summaryrefslogtreecommitdiffstats
path: root/languages/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'languages/cpp')
-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
1053 files changed, 101413 insertions, 0 deletions
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 für 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: Mårten 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]=Génère un simple programme de test avec la bibliothéque 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]=Génère un squelette de programme pour la gestion d'un service DCOP pour KDE et un programme d'accés au bibliothéque.
+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]=Génère un modèle 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]=Génère une application basée 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]=Génère 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]=Génère une application basée 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]=Génère un simple programme de test du type « Hello world » en utilisant la bibliothéque 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;