From 84da08d7b7fcda12c85caeb5a10b4903770a6f69 Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- COPYING-DOCS | 397 + Makefile.am.in | 11 + Makefile.cvs | 15 + README | 126 + atlantikdesigner/Makefile.am | 17 + atlantikdesigner/TODO | 15 + atlantikdesigner/atlantikdesigner.desktop | 170 + atlantikdesigner/atlantikdesignerui.rc | 24 + atlantikdesigner/configure.in.bot | 9 + atlantikdesigner/configure.in.in | 7 + atlantikdesigner/designer/Makefile.am | 10 + atlantikdesigner/designer/boardinfo.cpp | 186 + atlantikdesigner/designer/boardinfo.h | 74 + atlantikdesigner/designer/designer.cpp | 1099 + atlantikdesigner/designer/designer.h | 106 + atlantikdesigner/designer/editor.cpp | 938 + atlantikdesigner/designer/editor.h | 310 + atlantikdesigner/designer/group.cpp | 242 + atlantikdesigner/designer/group.h | 99 + atlantikdesigner/designer/main.cpp | 37 + atlantikdesigner/pics/Makefile.am | 1 + .../pics/hi16-app-atlantikdesigner.png | Bin 0 -> 785 bytes .../pics/hi32-app-atlantikdesigner.png | Bin 0 -> 1640 bytes configure.in.in | 4 + doc/Makefile.am | 5 + doc/kate-plugins/Makefile.am | 4 + doc/kate-plugins/configure_insertcommand.png | Bin 0 -> 23622 bytes doc/kate-plugins/filetemplates.docbook | 323 + doc/kate-plugins/htmltools.docbook | 84 + doc/kate-plugins/index.docbook | 131 + doc/kate-plugins/insertcommand.docbook | 150 + doc/kate-plugins/insertcommand.png | Bin 0 -> 6558 bytes doc/kate-plugins/openheader.docbook | 49 + doc/kate-plugins/textfilter.docbook | 50 + doc/kate-plugins/xmlcheck.docbook | 102 + doc/kate-plugins/xmltools.docbook | 186 + doc/kicker-applets/Makefile.am | 4 + doc/kicker-applets/index.docbook | 113 + doc/kicker-applets/kolourpicker.docbook | 56 + doc/kicker-applets/ktimemon.docbook | 429 + doc/konq-plugins/Makefile.am | 6 + doc/konq-plugins/babel/Makefile.am | 6 + doc/konq-plugins/babel/index.docbook | 95 + doc/konq-plugins/crashes/Makefile.am | 6 + doc/konq-plugins/crashes/index.docbook | 58 + doc/konq-plugins/dirfilter/Makefile.am | 6 + doc/konq-plugins/dirfilter/index.docbook | 61 + doc/konq-plugins/domtreeviewer/Makefile.am | 6 + doc/konq-plugins/domtreeviewer/index.docbook | 62 + doc/konq-plugins/fsview/Makefile.am | 6 + doc/konq-plugins/fsview/index.docbook | 182 + doc/konq-plugins/imgallery/Makefile.am | 6 + doc/konq-plugins/imgallery/folders.png | Bin 0 -> 26953 bytes doc/konq-plugins/imgallery/index.docbook | 207 + doc/konq-plugins/imgallery/look.png | Bin 0 -> 27791 bytes doc/konq-plugins/imgallery/thumbnails.png | Bin 0 -> 20725 bytes doc/konq-plugins/index.docbook | 158 + doc/konq-plugins/khtmlsettings/Makefile.am | 6 + doc/konq-plugins/khtmlsettings/index.docbook | 114 + doc/konq-plugins/kuick/Makefile.am | 6 + doc/konq-plugins/kuick/index.docbook | 116 + doc/konq-plugins/mediaplayer/Makefile.am | 6 + doc/konq-plugins/mediaplayer/index.docbook | 59 + doc/konq-plugins/uachanger/Makefile.am | 6 + doc/konq-plugins/uachanger/index.docbook | 102 + doc/konq-plugins/validators/Makefile.am | 6 + doc/konq-plugins/validators/index.docbook | 87 + doc/konq-plugins/webarchiver/Makefile.am | 6 + doc/konq-plugins/webarchiver/index.docbook | 62 + doc/ksig/Makefile.am | 2 + doc/ksig/index.docbook | 431 + doc/ksig/screenshot.png | Bin 0 -> 7692 bytes kaddressbook-plugins/Makefile.am | 1 + kaddressbook-plugins/configure.in.in | 7 + kaddressbook-plugins/xxports/Makefile.am | 1 + kaddressbook-plugins/xxports/gmx/Makefile.am | 18 + kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp | 346 + .../xxports/gmx/gmx_xxport.desktop | 109 + kaddressbook-plugins/xxports/gmx/gmx_xxport.h | 47 + kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc | 14 + .../xxports/kworldclock/Makefile.am | 17 + .../xxports/kworldclock/geo_xxport.cpp | 114 + .../xxports/kworldclock/geo_xxport.desktop | 112 + .../xxports/kworldclock/geo_xxport.h | 42 + .../xxports/kworldclock/geo_xxportui.rc | 11 + kate/Makefile.am | 5 + kate/cppsymbolviewer/Makefile.am | 17 + kate/cppsymbolviewer/cpp_parser.cpp | 335 + kate/cppsymbolviewer/katecppsymbolviewer.desktop | 115 + kate/cppsymbolviewer/plugin_katesymbolviewer.cpp | 337 + kate/cppsymbolviewer/plugin_katesymbolviewer.h | 300 + kate/cppsymbolviewer/tcl_parser.cpp | 150 + kate/cppsymbolviewer/testfile.c | 59 + kate/cppsymbolviewer/ui.rc | 9 + kate/filelistloader/Makefile.am | 34 + kate/filelistloader/katefll.desktop | 83 + kate/filelistloader/katefll_initplugin.cpp | 96 + kate/filelistloader/katefll_initplugin.desktop | 112 + kate/filelistloader/katefll_initplugin.h | 46 + kate/filelistloader/katefll_plugin.cpp | 241 + kate/filelistloader/katefll_plugin.desktop | 125 + kate/filelistloader/katefll_plugin.h | 67 + kate/filelistloader/ui.rc | 13 + kate/filetemplates/Makefile.am | 1 + kate/filetemplates/katefiletemplates.kateproject | 15 + kate/filetemplates/plugin/Makefile.am | 25 + kate/filetemplates/plugin/filetemplates.cpp | 1254 ++ kate/filetemplates/plugin/filetemplates.h | 258 + .../filetemplates/plugin/katefiletemplates.desktop | 113 + kate/filetemplates/plugin/katetemplate.xml | 87 + kate/filetemplates/plugin/ui.rc | 15 + kate/filetemplates/templates/Makefile.am | 5 + .../templates/cppgpl.cpp.katetemplate | 24 + .../filetemplates/templates/cppgpl.hh.katetemplate | 34 + .../templates/cpplgpl.cpp.katetemplate | 23 + .../templates/cpplgpl.hh.katetemplate | 32 + .../templates/docbookchapter.xml.katetemplate | 75 + kate/filetemplates/templates/html.katetemplate | 18 + .../templates/language.xml.katetemplate | 60 + kate/helloworld/Makefile.am | 18 + kate/helloworld/katehelloworld.desktop | 119 + kate/helloworld/plugin_katehelloworld.cpp | 66 + kate/helloworld/plugin_katehelloworld.h | 30 + kate/helloworld/ui.rc | 8 + kate/htmltools/Makefile.am | 21 + kate/htmltools/katehtmltools.desktop | 136 + kate/htmltools/plugin_katehtmltools.cpp | 161 + kate/htmltools/plugin_katehtmltools.h | 53 + kate/htmltools/ui.rc | 8 + kate/insertcommand/Makefile.am | 21 + kate/insertcommand/kateinsertcommand.desktop | 119 + kate/insertcommand/plugin_kateinsertcommand.cpp | 417 + kate/insertcommand/plugin_kateinsertcommand.h | 170 + kate/insertcommand/ui.rc | 8 + kate/kjswrapper/Makefile.am | 16 + kate/kjswrapper/bindings.cpp | 466 + kate/kjswrapper/bindings.h | 150 + kate/kjswrapper/plugin_katekjswrapper.cpp | 437 + kate/kjswrapper/plugin_katekjswrapper.h | 180 + kate/kjswrapper/samples/Makefile.am | 23 + .../samples/katekjsconsolewindow.desktop | 55 + kate/kjswrapper/samples/katekjsconsolewindow.js | 18 + kate/kjswrapper/samples/katekjsconsolewindow.rc | 8 + kate/kjswrapper/samples/katekjsselect.desktop | 53 + kate/kjswrapper/samples/katekjsselect.js | 92 + kate/kjswrapper/samples/katekjsselect.rc | 8 + kate/kjswrapper/samples/katekjstest1.desktop | 90 + kate/kjswrapper/samples/katekjstest1.js | 167 + kate/kpybrowser/Makefile.am | 18 + kate/kpybrowser/katepybrowse.desktop | 128 + kate/kpybrowser/kpybrowser.cpp | 397 + kate/kpybrowser/kpybrowser.desktop | 18 + kate/kpybrowser/kpybrowser.h | 69 + kate/kpybrowser/pybrowse.xpm | 495 + kate/kpybrowser/pybrowse_part.cpp | 157 + kate/kpybrowser/pybrowse_part.h | 72 + kate/kpybrowser/pybrowsenode.cpp | 209 + kate/kpybrowser/pybrowsenode.h | 68 + kate/kpybrowser/ui.rc | 8 + kate/make/Makefile.am | 21 + kate/make/katemake.desktop | 119 + kate/make/plugin_katemake.cpp | 736 + kate/make/plugin_katemake.h | 108 + kate/make/ui.rc | 12 + kate/modeline/Makefile.am | 21 + kate/modeline/ModelinePlugin.cpp | 125 + kate/modeline/ModelinePlugin.h | 40 + kate/modeline/katemodeline.desktop | 119 + kate/modeline/ui.rc | 8 + kate/openheader/Makefile.am | 21 + kate/openheader/kateopenheader.desktop | 112 + kate/openheader/plugin_kateopenheader.cpp | 117 + kate/openheader/plugin_kateopenheader.h | 50 + kate/openheader/ui.rc | 8 + kate/scripts/Makefile.am | 2 + kate/scripts/html-tidy.desktop | 77 + kate/scripts/html-tidy.sh | 64 + kate/snippets/CWidgetSnippetsBase.ui | 214 + kate/snippets/CWidgetSnippetsBase.ui.h | 28 + kate/snippets/Makefile.am | 17 + kate/snippets/csnippet.cpp | 17 + kate/snippets/csnippet.h | 39 + kate/snippets/cwidgetsnippets.cpp | 22 + kate/snippets/cwidgetsnippets.h | 26 + kate/snippets/katesnippets.desktop | 101 + kate/snippets/plugin_katesnippets.cpp | 321 + kate/snippets/plugin_katesnippets.h | 78 + kate/snippets/plugin_katesnippets.rc | 11 + kate/tabbarextension/Makefile.am | 17 + kate/tabbarextension/katetabbarextension.desktop | 109 + .../tabbarextension/plugin_katetabbarextension.cpp | 530 + kate/tabbarextension/plugin_katetabbarextension.h | 322 + kate/tabbarextension/ui.rc | 7 + kate/textfilter/Makefile.am | 21 + kate/textfilter/katetextfilter.desktop | 123 + kate/textfilter/plugin_katetextfilter.cpp | 336 + kate/textfilter/plugin_katetextfilter.h | 65 + kate/textfilter/ui.rc | 8 + kate/xmlcheck/Makefile.am | 21 + kate/xmlcheck/katexmlcheck.desktop | 122 + kate/xmlcheck/plugin_katexmlcheck.cpp | 353 + kate/xmlcheck/plugin_katexmlcheck.h | 87 + kate/xmlcheck/ui.rc | 8 + kate/xmltools/ChangeLog | 11 + kate/xmltools/Makefile.am | 30 + kate/xmltools/README | 43 + kate/xmltools/html4-loose.dtd.xml | 13498 ++++++++++++ kate/xmltools/html4-strict.dtd.xml | 11145 ++++++++++ kate/xmltools/katexmltools.desktop | 129 + kate/xmltools/kcfg.dtd.xml | 354 + kate/xmltools/kde-docbook.dtd.xml | 21489 +++++++++++++++++++ kate/xmltools/kpartgui.dtd.xml | 673 + kate/xmltools/language.dtd.xml | 960 + kate/xmltools/plugin_katexmltools.cpp | 1141 + kate/xmltools/plugin_katexmltools.h | 150 + kate/xmltools/pseudo_dtd.cpp | 466 + kate/xmltools/pseudo_dtd.h | 76 + kate/xmltools/simplify_dtd.xsl | 64 + kate/xmltools/testcases.xml | 73 + kate/xmltools/ui.rc | 10 + kate/xmltools/xhtml1-frameset.dtd.xml | 14043 ++++++++++++ kate/xmltools/xhtml1-strict.dtd.xml | 11629 ++++++++++ kate/xmltools/xhtml1-transitional.dtd.xml | 13983 ++++++++++++ kate/xmltools/xslt-1.0.dtd.xml | 1690 ++ kdeaddons.lsm | 11 + kfile-plugins/Makefile.am | 5 + kfile-plugins/RETURNED_ITEMS | 28 + kfile-plugins/cert/Makefile.am | 22 + kfile-plugins/cert/configure.in.in | 2 + kfile-plugins/cert/kfile_cert.cpp | 161 + kfile-plugins/cert/kfile_cert.desktop | 60 + kfile-plugins/cert/kfile_cert.h | 42 + kfile-plugins/desktop/Makefile.am | 22 + kfile-plugins/desktop/kfile_desktop.cpp | 128 + kfile-plugins/desktop/kfile_desktop.desktop | 68 + kfile-plugins/desktop/kfile_desktop.h | 39 + kfile-plugins/folder/Makefile.am | 21 + kfile-plugins/folder/kfile_folder.cpp | 86 + kfile-plugins/folder/kfile_folder.desktop | 70 + kfile-plugins/folder/kfile_folder.h | 37 + kfile-plugins/html/Makefile.am | 22 + kfile-plugins/html/kfile_html.cpp | 158 + kfile-plugins/html/kfile_html.desktop | 66 + kfile-plugins/html/kfile_html.h | 38 + kfile-plugins/lnk/Makefile.am | 34 + kfile-plugins/lnk/README | 29 + kfile-plugins/lnk/kfile_lnk.cpp | 93 + kfile-plugins/lnk/kfile_lnk.desktop | 62 + kfile-plugins/lnk/kfile_lnk.h | 46 + kfile-plugins/lnk/lnkforward.cpp | 130 + kfile-plugins/lnk/lnkforward.desktop | 114 + kfile-plugins/lnk/lnkforward.h | 42 + kfile-plugins/lnk/read_lnk.cpp | 227 + kfile-plugins/lnk/read_lnk.h | 46 + kfile-plugins/lnk/x-win-lnk.desktop | 61 + kfile-plugins/mhtml/Makefile.am | 21 + kfile-plugins/mhtml/kfile_mhtml.cpp | 201 + kfile-plugins/mhtml/kfile_mhtml.desktop | 60 + kfile-plugins/mhtml/kfile_mhtml.h | 45 + kfile-plugins/txt/Makefile.am | 21 + kfile-plugins/txt/kfile_txt.cpp | 129 + kfile-plugins/txt/kfile_txt.desktop | 70 + kfile-plugins/txt/kfile_txt.h | 39 + kicker-applets/Makefile.am | 2 + kicker-applets/kbinaryclock/Makefile.am | 22 + kicker-applets/kbinaryclock/datepicker.cpp | 51 + kicker-applets/kbinaryclock/datepicker.h | 42 + kicker-applets/kbinaryclock/kbinaryclock.cpp | 411 + kicker-applets/kbinaryclock/kbinaryclock.desktop | 108 + kicker-applets/kbinaryclock/kbinaryclock.h | 105 + kicker-applets/kbinaryclock/kbinaryclock.kcfg | 49 + kicker-applets/kbinaryclock/prefs.kcfgc | 7 + kicker-applets/kbinaryclock/settings.ui | 483 + kicker-applets/kolourpicker/Makefile.am | 23 + kicker-applets/kolourpicker/TODO | 1 + kicker-applets/kolourpicker/kolourpicker.cpp | 382 + kicker-applets/kolourpicker/kolourpicker.desktop | 145 + kicker-applets/kolourpicker/kolourpicker.h | 70 + kicker-applets/kolourpicker/simplebutton.cpp | 256 + kicker-applets/kolourpicker/simplebutton.h | 89 + kicker-applets/ktimemon/Makefile.am | 22 + kicker-applets/ktimemon/README | 65 + kicker-applets/ktimemon/TODO | 13 + kicker-applets/ktimemon/confdlg.cc | 295 + kicker-applets/ktimemon/confdlg.h | 99 + kicker-applets/ktimemon/configure.in.in | 3 + kicker-applets/ktimemon/cr16-app-ktimemon.png | Bin 0 -> 306 bytes kicker-applets/ktimemon/cr32-app-ktimemon.png | Bin 0 -> 345 bytes kicker-applets/ktimemon/ktimemon.desktop | 129 + kicker-applets/ktimemon/lo16-app-ktimemon.png | Bin 0 -> 306 bytes kicker-applets/ktimemon/lo32-app-ktimemon.png | Bin 0 -> 345 bytes kicker-applets/ktimemon/sample.cc | 508 + kicker-applets/ktimemon/sample.h | 94 + kicker-applets/ktimemon/timemon.cc | 435 + kicker-applets/ktimemon/timemon.h | 107 + kicker-applets/math/Makefile.am | 19 + kicker-applets/math/mathapplet.cpp | 285 + kicker-applets/math/mathapplet.desktop | 114 + kicker-applets/math/mathapplet.h | 74 + kicker-applets/math/parser.cpp | 813 + kicker-applets/math/parser.h | 241 + kicker-applets/mediacontrol/AUTHORS | 5 + kicker-applets/mediacontrol/Makefile.am | 28 + kicker-applets/mediacontrol/README | 28 + kicker-applets/mediacontrol/TODO | 7 + kicker-applets/mediacontrol/amarokInterface.cpp | 310 + kicker-applets/mediacontrol/amarokInterface.h | 69 + kicker-applets/mediacontrol/configfrontend.cpp | 99 + kicker-applets/mediacontrol/configfrontend.h | 52 + kicker-applets/mediacontrol/configure.in.in | 48 + kicker-applets/mediacontrol/jukInterface.cpp | 314 + kicker-applets/mediacontrol/jukInterface.h | 72 + kicker-applets/mediacontrol/kscdInterface.cpp | 332 + kicker-applets/mediacontrol/kscdInterface.h | 68 + kicker-applets/mediacontrol/mcslider.cpp | 66 + kicker-applets/mediacontrol/mcslider.h | 37 + kicker-applets/mediacontrol/mediacontrol.cpp | 614 + kicker-applets/mediacontrol/mediacontrol.desktop | 121 + kicker-applets/mediacontrol/mediacontrol.h | 122 + kicker-applets/mediacontrol/mediacontrolconfig.cpp | 197 + kicker-applets/mediacontrol/mediacontrolconfig.h | 54 + .../mediacontrol/mediacontrolconfigwidget.ui | 374 + kicker-applets/mediacontrol/mediacontroliface.h | 31 + kicker-applets/mediacontrol/mpdInterface.cpp | 585 + kicker-applets/mediacontrol/mpdInterface.h | 100 + kicker-applets/mediacontrol/noatunInterface.cpp | 283 + kicker-applets/mediacontrol/noatunInterface.h | 67 + kicker-applets/mediacontrol/pics/Makefile.am | 2 + .../mediacontrol/pics/blueish/Makefile.am | 4 + kicker-applets/mediacontrol/pics/blueish/next.png | Bin 0 -> 174 bytes kicker-applets/mediacontrol/pics/blueish/pause.png | Bin 0 -> 119 bytes kicker-applets/mediacontrol/pics/blueish/play.png | Bin 0 -> 160 bytes kicker-applets/mediacontrol/pics/blueish/prev.png | Bin 0 -> 173 bytes kicker-applets/mediacontrol/pics/blueish/stop.png | Bin 0 -> 115 bytes .../mediacontrol/pics/default/Makefile.am | 4 + kicker-applets/mediacontrol/pics/default/next.png | Bin 0 -> 392 bytes kicker-applets/mediacontrol/pics/default/pause.png | Bin 0 -> 345 bytes kicker-applets/mediacontrol/pics/default/play.png | Bin 0 -> 342 bytes kicker-applets/mediacontrol/pics/default/prev.png | Bin 0 -> 379 bytes kicker-applets/mediacontrol/pics/default/stop.png | Bin 0 -> 356 bytes .../mediacontrol/pics/fulldecent/Makefile.am | 4 + kicker-applets/mediacontrol/pics/fulldecent/README | 12 + .../mediacontrol/pics/fulldecent/next.png | Bin 0 -> 553 bytes .../mediacontrol/pics/fulldecent/pause.png | Bin 0 -> 423 bytes .../mediacontrol/pics/fulldecent/play.png | Bin 0 -> 546 bytes .../mediacontrol/pics/fulldecent/prev.png | Bin 0 -> 573 bytes .../mediacontrol/pics/fulldecent/source.xcf | Bin 0 -> 9566 bytes .../mediacontrol/pics/fulldecent/stop.png | Bin 0 -> 427 bytes kicker-applets/mediacontrol/playerInterface.cpp | 34 + kicker-applets/mediacontrol/playerInterface.h | 57 + kicker-applets/mediacontrol/simplebutton.cpp | 256 + kicker-applets/mediacontrol/simplebutton.h | 89 + kicker-applets/mediacontrol/xmmsInterface.cpp | 183 + kicker-applets/mediacontrol/xmmsInterface.h | 59 + knewsticker-scripts/GENERAL | 23 + knewsticker-scripts/Generic.Newsticker.Error | 134 + knewsticker-scripts/Makefile.am | 7 + knewsticker-scripts/README.kataribe | 44 + knewsticker-scripts/Readme.ErrorHandling | 19 + knewsticker-scripts/Readme.newsrss | 48 + knewsticker-scripts/Readme.stock | 36 + knewsticker-scripts/bbc.pl | 54 + knewsticker-scripts/fyensget.py | Bin 0 -> 3312 bytes knewsticker-scripts/kataribe.pl | 96 + knewsticker-scripts/newsrss.pl | 100 + knewsticker-scripts/sportscores.py | 241 + knewsticker-scripts/stock.pl | 276 + konq-plugins/Makefile.am | 6 + konq-plugins/README | 91 + konq-plugins/akregator/Makefile.am | 25 + .../akregator/akregator_konqfeedicon.desktop | 116 + konq-plugins/akregator/akregator_konqfeedicon.rc | 3 + .../akregator/akregator_konqplugin.desktop | 54 + konq-plugins/akregator/akregatorplugin.cpp | 135 + konq-plugins/akregator/akregatorplugin.h | 60 + konq-plugins/akregator/feeddetector.cpp | 147 + konq-plugins/akregator/feeddetector.h | 77 + konq-plugins/akregator/konqfeedicon.cpp | 222 + konq-plugins/akregator/konqfeedicon.h | 77 + konq-plugins/akregator/pluginbase.cpp | 102 + konq-plugins/akregator/pluginbase.h | 60 + konq-plugins/akregator/rss.png | Bin 0 -> 1158 bytes konq-plugins/akregator/rss.svgz | Bin 0 -> 2075 bytes konq-plugins/arkplugin/Makefile.am | 18 + konq-plugins/arkplugin/ark_plugin.desktop | 59 + konq-plugins/arkplugin/arkplugin.cpp | 566 + konq-plugins/arkplugin/arkplugin.desktop | 59 + konq-plugins/arkplugin/arkplugin.h | 72 + konq-plugins/autorefresh/Makefile.am | 21 + konq-plugins/autorefresh/autorefresh.cpp | 107 + konq-plugins/autorefresh/autorefresh.desktop | 120 + konq-plugins/autorefresh/autorefresh.h | 55 + konq-plugins/autorefresh/autorefresh.rc | 10 + konq-plugins/autorefresh/lo16-app-autorefresh.png | Bin 0 -> 258 bytes konq-plugins/babelfish/Makefile.am | 26 + konq-plugins/babelfish/cr16-action-babelfish.png | Bin 0 -> 790 bytes konq-plugins/babelfish/cr22-action-babelfish.png | Bin 0 -> 1356 bytes konq-plugins/babelfish/plugin_babelfish.cpp | 376 + konq-plugins/babelfish/plugin_babelfish.desktop | 126 + konq-plugins/babelfish/plugin_babelfish.h | 52 + konq-plugins/babelfish/plugin_babelfish.rc | 11 + konq-plugins/babelfish/translaterc | 15 + konq-plugins/crashes/Makefile.am | 16 + konq-plugins/crashes/crashesplugin.cpp | 193 + konq-plugins/crashes/crashesplugin.desktop | 124 + konq-plugins/crashes/crashesplugin.h | 70 + konq-plugins/crashes/crashesplugin.rc | 11 + konq-plugins/dirfilter/Makefile.am | 19 + konq-plugins/dirfilter/dirfilterplugin.cpp | 492 + konq-plugins/dirfilter/dirfilterplugin.desktop | 125 + konq-plugins/dirfilter/dirfilterplugin.h | 132 + konq-plugins/dirfilter/dirfilterplugin.rc | 13 + konq-plugins/domtreeviewer/Makefile.am | 44 + konq-plugins/domtreeviewer/attributeeditdialog.ui | 174 + .../domtreeviewer/cr16-action-domtreeviewer.png | Bin 0 -> 932 bytes .../domtreeviewer/cr22-action-domtreeviewer.png | Bin 0 -> 1359 bytes konq-plugins/domtreeviewer/domlistviewitem.cpp | 73 + konq-plugins/domtreeviewer/domlistviewitem.h | 57 + konq-plugins/domtreeviewer/domtreecommands.cpp | 562 + konq-plugins/domtreeviewer/domtreecommands.h | 375 + konq-plugins/domtreeviewer/domtreeview.cpp | 1226 ++ konq-plugins/domtreeviewer/domtreeview.h | 203 + konq-plugins/domtreeviewer/domtreeviewbase.ui | 525 + konq-plugins/domtreeviewer/domtreeviewerui.rc | 45 + konq-plugins/domtreeviewer/domtreewindow.cpp | 379 + konq-plugins/domtreeviewer/domtreewindow.h | 194 + konq-plugins/domtreeviewer/elementeditdialog.ui | 201 + konq-plugins/domtreeviewer/messagedialog.ui | 117 + konq-plugins/domtreeviewer/messagedialog.ui.h | 20 + .../domtreeviewer/plugin_domtreeviewer.cpp | 56 + .../domtreeviewer/plugin_domtreeviewer.desktop | 128 + konq-plugins/domtreeviewer/plugin_domtreeviewer.h | 27 + konq-plugins/domtreeviewer/plugin_domtreeviewer.rc | 11 + konq-plugins/domtreeviewer/signalreceiver.cpp | 37 + konq-plugins/domtreeviewer/signalreceiver.h | 67 + konq-plugins/domtreeviewer/texteditdialog.ui | 149 + konq-plugins/fsview/Makefile.am | 51 + konq-plugins/fsview/README | 29 + konq-plugins/fsview/fsview.cpp | 540 + konq-plugins/fsview/fsview.desktop | 120 + konq-plugins/fsview/fsview.h | 136 + konq-plugins/fsview/fsview_part.cpp | 413 + konq-plugins/fsview/fsview_part.desktop | 58 + konq-plugins/fsview/fsview_part.h | 122 + konq-plugins/fsview/fsview_part.rc | 15 + konq-plugins/fsview/hi22-app-fsview.png | Bin 0 -> 834 bytes konq-plugins/fsview/hi32-app-fsview.png | Bin 0 -> 902 bytes konq-plugins/fsview/inode.cpp | 385 + konq-plugins/fsview/inode.h | 97 + konq-plugins/fsview/main.cpp | 56 + konq-plugins/fsview/scan.cpp | 362 + konq-plugins/fsview/scan.h | 230 + konq-plugins/fsview/scantest.cpp | 56 + konq-plugins/fsview/treemap.cpp | 3199 +++ konq-plugins/fsview/treemap.h | 742 + konq-plugins/imagerotation/Makefile.am | 7 + konq-plugins/imagerotation/exif.py | 1079 + konq-plugins/imagerotation/imageconverter.desktop | 83 + konq-plugins/imagerotation/jpegorient | 89 + konq-plugins/imagerotation/jpegorient.desktop | 307 + konq-plugins/imagerotation/orient.py | 104 + konq-plugins/khtmlsettingsplugin/Makefile.am | 18 + .../khtmlsettingsplugin.desktop | 136 + .../khtmlsettingsplugin/khtmlsettingsplugin.lsm | 18 + .../khtmlsettingsplugin/khtmlsettingsplugin.rc | 11 + .../khtmlsettingsplugin/settingsplugin.cpp | 328 + konq-plugins/khtmlsettingsplugin/settingsplugin.h | 56 + konq-plugins/kimgalleryplugin/Makefile.am | 21 + .../kimgalleryplugin/cr16-action-imagegallery.png | Bin 0 -> 878 bytes .../kimgalleryplugin/cr22-action-imagegallery.png | Bin 0 -> 1443 bytes konq-plugins/kimgalleryplugin/imgallerydialog.cpp | 455 + konq-plugins/kimgalleryplugin/imgallerydialog.h | 113 + konq-plugins/kimgalleryplugin/imgalleryplugin.cpp | 499 + konq-plugins/kimgalleryplugin/imgalleryplugin.h | 80 + .../kimgalleryplugin/kimgalleryplugin.desktop | 129 + konq-plugins/kimgalleryplugin/kimgalleryplugin.rc | 8 + konq-plugins/kuick/Makefile.am | 26 + konq-plugins/kuick/kcmkuick/Makefile.am | 17 + konq-plugins/kuick/kcmkuick/kcmkuick.cpp | 155 + konq-plugins/kuick/kcmkuick/kcmkuick.desktop | 202 + konq-plugins/kuick/kcmkuick/kcmkuick.h | 46 + konq-plugins/kuick/kcmkuick/kcmkuickdialog.ui | 197 + konq-plugins/kuick/kdirmenu.cpp | 169 + konq-plugins/kuick/kdirmenu.h | 61 + konq-plugins/kuick/kimcontactmenu.cpp | 82 + konq-plugins/kuick/kimcontactmenu.h | 54 + konq-plugins/kuick/kmetamenu.cpp | 180 + konq-plugins/kuick/kmetamenu.h | 67 + konq-plugins/kuick/kuick_plugin.cpp | 114 + konq-plugins/kuick/kuick_plugin.desktop | 67 + konq-plugins/kuick/kuick_plugin.h | 54 + konq-plugins/kuick/kuickplugin.desktop | 66 + konq-plugins/mediarealfolder/Makefile.am | 5 + konq-plugins/mediarealfolder/kio_media_realfolder | 20 + .../mediarealfolder/media_realfolder.desktop | 55 + konq-plugins/microformat/Makefile.am | 19 + konq-plugins/microformat/README | 14 + konq-plugins/microformat/hcard.png | Bin 0 -> 304 bytes konq-plugins/microformat/konqmficon.cpp | 323 + konq-plugins/microformat/konqmficon.h | 70 + konq-plugins/microformat/mf_konqmficon.desktop | 110 + konq-plugins/microformat/mf_konqmficon.rc | 3 + konq-plugins/microformat/microformat.png | Bin 0 -> 1046 bytes konq-plugins/microformat/microformat.svgz | Bin 0 -> 1258 bytes konq-plugins/microformat/pluginbase.cpp | 43 + konq-plugins/microformat/pluginbase.h | 38 + konq-plugins/minitools/Makefile.am | 14 + konq-plugins/minitools/cr16-action-minitools.png | Bin 0 -> 690 bytes konq-plugins/minitools/cr22-action-minitools.png | Bin 0 -> 996 bytes konq-plugins/minitools/cr32-action-minitools.png | Bin 0 -> 1454 bytes konq-plugins/minitools/cr48-action-minitools.png | Bin 0 -> 2272 bytes konq-plugins/minitools/minitoolsplugin.cpp | 156 + konq-plugins/minitools/minitoolsplugin.desktop | 121 + konq-plugins/minitools/minitoolsplugin.h | 66 + konq-plugins/minitools/minitoolsplugin.rc | 11 + konq-plugins/rellinks/AUTHORS | 3 + konq-plugins/rellinks/ChangeLog | 31 + konq-plugins/rellinks/Makefile.am | 12 + konq-plugins/rellinks/README | 13 + konq-plugins/rellinks/TODO | 20 + konq-plugins/rellinks/plugin_rellinks.cpp | 618 + konq-plugins/rellinks/plugin_rellinks.desktop | 120 + konq-plugins/rellinks/plugin_rellinks.h | 170 + konq-plugins/rellinks/plugin_rellinks.rc | 38 + konq-plugins/rellinks/rellinks.kdevelop | 157 + konq-plugins/rellinks/rellinks.lsm | 16 + konq-plugins/searchbar/Makefile.am | 21 + konq-plugins/searchbar/icons/Makefile.am | 3 + .../searchbar/icons/cr16-action-google.png | Bin 0 -> 820 bytes konq-plugins/searchbar/searchbar.cpp | 556 + konq-plugins/searchbar/searchbar.desktop | 121 + konq-plugins/searchbar/searchbar.h | 168 + konq-plugins/searchbar/searchbar.lsm | 13 + konq-plugins/searchbar/searchbar.rc | 6 + konq-plugins/sidebar/Makefile.am | 5 + konq-plugins/sidebar/delicious/Makefile.am | 22 + .../sidebar/delicious/bookmarkListItem.cpp | 72 + konq-plugins/sidebar/delicious/bookmarkListItem.h | 51 + .../sidebar/delicious/delicious_add.desktop | 57 + konq-plugins/sidebar/delicious/mainWidget.cpp | 354 + konq-plugins/sidebar/delicious/mainWidget.h | 175 + konq-plugins/sidebar/delicious/pics/Makefile.am | 1 + .../pics/cr16-app-konqsidebar_delicious.png | Bin 0 -> 128 bytes konq-plugins/sidebar/delicious/plugin.cpp | 108 + konq-plugins/sidebar/delicious/plugin.h | 85 + konq-plugins/sidebar/delicious/tagListItem.cpp | 78 + konq-plugins/sidebar/delicious/tagListItem.h | 50 + konq-plugins/sidebar/delicious/widget.ui | 165 + konq-plugins/sidebar/mediaplayer/AUTHORS | 13 + konq-plugins/sidebar/mediaplayer/COPYING | 12 + konq-plugins/sidebar/mediaplayer/Makefile.am | 33 + konq-plugins/sidebar/mediaplayer/controls.cpp | 138 + konq-plugins/sidebar/mediaplayer/controls.h | 93 + konq-plugins/sidebar/mediaplayer/engine.cpp | 207 + konq-plugins/sidebar/mediaplayer/engine.h | 97 + konq-plugins/sidebar/mediaplayer/mediaplayer.cpp | 74 + konq-plugins/sidebar/mediaplayer/mediaplayer.h | 43 + .../sidebar/mediaplayer/mediaplayerplugin.desktop | 115 + konq-plugins/sidebar/mediaplayer/mediawidget.cpp | 169 + konq-plugins/sidebar/mediaplayer/mediawidget.h | 57 + .../sidebar/mediaplayer/mediawidget_skel.ui | 340 + .../mediaplayer/mediawidget_skel_designer.ui | 340 + .../sidebar/mediaplayer/mplayer_add.desktop | 61 + konq-plugins/sidebar/mediaplayer/pics/Makefile.am | 1 + .../pics/cr16-app-konqsidebar_mediaplayer.png | Bin 0 -> 897 bytes .../pics/cr22-app-konqsidebar_mediaplayer.png | Bin 0 -> 1319 bytes .../pics/cr32-app-konqsidebar_mediaplayer.png | Bin 0 -> 2070 bytes .../pics/cr48-app-konqsidebar_mediaplayer.png | Bin 0 -> 4411 bytes .../pics/lo32-app-konqsidebar_mediaplayer.png | Bin 0 -> 467 bytes konq-plugins/sidebar/mediaplayer/player.cpp | 180 + konq-plugins/sidebar/mediaplayer/player.h | 178 + konq-plugins/sidebar/metabar/AUTHORS | 1 + konq-plugins/sidebar/metabar/COPYING | 340 + konq-plugins/sidebar/metabar/ChangeLog | 0 konq-plugins/sidebar/metabar/Doxyfile | 275 + konq-plugins/sidebar/metabar/INSTALL | 167 + konq-plugins/sidebar/metabar/Makefile.am | 1 + konq-plugins/sidebar/metabar/NEWS | 0 konq-plugins/sidebar/metabar/README | 0 konq-plugins/sidebar/metabar/TODO | 0 konq-plugins/sidebar/metabar/config.h.in | 244 + konq-plugins/sidebar/metabar/configure.in.in | 5 + konq-plugins/sidebar/metabar/metabar.kdevelop | 213 + konq-plugins/sidebar/metabar/metabar.kdevses | 47 + konq-plugins/sidebar/metabar/src/Makefile.am | 28 + konq-plugins/sidebar/metabar/src/configdialog.cpp | 611 + konq-plugins/sidebar/metabar/src/configdialog.h | 114 + konq-plugins/sidebar/metabar/src/default.css | 64 + konq-plugins/sidebar/metabar/src/defaultplugin.cpp | 458 + konq-plugins/sidebar/metabar/src/defaultplugin.h | 64 + .../sidebar/metabar/src/hi128-app-metabar.png | Bin 0 -> 11139 bytes .../sidebar/metabar/src/hi16-app-metabar.png | Bin 0 -> 735 bytes .../sidebar/metabar/src/hi32-app-metabar.png | Bin 0 -> 1710 bytes .../sidebar/metabar/src/hi48-app-metabar.png | Bin 0 -> 2912 bytes .../sidebar/metabar/src/hi64-app-metabar.png | Bin 0 -> 4318 bytes .../sidebar/metabar/src/hisc-app-metabar.svgz | Bin 0 -> 5341 bytes konq-plugins/sidebar/metabar/src/httpplugin.cpp | 119 + konq-plugins/sidebar/metabar/src/httpplugin.h | 51 + konq-plugins/sidebar/metabar/src/iconsrc | 4 + konq-plugins/sidebar/metabar/src/layout.html | 48 + konq-plugins/sidebar/metabar/src/metabar.cpp | 59 + konq-plugins/sidebar/metabar/src/metabar.desktop | 81 + konq-plugins/sidebar/metabar/src/metabar.h | 32 + .../sidebar/metabar/src/metabar_add.desktop | 70 + .../sidebar/metabar/src/metabarfunctions.cpp | 242 + .../sidebar/metabar/src/metabarfunctions.h | 59 + konq-plugins/sidebar/metabar/src/metabarwidget.cpp | 592 + konq-plugins/sidebar/metabar/src/metabarwidget.h | 88 + .../sidebar/metabar/src/protocolplugin.cpp | 157 + konq-plugins/sidebar/metabar/src/protocolplugin.h | 60 + konq-plugins/sidebar/metabar/src/remoteplugin.cpp | 52 + konq-plugins/sidebar/metabar/src/remoteplugin.h | 37 + konq-plugins/sidebar/metabar/src/serviceloader.cpp | 213 + konq-plugins/sidebar/metabar/src/serviceloader.h | 59 + .../sidebar/metabar/src/settingsplugin.cpp | 201 + konq-plugins/sidebar/metabar/src/settingsplugin.h | 56 + konq-plugins/sidebar/metabar/stamp-h.in | 0 konq-plugins/sidebar/newsticker/Makefile.am | 36 + konq-plugins/sidebar/newsticker/README | 38 + konq-plugins/sidebar/newsticker/configfeeds.cpp | 38 + konq-plugins/sidebar/newsticker/configfeeds.h | 53 + konq-plugins/sidebar/newsticker/configfeedsbase.ui | 26 + .../sidebar/newsticker/konq_sidebarnews.kcfg | 15 + konq-plugins/sidebar/newsticker/news_add.desktop | 44 + konq-plugins/sidebar/newsticker/norsswidget.cpp | 100 + konq-plugins/sidebar/newsticker/norsswidget.h | 51 + konq-plugins/sidebar/newsticker/nspanel.cpp | 181 + konq-plugins/sidebar/newsticker/nspanel.h | 109 + .../sidebar/newsticker/nsstacktabwidget.cpp | 365 + konq-plugins/sidebar/newsticker/nsstacktabwidget.h | 91 + konq-plugins/sidebar/newsticker/pics/LICENSE | 16 + konq-plugins/sidebar/newsticker/pics/Makefile.am | 1 + .../newsticker/pics/cr16-app-konqsidebar_news.png | Bin 0 -> 759 bytes .../sidebar/newsticker/pics/livemark-item.png | Bin 0 -> 3449 bytes konq-plugins/sidebar/newsticker/sidebar_news.cpp | 279 + konq-plugins/sidebar/newsticker/sidebar_news.h | 89 + .../sidebar/newsticker/sidebarsettings.kcfgc | 5 + konq-plugins/smbmounter/Readme | 19 + konq-plugins/uachanger/Makefile.am | 17 + konq-plugins/uachanger/uachangerplugin.cpp | 436 + konq-plugins/uachanger/uachangerplugin.desktop | 121 + konq-plugins/uachanger/uachangerplugin.h | 95 + konq-plugins/uachanger/uachangerplugin.rc | 11 + konq-plugins/uninstall.desktop | 2 + konq-plugins/validators/Makefile.am | 24 + .../validators/cr16-action-cssvalidator.png | Bin 0 -> 746 bytes .../validators/cr16-action-htmlvalidator.png | Bin 0 -> 631 bytes konq-plugins/validators/cr16-action-validators.png | Bin 0 -> 631 bytes .../validators/cr22-action-cssvalidator.png | Bin 0 -> 1125 bytes .../validators/cr22-action-htmlvalidator.png | Bin 0 -> 999 bytes konq-plugins/validators/cr22-action-validators.png | Bin 0 -> 999 bytes konq-plugins/validators/plugin_validators.cpp | 202 + konq-plugins/validators/plugin_validators.desktop | 128 + konq-plugins/validators/plugin_validators.h | 72 + konq-plugins/validators/plugin_validators.rc | 11 + konq-plugins/validators/validatorsdialog.cpp | 176 + konq-plugins/validators/validatorsdialog.h | 58 + konq-plugins/webarchiver/Makefile.am | 32 + konq-plugins/webarchiver/archivedialog.cpp | 565 + konq-plugins/webarchiver/archivedialog.h | 82 + konq-plugins/webarchiver/archiveviewbase.ui | 128 + .../webarchiver/cr16-action-webarchiver.png | Bin 0 -> 919 bytes .../webarchiver/cr22-action-webarchiver.png | Bin 0 -> 1419 bytes konq-plugins/webarchiver/plugin_webarchiver.cpp | 116 + .../webarchiver/plugin_webarchiver.desktop | 130 + konq-plugins/webarchiver/plugin_webarchiver.h | 42 + konq-plugins/webarchiver/plugin_webarchiver.rc | 11 + konq-plugins/webarchiver/webarchivecreator.cpp | 117 + konq-plugins/webarchiver/webarchivecreator.h | 51 + .../webarchiver/webarchivethumbnail.desktop | 76 + ksig/Makefile.am | 20 + ksig/hi16-app-ksig.png | Bin 0 -> 751 bytes ksig/hi32-app-ksig.png | Bin 0 -> 1731 bytes ksig/ksig.cpp | 273 + ksig/ksig.desktop | 72 + ksig/ksig.h | 75 + ksig/ksig.spec | 45 + ksig/ksigui.rc | 26 + ksig/main.cpp | 69 + ksig/siggenerator.cpp | 87 + ksig/siggenerator.h | 43 + ksig/siglistview.cpp | 124 + ksig/siglistview.h | 71 + ksig/siglistviewitem.cpp | 108 + ksig/siglistviewitem.h | 57 + ksig/standardtext.cpp | 51 + ksig/standardtext.h | 39 + ksig/standardtextbase.ui | 119 + noatun-plugins/Makefile.am | 18 + noatun-plugins/alarm/Makefile.am | 21 + noatun-plugins/alarm/kminutespinbox.cpp | 41 + noatun-plugins/alarm/kminutespinbox.h | 38 + noatun-plugins/alarm/kpercentspinbox.cpp | 38 + noatun-plugins/alarm/kpercentspinbox.h | 33 + noatun-plugins/alarm/wakeup.cpp | 373 + noatun-plugins/alarm/wakeup.h | 103 + noatun-plugins/alarm/wakeup.plugin | 115 + noatun-plugins/alsaplayer/AlsaPlayer.ui | 2640 +++ noatun-plugins/alsaplayer/Custom.cw | 20 + noatun-plugins/alsaplayer/Makefile.am | 24 + noatun-plugins/alsaplayer/alsaplayerui.cpp | 35 + noatun-plugins/alsaplayer/alsaplayerui.plugin | 84 + noatun-plugins/alsaplayer/configmodule.cpp | 72 + noatun-plugins/alsaplayer/configmodule.h | 53 + noatun-plugins/alsaplayer/seeker.cpp | 61 + noatun-plugins/alsaplayer/seeker.h | 50 + noatun-plugins/alsaplayer/userinterface.cpp | 339 + noatun-plugins/alsaplayer/userinterface.h | 91 + noatun-plugins/blurscope/Makefile.am | 10 + noatun-plugins/blurscope/blurscope.plugin | 74 + noatun-plugins/blurscope/scopedisplayer.cpp | 291 + noatun-plugins/blurscope/sdlscope.cpp | 78 + noatun-plugins/blurscope/sdlscope.h | 110 + noatun-plugins/charlatan/Makefile.am | 23 + noatun-plugins/charlatan/charlatanui.cpp | 35 + noatun-plugins/charlatan/charlatanui.plugin | 77 + noatun-plugins/charlatan/configmodule.cpp | 71 + noatun-plugins/charlatan/configmodule.h | 53 + noatun-plugins/charlatan/pixmaps.h | 612 + noatun-plugins/charlatan/seeker.cpp | 104 + noatun-plugins/charlatan/seeker.h | 58 + noatun-plugins/charlatan/userinterface.cpp | 408 + noatun-plugins/charlatan/userinterface.h | 99 + noatun-plugins/configure.in.bot | 10 + noatun-plugins/configure.in.in | 203 + noatun-plugins/dub/AUTHORS | 1 + noatun-plugins/dub/BUGS | 8 + noatun-plugins/dub/COPYING | 340 + noatun-plugins/dub/ChangeLog | 38 + noatun-plugins/dub/INSTALL | 167 + noatun-plugins/dub/Makefile.am | 11 + noatun-plugins/dub/NEWS | 35 + noatun-plugins/dub/README | 22 + noatun-plugins/dub/TODO | 20 + noatun-plugins/dub/configure.in.in | 4 + noatun-plugins/dub/design.txt | 43 + noatun-plugins/dub/dub.kdevprj | 198 + noatun-plugins/dub/dub/Makefile.am | 20 + noatun-plugins/dub/dub/dub.cpp | 641 + noatun-plugins/dub/dub/dub.h | 207 + noatun-plugins/dub/dub/dub.plugin | 69 + noatun-plugins/dub/dub/dubapp.cpp | 98 + noatun-plugins/dub/dub/dubapp.h | 83 + noatun-plugins/dub/dub/dubconfigmodule.cpp | 125 + noatun-plugins/dub/dub/dubconfigmodule.h | 40 + noatun-plugins/dub/dub/dubplaylist.cpp | 158 + noatun-plugins/dub/dub/dubplaylist.h | 77 + noatun-plugins/dub/dub/dubplaylistitem.cpp | 83 + noatun-plugins/dub/dub/dubplaylistitem.h | 55 + noatun-plugins/dub/dub/dubprefs.ui | 187 + noatun-plugins/dub/dub/dubui.rc | 8 + noatun-plugins/dub/dub/dubview.cpp | 63 + noatun-plugins/dub/dub/dubview.h | 52 + noatun-plugins/dub/dub/fileselectorwidget.cpp | 183 + noatun-plugins/dub/dub/fileselectorwidget.h | 74 + noatun-plugins/dub/dub/random.h | 43 + noatun-plugins/dub/dub/templates/cpp_template | 15 + noatun-plugins/dub/dub/templates/header_template | 21 + noatun-plugins/ffrs/Makefile.am | 17 + noatun-plugins/ffrs/ffrs.cpp | 305 + noatun-plugins/ffrs/ffrs.h | 80 + noatun-plugins/ffrs/ffrs.plugin | 108 + noatun-plugins/luckytag/Makefile.am | 11 + noatun-plugins/luckytag/luckytag.cpp | 49 + noatun-plugins/luckytag/luckytag.h | 35 + noatun-plugins/luckytag/luckytag.plugin | 121 + noatun-plugins/luckytag/parsedmp3filename.cpp | 98 + noatun-plugins/luckytag/parsedmp3filename.h | 49 + noatun-plugins/lyrics/Makefile.am | 17 + noatun-plugins/lyrics/TODO | 17 + noatun-plugins/lyrics/cmodule.cpp | 218 + noatun-plugins/lyrics/cmodule.h | 43 + noatun-plugins/lyrics/historymanager.cpp | 56 + noatun-plugins/lyrics/historymanager.h | 28 + noatun-plugins/lyrics/lyrics.cpp | 268 + noatun-plugins/lyrics/lyrics.h | 55 + noatun-plugins/lyrics/lyrics.plugin | 117 + noatun-plugins/lyrics/lyricsui.rc | 24 + noatun-plugins/nexscope/Makefile.am | 22 + noatun-plugins/nexscope/bitmappool.cpp | 54 + noatun-plugins/nexscope/convolve.c | 297 + noatun-plugins/nexscope/convolve.h | 61 + noatun-plugins/nexscope/gui.cpp | 197 + noatun-plugins/nexscope/gui.h | 54 + noatun-plugins/nexscope/input.cpp | 238 + noatun-plugins/nexscope/nex.cpp | 597 + noatun-plugins/nexscope/nex.h | 352 + noatun-plugins/nexscope/nexscope.plugin | 72 + noatun-plugins/nexscope/noatunplugin.cpp | 49 + noatun-plugins/nexscope/noatunplugin.h | 25 + noatun-plugins/nexscope/output.cpp | 48 + noatun-plugins/nexscope/regionwidget.cpp | 77 + noatun-plugins/nexscope/regionwidget.h | 47 + noatun-plugins/nexscope/renderers.cpp | 369 + noatun-plugins/nexscope/renderers.h | 34 + noatun-plugins/noatunmadness/Makefile.am | 10 + noatun-plugins/noatunmadness/madness.cpp | 123 + noatun-plugins/noatunmadness/madness.h | 32 + noatun-plugins/noatunmadness/madness.plugin | 105 + noatun-plugins/oblique/COPYING | 35 + noatun-plugins/oblique/Makefile.am | 18 + noatun-plugins/oblique/base.cpp | 435 + noatun-plugins/oblique/base.h | 105 + noatun-plugins/oblique/cmodule.cpp | 663 + noatun-plugins/oblique/cmodule.h | 123 + noatun-plugins/oblique/configure.in.in | 30 + noatun-plugins/oblique/file.cpp | 248 + noatun-plugins/oblique/file.h | 115 + noatun-plugins/oblique/kbuffer.cpp | 87 + noatun-plugins/oblique/kbuffer.h | 48 + noatun-plugins/oblique/kdatacollection.cpp | 143 + noatun-plugins/oblique/kdatacollection.h | 144 + noatun-plugins/oblique/kdbt.h | 59 + noatun-plugins/oblique/menu.cpp | 231 + noatun-plugins/oblique/menu.h | 99 + noatun-plugins/oblique/oblique.cpp | 325 + noatun-plugins/oblique/oblique.h | 142 + noatun-plugins/oblique/oblique.plugin | 73 + noatun-plugins/oblique/obliqueui.rc | 31 + noatun-plugins/oblique/query.cpp | 570 + noatun-plugins/oblique/query.h | 176 + noatun-plugins/oblique/schemas/Makefile.am | 3 + noatun-plugins/oblique/schemas/obliqueschema.dtd | 14 + noatun-plugins/oblique/schemas/standard | 80 + noatun-plugins/oblique/selector.cpp | 226 + noatun-plugins/oblique/selector.h | 76 + noatun-plugins/oblique/tree.cpp | 812 + noatun-plugins/oblique/tree.h | 194 + noatun-plugins/oblique/view.cpp | 251 + noatun-plugins/oblique/view.h | 71 + noatun-plugins/pitchablespeed/Makefile.am | 15 + noatun-plugins/pitchablespeed/pitchablespeed.cpp | 167 + noatun-plugins/pitchablespeed/pitchablespeed.h | 63 + .../pitchablespeed/pitchablespeed.plugin | 113 + noatun-plugins/pitchablespeed/speedtuner.ui | 195 + noatun-plugins/synaescope/Makefile.am | 23 + noatun-plugins/synaescope/cmodule.cpp | 88 + noatun-plugins/synaescope/cmodule.h | 49 + noatun-plugins/synaescope/core.cpp | 432 + noatun-plugins/synaescope/cr16-app-synaescope.png | Bin 0 -> 762 bytes noatun-plugins/synaescope/font.h | 258 + noatun-plugins/synaescope/icons.h | 4868 +++++ noatun-plugins/synaescope/main.cpp | 196 + noatun-plugins/synaescope/polygon.h | 106 + noatun-plugins/synaescope/sdlwrap.cpp | 207 + noatun-plugins/synaescope/symbol.h | 1021 + noatun-plugins/synaescope/syna.h | 253 + noatun-plugins/synaescope/synaescope.cpp | 110 + noatun-plugins/synaescope/synaescope.h | 41 + noatun-plugins/synaescope/synaescope.plugin | 80 + noatun-plugins/synaescope/ui.cpp | 609 + noatun-plugins/tippercanoe/Makefile.am | 21 + noatun-plugins/tippercanoe/core.cpp | 425 + noatun-plugins/tippercanoe/font.h | 258 + noatun-plugins/tippercanoe/icons.h | 4847 +++++ noatun-plugins/tippercanoe/main.cpp | 170 + noatun-plugins/tippercanoe/polygon.h | 98 + noatun-plugins/tippercanoe/sdlwrap.cpp | 197 + noatun-plugins/tippercanoe/symbol.h | 1021 + noatun-plugins/tippercanoe/syna.h | 247 + noatun-plugins/tippercanoe/synaescope.cpp | 103 + noatun-plugins/tippercanoe/synaescope.h | 46 + noatun-plugins/tippercanoe/tippecanoe.plugin | 72 + noatun-plugins/tippercanoe/ui.cpp | 507 + noatun-plugins/tyler/AUTHORS | 8 + noatun-plugins/tyler/COPYING | 340 + noatun-plugins/tyler/Makefile.am | 21 + noatun-plugins/tyler/README | 89 + noatun-plugins/tyler/README.Infinity | 89 + noatun-plugins/tyler/compute.c | 188 + noatun-plugins/tyler/compute.h | 23 + noatun-plugins/tyler/display.c | 481 + noatun-plugins/tyler/display.h | 40 + noatun-plugins/tyler/file.cpp | 81 + noatun-plugins/tyler/file.h | 31 + noatun-plugins/tyler/main.cpp | 100 + noatun-plugins/tyler/main.h | 30 + noatun-plugins/tyler/renderer.c | 195 + noatun-plugins/tyler/renderer.h | 69 + noatun-plugins/tyler/tyler.cpp | 72 + noatun-plugins/tyler/tyler.h | 34 + noatun-plugins/tyler/tyler.plugin | 70 + noatun-plugins/tyler/tylerstates | Bin 0 -> 928 bytes noatun-plugins/wavecapture/Makefile.am | 18 + noatun-plugins/wavecapture/wavecapture.cpp | 197 + noatun-plugins/wavecapture/wavecapture.h | 72 + noatun-plugins/wavecapture/wavecapture.plugin | 112 + renamedlgplugins/Makefile.am | 3 + renamedlgplugins/README | 7 + renamedlgplugins/audio/Makefile.am | 16 + renamedlgplugins/audio/TODO | 9 + renamedlgplugins/audio/audio_plugin.cpp | 104 + renamedlgplugins/audio/audiopreview.cpp | 135 + renamedlgplugins/audio/audiopreview.h | 75 + renamedlgplugins/audio/renaudiodlg.desktop | 63 + renamedlgplugins/images/Makefile.am | 21 + renamedlgplugins/images/image_plugin.cpp | 85 + renamedlgplugins/images/imagevisualizer.cpp | 83 + renamedlgplugins/images/imagevisualizer.h | 66 + renamedlgplugins/images/renimagedlg.desktop | 66 + 900 files changed, 205018 insertions(+) create mode 100644 COPYING-DOCS create mode 100644 Makefile.am.in create mode 100644 Makefile.cvs create mode 100644 README create mode 100644 atlantikdesigner/Makefile.am create mode 100644 atlantikdesigner/TODO create mode 100644 atlantikdesigner/atlantikdesigner.desktop create mode 100644 atlantikdesigner/atlantikdesignerui.rc create mode 100644 atlantikdesigner/configure.in.bot create mode 100644 atlantikdesigner/configure.in.in create mode 100644 atlantikdesigner/designer/Makefile.am create mode 100644 atlantikdesigner/designer/boardinfo.cpp create mode 100644 atlantikdesigner/designer/boardinfo.h create mode 100644 atlantikdesigner/designer/designer.cpp create mode 100644 atlantikdesigner/designer/designer.h create mode 100644 atlantikdesigner/designer/editor.cpp create mode 100644 atlantikdesigner/designer/editor.h create mode 100644 atlantikdesigner/designer/group.cpp create mode 100644 atlantikdesigner/designer/group.h create mode 100644 atlantikdesigner/designer/main.cpp create mode 100644 atlantikdesigner/pics/Makefile.am create mode 100644 atlantikdesigner/pics/hi16-app-atlantikdesigner.png create mode 100644 atlantikdesigner/pics/hi32-app-atlantikdesigner.png create mode 100644 configure.in.in create mode 100644 doc/Makefile.am create mode 100644 doc/kate-plugins/Makefile.am create mode 100644 doc/kate-plugins/configure_insertcommand.png create mode 100644 doc/kate-plugins/filetemplates.docbook create mode 100644 doc/kate-plugins/htmltools.docbook create mode 100644 doc/kate-plugins/index.docbook create mode 100644 doc/kate-plugins/insertcommand.docbook create mode 100644 doc/kate-plugins/insertcommand.png create mode 100644 doc/kate-plugins/openheader.docbook create mode 100644 doc/kate-plugins/textfilter.docbook create mode 100644 doc/kate-plugins/xmlcheck.docbook create mode 100644 doc/kate-plugins/xmltools.docbook create mode 100644 doc/kicker-applets/Makefile.am create mode 100644 doc/kicker-applets/index.docbook create mode 100644 doc/kicker-applets/kolourpicker.docbook create mode 100644 doc/kicker-applets/ktimemon.docbook create mode 100644 doc/konq-plugins/Makefile.am create mode 100644 doc/konq-plugins/babel/Makefile.am create mode 100644 doc/konq-plugins/babel/index.docbook create mode 100644 doc/konq-plugins/crashes/Makefile.am create mode 100644 doc/konq-plugins/crashes/index.docbook create mode 100644 doc/konq-plugins/dirfilter/Makefile.am create mode 100644 doc/konq-plugins/dirfilter/index.docbook create mode 100644 doc/konq-plugins/domtreeviewer/Makefile.am create mode 100644 doc/konq-plugins/domtreeviewer/index.docbook create mode 100644 doc/konq-plugins/fsview/Makefile.am create mode 100644 doc/konq-plugins/fsview/index.docbook create mode 100644 doc/konq-plugins/imgallery/Makefile.am create mode 100644 doc/konq-plugins/imgallery/folders.png create mode 100644 doc/konq-plugins/imgallery/index.docbook create mode 100644 doc/konq-plugins/imgallery/look.png create mode 100644 doc/konq-plugins/imgallery/thumbnails.png create mode 100644 doc/konq-plugins/index.docbook create mode 100644 doc/konq-plugins/khtmlsettings/Makefile.am create mode 100644 doc/konq-plugins/khtmlsettings/index.docbook create mode 100644 doc/konq-plugins/kuick/Makefile.am create mode 100644 doc/konq-plugins/kuick/index.docbook create mode 100644 doc/konq-plugins/mediaplayer/Makefile.am create mode 100644 doc/konq-plugins/mediaplayer/index.docbook create mode 100644 doc/konq-plugins/uachanger/Makefile.am create mode 100644 doc/konq-plugins/uachanger/index.docbook create mode 100644 doc/konq-plugins/validators/Makefile.am create mode 100644 doc/konq-plugins/validators/index.docbook create mode 100644 doc/konq-plugins/webarchiver/Makefile.am create mode 100644 doc/konq-plugins/webarchiver/index.docbook create mode 100644 doc/ksig/Makefile.am create mode 100644 doc/ksig/index.docbook create mode 100644 doc/ksig/screenshot.png create mode 100644 kaddressbook-plugins/Makefile.am create mode 100644 kaddressbook-plugins/configure.in.in create mode 100644 kaddressbook-plugins/xxports/Makefile.am create mode 100644 kaddressbook-plugins/xxports/gmx/Makefile.am create mode 100644 kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp create mode 100644 kaddressbook-plugins/xxports/gmx/gmx_xxport.desktop create mode 100644 kaddressbook-plugins/xxports/gmx/gmx_xxport.h create mode 100644 kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc create mode 100644 kaddressbook-plugins/xxports/kworldclock/Makefile.am create mode 100644 kaddressbook-plugins/xxports/kworldclock/geo_xxport.cpp create mode 100644 kaddressbook-plugins/xxports/kworldclock/geo_xxport.desktop create mode 100644 kaddressbook-plugins/xxports/kworldclock/geo_xxport.h create mode 100644 kaddressbook-plugins/xxports/kworldclock/geo_xxportui.rc create mode 100644 kate/Makefile.am create mode 100644 kate/cppsymbolviewer/Makefile.am create mode 100644 kate/cppsymbolviewer/cpp_parser.cpp create mode 100644 kate/cppsymbolviewer/katecppsymbolviewer.desktop create mode 100644 kate/cppsymbolviewer/plugin_katesymbolviewer.cpp create mode 100644 kate/cppsymbolviewer/plugin_katesymbolviewer.h create mode 100644 kate/cppsymbolviewer/tcl_parser.cpp create mode 100644 kate/cppsymbolviewer/testfile.c create mode 100644 kate/cppsymbolviewer/ui.rc create mode 100644 kate/filelistloader/Makefile.am create mode 100644 kate/filelistloader/katefll.desktop create mode 100644 kate/filelistloader/katefll_initplugin.cpp create mode 100644 kate/filelistloader/katefll_initplugin.desktop create mode 100644 kate/filelistloader/katefll_initplugin.h create mode 100644 kate/filelistloader/katefll_plugin.cpp create mode 100644 kate/filelistloader/katefll_plugin.desktop create mode 100644 kate/filelistloader/katefll_plugin.h create mode 100644 kate/filelistloader/ui.rc create mode 100644 kate/filetemplates/Makefile.am create mode 100644 kate/filetemplates/katefiletemplates.kateproject create mode 100644 kate/filetemplates/plugin/Makefile.am create mode 100644 kate/filetemplates/plugin/filetemplates.cpp create mode 100644 kate/filetemplates/plugin/filetemplates.h create mode 100644 kate/filetemplates/plugin/katefiletemplates.desktop create mode 100644 kate/filetemplates/plugin/katetemplate.xml create mode 100644 kate/filetemplates/plugin/ui.rc create mode 100644 kate/filetemplates/templates/Makefile.am create mode 100644 kate/filetemplates/templates/cppgpl.cpp.katetemplate create mode 100644 kate/filetemplates/templates/cppgpl.hh.katetemplate create mode 100644 kate/filetemplates/templates/cpplgpl.cpp.katetemplate create mode 100644 kate/filetemplates/templates/cpplgpl.hh.katetemplate create mode 100644 kate/filetemplates/templates/docbookchapter.xml.katetemplate create mode 100644 kate/filetemplates/templates/html.katetemplate create mode 100644 kate/filetemplates/templates/language.xml.katetemplate create mode 100644 kate/helloworld/Makefile.am create mode 100644 kate/helloworld/katehelloworld.desktop create mode 100644 kate/helloworld/plugin_katehelloworld.cpp create mode 100644 kate/helloworld/plugin_katehelloworld.h create mode 100644 kate/helloworld/ui.rc create mode 100644 kate/htmltools/Makefile.am create mode 100644 kate/htmltools/katehtmltools.desktop create mode 100644 kate/htmltools/plugin_katehtmltools.cpp create mode 100644 kate/htmltools/plugin_katehtmltools.h create mode 100644 kate/htmltools/ui.rc create mode 100644 kate/insertcommand/Makefile.am create mode 100644 kate/insertcommand/kateinsertcommand.desktop create mode 100644 kate/insertcommand/plugin_kateinsertcommand.cpp create mode 100644 kate/insertcommand/plugin_kateinsertcommand.h create mode 100644 kate/insertcommand/ui.rc create mode 100644 kate/kjswrapper/Makefile.am create mode 100644 kate/kjswrapper/bindings.cpp create mode 100644 kate/kjswrapper/bindings.h create mode 100644 kate/kjswrapper/plugin_katekjswrapper.cpp create mode 100644 kate/kjswrapper/plugin_katekjswrapper.h create mode 100644 kate/kjswrapper/samples/Makefile.am create mode 100644 kate/kjswrapper/samples/katekjsconsolewindow.desktop create mode 100644 kate/kjswrapper/samples/katekjsconsolewindow.js create mode 100644 kate/kjswrapper/samples/katekjsconsolewindow.rc create mode 100644 kate/kjswrapper/samples/katekjsselect.desktop create mode 100644 kate/kjswrapper/samples/katekjsselect.js create mode 100644 kate/kjswrapper/samples/katekjsselect.rc create mode 100644 kate/kjswrapper/samples/katekjstest1.desktop create mode 100644 kate/kjswrapper/samples/katekjstest1.js create mode 100644 kate/kpybrowser/Makefile.am create mode 100644 kate/kpybrowser/katepybrowse.desktop create mode 100644 kate/kpybrowser/kpybrowser.cpp create mode 100644 kate/kpybrowser/kpybrowser.desktop create mode 100644 kate/kpybrowser/kpybrowser.h create mode 100644 kate/kpybrowser/pybrowse.xpm create mode 100644 kate/kpybrowser/pybrowse_part.cpp create mode 100644 kate/kpybrowser/pybrowse_part.h create mode 100644 kate/kpybrowser/pybrowsenode.cpp create mode 100644 kate/kpybrowser/pybrowsenode.h create mode 100644 kate/kpybrowser/ui.rc create mode 100644 kate/make/Makefile.am create mode 100644 kate/make/katemake.desktop create mode 100644 kate/make/plugin_katemake.cpp create mode 100644 kate/make/plugin_katemake.h create mode 100644 kate/make/ui.rc create mode 100644 kate/modeline/Makefile.am create mode 100644 kate/modeline/ModelinePlugin.cpp create mode 100644 kate/modeline/ModelinePlugin.h create mode 100644 kate/modeline/katemodeline.desktop create mode 100644 kate/modeline/ui.rc create mode 100644 kate/openheader/Makefile.am create mode 100644 kate/openheader/kateopenheader.desktop create mode 100644 kate/openheader/plugin_kateopenheader.cpp create mode 100644 kate/openheader/plugin_kateopenheader.h create mode 100644 kate/openheader/ui.rc create mode 100644 kate/scripts/Makefile.am create mode 100644 kate/scripts/html-tidy.desktop create mode 100644 kate/scripts/html-tidy.sh create mode 100644 kate/snippets/CWidgetSnippetsBase.ui create mode 100644 kate/snippets/CWidgetSnippetsBase.ui.h create mode 100644 kate/snippets/Makefile.am create mode 100644 kate/snippets/csnippet.cpp create mode 100644 kate/snippets/csnippet.h create mode 100644 kate/snippets/cwidgetsnippets.cpp create mode 100644 kate/snippets/cwidgetsnippets.h create mode 100644 kate/snippets/katesnippets.desktop create mode 100644 kate/snippets/plugin_katesnippets.cpp create mode 100644 kate/snippets/plugin_katesnippets.h create mode 100644 kate/snippets/plugin_katesnippets.rc create mode 100644 kate/tabbarextension/Makefile.am create mode 100644 kate/tabbarextension/katetabbarextension.desktop create mode 100644 kate/tabbarextension/plugin_katetabbarextension.cpp create mode 100644 kate/tabbarextension/plugin_katetabbarextension.h create mode 100644 kate/tabbarextension/ui.rc create mode 100644 kate/textfilter/Makefile.am create mode 100644 kate/textfilter/katetextfilter.desktop create mode 100644 kate/textfilter/plugin_katetextfilter.cpp create mode 100644 kate/textfilter/plugin_katetextfilter.h create mode 100644 kate/textfilter/ui.rc create mode 100644 kate/xmlcheck/Makefile.am create mode 100644 kate/xmlcheck/katexmlcheck.desktop create mode 100644 kate/xmlcheck/plugin_katexmlcheck.cpp create mode 100644 kate/xmlcheck/plugin_katexmlcheck.h create mode 100644 kate/xmlcheck/ui.rc create mode 100644 kate/xmltools/ChangeLog create mode 100644 kate/xmltools/Makefile.am create mode 100644 kate/xmltools/README create mode 100644 kate/xmltools/html4-loose.dtd.xml create mode 100644 kate/xmltools/html4-strict.dtd.xml create mode 100644 kate/xmltools/katexmltools.desktop create mode 100644 kate/xmltools/kcfg.dtd.xml create mode 100644 kate/xmltools/kde-docbook.dtd.xml create mode 100644 kate/xmltools/kpartgui.dtd.xml create mode 100644 kate/xmltools/language.dtd.xml create mode 100644 kate/xmltools/plugin_katexmltools.cpp create mode 100644 kate/xmltools/plugin_katexmltools.h create mode 100644 kate/xmltools/pseudo_dtd.cpp create mode 100644 kate/xmltools/pseudo_dtd.h create mode 100644 kate/xmltools/simplify_dtd.xsl create mode 100644 kate/xmltools/testcases.xml create mode 100644 kate/xmltools/ui.rc create mode 100644 kate/xmltools/xhtml1-frameset.dtd.xml create mode 100644 kate/xmltools/xhtml1-strict.dtd.xml create mode 100644 kate/xmltools/xhtml1-transitional.dtd.xml create mode 100644 kate/xmltools/xslt-1.0.dtd.xml create mode 100644 kdeaddons.lsm create mode 100644 kfile-plugins/Makefile.am create mode 100644 kfile-plugins/RETURNED_ITEMS create mode 100644 kfile-plugins/cert/Makefile.am create mode 100644 kfile-plugins/cert/configure.in.in create mode 100644 kfile-plugins/cert/kfile_cert.cpp create mode 100644 kfile-plugins/cert/kfile_cert.desktop create mode 100644 kfile-plugins/cert/kfile_cert.h create mode 100644 kfile-plugins/desktop/Makefile.am create mode 100644 kfile-plugins/desktop/kfile_desktop.cpp create mode 100644 kfile-plugins/desktop/kfile_desktop.desktop create mode 100644 kfile-plugins/desktop/kfile_desktop.h create mode 100644 kfile-plugins/folder/Makefile.am create mode 100644 kfile-plugins/folder/kfile_folder.cpp create mode 100644 kfile-plugins/folder/kfile_folder.desktop create mode 100644 kfile-plugins/folder/kfile_folder.h create mode 100644 kfile-plugins/html/Makefile.am create mode 100644 kfile-plugins/html/kfile_html.cpp create mode 100644 kfile-plugins/html/kfile_html.desktop create mode 100644 kfile-plugins/html/kfile_html.h create mode 100644 kfile-plugins/lnk/Makefile.am create mode 100644 kfile-plugins/lnk/README create mode 100644 kfile-plugins/lnk/kfile_lnk.cpp create mode 100644 kfile-plugins/lnk/kfile_lnk.desktop create mode 100644 kfile-plugins/lnk/kfile_lnk.h create mode 100644 kfile-plugins/lnk/lnkforward.cpp create mode 100644 kfile-plugins/lnk/lnkforward.desktop create mode 100644 kfile-plugins/lnk/lnkforward.h create mode 100644 kfile-plugins/lnk/read_lnk.cpp create mode 100644 kfile-plugins/lnk/read_lnk.h create mode 100644 kfile-plugins/lnk/x-win-lnk.desktop create mode 100644 kfile-plugins/mhtml/Makefile.am create mode 100644 kfile-plugins/mhtml/kfile_mhtml.cpp create mode 100644 kfile-plugins/mhtml/kfile_mhtml.desktop create mode 100644 kfile-plugins/mhtml/kfile_mhtml.h create mode 100644 kfile-plugins/txt/Makefile.am create mode 100644 kfile-plugins/txt/kfile_txt.cpp create mode 100644 kfile-plugins/txt/kfile_txt.desktop create mode 100644 kfile-plugins/txt/kfile_txt.h create mode 100644 kicker-applets/Makefile.am create mode 100644 kicker-applets/kbinaryclock/Makefile.am create mode 100644 kicker-applets/kbinaryclock/datepicker.cpp create mode 100644 kicker-applets/kbinaryclock/datepicker.h create mode 100644 kicker-applets/kbinaryclock/kbinaryclock.cpp create mode 100644 kicker-applets/kbinaryclock/kbinaryclock.desktop create mode 100644 kicker-applets/kbinaryclock/kbinaryclock.h create mode 100644 kicker-applets/kbinaryclock/kbinaryclock.kcfg create mode 100644 kicker-applets/kbinaryclock/prefs.kcfgc create mode 100644 kicker-applets/kbinaryclock/settings.ui create mode 100644 kicker-applets/kolourpicker/Makefile.am create mode 100644 kicker-applets/kolourpicker/TODO create mode 100644 kicker-applets/kolourpicker/kolourpicker.cpp create mode 100644 kicker-applets/kolourpicker/kolourpicker.desktop create mode 100644 kicker-applets/kolourpicker/kolourpicker.h create mode 100644 kicker-applets/kolourpicker/simplebutton.cpp create mode 100644 kicker-applets/kolourpicker/simplebutton.h create mode 100644 kicker-applets/ktimemon/Makefile.am create mode 100644 kicker-applets/ktimemon/README create mode 100644 kicker-applets/ktimemon/TODO create mode 100644 kicker-applets/ktimemon/confdlg.cc create mode 100644 kicker-applets/ktimemon/confdlg.h create mode 100644 kicker-applets/ktimemon/configure.in.in create mode 100644 kicker-applets/ktimemon/cr16-app-ktimemon.png create mode 100644 kicker-applets/ktimemon/cr32-app-ktimemon.png create mode 100644 kicker-applets/ktimemon/ktimemon.desktop create mode 100644 kicker-applets/ktimemon/lo16-app-ktimemon.png create mode 100644 kicker-applets/ktimemon/lo32-app-ktimemon.png create mode 100644 kicker-applets/ktimemon/sample.cc create mode 100644 kicker-applets/ktimemon/sample.h create mode 100644 kicker-applets/ktimemon/timemon.cc create mode 100644 kicker-applets/ktimemon/timemon.h create mode 100644 kicker-applets/math/Makefile.am create mode 100644 kicker-applets/math/mathapplet.cpp create mode 100644 kicker-applets/math/mathapplet.desktop create mode 100644 kicker-applets/math/mathapplet.h create mode 100644 kicker-applets/math/parser.cpp create mode 100644 kicker-applets/math/parser.h create mode 100644 kicker-applets/mediacontrol/AUTHORS create mode 100644 kicker-applets/mediacontrol/Makefile.am create mode 100644 kicker-applets/mediacontrol/README create mode 100644 kicker-applets/mediacontrol/TODO create mode 100644 kicker-applets/mediacontrol/amarokInterface.cpp create mode 100644 kicker-applets/mediacontrol/amarokInterface.h create mode 100644 kicker-applets/mediacontrol/configfrontend.cpp create mode 100644 kicker-applets/mediacontrol/configfrontend.h create mode 100644 kicker-applets/mediacontrol/configure.in.in create mode 100644 kicker-applets/mediacontrol/jukInterface.cpp create mode 100644 kicker-applets/mediacontrol/jukInterface.h create mode 100644 kicker-applets/mediacontrol/kscdInterface.cpp create mode 100644 kicker-applets/mediacontrol/kscdInterface.h create mode 100644 kicker-applets/mediacontrol/mcslider.cpp create mode 100644 kicker-applets/mediacontrol/mcslider.h create mode 100644 kicker-applets/mediacontrol/mediacontrol.cpp create mode 100644 kicker-applets/mediacontrol/mediacontrol.desktop create mode 100644 kicker-applets/mediacontrol/mediacontrol.h create mode 100644 kicker-applets/mediacontrol/mediacontrolconfig.cpp create mode 100644 kicker-applets/mediacontrol/mediacontrolconfig.h create mode 100644 kicker-applets/mediacontrol/mediacontrolconfigwidget.ui create mode 100644 kicker-applets/mediacontrol/mediacontroliface.h create mode 100644 kicker-applets/mediacontrol/mpdInterface.cpp create mode 100644 kicker-applets/mediacontrol/mpdInterface.h create mode 100644 kicker-applets/mediacontrol/noatunInterface.cpp create mode 100644 kicker-applets/mediacontrol/noatunInterface.h create mode 100644 kicker-applets/mediacontrol/pics/Makefile.am create mode 100644 kicker-applets/mediacontrol/pics/blueish/Makefile.am create mode 100644 kicker-applets/mediacontrol/pics/blueish/next.png create mode 100644 kicker-applets/mediacontrol/pics/blueish/pause.png create mode 100644 kicker-applets/mediacontrol/pics/blueish/play.png create mode 100644 kicker-applets/mediacontrol/pics/blueish/prev.png create mode 100644 kicker-applets/mediacontrol/pics/blueish/stop.png create mode 100644 kicker-applets/mediacontrol/pics/default/Makefile.am create mode 100644 kicker-applets/mediacontrol/pics/default/next.png create mode 100644 kicker-applets/mediacontrol/pics/default/pause.png create mode 100644 kicker-applets/mediacontrol/pics/default/play.png create mode 100644 kicker-applets/mediacontrol/pics/default/prev.png create mode 100644 kicker-applets/mediacontrol/pics/default/stop.png create mode 100644 kicker-applets/mediacontrol/pics/fulldecent/Makefile.am create mode 100644 kicker-applets/mediacontrol/pics/fulldecent/README create mode 100644 kicker-applets/mediacontrol/pics/fulldecent/next.png create mode 100644 kicker-applets/mediacontrol/pics/fulldecent/pause.png create mode 100644 kicker-applets/mediacontrol/pics/fulldecent/play.png create mode 100644 kicker-applets/mediacontrol/pics/fulldecent/prev.png create mode 100644 kicker-applets/mediacontrol/pics/fulldecent/source.xcf create mode 100644 kicker-applets/mediacontrol/pics/fulldecent/stop.png create mode 100644 kicker-applets/mediacontrol/playerInterface.cpp create mode 100644 kicker-applets/mediacontrol/playerInterface.h create mode 100644 kicker-applets/mediacontrol/simplebutton.cpp create mode 100644 kicker-applets/mediacontrol/simplebutton.h create mode 100644 kicker-applets/mediacontrol/xmmsInterface.cpp create mode 100644 kicker-applets/mediacontrol/xmmsInterface.h create mode 100644 knewsticker-scripts/GENERAL create mode 100644 knewsticker-scripts/Generic.Newsticker.Error create mode 100644 knewsticker-scripts/Makefile.am create mode 100644 knewsticker-scripts/README.kataribe create mode 100644 knewsticker-scripts/Readme.ErrorHandling create mode 100644 knewsticker-scripts/Readme.newsrss create mode 100644 knewsticker-scripts/Readme.stock create mode 100755 knewsticker-scripts/bbc.pl create mode 100755 knewsticker-scripts/fyensget.py create mode 100755 knewsticker-scripts/kataribe.pl create mode 100644 knewsticker-scripts/newsrss.pl create mode 100755 knewsticker-scripts/sportscores.py create mode 100755 knewsticker-scripts/stock.pl create mode 100644 konq-plugins/Makefile.am create mode 100644 konq-plugins/README create mode 100644 konq-plugins/akregator/Makefile.am create mode 100644 konq-plugins/akregator/akregator_konqfeedicon.desktop create mode 100644 konq-plugins/akregator/akregator_konqfeedicon.rc create mode 100644 konq-plugins/akregator/akregator_konqplugin.desktop create mode 100644 konq-plugins/akregator/akregatorplugin.cpp create mode 100644 konq-plugins/akregator/akregatorplugin.h create mode 100644 konq-plugins/akregator/feeddetector.cpp create mode 100644 konq-plugins/akregator/feeddetector.h create mode 100644 konq-plugins/akregator/konqfeedicon.cpp create mode 100644 konq-plugins/akregator/konqfeedicon.h create mode 100644 konq-plugins/akregator/pluginbase.cpp create mode 100644 konq-plugins/akregator/pluginbase.h create mode 100644 konq-plugins/akregator/rss.png create mode 100644 konq-plugins/akregator/rss.svgz create mode 100644 konq-plugins/arkplugin/Makefile.am create mode 100644 konq-plugins/arkplugin/ark_plugin.desktop create mode 100644 konq-plugins/arkplugin/arkplugin.cpp create mode 100644 konq-plugins/arkplugin/arkplugin.desktop create mode 100644 konq-plugins/arkplugin/arkplugin.h create mode 100644 konq-plugins/autorefresh/Makefile.am create mode 100644 konq-plugins/autorefresh/autorefresh.cpp create mode 100644 konq-plugins/autorefresh/autorefresh.desktop create mode 100644 konq-plugins/autorefresh/autorefresh.h create mode 100644 konq-plugins/autorefresh/autorefresh.rc create mode 100644 konq-plugins/autorefresh/lo16-app-autorefresh.png create mode 100644 konq-plugins/babelfish/Makefile.am create mode 100644 konq-plugins/babelfish/cr16-action-babelfish.png create mode 100644 konq-plugins/babelfish/cr22-action-babelfish.png create mode 100644 konq-plugins/babelfish/plugin_babelfish.cpp create mode 100644 konq-plugins/babelfish/plugin_babelfish.desktop create mode 100644 konq-plugins/babelfish/plugin_babelfish.h create mode 100644 konq-plugins/babelfish/plugin_babelfish.rc create mode 100644 konq-plugins/babelfish/translaterc create mode 100644 konq-plugins/crashes/Makefile.am create mode 100644 konq-plugins/crashes/crashesplugin.cpp create mode 100644 konq-plugins/crashes/crashesplugin.desktop create mode 100644 konq-plugins/crashes/crashesplugin.h create mode 100644 konq-plugins/crashes/crashesplugin.rc create mode 100644 konq-plugins/dirfilter/Makefile.am create mode 100644 konq-plugins/dirfilter/dirfilterplugin.cpp create mode 100644 konq-plugins/dirfilter/dirfilterplugin.desktop create mode 100644 konq-plugins/dirfilter/dirfilterplugin.h create mode 100644 konq-plugins/dirfilter/dirfilterplugin.rc create mode 100644 konq-plugins/domtreeviewer/Makefile.am create mode 100644 konq-plugins/domtreeviewer/attributeeditdialog.ui create mode 100644 konq-plugins/domtreeviewer/cr16-action-domtreeviewer.png create mode 100644 konq-plugins/domtreeviewer/cr22-action-domtreeviewer.png create mode 100644 konq-plugins/domtreeviewer/domlistviewitem.cpp create mode 100644 konq-plugins/domtreeviewer/domlistviewitem.h create mode 100644 konq-plugins/domtreeviewer/domtreecommands.cpp create mode 100644 konq-plugins/domtreeviewer/domtreecommands.h create mode 100644 konq-plugins/domtreeviewer/domtreeview.cpp create mode 100644 konq-plugins/domtreeviewer/domtreeview.h create mode 100644 konq-plugins/domtreeviewer/domtreeviewbase.ui create mode 100644 konq-plugins/domtreeviewer/domtreeviewerui.rc create mode 100644 konq-plugins/domtreeviewer/domtreewindow.cpp create mode 100644 konq-plugins/domtreeviewer/domtreewindow.h create mode 100644 konq-plugins/domtreeviewer/elementeditdialog.ui create mode 100644 konq-plugins/domtreeviewer/messagedialog.ui create mode 100644 konq-plugins/domtreeviewer/messagedialog.ui.h create mode 100644 konq-plugins/domtreeviewer/plugin_domtreeviewer.cpp create mode 100644 konq-plugins/domtreeviewer/plugin_domtreeviewer.desktop create mode 100644 konq-plugins/domtreeviewer/plugin_domtreeviewer.h create mode 100644 konq-plugins/domtreeviewer/plugin_domtreeviewer.rc create mode 100644 konq-plugins/domtreeviewer/signalreceiver.cpp create mode 100644 konq-plugins/domtreeviewer/signalreceiver.h create mode 100644 konq-plugins/domtreeviewer/texteditdialog.ui create mode 100644 konq-plugins/fsview/Makefile.am create mode 100644 konq-plugins/fsview/README create mode 100644 konq-plugins/fsview/fsview.cpp create mode 100644 konq-plugins/fsview/fsview.desktop create mode 100644 konq-plugins/fsview/fsview.h create mode 100644 konq-plugins/fsview/fsview_part.cpp create mode 100644 konq-plugins/fsview/fsview_part.desktop create mode 100644 konq-plugins/fsview/fsview_part.h create mode 100644 konq-plugins/fsview/fsview_part.rc create mode 100644 konq-plugins/fsview/hi22-app-fsview.png create mode 100644 konq-plugins/fsview/hi32-app-fsview.png create mode 100644 konq-plugins/fsview/inode.cpp create mode 100644 konq-plugins/fsview/inode.h create mode 100644 konq-plugins/fsview/main.cpp create mode 100644 konq-plugins/fsview/scan.cpp create mode 100644 konq-plugins/fsview/scan.h create mode 100644 konq-plugins/fsview/scantest.cpp create mode 100644 konq-plugins/fsview/treemap.cpp create mode 100644 konq-plugins/fsview/treemap.h create mode 100644 konq-plugins/imagerotation/Makefile.am create mode 100755 konq-plugins/imagerotation/exif.py create mode 100644 konq-plugins/imagerotation/imageconverter.desktop create mode 100755 konq-plugins/imagerotation/jpegorient create mode 100644 konq-plugins/imagerotation/jpegorient.desktop create mode 100755 konq-plugins/imagerotation/orient.py create mode 100644 konq-plugins/khtmlsettingsplugin/Makefile.am create mode 100644 konq-plugins/khtmlsettingsplugin/khtmlsettingsplugin.desktop create mode 100644 konq-plugins/khtmlsettingsplugin/khtmlsettingsplugin.lsm create mode 100644 konq-plugins/khtmlsettingsplugin/khtmlsettingsplugin.rc create mode 100644 konq-plugins/khtmlsettingsplugin/settingsplugin.cpp create mode 100644 konq-plugins/khtmlsettingsplugin/settingsplugin.h create mode 100644 konq-plugins/kimgalleryplugin/Makefile.am create mode 100644 konq-plugins/kimgalleryplugin/cr16-action-imagegallery.png create mode 100644 konq-plugins/kimgalleryplugin/cr22-action-imagegallery.png create mode 100644 konq-plugins/kimgalleryplugin/imgallerydialog.cpp create mode 100644 konq-plugins/kimgalleryplugin/imgallerydialog.h create mode 100644 konq-plugins/kimgalleryplugin/imgalleryplugin.cpp create mode 100644 konq-plugins/kimgalleryplugin/imgalleryplugin.h create mode 100644 konq-plugins/kimgalleryplugin/kimgalleryplugin.desktop create mode 100644 konq-plugins/kimgalleryplugin/kimgalleryplugin.rc create mode 100644 konq-plugins/kuick/Makefile.am create mode 100644 konq-plugins/kuick/kcmkuick/Makefile.am create mode 100644 konq-plugins/kuick/kcmkuick/kcmkuick.cpp create mode 100644 konq-plugins/kuick/kcmkuick/kcmkuick.desktop create mode 100644 konq-plugins/kuick/kcmkuick/kcmkuick.h create mode 100644 konq-plugins/kuick/kcmkuick/kcmkuickdialog.ui create mode 100644 konq-plugins/kuick/kdirmenu.cpp create mode 100644 konq-plugins/kuick/kdirmenu.h create mode 100644 konq-plugins/kuick/kimcontactmenu.cpp create mode 100644 konq-plugins/kuick/kimcontactmenu.h create mode 100644 konq-plugins/kuick/kmetamenu.cpp create mode 100644 konq-plugins/kuick/kmetamenu.h create mode 100644 konq-plugins/kuick/kuick_plugin.cpp create mode 100644 konq-plugins/kuick/kuick_plugin.desktop create mode 100644 konq-plugins/kuick/kuick_plugin.h create mode 100644 konq-plugins/kuick/kuickplugin.desktop create mode 100644 konq-plugins/mediarealfolder/Makefile.am create mode 100755 konq-plugins/mediarealfolder/kio_media_realfolder create mode 100644 konq-plugins/mediarealfolder/media_realfolder.desktop create mode 100644 konq-plugins/microformat/Makefile.am create mode 100644 konq-plugins/microformat/README create mode 100644 konq-plugins/microformat/hcard.png create mode 100644 konq-plugins/microformat/konqmficon.cpp create mode 100644 konq-plugins/microformat/konqmficon.h create mode 100644 konq-plugins/microformat/mf_konqmficon.desktop create mode 100644 konq-plugins/microformat/mf_konqmficon.rc create mode 100644 konq-plugins/microformat/microformat.png create mode 100644 konq-plugins/microformat/microformat.svgz create mode 100644 konq-plugins/microformat/pluginbase.cpp create mode 100644 konq-plugins/microformat/pluginbase.h create mode 100644 konq-plugins/minitools/Makefile.am create mode 100644 konq-plugins/minitools/cr16-action-minitools.png create mode 100644 konq-plugins/minitools/cr22-action-minitools.png create mode 100644 konq-plugins/minitools/cr32-action-minitools.png create mode 100644 konq-plugins/minitools/cr48-action-minitools.png create mode 100644 konq-plugins/minitools/minitoolsplugin.cpp create mode 100644 konq-plugins/minitools/minitoolsplugin.desktop create mode 100644 konq-plugins/minitools/minitoolsplugin.h create mode 100644 konq-plugins/minitools/minitoolsplugin.rc create mode 100644 konq-plugins/rellinks/AUTHORS create mode 100644 konq-plugins/rellinks/ChangeLog create mode 100644 konq-plugins/rellinks/Makefile.am create mode 100644 konq-plugins/rellinks/README create mode 100644 konq-plugins/rellinks/TODO create mode 100644 konq-plugins/rellinks/plugin_rellinks.cpp create mode 100644 konq-plugins/rellinks/plugin_rellinks.desktop create mode 100644 konq-plugins/rellinks/plugin_rellinks.h create mode 100644 konq-plugins/rellinks/plugin_rellinks.rc create mode 100644 konq-plugins/rellinks/rellinks.kdevelop create mode 100644 konq-plugins/rellinks/rellinks.lsm create mode 100644 konq-plugins/searchbar/Makefile.am create mode 100644 konq-plugins/searchbar/icons/Makefile.am create mode 100644 konq-plugins/searchbar/icons/cr16-action-google.png create mode 100644 konq-plugins/searchbar/searchbar.cpp create mode 100644 konq-plugins/searchbar/searchbar.desktop create mode 100644 konq-plugins/searchbar/searchbar.h create mode 100644 konq-plugins/searchbar/searchbar.lsm create mode 100644 konq-plugins/searchbar/searchbar.rc create mode 100644 konq-plugins/sidebar/Makefile.am create mode 100644 konq-plugins/sidebar/delicious/Makefile.am create mode 100644 konq-plugins/sidebar/delicious/bookmarkListItem.cpp create mode 100644 konq-plugins/sidebar/delicious/bookmarkListItem.h create mode 100644 konq-plugins/sidebar/delicious/delicious_add.desktop create mode 100644 konq-plugins/sidebar/delicious/mainWidget.cpp create mode 100644 konq-plugins/sidebar/delicious/mainWidget.h create mode 100644 konq-plugins/sidebar/delicious/pics/Makefile.am create mode 100644 konq-plugins/sidebar/delicious/pics/cr16-app-konqsidebar_delicious.png create mode 100644 konq-plugins/sidebar/delicious/plugin.cpp create mode 100644 konq-plugins/sidebar/delicious/plugin.h create mode 100644 konq-plugins/sidebar/delicious/tagListItem.cpp create mode 100644 konq-plugins/sidebar/delicious/tagListItem.h create mode 100644 konq-plugins/sidebar/delicious/widget.ui create mode 100644 konq-plugins/sidebar/mediaplayer/AUTHORS create mode 100644 konq-plugins/sidebar/mediaplayer/COPYING create mode 100644 konq-plugins/sidebar/mediaplayer/Makefile.am create mode 100644 konq-plugins/sidebar/mediaplayer/controls.cpp create mode 100644 konq-plugins/sidebar/mediaplayer/controls.h create mode 100644 konq-plugins/sidebar/mediaplayer/engine.cpp create mode 100644 konq-plugins/sidebar/mediaplayer/engine.h create mode 100644 konq-plugins/sidebar/mediaplayer/mediaplayer.cpp create mode 100644 konq-plugins/sidebar/mediaplayer/mediaplayer.h create mode 100644 konq-plugins/sidebar/mediaplayer/mediaplayerplugin.desktop create mode 100644 konq-plugins/sidebar/mediaplayer/mediawidget.cpp create mode 100644 konq-plugins/sidebar/mediaplayer/mediawidget.h create mode 100644 konq-plugins/sidebar/mediaplayer/mediawidget_skel.ui create mode 100644 konq-plugins/sidebar/mediaplayer/mediawidget_skel_designer.ui create mode 100644 konq-plugins/sidebar/mediaplayer/mplayer_add.desktop create mode 100644 konq-plugins/sidebar/mediaplayer/pics/Makefile.am create mode 100644 konq-plugins/sidebar/mediaplayer/pics/cr16-app-konqsidebar_mediaplayer.png create mode 100644 konq-plugins/sidebar/mediaplayer/pics/cr22-app-konqsidebar_mediaplayer.png create mode 100644 konq-plugins/sidebar/mediaplayer/pics/cr32-app-konqsidebar_mediaplayer.png create mode 100644 konq-plugins/sidebar/mediaplayer/pics/cr48-app-konqsidebar_mediaplayer.png create mode 100644 konq-plugins/sidebar/mediaplayer/pics/lo32-app-konqsidebar_mediaplayer.png create mode 100644 konq-plugins/sidebar/mediaplayer/player.cpp create mode 100644 konq-plugins/sidebar/mediaplayer/player.h create mode 100644 konq-plugins/sidebar/metabar/AUTHORS create mode 100644 konq-plugins/sidebar/metabar/COPYING create mode 100644 konq-plugins/sidebar/metabar/ChangeLog create mode 100644 konq-plugins/sidebar/metabar/Doxyfile create mode 100644 konq-plugins/sidebar/metabar/INSTALL create mode 100644 konq-plugins/sidebar/metabar/Makefile.am create mode 100644 konq-plugins/sidebar/metabar/NEWS create mode 100644 konq-plugins/sidebar/metabar/README create mode 100644 konq-plugins/sidebar/metabar/TODO create mode 100644 konq-plugins/sidebar/metabar/config.h.in create mode 100644 konq-plugins/sidebar/metabar/configure.in.in create mode 100644 konq-plugins/sidebar/metabar/metabar.kdevelop create mode 100644 konq-plugins/sidebar/metabar/metabar.kdevses create mode 100644 konq-plugins/sidebar/metabar/src/Makefile.am create mode 100644 konq-plugins/sidebar/metabar/src/configdialog.cpp create mode 100644 konq-plugins/sidebar/metabar/src/configdialog.h create mode 100644 konq-plugins/sidebar/metabar/src/default.css create mode 100644 konq-plugins/sidebar/metabar/src/defaultplugin.cpp create mode 100644 konq-plugins/sidebar/metabar/src/defaultplugin.h create mode 100644 konq-plugins/sidebar/metabar/src/hi128-app-metabar.png create mode 100644 konq-plugins/sidebar/metabar/src/hi16-app-metabar.png create mode 100644 konq-plugins/sidebar/metabar/src/hi32-app-metabar.png create mode 100644 konq-plugins/sidebar/metabar/src/hi48-app-metabar.png create mode 100644 konq-plugins/sidebar/metabar/src/hi64-app-metabar.png create mode 100644 konq-plugins/sidebar/metabar/src/hisc-app-metabar.svgz create mode 100644 konq-plugins/sidebar/metabar/src/httpplugin.cpp create mode 100644 konq-plugins/sidebar/metabar/src/httpplugin.h create mode 100644 konq-plugins/sidebar/metabar/src/iconsrc create mode 100644 konq-plugins/sidebar/metabar/src/layout.html create mode 100644 konq-plugins/sidebar/metabar/src/metabar.cpp create mode 100644 konq-plugins/sidebar/metabar/src/metabar.desktop create mode 100644 konq-plugins/sidebar/metabar/src/metabar.h create mode 100644 konq-plugins/sidebar/metabar/src/metabar_add.desktop create mode 100644 konq-plugins/sidebar/metabar/src/metabarfunctions.cpp create mode 100644 konq-plugins/sidebar/metabar/src/metabarfunctions.h create mode 100644 konq-plugins/sidebar/metabar/src/metabarwidget.cpp create mode 100644 konq-plugins/sidebar/metabar/src/metabarwidget.h create mode 100644 konq-plugins/sidebar/metabar/src/protocolplugin.cpp create mode 100644 konq-plugins/sidebar/metabar/src/protocolplugin.h create mode 100644 konq-plugins/sidebar/metabar/src/remoteplugin.cpp create mode 100644 konq-plugins/sidebar/metabar/src/remoteplugin.h create mode 100644 konq-plugins/sidebar/metabar/src/serviceloader.cpp create mode 100644 konq-plugins/sidebar/metabar/src/serviceloader.h create mode 100644 konq-plugins/sidebar/metabar/src/settingsplugin.cpp create mode 100644 konq-plugins/sidebar/metabar/src/settingsplugin.h create mode 100644 konq-plugins/sidebar/metabar/stamp-h.in create mode 100644 konq-plugins/sidebar/newsticker/Makefile.am create mode 100644 konq-plugins/sidebar/newsticker/README create mode 100644 konq-plugins/sidebar/newsticker/configfeeds.cpp create mode 100644 konq-plugins/sidebar/newsticker/configfeeds.h create mode 100644 konq-plugins/sidebar/newsticker/configfeedsbase.ui create mode 100644 konq-plugins/sidebar/newsticker/konq_sidebarnews.kcfg create mode 100644 konq-plugins/sidebar/newsticker/news_add.desktop create mode 100644 konq-plugins/sidebar/newsticker/norsswidget.cpp create mode 100644 konq-plugins/sidebar/newsticker/norsswidget.h create mode 100644 konq-plugins/sidebar/newsticker/nspanel.cpp create mode 100644 konq-plugins/sidebar/newsticker/nspanel.h create mode 100644 konq-plugins/sidebar/newsticker/nsstacktabwidget.cpp create mode 100644 konq-plugins/sidebar/newsticker/nsstacktabwidget.h create mode 100644 konq-plugins/sidebar/newsticker/pics/LICENSE create mode 100644 konq-plugins/sidebar/newsticker/pics/Makefile.am create mode 100644 konq-plugins/sidebar/newsticker/pics/cr16-app-konqsidebar_news.png create mode 100644 konq-plugins/sidebar/newsticker/pics/livemark-item.png create mode 100644 konq-plugins/sidebar/newsticker/sidebar_news.cpp create mode 100644 konq-plugins/sidebar/newsticker/sidebar_news.h create mode 100644 konq-plugins/sidebar/newsticker/sidebarsettings.kcfgc create mode 100644 konq-plugins/smbmounter/Readme create mode 100644 konq-plugins/uachanger/Makefile.am create mode 100644 konq-plugins/uachanger/uachangerplugin.cpp create mode 100644 konq-plugins/uachanger/uachangerplugin.desktop create mode 100644 konq-plugins/uachanger/uachangerplugin.h create mode 100644 konq-plugins/uachanger/uachangerplugin.rc create mode 100644 konq-plugins/uninstall.desktop create mode 100644 konq-plugins/validators/Makefile.am create mode 100644 konq-plugins/validators/cr16-action-cssvalidator.png create mode 100644 konq-plugins/validators/cr16-action-htmlvalidator.png create mode 100644 konq-plugins/validators/cr16-action-validators.png create mode 100644 konq-plugins/validators/cr22-action-cssvalidator.png create mode 100644 konq-plugins/validators/cr22-action-htmlvalidator.png create mode 100644 konq-plugins/validators/cr22-action-validators.png create mode 100644 konq-plugins/validators/plugin_validators.cpp create mode 100644 konq-plugins/validators/plugin_validators.desktop create mode 100644 konq-plugins/validators/plugin_validators.h create mode 100644 konq-plugins/validators/plugin_validators.rc create mode 100644 konq-plugins/validators/validatorsdialog.cpp create mode 100644 konq-plugins/validators/validatorsdialog.h create mode 100644 konq-plugins/webarchiver/Makefile.am create mode 100644 konq-plugins/webarchiver/archivedialog.cpp create mode 100644 konq-plugins/webarchiver/archivedialog.h create mode 100644 konq-plugins/webarchiver/archiveviewbase.ui create mode 100644 konq-plugins/webarchiver/cr16-action-webarchiver.png create mode 100644 konq-plugins/webarchiver/cr22-action-webarchiver.png create mode 100644 konq-plugins/webarchiver/plugin_webarchiver.cpp create mode 100644 konq-plugins/webarchiver/plugin_webarchiver.desktop create mode 100644 konq-plugins/webarchiver/plugin_webarchiver.h create mode 100644 konq-plugins/webarchiver/plugin_webarchiver.rc create mode 100644 konq-plugins/webarchiver/webarchivecreator.cpp create mode 100644 konq-plugins/webarchiver/webarchivecreator.h create mode 100644 konq-plugins/webarchiver/webarchivethumbnail.desktop create mode 100644 ksig/Makefile.am create mode 100644 ksig/hi16-app-ksig.png create mode 100644 ksig/hi32-app-ksig.png create mode 100644 ksig/ksig.cpp create mode 100644 ksig/ksig.desktop create mode 100644 ksig/ksig.h create mode 100644 ksig/ksig.spec create mode 100644 ksig/ksigui.rc create mode 100644 ksig/main.cpp create mode 100644 ksig/siggenerator.cpp create mode 100644 ksig/siggenerator.h create mode 100644 ksig/siglistview.cpp create mode 100644 ksig/siglistview.h create mode 100644 ksig/siglistviewitem.cpp create mode 100644 ksig/siglistviewitem.h create mode 100644 ksig/standardtext.cpp create mode 100644 ksig/standardtext.h create mode 100644 ksig/standardtextbase.ui create mode 100644 noatun-plugins/Makefile.am create mode 100644 noatun-plugins/alarm/Makefile.am create mode 100644 noatun-plugins/alarm/kminutespinbox.cpp create mode 100644 noatun-plugins/alarm/kminutespinbox.h create mode 100644 noatun-plugins/alarm/kpercentspinbox.cpp create mode 100644 noatun-plugins/alarm/kpercentspinbox.h create mode 100644 noatun-plugins/alarm/wakeup.cpp create mode 100644 noatun-plugins/alarm/wakeup.h create mode 100644 noatun-plugins/alarm/wakeup.plugin create mode 100644 noatun-plugins/alsaplayer/AlsaPlayer.ui create mode 100644 noatun-plugins/alsaplayer/Custom.cw create mode 100644 noatun-plugins/alsaplayer/Makefile.am create mode 100644 noatun-plugins/alsaplayer/alsaplayerui.cpp create mode 100644 noatun-plugins/alsaplayer/alsaplayerui.plugin create mode 100644 noatun-plugins/alsaplayer/configmodule.cpp create mode 100644 noatun-plugins/alsaplayer/configmodule.h create mode 100644 noatun-plugins/alsaplayer/seeker.cpp create mode 100644 noatun-plugins/alsaplayer/seeker.h create mode 100644 noatun-plugins/alsaplayer/userinterface.cpp create mode 100644 noatun-plugins/alsaplayer/userinterface.h create mode 100644 noatun-plugins/blurscope/Makefile.am create mode 100644 noatun-plugins/blurscope/blurscope.plugin create mode 100644 noatun-plugins/blurscope/scopedisplayer.cpp create mode 100644 noatun-plugins/blurscope/sdlscope.cpp create mode 100644 noatun-plugins/blurscope/sdlscope.h create mode 100644 noatun-plugins/charlatan/Makefile.am create mode 100644 noatun-plugins/charlatan/charlatanui.cpp create mode 100644 noatun-plugins/charlatan/charlatanui.plugin create mode 100644 noatun-plugins/charlatan/configmodule.cpp create mode 100644 noatun-plugins/charlatan/configmodule.h create mode 100644 noatun-plugins/charlatan/pixmaps.h create mode 100644 noatun-plugins/charlatan/seeker.cpp create mode 100644 noatun-plugins/charlatan/seeker.h create mode 100644 noatun-plugins/charlatan/userinterface.cpp create mode 100644 noatun-plugins/charlatan/userinterface.h create mode 100644 noatun-plugins/configure.in.bot create mode 100644 noatun-plugins/configure.in.in create mode 100644 noatun-plugins/dub/AUTHORS create mode 100644 noatun-plugins/dub/BUGS create mode 100644 noatun-plugins/dub/COPYING create mode 100644 noatun-plugins/dub/ChangeLog create mode 100644 noatun-plugins/dub/INSTALL create mode 100644 noatun-plugins/dub/Makefile.am create mode 100644 noatun-plugins/dub/NEWS create mode 100644 noatun-plugins/dub/README create mode 100644 noatun-plugins/dub/TODO create mode 100644 noatun-plugins/dub/configure.in.in create mode 100644 noatun-plugins/dub/design.txt create mode 100644 noatun-plugins/dub/dub.kdevprj create mode 100644 noatun-plugins/dub/dub/Makefile.am create mode 100644 noatun-plugins/dub/dub/dub.cpp create mode 100644 noatun-plugins/dub/dub/dub.h create mode 100644 noatun-plugins/dub/dub/dub.plugin create mode 100644 noatun-plugins/dub/dub/dubapp.cpp create mode 100644 noatun-plugins/dub/dub/dubapp.h create mode 100644 noatun-plugins/dub/dub/dubconfigmodule.cpp create mode 100644 noatun-plugins/dub/dub/dubconfigmodule.h create mode 100644 noatun-plugins/dub/dub/dubplaylist.cpp create mode 100644 noatun-plugins/dub/dub/dubplaylist.h create mode 100644 noatun-plugins/dub/dub/dubplaylistitem.cpp create mode 100644 noatun-plugins/dub/dub/dubplaylistitem.h create mode 100644 noatun-plugins/dub/dub/dubprefs.ui create mode 100644 noatun-plugins/dub/dub/dubui.rc create mode 100644 noatun-plugins/dub/dub/dubview.cpp create mode 100644 noatun-plugins/dub/dub/dubview.h create mode 100644 noatun-plugins/dub/dub/fileselectorwidget.cpp create mode 100644 noatun-plugins/dub/dub/fileselectorwidget.h create mode 100644 noatun-plugins/dub/dub/random.h create mode 100644 noatun-plugins/dub/dub/templates/cpp_template create mode 100644 noatun-plugins/dub/dub/templates/header_template create mode 100644 noatun-plugins/ffrs/Makefile.am create mode 100644 noatun-plugins/ffrs/ffrs.cpp create mode 100644 noatun-plugins/ffrs/ffrs.h create mode 100644 noatun-plugins/ffrs/ffrs.plugin create mode 100644 noatun-plugins/luckytag/Makefile.am create mode 100644 noatun-plugins/luckytag/luckytag.cpp create mode 100644 noatun-plugins/luckytag/luckytag.h create mode 100644 noatun-plugins/luckytag/luckytag.plugin create mode 100644 noatun-plugins/luckytag/parsedmp3filename.cpp create mode 100644 noatun-plugins/luckytag/parsedmp3filename.h create mode 100644 noatun-plugins/lyrics/Makefile.am create mode 100644 noatun-plugins/lyrics/TODO create mode 100644 noatun-plugins/lyrics/cmodule.cpp create mode 100644 noatun-plugins/lyrics/cmodule.h create mode 100644 noatun-plugins/lyrics/historymanager.cpp create mode 100644 noatun-plugins/lyrics/historymanager.h create mode 100644 noatun-plugins/lyrics/lyrics.cpp create mode 100644 noatun-plugins/lyrics/lyrics.h create mode 100644 noatun-plugins/lyrics/lyrics.plugin create mode 100644 noatun-plugins/lyrics/lyricsui.rc create mode 100644 noatun-plugins/nexscope/Makefile.am create mode 100644 noatun-plugins/nexscope/bitmappool.cpp create mode 100644 noatun-plugins/nexscope/convolve.c create mode 100644 noatun-plugins/nexscope/convolve.h create mode 100644 noatun-plugins/nexscope/gui.cpp create mode 100644 noatun-plugins/nexscope/gui.h create mode 100644 noatun-plugins/nexscope/input.cpp create mode 100644 noatun-plugins/nexscope/nex.cpp create mode 100644 noatun-plugins/nexscope/nex.h create mode 100644 noatun-plugins/nexscope/nexscope.plugin create mode 100644 noatun-plugins/nexscope/noatunplugin.cpp create mode 100644 noatun-plugins/nexscope/noatunplugin.h create mode 100644 noatun-plugins/nexscope/output.cpp create mode 100644 noatun-plugins/nexscope/regionwidget.cpp create mode 100644 noatun-plugins/nexscope/regionwidget.h create mode 100644 noatun-plugins/nexscope/renderers.cpp create mode 100644 noatun-plugins/nexscope/renderers.h create mode 100644 noatun-plugins/noatunmadness/Makefile.am create mode 100644 noatun-plugins/noatunmadness/madness.cpp create mode 100644 noatun-plugins/noatunmadness/madness.h create mode 100644 noatun-plugins/noatunmadness/madness.plugin create mode 100644 noatun-plugins/oblique/COPYING create mode 100644 noatun-plugins/oblique/Makefile.am create mode 100644 noatun-plugins/oblique/base.cpp create mode 100644 noatun-plugins/oblique/base.h create mode 100644 noatun-plugins/oblique/cmodule.cpp create mode 100644 noatun-plugins/oblique/cmodule.h create mode 100644 noatun-plugins/oblique/configure.in.in create mode 100644 noatun-plugins/oblique/file.cpp create mode 100644 noatun-plugins/oblique/file.h create mode 100644 noatun-plugins/oblique/kbuffer.cpp create mode 100644 noatun-plugins/oblique/kbuffer.h create mode 100644 noatun-plugins/oblique/kdatacollection.cpp create mode 100644 noatun-plugins/oblique/kdatacollection.h create mode 100644 noatun-plugins/oblique/kdbt.h create mode 100644 noatun-plugins/oblique/menu.cpp create mode 100644 noatun-plugins/oblique/menu.h create mode 100644 noatun-plugins/oblique/oblique.cpp create mode 100644 noatun-plugins/oblique/oblique.h create mode 100644 noatun-plugins/oblique/oblique.plugin create mode 100644 noatun-plugins/oblique/obliqueui.rc create mode 100644 noatun-plugins/oblique/query.cpp create mode 100644 noatun-plugins/oblique/query.h create mode 100644 noatun-plugins/oblique/schemas/Makefile.am create mode 100644 noatun-plugins/oblique/schemas/obliqueschema.dtd create mode 100644 noatun-plugins/oblique/schemas/standard create mode 100644 noatun-plugins/oblique/selector.cpp create mode 100644 noatun-plugins/oblique/selector.h create mode 100644 noatun-plugins/oblique/tree.cpp create mode 100644 noatun-plugins/oblique/tree.h create mode 100644 noatun-plugins/oblique/view.cpp create mode 100644 noatun-plugins/oblique/view.h create mode 100644 noatun-plugins/pitchablespeed/Makefile.am create mode 100644 noatun-plugins/pitchablespeed/pitchablespeed.cpp create mode 100644 noatun-plugins/pitchablespeed/pitchablespeed.h create mode 100644 noatun-plugins/pitchablespeed/pitchablespeed.plugin create mode 100644 noatun-plugins/pitchablespeed/speedtuner.ui create mode 100644 noatun-plugins/synaescope/Makefile.am create mode 100644 noatun-plugins/synaescope/cmodule.cpp create mode 100644 noatun-plugins/synaescope/cmodule.h create mode 100644 noatun-plugins/synaescope/core.cpp create mode 100644 noatun-plugins/synaescope/cr16-app-synaescope.png create mode 100644 noatun-plugins/synaescope/font.h create mode 100644 noatun-plugins/synaescope/icons.h create mode 100644 noatun-plugins/synaescope/main.cpp create mode 100644 noatun-plugins/synaescope/polygon.h create mode 100644 noatun-plugins/synaescope/sdlwrap.cpp create mode 100644 noatun-plugins/synaescope/symbol.h create mode 100644 noatun-plugins/synaescope/syna.h create mode 100644 noatun-plugins/synaescope/synaescope.cpp create mode 100644 noatun-plugins/synaescope/synaescope.h create mode 100644 noatun-plugins/synaescope/synaescope.plugin create mode 100644 noatun-plugins/synaescope/ui.cpp create mode 100644 noatun-plugins/tippercanoe/Makefile.am create mode 100644 noatun-plugins/tippercanoe/core.cpp create mode 100644 noatun-plugins/tippercanoe/font.h create mode 100644 noatun-plugins/tippercanoe/icons.h create mode 100644 noatun-plugins/tippercanoe/main.cpp create mode 100644 noatun-plugins/tippercanoe/polygon.h create mode 100644 noatun-plugins/tippercanoe/sdlwrap.cpp create mode 100644 noatun-plugins/tippercanoe/symbol.h create mode 100644 noatun-plugins/tippercanoe/syna.h create mode 100644 noatun-plugins/tippercanoe/synaescope.cpp create mode 100644 noatun-plugins/tippercanoe/synaescope.h create mode 100644 noatun-plugins/tippercanoe/tippecanoe.plugin create mode 100644 noatun-plugins/tippercanoe/ui.cpp create mode 100644 noatun-plugins/tyler/AUTHORS create mode 100644 noatun-plugins/tyler/COPYING create mode 100644 noatun-plugins/tyler/Makefile.am create mode 100644 noatun-plugins/tyler/README create mode 100644 noatun-plugins/tyler/README.Infinity create mode 100644 noatun-plugins/tyler/compute.c create mode 100644 noatun-plugins/tyler/compute.h create mode 100644 noatun-plugins/tyler/display.c create mode 100644 noatun-plugins/tyler/display.h create mode 100644 noatun-plugins/tyler/file.cpp create mode 100644 noatun-plugins/tyler/file.h create mode 100644 noatun-plugins/tyler/main.cpp create mode 100644 noatun-plugins/tyler/main.h create mode 100644 noatun-plugins/tyler/renderer.c create mode 100644 noatun-plugins/tyler/renderer.h create mode 100644 noatun-plugins/tyler/tyler.cpp create mode 100644 noatun-plugins/tyler/tyler.h create mode 100644 noatun-plugins/tyler/tyler.plugin create mode 100644 noatun-plugins/tyler/tylerstates create mode 100644 noatun-plugins/wavecapture/Makefile.am create mode 100644 noatun-plugins/wavecapture/wavecapture.cpp create mode 100644 noatun-plugins/wavecapture/wavecapture.h create mode 100644 noatun-plugins/wavecapture/wavecapture.plugin create mode 100644 renamedlgplugins/Makefile.am create mode 100644 renamedlgplugins/README create mode 100644 renamedlgplugins/audio/Makefile.am create mode 100644 renamedlgplugins/audio/TODO create mode 100644 renamedlgplugins/audio/audio_plugin.cpp create mode 100644 renamedlgplugins/audio/audiopreview.cpp create mode 100644 renamedlgplugins/audio/audiopreview.h create mode 100644 renamedlgplugins/audio/renaudiodlg.desktop create mode 100644 renamedlgplugins/images/Makefile.am create mode 100644 renamedlgplugins/images/image_plugin.cpp create mode 100644 renamedlgplugins/images/imagevisualizer.cpp create mode 100644 renamedlgplugins/images/imagevisualizer.h create mode 100644 renamedlgplugins/images/renimagedlg.desktop diff --git a/COPYING-DOCS b/COPYING-DOCS new file mode 100644 index 0000000..4a0fe1c --- /dev/null +++ b/COPYING-DOCS @@ -0,0 +1,397 @@ + GNU Free Documentation License + Version 1.2, November 2002 + + + Copyright (C) 2000,2001,2002 Free Software Foundation, Inc. + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + +0. PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document "free" in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of "copyleft", which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + + +1. APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The "Document", below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as "you". You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A "Modified Version" of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A "Secondary Section" is a named appendix or a front-matter section of +the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall subject +(or to related matters) and contains nothing that could fall directly +within that overall subject. (Thus, if the Document is in part a +textbook of mathematics, a Secondary Section may not explain any +mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The "Invariant Sections" are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The "Cover Texts" are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A "Transparent" copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not "Transparent" is called "Opaque". + +Examples of suitable formats for Transparent copies include plain +ASCII without markup, Texinfo input format, LaTeX input format, SGML +or XML using a publicly available DTD, and standard-conforming simple +HTML, PostScript or PDF designed for human modification. Examples of +transparent image formats include PNG, XCF and JPG. Opaque formats +include proprietary formats that can be read and edited only by +proprietary word processors, SGML or XML for which the DTD and/or +processing tools are not generally available, and the +machine-generated HTML, PostScript or PDF produced by some word +processors for output purposes only. + +The "Title Page" means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, "Title Page" means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +A section "Entitled XYZ" means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as "Acknowledgements", +"Dedications", "Endorsements", or "History".) To "Preserve the Title" +of such a section when you modify the Document means that it remains a +section "Entitled XYZ" according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + + +2. VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + + +3. COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + + +4. MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +A. Use in the Title Page (and on the covers, if any) a title distinct + from that of the Document, and from those of previous versions + (which should, if there were any, be listed in the History section + of the Document). You may use the same title as a previous version + if the original publisher of that version gives permission. +B. List on the Title Page, as authors, one or more persons or entities + responsible for authorship of the modifications in the Modified + Version, together with at least five of the principal authors of the + Document (all of its principal authors, if it has fewer than five), + unless they release you from this requirement. +C. State on the Title page the name of the publisher of the + Modified Version, as the publisher. +D. Preserve all the copyright notices of the Document. +E. Add an appropriate copyright notice for your modifications + adjacent to the other copyright notices. +F. Include, immediately after the copyright notices, a license notice + giving the public permission to use the Modified Version under the + terms of this License, in the form shown in the Addendum below. +G. Preserve in that license notice the full lists of Invariant Sections + and required Cover Texts given in the Document's license notice. +H. Include an unaltered copy of this License. +I. Preserve the section Entitled "History", Preserve its Title, and add + to it an item stating at least the title, year, new authors, and + publisher of the Modified Version as given on the Title Page. If + there is no section Entitled "History" in the Document, create one + stating the title, year, authors, and publisher of the Document as + given on its Title Page, then add an item describing the Modified + Version as stated in the previous sentence. +J. Preserve the network location, if any, given in the Document for + public access to a Transparent copy of the Document, and likewise + the network locations given in the Document for previous versions + it was based on. These may be placed in the "History" section. + You may omit a network location for a work that was published at + least four years before the Document itself, or if the original + publisher of the version it refers to gives permission. +K. For any section Entitled "Acknowledgements" or "Dedications", + Preserve the Title of the section, and preserve in the section all + the substance and tone of each of the contributor acknowledgements + and/or dedications given therein. +L. Preserve all the Invariant Sections of the Document, + unaltered in their text and in their titles. Section numbers + or the equivalent are not considered part of the section titles. +M. Delete any section Entitled "Endorsements". Such a section + may not be included in the Modified Version. +N. Do not retitle any existing section to be Entitled "Endorsements" + or to conflict in title with any Invariant Section. +O. Preserve any Warranty Disclaimers. + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled "Endorsements", provided it contains +nothing but endorsements of your Modified Version by various +parties--for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + + +5. COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled "History" +in the various original documents, forming one section Entitled +"History"; likewise combine any sections Entitled "Acknowledgements", +and any sections Entitled "Dedications". You must delete all sections +Entitled "Endorsements". + + +6. COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + + +7. AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an "aggregate" if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + + +8. TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled "Acknowledgements", +"Dedications", or "History", the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + + +9. TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + + +10. FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +http://www.gnu.org/copyleft/. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License "or any later version" applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. + + +ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + + Copyright (c) YEAR YOUR NAME. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + A copy of the license is included in the section entitled "GNU + Free Documentation License". + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the "with...Texts." line with this: + + with the Invariant Sections being LIST THEIR TITLES, with the + Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST. + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. diff --git a/Makefile.am.in b/Makefile.am.in new file mode 100644 index 0000000..66a6d68 --- /dev/null +++ b/Makefile.am.in @@ -0,0 +1,11 @@ +## kdeaddons/Makefile.am +## (C) 1997 Stephan Kulow + +AUTOMAKE_OPTIONS = foreign 1.6.1 + +EXTRA_DIST = admin +dist-hook: + cd $(top_distdir) && perl $(top_srcdir)/admin/am_edit -padmin + +include admin/deps.am + diff --git a/Makefile.cvs b/Makefile.cvs new file mode 100644 index 0000000..d5c4a7b --- /dev/null +++ b/Makefile.cvs @@ -0,0 +1,15 @@ + +all: + @echo "This Makefile is only for the CVS repository" + @echo "This will be deleted before making the distribution" + @echo "" + @if test ! -d admin; then \ + echo "Please recheckout this module!" ;\ + echo "for cvs: use checkout once and after that update again" ;\ + echo "for cvsup: checkout kde-common from cvsup and" ;\ + echo " link kde-common/admin to ./admin" ;\ + exit 1 ;\ + fi + $(MAKE) -f admin/Makefile.common cvs + +.SILENT: diff --git a/README b/README new file mode 100644 index 0000000..a803e37 --- /dev/null +++ b/README @@ -0,0 +1,126 @@ +In this file: + +* What it is +* Plugins for Kate +* Plugins for kfile +* Plugins for Kicker +* Plugins for Konqueror +* Plugins for Noatun +* Scripts for KNewsTicker + +What it is +---------- + +kdeaddons contains additional plugins and scripts for some KDE applications. + +Plugins for Kate +---------------- + +* cppsymbolviewer: C/C++ symbol viewer +* filelistloader: Save and load file lists (removed in KDE4) +* filetemplates: Create new files from templates +* helloworld: demo plugin, insert's "Hello World" into your document +* htmltools: facilitates insertion of HTML tags +* insertcommand: inserts shell command output into a document +* kjswrapper: demo kjs wrapper plugin (not compiled at the moment) +* kpybrowser: browse python files +* make: Compile and parse error messages +* modeline: Set document settings based on vim or emacs modelines + (removed in KDE4) +* scripts: scripts shown in the Tools>Kate Scripts menu +* snippets: Configurable Text-Snippets for Kate +* tabbarextension: Tab Bar extension for documents +* openheader: opens .h for .c file and vica verca +* textfilter: pipe your document throught a filter +* xmlcheck: Validates XML files using xmllint +* xmltools: lists XML elements, attributes, attributes values and + entities allowed by DTD + +Plugins for kfile +----------------- + +* cert: Certificate Info +* desktop: Desktop Entry Info +* folder: Folder Info +* html: HTML Playlist Info +* lnk: Start link given in Windows .lnk file +* mhtml: mhtml Info +* txt: Text File Info + +Plugins for Kicker +------------------ + +* kbinaryclock: display binary clock +* kolourpicker: picks color from anywhere and displays it's values +* ktimemon: little app to display cpu, memory and swap info +* kbandwidth: a network bandwidth monitor +* math: A mathematical expression evaluator +* mediacontrol: Applet to control media players + +Plugins for Konqueror +--------------------- + +* akregator: RSS feed reader and manager +* arkplugin: Compress/Extract Files with Ark +* autorefresh: Auto Refresh Plugin +* babelfish: cringes the current web page through babelfish for a rough + translation +* crashes: Crashes monitor +* dirfilter: this allows Konqueror as file manager to filter the current + directory display +* domtreeviewer: display the document object model (DOM) in a dialog box +* fsview: Graphical Disk Usage KPart for inode/directory, only for local files. +* imagerotation: servicemenu for image rotation and conversion +* khtmlsettingsplugin: to quickly enable/disble Javascript, Java, Cache etc +* kimgalleryplugin: Konqueror as file manager creates HTML files with a + gallery of graphics file +* kuick: allows to select a bunch of files and copy and move them really quick +* mediarealfolder: servicemenu for mounted devs: Open the medium system folder... +* microformat: Displays icon in the statusbar when the page has a microformat +* minitools: minitools +* rellinks: Document Relations plugin +* searchbar: Search Bar Plugin. Presents you with a textbox for direct access + to search engines like Google. +* sidebar/mediaplayer: small embedded mediaplayer +* sidebar/newsticker: show newsticker +* smbmounter: smbmount/umount samba shares (removed since KDE 3.4) +* uachanger: quickly change the user agent so that you can browse hostile + web sites :-) +* validators: validates a HTML or CSS file against W3's html validor +* webarchiver: store a complete web page with pictures locally as a *.war file + +Plugins for Noatun +------------------ + +* alarm: a simple, customizable wakeup alarm +* alsaplayer: AlsaPlayer UI clone +* blurscope: a pretty fading monoscope +* charlatan: "The dead man's interface" +* dub: A filesystem based playlist +* ffrs: French Foreign Region +* luckytag: guesses tag information from the filename +* lyrics: Display the lyrics for the current song +* nexscope: the ultra-customizable visualization +* noatunmadness: a weird and annoying scope that moves your windows +* oblique: Auto-collating playlist +* pitchablespeed: pitchable playing speed +* synaescope: a visualization +* tippercanoe: a visualization +* tyler: a psychodelic visualization, tunnel like +* wavecapture: Capture to wave file + +Scripts for KNewsTicker +----------------------- + +* fyensget.py: A Python script to retrieve news from the danish newspaper + "Fyens Stiftstidende". Take this as a motivation to write scripts for your + local newspaper. :-) +* bbc.pl: +* kataribe.pl: +* newsrss.pl: A nifty Perl script which you can use to have the most recent + postings which appeared in a USENET newsgroup of your chance show up in the + news ticker. Check the script for further details. +* stock.pl: Use this Perl script to turn KNewsTicker into a stock ticker, check + the script for information on how to define which symbols to monitor. + + diff --git a/atlantikdesigner/Makefile.am b/atlantikdesigner/Makefile.am new file mode 100644 index 0000000..1c6ba3d --- /dev/null +++ b/atlantikdesigner/Makefile.am @@ -0,0 +1,17 @@ +INCLUDES = $(all_includes) +LDFLAGS = $(all_libraries) $(KDE_RPATH) +LDADD = $(LIB_KSYCOCA) $(LIB_KFILE) + +SUBDIRS = designer pics + +EXTRA_DIST = atlantikdesigner.desktop + +xdg_apps_DATA = atlantikdesigner.desktop + +METASOURCES = AUTO + +rcdir = $(kde_datadir)/atlantikdesigner +rc_DATA = atlantikdesignerui.rc + +messages: rc.cpp + $(XGETTEXT) `find . -name '*.cpp'` -o $(podir)/atlantikdesigner.pot diff --git a/atlantikdesigner/TODO b/atlantikdesigner/TODO new file mode 100644 index 0000000..3450d34 --- /dev/null +++ b/atlantikdesigner/TODO @@ -0,0 +1,15 @@ +Bugfixes +-------- + +- fix leak of 4-300 Kb each time one switches board, i've investigated + but haven't found leak :( +- let you delete last card in a stack, it made designer crash, so delete + doesn't do anything if there is only 1 card on stack +- disable "Less properties" when there are no properties for a card + +For 0.3.0 +--------- + +- support 's go= instead of type=go in +- libatlantikui exists, make designer a seperate app again +- remove type= entirely (depends on proper monopd groups) diff --git a/atlantikdesigner/atlantikdesigner.desktop b/atlantikdesigner/atlantikdesigner.desktop new file mode 100644 index 0000000..7b883a9 --- /dev/null +++ b/atlantikdesigner/atlantikdesigner.desktop @@ -0,0 +1,170 @@ +[Desktop Entry] +Type=Application +Exec=atlantikdesigner -caption "%c" %i %m +Icon=atlantikdesigner +Terminal=false +Name=Atlantik Designer +Name[af]=Atlantik Ontwerper +Name[ar]=المصمم Atlantik +Name[az]=Atlantik Tərtib Edicisi +Name[bg]=Дизайнер на Atlantik +Name[br]=Ergrafer Atlantik +Name[ca]=Dissenyador Atlantik +Name[cs]=Atlantik designer +Name[cy]=Dylunydd Atlantik +Name[da]=Atlantik-designer +Name[de]=Atlantik Spielbrett-Editor +Name[el]=Σχεδιαστής Atlantik +Name[eo]=Atlantika Desegnilo +Name[es]=Diseñador de Atlantik +Name[et]=Atlantik disainer +Name[fa]=طراح Atlantik +Name[fo]=Atlantik-sniðari +Name[fy]=Atlantik Untwerper +Name[gl]=Deseñador Atlantik +Name[he]=מעצב Atlantik +Name[hi]=अटलांटिक डिज़ाइनर +Name[hr]=Atlantik Dizajner +Name[ja]=Atlantik デザイナー +Name[ka]=Atlantik დიზაინერი +Name[kk]=Atlantik конструкторы +Name[km]=កម្មវិធី​រចនា Atlantik​ +Name[lv]=Atlantijas Konstruktors +Name[mk]=Атлантик дизајнер +Name[mt]=Diżinjatur Atlantik +Name[nb]=Atlantik-designer +Name[nds]=Atlantik-Maker +Name[ne]=एटालन्टिक डिजाइनर +Name[nso]=Mokgabisi wa Atlantik +Name[pa]=ਐਟਲਾਟਿਕ ਨਿਰਮਾਤਾ +Name[pl]=Projektant do programu Atlantyk +Name[ru]=Редактор полей Atlantik +Name[sl]=Snovalnik za Atlantik +Name[sr]=Atlantik-ов дизајнер +Name[sr@Latn]=Atlantik-ov dizajner +Name[sv]=Atlantik designer +Name[ta]=அட்லாண்டிக் வடிவமைப்பான் +Name[tg]=Коркарди Atlantik +Name[th]=ออกแบบเกมแอตแลนติก +Name[tr]=Atlantik Tasarımcısı +Name[uk]=Редактор Atlantik +Name[uz]=Atlantik dizayneri +Name[uz@cyrillic]=Atlantik дизайнери +Name[vi]=Bộ thiết kế Atlantik +Name[xh]=Umzobi we Atlantik +Name[zh_CN]=Atlantik 设计器 +Name[zh_TW]=Atlantik 設計者 +Comment=Game board designer for Atlantik +Comment[af]=Speletjie bord ontwerper vir Atlantik +Comment[ar]=مصمم لوحات ألعاب لـ Atlantic +Comment[az]=Atlantik üçün oyun lövhəsi tərtib edicisi +Comment[bg]=Дизайнер на игралната дъска за играта Atlantik +Comment[bs]=Dizajner tabli za igru za Atlantik +Comment[ca]=Dissenyador de jocs de taula per a Atlantik +Comment[cs]=Návrhář hracích desek pro hru Atlantik +Comment[cy]=Dylunydd byrddau gêm am Atlantik +Comment[da]=Spillebræt-designer for Atlantik +Comment[de]=Spielbrett-Editor für das Spiel "Atlantik" +Comment[el]=Σχεδιαστής πινάκων παιχνιδιού για το Atlantik +Comment[eo]=Breta desegnilo por Atlantiko +Comment[es]=Diseñador de tableros de juego para Atlantik +Comment[et]=Atlantik mängulaua disainer +Comment[eu]=Atlantik jokorako taula diseinatzeko tresna +Comment[fa]=طراح تخته بازی برای Atlantik +Comment[fi]=Pelilaudan suunnitteluohjelma Atlantikiin +Comment[fo]=Spælabrettissniðari til Atlantik +Comment[fr]=Concepteur de plateaux de jeu pour Atlantik +Comment[fy]=Spulboerdûntwerper foar Atlantik +Comment[ga]=Dearthóir clár cluiche le haghaidh Atlantik +Comment[gl]=O deseñador de taboleiro de Atlantik +Comment[he]=מעצב לוחות משחק ל־Atlantik +Comment[hi]=अटलांटिक के लिए खेल बिसातडिज़ाइनर +Comment[hr]=Dizajner ploče za Atlantik +Comment[hu]=Táblatervező az Atlantikhoz +Comment[is]=Hönnun borða fyrir Atlantik +Comment[it]=Per progettare tabelloni per Atlantik +Comment[ja]=Atlantik 用のゲームボードデザイナー +Comment[ka]=Atlantik-სთვის სათამაშო დაფის დიზაინერი +Comment[kk]=Atlantik ойын тақта конструкторы +Comment[km]=កម្មវិធី​រចនា​ក្ដារ​ល្បែង​សម្រាប់ Atlantik +Comment[lt]=Žaidimo stalo dizaineris, skirtas Atlantik +Comment[lv]=Spēļu galda konstruktors Antlantikai +Comment[mk]=Дизајнер за игри на табла за Атлантик +Comment[ms]=Pereka permainan papan untuk Atlantik +Comment[mt]=Diżinjatur ta' logħob tal-bord għall-Atlantik +Comment[nb]=Spillebrettbygger for Atlantik +Comment[nds]=En Speelbrettmaker för Atlantik +Comment[ne]=एटलान्टिकका लागि खेल पाटी डिजाइनर +Comment[nl]=Spelbordontwerper voor Atlantik +Comment[nn]=Utforming av spelebrett for Atlantik +Comment[pl]=Program do projektowania plansz dla programu Atlantyk +Comment[pt]=O desenhador do tabuleiro do Atlantik +Comment[pt_BR]=O designer de jogo para o Atlantik +Comment[ro]=Desenator de table de joc pentru Atlantik +Comment[ru]=Редактор полей Atlantik +Comment[sk]=Návrhár pre hru Atlantik +Comment[sl]=Snovalnik igralnih miz za Atlantik +Comment[sr]=Дизајнер табли за игру Atlantik +Comment[sr@Latn]=Dizajner tabli za igru Atlantik +Comment[sv]=Atlantik spelplanskonstruktion +Comment[ta]=அட்லாண்டிக்கிற்கான மேஜை விளையாட்டு வடிவமைப்பாளர் +Comment[tg]=Коркарди дизайн барои бозии Atlantik +Comment[th]=เครื่องมือออกแบบกระดานเกมแอตแลนติก +Comment[tr]=Atlantik için oyun tahtası düzenleyici +Comment[uk]=Редактор гри Atlantik +Comment[uz]=Atlantik uchun oʻyin maydoni tahrirchisi +Comment[uz@cyrillic]=Atlantik учун ўйин майдони таҳрирчиси +Comment[vi]=Bộ thiết kế bảng trò chơi cho Atlantik +Comment[xh]=Umzobi womdlalo webhodi we Atlantik +Comment[zh_CN]=Atlantik 的游戏盘设计器 +Comment[zh_TW]=Atlantik 遊戲板設計師 +Categories=Qt;KDE;Game;BoardGame; +GenericName=Monopoly®-like Board Designer +GenericName[bg]=Дизайнер на Atlantik +GenericName[ca]=Dissenyador de taulells de tipus Monopoly® +GenericName[cs]=Návrhář desky podobný Monopolům® +GenericName[da]=Matador®-lignende brætdesigner +GenericName[de]=Monopoly®-ähnlicher Spielbrett-Editor +GenericName[el]=Σχεδιαστής πίνακα σε στυλ Monopoly® +GenericName[eo]=Monopoly-similaj breta desegnilo +GenericName[es]=Diseñador de tableros similar al Monopoly® +GenericName[et]=Monopoly® laadsete mängulaudade disainer +GenericName[eu]=Monopoly®-bezalako diseinatzailea +GenericName[fi]=Monopoly®-tyylisen pelin suunnitteluohjelma +GenericName[fr]=Concepteur de plateaux dans le style du Monopoly® +GenericName[fy]=Monopoly®-eftige boerdûntwerper +GenericName[ga]=Dearthóir Cluichí cosúil le Monopoly® +GenericName[gl]=Deseñador de Taboleiros tipo Monopoly® +GenericName[he]=בונה לוחות לתואמי מונופל® +GenericName[hr]=Dizajner ploče za igre poput Monopola® +GenericName[hu]=Monopoly®-szerű táblatervező +GenericName[is]=Matador (Monopoly) borðhönnuður +GenericName[it]=Gioco da tavolo simile a Monopoly® +GenericName[ja]=Monopoly® 風ボードゲームのデザイナー +GenericName[ka]=Monopoly®-ს მაგვარი სამაგიდო თამაში +GenericName[kk]=Monopoly® секілді тақта конструкторы +GenericName[km]=កម្មវិធី​រចនា​ក្ដារ Monopoly®-like +GenericName[lt]=Monopoly® primenančių lentų kūrimo priemonė +GenericName[mk]=Дизајнер за табли за игри како Монопол® +GenericName[nb]=Monopol®-aktig spillebrettmaker +GenericName[nds]=Maker för Monopoly®-liek Speelbreed +GenericName[ne]=एकाधिकारी®-जस्तै पाटी डिजाइनर +GenericName[nl]=Monopoly®-achtige bordontwerper +GenericName[nn]=Monopol®-liknande brettutforming +GenericName[pa]=Monopoly®-ਵਰਗੀ ਬੋਰਡ ਡਿਜ਼ਾਈਨਰ +GenericName[pl]=Edytor planszy do gry typu Monopoly® +GenericName[pt]=Desenhador de Tabuleiros tipo Monopoly® +GenericName[pt_BR]=Construtor de Tabuleiros para o Atlantik +GenericName[ru]=Редактор полей Atlantik +GenericName[sk]=Board Designer typu Monopoly® +GenericName[sl]=Snovalnik plošč, podobnim za Monopoly® +GenericName[sr]=Дизајнер табли налик на Monopoly® +GenericName[sr@Latn]=Dizajner tabli nalik na Monopoly® +GenericName[sv]=Konstruktion av Monopol®-liknande spelplaner +GenericName[tr]=Monopoly®-like Tahta Düzenleyici +GenericName[uk]=Monopoly®-подібний дизайнер дошки +GenericName[uz]=Monopoly® oʻyinga oʻxshagan oʻyin maydoni tahrirchisi +GenericName[uz@cyrillic]=Monopoly® ўйинга ўхшаган ўйин майдони таҳрирчиси +GenericName[vi]=Bộ thiết kế bảng kiểu Monopoly® +GenericName[zh_CN]=类似 Monopoly(R) 的棋盘设计器 +GenericName[zh_TW]=類似 Monopoly® 棋盤設計師 diff --git a/atlantikdesigner/atlantikdesignerui.rc b/atlantikdesigner/atlantikdesignerui.rc new file mode 100644 index 0000000..99d942e --- /dev/null +++ b/atlantikdesigner/atlantikdesignerui.rc @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/atlantikdesigner/configure.in.bot b/atlantikdesigner/configure.in.bot new file mode 100644 index 0000000..74e3848 --- /dev/null +++ b/atlantikdesigner/configure.in.bot @@ -0,0 +1,9 @@ +if test "x$ATLANTIKDESIGNER_SUBDIR" = "x"; then + echo "" + echo "You're missing the Atlantik header files, therefore Atlantik Designer" + echo "will not be compiled. Install Atlantik from kdegames if you want to" + echo "compile Atlantik Designer." + echo "" + all_tests=bad +fi + diff --git a/atlantikdesigner/configure.in.in b/atlantikdesigner/configure.in.in new file mode 100644 index 0000000..394e4f9 --- /dev/null +++ b/atlantikdesigner/configure.in.in @@ -0,0 +1,7 @@ +ATLANTIKDESIGNER_SUBDIR= +KDE_CHECK_HEADER(atlantik/ui/board.h, ATLANTIKDESIGNER_SUBDIR=atlantikdesigner) + +if test -z "$ATLANTIKDESIGNER_SUBDIR"; then + dnl dir will only be compiled conditionally + DO_NOT_COMPILE="$DO_NOT_COMPILE atlantikdesigner" +fi diff --git a/atlantikdesigner/designer/Makefile.am b/atlantikdesigner/designer/Makefile.am new file mode 100644 index 0000000..ca9fadc --- /dev/null +++ b/atlantikdesigner/designer/Makefile.am @@ -0,0 +1,10 @@ +bin_PROGRAMS = atlantikdesigner +INCLUDES = -I$(kde_includes)/atlantic $(all_includes) +AM_LDFLAGS = $(all_libraries) $(KDE_RPATH) +LDADD = -latlantikui -lkdegames $(LIB_KIO) + +SUBDIRS = + +atlantikdesigner_SOURCES = boardinfo.cpp designer.cpp editor.cpp main.cpp group.cpp + +METASOURCES = AUTO diff --git a/atlantikdesigner/designer/boardinfo.cpp b/atlantikdesigner/designer/boardinfo.cpp new file mode 100644 index 0000000..9bc6dbb --- /dev/null +++ b/atlantikdesigner/designer/boardinfo.cpp @@ -0,0 +1,186 @@ +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "boardinfo.h" + +BoardInfoDlg::BoardInfoDlg(bool editable, BoardInfo *info, QWidget *parent, const char *_name, bool modal) + : KDialogBase(KDialogBase::Tabbed, i18n("Gameboard Information"), (editable? Ok|Apply|Cancel : Close), (editable? Ok : Close), parent, _name, modal) +{ + if (!info) + return; + this->info = info; + + setWFlags(WDestructiveClose); + + QFrame *about = addPage(i18n("Information")); + QVBoxLayout *aboutLayout = new QVBoxLayout(about, spacingHint()); + + if (editable) + { + aboutLayout->addWidget(name = new KLineEdit(about)); + name->setText(info->name); + } + else + { + aboutLayout->addWidget(new QLabel(info->name, about)); + name = 0; + } + + QHBoxLayout *versionLayout = new QHBoxLayout(aboutLayout, spacingHint()); + versionLayout->addWidget(new QLabel(i18n("Version:"), about)); + if (editable) + { + versionLayout->addWidget(version = new KLineEdit(about)); + version->setText(info->version); + } + else + versionLayout->addWidget(new QLabel(info->version, about)); + + QHBoxLayout *urlLayout = new QHBoxLayout(aboutLayout, spacingHint()); + urlLayout->addWidget(new QLabel(i18n("URL:"), about)); + if (editable) + urlLayout->addWidget(url = new KLineEdit(info->url, about)); + else + urlLayout->addWidget(new KURLLabel(info->url, info->url, about)); + + aboutLayout->addStretch(3); + + aboutLayout->addWidget(new QLabel(i18n("Description:"), about)); + aboutLayout->addStretch(); + aboutLayout->addWidget(description = new KLineEdit(about)); + description->setText(info->description); + if (!editable) + { + description->setReadOnly(true); + } + + if (editable) + { + QHBoxLayout *bgLayout = new QHBoxLayout(aboutLayout, spacingHint()); + bgLayout->addWidget(new QLabel(i18n("Background color:"), about)); + bgColor = new KColorButton(info->bgColor, about); + bgLayout->addWidget(bgColor); + } + else + bgColor = 0; + + QFrame *authorsFrame = addPage(i18n("&Authors")); + QVBoxLayout *authorsLayout = new QVBoxLayout(authorsFrame, spacingHint()); + authorsLayout->addWidget(authors = new LotsaEdits(editable, info->authors, authorsFrame)); + + QFrame *creditsFrame = addPage(i18n("&Thanks To")); + QVBoxLayout *creditsLayout = new QVBoxLayout(creditsFrame, spacingHint()); + creditsLayout->addWidget(credits = new LotsaEdits(editable, info->credits, creditsFrame)); +} + +void BoardInfoDlg::slotApply() +{ + info->name = name->text(); + info->description = description->text(); + info->version = version->text(); + info->url = url->text(); + info->authors = authors->save(); + info->credits = credits->save(); + + if (bgColor) + info->bgColor = bgColor->color().name(); + + emit okClicked(); + KDialogBase::slotApply(); +} + +void BoardInfoDlg::slotOk() +{ + slotApply(); + + KDialogBase::slotOk(); +} + +/////////////////////////////////// + +LotsaEdits::LotsaEdits(bool editable, QStringList defaults, QWidget *parent, const char *name) : QWidget(parent, name) +{ + list.setAutoDelete(true); + this->editable = editable; + + layout = new QVBoxLayout(this, KDialogBase::spacingHint()); + QHBoxLayout *hlayout = new QHBoxLayout(layout, KDialogBase::spacingHint()); + + if (editable) + { + KPushButton *more = new KPushButton(i18n("&Add Name"), this); + hlayout->addWidget(more); + connect(more, SIGNAL(clicked()), this, SLOT(more())); + hlayout->addStretch(); + KPushButton *less= new KPushButton(i18n("&Delete Name"), this); + hlayout->addWidget(less); + connect(less, SIGNAL(clicked()), this, SLOT(less())); + } + + layout->addStretch(); + + for (QStringList::Iterator it = defaults.begin(); it != defaults.end(); ++it) + { + more(); + if (editable) + static_cast(list.last())->setText(*it); + else + static_cast(list.last())->setText(*it); + } +} + +void LotsaEdits::more() +{ + QWidget *edit; + if (editable) + edit = new KLineEdit(this); + else + edit = new QLabel(this); + layout->addWidget(edit); + list.append(edit); + edit->show(); +} + +void LotsaEdits::less() +{ + list.removeLast(); + /* + QWidget *edit = 0; + for (edit = list.first(); edit; edit = list.next()) + { + if (edit->hasFocus()) + { + list.remove(); + break; + } + } + */ +} + +QStringList LotsaEdits::save() +{ + QStringList ret; + + QWidget *edit = 0; + for (edit = list.first(); edit; edit = list.next()) + if (editable) + ret.append(static_cast(edit)->text()); + else + ret.append(static_cast(edit)->text()); + + return ret; +} + +#include "boardinfo.moc" diff --git a/atlantikdesigner/designer/boardinfo.h b/atlantikdesigner/designer/boardinfo.h new file mode 100644 index 0000000..00825a5 --- /dev/null +++ b/atlantikdesigner/designer/boardinfo.h @@ -0,0 +1,74 @@ +#ifndef ATLANTIK_BOARDINFO_H +#define ATLANTIK_BOARDINFO_H + +#include +#include +#include +#include +#include + +#include + +class KColorButton; +class KLineEdit; +class KURLLabel; + +class QVBoxLayout; + +struct BoardInfo +{ + BoardInfo() { bgColor = Qt::lightGray; } + QString name; + QStringList authors; + QStringList credits; + QString description; + QString url; + QString version; + QColor bgColor; +}; + +class LotsaEdits : public QWidget +{ + Q_OBJECT + + public: + LotsaEdits(bool, QStringList=QStringList(), QWidget *parent=0, const char *name=0); + + public slots: + QStringList save(); + + private slots: + void more(); + void less(); + + private: + bool editable; + QPtrList list; + QVBoxLayout *layout; +}; + +class BoardInfoDlg : public KDialogBase +{ + Q_OBJECT + + public: + BoardInfoDlg(bool editable, BoardInfo *, QWidget *parent=0, const char *_name=0, bool = true); + + protected slots: + void slotOk(); + void slotApply(); + + private: + KLineEdit *name; + KLineEdit *url; + KLineEdit *version; + KLineEdit *description; + KColorButton *bgColor; + + LotsaEdits *authors; + LotsaEdits *credits; + + BoardInfo *info; +}; + +#endif diff --git a/atlantikdesigner/designer/designer.cpp b/atlantikdesigner/designer/designer.cpp new file mode 100644 index 0000000..11da0e3 --- /dev/null +++ b/atlantikdesigner/designer/designer.cpp @@ -0,0 +1,1099 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "boardinfo.h" +#include "editor.h" +#include "designer.h" + +AtlanticDesigner::AtlanticDesigner(QWidget *parent, const char *name) + : KMainWindow(parent, name) +{ + firstBoard = true; + estates.setAutoDelete(true); + + isMod = false; + m_player = 0; + copiedEstate = 0; + editor = 0; + board = 0; + layout = 0; + + (void) KStdAction::quit(this, SLOT(close()), actionCollection()); + (void) KStdAction::open(this, SLOT(open()), actionCollection()); + (void) KStdAction::openNew(this, SLOT(openNew()), actionCollection()); + (void) KStdAction::save(this, SLOT(save()), actionCollection()); + (void) KStdAction::saveAs(this, SLOT(saveAs()), actionCollection()); + (void) new KAction(i18n("&Edit Gameboard Info..."), CTRL+Key_I, this, SLOT(info()), actionCollection(), "boardinfo"); + (void) new KAction(i18n("&Edit Groups..."), CTRL+Key_G, this, SLOT(editGroups()), actionCollection(), "groupeditor"); + + (void) new KAction(i18n("&Add 4 Squares"), "viewmag+", 0, this, SLOT(larger()), actionCollection(), "larger"); + (void) new KAction(i18n("&Remove 4 Squares"), "viewmag-", 0, this, SLOT(smaller()), actionCollection(), "smaller"); + (void) KStdAction::copy(this, SLOT(copy()), actionCollection()); + (void) KStdAction::paste(this, SLOT(paste()), actionCollection()); + (void) new KAction(i18n("&Up"), Key_Up, this, SLOT(up()), actionCollection(), "up"); + (void) new KAction(i18n("&Down"), Key_Down, this, SLOT(down()), actionCollection(), "down"); + (void) new KAction(i18n("&Left"), Key_Left, this, SLOT(left()), actionCollection(), "left"); + (void) new KAction(i18n("&Right"), Key_Right, this, SLOT(right()), actionCollection(), "right"); + + recentAct = KStdAction::openRecent(0, 0, actionCollection()); + connect(recentAct, SIGNAL(urlSelected(const KURL &)), this, SLOT(openRecent(const KURL &))); + recentAct->loadEntries(KGlobal::config(), "Designer recent files"); + + estateAct = new KListAction(i18n("Change Estate"), 0, 0, 0, actionCollection(), "estate_num"); + connect(estateAct, SIGNAL(activated(int)), SLOT(changeEstate(int))); + + createGUI("atlantikdesignerui.rc"); + + KConfig *config = kapp->config(); + config->setGroup("General"); + QColor defaultColor = colorGroup().background(); + defaultBg = config->readColorEntry("alternateBackground", &defaultColor); + config->setGroup("WM"); + defaultColor = colorGroup().dark(); + defaultFg = config->readColorEntry("activeBackground", &defaultColor); + + // these must match up to the ones in editor.cpp! + // I don't think these are used anymore. + types.append("street"); + types.append("cards"); + types.append("freeparking"); + types.append("tojail"); + types.append("tax"); + types.append("jail"); + + openNew(); + + resize(350, 400); + applyMainWindowSettings(KGlobal::config(), "DesignerTopLevelWindow"); +} + +AtlanticDesigner::~AtlanticDesigner() +{ + delete m_player; +} + +void AtlanticDesigner::initMembers() +{ + estates.clear(); + cards.clear(); + groups.clear(); + + boardInfo = BoardInfo(); + + for (ConfigEstateGroupList::Iterator it = groups.begin(); it != groups.end(); ++it) + if ((*it).name() == "Default") + return; + + ConfigEstateGroup defaultGroup("Default"); + defaultGroup.setBgColor(defaultBg); + defaultGroup.setFgColor(defaultFg); + groups.append(defaultGroup); +} + +void AtlanticDesigner::initBoard() +{ + // let her say her prayers (if she's alive) + if (!firstBoard) + editor->aboutToDie(); + + firstBoard = false; + + delete editor; + delete board; + delete layout; + + board = new AtlantikBoard(0, max, AtlantikBoard::Edit, this, "Board"); + + setCentralWidget(board); + layout = new QVBoxLayout(board->centerWidget()); + editor = new EstateEdit(&groups, &estates, &cards, board->centerWidget(), "Estate Editor"); + connect(editor, SIGNAL(goChecked(int)), this, SLOT(goChanged(int))); + connect(editor, SIGNAL(updateBackground()), this, SLOT(updateBackground())); + connect(editor, SIGNAL(resized()), board, SLOT(slotResizeAftermath())); + layout->addWidget(editor); + + editor->setReady(false); + + board->show(); + editor->show(); + + initToken(); +} + +void AtlanticDesigner::initToken() +{ + if (!m_player) + m_player = new Player(0); + else + m_player->setLocation(0); + + board->addToken(m_player); + + connect(m_player, SIGNAL(changed(Player *)), board, SLOT(playerChanged(Player *))); +} + +void AtlanticDesigner::openNew() +{ + if (warnClose()) + return; + filename = QString::null; + + max = 40; + + initMembers(); + initBoard(); + + for (int i = 0; i < 40; ++i) + { + (void) newEstate(i); + } + + doCaption(false); + updateJumpMenu(); + + groupsChanged(); + updateBackground(); + + QTimer::singleShot(500, this, SLOT(setPlayerAtBeginning())); + doCaption(false); +} + +ConfigEstate *AtlanticDesigner::newEstate(int i) +{ + ConfigEstate *estate = new ConfigEstate(i); + estate->setName(i18n("New Estate")); + estate->setPrice(100); + for (int j = 0; j < 6; ++j) + estate->setRent(j, 10 * (j + 1)); + estate->setChanged(false); + estates.insert(i, estate); + + connect(estate, SIGNAL(LMBClicked(Estate *)), this, SLOT(changeEstate(Estate *))); + connect(estate, SIGNAL(changed()), this, SLOT(modified())); + + board->addEstateView(estate); + + return estate; +} + +bool AtlanticDesigner::warnClose() +{ + if (isMod) + { + int result = KMessageBox::warningYesNoCancel(this, i18n("There are unsaved changes to gameboard. Save them?"), i18n("Unsaved Changes"), KStdGuiItem::save(), KStdGuiItem::discard(), "DiscardAsk", true); + switch(result) + { + case KMessageBox::Yes: + save(); + // fallthrough + case KMessageBox::No: + return false; + case KMessageBox::Cancel: + return true; + } + } + return false; +} + +void AtlanticDesigner::open() +{ + if (warnClose()) + return; + + filename = KFileDialog::getOpenFileName(); + + if (filename.isNull()) + return; + + openFile(filename); + recentAct->addURL(KURL::fromPathOrURL( filename )); +} + +void AtlanticDesigner::openRecent(const KURL &url) +{ + if (url.isLocalFile()) + { + filename = url.path(); + openFile(filename); + + recentAct->popupMenu()->setItemChecked(recentAct->currentItem(), false); + } + else + { + recentAct->removeURL(url); + } +} + +void AtlanticDesigner::openFile(const QString &filename) +{ + enum ParseMode { Parse_Nothing, Parse_General, Parse_Board, Parse_Cards, Parse_EstateGroups, Parse_Estates }; + QFile f(filename); + if (!f.open(IO_ReadOnly)) + return; + + initMembers(); + + QTextStream t(&f); + t.setCodec(QTextCodec::codecForName("utf8")); + + QString s = t.readLine(); + int parseMode = Parse_Nothing; + + CardStack *curCardStack = 0; + + int goEstate = 0; + int i; + for (i = 0; !t.atEnd();) + { + s = s.stripWhiteSpace(); + + if (s.isEmpty()) + { + s = t.readLine(); + continue; + } + + QString name; + + if (s.left(1) == "<") + { + if (s == "") + parseMode = Parse_General; + else if (s == "") + parseMode = Parse_Board; + else if (s == "") + parseMode = Parse_EstateGroups; + else if (s == "") + parseMode = Parse_Cards; + else if (s == "") + parseMode = Parse_Estates; + + s = t.readLine(); + continue; + } + + // this for outside-of-[]-settings + int eqSign = s.find("="); + if (eqSign >= 0) + { + QString key = s.left(eqSign); + QString value = s.right(s.length() - eqSign - 1); + + if (parseMode == Parse_Cards) + { + if (key == "groupname") + { + cards.append(CardStack(value)); + curCardStack = &cards.last(); + } + } + else if (parseMode == Parse_General) + { + if (key == "name") + boardInfo.name = value; + else if (key == "description") + boardInfo.description = value; + else if (key == "version") + boardInfo.version = value; + else if (key == "url") + boardInfo.url = value; + else if (key == "authors") + boardInfo.authors = QStringList::split(",", value); + else if (key == "credits") + boardInfo.credits = QStringList::split(",", value); + } + else if (parseMode == Parse_Board) + { + if (key == "go") + goEstate = value.toInt(); + else if (key == "bgcolor") + boardInfo.bgColor.setNamedColor(value); + } + + s = t.readLine(); + continue; + } + + name = s.left(s.find("]")); + name = name.right(name.length() - name.find("[") - 1); + + if (name.isEmpty()) + name = i18n("No Name"); + + // for estates + int type = FreeParking; + QString group, takeCard; + int price = -1; + int rent[6] = {-1, -1, -1, -1, -1, -1}; + int tax = -1; + int taxPercentage = -1; + int passMoney = -1; + QColor forceBg; + + // for groups + QColor color, bgColor; + QString rentMath; + int housePrice = -1; + int globalPrice = -1; + + // for cards + QStringList keys; + QValueList values; + + while (true) + { + if (t.atEnd()) + break; + + s = t.readLine().stripWhiteSpace(); + + if (s.left(1) == "[" || s.left(1) == "<") + break; + + int eqSign = s.find("="); + if (eqSign < 0) + continue; + + QString key = s.left(eqSign); + QString value = s.right(s.length() - eqSign - 1); + + //////////////////////////////// ESTATES + if (parseMode == Parse_Estates) + { + if (key == "price") + price = value.toInt(); + else if (key.left(4) == "rent") + { + int houses = key.right(1).toInt(); + if (houses < 0 || houses > 5) + continue; + + rent[houses] = value.toInt(); + } + else if (key == "tax") + { + tax = value.toInt(); + type = Tax; + } + else if (key == "taxpercentage") + taxPercentage = value.toInt(); + else if (key == "group") + { + group = value; + type = Street; + } + else if (key == "tojail") + type = ToJail; + else if (key == "jail") + type = Jail; + else if (key == "freeparking") + type = FreeParking; + else if (key == "takecard") + { + takeCard = value; + type = Cards; + } + else if (key == "bgcolor") + forceBg = QColor(value); + else if (key == "passmoney") + passMoney = value.toInt(); + } + else if (parseMode == Parse_EstateGroups) + { + if (key == "color") + color.setNamedColor(value); + else if (key == "bgcolor") + bgColor.setNamedColor(value); + else if (key == "houseprice") + housePrice = value.toInt(); + else if (key == "price") + globalPrice = value.toInt(); + else if (key == "rentmath") + rentMath = value; + } + else if (parseMode == Parse_Cards) + { + bool ok; + int v = value.toInt(&ok); + if (!ok) + continue; + + if (key == "pay" && v < 0) + { + v *= -1; + key = "collect"; + } + else if (key == "payeach" && v < 0) + { + v *= -1; + key = "collecteach"; + } + else if (key == "advance" && v < 0) + { + v *= -1; + key = "goback"; + } + + keys.append(key); + values.append(v); + } + } + + if (parseMode == Parse_Estates) + { + ConfigEstate *estate = new ConfigEstate(i); + estate->setName(name); + estate->setType(type); + if (!group.isEmpty()) + estate->setGroup(group); + estate->setTakeCard(takeCard); + estate->setPrice(price); + for (int j = 0; j < 6; j++) + estate->setRent(j, rent[j]); + estate->setTax(tax); + estate->setTaxPercentage(taxPercentage); + estate->setForceBg(forceBg); + estate->setPassMoney(passMoney); + estates.append(estate); + + connect(estate, SIGNAL(LMBClicked(Estate *)), this, SLOT(changeEstate(Estate *))); + connect(estate, SIGNAL(changed()), this, SLOT(modified())); + i++; + } + else if (parseMode == Parse_Cards) + { + Card card; + card.name = name; + card.keys = keys; + card.values = values; + if (curCardStack) + curCardStack->append(card); + } + else if (parseMode == Parse_EstateGroups) + { + bool found = false; + for (ConfigEstateGroupList::Iterator it = groups.begin(); it != groups.end(); ++it) + { + if ((*it).name() == name) + { + found = true; + break; + } + } + + if (found) + continue; + + ConfigEstateGroup group(name); + group.setHousePrice(housePrice); + group.setGlobalPrice(globalPrice); + group.setFgColor(color); + group.setBgColor(bgColor); + group.setRentMath(rentMath); + groups.append(group); + } + } + + if (i < 8) + { + KMessageBox::detailedSorry(this, i18n("This board file is invalid; cannot open."), i18n("There are only %1 estates specified in this file.").arg(i)); + if (this->filename.isNull()) + close(); + return; + } + max = i; + + initBoard(); + ConfigEstate *estate = 0; + for (estate = estates.first(); estate; estate = estates.next()) + board->addEstateView(estate); + + if (goEstate >= 0 && goEstate < max - 1) + estates.at(goEstate)->setGo(true); + + groupsChanged(); + updateBackground(); + updateJumpMenu(); + + QTimer::singleShot(500, this, SLOT(setPlayerAtBeginning())); + doCaption(false); +} + +void AtlanticDesigner::updateJumpMenu() +{ + QStringList estates; + for (int i = 1; i <= max; i++) + estates.append(i18n("Jump to Estate %1").arg(QString::number(i))); + estateAct->setItems(estates); +} + +void AtlanticDesigner::setPlayerAtBeginning() +{ + ConfigEstate *go = 0; + for (go = estates.first(); go; go = estates.next()) + if (go->go()) + break; + + if (!go) + go = estates.first(); + + movePlayer(go); + editor->setEstate(go); +} + +void AtlanticDesigner::saveAs() +{ + QString oldfilename = filename; + filename = QString::null; + + save(); + + if (filename.isNull()) + { + filename = oldfilename; + return; + } + else + recentAct->addURL(KURL::fromPathOrURL( filename )); +} + +void AtlanticDesigner::save() +{ + (void) editor->saveEstate(); + QString oldfilename = filename; + if (filename.isNull()) + filename = KFileDialog::getOpenFileName(); + + if (filename.isNull()) + { + filename = oldfilename; + return; + } + + QFile f(filename); + if (!f.open(IO_WriteOnly)) + return; + + QTextStream t(&f); + t.setCodec(QTextCodec::codecForName("utf8")); + + t << "" << endl << endl; + if (!boardInfo.name.isEmpty()) + t << "name=" << boardInfo.name << endl; + if (!boardInfo.description.isEmpty()) + t << "description=" << boardInfo.description << endl; + if (!boardInfo.url.isEmpty()) + t << "url=" << boardInfo.url << endl; + if (!boardInfo.version.isEmpty()) + t << "version=" << boardInfo.version << endl; + if (!boardInfo.authors.isEmpty()) + t << "authors=" << boardInfo.authors.join(",") << endl; + if (!boardInfo.credits.isEmpty()) + t << "credits=" << boardInfo.credits.join(",") << endl; + + // FIXME: make configurable. Hardcoded defaults are still better than + // non-existant entries that would make the saved configs useless. + t << "minplayers=2" << endl; + t << "maxplayers=6" << endl; + t << "houses=32" << endl; + t << "hotels=16" << endl; + t << "startmoney=1500" << endl; + + t << endl; + t << "" << endl << endl; + + ConfigEstate *estate = 0; + bool hasGo = false; + for (estate = estates.first(); estate; estate = estates.next()) + { + if (estate->go()) + { + t << "go=" << estate->id() << endl; + hasGo = true; + break; + } + } + if (!hasGo) + t << "go=" << 0 << endl; + + if (boardInfo.bgColor.isValid()) + t << "bgcolor=" << boardInfo.bgColor.name() << endl; + + t << endl << endl; + + t << "" << endl; + + // double-prevent duplicates + QStringList writtenGroups; + + for (ConfigEstateGroupList::Iterator it = groups.begin(); it != groups.end(); ++it) + { + if (writtenGroups.contains((*it).name()) > 0) + continue; + + if ((*it).name() == "Default") + { + bool containsDefault = false; + for (estate = estates.first(); estate; estate = estates.next()) + { + if (estate->group() == "Default") + { + containsDefault = true; + break; + } + } + + if (!containsDefault) + continue; + } + + writtenGroups.append((*it).name()); + + t << endl << QString("[%1]").arg((*it).name()) << endl; + + if ((*it).globalPrice() > 0) + t << "price=" << (*it).globalPrice() << endl; + + if ((*it).fgColor().isValid()) + t << "color=" << (*it).fgColor().name() << endl; + if ((*it).bgColor().isValid()) + t << "bgcolor=" << (*it).bgColor().name() << endl; + + if ((*it).housePrice() > 0) + t << "houseprice=" << (*it).housePrice() << endl; + + if (!(*it).rentMath().isEmpty()) + t << "rentmath=" << (*it).rentMath() << endl; + } + + // now do the cards + + for (QValueList::Iterator it = cards.begin(); it != cards.end(); ++it) + { + t << endl << endl; + t << "" << endl << endl; + t << "groupname=" << (*it).name() << endl; + + for (CardStack::Iterator cit = (*it).begin(); cit != (*it).end(); ++cit) + { + t << endl << "[" << (*cit).name << "]" << endl; + QValueList::Iterator vit = (*cit).values.begin(); + for (QStringList::Iterator it = (*cit).keys.begin(); it != (*cit).keys.end(); ++it, ++vit) + { + QString key = (*it); + int value = (*vit); + + if (key == "collect") + { + value *= -1; + key = "pay"; + } + else if (key == "collecteach") + { + value *= -1; + key = "payeach"; + } + else if (key == "goback") + { + value *= -1; + key = "advance"; + } + + if (key == "outofjail" || key == "tojail" || key == "nextrr" || key == "nextutil") + value = 1; + + if (key == "outofjail") + { + t << "canbeowned=" << 1 << endl; + } + + t << key << "=" << value << endl; + } + } + } + + t << endl << endl; + + t << "" << endl; + + for (estate = estates.first(); estate; estate = estates.next()) + { + t << endl << QString("[%1]").arg(estate->name()) << endl; + + switch (estate->type()) + { + case Street: + if (!estate->group().isNull()) + t << "group=" << estate->group() << endl; + + if (estate->price() > 0) + t << "price=" << estate->price() << endl; + + for (int i = 0; i < 6; i++) + { + if (estate->rent(i) > 0) + t << "rent" << i << "=" << estate->rent(i) << endl; + } + break; + + case Tax: + if (estate->tax() > 0) + t << "tax=" << estate->tax() << endl; + if (estate->taxPercentage() > 0) + t << "taxpercentage=" << estate->taxPercentage() << endl; + break; + + case Jail: + t << "jail=1" << endl; + if (estate->forceBg().isValid()) + t << "bgcolor=" << estate->forceBg().name() << endl; + break; + + case ToJail: + t << "tojail=1" << endl; + if (estate->forceBg().isValid()) + t << "bgcolor=" << estate->forceBg().name() << endl; + break; + + case Cards: + t << "takecard=" << estate->takeCard() << endl; + break; + + case FreeParking: + t << "freeparking=1" << endl; + if (estate->forceBg().isValid()) + t << "bgcolor=" << estate->forceBg().name() << endl; + break; + } + + if (estate->passMoney() > 0) + t << "passmoney=" << estate->passMoney() << endl; + } + + f.flush(); + doCaption(false); +} + +void AtlanticDesigner::copy() +{ + copiedEstate = editor->theEstate(); +} + +void AtlanticDesigner::paste() +{ + ConfigEstate *estate = editor->theEstate(); + for (int i = 0; i < 6; i++) + estate->setRent(i, copiedEstate->rent(i)); + estate->setPrice(copiedEstate->price()); + estate->setTax(copiedEstate->tax()); + estate->setTaxPercentage(copiedEstate->taxPercentage()); + estate->setGroup(copiedEstate->group()); + estate->setTakeCard(copiedEstate->takeCard()); + estate->setType(copiedEstate->type()); + estate->setName(copiedEstate->name()); + estate->setPassMoney(copiedEstate->passMoney()); + + editor->setEstate(estate); + + groupsChanged(); +} + +void AtlanticDesigner::closeEvent(QCloseEvent *e) +{ + if (warnClose()) + return; + + saveMainWindowSettings(KGlobal::config(), "DesignerTopLevelWindow"); + recentAct->saveEntries(KGlobal::config(), "Designer recent files"); + + e->accept(); + kapp->quit(); +} + +void AtlanticDesigner::changeEstate(int index) +{ + if (index < 0 || index > max - 1) + return; + + changeEstate(estates.at(index)); +} + +void AtlanticDesigner::changeEstate(Estate *estate) +{ + if (!estate) + return; + + setFocus(); + + (void) editor->saveEstate(); + + editor->setEstate(static_cast(estate)); + movePlayer(estate); +} + +void AtlanticDesigner::movePlayer(Estate *estate) +{ + estateAct->setCurrentItem(estate->id()); + board->setFocus(); + m_player->setLocation(estate); + m_player->update(); +} + +// this will add a square to all sides +void AtlanticDesigner::larger() +{ + max += 4; + int sideLen = max/4; + + initBoard(); + + ConfigEstate *estate = 0; + for (int i = 0; i < max; ++i) + { + estate = estates.at(i); + estate->setEstateId(i); + board->addEstateView(estate); + + // make a newEstate + if ((i % sideLen - 1) == 0 || i == 1) + { + newEstate(i); + } + } + + updateJumpMenu(); + groupsChanged(); + updateBackground(); + + QTimer::singleShot(500, this, SLOT(setPlayerAtBeginning())); + doCaption(true); +} + +void AtlanticDesigner::smaller() +{ + if (max < 12) + return; + + max -= 4; + int sideLen = max/4; + + initBoard(); + + bool remove = true; + + ConfigEstate *estate = 0; + for (int i = 0; i < max; ++i) + { + // remove estate + if (((i % sideLen - 1) == 0 || i == 1) && remove) + { + estates.remove(i); + i--; + remove = false; + } + else + { + estate = estates.at(i); + estate->setEstateId(i); + board->addEstateView(estate); + + remove = true; + } + } + + updateJumpMenu(); + groupsChanged(); + updateBackground(); + QTimer::singleShot(500, this, SLOT(setPlayerAtBeginning())); + + doCaption(true); +} + +void AtlanticDesigner::modified() +{ + doCaption(true); +} + +void AtlanticDesigner::doCaption(bool modified) +{ + setCaption(filename.isNull()? i18n("Atlantik Gameboard Editor") : filename, modified); + isMod = modified; +} + +void AtlanticDesigner::editGroups() +{ + if (groupEditor.isNull()) + { + groupEditor = new GroupEditor(&groups, this); + groupEditor->show(); + + connect(groupEditor, SIGNAL(changed()), this, SLOT(modified())); + connect(groupEditor, SIGNAL(update()), this, SLOT(groupsChanged())); + connect(groupEditor, SIGNAL(update()), editor, SLOT(groupsChanged())); + } + else + groupEditor->raise(); +} + +void AtlanticDesigner::goChanged(int id) +{ + ConfigEstate *curEstate = 0; + for (curEstate = estates.first(); curEstate; curEstate = estates.next()) + if (curEstate->go() && curEstate->id() != id) + curEstate->setGo(false); +} + +void AtlanticDesigner::groupsChanged() +{ + ConfigEstate *curEstate = 0; + for (curEstate = estates.first(); curEstate; curEstate = estates.next()) + { + for (ConfigEstateGroupList::Iterator it = groups.begin(); it != groups.end(); ++it) + { + if ((*it).name() == curEstate->group() && curEstate->type() == Street) + { + curEstate->setBgColor((*it).bgColor().isValid()? (*it).bgColor() : boardInfo.bgColor); + curEstate->setColor((*it).fgColor()); + curEstate->update(); + break; + } + } + } +} + +void AtlanticDesigner::updateBackground() +{ + ConfigEstate *curEstate = 0; + for (curEstate = estates.first(); curEstate; curEstate = estates.next()) + { + if (curEstate->type() != Street || (curEstate->type() == Street && curEstate->group().isNull())) + { + curEstate->setColor(QColor()); + curEstate->setBgColor(boardInfo.bgColor); + } + + if (curEstate->forceBg().isValid() && (curEstate->type() == FreeParking || curEstate->type() == Jail || curEstate->type() == ToJail)) + { + curEstate->setBgColor(curEstate->forceBg()); + } + + curEstate->update(); + } +} + +void AtlanticDesigner::info() +{ + if (boardInfoDlg.isNull()) + { + // non-modal + boardInfoDlg = new BoardInfoDlg(true, &boardInfo, this, "Board Information", false); + boardInfoDlg->show(); + + connect(boardInfoDlg, SIGNAL(okClicked()), this, SLOT(updateBackground())); + connect(boardInfoDlg, SIGNAL(okClicked()), this, SLOT(modified())); + } + else + boardInfoDlg->raise(); +} + +// now some fun functions ;) + +void AtlanticDesigner::up() +{ + if (editor->upArrow()) + return; + int fourth = max / 4; + int estateId = editor->theEstate()->id() + 1; + int dest = estateId - 1; + + if (estateId <= 2*fourth && estateId > fourth) // left side + dest++; + else if (estateId > (3*fourth + 1)) // right side + dest--; + else if (estateId == 1) + dest = max - 1; + + changeEstate(dest); +} + +void AtlanticDesigner::down() +{ + if (editor->downArrow()) + return; + int fourth = max / 4; + int estateId = editor->theEstate()->id() + 1; + int dest = estateId - 1; + + if (estateId <= (2*fourth + 1) && estateId > (fourth + 1)) // left side + dest--; + else if (estateId > 3*fourth && estateId < max) // right side + dest++; + else if (estateId == max) + dest = 0; + + changeEstate(dest); +} + +void AtlanticDesigner::left() +{ + if (editor->leftArrow()) + return; + int fourth = max / 4; + int estateId = editor->theEstate()->id() + 1; + int dest = estateId - 1; + + if (estateId <= fourth) // bottom + dest++; + else if (estateId > (2*fourth + 1) && estateId <= (3*fourth + 1)) // top + dest--; + + changeEstate(dest); +} + +void AtlanticDesigner::right() +{ + if (editor->rightArrow()) + return; + int fourth = max / 4; + int estateId = editor->theEstate()->id() + 1; + int dest = estateId - 1; + + if (estateId <= (fourth + 1) && estateId != 1) // bottom + dest--; + else if (estateId > 2*fourth && estateId <= 3*fourth) // top + dest++; + + changeEstate(dest); +} + +#include "designer.moc" diff --git a/atlantikdesigner/designer/designer.h b/atlantikdesigner/designer/designer.h new file mode 100644 index 0000000..91dd7b4 --- /dev/null +++ b/atlantikdesigner/designer/designer.h @@ -0,0 +1,106 @@ +#ifndef ATLANTK_DESIGNER_H +#define ATLANTK_DESIGNER_H + +#include +#include +#include +#include +#include + +#include + +#include "boardinfo.h" +#include "group.h" +#include "editor.h" + +class EstateEdit; +class QCloseEvent; +class KListAction; +class KRecentFilesAction; +class Estate; +class Player; +class ConfigEstate; +class AtlantikBoard; + +class AtlanticDesigner : public KMainWindow +{ + Q_OBJECT + + public: + AtlanticDesigner(QWidget *parent = 0, const char *name = 0); + ~AtlanticDesigner(); + + protected: + void closeEvent(QCloseEvent *); + + public slots: + void modified(); + + private slots: + void open(); + void openRecent(const KURL &); + void openNew(); + void save(); + void saveAs(); + void copy(); + void paste(); + void changeEstate(int); + void changeEstate(Estate *); + void movePlayer(Estate *); + void setPlayerAtBeginning(); + void info(); + void editGroups(); + void groupsChanged(); + void goChanged(int); + void updateBackground(); + + void up(); + void down(); + void left(); + void right(); + + void smaller(); + void larger(); + + void updateJumpMenu(); + + private: + void openFile(const QString &); + bool warnClose(); + void initBoard(); + void initMembers(); + void initToken(); + bool firstBoard; + ConfigEstate *newEstate(int); + + QGuardedPtr editor; + QGuardedPtr layout; + QGuardedPtr board; + QGuardedPtr groupEditor; + QGuardedPtr boardInfoDlg; + EstateList estates; + KListAction *estateAct; + KRecentFilesAction *recentAct; + + QValueList cards; + BoardInfo boardInfo; + ConfigEstateGroupList groups; + + QString filename; + + ConfigEstate *copiedEstate; + + void doCaption(bool); + + int max; + QStringList types; + + Player *m_player; + + bool isMod; + + QColor defaultFg; + QColor defaultBg; +}; + +#endif diff --git a/atlantikdesigner/designer/editor.cpp b/atlantikdesigner/designer/editor.cpp new file mode 100644 index 0000000..f092254 --- /dev/null +++ b/atlantikdesigner/designer/editor.cpp @@ -0,0 +1,938 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "editor.h" + +ConfigEstate::ConfigEstate(int estateId) : Estate(estateId) +{ + m_rent[0] = m_rent[1] = m_rent[2] = m_rent[3] = m_rent[4] = m_rent[5] = 0; + m_type = m_price = m_tax = m_taxPercentage = m_passMoney = 0; + m_go = false; + m_group = "Default"; + m_changed = false; +} + +void ConfigEstate::setChanged(bool b) +{ + m_changed = b; +} + +void ConfigEstate::setEstateId(const int estateId) +{ + if (m_id != estateId) + { + m_id = estateId; + m_changed = true; + } +} + +void ConfigEstate::setType(const int type) +{ + if (m_type != type) + { + m_type = type; + m_changed = true; + } +} + +void ConfigEstate::setGroup(const QString &group) +{ + if (m_group != group) + { + m_group = group; + m_changed = true; + } +} + +void ConfigEstate::setPrice(int price) +{ + if (m_price != price) + { + m_price = price; + m_changed = true; + } +} + +void ConfigEstate::setRent(const int houses, const int rent) +{ + if (m_rent[houses] != rent) + { + m_rent[houses] = rent; + m_changed = true; + } +} + +void ConfigEstate::setTax(const int tax) +{ + if (m_tax != tax) + { + m_tax = tax; + m_changed = true; + } +} + +void ConfigEstate::setTaxPercentage(const int taxPercentage) +{ + if (m_taxPercentage != taxPercentage) + { + m_taxPercentage = taxPercentage; + m_changed = true; + } +} + +void ConfigEstate::setTakeCard(const QString &takeCard) +{ + if (m_takeCard != takeCard) + { + m_takeCard = takeCard; + m_changed = true; + } +} + +void ConfigEstate::setForceBg(const QColor &forceBg) +{ + if (m_forceBg != forceBg) + { + m_forceBg = forceBg; + m_changed = true; + } +} + +void ConfigEstate::setGo(const bool go) +{ + if (m_go != go) + { + m_go = go; + m_changed = true; + } +} + +void ConfigEstate::setPassMoney(const int passMoney) +{ + if (m_passMoney != passMoney) + { + m_passMoney = passMoney; + m_changed = true; + } +} + +/////////////////////////// + +QStringList types; + +EstateEdit::EstateEdit(ConfigEstateGroupList *newGroups, EstateList *estates, QValueList *cards, QWidget *parent, const char *name) + : QWidget(parent, name) +{ + groups = newGroups; + + types.append("pay"); + types.append("payeach"); + types.append("collect"); + types.append("collecteach"); + types.append("advanceto"); + types.append("advance"); + types.append("goback"); + types.append("tojail"); + types.append("outofjail"); + types.append("nextutil"); + types.append("nextrr"); + types.append("payhouse"); + types.append("payhotel"); + + oldType = -1; + estate = 0; + this->cards = cards; + this->estates = estates; + ready = false; + locked = false; + + connect(this, SIGNAL(somethingChanged()), this, SLOT(saveEstate())); + + layout = new QGridLayout(this, 7, 1, KDialog::marginHint(), KDialog::spacingHint()); + nameEdit = new QLineEdit(this, "Name Edit"); + layout->addWidget(nameEdit, 0, 0); + connect(nameEdit, SIGNAL(returnPressed()), this, SIGNAL(somethingChanged())); + + confDlg = 0; + + layout->setRowStretch(2, 2); + + layout->addWidget(new KSeparator(this), 3, 0); + + QHBoxLayout *typeLayout = new QHBoxLayout(KDialog::spacingHint()); + layout->addLayout(typeLayout, 4, 0); + + QLabel *typeLabel = new QLabel(i18n("Type:"), this); + typeLayout->addWidget(typeLabel); + typeCombo = new KComboBox(false, this, "Type Combo"); + typeLayout->addWidget(typeCombo); + connect(typeCombo, SIGNAL(activated(int)), this, SIGNAL(somethingChanged())); + connect(typeCombo, SIGNAL(activated(int)), this, SIGNAL(updateBackground())); + + goCheck = new QCheckBox(i18n("This estate is 'Go'"), this); + connect(goCheck, SIGNAL(toggled(bool)), this, SIGNAL(somethingChanged())); + connect(goCheck, SIGNAL(toggled(bool)), this, SLOT(goToggled(bool))); + layout->addWidget(goCheck, 5, 0); + + QHBoxLayout *passMoneyLayout = new QHBoxLayout(KDialog::spacingHint()); + layout->addLayout(passMoneyLayout, 6, 0); + QLabel *passMoneyLabel = new QLabel(i18n("Pass money:"), this); + passMoneyLayout->addWidget(passMoneyLabel); + passMoney = new QSpinBox(0, 3000, 10, this); + passMoney->setSpecialValueText(i18n("None")); + passMoney->setSuffix("$"); + passMoneyLayout->addWidget(passMoney); + + QStringList estateTypes(i18n("Street")); + estateTypes.append(i18n("Cards")); + estateTypes.append(i18n("Free Parking")); + estateTypes.append(i18n("Go to Jail")); + estateTypes.append(i18n("Tax")); + estateTypes.append(i18n("Jail")); + typeCombo->insertStringList(estateTypes); +} + +void EstateEdit::aboutToDie() +{ + delete confDlg; + confDlg = 0; +} + +void EstateEdit::setReady(bool ready) +{ + this->ready = ready; +} + +void EstateEdit::resizeEvent(QResizeEvent *) +{ + emit resized(); +} + +void EstateEdit::setEstate(ConfigEstate *_estate) +{ + if (!_estate) + return; + + // why the hell is this here? :-) + while (1) + if (!locked) + break; + + estate = _estate; + + ready = false; + nameEdit->setText(estate->name()); + typeCombo->setCurrentItem(estate->type()); + goCheck->setChecked(estate->go()); + passMoney->setValue(estate->passMoney()); + + ready = true; + + saveEstate(true); +} + +ConfigEstate *EstateEdit::saveEstate(bool superficial) +{ + if (!estate || !ready) + return 0; + + locked = true; + + EstateType curType = (EstateType)typeCombo->currentItem(); + + if (!superficial) + { + confDlg->slotOk(); + + estate->setType(curType); + estate->setName(nameEdit->text()); + estate->setGo(goCheck->isChecked()); + estate->setPassMoney(passMoney->value()); + } + + if (curType != Street) + { + } + + if (!superficial) + estate->update(); + + configure(); + + locked = false; + + return estate; +} + +void EstateEdit::configure() +{ + if (oldType == typeCombo->currentItem()) + { + confDlg->slotUpdate(estate); + return; + } + + delete confDlg; + + switch (estate->type()) + { + case Street: + confDlg = new StreetDlg(groups, this); + break; + + case Tax: + confDlg = new TaxDlg(this); + break; + + case Cards: + confDlg = new CardsDlg(estates, cards, this); + break; + + case Jail: + case ToJail: + case FreeParking: + confDlg = new GenericDlg(this); + break; + + default: + confDlg = new EstateDlg(this); + break; + } + + confDlg->slotUpdate(estate); + + connect(confDlg, SIGNAL(updateBackground()), this, SIGNAL(updateBackground())); + + layout->addWidget(confDlg, 1, 0); + confDlg->show(); + + oldType = typeCombo->currentItem(); +} + +void EstateEdit::groupsChanged() +{ + confDlg->groupsChanged(); +} + +void EstateEdit::goToggled(bool on) +{ + if (on) + { + emit goChecked(estate->id()); + } +} + +bool EstateEdit::upArrow()const +{ + return (nameEdit->hasFocus() || typeCombo->hasFocus()); +} + +bool EstateEdit::downArrow()const +{ + return upArrow(); +} + +bool EstateEdit::leftArrow()const +{ + if (nameEdit->hasFocus()) + { + nameEdit->setCursorPosition(nameEdit->cursorPosition() - 1); + return true; + } + return false; +} + +bool EstateEdit::rightArrow()const +{ + if (nameEdit->hasFocus()) + { + nameEdit->setCursorPosition(nameEdit->cursorPosition() + 1); + return true; + } + return false; +} + +///////////////////////////////// + +TaxDlg::TaxDlg(QWidget *parent, char *name) + : EstateDlg(parent, name) +{ + QGridLayout *taxBox = new QGridLayout(this, 2, 2, KDialog::marginHint(), KDialog::spacingHint()); + taxBox->addWidget(new QLabel(i18n("Fixed tax:"), this), 0, 0); + taxBox->addWidget(tax = new QSpinBox(0, 3000, 1, this), 0, 1); + tax->setSpecialValueText(i18n("None")); + tax->setSuffix("$"); + taxBox->addWidget(new QLabel(i18n("Percentage tax:"), this), 1, 0); + taxBox->addWidget(taxPercentage = new QSpinBox(0, 100, 1, this), 1, 1); + taxPercentage->setSpecialValueText(i18n("None")); + taxPercentage->setSuffix("%"); +} + +void TaxDlg::save() +{ + estate->setTax(tax->value()); + estate->setTaxPercentage(taxPercentage->value()); +} + +void TaxDlg::update() +{ + tax->setValue(estate->tax()); + taxPercentage->setValue(estate->taxPercentage()); +} + +///////////////////////////////// + +GenericDlg::GenericDlg(QWidget *parent, char *name) + : EstateDlg(parent, name) +{ + QHBoxLayout *layout = new QHBoxLayout(this, KDialog::spacingHint()); + layout->addWidget(new QLabel(i18n("Background:"), this)); + + col = new KColorButton(this); + layout->addWidget(col); +} + +void GenericDlg::save() +{ + estate->setForceBg(col->color()); + emit updateBackground(); +} + +void GenericDlg::update() +{ + col->setColor(estate->forceBg()); +} + +///////////////////////////////// + +CardsDlg::CardsDlg(EstateList *newEstates, QValueList *newCards, QWidget *parent, char *name) + : EstateDlg(parent, name) +{ + estates = newEstates; + stacks = newCards; + + view = 0; + + vlayout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + + QHBoxLayout *layout = new QHBoxLayout(vlayout, KDialog::spacingHint()); + + KPushButton *addB = new KPushButton(i18n("&New Stack"), this); + connect(addB, SIGNAL(clicked()), this, SLOT(addStack())); + layout->addWidget(addB); + layout->addStretch(); + + layout->addWidget(new QLabel(i18n("Cards from"), this)); + QStringList cardNames; + for (QValueList::Iterator it = stacks->begin(); it != stacks->end(); ++it) + cardNames.append((*it).name()); + + cards = new QComboBox(this); + cards->insertStringList(cardNames); + layout->addWidget(cards); + connect(cards, SIGNAL(activated(const QString &)), this, SLOT(updateView(const QString &))); + + vlayout->addWidget(new KSeparator(this)); +} + +void CardsDlg::addStack() +{ + bool ok; + QString name = KLineEditDlg::getText(i18n("Add Stack"), i18n("Enter the name of the new stack:"), QString::null, &ok, this); + if (ok) + { + for (QValueList::Iterator it = stacks->begin(); it != stacks->end(); ++it) + { + if ((*it).name() == name) + { + KMessageBox::information(this, i18n("That name is already on the list.")); + return; + } + } + + stacks->append(CardStack(name)); + cards->insertItem(name); + cards->setCurrentText(name); + updateView(name); + } +} + +void CardsDlg::updateView(const QString &curName) +{ + CardStack *curStack = 0; + for (QValueList::Iterator it = stacks->begin(); it != stacks->end(); ++it) + if ((*it).name() == curName) + curStack = &(*it); + + if (!curStack) + return; + + delete view; + view = new CardView(estates, curStack, this); + vlayout->addWidget(view); + view->show(); +} + +void CardsDlg::save() +{ + estate->setTakeCard(cards->currentText()); +} + +void CardsDlg::update() +{ + if (!estate->takeCard().isNull()) + { + cards->setCurrentText(estate->takeCard()); + updateView(estate->takeCard()); + } + else + cards->setCurrentItem(-1); +} + +///////////////////////////////// + +ChooseWidget::ChooseWidget(EstateList *estates, int id, Card *card, QWidget *parent, char *name) + : QWidget (parent, name) +{ + this->id = id; + this->card = card; + this->estates = estates; + + value = 0; + estate = 0; + number = true; + prevNumber = true; + init = true; + + value = 0; + + hlayout = new QHBoxLayout(this, KDialog::spacingHint()); + typeCombo = new KComboBox(this); + QStringList _types(i18n("Pay")); + _types.append(i18n("Pay Each Player")); + _types.append(i18n("Collect")); + _types.append(i18n("Collect From Each Player")); + _types.append(i18n("Advance To")); + _types.append(i18n("Advance")); + _types.append(i18n("Go Back")); + _types.append(i18n("Go to Jail")); + _types.append(i18n("Get out of Jail Free Card")); + _types.append(i18n("Advance to Nearest Utility")); + _types.append(i18n("Advance to Nearest Railroad")); + _types.append(i18n("Pay for Each House")); + _types.append(i18n("Pay for Each Hotel")); + typeCombo->insertStringList(_types); + hlayout->addWidget(typeCombo); + connect(typeCombo, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); + + hlayout->addStretch(); +} + +void ChooseWidget::valueChanged(int i) +{ + if (!value) + return; + (*card->values.at(id)) = i; + value->setValue(i); +} + +void ChooseWidget::estateChanged(int i) +{ + if (!estate) + return; + + (*card->values.at(id)) = i; + estate->setCurrentItem(i); +} + +void ChooseWidget::typeChanged(int i) +{ + QString key = (*types.at(i)); + + (*card->keys.at(id)) = key; + typeCombo->setCurrentItem(i); + + number = key != "advanceto"; + + if (prevNumber == number && !init) + goto Skipped; + + if (number) + { + delete estate; + estate = 0; + + value = new QSpinBox(0, 2000, (key == "advance" || key == "goback")? 1 : 5, this); + + hlayout->addWidget(value); + connect(value, SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int))); + + value->show(); + } + else + { + delete value; + value = 0; + estate = new KComboBox(this); + ConfigEstate *curestate = 0; + QStringList estateStrings; + for (curestate = estates->first(); curestate; curestate = estates->next()) + estateStrings.append(curestate->name()); + estate->insertStringList(estateStrings); + connect(estate, SIGNAL(activated(int)), this, SLOT(estateChanged(int))); + + hlayout->addWidget(estate); + estate->show(); + } + + prevNumber = number; + +Skipped: + init = false; + + if (!number) + return; + + bool boolean = (key == "outofjail" || key == "tojail" || key == "nextrr" || key == "nextutil"); + if (boolean) + { + value->setValue(1); + valueChanged(1); + } + value->setEnabled(!boolean); + + QString suffix = ""; + QString prefix = ""; + + // first four types are money, pay, payeach, collect, collecteach + if (i < 4 || key == "payhouse" || key == "payhotel") + suffix = "$"; + else if (key == "advance" || key == "goback") + suffix = i18n("Estate(s)").prepend(" "); + + value->setPrefix(prefix); + value->setSuffix(suffix); +} + +///////////////////////////////// + +CardView::CardView(EstateList *estates, CardStack *stack, QWidget *parent, char *name) : QWidget(parent, name) +{ + card = 0; + + this->stack = stack; + this->estates = estates; + + choosies.setAutoDelete(true); + + layout = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + QHBoxLayout *hlayout = new QHBoxLayout(layout, KDialog::spacingHint()); + + addButton = new KPushButton(i18n("&Add Card..."), this); + connect(addButton, SIGNAL(clicked()), this, SLOT(add())); + hlayout->addWidget(addButton); + hlayout->addStretch(); + renameButton = new KPushButton(i18n("&Rename..."), this); + connect(renameButton, SIGNAL(clicked()), this, SLOT(rename())); + hlayout->addWidget(renameButton); + hlayout->addStretch(); + delButton = new KPushButton(i18n("&Delete"), this); + connect(delButton, SIGNAL(clicked()), this, SLOT(del())); + hlayout->addWidget(delButton); + + List = new KListBox(this); + layout->addWidget(List); + connect(List, SIGNAL(highlighted(int)), this, SLOT(selected(int))); + + // it gets very big (and won't shrink) otherwise + List->setMaximumHeight(90); + + hlayout = new QHBoxLayout(layout, KDialog::spacingHint()); + moreButton = new KPushButton(i18n("&More Properties"), this); + connect(moreButton, SIGNAL(clicked()), this, SLOT(more())); + hlayout->addWidget(moreButton); + hlayout->addStretch(); + lessButton = new KPushButton(i18n("&Fewer Properties"), this); + connect(lessButton, SIGNAL(clicked()), this, SLOT(less())); + hlayout->addWidget(lessButton); + + for (CardStack::Iterator it = stack->begin(); it != stack->end(); ++it) + List->insertItem((*it).name); + + updateButtonsEnabled(); +} + +void CardView::more() +{ + if (!card) + return; + + card->keys.append("pay"); + card->values.append(0); + ChooseWidget *newChooseWidget = new ChooseWidget(estates, choosies.count(), card, this); + newChooseWidget->typeChanged(0); + newChooseWidget->valueChanged(0); + + choosies.append(newChooseWidget); + layout->addWidget(newChooseWidget); + + newChooseWidget->show(); + + updateButtonsEnabled(); +} + +void CardView::less() +{ + if (List->count() <= 0 || choosies.count() <= 0) + return; + + choosies.removeLast(); + card->keys.pop_back(); + card->values.pop_back(); + + updateButtonsEnabled(); +} + +void CardView::add() +{ + bool ok = false; + QString name = KLineEditDlg::getText(i18n("Add Card"), i18n("Enter the name of the new card:"), QString::null, &ok, this); + if (ok) + List->insertItem(name, 0); + + choosies.clear(); + + stack->prepend(Card(name)); + + List->setCurrentItem(0); + + more(); + + updateButtonsEnabled(); +} + +void CardView::rename() +{ + int curItem = List->currentItem(); + if (curItem < 0) + return; + + bool ok = false;; + QString name = KLineEditDlg::getText(i18n("Add Card"), i18n("Enter the name of the new card:"), (*stack->at(curItem)).name, &ok, this); + if (ok) + { + (*stack->at(curItem)).name = name; + List->changeItem(name, curItem); + } + + updateButtonsEnabled(); +} + +void CardView::del() +{ + int curItem = List->currentItem(); + + // for some reason, crashes if count == 0 + if (curItem < 0 || List->count() <= 1) + return; + + List->removeItem(curItem); + stack->remove(stack->at(curItem)); + choosies.clear(); + + updateButtonsEnabled(); +} + +void CardView::selected(int i) +{ + choosies.clear(); + + card = &(*stack->at(i)); + unsigned int num = card->keys.count(); + + QValueList::Iterator vit = card->values.begin(); + for (QStringList::Iterator it = card->keys.begin(); it != card->keys.end(); ++it) + { + ChooseWidget *newChooseWidget = new ChooseWidget(estates, choosies.count(), card, this); + + choosies.append(newChooseWidget); + layout->addWidget(newChooseWidget); + + newChooseWidget->show(); + + newChooseWidget->typeChanged(types.findIndex(*it)); + newChooseWidget->valueChanged(*vit); + newChooseWidget->estateChanged(*vit); + + ++vit; + } + + if (num == 0) + { + card->values.clear(); + more(); + } + + updateButtonsEnabled(); +} + +void CardView::updateButtonsEnabled() +{ + int curItem = List->currentItem(); + int count = List->count(); + delButton->setEnabled(!(curItem < 0 || count <= 1)); + renameButton->setEnabled(!(curItem < 0)); + moreButton->setEnabled(card); + lessButton->setEnabled(!(count <= 0 || choosies.count() <= 0)); +} + +///////////////////////////////// + +StreetDlg::StreetDlg(ConfigEstateGroupList *newGroups, QWidget *parent, char *name) + : EstateDlg(parent, name) +{ + groups = newGroups; + + QVBoxLayout *bigbox = new QVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + + QVGroupBox *RentPage = new QVGroupBox(i18n("&Rent by Number of Houses"), this); + RentPage->setInsideSpacing(KDialog::spacingHint()); + RentPage->setInsideMargin(KDialog::marginHint()); + bigbox->addWidget(RentPage); + QWidget *topRent = new QWidget(RentPage); + QGridLayout *rentBox = new QGridLayout(topRent, 3, 3, KDialog::spacingHint()); + rentBox->addWidget(new QLabel(i18n("None:"), topRent), 0, 0); + rentBox->addWidget(new QLabel(i18n("One:"), topRent), 0, 1); + rentBox->addWidget(new QLabel(i18n("Two:"), topRent), 0, 2); + rentBox->addWidget(new QLabel(i18n("Three:"), topRent), 2, 0); + rentBox->addWidget(new QLabel(i18n("Four:"), topRent), 2, 1); + rentBox->addWidget(new QLabel(i18n("Hotel:"), topRent), 2, 2); + + rentBox->addWidget(houses0 = new QSpinBox(0, 3000, 1, topRent), 1, 0); + rentBox->addWidget(houses1 = new QSpinBox(0, 3000, 1, topRent), 1, 1); + rentBox->addWidget(houses2 = new QSpinBox(0, 3000, 1, topRent), 1, 2); + rentBox->addWidget(houses3 = new QSpinBox(0, 3000, 1, topRent), 3, 0); + rentBox->addWidget(houses4 = new QSpinBox(0, 3000, 1, topRent), 3, 1); + rentBox->addWidget(houses5 = new QSpinBox(0, 3000, 1, topRent), 3, 2); + houses0->setSuffix(i18n("$")); + houses0->setSpecialValueText(i18n("None")); + houses1->setSuffix(i18n("$")); + houses1->setSpecialValueText(i18n("None")); + houses2->setSuffix(i18n("$")); + houses2->setSpecialValueText(i18n("None")); + houses3->setSuffix(i18n("$")); + houses3->setSpecialValueText(i18n("None")); + houses4->setSuffix(i18n("$")); + houses4->setSpecialValueText(i18n("None")); + houses5->setSuffix(i18n("$")); + houses5->setSpecialValueText(i18n("None")); + + QGridLayout *pricesBox = new QGridLayout(bigbox, 2, 2, KDialog::spacingHint()); + pricesBox->addWidget(new QLabel(i18n("Price:"), this), 0, 0); + pricesBox->addWidget(price = new QSpinBox(0, 3000, 25, this), 0, 1); + price->setSpecialValueText(i18n("None")); + price->setSuffix(i18n("$")); + + QLabel *groupLabel = new QLabel(i18n("Group:"), this); + pricesBox->addWidget(groupLabel, 1, 0); + groupCombo = new KComboBox(this, "Group Combo"); + groupUpdate(); + connect(groupCombo, SIGNAL(activated(const QString &)), this, SLOT(groupChanged(const QString &))); + + pricesBox->addWidget(groupCombo, 1, 1); +} + +void StreetDlg::groupChanged(const QString &groupName) +{ + for (ConfigEstateGroupList::Iterator it = groups->begin(); it != groups->end(); ++it) + { + if ((*it).name() == groupName) + { + if ( (*it).fgColor().isValid() ) + estate->setColor((*it).fgColor()); + if ( (*it).bgColor().isValid() ) + estate->setBgColor((*it).bgColor()); + estate->update(); + + break; + } + } +} + +void StreetDlg::groupUpdate() +{ + QString curGroupName = groupCombo->currentText(); + + QStringList newGroups; + for (ConfigEstateGroupList::Iterator it = groups->begin(); it != groups->end(); ++it) + newGroups.append((*it).name()); + + groupCombo->clear(); + groupCombo->insertStringList(newGroups); + + if (!curGroupName.isNull()) + { + groupCombo->setCurrentText(curGroupName); + groupChanged(curGroupName); + } +} + +void StreetDlg::save() +{ + estate->setRent(0, houses0->value()); + estate->setRent(1, houses1->value()); + estate->setRent(2, houses2->value()); + estate->setRent(3, houses3->value()); + estate->setRent(4, houses4->value()); + estate->setRent(5, houses5->value()); + estate->setPrice(price->value()); + estate->setGroup(groupCombo->currentText()); +} + +void StreetDlg::update() +{ + houses0->setValue(estate->rent(0)); + houses1->setValue(estate->rent(1)); + houses2->setValue(estate->rent(2)); + houses3->setValue(estate->rent(3)); + houses4->setValue(estate->rent(4)); + houses5->setValue(estate->rent(5)); + + price->setValue(estate->price()); + + if (estate->group().isEmpty()) + { + groupCombo->setCurrentText("Default"); + estate->setGroup("Default"); + } + else + groupCombo->setCurrentText(estate->group()); + + groupChanged(estate->group()); +} + +#include "editor.moc" diff --git a/atlantikdesigner/designer/editor.h b/atlantikdesigner/designer/editor.h new file mode 100644 index 0000000..be6d63a --- /dev/null +++ b/atlantikdesigner/designer/editor.h @@ -0,0 +1,310 @@ +#ifndef ATLANTIK_EDITOR_H +#define ATLANTIK_EDITOR_H + +#include +#include +#include +#include + +#include + +#include "group.h" + +class QCheckBox; +class QGridLayout; +class QLineEdit; +class QSpinBox; + +class KColorButton; +class KComboBox; +class KListBox; +class KPushButton; + +enum EstateType { Street = 0, Cards, FreeParking, ToJail, Tax, Jail }; + +class ConfigEstate : public Estate +{ + public: + ConfigEstate(int estateId); + void setEstateId(const int estateId); + int type()const { return m_type; } + void setType(const int type); + const QString &group() { return m_group; } + void setGroup(const QString &group); + int price()const { return m_price; } + void setPrice(int); + int rent(int _h)const { return m_rent[_h]; } + void setRent(const int, const int); + int tax()const { return m_tax; } + void setTax(const int); + int taxPercentage() { return m_taxPercentage; } + void setTaxPercentage(const int); + const QString &takeCard() { return m_takeCard; } + void setTakeCard(const QString &); + const QColor &forceBg() { return m_forceBg; } + void setForceBg(const QColor &); + bool go()const { return m_go; } + void setGo(const bool); + int passMoney()const { return m_passMoney; } + void setPassMoney(const int); + + void setChanged(bool); + + private: + int m_type; + QString m_group; + int m_rent[6]; + int m_price; + int m_tax; + int m_taxPercentage; + QString m_takeCard; + QColor m_forceBg; + bool m_go; + int m_passMoney; +}; +typedef QPtrList EstateList; + +struct Card +{ + Card() {} + Card(const QString &newName) { name = newName; } + QString name; + QStringList keys; + QValueList values; +}; +class CardStack : public QValueList +{ + public: + CardStack() {} + CardStack(const QString &newName) { setName(newName); } + const QString &name() { return m_name; } + void setName(const QString &newName) { m_name = newName; } + + private: + QString m_name; +}; + +class EstateDlg : public QWidget +{ + Q_OBJECT + + public: + EstateDlg(QWidget *parent = 0, char *name = 0) : QWidget(parent, name) { estate = 0; } + + signals: + void updateBackground(); + + public slots: + virtual void slotOk() { save(); } + void slotUpdate(ConfigEstate *newEstate) { estate = newEstate; if (estate) update(); } + void groupsChanged() { groupUpdate(); } + + protected: + virtual void update() {} + virtual void save() {} + virtual void groupUpdate() {} + ConfigEstate *estate; +}; + +class EstateEdit : public QWidget +{ + Q_OBJECT + + public: + EstateEdit(ConfigEstateGroupList *, EstateList *, QValueList *, QWidget *parent = 0, const char *name = 0); + ConfigEstate *theEstate() { return estate; } + bool upArrow()const; + bool downArrow()const; + bool leftArrow()const; + bool rightArrow()const; + void aboutToDie(); + void setReady(bool); + + public slots: + void setEstate(ConfigEstate *); + ConfigEstate *saveEstate(bool superficial = false); + void groupsChanged(); + + signals: + void somethingChanged(); + void modified(); + void updateBackground(); + void goChecked(int id); + void resized(); + + protected: + void resizeEvent(QResizeEvent *); + + private slots: + void configure(); + void goToggled(bool); + + private: + KComboBox *typeCombo; + QLineEdit *nameEdit; + QCheckBox *goCheck; + QSpinBox *passMoney; + QWidget *centerWidget; + QGridLayout *layout; + + EstateList *estates; + QValueList *cards; + ConfigEstateGroupList *groups; + + ConfigEstate *estate; + + EstateDlg *confDlg; + + int oldType; + + bool ready; + bool locked; +}; + +class ChooseWidget : public QWidget +{ + Q_OBJECT + + public: + ChooseWidget(EstateList *, int id, Card *, QWidget *parent = 0, char *name = 0); + + public slots: + void typeChanged(int); + void valueChanged(int); + void estateChanged(int); + + private: + Card *card; + KComboBox *typeCombo; + QSpinBox *value; + KComboBox *estate; + bool number; + bool prevNumber; + bool init; + QHBoxLayout *hlayout; + + EstateList *estates; + + int id; +}; + +class CardView : public QWidget +{ + Q_OBJECT + + public: + CardView(EstateList *, CardStack *, QWidget *parent = 0, char *name = 0); + + private slots: + void selected(int); + void add(); + void del(); + void rename(); + void more(); + void less(); + void updateButtonsEnabled(); + + private: + KListBox *List; + KPushButton *addButton; + KPushButton *renameButton; + KPushButton *delButton; + KPushButton *moreButton; + KPushButton *lessButton; + + EstateList *estates; + + QVBoxLayout *layout; + + Card *card; + + CardStack *stack; + QPtrList choosies; +}; + +class TaxDlg : public EstateDlg +{ + Q_OBJECT + + public: + TaxDlg(QWidget *parent = 0, char *name = 0); + + protected: + virtual void save(); + virtual void update(); + + private: + QSpinBox *tax; + QSpinBox *taxPercentage; +}; + +class GenericDlg : public EstateDlg +{ + Q_OBJECT + + public: + GenericDlg(QWidget *parent = 0, char *name = 0); + + protected: + virtual void save(); + virtual void update(); + + private: + KColorButton *col; +}; + +class CardsDlg : public EstateDlg +{ + Q_OBJECT + + public: + CardsDlg(EstateList *, QValueList *, QWidget *parent = 0, char *name = 0); + + protected: + virtual void save(); + virtual void update(); + + private slots: + void addStack(); + void updateView(const QString &); + + private: + QValueList *stacks; + EstateList *estates; + + QComboBox *cards; + CardView *view; + QVBoxLayout *vlayout; +}; + +class StreetDlg : public EstateDlg +{ + Q_OBJECT + + public: + StreetDlg(ConfigEstateGroupList *, QWidget *parent = 0, char *name = 0); + + protected: + virtual void save(); + virtual void update(); + virtual void groupUpdate(); + + private slots: + void groupChanged(const QString &); + + private: + QSpinBox *houses0; + QSpinBox *houses1; + QSpinBox *houses2; + QSpinBox *houses3; + QSpinBox *houses4; + QSpinBox *houses5; + QSpinBox *price; + KComboBox *groupCombo; + + ConfigEstateGroupList *groups; + + ConfigEstateGroup *curGroup(); +}; + +#endif diff --git a/atlantikdesigner/designer/group.cpp b/atlantikdesigner/designer/group.cpp new file mode 100644 index 0000000..41f7c6f --- /dev/null +++ b/atlantikdesigner/designer/group.cpp @@ -0,0 +1,242 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "group.h" + +GroupEditor::GroupEditor(ConfigEstateGroupList *newList, QWidget *parent) + : KDialogBase(KDialogBase::Plain, i18n("Group Editor"), Ok|Apply|Cancel, Ok, parent, "Group Editor", false, true), mylist(*newList) +{ + setWFlags(WDestructiveClose); + list = newList; + + QFrame *page = plainPage(); + QHBoxLayout *hlayout = new QHBoxLayout(page, marginHint(), spacingHint()); + + groups = new KListBox(page); + hlayout->addWidget(groups); + connect(groups, SIGNAL(highlighted(QListBoxItem *)), this, SLOT(updateSettings(QListBoxItem *))); + QStringList newgroups; + for (ConfigEstateGroupList::Iterator it = list->begin(); it != list->end(); ++it) + newgroups.append((*it).name()); + groups->insertStringList(newgroups); + connect(groups, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); + + QVBoxLayout *vlayout = new QVBoxLayout(hlayout, spacingHint()); + colorGroupBox = new QVGroupBox(i18n("&Colors"), page); + vlayout->addWidget(colorGroupBox); + + (void) new QLabel(i18n("Foreground:"), colorGroupBox); + fgButton = new KColorButton(colorGroupBox, "Foreground Button"); + connect(fgButton, SIGNAL(changed(const QColor &)), this, SLOT(fgChanged(const QColor &))); + connect(fgButton, SIGNAL(changed(const QColor &)), this, SIGNAL(changed())); + + (void) new QLabel(i18n("Background:"), colorGroupBox); + bgButton = new KColorButton(colorGroupBox, "Background Button"); + connect(bgButton, SIGNAL(changed(const QColor &)), this, SLOT(bgChanged(const QColor &))); + connect(bgButton, SIGNAL(changed(const QColor &)), this, SIGNAL(changed())); + + pricesGroupBox = new QVGroupBox(i18n("&Prices"), page); + vlayout->addWidget(pricesGroupBox); + + pricesWidget = new QWidget(pricesGroupBox); + QGridLayout *pricesLayout = new QGridLayout(pricesWidget, 2, 2, 0, spacingHint()); + pricesLayout->addWidget(new QLabel(i18n("House price:"), pricesWidget), 0, 0); + pricesLayout->addWidget(housePrice = new QSpinBox(0, 3000, 25, pricesWidget), 0, 1); + housePrice->setSpecialValueText(i18n("None")); + housePrice->setSuffix(i18n("$")); + connect(housePrice, SIGNAL(valueChanged(int)), this, SLOT(housePriceChanged(int))); + + pricesLayout->addWidget(new QLabel(i18n("Global price:"), pricesWidget), 1, 0); + pricesLayout->addWidget(globalPrice = new QSpinBox(0, 3000, 25, pricesWidget), 1, 1); + globalPrice->setSpecialValueText(i18n("None")); + globalPrice->setSuffix(i18n("$")); + connect(globalPrice, SIGNAL(valueChanged(int)), this, SLOT(globalPriceChanged(int))); + + dynamicGroupBox = new QVGroupBox(i18n("&Dynamic Rent"), page); + vlayout->addWidget(dynamicGroupBox); + + mathWidget = new QWidget(dynamicGroupBox); + QGridLayout *mathLayout = new QGridLayout(mathWidget, 2, 2, 0, spacingHint()); + mathLayout->addWidget(new QLabel(i18n("Add rent variable:"), mathWidget), 0, 0); + mathLayout->addWidget(new QLabel(i18n("Expression:"), mathWidget), 1, 0); + + QComboBox *rentVarCombo = new QComboBox(mathWidget); + QStringList vars; + vars << "DICE"; + vars << "HOUSES"; + vars << "GROUPOWNED"; + rentVarCombo->insertStringList(vars); + mathLayout->addWidget(rentVarCombo, 0, 1); + + rentMathEdit = new KLineEdit(mathWidget); + connect(rentMathEdit, SIGNAL(textChanged(const QString &)), this, SLOT(rentMathChanged(const QString &))); + connect(rentVarCombo, SIGNAL(activated(const QString &)), rentMathEdit, SLOT(insert(const QString &))); + mathLayout->addWidget(rentMathEdit, 1, 1); + + QHBoxLayout *buttonlayout = new QHBoxLayout(vlayout, spacingHint()); + KPushButton *addB = new KPushButton(i18n("&Add..."), page); + buttonlayout->addWidget(addB); + connect(addB, SIGNAL(clicked()), this, SLOT(add())); + + removeB = new KPushButton(i18n("&Remove"), page); + buttonlayout->addWidget(removeB); + connect(removeB, SIGNAL(clicked()), this, SLOT(remove())); + + selectionChanged(); +} + +void GroupEditor::add() +{ + bool ok; + QString name = KLineEditDlg::getText(i18n("Add Group"), i18n("Enter the name of the new group:"), QString::null, &ok, this); + if (ok) + { + for (ConfigEstateGroupList::Iterator it = mylist.begin(); it != mylist.end(); ++it) + { + if ((*it).name() == name) + { + KMessageBox::information(this, i18n("That group is already on the list.")); + return; + } + } + + mylist.append(ConfigEstateGroup(name)); + groups->insertItem(name); + + emit changed(); + } +} + +void GroupEditor::remove() +{ + QString curText = groups->currentText(); + if (!curText.isNull()) + { + groups->removeItem(groups->currentItem()); + for (ConfigEstateGroupList::Iterator it = mylist.begin(); it != mylist.end(); ++it) + { + if ((*it).name() == curText) + { + mylist.remove(it); + break; + } + } + + emit changed(); + } +} + +void GroupEditor::updateSettings(QListBoxItem *item) +{ + if (!mylist.size()) + return; + + if (!item) + return; + + for (ConfigEstateGroupList::Iterator it = mylist.begin(); it != mylist.end() ; ++it) + { + if ((*it).name() == item->text()) + { + fgButton->setColor((*it).fgColor()); + bgButton->setColor((*it).bgColor()); + housePrice->setValue((*it).housePrice()); + globalPrice->setValue((*it).globalPrice()); + rentMathEdit->setText((*it).rentMath()); + break; + } + } +} + +ConfigEstateGroup *GroupEditor::currentGroup() +{ + QListBoxItem *item = groups->item(groups->currentItem()); + if (!item) + return 0; + + for (ConfigEstateGroupList::Iterator it = mylist.begin(); it != mylist.end(); ++it) + if ((*it).name() == item->text()) + return &(*it); + + return 0; +} + +void GroupEditor::fgChanged(const QColor &color) +{ + ConfigEstateGroup *group = currentGroup(); + if (group) + group->setFgColor(color); +} + +void GroupEditor::bgChanged(const QColor &color) +{ + ConfigEstateGroup *group = currentGroup(); + if (group) + group->setBgColor(color); +} + +void GroupEditor::housePriceChanged(int newValue) +{ + ConfigEstateGroup *group = currentGroup(); + if (group) + group->setHousePrice(newValue); +} + +void GroupEditor::globalPriceChanged(int newValue) +{ + ConfigEstateGroup *group = currentGroup(); + if (group) + group->setGlobalPrice(newValue); +} + +void GroupEditor::rentMathChanged(const QString &newValue) +{ + ConfigEstateGroup *group = currentGroup(); + if (group) + { + group->setRentMath(newValue); + } +} + +void GroupEditor::slotApply() +{ + *list = mylist; + + KDialogBase::slotApply(); + + emit update(); +} + +void GroupEditor::slotOk() +{ + slotApply(); + + KDialogBase::slotOk(); +} + +void GroupEditor::selectionChanged() +{ + bool issel = groups->currentItem() >= 0; + colorGroupBox->setEnabled(issel); + pricesGroupBox->setEnabled(issel); + dynamicGroupBox->setEnabled(issel); + removeB->setEnabled(issel); +} + +#include "group.moc" diff --git a/atlantikdesigner/designer/group.h b/atlantikdesigner/designer/group.h new file mode 100644 index 0000000..b1ebf99 --- /dev/null +++ b/atlantikdesigner/designer/group.h @@ -0,0 +1,99 @@ +#ifndef GROUP_H +#define GROUP_H + +#include +#include + +#include + +#include + +class KColorButton; +class KLineEdit; +class KListBox; +class KPushButton; + +class QComboBox; +class QListBoxItem; +class QSpinBox; +class QVGroupBox; + +class ConfigEstateGroup +{ + public: + ConfigEstateGroup() { init(); } + ConfigEstateGroup(const QString &name) { setName(name); init(); } + void init() { setHousePrice(0); setGlobalPrice(0); } + + void setHousePrice(int newPrice) { m_housePrice = newPrice; } + int housePrice()const { return m_housePrice; } + void setGlobalPrice(int newGlobalPrice) { m_globalPrice = newGlobalPrice; } + int globalPrice()const { return m_globalPrice; } + const QString &rentMath() { return m_rentMath; } + void setRentMath(const QString &newMath) { m_rentMath = newMath; } + bool dynamicRent()const { return !m_rentMath.isEmpty(); } + void setName(const QString &name) { m_name = name; } + const QString &name() { return m_name; } + + const QColor &fgColor() { return m_fgColor; } + void setFgColor(const QColor &color) { m_fgColor = color; } + const QColor &bgColor() { return m_bgColor; } + void setBgColor(const QColor &color) { m_bgColor = color; } + + private: + QColor m_fgColor; + QColor m_bgColor; + QString m_rentMath; + int m_housePrice; + int m_globalPrice; + QString m_name; +}; +typedef QValueList ConfigEstateGroupList; + +class GroupEditor : public KDialogBase +{ + Q_OBJECT + + public: + GroupEditor(ConfigEstateGroupList *, QWidget *parent=0); + + signals: + void changed(); + void update(); + + protected slots: + virtual void slotOk(); + virtual void slotApply(); + + private slots: + void updateSettings(QListBoxItem *item); + void fgChanged(const QColor &); + void bgChanged(const QColor &); + void housePriceChanged(int); + void globalPriceChanged(int); + void rentMathChanged(const QString &); + void add(); + void remove(); + void selectionChanged(); + + private: + KListBox *groups; + KLineEdit *rentMathEdit; + KColorButton *fgButton; + KColorButton *bgButton; + QWidget *pricesWidget; + QWidget *mathWidget; + QSpinBox *housePrice; + QSpinBox *globalPrice; + QVGroupBox *colorGroupBox; + QVGroupBox *pricesGroupBox; + QVGroupBox *dynamicGroupBox; + KPushButton *removeB; + + ConfigEstateGroupList *list; + ConfigEstateGroupList mylist; + + ConfigEstateGroup *currentGroup(); +}; + +#endif diff --git a/atlantikdesigner/designer/main.cpp b/atlantikdesigner/designer/main.cpp new file mode 100644 index 0000000..b7dee10 --- /dev/null +++ b/atlantikdesigner/designer/main.cpp @@ -0,0 +1,37 @@ +#include +#include +#include +#include + +#include "designer.h" + +int main(int argc, char *argv[]) +{ + KAboutData aboutData( + "atlantikdesigner", + I18N_NOOP("Atlantik Designer"), "1.1.0", + I18N_NOOP("Atlantik gameboard designer"), + KAboutData::License_GPL, + I18N_NOOP("(c) 2002 Jason Katz-Brown"), + 0, + "http://www.unixcode.org/atlantik/" + ); + + aboutData.addAuthor("Jason Katz-Brown", I18N_NOOP("main author"), "jason@katzbrown.com", "http://katzbrown.com/"); + aboutData.addAuthor("Rob Kaper", I18N_NOOP("libatlantikui"), "cap@capsi.com", "http://capsi.com/"); + + KCmdLineArgs::init(argc, argv, &aboutData); + + KApplication kapplication; + + if (kapplication.isRestored()) + RESTORE(AtlanticDesigner) + else + { + AtlanticDesigner *designer = new AtlanticDesigner; + designer->show(); + } + + return kapplication.exec(); +} + diff --git a/atlantikdesigner/pics/Makefile.am b/atlantikdesigner/pics/Makefile.am new file mode 100644 index 0000000..82d6695 --- /dev/null +++ b/atlantikdesigner/pics/Makefile.am @@ -0,0 +1 @@ +KDE_ICON = atlantikdesigner diff --git a/atlantikdesigner/pics/hi16-app-atlantikdesigner.png b/atlantikdesigner/pics/hi16-app-atlantikdesigner.png new file mode 100644 index 0000000..8eb628b Binary files /dev/null and b/atlantikdesigner/pics/hi16-app-atlantikdesigner.png differ diff --git a/atlantikdesigner/pics/hi32-app-atlantikdesigner.png b/atlantikdesigner/pics/hi32-app-atlantikdesigner.png new file mode 100644 index 0000000..881a148 Binary files /dev/null and b/atlantikdesigner/pics/hi32-app-atlantikdesigner.png differ diff --git a/configure.in.in b/configure.in.in new file mode 100644 index 0000000..0825d68 --- /dev/null +++ b/configure.in.in @@ -0,0 +1,4 @@ +#MIN_CONFIG + +AC_CHECK_SETENV +CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS" diff --git a/doc/Makefile.am b/doc/Makefile.am new file mode 100644 index 0000000..6812bd2 --- /dev/null +++ b/doc/Makefile.am @@ -0,0 +1,5 @@ + +KDE_LANG = en +KDE_DOCS = AUTO +SUBDIRS = $(AUTODIRS) + diff --git a/doc/kate-plugins/Makefile.am b/doc/kate-plugins/Makefile.am new file mode 100644 index 0000000..085981d --- /dev/null +++ b/doc/kate-plugins/Makefile.am @@ -0,0 +1,4 @@ + +KDE_LANG = en +KDE_DOCS = AUTO + diff --git a/doc/kate-plugins/configure_insertcommand.png b/doc/kate-plugins/configure_insertcommand.png new file mode 100644 index 0000000..af05441 Binary files /dev/null and b/doc/kate-plugins/configure_insertcommand.png differ diff --git a/doc/kate-plugins/filetemplates.docbook b/doc/kate-plugins/filetemplates.docbook new file mode 100644 index 0000000..74ee3cb --- /dev/null +++ b/doc/kate-plugins/filetemplates.docbook @@ -0,0 +1,323 @@ + + + + File Templates + + + + Anders + Lund + +
&Anders.Lund.mail;
+
+
+ +
+ 2006-01-10 + 0.1 + + + KDE + kate + kdeaddons + template + macro + +
+ + Introduction + + The File Templates plug-in allows you to create files based on other + files. You can use any file as a template, which will create a copy of the + file with an empty &URL;, or use a special template file which may contain + macros to fill in information like your name and email address, the + current date and so on, and position the cursor at a + convenient position in the new file. + Furthermore, templates located in the template folder will + be presented in the menu item + FileNew from + Template. The plug-in also + provides a method to easily create a new template + from an open document. + The template folder is part of the &kde; file system, and + consists of at least + KDEDIR/share/applications/kate/plugins/katefiletemplates/templates and + KDEHOME/share/applications/kate/plugins/katefiletemplates/templates. If your + KDEDIRS environment variable contains additional directories, those are + searched for a similar subdirectory as well. If equally named templates are + found, the one in the local (KDEHOME) folder is chosen. + + Menu Structure + + + + + + File + New From Template + Any File... + + + Presents you with Open File dialog that allows + you to use any file as a template. If the chosen file has the + extension katetemplate it will be parsed + for template information and macros. + + + + + + File + New From Template + Use Recent + + + Presents a list of files recently used as + templates, represented by their &URL;. + + + + + + File + New From Template + + + The remainder of submenus contains links to + templates. Click a menuitem to create a file as described by + the menu item text. + + + + + + + SettingsManage + Templates... + This will launch a dialog with a list of all templates + found within the template directories, along with options to add, + edit or remove templates. + + + + + + Using a &kate; Template + When creating a file from a template that contain template + macros, some macros appears as editable variables in the text. Such + variables appears as underlined words in the text. + The first variable will be selected, so you just have to type to edit + it.If the document text contains more instances of the same variable, + they are changed as you edit. To move to the next editable variable, + press the TAB key. When the last variable is edited, the list is + dropped, and your TAB key works as normal. + + + + Creating your own templates + To create a new template, use the + Settings + Manage Templates Item to launch + the template management dialog. In that, click + New... to launch the File Template Wizard. You + will be asked for an optional file to turn into a template and prompted + for template information settings, and a template file will be created for + you. Alternatively, you can create a template manually by + adding template information to the top of any file, add text and macros, + and save it with the katetemplate extension. + The template menu gets automatically updated if you chose to store + your template in the template directory. + + + + Editing templates + To edit a template, use the + Settings + Manage Templates.... Select the + template you want to work on and click Edit..., + and the template file will be opened. Close the dialog, edit the template + file as desired, save it and close it. Changes to templates takes + immediate effect, you can activate the template to test your changes after + saving it. + + + + The &kate; Template Format + If you use files with the extension + katetemplate, they will be parsed for template + information, macros and a cursor position. + + + Template information + While reading in the file, the parser keeps + lines beginning with the phrase + katetemplate: and searches them for + template information in the form VARIABLENAME=VALUE. The first line not + starting with katetemplate: will be taken as the + start of the template contents. VALUE may contain any character but + equal sign (=). Legal variable names are: + + + Template + This is the template name, displayed in the + FileNew from + Template menu. + + + Group + The group places the template in a submenu of + the FileNew from + Template menu. + + Name + This is the name that will be set for the + document, and displayed in the file list and title bar. If the + name contains %N that will be replaced + with a number, increasing if more documents has the same + name. + + + Highlight + The plug-in will try to set the Highlight for + the new document to the value of this variable. The value + should be the name, as found in the + Tools + Highlighting + . + + + + Description + A short informative description of the + template. This is currently used to set a Whatsthis string for + the menu item, but may be used for more purposes in the + future. + + Author + A string identifying the author, for example + in the form Name <email address>. + This is currently used to set a Whatsthis string for the menu + item, but may be used for more purposes in the + future. + + + + + + + + Template Macros + + While parsing the template contents, macros in the form + %{NAME} or ${NAME} are + expanded. If you use the $ prefix, the + expanded macro will be treated as a editable variable when a document + is created from the template, whereas if you use + % it is not, unless expanding failed. + The following macros are expanded: + + time + Expands to the current time in your locale + format. + + + date + Expands to the current date in short + format. + + + datetime + Expands to the current date and time, + formatted as a string according to your + locale. + + + year + The current year as a four digit + number. + + + month + The full name of the current month, according + to your locale. + + day + Expands to the current day of the month. + + + hostname + Expands to the 'hostname' of your computer. + + + index + Expands to 'i'. + + fullname + Expands to your full name, as defined by the + owner addressee in your standard &kde; + addressbook. + + firstname + Expands to your first name, as defined in the owner + addressee in your standard &kde; addressbook. + + + lastname + Expands to your last name, as defined in the owner + addressee in your standard &kde; addressbook. + + + + + email + Expands to your email address, as defined by + the owner address in your standard &kde; + addressbook. + + + + + Any macro not in the above list is treated as a editable variable + no matter the prefix. + If the same variable occurs multiple times in the template, they can be + edited at once after creating a document from the template. + + + + Setting the cursor position + The special macro ${cursor} will be replaced + with a vertical bar and added to the end of the list of editable variables, + independent on its location in the text. + + + + + + Thanks and Acknowledgments + + + &kate; Plug-in File Templates copyright 2004 &Anders.Lund; + &Anders.Lund.mail;. + + + + Documentation copyright 2004 &Anders.Lund; + + + + + + &underGPL; + + +
+ + \ No newline at end of file diff --git a/doc/kate-plugins/htmltools.docbook b/doc/kate-plugins/htmltools.docbook new file mode 100644 index 0000000..e8c48fa --- /dev/null +++ b/doc/kate-plugins/htmltools.docbook @@ -0,0 +1,84 @@ + + + +<acronym>HTML</acronym> Tools + + + +Francis +Giannaros + +
francisg@gmail.com
+
+
+
+2002-05-15 +1.00.00 + + +A plugin to help with the insertion of &HTML; elements. + + + + +KDE +kate +html + +
+ +Introduction + +This plugin will open a dialog which will prompt your for a &HTML; +tag +name. +Attributes and values to be put in the opening tag should be entered +attribute-name="attribute-value". +After pressing &Enter;, the opening -- and respective closing -- tag +will be placed into the document. + + +Menu Structure + + + + + +Tools +HTML Tag... + + +This will open the dialogue as described above. + + + + + + +Thanks and Acknowledgments + + +&kate; Plugin HTML Tools copyright 2002 Joseph Wenninger +kde@jowenn.at. + + + +Documentation copyright 2005 Francis Giannaros + + + + + +&underGPL; + + + +
+ + diff --git a/doc/kate-plugins/index.docbook b/doc/kate-plugins/index.docbook new file mode 100644 index 0000000..e927cc9 --- /dev/null +++ b/doc/kate-plugins/index.docbook @@ -0,0 +1,131 @@ + + + + + + + + + + + +]> + + + +The &kate; Plugins Handbook + + + +2006-02-24 +3.5.1 + + +2001 +2002 + + + +&FDLNotice; + + + +This is the handbook for the plugins for &kate;, &kde;'s Advanced Text +Editor. + + + + +KDE +kdeaddons +Kate +Plugins + + + + + +&kate; plugins + + +&kate; plugins are additional functions for the &kate; editor. They can +add extra menus and shortcuts, and extend &kate;'s features. You can +install as many or as few as you like, from within &kate;. +Open &kate;'s configuration dialog with +SettingsConfigure &kate;.... +Select ApplicationPlugins to +choose the wanted plugins. + + + +More information on using &kate; and enabling the plugins you want is +available in the &kate; handbook. + + + +The plugins installed in this handbook are: + + + + +&XML; Completion + + +&XML; Validation + + +Insert Command + + +&HTML; Tools + + +Open Header + + +Text Filter + + +File Templates + + + + + +&doc-xmltools; +&doc-xmlcheck; +&doc-insertcommand; +&doc-htmltools; +&doc-openheader; +&doc-textfilter; +&doc-filetemplates; + + +Credits and License + + +Copyrights for each applet is listed in the applicable chapter. + + +&underFDL; +&underGPL; + + + + + + + + diff --git a/doc/kate-plugins/insertcommand.docbook b/doc/kate-plugins/insertcommand.docbook new file mode 100644 index 0000000..eeafe7e --- /dev/null +++ b/doc/kate-plugins/insertcommand.docbook @@ -0,0 +1,150 @@ + + + +Insert Command + + + +Anders +Lund + +
&Anders.Lund.mail;
+
+
+
+2006-05-17 +3.5.2 + + +The Insert Command plugin allows you to insert shell +command output into a document open in &kate;. + + + +KDE +kate +insert + +
+ +Introduction + +The Insert Command plugin allows you to insert +shell command output into a document open in &kate;. + +First enable the Insert Command plugin by using the +Settings Configure +&kate;... dialog and checking &kate; +InsertCommand in in the Application +Plugins section and close the dialog. + + +Onscreen Fundamentals + + + To use the plugin, select +Insert Command... from the Tools +menu, which will present you with a small dialog for entering the +command, choosing a working folder and selecting whether to include +errors (STDERR output) in the inserted text. You can also have the +command string printed above the output. + + + + + +The Insert Command Dialog + + + +The plugin can remember a number of commands as chosen in the +configuration page. These are used for autocompletion, and can be +selected from a list in the command entry. + +By default, the command will be run in the working folder of the +kate process, which is usually your home folder. This can be changed +in the configuration page for the plugin. + +Note that any shell command that requires user input (for +example passwd) or uses a ncurses interface or something similar (for +example top) will fail to produce the expected output. + + + + +Configuration + + +To configure the Insert Command +plugin, open the &kate; configuration dialog from the +SettingsConfigure +&kate;... menu and choose +PluginsInsert Command +. + + + + +The Insert Command Configuration Tab + + + + +The following configuration options are available: + + + + +Number of commands to remember + +This setting is presented as a spinbox which you can set to the +number of commands to be remembered. Any number from 0 to 99 is +legal. Default is 20. + + + + +Default Working Folder + +This setting, presented as a set of radio buttons, allows you to +decide how the working folder of a command is chosen. The options are +the working folder of the &kate; process (usually your home folder when &kate; is started from the K menu), the folder of the document (if any, otherwise the +above option is used) or the working folder of the last command run in +the plugin. + + + + + + + + + +Thanks and Acknowledgments + + +&kate; Plugin Insert Command copyright 2001 Anders Lund +&Anders.Lund.mail;. + + + +Documentation copyright 2001 &Anders.Lund; &Anders.Lund.mail; + + + + + +&underGPL; + + +
+ + + diff --git a/doc/kate-plugins/insertcommand.png b/doc/kate-plugins/insertcommand.png new file mode 100644 index 0000000..1d756be Binary files /dev/null and b/doc/kate-plugins/insertcommand.png differ diff --git a/doc/kate-plugins/openheader.docbook b/doc/kate-plugins/openheader.docbook new file mode 100644 index 0000000..60aed58 --- /dev/null +++ b/doc/kate-plugins/openheader.docbook @@ -0,0 +1,49 @@ + + + +Open Header + + + +KDE +kate +header + + + +Introduction + + +The &kate; plugin Open Header currently has no +documentation. If you are interested in rectifying that situation, +please contact Lauri Watts lauri@kde.org, &kde;'s +Documentation Team coordinator. + + + + + + diff --git a/doc/kate-plugins/textfilter.docbook b/doc/kate-plugins/textfilter.docbook new file mode 100644 index 0000000..1d628c5 --- /dev/null +++ b/doc/kate-plugins/textfilter.docbook @@ -0,0 +1,50 @@ + + + +Text Filter + + + +KDE +kate +text +filter + + + +Introduction + + +The &kate; plugin Text Filer currently has no +documentation. If you are interested in rectifying that situation, +please contact Lauri Watts lauri@kde.org, &kde;'s +Documentation Team coordinator. + + + + + + diff --git a/doc/kate-plugins/xmlcheck.docbook b/doc/kate-plugins/xmlcheck.docbook new file mode 100644 index 0000000..0156509 --- /dev/null +++ b/doc/kate-plugins/xmlcheck.docbook @@ -0,0 +1,102 @@ + + + +&XML; Validation + + + +Daniel +Naber + +
&Daniel.Naber.mail;
+
+
+ +
+2006-05-17 +3.5.2 + + +This plugin checks &XML; files for well-formedness and validity. + + + +KDE +kate +xml +DTD + +
+ +Introduction + +This plugin checks the current file. A list of warnings and errors +will appears at the bottom of &kate;'s main window. You can click on an error message +to jump to the corresponding place in the file. If the file has a DOCTYPE +the DTD given with this doctype will be used to check the file for validity. The +DTD is expected at a position relative to the current file, ⪚ if the doctype +refers to DTD/xhtml1-transitional.dtd and the file is /home/peter/test.xml +the DTD is expected to be located at /home/peter/DTD/xhtml1-transitional.dtd. +However, remote DTDs specified via http are supported. + +If the file has no doctype it will be checked for well-formedness. + +To learn more about &XML; check out the official W3C &XML; pages. + +Internally this plugin calls the external command xmllint, which +is part of libxml2. If this command is not correctly installed on your system, the plugin +will not work. + +A temporary file needs to be written to the same folder as the file +that should be checked, so you need to have write access to that folder. + +To load this plugin open &kate;s configuration dialog under Settings +Configure &kate;.... +Then select Kate XML Validation which will appear +in the Application/Plugins section and close the dialog. + + + +Menu Structure + + + + + +XML +Validate XML + + +This will start the check, as described above. + + + + + + +Thanks and Acknowledgments + + +&kate; Plugin XML Validation copyright 2002 &Daniel.Naber; +&Daniel.Naber.mail;. + + + +Documentation copyright 2002 &Daniel.Naber; + + + + +&underGPL; + + +
+ + + diff --git a/doc/kate-plugins/xmltools.docbook b/doc/kate-plugins/xmltools.docbook new file mode 100644 index 0000000..fcbadd2 --- /dev/null +++ b/doc/kate-plugins/xmltools.docbook @@ -0,0 +1,186 @@ + + + +&XML; Completion + + + +Daniel +Naber + +
&Daniel.Naber.mail;
+
+
+
+2006-05-17 +3.5.2 + + +This plugin supports writing &XML; files by listing allowed tags +and more. + + + +KDE +kate +xml + +
+ +Introduction + +This plugin gives hints about what is allowed at a certain position in +an &XML; file, according to the file's DTD. It will list possible +elements, attributes, attribute values or entities, depending on the +cursor position (⪚ all entities are listed if the character on the left +of the cursor is &). It's also possible to close the nearest +open tag on the left. + +The DTD must exist in &XML; format, as produced by the Perl program +dtdparse. We will call a DTD in this format meta DTD. +Some meta DTDs are supplied. They are installed in +$KDEDIR/share/apps/katexmltools/, +which is also the default folder when you choose +Assign Meta DTD.... +To produce your own meta DTDs, get dtdparse from +http://dtdparse.sourceforge.net. + + +How to Use + +Start &kate; and open the configuration dialog under Settings +Configure &kate;.... +Then select Kate XML Completion which will appear +in the Application/Plugins section and close the dialog. After +that, select XMLAssign Meta DTD.... +If your document contains no DOCTYPE or the doctype is unknown, you'll have to +select a meta DTD from the file system. Otherwise the meta DTD that +matches the current document's DOCTYPE will be loaded automatically. + +You can now use the plugin while typing your text: + + + + +< (less than key) +This will trigger a list of possible elements unless the +cursor is inside a tag already. Note that you currently cannot use +this to insert the top level element (⪚ <html>). + + + +" (quote key) +The quote key will trigger a list of possible attribute +values (if there are some) if you are inside a tag. + + + +(space key) +This key will trigger a list of possible attributes for the +current element if you are inside a tag. + + + + +& (ampersand key) +This key will trigger a list of named entities. + + + + + + +Features and Limitations + +You can test all functions and limitations by loading +$KDEDIR/share/apps/katexmltools/testcases.xml +into &kate; and following the instructions. Note that working with +more than one view per document is not yet correctly supported by +this plugin. + + + + + +Menu Structure + + + + + + +&Ctrl;Return + +XML +Insert Element... + + +This will open a dialog that lets you insert an &XML; element. +The <, > characters and the closing tag will be inserted automatically. +If you have selected text when this menu item is selected, the selected +text will be surrounded by the opening and the closing tag. +The dialog also offers completion of all elements that may be inserted +at the current cursor position if you have assigned a meta DTD by +using Assign Meta DTD.... + + + + + + + +&Ctrl;< + +XML +Close Element + + +This will search your text for a tag that is not yet closed +and will close it by inserting the corresponding closing tag. +The search starts at the cursor position and goes left. If +it cannot find an open tag nothing will happen. + + + + + +XML +Assign Meta DTD... + + +This will tell the plugin which meta DTD to use for the +current document. Note that this assignment will not be saved. +You will have to repeat it when you start &kate; the next time. + + + + + + +Thanks and Acknowledgments + + +&kate; Plugin XML Completion copyright 2001,2002 &Daniel.Naber; +&Daniel.Naber.mail;. + + + +Documentation copyright 2001,2002 &Daniel.Naber; + + + + + +&underGPL; + + +
+ + + diff --git a/doc/kicker-applets/Makefile.am b/doc/kicker-applets/Makefile.am new file mode 100644 index 0000000..085981d --- /dev/null +++ b/doc/kicker-applets/Makefile.am @@ -0,0 +1,4 @@ + +KDE_LANG = en +KDE_DOCS = AUTO + diff --git a/doc/kicker-applets/index.docbook b/doc/kicker-applets/index.docbook new file mode 100644 index 0000000..82a61a8 --- /dev/null +++ b/doc/kicker-applets/index.docbook @@ -0,0 +1,113 @@ + + + + KTimemon"> + KolourPicker"> + +]> + + + +The &kicker; Applets Handbook + + + + + +
+
+
+
+ + + +2001-05-12 +2.20.00 + + +2001 + + + +&FDLNotice; + + + +This is the handbook for the addon applets for &kicker;, &kde;'s panel. + + + + +KDE +kdeaddons +Kicker +Applets + + +
+ + +&kicker; applets + + +Applets are small applications running inside of &kicker;. Almost +everything besides the application starter buttons are applets. They can +be added from the context menu or from the submenu +Configure Panel by choosing +Add and the Applet. + + + +More information on the use of &kicker; and on the base set of applets +that come with &kicker;, can be found in the &kicker; handbook. + + + +The Applets described in this handbook are: + + + + +&kolourpicker; + + +&ktimemon; + + + + + +&doc-kolourpicker; +&doc-ktimemon; + + +Credits and License + + +Copyrights for each applet is listed in the applicable chapter. + + +&underFDL; +&underGPL; + + + + +Installation + + +To be written + + + + + +
+ + diff --git a/doc/kicker-applets/kolourpicker.docbook b/doc/kicker-applets/kolourpicker.docbook new file mode 100644 index 0000000..fcbd730 --- /dev/null +++ b/doc/kicker-applets/kolourpicker.docbook @@ -0,0 +1,56 @@ + + + +&kolourpicker; + + + + + + +
+
+
+
+ + + +To be written + + + +KDE +color +selector + +
+ +Introduction + + +The &kicker; plugin Kolourpicker currently has no +documentation. If you are interested in rectifying that situation, +please contact the kde-doc-english mailing list, which you can reach at + +http://master.kde.org/mailman/listinfo/kde-doc-english +. + + + +Thanks and Acknowledgments + + + +&underGPL; + + +
+ + + diff --git a/doc/kicker-applets/ktimemon.docbook b/doc/kicker-applets/ktimemon.docbook new file mode 100644 index 0000000..b7ce2d5 --- /dev/null +++ b/doc/kicker-applets/ktimemon.docbook @@ -0,0 +1,429 @@ + + + +&ktimemon; + + + +Martin +Maierhofer + +
m.maierhofer@tees.ac.uk
+
+
+ +
+2001-11-29 +0.03.01 + +&ktimemon; is a system monitor for the K Desktop Environment + + +KDE +ktimemon +system monitor +timemon + +
+ +Introduction + +&ktimemon; is a small program to keep track of your computer's system +usage. It can display bar graphs containing information about +CPU, memory, and swap usage as well as disk usage and +context switch activity. In keeping with the spirit of KDE, it supports configuration via a +graphical user interface. It also supports docking, +&ie; it can display information in the system panel tray. + + +Currently, &ktimemon; only supports a limited number of systems: +&Linux; based installations with the /proc file +system, &Solaris; based installations with the +kstat library, and Digital &UNIX; (formerly +DEC/OSF1) based installations with the +table(2) system call. Help with +porting it to other platforms is most welcome. + + + + +&ktimemon; can be started from the command line or from the &kde; +start menu (in the Utilities +submenu). If you choose to start from the command line, &ktimemon; +honors the usual &X-Window; program flags such as +. &ktimemon; is +session-aware, &ie; it keeps track of the current +state (colors, &etc;) and restores it in the user's next session. + + + +Onscreen Fundamentals + + +After starting &ktimemon; a small window will appear displaying +information gathered from the operating system. If you move the mouse +pointer over the &ktimemon; window and let it rest for a small amount of +time, a tool-tip (&ie; a small transient window) +will appear. The tool-tip contains numeric information about the system +parameters displayed by the bar graphs. Tool-tips can be disabled (refer +to Configuration). + + + +Display Modes + + +&ktimemon; can display two different sets of system information. As +explained in the Configuration chapter, +mouse buttons can be bound to various actions. Per default, the left +mouse button is bound to the mode switch action, &ie; by clicking the +&LMB; mouse button anywhere in the &ktimemon; window, the displayed +information switches from Normal Mode (the default) +to Extended Mode, and vice versa. + + + +Normal Mode + +After starting &ktimemon; for the first time, it will show +information about the current CPU activity, as well as memory and swap +usage. Three bar graphs are used to show this information; they are +updated regularly (the default sample interval is 0.5s, but it can be +changed, see Configuration). The three bar +graphs represent (from left to right): + + +CPU usage. + +&ktimemon; shows the bar in three different colors, representing +CPU time spent in various modes. From bottom to top +they are: kernel mode, user mode, and user mode with lowered priority +(nice) - since &Solaris; does not seem to support +statistics for nice mode, the topmost part of the bar represents time +spent in the wait state on such systems. The gap +from the top of the bar to the top of the window represents the +percentage the CPU idle time. + + + +Memory usage. + +Similar to the CPU usage bar, this bar is +composed of three sub fields, representing (from bottom to top): +memory allocated by processes, memory used for I/O buffering, and +memory used for file caching. For Digital &UNIX; based systems, the +middle section represents inactive memory (&ie; memory +allocated and not used for a certain amount of time), and for +&Solaris; based systems, the middle section of the bar is not used, +and the topmost section represents the amount of memory used by the +kernel. Again, the gap from the top of the bar to the top of the +window represents free memory. + + + +Swap usage. + +This bar consists of a single field representing +the current swap usage relative to the system's total amount of swap +space. + + + + + +Clicking the mouse button bound to mode switch in +the &ktimemon; window switches to Extended Mode. + + + + +Extended Mode + +In this mode, the three bar graphs are used to display a different +set of system information. Again from left to right, they show: + + + +Paging activity. + +This bar consists of two parts, the lower half +of which shows the number of memory pages written to secondary +storage in the last sample interval. Similarly, the upper half +indicates the number of pages read from secondary storage. + + + +Swapping activity. + +The second bar displays the analog +information for swap activity. + + + +Context switches. + +Again, this bar graph consists of a single +field which indicates the number of context switches in the last +sample interval. + + + + +Since there is no natural way of scaling the +information shown in Extended Mode, by default +&ktimemon; uses autoscaling (explained in the +Common Questions Section). There +is, however, the possibility of specifying the scaling information, +see the Configuration section. + +Note that the two sets of bar graphs share the same colors, &ie; +the colors setup for Normal Mode is also used for +displaying information in Extended Mode (see also Configuration on how to change the color +scheme). + + + + + +Menu Structure + + +By default, the &RMB; mouse button is bound to the menu +pop-up action, &ie; clicking the right mouse button anywhere in +the &ktimemon; window brings up a menu, which is discussed in the +following sections. + + + +<guimenuitem>Settings...</guimenuitem> + +The Settings... menu item is used to +pop up the configuration dialog. Configuration options are discussed in +section Configuration. + + + + +<guimenuitem>Docked In Panel</guimenuitem> + + +By selecting the Docked In Panel menu item, +&ktimemon; switches between its standard display (&ie; a normal window) +and the panelized state, where the &ktimemon; window disappears and a +smaller version is displayed in the system panel. Apart from the +reduction in size, the panelized &ktimemon; behaves +exactly like its big brother. + + + + +<guimenu>Help</guimenu> + +&help.menu.documentation; + + + + +<guimenuitem>Horizontal Bars</guimenuitem> + +By selecting the Horizontal Bars menu +entry, &ktimemon; switches from vertical bars to horizontal bars and +vice versa. Not very useful, but it was easy to implement ;-) + + + + +<guimenuitem>Quit</guimenuitem> + + +The Quit menu item - surprise, surprise +-- is used to terminate &ktimemon;. It will save the current state +(⪚ the color scheme, window size, whether it is displayed in the +panel) and restore the state in the next invocation. + + + +The configuration information is saved in the file +$HOME/.kde/share/config/ktimemonrc, +where $HOME refers +to the user's home folder. If this file is deleted, &ktimemon; will +start in its default state in the next invocation. + + + + + +Configuration + + +&ktimemon; can be configured via a straight-forward dialog (see also the +discussion of the Configuration +Menu). On the General page, the sample +interval can be specified as well as scaling information (see also the +discussion of the extended mode). If the +Autoscaling check box is ticked (autoscaling is +explained in the FAQ section), the +scaling factors cannot be edited, since &ktimemon; determines them +automatically. + + + +The Colors page can be used to tailor the colors of +the bar graph to individual preferences. A small sample bar graph gives +immediate feedback. + + + +In the Interaction page, mouse bindings can be +adapted. Clicking a mouse button on the &ktimemon; window can be +ignored, trigger a mode switch (see also Modes), invoke the context menu (see also Menu), or invoke an external process. The command +line specified for external processes is interpreted by the standard +shell, &ie; shell commands, environment variables, redirection &etc; can +be used. + +The Interaction page also contains a check +box which can be used to disable to automatic appearance of tool-tips +with numeric information about the bar graphs (compare Onscreen Fundamentals). + + + +Common Questions and Answers + + + + +Which operating systems does &ktimemon; support? + + + +&ktimemon; supports &Linux; based systems with the /proc file system, &Solaris; based +systems with the kstat library, and Digital +&UNIX; (formerly DEC/OSF1) systems with the +table(2) system call interface. Only the &Linux; +version has been thoroughly tested, if you experience any problems +with the &Solaris;/Digital &UNIX; port, please do not hesitate to +contact me. + + + +Also, contributions to &ktimemon; to adapt it to other platforms are +most welcome. Please contact me at +m.maierhofer@tees.ac.uk if you intend to port &ktimemon; +to other flavors of &UNIX;. + + + + + + + + +How does autoscaling work? + + + + +Glad you asked. Since there is no sensible predetermined scaling factor +for paging/swapping operations and context switches (unlike ⪚ memory +utilization, where you can take the total memory size as baseline), +&ktimemon; uses a semi-intelligent (well, ...) autoscaling +mechanism. Autoscaling works as follows: + + + + + +Each of the three bar graphs as described in the extended mode section has an associated +scaling factor. The initial values of these factors are set to some +predetermined value. + + + + +Each time a new sample is displayed, the respective value is tentatively +scaled with the corresponding factor. If the value can be displayed in +the scale chosen by the factor, no change occurs (&ie; small changes in +the activity are reflected by a changing height of the bar). + + + + +If the scaled value would be either too large or too small to be +displayed with the current scaling factor, the scaling is adjusted so +that the new value displayed is roughly halfway up the bar graph. Thus, +subsequent changes should have a good chance of getting displayed +relative to the current value, without having to change the scale again. + + + + + + + + + +Why does a message box with diagnostic output from child +command pop up? + + + + +If you bind a mouse button to an external command as described in the +Configuration chapter, &ktimemon; does +not check for a valid command name. Instead a command shell is invoked +to execute the statement, so shell commands, environment variables and +more can be used. To allow some feedback to the user, &ktimemon; +monitors the stderr output of the command +shell, and reports it in this message box. + + + +While this scheme can be helpful in case a command is not found, it can +be quite annoying if the invoked command prints harmless diagnostic +information on stderr. A simple and elegant +solution to this problem is to add 2>/dev/null +at the end of the command specification. This redirects diagnostic +messages to message nirvana, and stops the message box popping up. + + + + + + + + +Thanks and Acknowledgments + +&ktimemon; is based on an Xt version by my brother. + +Thanks to Tobe Toben, +ttoben@artis.uni-oldenburg.de, Cristian Tibirna +ctibirna@gch.ulaval.ca, Dirk A. Mueller +dmuell@rhrk.uni-kl.de, Mark Krischer +krischem@amp.com, and Lubos Lunak +l.lunak@sh.cvut.cz for bug reports, patches, comments, +suggestions. + + + + +&underGPL; + + +
+ + + diff --git a/doc/konq-plugins/Makefile.am b/doc/konq-plugins/Makefile.am new file mode 100644 index 0000000..3f4b33a --- /dev/null +++ b/doc/konq-plugins/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = AUTO + + diff --git a/doc/konq-plugins/babel/Makefile.am b/doc/konq-plugins/babel/Makefile.am new file mode 100644 index 0000000..92a0127 --- /dev/null +++ b/doc/konq-plugins/babel/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/babel + + diff --git a/doc/konq-plugins/babel/index.docbook b/doc/konq-plugins/babel/index.docbook new file mode 100644 index 0000000..fdc5728 --- /dev/null +++ b/doc/konq-plugins/babel/index.docbook @@ -0,0 +1,95 @@ + + + +]> + +
+ + + + + + +Lauri +Watts +
&Lauri.Watts.mail;
+
+ + +
+ +2006-02-26 +3.5.1 + + +The Babel &konqueror; plugin gives you quick access to the +Babelfish translation service. + + + +KDE +kdeaddons +konqueror +plugins +babelfish +translate + +
+ +The Babel &konqueror; plugin + + +Using the Babelfish plugin + +Babelfish is a machine translation service provided by AltaVista. + +The plugin allows you to automatically translate web pages +between several languages. + +The Babelfish plugin can be accessed in the &konqueror; menubar +under Tools +Translate Web Page. +Select from the list that drops down the language to translate from +and the language to translate to. + +If you have a portion of the text on the page selected, that +will be translated instead of the entire &URL;. + +Not all languages are available from the Babelfish service. + + +Machine translation is not a perfect science! Babelfish will at +best give you a rough translation, and at worst will give you a very +funny read. Don't base important decisions on things you have read +from a Babelfish translated page, without confirming that the +translation is indeed accurate. + + + +You may only translate web pages that are accessible on the +world wide web. To translate any other text, you should go directly +to the Babelfish site itself, where you are able to paste in text for +translation. + + + + + +Credits + +The Babelfish plugin is copyright (C) +2001 &Kurt.Granroth; + +&Kurt.Granroth.mail; + +Documentation Copyright 2002 &Lauri.Watts; +&Lauri.Watts.mail; + + + + +
+
diff --git a/doc/konq-plugins/crashes/Makefile.am b/doc/konq-plugins/crashes/Makefile.am new file mode 100644 index 0000000..07b6370 --- /dev/null +++ b/doc/konq-plugins/crashes/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/crashes + + diff --git a/doc/konq-plugins/crashes/index.docbook b/doc/konq-plugins/crashes/index.docbook new file mode 100644 index 0000000..2918c2f --- /dev/null +++ b/doc/konq-plugins/crashes/index.docbook @@ -0,0 +1,58 @@ + + + +]> + +
+ + + + + + +Gardner +Bell +
gbell72@rogers.com
+
+ + +
+ +2004-07-21 +3.10.00 + + +The crashes plugin bookmarks a list of websites that &konqueror; has crashed on. + + + +KDE +kdeaddons +konqueror +plugins + + + +
+ +The Crashes Plugin + + +Using the Crashes Plugin + +To use the crashes plugin point &konqueror; to ToolsCrashes. Here you can select to view the site that &konqueror; has crashed on or clear the list of crashes, if any. + + + + +Credits + +The crashesplugin is Copyright © +2002-2003 Alexander Kellett +lypanov@kde.org. + + +
+
diff --git a/doc/konq-plugins/dirfilter/Makefile.am b/doc/konq-plugins/dirfilter/Makefile.am new file mode 100644 index 0000000..4e18760 --- /dev/null +++ b/doc/konq-plugins/dirfilter/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/dirfilter + + diff --git a/doc/konq-plugins/dirfilter/index.docbook b/doc/konq-plugins/dirfilter/index.docbook new file mode 100644 index 0000000..11e4b89 --- /dev/null +++ b/doc/konq-plugins/dirfilter/index.docbook @@ -0,0 +1,61 @@ + + + +]> + +
+ + + + + + +Gardner +Bell +
gbell72@rogers.com
+
+ + +
+ +2004-09-15 +3.10.00 + + +The directory view filter allows you to choose which items are displayed in a directory. + + + +KDE +kdeaddons +konqueror +plugins +dirfilter + + +
+ +The View Filter + + +Using the View Filter + +The View Filter plugin (also known as dirfilter) +can be accessed in the &konqueror; menubar under +ToolsView +Filter. This plugin allows you to filter +&konqueror;'s current working directory in a variety of ways. + + + + +Credits + +The dirfilter plugin is copyright © +2000-2002 Dawit Alemayehu adawit@kde.org. + + +
+
diff --git a/doc/konq-plugins/domtreeviewer/Makefile.am b/doc/konq-plugins/domtreeviewer/Makefile.am new file mode 100644 index 0000000..aad8af0 --- /dev/null +++ b/doc/konq-plugins/domtreeviewer/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/domtreeviewer + + diff --git a/doc/konq-plugins/domtreeviewer/index.docbook b/doc/konq-plugins/domtreeviewer/index.docbook new file mode 100644 index 0000000..17421b3 --- /dev/null +++ b/doc/konq-plugins/domtreeviewer/index.docbook @@ -0,0 +1,62 @@ + + + +]> + +
+ + + + + + +Gardner +Bell +
gbell72@rogers.com
+
+ + +
+ +2006-02-26 +3.5.1 + + +The DOM Tree Viewer allows a developer to view the styles, attributes and elements of a web document. + + + +KDE +kdeaddons +konqueror +plugins +DOMTreeViewer + + +
+ +The <acronym>DOM</acronym> Tree Viewer + + +Using the <acronym>DOM</acronym> Tree Viewer + +To begin using The DOM Tree Viewer in &konqueror;, select ToolsShow DOM Tree. This will open a new window which displays the DOM of the current web page you are viewing. By default the display starts at the root node of the document, example: documentElement, all other nodes that you will see are children or descendants of the root node. + +If you wish to manipulate the DOM tree in any way you will have to use an external script to do so. + + + + +Credits + +The domtreeviewer plugin is Copyright © +2001 The Kafka Team/Andreas Schlapbach + +kde-kafka@master.kde.org +schlpbch@unibe.ch + + +
+
diff --git a/doc/konq-plugins/fsview/Makefile.am b/doc/konq-plugins/fsview/Makefile.am new file mode 100644 index 0000000..23e96f9 --- /dev/null +++ b/doc/konq-plugins/fsview/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/fsview + + diff --git a/doc/konq-plugins/fsview/index.docbook b/doc/konq-plugins/fsview/index.docbook new file mode 100644 index 0000000..60ceef1 --- /dev/null +++ b/doc/konq-plugins/fsview/index.docbook @@ -0,0 +1,182 @@ + +FSView"> + + +]> + +
+ + + + + + +Josef +Weidendorfer +
Josef.Weidendorfer@gmx.de
+
+ + +
+ +2006-02-24 +3.5.1 + + +The &fsview; Plugin for &konqueror; is another view mode for +objects of mimetype inode/directory for local +files. It can be viewed as an alternative to the various iconviews and +listviews for browsing the content of your local file system. + + + +KDE +kdeaddons +konqueror +plugins + + + +
+ +&fsview; - the File System View + + +Introduction + +The &fsview; Plugin for &konqueror; is another view mode for +objects of mimetype inode/directory for local +files. It can be viewed as an alternative to the various iconviews and +listviews for browsing the content of your local file system. + +The unique property of &fsview; is its ability to show whole +nested folder hierarchies using a so-called tree map for graphical +visualization. Tree maps allow for displaying metrics of objects in +nested structures: each object is represented by a rectangle whose +area is proportional to its metric. The sum of the children's metrics must be +equal to or smaller than the parent object's metric. + +For &fsview;, sizes of files and folders are choosen as +metric, where the the size of a folder is defined to be the sum of the +sizes of its subitems. This way, big files even deep down in the +folder hierarchy can be spotted easily be looking for large +rectangles. So &fsview; can be looked at as a graphical and interactive +version of the &UNIX; du command. + +The integration of &fsview; as part of Konqueror allows it to +use the standard features like context file menus, and mime type +sensitive actions. But it was choosen not to implement automatical +update of file system changes by watching: if you delete a file shown +in &fsview; outside of &konqueror;, you have to update manually by +⪚ pressing F5. The reason for this decision is +the potentially huge amount of files which would have to be watched +for changes, and thus, could put an unreasonable pressure on system +resources for a small feature. + + + + +Visualization Features + +This section explains the graphical visualization of &fsview; +in detail. + + +Item Drawing Options + +In &fsview;, an item of the tree map visualization is a rectangle +representing a file or folder of your file system. For easier navigation, +rectangles have a meaningful coloring and labeling options. + +The color of a rectangle, switchable via menu item +ViewColor +Mode can be either +Depth for easy detection of the nesting, or +a color mapping of different file attributes like name, owner, group, +or mime type. + +A rectangle can be labeled with the various attributes +of the corresponding file or folder. For an attribute, you can +choose, whether it should be shown at all, only if space is available, +or if space should be taken from children (thus introducing +errors to pure tree map drawing constrains). Additionally, you can choose +the relative location of the label in the rectangle. + + + + +TreeMap Drawing Algorithms + +For drawing algorithms in tree maps, the rule that the area +is proportional to the metric of an item should hold true. +With the tree map in &fsview;, this goal isn't always met: we draw borders +to show the nesting of items, and this border takes space for a item +which is possible lost for the areas of child items. Note that +less space is lost for the border if the rectangle is quadratic. + +Similar, it is good for a better overview to let all rectangles +at least have its name as label, taking space, too. It is an option to +always force space for labels, or only to draw labels when empty space +is available. In the latter case, the tool tips appearing when the +mouse is kept over an item for some time, can help a lot. They show +information for the item the mouse is currently over, together with +its parent relations up to the root item of the tree map. + +How the space of an item is split into subareas for children is +left to the implementation. It is always better to try to split areas +in such a way that rectangles are as quadratic as possible, both for +labeling and less space lost by borders. The best methods in this +regard are Rows, Columns, or +Recursive Bisection. + +You can choose the minimal area of items to be drawn via the +menu item ViewStop at +Area. Instead, a hash pattern will be drawn +over the parents area to signal that this space is in fact occupied by +a child. + + + + + + +User Interface + +&fsview; supports multiple selection of items, similar to the +iconview and listview. This allows for actions to be done +simultaneously to a set of files. A simple mouse click always selects +a single item below the mouse pointer. Use a mouse click in +combination with pressing the &Shift; key for range selection or the +&Ctrl; Key for selection toggle. Note that by selecting an item, subitems can no +longer be selected. Selecting an item will also clear the selection of all its +parent items before. + +There is keyboard navigation available in tree maps: use +Left Arrow and Right Arrow keys to +move the current item between siblings, and the Up +Arrow and Down Arrow keys to go up and down +the nesting hierarchy. Space selects the item, in +conjunction with &Shift; does range selection, and with the &Ctrl; key +hold down simultaneously, toggles selection of the current item. Press +Return to run the open action onto the current item. + + + + +Credits and License + +Originally, &fsview; was meant as a small test application and +usage tutorial for the TreeMap widget developed within +KCachegrind. + +Copyright by Josef Weidendorfer, licensed using GPL V2. + +&underGPL; +&underFDL; + + + +
+
diff --git a/doc/konq-plugins/imgallery/Makefile.am b/doc/konq-plugins/imgallery/Makefile.am new file mode 100644 index 0000000..9524b61 --- /dev/null +++ b/doc/konq-plugins/imgallery/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/imgallery + + diff --git a/doc/konq-plugins/imgallery/folders.png b/doc/konq-plugins/imgallery/folders.png new file mode 100644 index 0000000..8cce375 Binary files /dev/null and b/doc/konq-plugins/imgallery/folders.png differ diff --git a/doc/konq-plugins/imgallery/index.docbook b/doc/konq-plugins/imgallery/index.docbook new file mode 100644 index 0000000..517bb99 --- /dev/null +++ b/doc/konq-plugins/imgallery/index.docbook @@ -0,0 +1,207 @@ + + + +]> + +
+ + + + + + +Mike +Diehl +
madpenguin8@yahoo.com
+
+ + +
+ +2006-02-24 +3.00.00 + + +The Image Gallery &konqueror; plugin creates image gallery html pages from a selected directory. + + + +KDE +kdeaddons +konqueror +plugins + + +
+ +The Image Gallery Plugin + + +Using the Image Gallery Plugin + +The Image Gallery plugin can be accessed in the &konqueror; menubar under ToolsCreate Image Gallery, or with &Ctrl;I. + +When you start the Image Gallery plugin a dialog opens allowing you to adjust the way the gallery is created. + +
+ + +Page Look + + +Look Dialog Screenshot + + + + + +Screenshot + + + + +The Look dialog is for adjusting the appearance of the gallery page. + + + + +Page title +The Page title option has a text input box for changing the title of the image gallery page. + + + +Images per row +The Images per row option has a slider and a spin box for adjusting the number of thumbnails that are in a single row in the gallery. + + + +Show image file name +The Show image file name check box allows you to turn on or off the use of the filenames below the gallery thumbnails. + + + +Show image file size +The Show image filesize check box allows you to turn on or off the use of the filesizes below the gallery thumbnails. + + + +Show image dimensions +The Show image dimensions check box allows you to turn on or off the use of the image dimensions in pixels below the gallery thumbnails. + + + +Font name +The Font name combo box provides you with a choice of which font to use in creating the gallery. + + + +Font size +The Font size spin box is for changing the size of the font you selected. + + + +Foreground color +The Foreground color option has a selector for choosing the foreground color of the gallery, this includes the text areas. + + + +Background color +The Background color option has a selector for choosing the background color of the gallery. + + + + + + +Folders + + +Folders Dialog Screenshot + + + + + +Screenshot + + + + + +The Folders dialog is used for choosing where to save the gallery. This dialog is also used to configure what folders are used. + + + + +Save to HTML file +The Save to file selector decides where you want to save you image gallery html page. + + + +Recurse subfolders +The Recurse subfolders check box enables recursing of subdirectories. If the check box is enabled, a slider and spin box are enabled to select the recursion depth. + + + +Copy original files +The Copy original files check box creates an image folder storing copies of the original images used in the gallery. + + + +Use comment file +The use comment file check box enables a file selector to choose a comments file to use with your gallery. + + + + + + +Thumbnails + + +Thumbnails Dialog Screenshot + + + + + +Screenshot + + + + +The thumbnails dialog is used for adjusting the properties of the thumbnails in the gallery. + + + + +Image format for the thumbnails +The image format combo box allows you to choose what format is used for the thumbnail images. + + + +Thumbnail size +The thumbnail size option provides a slider and spin box for adjusting the size of the thumbnails used in the gallery. + + + +Set different color depth +The set different color depth check box enables a combo box for selecting a different color depth for the thumbnails if you wish to use a color depth other than the depth used in the original image. + + + + + +Credits + + Copyright © 2001,2003 Lukas Tinkl lukas@kde.org + Andreas Schlapbach schlpbch@iam.unibe.ch + +Documentation Copyright 2004 Mike Diehl madpenguin8@yahoo.com + + + + +
diff --git a/doc/konq-plugins/imgallery/look.png b/doc/konq-plugins/imgallery/look.png new file mode 100644 index 0000000..e06c6c4 Binary files /dev/null and b/doc/konq-plugins/imgallery/look.png differ diff --git a/doc/konq-plugins/imgallery/thumbnails.png b/doc/konq-plugins/imgallery/thumbnails.png new file mode 100644 index 0000000..c1a7c0c Binary files /dev/null and b/doc/konq-plugins/imgallery/thumbnails.png differ diff --git a/doc/konq-plugins/index.docbook b/doc/konq-plugins/index.docbook new file mode 100644 index 0000000..d105e5c --- /dev/null +++ b/doc/konq-plugins/index.docbook @@ -0,0 +1,158 @@ + + + + +]> + + + +The &konqueror; Plugins Handbook + + + +Lauri +Watts +
&Lauri.Watts.mail;
+
+ +
+ + +2006-05-20 +3.5.2 + + +2002 +&Lauri.Watts; + + +&FDLNotice; + + + +This is the handbook for the additional plugins for &konqueror; the +&kde; file manager and web browser. + + + + +KDE +kdeaddons +Konqueror +Plugins + + +
+ + +Introduction + + +The &package; package contains several plugins for &konqueror;. +Despite their small size, they provide additional functions and ease +the use of some of the functions &konqueror; already contains, by +making them more accessible. + + + +More information on the use of &konqueror; and it's built in +functionality, can be found in the &konqueror; handbook. + + + +To load these plugins from within &konqueror;, select +SettingsConfigure Extensions.... +Go to the Tools tab and choose the wanted plugins. + + + +This is a list of the standard configuration +modules provided by the &kde; addons +package. Please note that there may be many more modules on your system if you +have installed additional software. + + + + +Babelfish + + +The DOM tree +viewer + + +The &konqueror; image +gallery + + +The Embedded Media +Player + + +The +Validators + + +Kuick + + +The Folder +Filter + + +KHTMLSettings + + +The User Agent Changer + + +The Web +Archiver + + +The Crashes +Plugin + + +FSView - the File +System View + + + + + + +Credits and License + + +Copyrights for each plugin are listed in the applicable chapter. + + + +&underFDL; +&underGPL; + + + + +Installation + +&install.intro.documentation; + +You should install the kdebase package which contains +&konqueror; before attempting to compile this package. + +&install.compile.documentation; + + + + +
+ + diff --git a/doc/konq-plugins/khtmlsettings/Makefile.am b/doc/konq-plugins/khtmlsettings/Makefile.am new file mode 100644 index 0000000..047e57d --- /dev/null +++ b/doc/konq-plugins/khtmlsettings/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/khtmlsettings + + diff --git a/doc/konq-plugins/khtmlsettings/index.docbook b/doc/konq-plugins/khtmlsettings/index.docbook new file mode 100644 index 0000000..f86999d --- /dev/null +++ b/doc/konq-plugins/khtmlsettings/index.docbook @@ -0,0 +1,114 @@ + + + +]> + +
+ + + + + + +Mike +Diehl +
madpenguin8@yahoo.com
+
+ + +Lauri +Watts +
&Lauri.Watts.mail;
+
+ + + +
+ +2006-01-10 +3.5.1 + + +The &HTML; Settings plugin provides an easy way to access the common &HTML; settings for &konqueror;. + + + +KDE +kdeaddons +konqueror +plugins + + +
+ +KHTMLSettings + + +Using KHTMLSettings + +The &HTML; settings plugin can be accessed in the &konqueror; menubar under ToolsHTML Settings. Below is a list of the settings and a short description of each one. + + + +JavaScript +Allows you to turn the use of JavaScript in &konqueror; on or off. + + + +Java +Allows you to turn the use of &Java; in &konqueror; on or off. + + + +Cookies +Allows you to turn the use of Cookies in &konqueror; on or off. + + + +Plugins +Allows you to turn the use of the &konqueror; plugins you have installed on or off. + + + +Autoload Images +Allows you to turn on or off the loading of images in web pages. + + + +Enable Proxy +Allows you to enable or disable the use of a proxy in the &konqueror; browser. + + + +Enable Cache +Allows you to enable or disable the use of cache in the &konqueror; browser. + + + +Cache Policy + +The Cache Policy submenu provides you with a way to configure the how +&konqueror; uses cache. The possible uses include: + +Keep Cache in Sync +Use Cache if Possible +Offline Browsing Mode + + + + + + + + +Credits + + Copyright © 2001 &Carsten.Pfeiffer; &Carsten.Pfeiffer.mail; + +Documentation Copyright 2004 Mike Diehl madpenguin8@yahoo.com + + +
+
diff --git a/doc/konq-plugins/kuick/Makefile.am b/doc/konq-plugins/kuick/Makefile.am new file mode 100644 index 0000000..7edba19 --- /dev/null +++ b/doc/konq-plugins/kuick/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/kuick + + diff --git a/doc/konq-plugins/kuick/index.docbook b/doc/konq-plugins/kuick/index.docbook new file mode 100644 index 0000000..0b28852 --- /dev/null +++ b/doc/konq-plugins/kuick/index.docbook @@ -0,0 +1,116 @@ + + + +]> + +
+ + + + + + +Burkhard +Lück +
+lueck@hube-lueck.de
+
+ + +
+ +2006-03-11 +3.5.2 + + +Kuick allows you to move and copy files quickly from a context menu in &konqueror;. + + + +KDE +kdeaddons +konqueror +plugins +kuick + + +
+ +The Kuick &konqueror; plugin + + +Introduction + + +Kuick offers a quick and easy way to copy or move files to another folder. +Open the context menu with a &RMB; click on a file or a selection of files. +Select Copy To or Move To to show a list with +these options: + + + + + +Home Folder +Copy or Move the selection to the home folder or subfolders + + + +Root Folder +Copy or Move the selection to the root folder or subfolders + + + +Contact +To be written + + + +Browse... +Opens a dialog to choose a target folder or create a +New Folder. + + + + + + + +The Kuick &kcontrolcenter; module + +In the &kcontrolcenter; select KDE Components +File Manager. Configure the options of Kuick on the +Quick Copy & Move tab: + +Check Show "Copy To" and "Move To" entries in context menu +to enable the Kuick module. + +In the sections Copy Operations and Move Operations +you can set the number of the last cached folder with the spinbox Cache the last folders +to a value between 1 and 6. Default is 5. + +If you want to remove all cached entries, click on the Clear List button. + + + + + +Credits and Licenses + +Kuick is Copyright (C) 2001 Holger Freyther +freyther@yahoo.com + +Documentation written by Burkhard Lück +lueck@hube-lueck.de, 2006 + + +&underFDL; +&underGPL; + + + +
+ +
diff --git a/doc/konq-plugins/mediaplayer/Makefile.am b/doc/konq-plugins/mediaplayer/Makefile.am new file mode 100644 index 0000000..852d6e5 --- /dev/null +++ b/doc/konq-plugins/mediaplayer/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/mediaplayer + + diff --git a/doc/konq-plugins/mediaplayer/index.docbook b/doc/konq-plugins/mediaplayer/index.docbook new file mode 100644 index 0000000..1fa5b4a --- /dev/null +++ b/doc/konq-plugins/mediaplayer/index.docbook @@ -0,0 +1,59 @@ + + + +]> + +
+ + + + + + +Gardner +Bell +
gbell72@rogers.com
+
+ + +
+ +2004-09-09 +3.10.00 + + +The sidebar-mediaplayer allows you to play your music files directly in &konqueror;. + + + +KDE +kdeaddons +konqueror +plugins +sidebar-mediaplayer + + +
+ +The Sidebar Media Player + + +Using the Sidebar Media Player + +The Sidebar Media Player can be accessed in the &konqueror; menubar underWindowShow Navigation Panel or by using the F9 shortcut. + +To use, click the on the navigation panel in &konqueror;, and drag-and-drop any music files you wish to listen to into the mediaplayer. + + + + +Credits + +The Sidebar Media Player is copyright © +2001 Joseph Wenninger jowenn@kde.org. + + +
+
diff --git a/doc/konq-plugins/uachanger/Makefile.am b/doc/konq-plugins/uachanger/Makefile.am new file mode 100644 index 0000000..f1f502b --- /dev/null +++ b/doc/konq-plugins/uachanger/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/uachanger + + diff --git a/doc/konq-plugins/uachanger/index.docbook b/doc/konq-plugins/uachanger/index.docbook new file mode 100644 index 0000000..a40b392 --- /dev/null +++ b/doc/konq-plugins/uachanger/index.docbook @@ -0,0 +1,102 @@ + + + +]> + +
+ + + + + + +Gardner +Bell +
gbell72@rogers.com
+
+ + +
+ +2004-07-13 +3.10.00 + + +The uachanger adds a menu to &konqueror; that allows you to +change the Browser and Operating System identification on a +domain-by-domain basis. This is useful when browsing websites that +limit access to those using a particular web browser. + + + +KDE +kdeaddons +konqueror +plugins +uachanger + + +
+ +The User Agent Changer + + +Using the User Agent Changer + +The &konqueror; uachanger plugin can be accessed in the menubar under ToolsChange Browser Identification + + + + + + +Default Identification +The default User Agent header for &konqueror; is Mozilla/5.0(compatible;Konqueror/3.2)(KHTML, like Gecko). If you come across a site that refuses this browser access, change your User Agent to one of the options below. + + + +Internet Explorer +Allows you to change your User Agent header to MSIE for sites that refuse Mozilla-based browsers entry. You will most likely need to use one of the MSIE User Agents if you wish to use &konqueror; to access Hotmail. + + + +Mozilla +Allows you to change the User Agent header in &konqueror; to appear as Mozilla version 1.2.1 through 1.6 + + + +Netscape Navigator +Pages that don't comply with W3C recommendations, or were written using proprietary &HTML; elements and attributes will render correctly if you choose to send the User Agent of these old browsers. + + + +Other +This section contains miscellaneous browsers that you can use to change your User Agent. + + + +Apply To Entire Site +This option allows you to specify that the defined User Agent applies across every page on the site you are visiting. + + + +Configure +Selecting Configure allows you to fine tune the amount of information you wish to reveal about the browser and operating system being used. + + + + + + +Credits + +The User Agent Changer plugin is Copyright © +2001 Dawit Alemayehu. + +adawit@kde.org + + +
+
diff --git a/doc/konq-plugins/validators/Makefile.am b/doc/konq-plugins/validators/Makefile.am new file mode 100644 index 0000000..265a69c --- /dev/null +++ b/doc/konq-plugins/validators/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/validators + + diff --git a/doc/konq-plugins/validators/index.docbook b/doc/konq-plugins/validators/index.docbook new file mode 100644 index 0000000..47b08bf --- /dev/null +++ b/doc/konq-plugins/validators/index.docbook @@ -0,0 +1,87 @@ + + + +]> + +
+ + + + + + +Gardner +Bell +
gbell72@rogers.com
+
+ + +
+ +2006-01-10 +3.5.1 + + +The &konqueror; validator plugin checks your &CSS; and &HTML; documents +for conformance to W3C recommendations and other standards. + + + +KDE +kdeaddons +konqueror +plugins +validators + + +
+ +The Validators Plugin + + +Using the Validators Plugin + +The validator plugin can be accessed in the &konqueror; menubar under +ToolsValidate Web Page. +A description of each subitem can be found below. + + + +Validate &HTML; +The validate &HTML; option allows you to compare your &HTML; document to the defined syntax of &HTML; and reports any errors found. Validating your &HTML; will ensure that your pages display properly on all browsers. + + + +Validate CSS +Allows you to validate your &CSS; style sheet that is embedded in an &HTML; or &XHTML; +document. Having valid &CSS; is critical to ensuring that your web site maintains a consistent look regardless of the browser that is being used. + + + +Validate Links +Allows you to confirm that the links on your site contain no redirects or broken links. This tool recursively checks all links on a site. + + + +Configure Validator +The configure validator item allows you to view the preset validators you can use +to validate your &HTML; and &CSS;. + + + + + + +Credits + +The validators plugin is Copyright © +2001 Richard Moore and Andreas Schlapbach + +&Richard.J.Moore.mail; +schlpbch@iam.unibe.ch + + +
+
diff --git a/doc/konq-plugins/webarchiver/Makefile.am b/doc/konq-plugins/webarchiver/Makefile.am new file mode 100644 index 0000000..5d00374 --- /dev/null +++ b/doc/konq-plugins/webarchiver/Makefile.am @@ -0,0 +1,6 @@ +SUBDIRS = $(AUTODIRS) + +KDE_LANG = en +KDE_DOCS = konq-plugins/webarchiver + + diff --git a/doc/konq-plugins/webarchiver/index.docbook b/doc/konq-plugins/webarchiver/index.docbook new file mode 100644 index 0000000..12e561f --- /dev/null +++ b/doc/konq-plugins/webarchiver/index.docbook @@ -0,0 +1,62 @@ + + + +]> + +
+ + + + + + +Gardner +Bell +
gbell72@rogers.com
+
+ + +
+ +2004-07-14 +3.10.00 + + +The webarchiver plugin for &konqueror; allows for archiving of +web pages, documents and images in .war format. + + + +KDE +kdeaddons +konqueror +plugins +webarchiver + + +
+ +Web Archiver + + +Using the Web Archiver + +To access the webarchiver point your mouse to ToolsArchive Web Page.... A dialog will appear allowing you to save the current website being viewed. + + + + +Credits + +The webarchiver plugin is Copyright © +2001-2003 Andreas Schlapbach, Antonio Larossa and Malte Starostik + +schlpbch@iam.unibe.ch +larossa@kde.org +malte@kde.org + + +
+
diff --git a/doc/ksig/Makefile.am b/doc/ksig/Makefile.am new file mode 100644 index 0000000..1a8064c --- /dev/null +++ b/doc/ksig/Makefile.am @@ -0,0 +1,2 @@ +KDE_LANG = en +KDE_DOCS = AUTO diff --git a/doc/ksig/index.docbook b/doc/ksig/index.docbook new file mode 100644 index 0000000..85879cf --- /dev/null +++ b/doc/ksig/index.docbook @@ -0,0 +1,431 @@ + +KSig"> + + + + +]> + + + + + +The &ksig; Handbook + + + + +Richard +A. +Johnson + +nixternal@ubuntu.com + + + + + +2006 +Richard A. Johnson + + + +&FDLNotice; + +2007-01-06 +1.01.00 + + + +&ksig; is an application specially designed to manage multiple email signatures +graphically. + + + + +KSig +kdeaddons +signature +kmail +plugin + + + + + + +Introduction + +&ksig; is a graphical tool for keeping track of many different email signatures. +The signatures themselves can be edited through &ksig;'s graphical user +interface. A command-line interface is then available for generating random or +daily signatures from a list. The command-line interface makes a suitable plugin +for generating signatures in external mail clients such as &kmail;. + + +Random signatures will pull signatures from the &ksig; signature file randomly. +You can make every email more exiciting and uniqe than the previous by creating +multiple signatures with varying quotes, styles, and information. + + +Daily signatures will pull signatures from the &ksig; signature file only using +one signature for an entire day. Every day will provide a different signature, +and just like the random signatures provide uniqueness to your emails. + + + Please report any problems or feature requests to the &kde; mailing lists. + + + + +Using &ksig; + +Go to +KMenuUtilities +PIM&ksig; Signature Editor + + + +Here's a screenshot of &ksig; + + + + + + Screenshot + + + + + + +Creating a new signature +To create a new signature, go to &Ctrl;N +File +New . This will create an +<empty signature> in the +Signatures section. Left click +the <empty signature> and in the bottom section type in your new +signature. + +Signature example + +Mr. Konqi +konqi@kde.org +http://www.kde.org + + +Once you have completed your signature, save it by going to + &Ctrl;S +File +Save , or by pressing the +Save button (floppy disc icon). + + +You can create as many signatures as you would like. Doing so provides you +with a list of signatures to use in email applications such as &kmail;, so no +matter how informal or professional you need to be, there will always be an +available signature. + + + + +Deleting a signature +To remove a signature first select the signature that you want to remove +and then click +FileRemove, or by clicking the Remove button with the red x icon in the +toolbar. + + + + +Adding daily signatures to &kmail; +Adding a daily signature is pretty straight forward. Open &kmail; by +pressing &Alt;F2. Enter +kmail in the text box and then press +Run. Once inside &kmail;, go to +SettingsConfigure +KMail.... In the Identities +selection, highlight the identity to add the signature to and then press the +Modify... button on the right-hand side of the window. Select +the Signature tab. Check the Enable +signature box. From the Obtain signature text +from drop down, select Output of Command. +In the Specify command text box, enter ksig +--daily and then press the OK button. + + + + +Adding random signatures to &kmail; +Adding a random signature, just like the daily signature, is pretty +straight forward. Open &kmail; by pressing +&Alt;F2. Enter kmail in +the text box and then press Run. Once inside &kmail;, go +to SettingsConfigure +KMail.... In the Identities +selection, highlight the identity to add the signature to and then press the +Modify... button on the right-hand side of the window. Select +the Signature tab. Check the Enable +signature box. From the Obtain signature text +from drop down, select Output of Command. +In the Specify command text box, enter ksig +--random and then press the OK button. + + + + + +Command Reference + + + + +The <guilabel>File</guilabel> Menu + + + + &Ctrl;N +File +New + +Creates a new signature. + + + + + &Ctrl;S +File +Save + +Saves the signature. + + + + + +File +Remove + +Removes a signature. + + + + + &Ctrl;Q +File +Quit + +Quits &ksig;. + + + + + + + +The <guilabel>Edit</guilabel> Menu + + + + &Ctrl;X +Edit +Cut + +Cuts the current selection. + + + + + &Ctrl;C +Edit +Copy + +Copies the current selection. + + + + + &Ctrl;V +Edit +Paste + +Pastes the current &klipper; content. + + + + + +Edit +Clear + +Clears the current selection. + + + + + + + +The <guilabel>Settings</guilabel> Menu + + + + +Settings +Toolbars + +Toggles whether the Main Toolbar +(&ksig;) or the Search Toolbar (&ksig;) +is displayed. + + + + + +Settings +Show/Hide Statusbar + +Toggles whether the status bar is displayed. + + + + + +Settings +Edit Standard Header + +Edits the Standard signature +header. + + + + + +Settings +Edit Standard Footer + +Edits the Standard signature +footer. + + + + + +Settings +Configure Shortcuts... + +Displays the Configure Shortcuts dialog box. +This lets you choose shortcut keys for various menu items. To change a shortcut, +select an action from the list, and then choose which keystroke to use. Clicking +on the bottom right Custom button lets you choose which +specific key to use. Just press the new key or key combo. + + + + + +Settings +Configure Toolbars... + +Displays a &kde; standard dialog where you can configure the +toolbar icons. + + + + + + + +The <guilabel>Help</guilabel> Menu + +&help.menu.documentation; + + + + + +Credits and License + + +&ksig; + + +Program copyright 2002 &Scott.Wheeler; &Scott.Wheeler.mail; + + + +Documentation Copyright © 2006 Richard A. Johnson +nixternal@ubuntu.com + + + + +&underFDL; + +&underGPL; + + + + +Installation + + +How to obtain &ksig; + +&install.intro.documentation; + + + + +Requirements + + +In order to successfully use &ksig;, you need &kde; 3.5. To apply a signature to +your emails you will also need a client such as &kmail; or any other client that +can obtain the signature text from the output of a command. + + + + + +Compilation and Installation + +&install.compile.documentation; + + + + + + +&documentation.index; + + + diff --git a/doc/ksig/screenshot.png b/doc/ksig/screenshot.png new file mode 100644 index 0000000..69be819 Binary files /dev/null and b/doc/ksig/screenshot.png differ diff --git a/kaddressbook-plugins/Makefile.am b/kaddressbook-plugins/Makefile.am new file mode 100644 index 0000000..070c955 --- /dev/null +++ b/kaddressbook-plugins/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = xxports diff --git a/kaddressbook-plugins/configure.in.in b/kaddressbook-plugins/configure.in.in new file mode 100644 index 0000000..6913868 --- /dev/null +++ b/kaddressbook-plugins/configure.in.in @@ -0,0 +1,7 @@ +KADDRESSBOOK_SUBDIR= +KDE_CHECK_HEADER(kaddressbook/xxport.h, KADDRESSBOOK_SUBDIR=kaddressbook-plugins) + +if test -z "$KADDRESSBOOK_SUBDIR"; then + dnl dir will only be compiled conditionally + DO_NOT_COMPILE="$DO_NOT_COMPILE kaddressbook-plugins" +fi diff --git a/kaddressbook-plugins/xxports/Makefile.am b/kaddressbook-plugins/xxports/Makefile.am new file mode 100644 index 0000000..7501d2a --- /dev/null +++ b/kaddressbook-plugins/xxports/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = kworldclock gmx diff --git a/kaddressbook-plugins/xxports/gmx/Makefile.am b/kaddressbook-plugins/xxports/gmx/Makefile.am new file mode 100644 index 0000000..facdd37 --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/Makefile.am @@ -0,0 +1,18 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = libkaddrbk_gmx_xxport.la + +servicedir = $(kde_servicesdir)/kaddressbook +service_DATA = gmx_xxport.desktop + +libkaddrbk_gmx_xxport_la_SOURCES = gmx_xxport.cpp +libkaddrbk_gmx_xxport_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined +libkaddrbk_gmx_xxport_la_LIBADD = $(LIB_KDEUI) -lkabc -lkabinterfaces +libkaddrbk_gmx_xxport_la_METASOURCES = AUTO + +rc_DATA = gmx_xxportui.rc +rcdir = $(kde_datadir)/kaddressbook + +messages: rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/libkaddrbk_gmx_xxport.pot + diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp b/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp new file mode 100644 index 0000000..524ad70 --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp @@ -0,0 +1,346 @@ +/* + This file is part of KAddressbook. + Copyright (c) 2003 - 2004 Helge Deller + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + + + Description: + This import/export filter reads and writes addressbook entries in the + gmx format which is natively used by the german freemail provider GMX. + The big advantage of this format is, that it stores it's information + very consistent and makes parsing pretty simple. Furthermore, most + information needed by KABC is available when compared to other formats. + For further information please visit http://www.gmx.com +*/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "gmx_xxport.h" + +K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libkaddrbk_gmx_xxport, GMXXXPort, "libkaddrbk_gmx_xxport" ) + +#define GMX_FILESELECTION_STRING "*.gmxa|" + i18n( "GMX addressbook file (*.gmxa)" ) + +GMXXXPort::GMXXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) + : KAB::XXPort( ab, parent, name ) +{ + createImportAction( i18n( "Import GMX Address Book..." ) ); + createExportAction( i18n( "Export GMX Address Book..." ) ); +} + +static bool checkDateTime( const QString &dateStr, QDateTime &dt ) +{ + if (dateStr.isEmpty()) + return false; + dt = QDateTime::fromString(dateStr, Qt::ISODate); + if (dt.isValid() && dt.date().year()>1901) + return true; + dt.setDate(QDate()); + return false; +} + +/* import */ + +KABC::AddresseeList GMXXXPort::importContacts( const QString& ) const +{ + KABC::AddresseeList addrList; + + QString fileName = KFileDialog::getOpenFileName( ":xxport_gmx", + GMX_FILESELECTION_STRING, 0 ); + if ( fileName.isEmpty() ) + return addrList; + + QFile file( fileName ); + if ( !file.open( IO_ReadOnly ) ) { + QString msg = i18n( "Unable to open %1 for reading." ); + KMessageBox::error( parentWidget(), msg.arg( fileName ) ); + return addrList; + } + + QDateTime dt; + QTextStream gmxStream( &file ); + gmxStream.setEncoding( QTextStream::Latin1 ); + QString line, line2; + line = gmxStream.readLine(); + line2 = gmxStream.readLine(); + if (!line.startsWith("AB_ADDRESSES:") || !line2.startsWith("Address_id")) { + KMessageBox::error( parentWidget(), i18n("%1 is not a GMX address book file.").arg(fileName) ); + return addrList; + } + + QStringList strList; + typedef QMap AddressMap; + AddressMap addrMap; + + // "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments,Change_date,Status,Address_link_id,Categories" + line = gmxStream.readLine(); + while (!line.startsWith("####") && !gmxStream.atEnd()) { + while (1) { + strList = QStringList::split('#', line, true); + if (strList.count() >= 11) + break; + line.append('\n'); + line.append(gmxStream.readLine()); + }; + + KABC::Addressee *addr = new KABC::Addressee; + addr->setNickName(strList[1]); + addr->setGivenName(strList[2]); + addr->setFamilyName(strList[3]); + addr->setTitle(strList[4]); + + if (addr->formattedName().isEmpty()) + addr->setFormattedName(addr->realName()); + + if (checkDateTime(strList[5],dt)) addr->setBirthday(dt); + addr->setNote(strList[6]); + if (checkDateTime(strList[7],dt)) addr->setRevision(dt); + // addr->setStatus(strList[8]); Status + // addr->xxx(strList[9]); Address_link_id + // addr->setCategory(strList[10]); Categories + addrMap[strList[0]] = addr; + + line = gmxStream.readLine(); + } + + // now read the address records + line = gmxStream.readLine(); + if (!line.startsWith("AB_ADDRESS_RECORDS:")) { + kdWarning() << "Could not find address records!\n"; + return addrList; + } + // Address_id,Record_id,Street,Country,Zipcode,City,Phone,Fax,Mobile,Mobile_type,Email, + // Homepage,Position,Comments,Record_type_id,Record_type,Company,Department,Change_date,Preferred,Status + line = gmxStream.readLine(); + line = gmxStream.readLine(); + + while (!line.startsWith("####") && !gmxStream.atEnd()) { + while (1) { + strList = QStringList::split('#', line, true); + if (strList.count() >= 21) + break; + line.append('\n'); + line.append(gmxStream.readLine()); + }; + + KABC::Addressee *addr = addrMap[strList[0]]; + if (addr) { + for ( QStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) + *it = (*it).simplifyWhiteSpace(); + // strList[1] = Record_id (numbered item, ignore here) + int id = strList[14].toInt(); // Record_type_id (0=work,1=home,2=other) + int type = (id==0) ? KABC::Address::Work : KABC::Address::Home; + if (!strList[19].isEmpty() && strList[19].toInt()!=0) + type |= KABC::Address::Pref; // Preferred address (seems to be bitfield for telephone Prefs) + KABC::Address adr = addr->address(type); + adr.setStreet(strList[2]); + adr.setCountry(strList[3]); + adr.setPostalCode(strList[4]); + adr.setLocality(strList[5]); + addr->insertPhoneNumber( KABC::PhoneNumber(strList[6], KABC::PhoneNumber::Home) ); + addr->insertPhoneNumber( KABC::PhoneNumber(strList[7], KABC::PhoneNumber::Fax) ); + int celltype = KABC::PhoneNumber::Cell; + // strList[9]=Mobile_type // always 0 or -1(default phone). + if (strList[9].toInt()) celltype |= KABC::PhoneNumber::Pref; + addr->insertPhoneNumber( KABC::PhoneNumber(strList[8], celltype) ); + addr->insertEmail(strList[10]); + if (!strList[11].isEmpty()) addr->setUrl(strList[11]); + if (!strList[12].isEmpty()) addr->setRole(strList[12]); + // strList[13]=Comments + // strList[14]=Record_type_id (0,1,2) - see above + // strList[15]=Record_type (name of this additional record entry) + if (!strList[16].isEmpty()) addr->setOrganization(strList[16]); // Company + if (!strList[17].isEmpty()) addr->insertCustom( + "KADDRESSBOOK", "X-Department", strList[17]); // Department + if (checkDateTime(strList[18],dt)) addr->setRevision(dt); // Change_date + // strList[19]=Preferred (see above) + // strList[20]=Status (should always be "1") + addr->insertAddress(adr); + } else { + kdWarning() << "unresolved line: " << line << endl; + } + + line = gmxStream.readLine(); + } + + // now add the addresses to to addrList + for ( AddressMap::Iterator it = addrMap.begin(); it != addrMap.end(); ++it ) { + KABC::Addressee *addr = it.data(); + addrList.append(*addr); + delete addr; + } + + file.close(); + return addrList; +} + + +/* export */ + +bool GMXXXPort::exportContacts( const KABC::AddresseeList &list, const QString& ) +{ + KURL url = KFileDialog::getSaveURL( ":xxport_gmx", GMX_FILESELECTION_STRING ); + if ( url.isEmpty() ) + return true; + + if ( !url.isLocalFile() ) { + KTempFile tmpFile; + if ( tmpFile.status() != 0 ) { + QString txt = i18n( "Unable to open file %1.%2." ); + KMessageBox::error( parentWidget(), txt.arg( url.url() ) + .arg( strerror( tmpFile.status() ) ) ); + return false; + } + + doExport( tmpFile.file(), list ); + tmpFile.close(); + + return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); + } else { + QString filename = url.path(); + QFile file( filename ); + + if ( !file.open( IO_WriteOnly ) ) { + QString txt = i18n( "Unable to open file %1." ); + KMessageBox::error( parentWidget(), txt.arg( filename ) ); + return false; + } + + doExport( &file, list ); + file.close(); + + return true; + } +} + +static const QString dateString( const QDateTime &dt ) +{ + if (!dt.isValid()) + return QString::fromLatin1("1000-01-01 00:00:00"); + QString d(dt.toString(Qt::ISODate)); + d[10] = ' '; // remove the "T" in the middle of the string + return d; +} + +void GMXXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) +{ + if (!fp || !list.count()) + return; + + QTextStream t( fp ); + t.setEncoding( QTextStream::Latin1 ); + + KABC::AddresseeList::ConstIterator it; + typedef QMap AddressMap; + AddressMap addrMap; + const KABC::Addressee *addr; + + t << "AB_ADDRESSES:\n"; + t << "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments," + "Change_date,Status,Address_link_id,Categories\n"; + + int no = 0; + const QChar DELIM('#'); + for ( it = list.begin(); it != list.end(); ++it ) { + addr = &(*it); + if (addr->isEmpty()) + continue; + addrMap[++no] = addr; + t << no << DELIM // Address_id + << addr->nickName() << DELIM // Nickname + << addr->givenName() << DELIM // Firstname + << addr->familyName() << DELIM // Lastname + << addr->title() << DELIM // Title + << dateString(addr->birthday()) << DELIM // Birthday + << addr->note() /*.replace('\n',"\r\n")*/ << DELIM // Comments + << dateString(addr->revision()) << DELIM // Change_date + << "1##0\n"; // Status, Address_link_id, Categories + } + + t << "####\n"; + t << "AB_ADDRESS_RECORDS:\n"; + t << "Address_id,Record_id,Street,Country,Zipcode,City,Phone,Fax,Mobile," + "Mobile_type,Email,Homepage,Position,Comments,Record_type_id,Record_type," + "Company,Department,Change_date,Preferred,Status\n"; + + no = 1; + while ( (addr = addrMap[no]) != NULL ) { + for (unsigned int record_id=0; record_id<3; record_id++) { + + KABC::Address address; + KABC::PhoneNumber phone, fax, cell; + + + if (record_id == 0) { + address = addr->address(KABC::Address::Work); + phone = addr->phoneNumber(KABC::PhoneNumber::Work); + fax = addr->phoneNumber(KABC::PhoneNumber::Fax); + cell = addr->phoneNumber(KABC::PhoneNumber::Work | KABC::PhoneNumber::Cell); + } else { + address = addr->address(KABC::Address::Home); + phone = addr->phoneNumber(KABC::PhoneNumber::Home); + cell = addr->phoneNumber(KABC::PhoneNumber::Cell); + } + + const QStringList emails = addr->emails(); + QString email; + if (emails.count()>record_id) email = emails[record_id]; + + t << no << DELIM // Address_id + << record_id << DELIM // Record_id + << address.street() << DELIM // Street + << address.country() << DELIM // Country + << address.postalCode() << DELIM // Zipcode + << address.locality() << DELIM // City + << phone.number() << DELIM // Phone + << fax.number() << DELIM // Fax + << cell.number() << DELIM // Mobile + << ((cell.type()&KABC::PhoneNumber::Pref)?-1:0) << DELIM // Mobile_type + << email << DELIM // Email + << ((record_id==0)?addr->url().url():QString::null) << DELIM // Homepage + << ((record_id==0)?addr->role():QString::null) << DELIM // Position + << DELIM // Comments + << record_id << DELIM // Record_type_id (0,1,2) - see above + << DELIM // Record_type (name of this additional record entry) + << ((record_id==0)?addr->organization():QString::null) << DELIM // Company + << ((record_id==0)?addr->custom("KADDRESSBOOK", "X-Department"):QString::null) << DELIM // Department + << dateString(addr->revision()) << DELIM // Change_date + << 5 << DELIM // Preferred + << 1 << endl; // Status (should always be "1") + } + + ++no; + }; + + t << "####"; +} + +#include "gmx_xxport.moc" + diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxport.desktop b/kaddressbook-plugins/xxports/gmx/gmx_xxport.desktop new file mode 100644 index 0000000..1b31521 --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxport.desktop @@ -0,0 +1,109 @@ +[Desktop Entry] +X-KDE-Library=libkaddrbk_gmx_xxport +Name=KAB GMX XXPort Plugin +Name[br]=Lugent XXPorzh GMX KAB +Name[ca]=Connector GMX XXPort per a KAB +Name[cs]=KAB GMX XXPort modul +Name[de]=GMX Adressbuchmodul +Name[el]=Πρόσθετο KAB GMX XXPort +Name[eo]=KAB GMX porta kromaĵo +Name[es]=Complemento KAB KWorldClock XXPort +Name[et]=KAB GMX eksport/importplugin +Name[eu]=KAB GMX XXPort plugina +Name[fa]=وصلۀ KAB GMX XXPort +Name[fi]=KAB-GMX XXPort-liitännäinen +Name[fr]=Module d'XXportation GMX KAB +Name[fy]=KAB GMX XXPort-plugin +Name[ga]=Breiseán KAB GMX XXPort +Name[gl]=Plugin XXPort GMX de KAB +Name[he]= תוסיף יבוא/ייצוא של KAB GMX +Name[hi]=केएबी जीएमएक्स एक्सएक्स-पोर्ट प्लगइन +Name[hr]=KAB GMX XXPort dodatak +Name[hu]=KAB GMX XXPort bővítőmodul +Name[is]=KAB GMX XXPort íforrit +Name[it]=Plugin per KAB GMX XXPort +Name[ja]=KAB KWorldClock XXPort プラグイン +Name[ka]=KAB GMX XXPort მოდული +Name[kk]=KAB GMX XXPort плагин модулі +Name[km]=កម្មវិធី​ជំនួយ KAB GMX XXPort +Name[lt]=KAB GMX XXPort priedas +Name[mk]=Приклучок KAB GMX XXPort +Name[nb]=Programtillegg for KAB GMX XXPort +Name[nds]=GMX-Moduul för KAdressbook +Name[ne]=KAB GMX XX पोर्ट प्लगइन +Name[nl]=KAB GMX XXPort-plugin +Name[nn]=Programtillegg KAB GMX XXPort +Name[pa]=KAB GMX XXPort ਪਲੱਗਇਨ +Name[pl]=Wtyczka KAB GMX XXPort +Name[pt]='Plugin' XXPort GMX do KAB +Name[pt_BR]=Plug-in GMX para o Livro de Endereços +Name[ru]=Модуль KAB GMX XXPort +Name[sk]=KAB GMX XXPort modul +Name[sl]=Vstavek KAB GMX XXPort +Name[sr]=XXPort прикључак KAB-а за GMX +Name[sr@Latn]=XXPort priključak KAB-a za GMX +Name[sv]=Adressbokens överföringsinsticksprogram för GMX +Name[ta]=KAB GMX XXமுனைய சொருகுப்பொருள் +Name[tr]=KAB GMX XXPort Eklentisi +Name[uk]=Втулок KAB GMX XXPort +Name[uz]=KAB GMX XXPort plagini +Name[uz@cyrillic]=KAB GMX XXPort плагини +Name[vi]=Bổ sung XXPort GMX KAB +Name[zh_CN]=KAB GMX XXPort 插件 +Name[zh_TW]=KAB GMX XXPort 外掛程式 +Comment=Plugin to import and export contacts in GMX's addressbook format +Comment[bg]=Приставка за импортиране и експортиране на контакти от адресник във формат GMX +Comment[ca]=Connector per a importar i exportar contactes en el format de llibreta d'adreces GMX +Comment[cs]=Modul pro export kontaktů v adresářovém formátu GMX +Comment[da]=Plugin til at importere og eksportere kontakter i GMX's adressebogsformat +Comment[de]=Modul zum Import und Export von Kontaktdaten im Adressbuchformat von GMX +Comment[el]=Πρόσθετο για εισαγωγή και εξαγωγή επαφών στη μορφή του βιβλίου διευθύνσεων του GMX +Comment[eo]=Kromaĵo por enporti kaj elporti kontaktojn en GMX-a adreslibra formato +Comment[es]=Complemento para importar y exportar contactos en el formato GMX de la libreta de direcciones +Comment[et]=Plugin, mis impordib ja ekspordib kontakte GMX aadressiraamatu vormingust/vormingusse +Comment[eu]=GMX formatuan dauden helbide liburuxkak inportatu eta esportatzeko plugina +Comment[fa]=وصله برای واردات و صادرات تماسها در قالب کتاب نشانی GMX +Comment[fi]=Sovelma GMX-osoitekirjamuodossa olevien tietueiden tuontiin ja vientiin +Comment[fr]=Module externe permettant d'importer et d'exporter des contacts avec le format du carnet d'adresses GMX +Comment[fy]=Plugin foar it ym-en eksportearjen fan kontakten út it adresboekformaat fan GMX +Comment[ga]=Breiseán chun teagmhálacha i bhformáid leabhair seoltaí GMX a iompórtáil agus a easpórtáil +Comment[gl]=Un plugin para importar e exportar contactos no formato de libro de enderezos GMX +Comment[he]= תוסף לייבוא וייצוא של אנשי קשר בפורמט פנקס הכתובות של GMX +Comment[hi]=जीएमएक्स पता पुस्तिका फार्मेट में सम्पर्कों को आयात और निर्यात करने का प्लगइन +Comment[hr]=Dodatak za uvoz i izvoz kontakata u oblikovanju GMX adresara +Comment[hu]=Bővítőmodul GMX formátumú névjegyek importálásához és exportálásához +Comment[is]=Íforrit sem flytur inn og út tengiliði í GMX vistfangasniði +Comment[it]=Plugin per importare ed esportare contatti in formato GXM +Comment[ja]=KWorldClock の旗を GMX 形式の地図データでインポート、エクスポートするプラグイン +Comment[ka]=GMX's მისამართთა წიგნის ფორმატში კონტაქტების იმპორტის და ექსპორტის მოდული +Comment[kk]=GMX адрестік кітапша пішіміне контакттарды импорт және экспорттау +Comment[km]=កម្មវិធី​ជំនួយ​ដើម្បី​នាំ​ចូល​ និង​នាំ​ចេញ​ទំនាក់ទំនង​នៅ​ក្នុង​ទ្រង់ទ្រាយ​សៀវភៅ​អាសយដ្ឋាន​របស់ GMX +Comment[lt]=Priedas GMX formato adresų knygutės eksportavimui ir importavimui +Comment[mk]=Приклучок за внесување и изнесување на контакти во GMX-формат на адресар +Comment[ms]=Plugin akan mengimport dan mengeksport hubungan dalam format buku alamat GMX +Comment[nb]=Modul som eksporterer kontakter i adressebok-formatet til GMX +Comment[nds]=Moduul för't Im- un Exporteren vun Kontakten in GMX-Adressbookformaat +Comment[ne]=जीएमएक्सको ठेगाना पुस्तक ढाँचामा सम्पर्क आयात र निर्यात गर्ने प्लगइन +Comment[nl]=Plugin voor het im-en exporteren van contacten uit het adresboekformaat van GMX +Comment[nn]=Programtillegg for å importera og eksportera kontaktar i GMX-adressebokformatet +Comment[pl]=Wtyczka do importu i eksportu kontaktów z formatu książki adresowej GMX +Comment[pt]=Um 'plugin' para importar e exportar contactos no formato de livro de endereços GMX +Comment[pt_BR]=Plug-in para exportar e importar contatos usando o formato de livro de endereços GMX +Comment[ru]=Модуль для экспорта и импорта контактов в формат адресной книги GMX +Comment[sk]=Modul pre import a export kontaktov v GMX formáte adresára +Comment[sl]=Vstavek za uvoz in izvoz stikov v obliko adresarja GMX +Comment[sr]=Прикључак за увоз и извоз контаката у формату GMX-овог адресара +Comment[sr@Latn]=Priključak za uvoz i izvoz kontakata u formatu GMX-ovog adresara +Comment[sv]=Insticksprogram för import och export av kontakter med GMX adressboksformat +Comment[ta]=GMX's முகவரிப்புத்தக வடிவத்தில் உள்ள தொடர்புகளை ஏற்ற, இறக்க சொருகுப்பொருள் +Comment[tr]=GMX'in adresdefteri biçimindeki bağlantıları ekleme ve oluşturma eklentisi +Comment[uk]=Втулок для імпортування та експортування контактів у форматі адресної книги GMX +Comment[uz]=Aloqalarni GMX manzillar daftari formatida eksport-import qilish vositasi +Comment[uz@cyrillic]=Алоқаларни GMX манзиллар дафтари форматида экспорт-импорт қилиш воситаси +Comment[vi]=Bổ sung nhập/xuất khẩu liên lạc định dạng sổ địa chỉ của GMX +Comment[zh_CN]=以 GMX 的地址簿格式导入和导出联系人 +Comment[zh_TW]=匯入/匯出 GMX 通訊錄格式的外掛程式 +Type=Service +ServiceTypes=KAddressBook/XXPort +X-KDE-KAddressBook-XXPortPluginVersion=1 + diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxport.h b/kaddressbook-plugins/xxports/gmx/gmx_xxport.h new file mode 100644 index 0000000..9ced4da --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxport.h @@ -0,0 +1,47 @@ +/* + This file is part of KAddressbook. + Copyright (c) 2000 - 2003 Oliver Strutynski + Tobias Koenig + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef GMX_XXPORT_H +#define GMX_XXPORT_H + +#include + +class GMXXXPort : public KAB::XXPort +{ + Q_OBJECT + + public: + GMXXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + + QString identifier() const { return "gmx"; } + + public slots: + bool exportContacts( const KABC::AddresseeList &list, const QString &data ); + KABC::AddresseeList importContacts( const QString &data ) const; + + private: + void doExport( QFile *fp, const KABC::AddresseeList &list ); +}; + +#endif diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc b/kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc new file mode 100644 index 0000000..9239d6b --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc @@ -0,0 +1,14 @@ + + + + + &File + &Import + + + &Export + + + + + diff --git a/kaddressbook-plugins/xxports/kworldclock/Makefile.am b/kaddressbook-plugins/xxports/kworldclock/Makefile.am new file mode 100644 index 0000000..ee28aa6 --- /dev/null +++ b/kaddressbook-plugins/xxports/kworldclock/Makefile.am @@ -0,0 +1,17 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = libkaddrbk_geo_xxport.la + +servicedir = $(kde_servicesdir)/kaddressbook +service_DATA = geo_xxport.desktop + +libkaddrbk_geo_xxport_la_SOURCES = geo_xxport.cpp +libkaddrbk_geo_xxport_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) +libkaddrbk_geo_xxport_la_LIBADD = $(LIB_KDEUI) -lkabc -lkabinterfaces +libkaddrbk_geo_xxport_la_METASOURCES = AUTO + +rc_DATA = geo_xxportui.rc +rcdir = $(kde_datadir)/kaddressbook + +messages: rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/libkaddrbk_geo_xxport.pot diff --git a/kaddressbook-plugins/xxports/kworldclock/geo_xxport.cpp b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.cpp new file mode 100644 index 0000000..a2440aa --- /dev/null +++ b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.cpp @@ -0,0 +1,114 @@ +/* + This file is part of KAddressbook. + Copyright (c) 2003 Tobias Koenig + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#include +#include +#include +#include + +#include + +#include "geo_xxport.h" + +class FlagInfo +{ + public: + double latitude; + double longitude; + QColor color; +}; + +K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libkaddrbk_geo_xxport, GeoXXPort, "libkaddrbk_geo_xxport" ) + +GeoXXPort::GeoXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) + : KAB::XXPort( ab, parent, name ) +{ + createExportAction( i18n( "Export Geo Data..." ) ); +} + +bool GeoXXPort::exportContacts( const KABC::AddresseeList &list, const QString& ) +{ + KConfig config( "kworldclockrc" ); + + // At first we read all exiting flags and compare it with ours to + // avoid duplicated flags + int flags = config.readNumEntry( "Flags", 0 ); + QValueList availableFlags; + + if ( flags != 0 ) { + for ( int i = 0; i < flags; ++i ) { + FlagInfo info; + info.latitude = config.readDoubleNumEntry( QString( "Flag_%1_Latitude" ).arg( i ) ); + info.longitude = config.readDoubleNumEntry( QString( "Flag_%1_Longitude" ).arg( i ) ); + info.color = config.readColorEntry( QString( "Flag_%1_Color" ).arg( i ) ); + + availableFlags.append( info ); + } + } + + + QValueList flagList; + KABC::AddresseeList::ConstIterator addrIt; + for ( addrIt = list.begin(); addrIt != list.end(); ++addrIt ) { + KABC::Geo geo( (*addrIt).geo() ); + if ( !geo.isValid() ) + continue; + + bool available = false; + QValueList::Iterator it; + for ( it = availableFlags.begin(); it != availableFlags.end(); ++it ) { + if ( !( KABS( (*it).latitude - geo.latitude() ) > DBL_EPSILON ) && + !( KABS( (*it).longitude - geo.longitude() ) > DBL_EPSILON ) ) { + available = true; + break; + } + } + + if ( !available ) { + FlagInfo info; + info.latitude = geo.latitude(); + info.longitude = geo.longitude(); + info.color = QColor( 0, 255, 0 ); + + flagList.append( info ); + } + } + + if ( flagList.count() == 0 ) // nothing to export + return true; + + flagList += availableFlags; + + int startVal = 0; + QValueList::Iterator it; + for ( it = flagList.begin(); it != flagList.end(); ++it, ++startVal ) { + config.writeEntry( QString( "Flag_%1_Color" ).arg( startVal ), (*it).color ); + config.writeEntry( QString( "Flag_%1_Latitude" ).arg( startVal ), (*it).latitude ); + config.writeEntry( QString( "Flag_%1_Longitude" ).arg( startVal ), (*it).longitude ); + } + config.writeEntry( "Flags", startVal ); + + return true; +} + +#include "geo_xxport.moc" diff --git a/kaddressbook-plugins/xxports/kworldclock/geo_xxport.desktop b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.desktop new file mode 100644 index 0000000..9202d85 --- /dev/null +++ b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.desktop @@ -0,0 +1,112 @@ +[Desktop Entry] +X-KDE-Library=libkaddrbk_geo_xxport +Name=KAB KWorldClock XXPort Plugin +Name[az]=KAB KWorldClock XXPort Əlavəsi +Name[br]=Lugent KAB KWorldClock XXPort +Name[ca]=Connector KWorldClock XXPort per a KAB +Name[cs]=Exportní modul do KWorldClock +Name[cy]=Ategyn XXPort KClocByd KAB +Name[de]=Adressbuch/Weltuhr-Exportmodul +Name[el]=Πρόσθετο KAB KWorldClock XXPort +Name[eo]=KAB KMondhorloĝo porta kromaĵo +Name[es]=Complemento KAB KWorldClock XXPort +Name[et]=KAB KWorldClock eksportplugin +Name[eu]=KAB KWorldClock XXPort plugina +Name[fa]=وصلۀ KAB KWorldClock XXPort +Name[fi]=KAB-maailmakellon XXPort-liitännäinen +Name[fr]=Module d'export KAB vers KWorldClock +Name[fy]=KAB KWorldClock XXPort-plugin +Name[ga]=Breiseán KAB KWorldClock XXPort +Name[gl]=Plugin de XXPort de KWorldClock para KAB +Name[he]=תוסף XXPort של KAB עבור KWorldClock +Name[hi]=केएबी के-वर्ल्डक्लॉक XXपोर्ट प्लगइन +Name[hr]=KAB KWorldClock XXPort dodatak +Name[hu]=KAB KWorldClock XXPort bővítőmodul +Name[is]=KAB KWorldClock XXPort íforrit +Name[it]=Plugin per KAB KWorldClock XXPort +Name[ja]=KAB KWorldClock XXPort プラグイン +Name[ka]=KAB KWorldClock XXPort მოდული +Name[kk]=KAB KWorldClock XXPort плагин модулі +Name[km]=កម្មវិធី​ជំនួយ KAB KWorldClock XXPort +Name[lt]=KAB KWorldClock XXPort priedas +Name[mk]=Приклучок KAB KWorldClock XXPort +Name[nds]=KWorldClock-Moduul för KAdressbook +Name[ne]=KAB KWorldClock XXपोर्ट प्लगइन +Name[nl]=KAB KWorldClock XXPort-plugin +Name[nn]=Programtillegg KAB KWorldClock XXPort +Name[pa]=KAB KWorldClock XXPort ਪਲੱਗਇਨ +Name[pl]=Wtyczka eksportu danych KAB do KWorldClock +Name[pt]='Plugin' de XXPort do KWorldClock para o KAB +Name[pt_BR]=Plug-Ins do KWorldClock do Kab +Name[ro]=Modul de exportare KAB-KWorldClock +Name[ru]=Модуль KAB KWorldClock XXPort +Name[sk]=Module KWorldClock pre KAB +Name[sl]=Vstavek za KAB v KWorldClock XXPort +Name[sr]=XXPort прикључак KAB-а за KWorldClock +Name[sr@Latn]=XXPort priključak KAB-a za KWorldClock +Name[sv]=Adressbokens överföringsinsticksprogram för Världsklockan +Name[ta]=KAB கேஉலக கடிகாரம் XXPort சொருகு சாதனம் +Name[tg]=Модули KAB KWorldClock XXPort +Name[tr]=KAB Dünya Saati XXPort Plugin'i +Name[uk]=Втулок KAB KWorldClock XXPort +Name[uz]=KAB KWorldClock XXPort plagini +Name[uz@cyrillic]=KAB KWorldClock XXPort плагини +Name[vi]=Bổ sung XXPort KWorldClock KAB +Name[zh_CN]=KAB KWorldClock XXPort 插件 +Name[zh_TW]=KAB KWorldClock XXPort 外掛程式 +Comment=Plugin to export the geo data of contacts as flags in KWorldClock +Comment[az]=KWorldClock-da əlaqələrin geo mə'lumatını ixrac etmək üçün əlavə +Comment[bg]=Приставка за експортиране на геодезни данни от адресника като флагове на KWorldClock +Comment[ca]=Connector per a exportar les dades geogràfiques de contactes en kworldclock com a banderes +Comment[cs]=Modul pro export geo dat kontaktů jako značek pro KWorldClock +Comment[cy]=Ategyn i allforio data daearyddol cysylltau fel baneri yn KClocByd +Comment[da]=Plugin til at eksportere geo-data af kontakter som flag til KWorldClock +Comment[de]=Modul zum Export der Standortpositionen der Kontakte als Flaggen in KWorldClock +Comment[el]=Πρόσθετο για εξαγωγή των γεωγραφικών δεδομένων των επαφών σαν σημαίες στο KWorldClock +Comment[es]=Complemento para exportar datos geográficos de los contactos como banderas en KWorldClock +Comment[et]=Plugin, mis ekspordib KWorldClocki aadressiraamatus leiduvate isikute asukoha lipukestena +Comment[eu]=KWorldClock-eko kontaktuen datu geografikoak bandera gisa esportatzeko plugina +Comment[fa]=وصله برای صادرات داده‌های جغرافیایی تماسها به عنوان پرچمهای KWorldClock +Comment[fi]=Liitännäinen maantieteellisten koordinaattien siirtämiseen KWorldClock sovellukseen +Comment[fr]=Module externe pour exporter les données géographiques des contacts sous forme de drapeaux dans KWorldClock +Comment[fy]=Plugin foar it eksportearjen fan de geografyske gegevens fan kontakten as flaggen yn KWorldClock +Comment[ga]=Breiseán a easpórtálann na sonraí geografacha de theagmhálacha mar bhratacha i KWorldClock +Comment[gl]=Un plugin para exportar os dados xeográficos dos contactos como bandeiras en KWorldClock +Comment[hi]=कान्टेक्ट के भौगोलिक डाटा को के-वर्ल्डक्लॉक में फ्लेग्स की तरह निर्यात करने का प्लगइन +Comment[hr]=Dodatak za izvoz geografskih podataka kontakata u obliku zastava u KWorldClock +Comment[hu]=Bővítőmodul a névjegyek földrajzi adatainak KWorldClock-ba való exportálásához (jelzők formájában) +Comment[is]=Íforrit sem flytur út landupplýsingar um staðsetningar fyrir KWorldClock +Comment[it]=Plugin per esportare geo data dei contatti come bandiere in KWorldClock +Comment[ja]=KWorldClock の旗を地図データの接点にエクスポートするプラグイン +Comment[ka]=geo მონაცემების დასაექსპორტებელი მოდული, როგორიცაა KWorldClock-ში დროშები +Comment[kk]=Контакттардың географикалық мәліметтерін KWorldClock-тың жалауша түрінде экспорттайтын плагин модулі +Comment[km]=កម្មវិធី​ជំនួយ​ដើម្បី​នាំ​ចេញ​ទិន្ន័យ​​ភូមិសាស្ត្រ​​នៃ​ទំនាក់ទំនង​ជា​ទង់​នៅ​ក្នុង KWorldClock +Comment[lt]=Priedas kontaktų geografinių duomenų eksportavimui KWorldClock +Comment[mk]=Приклучок за изнесување на географски податоци на контактите како знамиња во KWorldClock +Comment[ms]=Plug masuk intuk eksport data geo hubungan sebagai tanda dalam KWorldClock +Comment[nb]=Modul som eksporterer geografiske data om kontakter som flagg i KWorldClock +Comment[nds]=Moduul för't Exporteren vun Kontakten-Standöörd as Flaggen binnen "KWorldClock" +Comment[ne]=KWorldClock मा झण्डा अनुरुपका सम्पर्कका geo डाट निर्यात गर्ने प्लगइन +Comment[nl]=Plugin voor het exporteren van de geografische gegevens van contacten als vlaggen in KWorldClock +Comment[nn]=Programtillegg for å eksportera geografiske data frå kontaktar til flagg i KWorldClock +Comment[pl]=Wtyczka do eksportu danych geograficznych z wizytówek jako flag w KWorldClock +Comment[pt]=Um 'plugin' para exportar os dados geográficos dos contactos como bandeiras no KWorldClock +Comment[pt_BR]=Plugin para exportar dados geográficos de contatos, como sinais no Kworldclock +Comment[ro]=Modul care exportă datele geografice din adresele de contact ca fanioane în KWorldClock +Comment[ru]=Модуль для экспорта географических координат контактов как флагов в KWorldClock +Comment[sk]=Modul pre export geografických dát kontaktov ako vlajok pre KWorldClock +Comment[sl]=Vstavek za izvoz zemljepisnih podatkov iz naslovov kot zastavice v KWorldClock +Comment[sr]=Прикључак за извоз географских података контаката као застава у KWorldClock-у +Comment[sr@Latn]=Priključak za izvoz geografskih podataka kontakata kao zastava u KWorldClock-u +Comment[sv]=Insticksprogram för export av geografisk data som flaggor i Världsklockan +Comment[ta]=கேஉலக கடிகாரத்தில் கொடிகளாக உள்ள தொடர்புகளின் ஜியோ தகவலை ஏற்றுவதற்கு சொருகு சாதனம் +Comment[tg]=Модул барои содироти маълумотҳои алоқаи ҷуғрофӣ мисли байрақчаҳо дар KWorldClock +Comment[tr]=KWorldClock'taki bayrakların geo veri bağlantılarını ihraç etmek için Plugin +Comment[uk]=Втулок для експортування географічних даних контактів як прапорці в KWorldClock +Comment[vi]=Bổ sung xuất khẩu dữ liệu địa lý của liên lạc dạng cờ trong đồng hồ thế giới KWorldClock +Comment[zh_CN]=将联系人的地理数据导出为 KWorldClock 中旗帜的插件 +Comment[zh_TW]=匯出 GEO 聯絡人資料為 KWorldClock 旗標 +Type=Service +ServiceTypes=KAddressBook/XXPort +X-KDE-KAddressBook-XXPortPluginVersion=1 + diff --git a/kaddressbook-plugins/xxports/kworldclock/geo_xxport.h b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.h new file mode 100644 index 0000000..d3b560a --- /dev/null +++ b/kaddressbook-plugins/xxports/kworldclock/geo_xxport.h @@ -0,0 +1,42 @@ +/* + This file is part of KAddressbook. + Copyright (c) 2003 Tobias Koenig + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef GEO_XXPORT_H +#define GEO_XXPORT_H + +#include + +class GeoXXPort : public KAB::XXPort +{ + Q_OBJECT + + public: + GeoXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + + QString identifier() const { return "geo"; } + + public slots: + bool exportContacts( const KABC::AddresseeList &list, const QString &data ); +}; + +#endif diff --git a/kaddressbook-plugins/xxports/kworldclock/geo_xxportui.rc b/kaddressbook-plugins/xxports/kworldclock/geo_xxportui.rc new file mode 100644 index 0000000..4b5ead3 --- /dev/null +++ b/kaddressbook-plugins/xxports/kworldclock/geo_xxportui.rc @@ -0,0 +1,11 @@ + + + + + &File + &Export + + + + + diff --git a/kate/Makefile.am b/kate/Makefile.am new file mode 100644 index 0000000..31e51a9 --- /dev/null +++ b/kate/Makefile.am @@ -0,0 +1,5 @@ +SUBDIRS = scripts htmltools kpybrowser modeline openheader textfilter xmltools \ + xmlcheck filelistloader cppsymbolviewer tabbarextension filetemplates \ + snippets insertcommand make helloworld + + diff --git a/kate/cppsymbolviewer/Makefile.am b/kate/cppsymbolviewer/Makefile.am new file mode 100644 index 0000000..8bf46f0 --- /dev/null +++ b/kate/cppsymbolviewer/Makefile.am @@ -0,0 +1,17 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = katecppsymbolviewerplugin.la + +katecppsymbolviewerplugin_la_SOURCES = cpp_parser.cpp tcl_parser.cpp plugin_katesymbolviewer.cpp +katecppsymbolviewerplugin_la_LIBADD = -lkateinterfaces +katecppsymbolviewerplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +pluginsdir = $(kde_datadir)/kate/plugins/katecppsymbolviewer +plugins_DATA = ui.rc + +kde_services_DATA = katecppsymbolviewer.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/katecppsymbolviewer.pot diff --git a/kate/cppsymbolviewer/cpp_parser.cpp b/kate/cppsymbolviewer/cpp_parser.cpp new file mode 100644 index 0000000..01ee919 --- /dev/null +++ b/kate/cppsymbolviewer/cpp_parser.cpp @@ -0,0 +1,335 @@ +/*************************************************************************** + cpp_parser.cpp - description + ------------------- + begin : Apr 2 2003 + author : 2003 Massimo Callegari + email : massimocallegari@yahoo.it + ***************************************************************************/ + /*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ +#include "plugin_katesymbolviewer.h" + +void KatePluginSymbolViewerView::parseCppSymbols(void) +{ + if (!win->viewManager()->activeView()) + return; + + QString cl; // Current Line + QString stripped; + uint i, j, tmpPos = 0; + int par = 0, graph = 0, retry = 0; + char mclass = 0, block = 0, comment = 0; // comment: 0-no comment 1-inline comment 2-multiline comment 3-string + char macro = 0, macro_pos = 0, func_close = 0; + bool structure = false; + QPixmap cls( ( const char** ) class_xpm ); + QPixmap sct( ( const char** ) struct_xpm ); + QPixmap mcr( ( const char** ) macro_xpm ); + QPixmap mtd( ( const char** ) method_xpm ); + QListViewItem *node = NULL; + QListViewItem *mcrNode = NULL, *sctNode = NULL, *clsNode = NULL, *mtdNode = NULL; + QListViewItem *lastMcrNode = NULL, *lastSctNode = NULL, *lastClsNode = NULL, *lastMtdNode = NULL; + + + Kate::Document *kv = win->viewManager()->activeView()->getDoc(); + //kdDebug(13000)<<"Lines counted :"<numLines()<lastItem(), i18n("Macros")); + sctNode = new QListViewItem(symbols, symbols->lastItem(), i18n("Structures")); + clsNode = new QListViewItem(symbols, symbols->lastItem(), i18n("Functions")); + mcrNode->setPixmap(0, (const QPixmap &)mcr); + sctNode->setPixmap(0, (const QPixmap &)sct); + clsNode->setPixmap(0, (const QPixmap &)cls); + if (expanded_on) + { + mcrNode->setOpen(TRUE); + sctNode->setOpen(TRUE); + clsNode->setOpen(TRUE); + } + lastMcrNode = mcrNode; + lastSctNode = sctNode; + lastClsNode = clsNode; + mtdNode = clsNode; + lastMtdNode = clsNode; + symbols->setRootIsDecorated(1); + } + else symbols->setRootIsDecorated(0); + + for (i=0; inumLines(); i++) + { + cl = kv->textLine(i); + cl = cl.stripWhiteSpace(); + func_close = 0; + if(cl.at(0) == '/' && cl.at(1) == '/') continue; + if(cl.find("/*") == 0 && (cl.find("*/") == ((signed)cl.length() - 2)) && graph == 0) continue; // workaround :( + if(cl.find("/*") >= 0 && graph == 0) comment = 1; + if(cl.find("*/") >= 0 && graph == 0) comment = 0; + if(cl.find("#") >= 0 && graph == 0 ) macro = 1; + if (comment != 1) + { + /* *********************** MACRO PARSING *****************************/ + if(macro == 1) + { + //macro_pos = cl.find("#"); + for (j = 0; j < cl.length(); j++) + { + if(cl.at(j)=='/' && cl.at(j+1)=='/') { macro = 4; break; } + if( (uint)cl.find("define") == j && + !((uint)cl.find("defined") == j)) + { + macro = 2; + j += 6; // skip the word "define" + } + if(macro == 2 && cl.at(j) != ' ') macro = 3; + if(macro == 3) + { + if (cl.at(j) >= 0x20) stripped += cl.at(j); + if (cl.at(j) == ' ' || j == cl.length() - 1) + macro = 4; + } + //kdDebug(13000)<<"Macro -- Stripped : "<lastItem(), stripped); + node->setPixmap(0, (const QPixmap &)mcr); + node->setText(1, QString::number( i, 10)); + } + macro = 0; + macro_pos = 0; + stripped = ""; + //kdDebug(13000)<<"Macro -- Inserted : "<= 0 && graph == 0 && block == 0)) + { + mclass = 1; + for (j = 0; j < cl.length(); j++) + { + if(cl.at(j)=='/' && cl.at(j+1)=='/') { mclass = 2; break; } + if(cl.at(j)=='{') { mclass = 4; break;} + stripped += cl.at(j); + } + if(func_on == true) + { + if (treeMode) + { + node = new QListViewItem(clsNode, lastClsNode, stripped); + if (expanded_on) node->setOpen(TRUE); + lastClsNode = node; + mtdNode = lastClsNode; + lastMtdNode = lastClsNode; + } + else node = new QListViewItem(symbols, symbols->lastItem(), stripped); + node->setPixmap(0, (const QPixmap &)cls); + node->setText(1, QString::number( i, 10)); + stripped = ""; + if (mclass == 1) mclass = 3; + } + continue; + } + if (mclass == 3) + { + if (cl.find('{') >= 0) + { + cl = cl.right(cl.find('{')); + mclass = 4; + } + } + + if(cl.find("(") >= 0 && cl.at(0) != '#' && block == 0 && comment != 2) + { structure = false; block = 1; } + if((cl.find("typedef") >= 0 || cl.find("struct") >= 0) && + graph == 0 && block == 0) + { structure = true; block = 2; stripped = ""; } + //if(cl.find(";") >= 0 && graph == 0) + // block = 0; + + if(block > 0 && mclass != 1 ) + { + for (j = 0; j < cl.length(); j++) + { + if (cl.at(j) == '/' && (cl.at(j + 1) == '*')) comment = 2; + if (cl.at(j) == '*' && (cl.at(j + 1) == '/')) { comment = 0; j+=2; } + // Handles a string. Those are freaking evilish ! + if (cl.at(j) == '"' && comment == 3) { comment = 0; j++; } + else if (cl.at(j) == '"' && comment == 0) comment = 3; + if(cl.at(j)=='/' && cl.at(j+1)=='/' && comment == 0) + { if(block == 1 && stripped.isEmpty()) block = 0; break; } + if (comment != 2 && comment != 3) + { + if (block == 1 && graph == 0 ) + { + if(cl.at(j) >= 0x20) stripped += cl.at(j); + if(cl.at(j) == '(') par++; + if(cl.at(j) == ')') + { + par--; + if(par == 0) + { + stripped = stripped.stripWhiteSpace(); + stripped.remove("static "); + //kdDebug(13000)<<"Function -- Inserted : "< (int)j) + { + stripped.replace(0x9, " "); + if(func_on == true) + { + if (types_on == false) + { + while (stripped.find('(') >= 0) + stripped = stripped.left(stripped.find('(')); + while (stripped.find("::") >= 0) + stripped = stripped.mid(stripped.find("::") + 2); + stripped = stripped.stripWhiteSpace(); + while (stripped.find(0x20) >= 0) + stripped = stripped.mid(stripped.find(0x20, 0) + 1); + } + //kdDebug(13000)<<"Function -- Inserted: "<lastItem(), stripped); + if (mclass == 4) node->setPixmap(0, (const QPixmap &)mtd); + else node->setPixmap(0, (const QPixmap &)cls); + node->setText(1, QString::number( tmpPos, 10)); + } + stripped = ""; + retry = 0; + block = 3; + } + if(cl.at(j)=='{' && structure == true) + { + block = 3; + tmpPos = i; + } + if(cl.at(j)=='(' && structure == true) + { + retry = 1; + block = 0; + j = 0; + //kdDebug(13000)<<"Restart from the beginning of line..."<= 0x20) stripped += cl.at(j); + } // BLOCK 2 + + if (block == 3) + { + // A comment...there can be anything + if(cl.at(j)=='/' && cl.at(j+1)=='/' && comment == 0) break; + if(cl.at(j)=='{') graph++; + if(cl.at(j)=='}') + { + graph--; + if (graph == 0 && structure == false) { block = 0; func_close = 1; } + if (graph == 0 && structure == true) block = 4; + } + } // BLOCK 3 + + if (block == 4) + { + if(cl.at(j) == ';') + { + //stripped.replace(0x9, " "); + stripped.remove('{'); + stripped.replace('}', " "); + if(struct_on == true) + { + if (treeMode) + { + node = new QListViewItem(sctNode, lastSctNode, stripped); + lastSctNode = node; + } + else node = new QListViewItem(symbols, symbols->lastItem(), stripped); + node->setPixmap(0, (const QPixmap &)sct); + node->setText(1, QString::number( tmpPos, 10)); + } + //kdDebug(13000)<<"Structure -- Inserted : "<= 0x20) stripped += cl.at(j); + } // BLOCK 4 + } // comment != 2 + //kdDebug(13000)<<"Stripped : "< 0 + if (mclass == 4 && block == 0 && func_close == 0) + { + if (cl.find('}') >= 0) + { + cl = cl.right(cl.find('}')); + mclass = 0; + } + } + } // Comment != 1 + } // for kv->numlines + + //for (i= 0; i < (symbols->itemIndex(node) + 1); i++) + // kdDebug(13000)<<"Symbol row :"< +#include +#include +#include +#include + +#include +#include + +K_EXPORT_COMPONENT_FACTORY( katecppsymbolviewerplugin, KGenericFactory( "katesymbolviewer" ) ) + +KatePluginSymbolViewerView::KatePluginSymbolViewerView(Kate::MainWindow *w) +{ + KGlobal::locale()->insertCatalogue("katecppsymbolviewer"); + KToggleAction* act = new KToggleAction ( i18n("Hide Symbols"), 0, this, SLOT( slotInsertSymbol() ), actionCollection(), "view_insert_symbolviewer" ); + act->setCheckedState(i18n("Show Symbols")); + + setInstance (new KInstance("kate")); + setXMLFile("plugins/katecppsymbolviewer/ui.rc"); + w->guiFactory()->addClient (this); + win = w; + symbols = 0; + + m_Active = false; + popup = new QPopupMenu(); + popup->insertItem(i18n("Refresh List"), this, SLOT(slotRefreshSymbol())); + popup->insertSeparator(); + m_macro = popup->insertItem(i18n("Show Macros"), this, SLOT(toggleShowMacros())); + m_struct = popup->insertItem(i18n("Show Structures"), this, SLOT(toggleShowStructures())); + m_func = popup->insertItem(i18n("Show Functions"), this, SLOT(toggleShowFunctions())); + popup->insertSeparator(); + popup->insertItem(i18n("List/Tree Mode"), this, SLOT(slotChangeMode())); + m_sort = popup->insertItem(i18n("Enable sorting"), this, SLOT(slotEnableSorting())); + + popup->setItemChecked(m_macro, true); + popup->setItemChecked(m_struct, true); + popup->setItemChecked(m_func, true); + macro_on = true; + struct_on = true; + func_on = true; + slotInsertSymbol(); +} + +KatePluginSymbolViewerView::~KatePluginSymbolViewerView() +{ + win->guiFactory()->removeClient (this); + delete dock; + delete popup; +} + +void KatePluginSymbolViewerView::toggleShowMacros(void) +{ + bool s = !popup->isItemChecked(m_macro); + popup->setItemChecked(m_macro, s); + macro_on = s; + slotRefreshSymbol(); +} + +void KatePluginSymbolViewerView::toggleShowStructures(void) +{ + bool s = !popup->isItemChecked(m_struct); + popup->setItemChecked(m_struct, s); + struct_on = s; + slotRefreshSymbol(); +} + +void KatePluginSymbolViewerView::toggleShowFunctions(void) +{ + bool s = !popup->isItemChecked(m_func); + popup->setItemChecked(m_func, s); + func_on = s; + slotRefreshSymbol(); +} + +void KatePluginSymbolViewerView::slotInsertSymbol() +{ + QPixmap cls( ( const char** ) class_xpm ); + + if (m_Active == false) + { + dock = win->toolViewManager()->createToolView("kate_plugin_cppsymbolviewer", Kate::ToolViewManager::Left, cls, i18n("Symbol List")); + + symbols = new KListView(dock); + treeMode = 0; + + connect(symbols, SIGNAL(executed(QListViewItem *)), this, SLOT(goToSymbol(QListViewItem *))); + connect(symbols, SIGNAL(rightButtonClicked(QListViewItem *, const QPoint&, int)), + SLOT(slotShowContextMenu(QListViewItem *, const QPoint&, int))); + connect(win->viewManager(), SIGNAL(viewChanged()), this, SLOT(slotDocChanged())); + //connect(symbols, SIGNAL(resizeEvent(QResizeEvent *)), this, SLOT(slotViewChanged(QResizeEvent *))); + + m_Active = true; + //symbols->addColumn(i18n("Symbols"), symbols->parentWidget()->width()); + symbols->addColumn(i18n("Symbols")); + symbols->addColumn(i18n("Position")); + symbols->setColumnWidthMode(1, QListView::Manual); + symbols->setColumnWidth ( 1, 0 ); + symbols->setSorting(-1, FALSE); + symbols->setRootIsDecorated(0); + symbols->setTreeStepSize(10); + symbols->setShowToolTips(TRUE); + + /* First Symbols parsing here...*/ + parseSymbols(); + } + else + { + delete dock; + dock = 0; + symbols = 0; + m_Active = false; + } +} + +void KatePluginSymbolViewerView::slotRefreshSymbol() +{ + if (!symbols) + return; + symbols->clear(); + parseSymbols(); +} + +void KatePluginSymbolViewerView::slotChangeMode() +{ + treeMode = !treeMode; + symbols->clear(); + parseSymbols(); +} + +void KatePluginSymbolViewerView::slotEnableSorting() +{ + lsorting = !lsorting; + popup->setItemChecked(m_sort, lsorting); + symbols->clear(); + if (lsorting == TRUE) + symbols->setSorting(0, TRUE); + else + symbols->setSorting(-1, FALSE); + + parseSymbols(); +} + +void KatePluginSymbolViewerView::slotDocChanged() +{ + //kdDebug(13000)<<"Document changed !!!!"<setColumnWidth(0, symbols->parentWidget()->width()); +} + +void KatePluginSymbolViewerView::slotShowContextMenu(QListViewItem *, const QPoint &p, int) +{ + popup->popup(p); +} + +void KatePluginSymbolViewerView::parseSymbols(void) +{ + unsigned int hlMode = 0; + + if (!win->viewManager()->activeView()) + return; + + Kate::Document *kv = win->viewManager()->activeView()->getDoc(); + + // be sure we have some document around ! + if (!kv) + return; + + /** Get the current highlighting mode */ + hlMode = kv->hlMode(); + QString hlModeName = kv->hlModeName(hlMode); + + //QListViewItem mcrNode = new QListViewItem(symbols, symbols->lastItem(), hlModeName); + + if (hlModeName == "C++" || hlModeName == "C") + parseCppSymbols(); + else if (hlModeName == "Tcl/Tk") + parseTclSymbols(); + else if (hlModeName == "Java") + parseCppSymbols(); +} + +void KatePluginSymbolViewerView::goToSymbol(QListViewItem *it) +{ + Kate::View *kv = win->viewManager()->activeView(); + + // be sure we really have a view ! + if (!kv) + return; + + kdDebug(13000)<<"Slot Activated at pos: "<itemIndex(it) <gotoLineNumber(it->text(1).toInt(NULL, 10) + 10); + kv->setFocus(); + kv->gotoLineNumber(it->text(1).toInt(NULL, 10)); +} + +KatePluginSymbolViewer::KatePluginSymbolViewer( QObject* parent, const char* name, const QStringList& ) + : Kate::Plugin ( (Kate::Application*)parent, name ), + pConfig("katecppsymbolviewerpluginrc") +{ + pConfig.setGroup("global"); +} + +KatePluginSymbolViewer::~KatePluginSymbolViewer() +{ + pConfig.sync(); +} + +void KatePluginSymbolViewer::addView (Kate::MainWindow *win) +{ + KatePluginSymbolViewerView *view = new KatePluginSymbolViewerView (win); + m_views.append (view); + view->types_on = pConfig.readBoolEntry("view_types", true); + view->expanded_on = pConfig.readBoolEntry("expand_tree", false); +} + +void KatePluginSymbolViewer::removeView(Kate::MainWindow *win) +{ + for (uint z=0; z < m_views.count(); z++) + if (m_views.at(z)->win == win) + { + KatePluginSymbolViewerView *view = m_views.at(z); + m_views.remove (view); + pConfig.writeEntry("view_types", view->types_on); + pConfig.writeEntry("expand_tree", view->expanded_on); + delete view; + return; + } +} + +Kate::PluginConfigPage* KatePluginSymbolViewer::configPage( + uint, QWidget *w, const char* /*name*/) +{ + KatePluginSymbolViewerConfigPage* p = new KatePluginSymbolViewerConfigPage(this, w); + initConfigPage( p ); + connect( p, SIGNAL(configPageApplyRequest(KatePluginSymbolViewerConfigPage*)), + SLOT(applyConfig(KatePluginSymbolViewerConfigPage *)) ); + return (Kate::PluginConfigPage*)p; +} + +void KatePluginSymbolViewer::initConfigPage( KatePluginSymbolViewerConfigPage* p ) +{ + p->viewReturns->setChecked(pConfig.readBoolEntry("view_types", true)); + p->expandTree->setChecked(pConfig.readBoolEntry("expand_tree", false)); +} + +void KatePluginSymbolViewer::applyConfig( KatePluginSymbolViewerConfigPage* p ) +{ + for (uint z=0; z < m_views.count(); z++) + { + m_views.at(z)->types_on = p->viewReturns->isChecked(); + m_views.at(z)->expanded_on = p->expandTree->isChecked(); + //kdDebug(13000)<<"KatePluginSymbolViewer: Configuration applied.("<types_on<<")"<slotRefreshSymbol(); + } + + pConfig.writeEntry("view_types", p->viewReturns->isChecked()); + pConfig.writeEntry("expand_tree", p->expandTree->isChecked()); +} + +// BEGIN KatePluginSymbolViewerConfigPage +KatePluginSymbolViewerConfigPage::KatePluginSymbolViewerConfigPage( + QObject* /*parent*/ /*= 0L*/, QWidget *parentWidget /*= 0L*/) + : Kate::PluginConfigPage( parentWidget ) +{ + QVBoxLayout* top = new QVBoxLayout(this, 0, + KDialogBase::spacingHint()); + + QGroupBox* gb = new QGroupBox( i18n("Parser Options"), + this, "cppsymbolviewer_config_page_layout" ); + gb->setColumnLayout(1, Qt::Horizontal); + gb->setInsideSpacing(KDialogBase::spacingHint()); + viewReturns = new QCheckBox(i18n("Display functions parameters"), gb); + expandTree = new QCheckBox(i18n("Automatically expand nodes in tree mode"), gb); + + top->add(gb); + top->addStretch(1); +// throw signal changed + connect(viewReturns, SIGNAL(toggled(bool)), this, SIGNAL(changed())); + connect(expandTree, SIGNAL(toggled(bool)), this, SIGNAL(changed())); +} + +KatePluginSymbolViewerConfigPage::~KatePluginSymbolViewerConfigPage() {} + +void KatePluginSymbolViewerConfigPage::apply() +{ + emit configPageApplyRequest( this ); +} +// END KatePluginSymbolViewerConfigPage + diff --git a/kate/cppsymbolviewer/plugin_katesymbolviewer.h b/kate/cppsymbolviewer/plugin_katesymbolviewer.h new file mode 100644 index 0000000..f20f097 --- /dev/null +++ b/kate/cppsymbolviewer/plugin_katesymbolviewer.h @@ -0,0 +1,300 @@ +/*************************************************************************** + plugin_katesymbolviewer.h - description + ------------------- + begin : Apr 2 2003 + author : 2003 Massimo Callegari + email : massimocallegari@yahoo.it + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _PLUGIN_KATE_SYMBOLVIEWER_H_ +#define _PLUGIN_KATE_SYMBOLVIEWER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +//#include +#include +#include +#include +#include +#include +#include + + +class KatePluginSymbolViewerView : public QObject, public KXMLGUIClient +{ + Q_OBJECT + + public: + KatePluginSymbolViewerView (Kate::MainWindow *w); + virtual ~KatePluginSymbolViewerView (); + + void parseSymbols(void); + + public slots: + void slotInsertSymbol(); + void slotRefreshSymbol(); + void slotChangeMode(); + void slotEnableSorting(); + void slotDocChanged(); + void goToSymbol(QListViewItem *); + void slotShowContextMenu(QListViewItem *, const QPoint&, int); + void toggleShowMacros(void); + void toggleShowStructures(void); + void toggleShowFunctions(void); + protected: + void slotViewChanged(QResizeEvent *e); + private: + QPopupMenu *popup; + KListView *symbols; + QWidget *dock; + bool m_Active; + int m_macro, m_struct, m_func, m_sort; + bool macro_on, struct_on, func_on; + bool treeMode, lsorting; + void parseCppSymbols(void); + void parseTclSymbols(void); + public: + Kate::MainWindow *win; + bool types_on; + bool expanded_on; +}; + +/** + * Plugin's config page + */ +class KatePluginSymbolViewerConfigPage : public Kate::PluginConfigPage +{ + Q_OBJECT + + friend class KatePluginSymbolViewer; + + public: + KatePluginSymbolViewerConfigPage (QObject* parent = 0L, QWidget *parentWidget = 0L); + ~KatePluginSymbolViewerConfigPage (); + + /** + * 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( KatePluginSymbolViewerConfigPage* ); + + /** + * Ask the plugin to apply changes + */ + void configPageInitRequest( KatePluginSymbolViewerConfigPage* ); + + private: + QCheckBox* viewReturns; + QCheckBox* expandTree; +}; + +class KatePluginSymbolViewer : public Kate::Plugin, Kate::PluginViewInterface, Kate::PluginConfigInterfaceExtension +{ + Q_OBJECT + + public: + KatePluginSymbolViewer( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + virtual ~KatePluginSymbolViewer(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + uint configPages () const { return 1; } + Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0); + QString configPageName(uint) const { return i18n("Symbol Viewer"); } + QString configPageFullName(uint) const { return i18n("Symbol Viewer Configuration Page"); } + QPixmap configPagePixmap (uint , int ) const { return 0L; } + + public slots: + void applyConfig( KatePluginSymbolViewerConfigPage* ); + + private: + void initConfigPage( KatePluginSymbolViewerConfigPage* ); + + private: + QPtrList m_views; + KConfig pConfig; +}; + +/* XPM */ +static const char* const class_xpm[] = { +"16 16 10 1", +" c None", +". c #000000", +"+ c #A4E8FC", +"@ c #24D0FC", +"# c #001CD0", +"$ c #0080E8", +"% c #C0FFFF", +"& c #00FFFF", +"* c #008080", +"= c #00C0C0", +" .. ", +" .++.. ", +" .+++@@. ", +" .@@@@@#... ", +" .$$@@##.%%.. ", +" .$$$##.%%%&&. ", +" .$$$#.&&&&&*. ", +" ...#.==&&**. ", +" .++..===***. ", +" .+++@@.==**. ", +" .@@@@@#..=*. ", +" .$$@@##. .. ", +" .$$$###. ", +" .$$$##. ", +" ..$#. ", +" .. "}; +static const char * const class_int_xpm[] = { +"16 16 10 1", +" c None", +". c #000000", +"+ c #B8B8B8", +"@ c #8A8A8A", +"# c #212121", +"$ c #575757", +"% c #CCCCCC", +"& c #9A9A9A", +"* c #4D4D4D", +"= c #747474", +" .. ", +" .++.. ", +" .+++@@. ", +" .@@@@@#... ", +" .$$@@##.%%.. ", +" .$$$##.%%%&&. ", +" .$$$#.&&&&&*. ", +" ...#.==&&**. ", +" .++..===***. ", +" .+++@@.==**. ", +" .@@@@@#..=*. ", +" .$$@@##. .. ", +" .$$$###. ", +" .$$$##. ", +" ..$#. ", +" .. "}; + +static const char* const struct_xpm[] = { +"16 16 14 1", +" c None", +". c #000000", +"+ c #C0FFC0", +"@ c #00FF00", +"# c #008000", +"$ c #00C000", +"% c #C0FFFF", +"& c #00FFFF", +"* c #008080", +"= c #00C0C0", +"- c #FFFFC0", +"; c #FFFF00", +"> c #808000", +", c #C0C000", +" .. ", +" .++.. ", +" .+++@@. ", +" .@@@@@#... ", +" .$$@@##.%%.. ", +" .$$$##.%%%&&. ", +" .$$$#.&&&&&*. ", +" ...#.==&&**. ", +" .--..===***. ", +" .---;;.==**. ", +" .;;;;;>..=*. ", +" .,,;;>>. .. ", +" .,,,>>>. ", +" .,,,>>. ", +" ..,>. ", +" .. "}; + +static const char* const macro_xpm[] = { +"16 16 14 1", +" c None", +". c #000000", +"+ c #FF7FE5", +"@ c #FF00C7", +"# c #7F0066", +"$ c #BC0096", +"% c #C0FFFF", +"& c #00FFFF", +"* c #008080", +"= c #00C0C0", +"- c #D493FF", +"; c #A100FF", +"> c #470082", +", c #6B00B7", +" .. ", +" .++.. ", +" .+++@@. ", +" .@@@@@#... ", +" .$$@@##.%%.. ", +" .$$$##.%%%&&. ", +" .$$$#.&&&&&*. ", +" ...#.==&&**. ", +" .--..===***. ", +" .---;;.==**. ", +" .;;;;;>..=*. ", +" .,,;;>>. .. ", +" .,,,>>>. ", +" .,,,>>. ", +" ..,>. ", +" .. "}; + +static const char* const method_xpm[] = { + "16 16 5 1", + " c None", + ". c #000000", + "+ c #FCFC80", + "@ c #E0BC38", + "# c #F0DC5C", + " ", + " ", + " ", + " .. ", + " .++.. ", + " .+++++. ", + " .+++++@. ", + " .. .##++@@. ", + " .++..###@@@. ", + " .+++++.##@@. ", + " .+++++@..#@. ", + " .##++@@. .. ", + " .###@@@. ", + " .###@@. ", + " ..#@. ", + " .. " +}; + +#endif diff --git a/kate/cppsymbolviewer/tcl_parser.cpp b/kate/cppsymbolviewer/tcl_parser.cpp new file mode 100644 index 0000000..ff51e60 --- /dev/null +++ b/kate/cppsymbolviewer/tcl_parser.cpp @@ -0,0 +1,150 @@ +/*************************************************************************** + tcl_parser.cpp - description + ------------------- + begin : Apr 2 2003 + author : 2003 Massimo Callegari + email : massimocallegari@yahoo.it + ***************************************************************************/ + /*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "plugin_katesymbolviewer.h" + +void KatePluginSymbolViewerView::parseTclSymbols(void) +{ + if (!win->viewManager()->activeView()) + return; + + QString currline, prevline; + bool prevComment = false; + QString varStr("set "); + QString procStr("proc"); + QString stripped; + uint i, j, args_par = 0, graph = 0; + char block = 0, parse_func = 0; + + QListViewItem *node = NULL; + QListViewItem *mcrNode = NULL, *clsNode = NULL; + QListViewItem *lastMcrNode = NULL, *lastClsNode = NULL; + + QPixmap mcr( ( const char** ) macro_xpm ); + QPixmap cls( ( const char** ) class_xpm ); + + if(treeMode) + { + clsNode = new QListViewItem(symbols, symbols->lastItem(), i18n("Functions")); + mcrNode = new QListViewItem(symbols, symbols->lastItem(), i18n("Globals")); + lastMcrNode = mcrNode; + lastClsNode = clsNode; + if (expanded_on) + { + clsNode->setOpen(TRUE); + mcrNode->setOpen(TRUE); + } + symbols->setRootIsDecorated(1); + } + else + symbols->setRootIsDecorated(0); + + Kate::Document *kDoc = win->viewManager()->activeView()->getDoc(); + + //positions.resize(kDoc->numLines() + 3); // Maximum symbols number o.O + //positions.fill(0); + + for (i = 0; inumLines(); i++) + { + currline = kDoc->textLine(i); + currline = currline.stripWhiteSpace(); + bool comment = false; + kdDebug(13000)< 0) + { + prevline = kDoc->textLine(i-1); + if(prevline.endsWith("\\") && prevComment) comment = true; + } + prevComment = comment; + + if(!comment) + { + if(currline.startsWith(varStr) && block == 0) + { + if (macro_on == true) // not really a macro, but a variable + { + stripped = currline.right(currline.length() - 3); + stripped = stripped.simplifyWhiteSpace(); + int fnd = stripped.find(' '); + //fnd = stripped.find(";"); + if(fnd > 0) stripped = stripped.left(fnd); + + if (treeMode) + { + node = new QListViewItem(mcrNode, lastMcrNode, stripped); + lastMcrNode = node; + } + else + node = new QListViewItem(symbols, symbols->lastItem(), stripped); + + node->setPixmap(0, (const QPixmap &)mcr); + node->setText(1, QString::number( i, 10)); + stripped = ""; + }//macro + } // starts with "set" + + else if(currline.startsWith(procStr)) { parse_func = 1; } + + if (parse_func == 1) + { + for (j = 0; j < currline.length(); j++) + { + if (block == 1) + { + if(currline.at(j)=='{') graph++; + if(currline.at(j)=='}') + { + graph--; + if (graph == 0) { block = 0; parse_func = 0; continue; } + } + } + if (block == 0) + { + stripped += currline.at(j); + if(currline.at(j) == '{') args_par++; + if(currline.at(j) == '}') + { + args_par--; + if (args_par == 0) + { + //stripped = stripped.simplifyWhiteSpace(); + if(func_on == true) + { + if (treeMode) + { + node = new QListViewItem(clsNode, lastClsNode, stripped); + lastClsNode = node; + } + else + node = new QListViewItem(symbols, symbols->lastItem(), stripped); + node->setPixmap(0, (const QPixmap &)cls); + node->setText(1, QString::number( i, 10)); + } + stripped = ""; + block = 1; + } + } + } // block = 0 + } // for j loop + }//func_on + } // not a comment + } //for i loop + + //positions.resize(symbols->itemIndex(node) + 1); +} + diff --git a/kate/cppsymbolviewer/testfile.c b/kate/cppsymbolviewer/testfile.c new file mode 100644 index 0000000..8f5f959 --- /dev/null +++ b/kate/cppsymbolviewer/testfile.c @@ -0,0 +1,59 @@ +/** Test File...very demoniac for parsing... **/ +#include +#include + +#ifdef (_cplusplus) +{ +#define VALUE 5 + +#define MACRO(x) (x^2) + +# define abs_float(x) \ + ( ((x)<0) ? -(x) : (x) ) + + +typedef struct + { + pTest *pNext; + pTest *pPrev; + } + Another_test, *pTest; + +typedef struct xauth +{ + unsigned short family; + char *address; +} Xauth; + +typedef struct { + color to_move; + occupant board[8][8]; + } game; + +typedef game gt_data; + +/* + A comment with a function hello() { } +*/ +// Continued... + +RockType * + MyMusicFunction( + void *Red, + int Hot, // Comment double slash + char Chili, /* Comment inline */ + unsigned long Peppers) +// A comment..just to make some noise... +{ + // Passed first stage ??? + // Ok..get ready for the second one ! + if(I_Have_Failed() >= 0 && /* comments everywhere :} */ + This_Appears() == 1) + { + printf("Damn !!! Better going to bed :(("); + if ( vs ) // here you are ;} + activateSpace( vs->currentView() ); + } +} + + } diff --git a/kate/cppsymbolviewer/ui.rc b/kate/cppsymbolviewer/ui.rc new file mode 100644 index 0000000..7827306 --- /dev/null +++ b/kate/cppsymbolviewer/ui.rc @@ -0,0 +1,9 @@ + + + + &Settings + + + + + diff --git a/kate/filelistloader/Makefile.am b/kate/filelistloader/Makefile.am new file mode 100644 index 0000000..8b47569 --- /dev/null +++ b/kate/filelistloader/Makefile.am @@ -0,0 +1,34 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +#KDE_ICON = textfilter + +# Install this plugin in the KDE modules directory +#kde_module_LTLIBRARIES = katefll_initplugin.la katefll_plugin.la +kde_module_LTLIBRARIES = katefll_plugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +#katefll_initplugin_la_SOURCES = katefll_initplugin.cpp +#katefll_initplugin_la_LIBADD = -lkateinterfaces +#katefll_initplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +katefll_plugin_la_SOURCES = katefll_plugin.cpp +katefll_plugin_la_LIBADD = -lkateinterfaces +katefll_plugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +pluginsdir = $(kde_datadir)/kate/plugins/katefll +plugins_DATA = ui.rc + +#kde_services_DATA = katefll_initplugin.desktop katefll_plugin.desktop +kde_services_DATA = katefll_plugin.desktop + +kdelnk_DATA = katefll.desktop +kdelnkdir = $(kde_appsdir)/.hidden + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katefll_initplugin.pot + $(XGETTEXT) *.cpp -o $(podir)/katefll_plugin.pot + diff --git a/kate/filelistloader/katefll.desktop b/kate/filelistloader/katefll.desktop new file mode 100644 index 0000000..0a5e58b --- /dev/null +++ b/kate/filelistloader/katefll.desktop @@ -0,0 +1,83 @@ +[Desktop Entry] +GenericName=Text Editor /FLL +GenericName[ar]=محرر نصوص /FLL +GenericName[az]=Mətn Editoru /FLL +GenericName[br]=Aozer skrid /FLL +GenericName[bs]=Tekst editor/FLL +GenericName[ca]=Editor de text /FLL +GenericName[cs]=Textový editor /FLL +GenericName[cy]=Golygydd Testun/FLL +GenericName[da]=Teksteditor/FLL +GenericName[de]=Texteditor /Dateilistenlader +GenericName[el]=Επεξεργαστής κειμένου /FLL +GenericName[eo]=Tekstredaktilo +GenericName[es]=Editor de texto /FLL +GenericName[et]=Tekstiredaktor /failinimekiri +GenericName[eu]=/FLL testu editorea +GenericName[fa]=ویرایشگر متن /FLL +GenericName[fi]=Tekstieditori /FLL +GenericName[fo]=Tekstritil/FLL +GenericName[fr]=Éditeur de texte / FLL +GenericName[fy]=Teksteditor /FLL +GenericName[ga]=Eagarthóir Téacs /FLL +GenericName[gl]=Lista de Ficheiros do Editor de Texto +GenericName[he]=עורך טקסט \FLL +GenericName[hi]=पाठ सम्पादक /एफएलएल +GenericName[hr]=Uređivač teksta / FLL +GenericName[hu]=Szövegszerkesztő /FLL +GenericName[is]=Textaritill /FLL +GenericName[it]=Editor di testi /FLL +GenericName[ja]=テキストエディタ/FLL +GenericName[ka]=ტექსტის რედაქტორი /FLL +GenericName[kk]=Мәтін редакторы/FLL +GenericName[km]=កម្មវិធី​និពន្ធ /FLL +GenericName[lt]=Teksto redaktorius /FLL +GenericName[mk]=Уредувач на текст /FLL +GenericName[ms]=Penyunting Teks /FLL +GenericName[mt]=Editur tat-test /FLL +GenericName[nb]=Tekstredigerer / Fillaster +GenericName[nds]=Texteditor /Dateilistlader +GenericName[ne]=पाठ सम्पादक /एफएलएल +GenericName[nl]=Teksteditor /FLL +GenericName[nn]=Skriveprogram/FLL +GenericName[nso]=/FLL ya Mofetosi wa Sengwalwana +GenericName[pa]=ਪਾਠ ਸੰਪਾਦਕ /FLL +GenericName[pl]=Edytor tekstu /Wczytywanie listy plików +GenericName[pt]=Lista de Ficheiros do Editor de Texto +GenericName[pt_BR]=Editor de Texto /FLL +GenericName[ro]=Editor de text / FFL +GenericName[ru]=Текстовый редактор/FLL +GenericName[sk]=Textový editor /FLL +GenericName[sl]=Urejevalnik besedil /FLL +GenericName[sr]=Уређивач текста /FLL +GenericName[sr@Latn]=Uređivač teksta /FLL +GenericName[sv]=Texteditor /FLL +GenericName[ta]=உரைதொகுப்பான்/FLL +GenericName[tg]=Муҳаррири матнӣ/FLL +GenericName[tr]=Metin Düzenleyici / FLL +GenericName[uk]=Редактор текстів /FLL +GenericName[vi]=Trình soạn thảo văn bản/FLL +GenericName[xh]= Umhleli wombhalo /FLL +GenericName[zh_CN]=文本编辑器 /FLL +GenericName[zh_TW]=文字編輯器 /FLL +Name=KateFLL +Name[de]=Kate Dateilistenlader +Name[eo]=Dosierlista ŝargilo por Kodredaktilo +Name[et]=Kate failinimekiri +Name[fy]=Kate FLL +Name[hi]=के-एटीईएफएलएल +Name[ne]=केट एफएलएल +Name[nl]=Kate FLL +Name[pa]=ਕੇਟFLL +Name[pl]=Program wczytujący listę plików do Kate +Name[ro]=KateFFL +Name[sv]=Kate FLL +MimeType=text/x-katefilelist +Exec=kate --initplugin katefll_initplugin %u +NoDisplay=true +Icon=kate +Path= +DocPath=kate/index.html +Type=Application +Terminal=false +X-DCOP-ServiceType=Multi diff --git a/kate/filelistloader/katefll_initplugin.cpp b/kate/filelistloader/katefll_initplugin.cpp new file mode 100644 index 0000000..4eb116f --- /dev/null +++ b/kate/filelistloader/katefll_initplugin.cpp @@ -0,0 +1,96 @@ +/*************************************************************************** + katefll_initplugin.cpp - description + ------------------- + begin : FRE July 12th 2002 + copyright : (C) 2002 by Joseph Wenninger + email : jowenn@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 "katefll_initplugin.h" +#include "katefll_initplugin.moc" + +#include + +#include +#include +#include +#include +#include +#include +#include + +K_EXPORT_COMPONENT_FACTORY( katefll_initplugin, KGenericFactory( "katefll_loader" ) ) + +InitPluginKateFileListLoader::InitPluginKateFileListLoader (QObject * parent, const char *name, const QStringList datalist) + :InitPlugin((Kate::Application*)parent,name) +{ +} + + +InitPluginKateFileListLoader:: ~InitPluginKateFileListLoader() +{ +} + + +int InitPluginKateFileListLoader::actionsKateShouldNotPerformOnRealStartup() +{ + return 0x1; +} + +int InitPluginKateFileListLoader::initKate() +{ + QString tmpFile; + KURL tmpURL; + if( KIO::NetAccess::download( configScript(), tmpFile ) ) + { + QFile file(tmpFile); + file.open(IO_ReadOnly); + + QTextStream t(&file); + + bool somethingOpened=false; + + application()->documentManager()->closeAllDocuments(); + while (!t.eof()) + { + somethingOpened=true; +// application()->activeMainWindow()->viewManager()->openURL(KURL(t.readLine())); + application()->documentManager()->openURL(tmpURL=KURL(t.readLine())); + } + if (!somethingOpened) application()->documentManager()->openURL(KURL()); + else if (application()->activeMainWindow()) + application()->activeMainWindow()->viewManager()->openURL(tmpURL); + + file.close(); + + KIO::NetAccess::removeTempFile( tmpFile ); + + } else application()->documentManager()->openURL(KURL()); + + Kate::Plugin *pl=application()->pluginManager()->plugin("katefll_plugin"); + if (pl) + { + connect(this,SIGNAL(updateInit()),pl,SLOT(updateInit())); + updateInit(); + disconnect(this,SIGNAL(updateInit()),pl,SLOT(updateInit())); + +/* int id = pl->metaObject()->findSlot( SLOT(updateInit()) ); + if ( id != -1 ) + { + kdDebug()<<"Action slot was found, it will be called now"<module->qt_invoke( id, o ); + } */ + } + return 0; +} + diff --git a/kate/filelistloader/katefll_initplugin.desktop b/kate/filelistloader/katefll_initplugin.desktop new file mode 100644 index 0000000..472a9ad --- /dev/null +++ b/kate/filelistloader/katefll_initplugin.desktop @@ -0,0 +1,112 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/InitPlugin +X-KDE-Library=katefll_initplugin +X-Kate-Version=2.5 +Name=Kate FLL Init Plugin +Name[bs]=Kate FLL init plugin +Name[ca]=Connector per iniciar FLL per a Kate +Name[cs]=Kate FLL init plugin +Name[de]=Kate Initialisierungsmodul für Dateilistenlader +Name[el]=Πρόσθετο αρχικοποίησης FLL του Kate +Name[eo]=Komenca kromaĵo por Kodredaktilo +Name[es]=Complemento Kate FLL Init +Name[et]=Kate failinimekirja lähtestamise plugin +Name[eu]=Kate FLL init plugina +Name[fa]=وصلۀ آغازین Kate FLL +Name[fi]=Kate FLL alustussovelma +Name[fr]=Module externe FLL d'initialisation pour Kate +Name[fy]=Kate FLL inisjalisaasjeplugin +Name[ga]=Breiseán Túsaithe FLL le haghaidh Kate +Name[gl]=Plugin de Lista de Ficheiros para Kate +Name[he]=תוסף אתחול FLL ל־Kate +Name[hi]=के-एटीई एफएलएल इनिट प्लगइन +Name[hr]=Kate FLL inicijalizacijski dodatak +Name[hu]=Kate FLL inicializálási bővítőmodul +Name[is]=Kate FLL ræsiviðbætur +Name[it]=Plugin di inizializzazione di Kate FLL +Name[ja]=Kate FLL 初期化プラグイン +Name[ka]=Kate FLL Init მოდული +Name[kk]=Kate FLL инициализациялау плагин модулі +Name[km]=កម្មវិធី​ជំនួយ Kate FLL Init +Name[lt]=Kate FLL Init priedas +Name[mk]=Приклучок за иницијализација на Kate FLL +Name[ms]=Plugin Kate FLL Init +Name[nb]=Kate FLL init-programtillegg +Name[nds]=KateFLL-Init-Moduul +Name[ne]=केट एफएफएल Init प्लगइन +Name[nl]=Kate FLL initialisatieplugin +Name[nn]=Kate FLL-oppstartstillegg +Name[pl]=Wtyczka FLL Init dla Kate +Name[pt]='Plugin' de Lista de Ficheiros do Kate +Name[pt_BR]=Plugin FLL Init do Kate +Name[ru]=Модуль инициализации Kate FLL +Name[sk]=Kate FLL inicializačný modul +Name[sl]=Vstavek za FLL v Kate +Name[sr]=Прикључак Kate за иницијализацију FLL +Name[sr@Latn]=Priključak Kate za inicijalizaciju FLL +Name[sv]=Kate FLL-initieringsinsticksprogram +Name[ta]=Kate FLL init சொருகுப்பொருள் +Name[tg]=Модули инисиализатсиякунонии Kate FLL +Name[tr]=Kate FLL İlklendirme Eklentisi +Name[uk]=Втулок ініціалізації FLL для Kate +Name[vi]=Bổ sung Init FLL Kate +Name[zh_CN]=Kate FLL 初始插件 +Name[zh_TW]=Kate FLL 初始化外掛程式 +Comment=Initializes Kate's opened files list with those URLs stored within an "init script" +Comment[ar]=تبدأ قوائم ملفات Kate المفتوحة مع العناوين المحفوظة في "initscrips" +Comment[az]=Kate-in açıq fayllar siyahısını "init script"dəki URL-lərlə yoxlayır. +Comment[bg]=Инициализиране на списъка от отворени файлове с адресите, които се намират в инициализиращ скрипт +Comment[bs]=Inicijalizira listu otvorenih Kate datoteka sa tim URL-ovima smještenim u "init skripti" +Comment[ca]=Inicialitza el llistat de fitxers oberts de Kate amb aquests URL desats en un "script d'inici" +Comment[cs]=Inicializuje otevřené soubory Kate pomocí URL uloženého v "init skriptu" +Comment[cy]=Ymgychwyn rhestr ffeiliau agored Kate efo'r URLs sydd wedi eu storio mewn "sgript init" +Comment[da]=Initialiserer Kates liste over åbne filer med de URL'er som er gemt i et "init-script" +Comment[de]=Initialisiert die Liste der von Kate geöffneten Dateien mit den Datei-Adressen aus einem "Init-Skript" +Comment[el]=Αρχικοποιεί τη λίστα ανοιγμένων αρχείων του Kate με αυτά τα URL που είναι αποθηκευμένα σε ένα "αρχείο εντολών αρχικοποίησης" +Comment[en_GB]=Initialises Kate's opened files list with those URLs stored within an "init script" +Comment[eo]=Komencas la liston de malfermitaj dosieraj de Kodredaktilo per la URLoj konservataj en « komenca skriptaĵo » +Comment[es]=Inicializa la lista de los archivos de Kate abiertos con los URL guardados en un «programa de inicio» +Comment[et]=Lähtestab Kate avatud failide nimekirja URLidega, mis on salvestatud "init script"-is +Comment[eu]=Katek irekita dituen fitxategien zerrenda hasieratzen du euren URLak "hasierako script" batean gordeta dituelarik. +Comment[fa]=فهرست پرونده‌های باز Kate را با آن نشانیهای وب ذخیره‌شده درون یک «init script»، مقداردهی اولیه می‌کند. +Comment[fi]=Alustaa Katen avattujen tiedostojen listan URL:la jotka on tallennettu "alustusskriptiin" +Comment[fr]=Initialise la liste des fichiers de Kate ouverts avec les URL enregistrées dans un « init script » +Comment[fy]=inisjalisearret de list mei fanút Kate iepene triemmen mei byhearrende URL-adressen opslein yn in "init script" +Comment[gl]=Inicializa a lista de ficheiros abertos en Kate cos URLs guardados nun script inicial +Comment[he]=אתחול רשימת הקבצים הפתוחים של Kate עם כתובות השמורות ב"תסריט אתחול" +Comment[hi]=के-एटीई के फ़ाइल खोलें सूची इनिशियलाइज़ करता है जो कि उन यूआरएल के साथ एक "इनिट स्क्रिप्ट" में होते हैं +Comment[hr]=Inicijalizira popis otvorenih datoteka aplikacije Kate s URL adresama pohranjenim unutar skripte "init script" +Comment[hu]=Feltölti a Kate-ben a megnyitott fájlok listáját azokkal az URL-ekkel, melyek a megadott "inicializációs szkriptben" találhatók +Comment[is]=Frumstillir opnar skrár Kate með lista af þeim slóðum sem eru geymdar í "init script" +Comment[it]=Inizializza la lista dei file aperti da Kate con gli URL salvati in uno script di inizializzazione +Comment[ja]=Kate のファイルリストを「初期化スクリプト」に保存されている URL で初期化します +Comment[ka]=Kate-ს ღია ფაილთა სიის ინიციალიზაციას აკეთებს იმ URLებით რომლებიც "init script"-ში ინახება +Comment[kk]=Kate-те ашылған файлдар тізімін "инициализациялау скриптінде" сақталғаны бойынша инициализациялайды +Comment[km]=ចាប់​ផ្ដើម​បញ្ជី​ឯកសារដែល​បាន​បើក​របស់ Kate ជា​មួយ​នឹង URLs ទាំង​នោះ​​ដែល​បាន​ទុក​ក្នុង "ស្គ្រីប init​" +Comment[lt]=Sužadina Kate atvertų bylų sąrašą su tais URL, kurie išsaugoti „sužadinimo scenarijuje“ +Comment[mk]=Ја иницијализира листата на отворени датотеки на Кате со URL-ата зачувани во „init script“ +Comment[ms]=Memulakan senarai fail terbuka Kate dengan fail yang distor oleh URL dalam "skrip init" +Comment[nb]=Initialiserer de åpne fil-listene i Kate med URLene i et «init skript» +Comment[nds]=Maakt Kate ehr List vun opmaakte Dateien mit de Adressen ut en "Init-Skript" torecht +Comment[ne]=एउटा "init script" मा भण्डारण गरिएका यूआरएलबाट केटका खुला फाइलहरू सुरुआत गर्छ +Comment[nl]=initialiseert de lijst met vanuit Kate geopende bestanden met bijhorende URL-adressen opgeslagen in een "init script" +Comment[nn]=Fyller fillista i Kate med URL-ar frå eit oppstartsskript +Comment[pl]=Inicjalizuje listę otwartych plików Kate zgodnie z URL-ami zapisanymi w "skrypcie inicjalizacyjnym" +Comment[pt]=Inicializa a lista de ficheiros abertos do Kate com os URLs guardados num 'script' inicial +Comment[pt_BR]=Inicializa os arquivos abertos do Kate com as URLs armazenadas dentro de um "init script" +Comment[ro]=Iniţializează lista de fişiere deschide de Kate cu URL-urile salvate într-un "script de iniţializare" +Comment[ru]=Инициализирует список открытых файлов Kate по их адресам через скрипт +Comment[sk]=Inicializuje otvorené súbory Kate s týmy URL uloženýmy v "init script" +Comment[sl]=Inicializira seznam odprtih datotek v Kate z naslovi URL znotraj le-teh»skripta init« +Comment[sr]=Иницијализује листу отворених фајлова у Kate са URL-овима похрањеним унутар „скрипте за иницијализацију“ +Comment[sr@Latn]=Inicijalizuje listu otvorenih fajlova u Kate sa URL-ovima pohranjenim unutar „skripte za inicijalizaciju“ +Comment[sv]=Initierar Kates öppnade fillista med webbadresserna lagrade inuti ett "init-skript" +Comment[ta]="init script"ல் சேமிக்கப்பட்டுள்ள வலைமனைகளுடன் கேட்ஸ்சின் திறந்துள்ள கோப்புகளின் பட்டியலை துவக்குகிறது +Comment[tg]=Ҳамаи рӯйхати файлҳои кушодаи Kate -ро бо суроғаҳояш аз дастнавис инисиалӣ мекунад +Comment[tr]=Kate'in açılan dosyalar listesini bir "ilklendirme betiği"nde saklanan URL'lerle oluşturur +Comment[uk]=Ініціалізує список фалів, відкритий Kate значеннями URL, що зберігаються в "init script" +Comment[vi]=Khởi tạo danh sách các tập tin mở của Kate bằng những địa chi URL được cất giữ bên trong một « văn lệnh khởi tạo » +Comment[xh]=Inika inani kuluhlu lweefayile ezivulekileyo kunye nezo ze URLs ezigcinwe phakathi kwi "init ushicilelo lwaphantsi" +Comment[zh_CN]=使用存储在“init script”中的 URL 来初始 Kate 的打开文件列表 +Comment[zh_TW]=初始化 Kate 開啟的檔案清單 diff --git a/kate/filelistloader/katefll_initplugin.h b/kate/filelistloader/katefll_initplugin.h new file mode 100644 index 0000000..7bfd955 --- /dev/null +++ b/kate/filelistloader/katefll_initplugin.h @@ -0,0 +1,46 @@ + /*************************************************************************** + katefll_initplugin.h - description + ------------------- + begin : FRE July 12th 2002 + copyright : (C) 2002 by Joseph Wenninger + email : jowenn@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 _PLUGIN_KATE_FLL_H +#define _PLUGIN_KATE_FLL_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +class InitPluginKateFileListLoader : public Kate::InitPlugin +{ + Q_OBJECT + + public: + InitPluginKateFileListLoader (QObject * =0, const char * =0, const QStringList =QStringList()); + virtual ~InitPluginKateFileListLoader(); + virtual int actionsKateShouldNotPerformOnRealStartup(); + virtual int initKate(); + + signals: + void updateInit(); + +}; + +#endif // _PLUGIN_KATE_FLL_H diff --git a/kate/filelistloader/katefll_plugin.cpp b/kate/filelistloader/katefll_plugin.cpp new file mode 100644 index 0000000..bbb91a3 --- /dev/null +++ b/kate/filelistloader/katefll_plugin.cpp @@ -0,0 +1,241 @@ +/*************************************************************************** + katefll_plugin.cpp - description + ------------------- + begin : FRE July 12th 2002 + copyright : (C) 2002 by Joseph Wenninger + email : jowenn@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 "katefll_plugin.h" +#include "katefll_plugin.moc" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +K_EXPORT_COMPONENT_FACTORY( katefll_plugin, KGenericFactory( "katefll_loader" ) ) + +class PluginView : public KXMLGUIClient +{ + friend class PluginKateFileListLoader; + + public: + Kate::MainWindow *win; + KRecentFilesAction *recentFiles; +}; + +PluginKateFileListLoader::PluginKateFileListLoader (QObject * parent, const char *name, const QStringList) + : Plugin((Kate::Application*)parent,name), PluginViewInterface(), + m_config( new KConfig("katefilelistpluginrc") ) +{ + m_config->setGroup("General"); + updateInit(); +} + + +PluginKateFileListLoader:: ~PluginKateFileListLoader() +{ + m_config->sync(); + delete m_config; +} + + +void PluginKateFileListLoader::updateInit() +{ + /*if (application()->initPluginManager()->initPlugin()) + { + if (application()->initPluginManager()->initPlugin()->qt_cast("InitPluginKateFileListLoader")) //That's needed, if the plugin is loaded during a configuration change + m_saveURL=application()->initPluginManager()->initScript(); + } + else*/ m_saveURL=KURL(); + m_oldInitURL="";//application()->initPluginManager()->initScript(); + m_saveAs=false; +} + +void PluginKateFileListLoader::addView(Kate::MainWindow *win) +{ + PluginView *view = new PluginView (); + + (void) new KAction( i18n("Open File List..."), 0, + this, SLOT( slotOpenList() ), + view->actionCollection(), "file_kfllopen" ); + + view->recentFiles = new KRecentFilesAction( i18n("Open Recent"), KShortcut::null(), + this, SLOT(slotOpenList(const KURL&)), view->actionCollection(), + "file_kfllopenrecent"); + view->recentFiles->loadEntries(m_config, "Recent Files"); + + (void) new KAction( i18n("Save File List"), 0, + this, SLOT( slotSaveList() ), + view->actionCollection(), "file_kfllsave" ); + + (void) new KAction( i18n("Save File List As..."), 0, + this, SLOT( slotSaveListAs() ), + view->actionCollection(), "file_kfllsaveas" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile( "plugins/katefll/ui.rc" ); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void PluginKateFileListLoader::removeView(Kate::MainWindow *win) +{ + if (m_views.count() == 1) // yeah baby, last view! So save filelist + m_views.at(0)->recentFiles->saveEntries(m_config, "Recent Files"); + + 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 PluginKateFileListLoader::addURLToList(const KURL& url) +{ + // add url to all views to make sure all are synced + for (uint a = 0; a < m_views.count(); ++a) + { + m_views.at(a)->recentFiles->addURL(url); + } +} + +void PluginKateFileListLoader::removeURLFromList(const KURL& url) +{ + // remove url from all views to make sure all are synced + for (uint a = 0; a < m_views.count(); ++a) { + m_views.at(a)->recentFiles->removeURL(url); + } +} + +void PluginKateFileListLoader::slotOpenList() +{ + KURL url = KFileDialog::getOpenURL(QString::null, + "*.katefl|Kate File List (*.katefl)"); + if (url.isValid()) // cancel pressed? + slotOpenList(url); +} + +void PluginKateFileListLoader::slotOpenList(const KURL& url) +{ + if ( url.isValid() && KIO::NetAccess::exists(url, false, 0) ) + { + addURLToList( url ); + if ( KMessageBox::questionYesNo (0, + i18n("Do you want to close all other files first?"), + i18n("Kate Filelist Loader"), + KStdGuiItem::close(), i18n("Do Not Close"), + "kate-filelist-loader-close-other" ) == KMessageBox::Yes ) + application()->documentManager()->closeAllDocuments(); + + QString tmpFile; + if( KIO::NetAccess::download( url, tmpFile, 0 ) ) + { + QFile file(tmpFile); + file.open(IO_ReadOnly); + + QTextStream t(&file); + KURL tmp; + while (!t.eof()) { + if ( ! tmp.isEmpty() ) + application()->documentManager()->openURL( tmp ); + + tmp = KURL(t.readLine()); +// application()->activeMainWindow()->viewManager()->openURL(KURL(t.readLine())); + } + + file.close(); + if ( ! tmp.isEmpty() ) + application()->activeMainWindow()->viewManager()->openURL(tmp); + + KIO::NetAccess::removeTempFile( tmpFile ); + } else application()->documentManager()->openURL(KURL()); + } + else + { + KMessageBox::error(0, i18n("The selected filelist does not exist or is invalid.")); + // url not valid -> remove from list + removeURLFromList(url); + } +} + +void PluginKateFileListLoader::slotSaveList() +{ + if (m_saveURL.isValid()) + { + if (m_saveAs) + { + /* if (m_oldInitURL!=application()->initPluginManager()->initScript()) + { + switch (KMessageBox::questionYesNoCancel(0,i18n("Since the last time you saved the file list, Kate has been reinitialized by another plugin other than the File List Loader. Do you still want to save the list to %1?").arg(m_saveURL.prettyURL()),QString::null,KStdGuiItem::save(),KStdGuiItem::discard())) + { + case KMessageBox::Yes: save(); break; + case KMessageBox::No: slotSaveListAs(); break; + default: break; + } + } + else*/ save(); + } + else + { + /*if (m_saveURL!=application()->initPluginManager()->initScript()) + { + switch (KMessageBox::questionYesNoCancel(0,i18n("Kate has been reinitialized by another plugin other than the File List Loader. Do you still want to save the list to %1?").arg(m_saveURL.prettyURL()),QString::null,KStdGuiItem::save(),KStdGuiItem::discard())) + { + case KMessageBox::Yes: save(); break; + case KMessageBox::No: slotSaveListAs(); break; + default: break; + } + } + else */save(); + } + } else slotSaveListAs(); +} + +void PluginKateFileListLoader::save() +{ + KTempFile file(locateLocal("tmp", "kate"), "katefll"); + for (uint i=0;idocumentManager()->documents();i++) + { + *file.textStream()<documentManager()->document(i)->url().url()<initPluginManager()->initScript(); + m_saveURL=url; + m_saveAs=true; + save(); + } +} diff --git a/kate/filelistloader/katefll_plugin.desktop b/kate/filelistloader/katefll_plugin.desktop new file mode 100644 index 0000000..7c7858b --- /dev/null +++ b/kate/filelistloader/katefll_plugin.desktop @@ -0,0 +1,125 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katefll_plugin +X-Kate-Version=2.5 +Name=Kate File List Loader +Name[af]=Kate Lêer Lys Laaier +Name[ar]=محمّل قوائم ملفات Kate +Name[az]=Kate Fayl Siyahısı Yükləyicisi +Name[br]=Karger ar roll restr Kate +Name[ca]=Carregador de la llista de fitxers per a Kate +Name[cy]=Llwythydd Rhestr Ffeiliau am Kate +Name[da]=Kate Fillisteindlæser +Name[de]=Kate-Dateilistenlader +Name[el]=Φορτωτής λίστας αρχείων για το Kate +Name[eo]=Dosierlista ŝargilo por Kodredaktilo +Name[es]=Cargador de la lista de archivos de Kate +Name[et]=Kate failinimekirja avaja +Name[eu]=Kateren fitxategi zerrendaren kargatzailea +Name[fa]=بارکنندۀ فهرست پروندۀ Kate +Name[fi]=Kate tiedostolistalatain +Name[fr]=Chargeur de liste de fichiers pour Kate +Name[fy]=Kate-triemlistlader +Name[ga]=Luchtóir Liostaí Comhad Kate +Name[gl]=Leitor da Lista de Ficheiros para Kate +Name[he]=טוען רשימות הקבצים של Kate +Name[hi]=के-एटीई फ़ाइल सूची लोड करने वाला +Name[hr]=Kate učitavač popisa datoteka +Name[hu]=Kate fájllista-betöltő +Name[is]=Kate skráarlistar +Name[it]=Caricatore di Liste di File (FLL) di Kate +Name[ja]=Kate ファイルリストローダ +Name[ka]=Kate ფაილთა სიის ჩამტვირთავი +Name[kk]=Kate файл тізімін жүктеуіші +Name[km]=កម្មវិធី​ផ្ទុក​បញ្ជី​ឯកសារ​របស់ Kate +Name[lt]=Kate bylų sąrašo pakrovėjas +Name[mk]=Вчитувач на листа на датотеки за Кате +Name[ms]=Pemuat Senarai Fail Kate +Name[nb]=Kate Filliste-laster +Name[nds]=Kate-Dateilistlader +Name[ne]=केट फाइल सूची लोडर +Name[nl]=Kate-bestandenlijstlader +Name[nn]=Fillistelastar for Kate +Name[nso]=Molaisi wa Palo ya Faele ya Kate +Name[pa]=ਕੇਟ ਫਾਇਲ ਸੂਚੀ ਲੋਡਰ +Name[pl]=Program wczytujący listę plików do Kate +Name[pt]=Leitor da Lista de Ficheiros do Kate +Name[pt_BR]=Carregador de Lista de Arquivos do Kate +Name[ro]=Încărcător listă de fişiere Kate +Name[ru]=Загрузчик списка файлов Kate +Name[sk]=Kate nahrávač zoznamu súborov +Name[sl]=Nalagalnik seznama datotek v Kate +Name[sr]=Учитавач листе фајлова за Kate +Name[sr@Latn]=Učitavač liste fajlova za Kate +Name[sv]=Kates fillistladdare +Name[ta]=கேட் கோப்புப் பட்டியல் உள்ளிடுபவர் +Name[tg]=Пурборкунандаи рӯйхати файлҳои Kate +Name[tr]=Kate Dosya Listesi Yükleyici +Name[uk]=Завантажувач списку файлів Kate +Name[uz]=Kate fayllar roʻyxatini yuklovchisi +Name[uz@cyrillic]=Kate файллар рўйхатини юкловчиси +Name[vi]=Bộ nạp danh sách tập tin Kate +Name[xh]=Umlayishi Woluhlu Lwefayile ye Kate +Name[zh_CN]=Kate 文件列表载入器 +Name[zh_TW]=Kate 文字清單載入器 +Comment=Store Kate's file list on disc +Comment[ar]=تحفظ قوائم ملفات Kate على القرص +Comment[az]=Store Kate-in disk üstündəki fayl siyahısı +Comment[bg]=Запис на списъка от отворени файлове на диска +Comment[bs]=Snima listu datoteka programa Kate na disk +Comment[ca]=Desa la llista de fitxers de Kate al disc +Comment[cs]=Uloží seznam souborů Kate na disk +Comment[cy]=Cadw rhestr ffeiliau Kate ar ddisg +Comment[da]=Gem Kates filliste på disken +Comment[de]=Dateiliste von Kate auf Festplatte speichern +Comment[el]=Αποθήκευση της λίστας αρχείων του Kate στο δίσκο +Comment[eo]=Konservas dosierliston de Kodredaktilo en disko +Comment[es]=Guarda en disco una lista de archivos de Kate +Comment[et]=Salvestab Kate failinimekirja kõvakettale +Comment[eu]=Gorde Kateren fitxategi zerrenda diskoan +Comment[fa]=فهرست پروندۀ Kate را بر روی دیسک ذخیره می‌کند. +Comment[fi]=Tallenna Katen tiedostolista levylle +Comment[fr]=Enregistrement de la liste des fichiers de Kate sur le disque +Comment[fy]=triemlist fan Kate op de skiif opslaan +Comment[ga]=Stóráil an liosta comhad Kate ar an diosca +Comment[gl]=Guarda a lista de ficheiros para Kate no disco +Comment[he]=שמירת רשימת הקבצים של Kate על גבי הכונן +Comment[hi]=डिस्क पर के-एटीई की फ़ाइल सूची भंडारित करता है +Comment[hr]=Spremanje Kate popisa datoteka na disk +Comment[hu]=A Kate fájllista elmentése lemezre +Comment[is]=Geyma skráarlista Kate á diski +Comment[it]=Salva la lista di file di Kate su disco +Comment[ja]=Kate のファイルリストをディスクに保存します +Comment[ka]=ინახავს დისკზე Kate-ის ფაილთა სიას +Comment[kk]=Kate файлдар тізімін дискіде сақтау +Comment[km]=​ទុក​បញ្ជី​ឯកសារ​របស់ Kate នៅ​ក្នុង​​ថាស +Comment[lt]=Išsaugoja Kate bylų sąrašą diske +Comment[mk]=Ја зачувува листата на датотеки на Кате на диск +Comment[ms]=Simpan senarai fail Kate atas cakera +Comment[nb]=Lagre fillistene fra Kate på disken +Comment[nds]=Sekert de Dateilist vun Kate op de Fastplaat +Comment[ne]=डिस्कमा केटको फाइल सूची भण्डारण गर्छ +Comment[nl]=Sla Kate's bestandenlijst op de schijf op +Comment[nn]=Lagra fillista i Kate +Comment[nso]=Boloka dipalo tsa faele ya Kate go disc +Comment[pl]=Zapisanie listy plików Kate na dysku +Comment[pt]=Guarda a lista de ficheiros do Kate no disco +Comment[pt_BR]=Armazena Lista de arquivos do Kate no disco +Comment[ro]=Salvează lista de fişiere Kate pe disc +Comment[ru]=Сохранить список файлов Kate на диске +Comment[sk]=Uloží zoznam súborov Kate na disk +Comment[sl]=Shrani seznam datotek v Kate na disk +Comment[sr]=Похраните листу фајлова из Kate на диск +Comment[sr@Latn]=Pohranite listu fajlova iz Kate na disk +Comment[sv]=Lagra Kates fillista på disk +Comment[ta]= கேட்ஸ்சின் கோப்புப்பட்டியலை வட்டில் சேமி +Comment[tg]=Захира кардани рӯйхати файлҳои Kate ба диск +Comment[tr]=Kate'in dosya listesini diske kaydeder +Comment[uk]=Запис списку файлів Kate на диск +Comment[uz]=Kate fayllar roʻyxatini diskda saqlash +Comment[uz@cyrillic]=Kate файллар рўйхатини дискда сақлаш +Comment[vi]=Cất giữ danh sách tập tin của Kate trên đĩa +Comment[xh]=Gcina uluhlu lodweliso lwefayile ye Kate kwi disc +Comment[zh_CN]=在磁盘上存储 Kate 的文件列表 +Comment[zh_TW]=儲存 Kate 檔案清單於磁碟中 diff --git a/kate/filelistloader/katefll_plugin.h b/kate/filelistloader/katefll_plugin.h new file mode 100644 index 0000000..81b7bb8 --- /dev/null +++ b/kate/filelistloader/katefll_plugin.h @@ -0,0 +1,67 @@ + /*************************************************************************** + katefll_plugin.h - description + ------------------- + begin : FRE July 12th 2002 + copyright : (C) 2002 by Joseph Wenninger + email : jowenn@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 _PLUGIN_KATE_FLL_H +#define _PLUGIN_KATE_FLL_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +class PluginKateFileListLoader : public Kate::Plugin, Kate::PluginViewInterface +{ + Q_OBJECT + + public: + PluginKateFileListLoader (QObject * =0, const char * =0, const QStringList =QStringList()); + virtual ~PluginKateFileListLoader(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + public slots: + void updateInit(); + + protected: + void addURLToList(const KURL& url); + void removeURLFromList(const KURL& url); + + protected slots: + void slotOpenList(); + void slotOpenList(const KURL& url); + void slotSaveList(); + void slotSaveListAs(); + void save(); + + private: + QPtrList m_views; + KRecentFilesAction *m_recentFiles; + KConfig* m_config; + KURL m_oldInitURL; + KURL m_saveURL; + bool m_saveAs; +}; + +#endif // _PLUGIN_KATE_FLL_H diff --git a/kate/filelistloader/ui.rc b/kate/filelistloader/ui.rc new file mode 100644 index 0000000..dc7e569 --- /dev/null +++ b/kate/filelistloader/ui.rc @@ -0,0 +1,13 @@ + + + +&File + &Filelist + + + + + + + + diff --git a/kate/filetemplates/Makefile.am b/kate/filetemplates/Makefile.am new file mode 100644 index 0000000..706d062 --- /dev/null +++ b/kate/filetemplates/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = plugin templates diff --git a/kate/filetemplates/katefiletemplates.kateproject b/kate/filetemplates/katefiletemplates.kateproject new file mode 100644 index 0000000..c7506d8 --- /dev/null +++ b/kate/filetemplates/katefiletemplates.kateproject @@ -0,0 +1,15 @@ +[Dir plugin] +Dirs= +Files=filetemplates.cpp/filetemplates.h/katefiletemplates.desktop/katetemplate.xml/Makefile.am/ui.rc + +[Dir templates] +Dirs= +Files=cppgpl.cpp.katetemplate/cppgpl.hh.katetemplate/cpplgpl.cpp.katetemplate/cpplgpl.hh.katetemplate/docbookchapter.xml.katetemplate/html.katetemplate/language.xml.katetemplate/Makefile.am + +[Project Dir] +Dirs=plugin/templates +Files=Makefile.am + +[Project File] +Name=katefiletemplates +Type=Default diff --git a/kate/filetemplates/plugin/Makefile.am b/kate/filetemplates/plugin/Makefile.am new file mode 100644 index 0000000..7963916 --- /dev/null +++ b/kate/filetemplates/plugin/Makefile.am @@ -0,0 +1,25 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +subdirs=src templates + +#KDE_ICON = filetemplates + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = katefiletemplates.la + +katefiletemplates_la_SOURCES = filetemplates.cpp +katefiletemplates_la_LIBADD = -lkateinterfaces -lktexteditor $(LIB_KNEWSTUFF) +katefiletemplates_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +pluginsdir = $(kde_datadir)/kate/plugins/katefiletemplates +plugins_DATA = ui.rc + +syntaxdir = $(kde_datadir)/katepart/syntax +syntax_DATA = katetemplate.xml + +kde_services_DATA = katefiletemplates.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katefiletemplates.pot + diff --git a/kate/filetemplates/plugin/filetemplates.cpp b/kate/filetemplates/plugin/filetemplates.cpp new file mode 100644 index 0000000..e1eb847 --- /dev/null +++ b/kate/filetemplates/plugin/filetemplates.cpp @@ -0,0 +1,1254 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + --- + Copyright (C) 2004, Anders Lund + */ + +//BEGIN Includes +#include "filetemplates.h" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +//END Includes + +//BEGIN plugin + factory stuff +class PluginView : public KXMLGUIClient +{ + friend class KateFileTemplates; + + public: + Kate::MainWindow *win; +}; + +extern "C" +{ + void* init_katefiletemplates() + { + KGlobal::locale()->insertCatalogue("katefiletemplates"); + 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 KateFileTemplates( parent, name ); +} + +KInstance* KatePluginFactory::s_instance = 0L; +//END + +//BEGIN TemplateInfo +class TemplateInfo +{ + public: + TemplateInfo( const QString& fn, const QString &t, const QString &g ) + : filename( fn ), tmplate ( t ), group( g ) { ; } + ~TemplateInfo() { ; } + + QString filename; + QString tmplate; + QString group; + QString description; + QString author; + QString highlight; + QString icon; +}; +//END TemplateInfo + +//BEGIN KateFileTemplates +KateFileTemplates::KateFileTemplates( QObject* parent, const char* name ) + : Kate::Plugin ( (Kate::Application*)parent, name ), + m_actionCollection( new KActionCollection( this, "template_actions", new KInstance("kate") ) ) +{ + // create actions, so that they are shared. + // We plug them into each view's menus, and update them centrally, so that + // new plugins can automatically become visible in all windows. + (void) new KAction ( i18n("Any File..."), 0, this, + SLOT( slotAny() ), m_actionCollection, + "file_template_any" ); + // recent templates + m_acRecentTemplates = new KRecentFilesAction( i18n("&Use Recent"), 0, this, + SLOT(slotOpenTemplate(const KURL &)), + m_actionCollection, + "file_templates_recent" ); + m_acRecentTemplates->loadEntries( kapp->config(), "Recent Templates" ); + + // template menu + m_dw = new KDirWatch( this, "template_dirwatch" ); + QStringList dirs = KGlobal::dirs()->findDirs("data", "kate/plugins/katefiletemplates/templates"); + for ( QStringList::Iterator it = dirs.begin(); it != dirs.end(); ++it ) + { + m_dw->addDir( *it, true ); + } + + connect( m_dw, SIGNAL(dirty(const QString&)), + this, SLOT(updateTemplateDirs(const QString&)) ); + connect( m_dw, SIGNAL(created(const QString&)), + this, SLOT(updateTemplateDirs(const QString&)) ); + connect( m_dw, SIGNAL(deleted(const QString&)), + this, SLOT(updateTemplateDirs(const QString&)) ); + + m_templates.setAutoDelete( true ); + updateTemplateDirs(); + + m_user = 0; + m_emailstuff = 0; +} + +/** + * Called whenever the template dir is changed. Recreates the templates list. + */ +void KateFileTemplates::updateTemplateDirs(const QString &d) +{ + kdDebug()<<"updateTemplateDirs called with arg "<findAllResources( + "data","kate/plugins/katefiletemplates/templates/*.katetemplate", + false,true); + + m_templates.clear(); + + QRegExp re( "\\b(\\w+)\\s*=\\s*(.+)(?:\\s+\\w+=|$)" ); + re.setMinimal( true ); + + KConfig *config = kapp->config(); + QStringList hidden; + config->readListEntry( "Hidden", hidden, ';' ); + + for ( QStringList::Iterator it=templates.begin(); it != templates.end(); ++it ) + { + QFile _f( *it ); + if ( _f.open( IO_ReadOnly ) ) + { + QString fname = (*it).section( '/', -1 ); + + // skip if hidden + if ( hidden.contains( fname ) ) + continue; + + // Read the first line of the file, to get the group/name + TemplateInfo *tmp = new TemplateInfo( *it, fname, "Other" ); + bool trymore ( true ); + QTextStream stream(&_f); + while ( trymore ) + { + QString _line = stream.readLine(); + trymore = _line.startsWith( "katetemplate:" ); + if ( ! trymore ) break; + + int pos ( 0 ); + while ( ( ( pos = re.search( _line, pos ) ) >= 0 ) ) + { + pos += re.cap( 1 ).length(); + if ( re.cap( 1 ).lower() == "template" ) + tmp->tmplate = re.cap( 2 ); + if ( re.cap( 1 ).lower() == "group" ) + tmp->group = re.cap( 2 ); + if ( re.cap( 1 ).lower() == "description" ) + tmp->description = re.cap( 2 ); + if ( re.cap( 1 ).lower() == "author" ) + tmp->author = re.cap( 2 ); + if ( re.cap( 1 ).lower() == "highlight" ) + tmp->highlight = re.cap( 2 ); + if ( re.cap( 1 ) == "icon" ) + tmp->icon = re.cap( 2 ); + } + } + + m_templates.append( tmp ); + _f.close(); + } + } + + // update the menus of all views + for (uint z=0; z < m_views.count(); z++) + { + PluginView *view = m_views.at(z); + refreshMenu( view ); + } +} + +KateFileTemplates::~KateFileTemplates() +{ + m_acRecentTemplates->saveEntries( kapp->config(), "Recent Templates" ); + delete m_emailstuff; + delete m_user; +} + +void KateFileTemplates::addView(Kate::MainWindow *win) +{ + PluginView *view = new PluginView (); + + (void) new KAction( i18n("&Manage Templates..."), 0, + this, SLOT(slotEditTemplate()), + view->actionCollection(), "settings_manage_templates" ); + + (void)new KActionMenu( i18n("New From &Template"), "make", + view->actionCollection(), "file_new_fromtemplate" ); + refreshMenu( view ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile("plugins/katefiletemplates/ui.rc"); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void KateFileTemplates::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; + } +} + +QStringList KateFileTemplates::groups() +{ + QStringList l; + QString s; + + for ( uint i = 0; i < m_templates.count(); i++ ) + { + s = m_templates.at( i )->group; + if ( ! l.contains( s ) ) + l.append( s ); + } + + return l; +} + +void KateFileTemplates::refreshMenu( PluginView *v ) +{ + QPopupMenu *m = (QPopupMenu*)(((KActionMenu*)(v->actionCollection()->action("file_new_fromtemplate")))->popupMenu()); + + // clear the menu for templates + m->clear(); + + // restore it + m_actionCollection->action( "file_template_any" )->plug( m ); + m_acRecentTemplates->plug( m ); + m->insertSeparator(); + + QDict submenus; // ### QMAP + for ( uint i = 0; i < m_templates.count(); i++ ) + { + if ( ! submenus[ m_templates.at( i )->group ] ) + { + QPopupMenu *sm = new QPopupMenu(); + submenus.insert( m_templates.at( i )->group, sm ); + m->insertItem( m_templates.at( i )->group, sm ); + } + kdDebug()<<"=== ICON: '"<icon<<"'"<icon.isEmpty() ) + submenus[m_templates.at( i )->group]->insertItem( + SmallIconSet( m_templates.at( i )->icon ), + m_templates.at( i )->tmplate, this, SLOT(slotOpenTemplate( int )), 0, i ); + else + submenus[m_templates.at( i )->group]->insertItem( + m_templates.at( i )->tmplate, this, SLOT(slotOpenTemplate( int )), 0, i ); + + // add whatsthis containing the description and author + QString w ( m_templates.at( i )->description ); + if( ! m_templates.at( i )->author.isEmpty() ) + { + w.append( "

Author: " ); + w.append( m_templates.at( i )->author ); + } + if ( ! w.isEmpty() ) + w.prepend( "

" ); + + if ( ! w.isEmpty() ) + submenus[m_templates.at( i )->group]->findItem( i )->setWhatsThis( w ); + } +} + +/** + * Action slot: use any file as a template. + * Get a URL and pass it on. + */ +void KateFileTemplates::slotAny() +{ + if (!application()->activeMainWindow()) + return; + + // get a URL and pass that to slotOpenTemplate + QString fn = KFileDialog::getOpenFileName( + "katefiletemplate", + QString::null, + application()->activeMainWindow()->viewManager()->activeView(), + i18n("Open as Template") ); + if ( ! fn.isEmpty() ) + slotOpenTemplate( KURL( fn ) ); +} + +/** + * converts template [index] to a URL and passes that + */ +void KateFileTemplates::slotOpenTemplate( int index ) +{ + kdDebug()<<"slotOpenTemplate( "< m_templates.count() ) return; + slotOpenTemplate( KURL( m_templates.at( index )->filename ) ); +} + +void KateFileTemplates::slotOpenTemplate( const KURL &url ) +{ + // check if the file can be opened + QString tmpfile; + QString filename = url.fileName(); + kdDebug()<<"file: "<activeMainWindow()->viewManager()->activeView(), + i18n("Error opening the file
%1
for reading. The document will not be created.
").arg(filename), + i18n("Template Plugin"), 0 ); + KIO::NetAccess::removeTempFile( tmpfile ); + return; + } + + // this may take a moment.. + kapp->setOverrideCursor( QCursor(QCursor::WaitCursor) ); + + // create a new document + application()->activeMainWindow()->viewManager()->openURL( KURL() ); + Kate::View *view = application()->activeMainWindow()->viewManager()->activeView(); + Kate::Document *doc = view->getDoc(); + + + QTextStream stream(&file); + QString str, tmp; + uint numlines = 0; + uint doneheader = 0; + while ( !stream.eof() ) { + tmp = stream.readLine(); + if ( ! numlines && isTemplate && tmp.startsWith( "katetemplate:" ) ) + { + // look for document name, highlight + if ( ! (doneheader & 1) ) + { + QRegExp reName( "\\bdocumentname\\s*=\\s*(.+)(?:\\s+\\w+\\s*=|$)", false ); + reName.setMinimal( true ); + if ( reName.search( tmp ) > -1 ) + { + docname = reName.cap( 1 ); + docname = docname.replace( "%N", "%1" ); + doneheader |= 1; + } + } + + if ( ! (doneheader & 2) ) + { + QRegExp reHl( "\\bhighlight\\s*=\\s*(.+)(?:\\s+\\w+\\s*=|$)", false ); + reHl.setMinimal( true ); + kdDebug()<<"looking for a hl mode"< -1 ) + { + kdDebug()<<"looking for a hl mode -- "<hlModeCount() ) + { + if ( doc->hlModeName( _i ) == hlmode ) + { + doc->setHlMode( _i ); + break; + } + _i++; + } + + doneheader |= 2; + } + } + + continue; // skip this line + } + if ( numlines ) + str += "\n"; + str += tmp; + numlines++; + } + file.close(); + KIO::NetAccess::removeTempFile( tmpfile ); + + uint line, col; + line = col = 0; + + if ( ! isTemplate ) + { + int d = filename.findRev('.'); + docname = i18n("Untitled %1"); + if ( d > 0 ) docname += filename.mid( d ); + } else if ( docname.isEmpty() ) + docname = filename.left( filename.length() - 13 ); + + // check for other documents matching this naming scheme, + // and do a count before chosing a name for this one + QString p = docname; + p.replace( "%1", "\\d+" ); + p.replace( ".", "\\." ); + p.prepend( "^" ); + p.append( "$" ); + QRegExp reName( p ); + + int count = 1; + for ( uint i=0; i < application()->documentManager()->documents(); i++ ) + if ( ( reName.search ( application()->documentManager()->document( i )->docName() ) > -1 ) ) + count++; + + if ( docname.contains( "%1" ) ) + docname = docname.arg( count ); + + doc->setDocName( docname ); + + doc->setModified( false ); + + kapp->restoreOverrideCursor(); + m_acRecentTemplates->addURL( url ); + + // clean up + delete m_user; + m_user = 0; + delete m_emailstuff; + m_emailstuff = 0; + if (isTemplate) { + KTextEditor::TemplateInterface *ti=KTextEditor::templateInterface(doc); + ti->insertTemplateText(0,0,str,QMap()); + } else { + doc->insertText( 0, 0, str ); + view->setCursorPosition( line, col ); + } + } +} + + +QWidget *KateFileTemplates::parentWindow() +{ + return dynamic_cast(application()->activeMainWindow()); +} + +// The next part are tools to aid the creation and editing of templates +// ///////////////////////////////////////////////////////////////////// +// Steps to produce a template +// * Choose a file to start from (optional) +// * Ask for a location to store the file -- suggesting either the file +// directory, or the local template directory. +// Set the URL +// * Get the template properties -- provide a dialog, which has filled in what +// we already know -- the author name, list of known groups +// +// Combine those data into the editor, and tell the user to position the cursor +// and edit the file as she wants to... +void KateFileTemplates::slotCreateTemplate() +{ + KateTemplateWizard w( parentWindow(), this ); + w.exec(); + + updateTemplateDirs(); +} + +// Tools for editing the existing templates +// Editing a template: +// * Select the template to edit +// * Open the template +// * Set the URL to a writable one if required +void KateFileTemplates::slotEditTemplate() +{ + KDialogBase dlg( parentWindow(), "templatemanager", false, i18n("Manage File Templates"), KDialogBase::Close); + dlg.setMainWidget( new KateTemplateManager( this, &dlg ) ); + dlg.exec(); +} +//END KateFileTemplates + +//BEGIN KateTemplateInfoWidget +// This widget can be used to change the data of a TemplateInfo object +KateTemplateInfoWidget::KateTemplateInfoWidget( QWidget *parent, TemplateInfo *info, KateFileTemplates *kft ) + : QWidget( parent ), + info( info ), + kft( kft ) +{ + QGridLayout *lo = new QGridLayout( this, 6, 2 ); + lo->setAutoAdd( true ); + lo->setSpacing( KDialogBase::spacingHint() ); + + QLabel *l = new QLabel( i18n("&Template:"), this ); + QHBox *hb = new QHBox( this ); + hb->setSpacing( KDialogBase::spacingHint() ); + leTemplate = new QLineEdit( hb ); + l->setBuddy( leTemplate ); + QWhatsThis::add( leTemplate, i18n("

This string is used as the template's name " + "and is displayed, for example, in the Template menu. It should describe the " + "meaning of the template, for example 'HTML Document'.

") ); + ibIcon = new KIconButton( hb ); + QWhatsThis::add( ibIcon, i18n( + "Press to select or change the icon for this template") ); + + l = new QLabel( i18n("&Group:"), this ); + cmbGroup = new QComboBox( true, this ); + cmbGroup->insertStringList( kft->groups() ); + l->setBuddy( cmbGroup ); + QWhatsThis::add( cmbGroup, i18n("

The group is used for chosing a " + "submenu for the plugin. If it is empty, 'Other' is used.

" + "

You can type any string to add a new group to your menu.

") ); + + l = new QLabel( i18n("Document &name:"), this ); + leDocumentName = new QLineEdit( this ); + l->setBuddy( leDocumentName ); + QWhatsThis::add( leDocumentName, i18n("

This string will be used to set a name " + "for the new document, to display in the title bar and file list.

" + "

If the string contains '%N', that will be replaced with a number " + "increasing with each similarly named file.

For example, if the " + "Document Name is 'New shellscript (%N).sh', the first document will be " + "named 'New shellscript (1).sh', the second 'New shellscipt (2).sh', and " + "so on.

") ); + + l = new QLabel( i18n( "&Highlight:"), this ); + btnHighlight = new QPushButton( i18n("None"), this ); + l->setBuddy( btnHighlight ); + QWhatsThis::add( btnHighlight, i18n("

Select the highlight to use for the " + "template. If 'None' is chosen, the property will not be set.

") ); + + l = new QLabel( i18n("&Description:"), this ); + leDescription = new QLineEdit( this ); + l->setBuddy( leDescription ); + QWhatsThis::add( leDescription, i18n("

This string is used, for example, as " + "context help for this template (such as the 'whatsthis' help for the " + "menu item.)

") ); + + l = new QLabel( i18n("&Author:"), this ); + leAuthor = new QLineEdit( this ); + l->setBuddy( leAuthor ); + QWhatsThis::add( leAuthor, i18n("

You can set this if you want to share your " + "template with other users.

" + "

the recommended form is like an Email " + "address: 'Anders Lund <anders@alweb.dk>'

") ); + + // if we have a object ! null + if ( info ) + { + if ( ! info->icon.isEmpty() ) + ibIcon->setIcon( info->icon ); + leTemplate->setText( info->tmplate ); + cmbGroup->setCurrentText( info->group ); + leDescription->setText( info->description ); + leAuthor->setText( info->author ); + if ( ! info->highlight.isEmpty() ) + btnHighlight->setText( info->highlight ); + } + + // fill in the Hl menu + Kate::Document *doc = kft->application()->documentManager()->activeDocument(); + if ( doc ) + { + QPopupMenu *m = new QPopupMenu( btnHighlight ); + connect( m, SIGNAL( activated( int ) ), this, SLOT( slotHlSet( int ) ) ); + QDict submenus; + for ( uint n = 0; n < doc->hlModeCount(); n++ ) + { + // create the sub menu if it does not exist + QString text( doc->hlModeSectionName( n ) ); + if ( ! text.isEmpty() ) + { + if ( ! submenus[ text ] ) + { + QPopupMenu *sm = new QPopupMenu(); + submenus.insert( text, sm ); + connect( sm, SIGNAL( activated( int ) ), this, SLOT( slotHlSet( int ) ) ); + m->insertItem( text, sm ); + } + + // create the item + submenus[ text ]->insertItem( doc->hlModeName( n ), n ); + } + else + m->insertItem( doc->hlModeName( n ), n ); + } + + btnHighlight->setPopup( m ); + } +} + +void KateTemplateInfoWidget::slotHlSet( int id ) +{ + btnHighlight->setText( + kft->application()->documentManager()->activeDocument()->hlModeName( id ) ); +} +//END KateTemplateInfoWidget + +//BEGIN KateTemplateWizard +// A simple wizard to help create a new template :-) +KateTemplateWizard::KateTemplateWizard( QWidget *parent, KateFileTemplates *kft ) + : KWizard( parent ), + kft( kft ) +{ + // Hide the help button for now + helpButton()->hide(); + + // 1) Optionally choose a file or existing template to start from + QWidget *page = new QWidget( this ); + QGridLayout *glo = new QGridLayout( page ); + //lo->setAutoAdd( true ); + glo->setSpacing( KDialogBase::spacingHint() ); + + glo->addMultiCellWidget( new QLabel( i18n("

If you want to base this " + "template on an existing file or template, select the appropriate option " + "below.

"), page ), 1, 1, 1, 2); + bgOrigin = new QButtonGroup( page ); + bgOrigin->hide(); + bgOrigin->setRadioButtonExclusive( true ); + + QRadioButton *rb = new QRadioButton( i18n("Start with an &empty document" ), page ); + bgOrigin->insert( rb, 1 ); + glo->addMultiCellWidget( rb, 2, 2, 1, 2 ); + rb->setChecked( true ); + + rb = new QRadioButton( i18n("Use an existing file:"), page ); + bgOrigin->insert( rb, 2 ); + glo->addMultiCellWidget( rb, 3, 3, 1, 2 ); + int marg = rb->style().subRect( QStyle::SR_RadioButtonIndicator, rb ).width(); + glo->addItem( new QSpacerItem( marg, 1, QSizePolicy::Fixed ), 4, 1 ); + urOrigin = new KURLRequester( page ); + glo->addWidget( urOrigin, 4, 2 ); + + rb = new QRadioButton( i18n("Use an existing template:"), page ); + bgOrigin->insert( rb, 3 ); + glo->addMultiCellWidget( rb, 5, 5, 1, 2 ); + glo->addItem( new QSpacerItem( marg, 1, QSizePolicy::Fixed ), 6, 1 ); + btnTmpl = new QPushButton( page ); + glo->addWidget( btnTmpl, 6, 2 ); + QPopupMenu *m = new QPopupMenu( btnTmpl ); + connect( m, SIGNAL( activated( int ) ), this, SLOT( slotTmplateSet( int ) ) ); + + QDict submenus; + for ( uint i = 0; i < kft->templates().count(); i++ ) + { + if ( ! submenus[ kft->templates().at( i )->group ] ) + { + QPopupMenu *sm = new QPopupMenu(); + connect( sm, SIGNAL( activated( int ) ), this, SLOT( slotTmplateSet( int ) ) ); + submenus.insert( kft->templates().at( i )->group, sm ); + m->insertItem( kft->templates().at( i )->group, sm ); + } + + submenus[kft->templates().at( i )->group]->insertItem( + kft->templates().at( i )->tmplate, i ); + } + btnTmpl->setPopup( m ); + + connect( bgOrigin, SIGNAL(clicked(int)), this, SLOT(slotStateChanged(int)) ); + connect( urOrigin, SIGNAL(textChanged(const QString&)), this, SLOT(slotStateChanged(const QString&)) ); + + glo->addMultiCell( new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding ), 7, 7, 1, 2 ); + + addPage( page, i18n("Choose Template Origin") ); + kdDebug()<<"=== Adding template origin page at "< map; + map[ "fullname" ] = ""; + map[ "email" ] = ""; + + KTextEditor::TemplateInterface::expandMacros( map, parent ); + QString sFullname = map["fullname"]; + QString sEmail = map["email"]; + QString _s = sFullname; + if ( ! sEmail.isEmpty() ) + _s += " <" + sEmail + ">"; + kti->leAuthor->setText( _s ); + + // 3) choose a location - either the template directory (default) or + // a custom location + page = new QWidget( this ); + glo = new QGridLayout( page, 7, 2 ); + glo->setSpacing( KDialogBase::spacingHint() ); + + glo->addMultiCellWidget( new QLabel( i18n("

Choose a location for the " + "template. If you store it in the template directory, it will " + "automatically be added to the template menu.

"), page ), 1, 1, 1, 2); + + bgLocation = new QButtonGroup( page ); + bgLocation->hide(); + bgLocation->setRadioButtonExclusive( true ); + + rb = new QRadioButton( i18n("Template directory"), page ); + bgLocation->insert( rb, 1 ); + glo->addMultiCellWidget( rb, 2, 2, 1, 2 ); + rb->setChecked( true ); + + glo->addMultiCell( new QSpacerItem( marg, 1, QSizePolicy::Fixed ), 3, 4, 1, 1 ); + leTemplateFileName = new QLineEdit( page ); + QLabel *l = new QLabel( leTemplateFileName, i18n("Template &file name:"), page ); + + glo->addWidget( l, 3, 2 ); + glo->addWidget( leTemplateFileName, 4, 2 ); + + rb = new QRadioButton( i18n("Custom location:"), page ); + bgLocation->insert( rb, 2 ); + glo->addMultiCellWidget( rb, 5, 5, 1, 2 ); + + glo->addItem( new QSpacerItem( marg, 1, QSizePolicy::Fixed ), 6, 1 ); + urLocation = new KURLRequester( page ); + glo->addWidget( urLocation, 6, 2 ); + + connect( bgLocation, SIGNAL(clicked(int)), this, SLOT(slotStateChanged(int)) ); + connect( urLocation, SIGNAL(textChanged(const QString&)), this, SLOT(slotStateChanged(const QString&)) ); + connect( leTemplateFileName, SIGNAL(textChanged(const QString &)), this, SLOT(slotStateChanged(const QString &)) ); + + glo->addMultiCell( new QSpacerItem( 1, 1, QSizePolicy::Expanding, QSizePolicy::Expanding ), 7, 7, 1, 2 ); + + addPage( page, i18n("Choose Location") ); + kdDebug()<<"=== Adding location page at "<setSpacing( KDialogBase::spacingHint() ); + + lo->addWidget( + new QLabel( i18n( "

You can replace certain strings in the text with " + "template macros.

If any of the data below is incorrect or missing, " + "edit the data in the KDE email information."), page ) ); + + cbRRealname = new QCheckBox( i18n("Replace full name '%1' with the " + "'%{fullname}' macro").arg( sFullname ), page ); + cbRRealname->setEnabled( ! sFullname.isEmpty() ); + lo->addWidget( cbRRealname ); + + cbREmail = new QCheckBox( i18n("Replace email address '%1' with the " + "'%email' macro").arg( sEmail ), page); + cbREmail->setEnabled( ! sEmail.isEmpty() ); + lo->addWidget( cbREmail ); + + lo->addStretch(); + + addPage( page, i18n("Autoreplace Macros") ); + kdDebug()<<"=== Adding autoreplace page at "<setSpacing( KDialogBase::spacingHint() ); + + QString s = i18n("

The template will now be created and saved to the chosen " + "location. To position the cursor put a caret ('^') character where you " + "want it in files created from the template.

"); + + lo->addWidget( new QLabel( s, page ) ); + + cbOpenTemplate = new QCheckBox( i18n("Open the template for editing"), page ); + + lo->addWidget( cbOpenTemplate ); + + lo->addStretch(); + + addPage( page, i18n("Create Template") ); + kdDebug()<<"=== Adding summary page at "<setText( kft->templates().at( idx )->tmplate ); + selectedTemplateIdx = idx; + slotStateChanged(); +} + +/** + * When the state of any button in any setup page is changed, set the + * enabled state of the next button accordingly. + * + * Origin: + * if file is chosen, the URLRequester must have a valid URL in it + * if template is chosen, one must be selected in the menu button. + * + * Props: + * anything goes, but if the user wants to store the template in the template + * directory, she should be encouraged to fill in information. +*/ +void KateTemplateWizard::slotStateChanged() +{ + bool sane( true ); + switch ( indexOf( currentPage() ) ) + { + case 0: // origin + { + int _t = bgOrigin->selectedId(); + sane = ( _t == 1 || + ( _t == 2 && ! urOrigin->url().isEmpty() ) || + ( _t == 3 && ! btnTmpl->text().isEmpty() ) ); + setAppropriate( page(3), _t == 2 ); + } + break; + case 1: // template properties + // if origin is a existing template, let us try setting some of the properties + if ( bgOrigin->selectedId() == 3 ) + { + TemplateInfo *info = kft->templateInfo( selectedTemplateIdx ); + kti->cmbGroup->setCurrentText( info->group ); + } + break; + case 2: // location + { + // If there is a template name, and the user did not enter text into + // the template file name entry, we will construct the name from the + // template name. + int _t = bgLocation->selectedId(); + sane = ( ( _t == 1 && (! leTemplateFileName->text().isEmpty() || ! kti->leTemplate->text().isEmpty() ) ) || + ( _t == 2 && ! urLocation->url().isEmpty() ) ); + } + break; + case 4: // summary + setFinishEnabled( currentPage(), true ); + break; + default: + break; + } + nextButton()->setEnabled( sane ); +} + +/** + * This will create the new template based on the collected information. + */ +void KateTemplateWizard::accept() +{ + // TODO check that everything is kosher, so that we can get a save location + // etc. + + // check that we can combine a valid URL + KURL templateUrl; + if ( bgLocation->selectedId() == 1 ) + { + QString suggestion; + if ( ! leTemplateFileName->text().isEmpty() ) + suggestion = leTemplateFileName->text(); + else + suggestion = kti->leTemplate->text(); + + suggestion.replace(" ", ""); + + if ( ! suggestion.endsWith(".katetemplate") ) + suggestion.append(".katetemplate"); + + QString dir = KGlobal::dirs()->saveLocation( "data", "kate/plugins/katefiletemplates/templates/", true ); + + templateUrl = dir + suggestion; + + if ( QFile::exists( templateUrl.path() ) ) + { + if ( KMessageBox::warningContinueCancel( this, i18n( + "

The file
'%1'
already exists; if you " + "do not want to overwrite it, change the template file name to " + "something else.").arg( templateUrl.prettyURL() ), + i18n("File Exists"), i18n("Overwrite") ) + == KMessageBox::Cancel ) + return; + } + } + else + { + templateUrl = urLocation->url(); + } + + QWizard::accept(); + // The following must be done: + // 1) add the collected template information to the top + uint ln = 0; + QString s, str; + if ( ! kti->leTemplate->text().isEmpty() ) + s += " Template=" + kti->leTemplate->text(); + if ( ! kti->cmbGroup->currentText().isEmpty() ) + s += " Group=" + kti->cmbGroup->currentText(); + if ( ! kti->leDocumentName->text().isEmpty() ) + s += " Documentname=" + kti->leDocumentName->text(); + if ( ! kti->ibIcon->icon().isEmpty() ) + s += " Icon=" + kti->ibIcon->icon(); + if ( ! kti->btnHighlight->text().isEmpty() ) + s += " Highlight=" + kti->btnHighlight->text(); + + str = "katetemplate:" + s; + + if ( ! (s = kti->leAuthor->text()).isEmpty() ) + str += "\nkatetemplate: Author=" + s; + + if ( ! (s = kti->leDescription->text()).isEmpty() ) + str += "\nkatetemplate: Description=" + s; + + // 2) If a file or template is chosen, open that. and fill the data into a string + int toid = bgOrigin->selectedId(); // 1 = blank, 2 = file, 3 = template + kdDebug()<<"=== create template: origin type "< 1 ) + { + KURL u; + if ( toid == 2 ) // file + u = KURL( urOrigin->url() ); + else // template + u = KURL( kft->templates().at( selectedTemplateIdx )->filename ); + + QString tmpfile, tmp; + if ( KIO::NetAccess::download( u, tmpfile, 0L ) ) + { + QFile file(tmpfile); + if ( ! file.open( IO_ReadOnly ) ) + { + KMessageBox::sorry( this, i18n( + "Error opening the file
%1
for reading. " + "The document will not be created
").arg(u.prettyURL()), + i18n("Template Plugin"), 0 ); + + KIO::NetAccess::removeTempFile( tmpfile ); + return; + } + + QTextStream stream(&file); + QString ln; + bool trymore = true; + while ( !stream.eof() ) + { + // skip template headers + ln = stream.readLine(); + if ( trymore && ln.startsWith("katetemplate:") ) + continue; + + trymore = false; + tmp += "\n" + ln; + } + + file.close(); + KIO::NetAccess::removeTempFile( tmpfile ); + } + + if ( toid == 2 ) // file + { + // 3) if the file is not already a template, escape any "%" and "^" in it, + // and try do do some replacement of the authors username, name and email. + tmp.replace( QRegExp("%(?=\\{[^}]+\\})"), "\\%" ); + tmp.replace( QRegExp("\\$(?=\\{[^}]+\\})"), "\\$" ); + //tmp.replace( "^", "\\^" ); + + if ( cbRRealname->isChecked() && ! sFullname.isEmpty() ) + tmp.replace( sFullname, "%{realname}" ); + + + if ( cbREmail->isChecked() && ! sEmail.isEmpty() ) + tmp.replace( sEmail, "%{email}" ); + } + + str += tmp; + } + + // 4) Save the document to the suggested URL if possible + + bool succes = false; + + if ( templateUrl.isValid() ) + { + if ( templateUrl.isLocalFile() ) + { + QFile file( templateUrl.path() ); + if ( file.open(IO_WriteOnly) ) + { + kdDebug()<<"file opened with succes"<application()->activeMainWindow()->viewManager()->openURL( KURL() ); + Kate::View *view = kft->application()->activeMainWindow()->viewManager()->activeView(); + Kate::Document *doc = view->getDoc(); + doc->insertText( ln++, 0, str ); + } + else if ( cbOpenTemplate->isChecked() ) + kft->application()->activeMainWindow()->viewManager()->openURL( templateUrl ); +} +//END KateTemplateWizard + +//BEGIN KateTemplateItem +class KateTemplateItem : public KListViewItem +{ + public: + KateTemplateItem( KListViewItem *parent, TemplateInfo *templateinfo ) + : KListViewItem( parent, templateinfo->tmplate ), templateinfo( templateinfo ) + { + } + TemplateInfo *templateinfo; +}; +//END KateTemplateItem + +//BEGIN KFTNewStuff +class KFTNewStuff : public KNewStuff { + public: + KFTNewStuff( const QString &type, QWidget *parent=0 ) : KNewStuff( type, parent ), m_win( parent ) {} + ~KFTNewStuff() {} + bool install( const QString &/*filename*/ ) { return true; } + bool createUploadFile( const QString &/*filename*/ ) { return false; } + QString downloadDestination( KNS::Entry *entry ) + { + QString dir = KGlobal::dirs()->saveLocation( "data", "kate/plugins/katefiletemplates/templates/", true ); + return dir.append( entry->payload().filename() ); + } + + private: + QWidget *m_win; +}; +//END KTNewStuff + +//BEGIN KateTemplateManager +KateTemplateManager::KateTemplateManager( KateFileTemplates *kft, QWidget *parent, const char *name ) + : QWidget( parent, name ) + , kft( kft ) +{ + QGridLayout *lo = new QGridLayout( this, 2, 6 ); + lo->setSpacing( KDialogBase::spacingHint() ); + lvTemplates = new KListView( this ); + lvTemplates->addColumn( i18n("Template") ); + lo->addMultiCellWidget( lvTemplates, 1, 1, 1, 6 ); + connect( lvTemplates, SIGNAL(selectionChanged()), this, SLOT(slotUpdateState()) ); + + btnNew = new QPushButton( i18n("New..."), this ); + connect( btnNew, SIGNAL(clicked()), kft, SLOT(slotCreateTemplate()) ); + lo->addWidget( btnNew, 2, 2 ); + + btnEdit = new QPushButton( i18n("Edit..."), this ); + connect( btnEdit, SIGNAL(clicked()), this, SLOT( slotEditTemplate()) ); + lo->addWidget( btnEdit, 2, 3 ); + + btnRemove = new QPushButton( i18n("Remove"), this ); + connect( btnRemove, SIGNAL(clicked()), this, SLOT(slotRemoveTemplate()) ); + lo->addWidget( btnRemove, 2, 4 ); + + btnUpload = new QPushButton( i18n("Upload..."), this ); + connect( btnUpload, SIGNAL(clicked()), this, SLOT(slotUpload()) ); + lo->addWidget( btnUpload, 2, 5 ); + + btnDownload = new QPushButton( i18n("Download..."), this ); + connect( btnDownload, SIGNAL(clicked()), this, SLOT(slotDownload()) ); + lo->addWidget( btnDownload, 2, 6 ); + + lo->setColStretch( 1, 1 ); + + reload(); + slotUpdateState(); +} + +void KateTemplateManager::apply() +{ + // if any files were removed, delete them unless they are not writeable, in + // which case a link .filename should be put in the writable directory. +} + +void KateTemplateManager::reload() +{ + lvTemplates->clear(); + + QDict groupitems; // FIXME QMAP + for ( uint i = 0; i < kft->templates().count(); i++ ) + { + if ( ! groupitems[ kft->templates().at( i )->group ] ) + { + groupitems.insert( kft->templates().at( i )->group , new KListViewItem( lvTemplates, kft->templates().at( i )->group ) ); + groupitems[ kft->templates().at( i )->group ]->setOpen( true ); + } + new KateTemplateItem( groupitems[ kft->templates().at( i )->group ], kft->templates().at( i ) ); + } +} + +void KateTemplateManager::slotUpdateState() +{ + // enable/disable buttons wrt the current item in the list view. + // we are in single selection mode, so currentItem() is selected. + bool cool = false; + if ( dynamic_cast( lvTemplates->currentItem() ) ) + cool = true; + + btnEdit->setEnabled( cool ); + btnRemove->setEnabled( cool ); + btnUpload->setEnabled( cool ); +} + +void KateTemplateManager::slotEditTemplate() +{ + // open the template file in kate + // TODO show the properties dialog, and modify the file if the data was changed. + KateTemplateItem *item = dynamic_cast( lvTemplates->currentItem() ); + if ( item ) + kft->application()->activeMainWindow()->viewManager()->openURL( item->templateinfo->filename ); +} + +void KateTemplateManager::slotRemoveTemplate() +{ + KateTemplateItem *item = dynamic_cast( lvTemplates->currentItem() ); + if ( item ) + { + // Find all instances of filename, and try to delete them. + // If it fails (there was a global, unwritable instance), add to a + // list of removed templates + KConfig *config = kapp->config(); + QString fname = item->templateinfo->filename.section( '/', -1 ); + QStringList templates = KGlobal::dirs()->findAllResources( + "data", fname.prepend( "kate/plugins/katefiletemplates/templates/" ), + false,true); + int failed = 0; + int removed = 0; + for ( QStringList::Iterator it=templates.begin(); it!=templates.end(); ++it ) + { + if ( ! QFile::remove(*it) ) + failed++; + else + removed++; + } + + if ( failed ) + { + config->setGroup( "KateFileTemplates" ); + QStringList l; + config->readListEntry( "Hidden", l, ';' ); + l << fname; + config->writeEntry( "Hidden", l, ';' ); + } + + // If we removed any files, we should delete a KNewStuff key + // for this template, so the template is installable again. + // ### This assumes that the knewstuff name is similar to the template name. + kdDebug()<<"trying to remove knewstuff key '"<templateinfo->tmplate<<"'"<setGroup("KNewStuffStatus"); + config->deleteEntry( item->templateinfo->tmplate ); + + + kft->updateTemplateDirs(); + reload(); + } +} + +// KNewStuff upload +void KateTemplateManager::slotUpload() +{ + // TODO something nicer, like preparing the meta data from the template info. + KateTemplateItem *item = dynamic_cast( lvTemplates->currentItem() ); + if ( item ) + { + KFTNewStuff *ns = new KFTNewStuff( "katefiletemplates/template", this ); + ns->upload( item->templateinfo->filename, QString::null ); + } +} + +// KNewStuff download +void KateTemplateManager::slotDownload() +{ + KFTNewStuff *ns = new KFTNewStuff( "katefiletemplates/template", this ); + ns->download(); + + kft->updateTemplateDirs(); + reload(); +} + +//END KateTemplateManager + +// kate: space-indent on; indent-width 2; replace-tabs on; + +#include "filetemplates.moc" diff --git a/kate/filetemplates/plugin/filetemplates.h b/kate/filetemplates/plugin/filetemplates.h new file mode 100644 index 0000000..0eedc38 --- /dev/null +++ b/kate/filetemplates/plugin/filetemplates.h @@ -0,0 +1,258 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + --- + Copyright (C) 2004, Anders Lund + */ + +#ifndef _PLUGIN_KATE_FILETEMPLATES_H_ +#define _PLUGIN_KATE_FILETEMPLATES_H_ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +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; +}; + +/** + * This template system has the following features: + * It allows to create new documents that allready has some contents and a meaningfull + * document name. + * + * Any file can b e used as a template. + * + * Special template files can contain macros that are expanded when the document + * is created, and the cursor can be positioned in the new document. + * + * A menu is provided, allowing access to templates located in the KDE file system + * in the plugins data directory. The menu is dynamically updated. + * + * Simple tools are provided for creating/eidting templates. + * + * The main class has methods to do all of the work related to use file templates: + * @li Maintain the Template menu (File, New from Template) + * @li Load templates + * @li Provide simple tools for creating/editing templates +*/ +class KateFileTemplates : public Kate::Plugin, public Kate::PluginViewInterface +{ + Q_OBJECT + + public: + KateFileTemplates( QObject* parent = 0, const char* name = 0 ); + virtual ~KateFileTemplates(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + /** + * @return a list of unique group names in the template list. + */ + QStringList groups(); + + /** + * @return a pointer to the templateinfo collection + */ + QPtrList templates() { return m_templates; } + + /** + * @return a pointer to the templateInfo for the template at @p index + * in the template collection. + */ + class TemplateInfo *templateInfo( int index ) { return m_templates.at( index ); } + + /** + * @return a a pointer to the active main window + */ + QWidget * parentWindow(); + + public slots: + /** + * Update the template collection by rereading the template + * directories. Also updates the menu. + */ + void updateTemplateDirs(const QString &s=QString::null); + + private slots: + /** + * Show a file dialog, so that any file can be opened as a template. + * If the chosen file has the .katetemplate extension, it is parsed, + * otherwise it is just copied to the new document. + */ + void slotAny(); + + /** + * Open the template found at @p index in the colletion + */ + void slotOpenTemplate( int index ); + + /** + * Open the file at @p url as a template. If it has the .katetemplate + * extension it is parsed, otherwise its content is just copied to the new + * document. + */ + void slotOpenTemplate( const KURL &url ); + + void slotEditTemplate(); + + /** + * Show a KateTemplateWizard wizard. + */ + void slotCreateTemplate(); + + private: + void refreshMenu( class PluginView */*class QPopupMenu **/ ); + + QPtrList m_views; + class KActionCollection *m_actionCollection; + class KRecentFilesAction *m_acRecentTemplates; + QPtrList m_templates; + class KDirWatch *m_dw; + class KUser *m_user; + class KConfig *m_emailstuff; + class KActionMenu *m_menu; +}; + +class TemplateInfo; + +/** + * This widget provide a GUI for editing template properties. + */ +class KateTemplateInfoWidget : public QWidget +{ + Q_OBJECT + public: + KateTemplateInfoWidget( QWidget *parent=0, TemplateInfo *info=0, KateFileTemplates *kft=0 ); + ~KateTemplateInfoWidget() {} + + TemplateInfo *info; + + class QLineEdit *leTemplate, *leDocumentName, *leDescription, *leAuthor; + class QComboBox *cmbGroup; + class QPushButton *btnHighlight; + class KIconButton *ibIcon; + + private slots: + void slotHlSet( int id ); + + private: + KateFileTemplates *kft; +}; + +/** + * This wizard helps creating a new template, which is then opened for the user + * to edit. + * Basically, the user is offered to select an existing file or template to start + * from, set template properties, and if a file is loaded, some replacements is + * done in the text: + * @li % characters are protected (% -> %%) + * @li ^ characters are protected (with a backsplash) + * @li The users name, username and email is replaced by the corresponding macros + * If so chosen, the file is saved to either the template directory, or a location + * set by the user. +*/ +class KateTemplateWizard : public KWizard +{ + friend class KateFileTemplates; + Q_OBJECT + public: + KateTemplateWizard( QWidget* parent, KateFileTemplates *ktf ); + ~KateTemplateWizard() {} + + public slots: + void accept(); + + private slots: + void slotTmplateSet( int ); + void slotStateChanged(); + void slotStateChanged( int ) { slotStateChanged(); } + void slotStateChanged( const QString& ) { slotStateChanged(); } + + private: + KateFileTemplates *kft; + KateTemplateInfoWidget *kti; + + // origin page + class QButtonGroup *bgOrigin; + class KURLRequester *urOrigin; + class QPushButton *btnTmpl; + uint selectedTemplateIdx; + + // location page + class QButtonGroup *bgLocation; + class KURLRequester *urLocation; + class QLineEdit *leTemplateFileName; + + // macro replacement page + class QCheckBox *cbRRealname, *cbRUsername, *cbREmail; + QString sFullname, sEmail/*, sUsername*/; + + // final + class QCheckBox *cbOpenTemplate; +}; + +class KateTemplateManager : public QWidget +{ + Q_OBJECT + public: + KateTemplateManager( KateFileTemplates *kft=0, QWidget *parent=0, const char *name=0 ); + ~KateTemplateManager() {} + + public slots: + void apply(); + void reload(); + void reset() { reload(); } + + private slots: + void slotUpload(); + void slotDownload(); + void slotUpdateState(); + void slotEditTemplate(); + void slotRemoveTemplate(); + + private: + class KListView *lvTemplates; + class QPushButton *btnNew, *btnEdit, *btnRemove, *btnDownload, *btnUpload; + KateFileTemplates *kft; + QPtrList *remove; + +}; + +#endif // _PLUGIN_KATE_FILETEMPLATES_H_ +// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kate/filetemplates/plugin/katefiletemplates.desktop b/kate/filetemplates/plugin/katefiletemplates.desktop new file mode 100644 index 0000000..252adaa --- /dev/null +++ b/kate/filetemplates/plugin/katefiletemplates.desktop @@ -0,0 +1,113 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-Kate-Version=2.5 +X-KDE-Library=katefiletemplates +Name=Kate File Templates +Name[bs]=Kate predlošci datoteka +Name[ca]=Plantilles de fitxer Kate +Name[cs]=Souborové šablony Kate +Name[da]=Kate filskabeloner +Name[de]=Kate-Dateivorlagen +Name[el]=Αρχείο προτύπων του Kate +Name[eo]=Dosieraj ŝablonoj por Kodredaktilo +Name[es]=Plantillas de archivos de Kate +Name[et]=Kate failimallid +Name[eu]=Kateren txantiloi fitxategiak +Name[fa]=قالبهای پروندۀ Kate +Name[fi]=Kate tiedostomallit +Name[fr]=Fichier de modèle pour Kate +Name[fy]=Kate Triemsjabloanen +Name[ga]=Teimpléid Kate +Name[gl]=Modelos de Ficheiro para Kate +Name[he]= תבניות הטקסט של Kate +Name[hi]=के-एटीई फ़ाइल टैम्पलेट्स +Name[hr]=Predlošci datoteka za Kate +Name[hu]=Kate fájlsablonok +Name[is]=Kate skráasniðmát +Name[it]=File template di Kate +Name[ja]=Kate ファイルテンプレート +Name[ka]=Kate ფაილის შაბლონები +Name[kk]=Kate файл үлгілері +Name[km]=ពុម្ព​ឯកសារ Kate​ +Name[lt]=Kate bylų šablonai +Name[mk]=Шаблони на датотеки за Кате +Name[ms]=Templat Fail Kate +Name[nb]=Kate Filmaler +Name[nds]=Kate-Dateivörlagen +Name[ne]=केट फाइल टेम्प्लेटहरू +Name[nl]=Kate Bestandsjablonen +Name[nn]=Kate Filmalar +Name[pa]=ਕੇਟ ਫਾਇਲ ਨਮੂਨੇ +Name[pl]=Wzorce plików dla Kate +Name[pt]=Modelos de Ficheiro do Kate +Name[pt_BR]=Modelos de Arquivo do Kate +Name[ru]=Шаблоны Kate +Name[sk]=Šablóny súborov pre Kate +Name[sl]=Datotečne predloge za Kate +Name[sr]=Шаблони фајлова за Kate +Name[sr@Latn]=Šabloni fajlova za Kate +Name[sv]=Kate-filmallar +Name[ta]=கேட் உரை வார்ப்புரு +Name[tg]=Нусхаҳои Kate +Name[tr]=Kate Dosya Şablonları +Name[uk]=Шаблони файлів для Kate +Name[uz]=Kate fayl namunalari +Name[uz@cyrillic]=Kate файл намуналари +Name[vi]=Mẫu tập tin Kate +Name[zh_CN]=Kate 文件模板 +Name[zh_TW]=Kate 檔案樣本 +Comment=Create new files from templates in the Kate text editor +Comment[bg]=Създаване на нови файлове от шаблони +Comment[bs]=Napravi nove datoteke iz šablona u Kate editoru teksta +Comment[ca]=Crea fitxers nous des de les plantilles de l'editor de text Kate +Comment[cs]=Vytváří z šablon nové soubory v textovém editoru Kate +Comment[da]=Lav nye filer ud fra skabeloner i teksteditoren Kate +Comment[de]=Erstellt neue Dateien aus Vorlagen im Kate Texteditor +Comment[el]=Δημιουργία νέων αρχείων από πρότυπα στον επεξεργαστή κειμένου Kate +Comment[eo]=Kreas novajn dosierojn el ŝablonoj en Kodredaktilo +Comment[es]=Crea archivos nuevos a partir de plantillas en el editor de texto Kate +Comment[et]=Uute failide loomine mallide põhjal tekstiredaktoris Kate +Comment[eu]=Sortu fitxategi berriak txantiloietatik Kate testu editorean +Comment[fa]=ایجاد پرونده‌های جدید از قالبهای درون ویرایشگر متن +Comment[fi]=Luo uudet tiedostot Kate-tekstieditorin malleista +Comment[fr]=Création de nouveaux fichiers à partir de modèles dans l'éditeur de texte de Kate +Comment[fy]=Makket nije triemmen fanút sjabloanen binnen de Kate tekstferwurker +Comment[ga]=Cruthaigh comhaid nua ó theimpléid in eagarthóir téacs Kate +Comment[gl]=Criar novos ficheiros a partir de modelos no editor de textKate +Comment[hi]=टैम्पलेट्स के द्वारा केएटीई पाठ संपादक में नया फ़ाइल बनाएँ +Comment[hr]=Izrađuje nove datoteke iz predložaka unutar Kate uređivača +Comment[hu]=Új fájlok létrehozása sablon alapján a Kate szövegszerkesztőben +Comment[is]=Búa til nýjar skrár úr sniðmátum í kate ritlinum +Comment[it]=Crea nuovi file dai template nell'editor di testi di Kate +Comment[ja]=テンプレートから新しいファイルを作成します +Comment[ka]=ახალი ფაილების შექმნა Kate ტექსტური რედაქტორიდან +Comment[kk]=Kate мәтін редакторында үлгілер бойынша жаңа файлдарды құру +Comment[km]=បង្កើត​ឯកសារ​ថ្មី​ចេញ​ពី​ពុម្ព​នៅ​ក្នុង​កម្មវិធី​​និពន្ធ​​អត្ថបទ​របស់ Kate +Comment[lt]=Kurkite naujas bylas iš Kate teksto rengyklės šablonų +Comment[mk]=Креира нови датотеки од шаблони во уредувачот на текст Кате +Comment[ms]=Cipta fail bari dari templat dalam editor teks Kate +Comment[nb]=Lag nye filer fra maler i redigeringsprogrammet Kate +Comment[nds]=In Kate niege Dateien ut Vörlagen opstellen +Comment[ne]=केट पाठ सम्पादकमा टेम्प्लेटहरूबाट नयाँ फाइल सिर्जना गर्छ +Comment[nl]=Creëert nieuwe bestanden vanuit sjablonen binnen de Kate tekstverwerker +Comment[nn]=Lag nye filer frå malar i redigeringsprogrammet Kate +Comment[pl]=Tworzy nowe pliki ze wzorców w edytorze tekstów Kate +Comment[pt]=Criar novos ficheiro a partir de modelos no editor de texto Kate +Comment[pt_BR]=Cria arquivos através dos modelos no editor de textos Kate +Comment[ru]=Создание новых файлов из шаблонов в Kate +Comment[sk]=Vytváranie nových súborov zo štablón v textovom editore Kate +Comment[sl]=Ustvari nove datoteke iz predlog v urejevalniku besedil Kate +Comment[sr]=Прави нове фајлове према шаблону у уређивачу текста Kate +Comment[sr@Latn]=Pravi nove fajlove prema šablonu u uređivaču teksta Kate +Comment[sv]=Skapa nya filer från mallar i texteditorn Kate +Comment[ta]=புதிய கோப்பினை கேட் உரை தொகுப்பியின் வார்ப்புருவில் இருந்து உருவாக்கவும் +Comment[tg]=Эҷод кардани файлҳои нав аз нусхаҳо ба Kate +Comment[tr]=Kate metin düzenleyicide hazır şablonlardan dosya oluşturma +Comment[uk]=Створення нових файлів з шаблонів в текстовому редакторі Kate +Comment[uz]=Namunalardan Kate tahrirchida fayl yaratish +Comment[uz@cyrillic]=Намуналардан Kate таҳрирчида файл яратиш +Comment[vi]=Tạo tập tin mới từ mẫu trong trình soạn thảo văn bản Kate +Comment[zh_CN]=在 Kate 文本编辑器中根据模板创建新文件 +Comment[zh_TW]=在 Kate 文字編輯器中從樣本建立新檔案 +author=Anders Lund, anders@alweb.dk diff --git a/kate/filetemplates/plugin/katetemplate.xml b/kate/filetemplates/plugin/katetemplate.xml new file mode 100644 index 0000000..0748481 --- /dev/null +++ b/kate/filetemplates/plugin/katetemplate.xml @@ -0,0 +1,87 @@ + + + + + + + + + template + group + documentname + author + description + highlight + icon + + + realname + username + email + organisation + date + time + datetime + month + year + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kate/filetemplates/plugin/ui.rc b/kate/filetemplates/plugin/ui.rc new file mode 100644 index 0000000..cbf18c8 --- /dev/null +++ b/kate/filetemplates/plugin/ui.rc @@ -0,0 +1,15 @@ + + + +

&File + + + &Settings + + + + + Main Toolbar + + + diff --git a/kate/filetemplates/templates/Makefile.am b/kate/filetemplates/templates/Makefile.am new file mode 100644 index 0000000..54f91aa --- /dev/null +++ b/kate/filetemplates/templates/Makefile.am @@ -0,0 +1,5 @@ +templatesdir=$(kde_datadir)/kate/plugins/katefiletemplates/templates +templates_DATA=html.katetemplate \ + cpplgpl.cpp.katetemplate cpplgpl.hh.katetemplate \ + cppgpl.cpp.katetemplate cppgpl.hh.katetemplate \ + docbookchapter.xml.katetemplate language.xml.katetemplate \ No newline at end of file diff --git a/kate/filetemplates/templates/cppgpl.cpp.katetemplate b/kate/filetemplates/templates/cppgpl.cpp.katetemplate new file mode 100644 index 0000000..a479615 --- /dev/null +++ b/kate/filetemplates/templates/cppgpl.cpp.katetemplate @@ -0,0 +1,24 @@ +katetemplate: template=C++ Source File (GPL) group=Source Code documentname=New%N.cpp highlight=C++ +katetemplate: description=A very simple GPL C++ source file +katetemplate: author= Anders Lund +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + --- + Copyright (C) %{year}, %{fullname} <%{email}> + */ + +${cursor} \ No newline at end of file diff --git a/kate/filetemplates/templates/cppgpl.hh.katetemplate b/kate/filetemplates/templates/cppgpl.hh.katetemplate new file mode 100644 index 0000000..7e0bd02 --- /dev/null +++ b/kate/filetemplates/templates/cppgpl.hh.katetemplate @@ -0,0 +1,34 @@ +katetemplate: template=C++ Header (GPL) group=Source Code documentname=New%N.hh highlight=C++ +katetemplate: description=A very simple GPL C++ header file +katetemplate: author= Anders Lund +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + --- + Copyright (C) %{year}, %{fullname} <%{email}> + */ + +#ifndef _${ClassName}_h_ +#define _${ClassName}_h_ + +class ${ClassName} : public ${Super} { + public: + ${ClassName}( ${cursor} ); + ~${ClassName}(); + +} + +#endif // _${ClassName}_h_ diff --git a/kate/filetemplates/templates/cpplgpl.cpp.katetemplate b/kate/filetemplates/templates/cpplgpl.cpp.katetemplate new file mode 100644 index 0000000..2742ee9 --- /dev/null +++ b/kate/filetemplates/templates/cpplgpl.cpp.katetemplate @@ -0,0 +1,23 @@ +katetemplate: template=C++ Source File (LGPL) group=Source Code documentname=New%N.cpp highlight=C++ +katetemplate: description=A very simple LGPL C++ source file +katetemplate: author= Anders Lund +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + --- + Copyright (C) %{year}, %{realname} <%{email}> +*/ + +${cursor} diff --git a/kate/filetemplates/templates/cpplgpl.hh.katetemplate b/kate/filetemplates/templates/cpplgpl.hh.katetemplate new file mode 100644 index 0000000..301f34b --- /dev/null +++ b/kate/filetemplates/templates/cpplgpl.hh.katetemplate @@ -0,0 +1,32 @@ +katetemplate: template=C++ Header (LGPL) group=Source Code documentname=New%N.hh highlight=C++ +katetemplate: description=A very simple LGPL C++ header file +katetemplate: author= Anders Lund +/* + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. + + --- + Copyright (C) %{year}, %{fullname} <%{email}> +*/ +#ifndef _${ClassName}_h_ +#define _${ClassName}_h_ + +class ${ClassName} : public ${Super} { + public: + ${ClassName}( ${cursor} ); + ~${ClassName}(); + +} + +#endif // _${ClassName}_h_ diff --git a/kate/filetemplates/templates/docbookchapter.xml.katetemplate b/kate/filetemplates/templates/docbookchapter.xml.katetemplate new file mode 100644 index 0000000..581682c --- /dev/null +++ b/kate/filetemplates/templates/docbookchapter.xml.katetemplate @@ -0,0 +1,75 @@ +katetemplate: Template=Kate Plugin Docbook Chapter DocumentName=chapter%N.docbook +katetemplate: Group=Documentation highlight=XML +katetemplate: Description=This creates a suitable beginning of a docbook chapter for a Kate plugin. +katetemplate: Author= Anders Lund + + + +${title} + + + +%{firstname} +%{lastname} + +
%{email}
+
+
+
+%{date} + + + + + + + +KDE +kate + + + +
+ +Introduction + + + + +Menu Structure + + + + + +Tools +Validate XML + + + + + + + + + +Thanks and Acknowledgments + + +&kate; Plugin PROJECT copyright %{year} %{fullname} +%{email}. + + + +Documentation copyright %{year} %{fullname} + + + + + +&underGPL; + + +
+ + diff --git a/kate/filetemplates/templates/html.katetemplate b/kate/filetemplates/templates/html.katetemplate new file mode 100644 index 0000000..40718e3 --- /dev/null +++ b/kate/filetemplates/templates/html.katetemplate @@ -0,0 +1,18 @@ +katetemplate: template=HTML 4.01 Strict Document documentname=New%N.html +katetemplate: highlight=HTML group=Internet icon=www +katetemplate: description=This will create a very basic HTML file with the HTML 4.01 strict DTD. +katetemplate: author=Anders Lund +katetemplate: this text is supposedly thrown away. + + + + + ${title} + + + +

${title}

+ ${cursor} + + diff --git a/kate/filetemplates/templates/language.xml.katetemplate b/kate/filetemplates/templates/language.xml.katetemplate new file mode 100644 index 0000000..420ba84 --- /dev/null +++ b/kate/filetemplates/templates/language.xml.katetemplate @@ -0,0 +1,60 @@ +katetemplate: Documentname=New language.xml (%N) Template=Kate Highlight Definition highlight=XML +katetemplate: Author=Dominik Haumann +katetemplate: Description=This template will create the basics of a kate highlight definition file. + + + + + + + + + + + + + + + + + + + + + + + diff --git a/kate/helloworld/Makefile.am b/kate/helloworld/Makefile.am new file mode 100644 index 0000000..b3fca29 --- /dev/null +++ b/kate/helloworld/Makefile.am @@ -0,0 +1,18 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = katehelloworldplugin.la + +katehelloworldplugin_la_SOURCES = plugin_katehelloworld.cpp +katehelloworldplugin_la_LIBADD = -lkateinterfaces +katehelloworldplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +pluginsdir = $(kde_datadir)/kate/plugins/katehelloworld +plugins_DATA = ui.rc + +kde_services_DATA = katehelloworld.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katehelloworld.pot + diff --git a/kate/helloworld/katehelloworld.desktop b/kate/helloworld/katehelloworld.desktop new file mode 100644 index 0000000..e8d2bf7 --- /dev/null +++ b/kate/helloworld/katehelloworld.desktop @@ -0,0 +1,119 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katehelloworldplugin +X-Kate-Version=2.5 +Name=My First Kate Plugin +Name[br]=Ma lugent Kate kentañ +Name[ca]=El meu primer connector per a Kate +Name[cs]=Můj první modul pro Kate +Name[cy]=F'ategyn cyntaf Kate +Name[da]=Mit første Kate-plugin +Name[de]=Mein erstes Kate-Modul +Name[el]=Το πρώτο μου πρόσθετο για το Kate +Name[eo]=Mia unua kromaĵo por Kodredaktilo +Name[es]=Mi primer complemento de Kate +Name[et]=Kate näidisplugin +Name[eu]=Nire lehen Kate plugina +Name[fa]=اولین وصلۀ Kate من +Name[fi]=Minun ensimmäinen Kate-sovelma +Name[fr]=Mon premier module Kate +Name[fy]=Myn earste Kate-plugin +Name[ga]=Mo Chéad Bhreiseán Kate +Name[gl]=O Meu Primeiro plugin para Kate +Name[he]=התוסף הראשון שלי ל־Kate +Name[hr]=Moj prvi dodatak za Kate +Name[hu]=Az első Kate-bővítőmodulom +Name[is]=Fyrsta Kate viðbótin mín +Name[it]=Il mio primo plugin di Kate +Name[ja]=はじめての Kate プラグイン +Name[ka]=ჩემი პირველი Kate მოდული +Name[kk]=Менің алғашқы Kate плагин модулім +Name[km]=កម្មវិធី​ជំនួយ​របស់ Kate ដំបូង​របស់​ខ្ញុំ +Name[lt]=Mano pirmas Kate priedas +Name[mk]=Мојот прв приклучок за Кате +Name[ms]=Plugin Kate Pertama Saya +Name[nb]=Mitt første programtillegg til Kate +Name[nds]=Mien eerst Kate-Moduul +Name[ne]=मेरो पहिलो केट प्लगइन +Name[nl]=Mijn eerste Kate-plugin +Name[nn]=Mitt første programtillegg til Kate +Name[pa]=ਮੇਰੀ ਪਹਿਲੀ ਕੇਟ ਪਲੱਗਇਨ +Name[pl]=Moja pierwsza wtyczka do Kate +Name[pt]=O Meu Primeiro 'Plugin' para o Kate +Name[pt_BR]=Meu Primeiro Plugin para o Kate +Name[ru]=Простой модуль для Kate +Name[sk]=Môj prvý modul pre Kate +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[ta]=என் முதல் கேட் சொருகுப்பொருள் +Name[tr]=İlk Kate Eklentim +Name[uk]=Мій перший втулок до Kate +Name[vi]=Bổ sung Kate đầu tiên của tôi +Name[zh_CN]=我的第一个 Kate 插件 +Name[zh_TW]=我的第一個 Kate 的外掛程式 +Comment=Your short description about the plugin goes here +Comment[af]=Jou kort beskrywing aangaande die inplak gaan hier +Comment[ar]=اكتب وصف قصير عن هذا الملحق هنا +Comment[az]=Əlavə haqqında qisaca izahat burada yer almalıdır +Comment[bg]=Описание на вашата първа приставка за Kate +Comment[bs]=Ovdje treba biti vaše malo objašnjenje o dodatku +Comment[ca]=La vostra descripció referent al connector va aquí +Comment[cs]=Zde by měl být krátký popis modulu +Comment[cy]=Mae eich disgrifiad byr am yr ategyn yn mynd yma +Comment[da]=Her er plads til din korte beskrivelse af hvad dette plugin gør +Comment[de]=Hier sollte eine kurze Beschreibung Ihres Moduls stehen +Comment[el]=Η σύντομη περιγραφή του προσθέτου σας πηγαίνει εδώ +Comment[eo]=Jen estu la mallonga priskribo pri la kromaĵo +Comment[es]=Aquí deberá incluir una breve descripción de su complemento +Comment[et]=Näidisplugina lühikirjeldus +Comment[eu]=Hemen duzu pluginari buruzko deskribapen laburra +Comment[fa]=توصیف کوتاه شما دربارۀ وصله‌ای که در اینجا می‌آید +Comment[fi]=Tässä pitäisi olla pieni kuvaus sovelmasta +Comment[fo]=Her kann tú skriva ein lýsing av ístingurin. +Comment[fr]=La description brève de votre module se place ici +Comment[fy]=Set hjir in lytse omskriuwing fan jo plugin +Comment[ga]=Cuir do chur síos gearr ar an mbreiseán anseo +Comment[gl]=Aqui deberá colocar unha descrición do plugin +Comment[he]=כאן אמור להיות התיאור הקצר שלך אודות התוסף +Comment[hi]=प्लगइन के बारे में आपका संक्षिप्त वर्णन यहाँ जाएगा +Comment[hr]=Mjesto za kratak opis vašeg dodatka +Comment[hu]=Ez a bővítőmodul leírása +Comment[is]=Hér ætti að vera smá lýsing á viðbótinni +Comment[it]=Inserisci qui la descrizione del tuo plugin +Comment[ja]=プラグインの簡単な説明をここに書きます +Comment[ka]=მოდულის მოკლე აღწერა იქნება აქ +Comment[kk]=Бұл плагин модульдің қысқаша сипаттамасының орны +Comment[km]=សេចក្ដី​អធិប្បាយ​ដ៏​​​ខ្លី​របស់​អ្នក​អំពី​កម្មវិធី​ជំនួយ​ទៅ​ទីនេះ +Comment[lt]=Čia turėtų būti trumpas priedo aprašymas +Comment[mk]=Тука доаѓа вашиот краток опис за приклучокот +Comment[ms]=Huraian ringkas anda tentang plugin anda di sini +Comment[nb]=Her skriver du en kort beskrivelse av programtillegget +Comment[nds]=Dien korte Beschrieven vun Dien Moduul kummt hierhen +Comment[ne]=प्लगइनका बारेको तपाईँको छोटो वर्णन यहाँ जान्छ +Comment[nl]=Plaats hier een kleine omschrijving van uw plugin +Comment[nn]=Her skildrar du kort programtillegget +Comment[nso]=Thlaloso ya gago ye kopana kaga plugin e tsamaya mo +Comment[pl]=Tu powinien być Twój krótki opis wtyczki +Comment[pt]=Aqui deverá colocar uma descrição do 'plugin' +Comment[pt_BR]=Uma pequena descrição maior sobre o que um plugin faz +Comment[ro]=Aici trebuie să fie descrierea modulului dumneavoastră +Comment[ru]=А здесь должно быть описание модуля +Comment[sk]=Tu by mal byť popis o module +Comment[sl]=Vaš kratek opis o vstavku je tukaj +Comment[sr]=Ваш кратак опис прикључка иде овде +Comment[sr@Latn]=Vaš kratak opis priključka ide ovde +Comment[sv]=Kort beskrivning av vad insticksprogrammet gör +Comment[ta]= உங்கள் சொருகு பொருளைப் பற்றிய சிறு விவரிப்பு இங்கே போகும் +Comment[tg]=Дар инҷо бояд тасвири модул бошад +Comment[th]=นี่เป็นรายละเอียดสั้น ๆ เกี่ยวกับปลั๊กอินที่ควรมี +Comment[tr]=Eklentinizin küçük bir açıklamasını buraya yazın +Comment[uk]=Тут повинен бути ваш короткий опис втулку +Comment[uz]=Plagin haqida qisqacha maʼlumot +Comment[uz@cyrillic]=Плагин ҳақида қисқача маълумот +Comment[vi]=Mô tả ngắn về bổ sung nằm ở đây +Comment[xh]=Inkcazelo yakho emfutshane malunga ne plagi yangaphakathi ihamba apha +Comment[zh_CN]=这里应该提供插件的简短描述 +Comment[zh_TW]=您對於這個外掛程式的一些描述放在這裡 diff --git a/kate/helloworld/plugin_katehelloworld.cpp b/kate/helloworld/plugin_katehelloworld.cpp new file mode 100644 index 0000000..7499c08 --- /dev/null +++ b/kate/helloworld/plugin_katehelloworld.cpp @@ -0,0 +1,66 @@ + +#include "plugin_katehelloworld.h" +#include "plugin_katehelloworld.moc" + +#include +#include +#include + +K_EXPORT_COMPONENT_FACTORY( katehelloworldplugin, KGenericFactory( "katehelloworld" ) ) + +class PluginView : public KXMLGUIClient +{ + friend class KatePluginHelloWorld; + + public: + Kate::MainWindow *win; +}; + +KatePluginHelloWorld::KatePluginHelloWorld( QObject* parent, const char* name, const QStringList& ) + : Kate::Plugin ( (Kate::Application*)parent, name ) +{ +} + +KatePluginHelloWorld::~KatePluginHelloWorld() +{ +} + +void KatePluginHelloWorld::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_helloworld" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile("plugins/katehelloworld/ui.rc"); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void KatePluginHelloWorld::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 KatePluginHelloWorld::slotInsertHello() +{ + if (!application()->activeMainWindow()) + return; + + Kate::View *kv = application()->activeMainWindow()->viewManager()->activeView(); + + if (kv) + kv->insertText ("Hello World"); +} diff --git a/kate/helloworld/plugin_katehelloworld.h b/kate/helloworld/plugin_katehelloworld.h new file mode 100644 index 0000000..84b3e86 --- /dev/null +++ b/kate/helloworld/plugin_katehelloworld.h @@ -0,0 +1,30 @@ +#ifndef _PLUGIN_KATE_HELLOWORLD_H_ +#define _PLUGIN_KATE_HELLOWORLD_H_ + +#include +#include +#include +#include +#include +#include +#include + +class KatePluginHelloWorld : public Kate::Plugin, Kate::PluginViewInterface +{ + Q_OBJECT + + public: + KatePluginHelloWorld( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + virtual ~KatePluginHelloWorld(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + public slots: + void slotInsertHello(); + + private: + QPtrList m_views; +}; + +#endif diff --git a/kate/helloworld/ui.rc b/kate/helloworld/ui.rc new file mode 100644 index 0000000..36b11a0 --- /dev/null +++ b/kate/helloworld/ui.rc @@ -0,0 +1,8 @@ + + + + &Tools + + + + diff --git a/kate/htmltools/Makefile.am b/kate/htmltools/Makefile.am new file mode 100644 index 0000000..73795b7 --- /dev/null +++ b/kate/htmltools/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = katehtmltoolsplugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +katehtmltoolsplugin_la_SOURCES = plugin_katehtmltools.cpp +katehtmltoolsplugin_la_LIBADD = -lkateinterfaces +katehtmltoolsplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +pluginsdir = $(kde_datadir)/kate/plugins/katehtmltools +plugins_DATA = ui.rc + +kde_services_DATA = katehtmltools.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katehtmltools.pot diff --git a/kate/htmltools/katehtmltools.desktop b/kate/htmltools/katehtmltools.desktop new file mode 100644 index 0000000..ed9b1ec --- /dev/null +++ b/kate/htmltools/katehtmltools.desktop @@ -0,0 +1,136 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katehtmltoolsplugin +X-Kate-Version=2.5 +Name=Kate HTML Tools +Name[af]=Kate Html Nutsprogramme +Name[ar]=أدوات Kate HTML +Name[az]=Kate HTML Vasitələri +Name[br]=Ostilhoù Kate HTML +Name[bs]=Kate HTML alati +Name[ca]=Eines HTML per a Kate +Name[cs]=HTML nástroje Kate +Name[cy]=Offer HTML am Kate +Name[da]=Kate HTML-værktøjer +Name[de]=HTML-Dienstprogramme für Kate +Name[el]=Εργαλεία HTML του Kate +Name[eo]=HTML-iloj por Kodredaktilo +Name[es]=Herramientas HTML de Kate +Name[et]=Kate HTML-tööriistad +Name[eu]=Kateren HTML tresnak +Name[fa]=ابزارهای زنگام Kate +Name[fi]=Kate HTML-työkalut +Name[fo]=Kate HTML-amboð +Name[fr]=Outils HTML pour Kate +Name[fy]=Kate HTML Ark +Name[ga]=Uirlisí HTML Kate +Name[gl]=Ferramentas de HTML para Kate +Name[he]=כלי ה־HTML של Kate +Name[hi]=के-एटीई एचटीएमएल औज़ार +Name[hr]=Kate HTML alati +Name[hu]=Kate HTML-eszközök +Name[is]=Kate HTML tól +Name[it]=Strumenti HTML di Kate +Name[ja]=Kate HTML ツール +Name[ka]=Kate HTML ხელსაწყოები +Name[kk]=Kate HTML құралдары +Name[km]=ឧបករណ៍ Kate HTML +Name[lt]=Kate HTML įrankiai +Name[lv]=Kate HTML Rīki +Name[mk]=HTML-алатки за Кате +Name[ms]= Alat HTML Kate +Name[mt]=Għodda HTML Kate +Name[nb]=HTML-verktøy til Kate +Name[nds]=HTML-Warktüüch för Kate +Name[ne]=केट एचटीएमएल उपकरणहरू +Name[nn]=Kate HTML-verktøy +Name[nso]=Dibereka tsa HTML ya Kate +Name[pa]=ਕੇਟ HTML ਸੰਦ +Name[pl]=Narzędzia HTML do Kate +Name[pt]=Ferramentas de HTML do Kate +Name[pt_BR]=Ferramentas HTML do Kate +Name[ro]=Unelte HTML Kate +Name[ru]=Утилиты для работы с HTML в Kate +Name[sk]=HTML nástroje Kate +Name[sl]=Orodja za HTML Kate +Name[sr]=HTML алати за Kate +Name[sr@Latn]=HTML alati za Kate +Name[sv]=HTML-verktyg för Kate +Name[ta]=கேட் HTML கருவிகள் +Name[tg]=Асбобҳо барои кор бо HTML дар Kate +Name[th]=เครื่องมือ HTML ของ Kate +Name[tr]=Kate HTML Araçları +Name[uk]=Засоби HTML для Kate +Name[uz]=Kate HTML vositalari +Name[uz@cyrillic]=Kate HTML воситалари +Name[ven]=Kate HTML Zwishumiswa +Name[vi]=Công cụ HTML Kate +Name[xh]=Izixhobo ze Kate HTML +Name[zh_CN]=Kate HTML 工具 +Name[zh_TW]=Kate HTML 工具組 +Name[zu]=Amathuluzi e Kate HTML. +Comment=Facilitated insertion of HTML tags +Comment[af]=Bystand invoeg van Html etiket +Comment[ar]=ادخال أسهل لعلامات HTML +Comment[az]=HTML təqlərinin səliqəli əlavəsi +Comment[bg]=Помощ при вмъкване на тагове и елементи HTML +Comment[bs]=Primjenjeno ubacivanje HTML tagova +Comment[ca]=Fàcil inserció d'etiquetes HTML +Comment[cs]=Usnadněné vkládání HTML značek +Comment[cy]=Hwyluso mewnosod tagiau HTML +Comment[da]=Hjælper med indsætning af HTML-koder +Comment[de]=Vereinfachte Eingabe von HTML-Formatierungen +Comment[el]=Διευκόλυνση της εισαγωγής HTML tags +Comment[eo]=Asistita enmeto de HTML-etikedoj +Comment[es]=Facilita la inserción de etiquetas HTML +Comment[et]=Hõlpus HTML-siltide lisamine +Comment[eu]=HTML etiketen txertaketa erraza +Comment[fa]=درج آسان برچسبهای زنگام +Comment[fi]=Helpotettu HTML-tagien lisäys +Comment[fo]=Gevur møguleiki fyri at innseta HTML-merki. +Comment[fr]=Aide à l'insertion de balises HTML +Comment[fy]=Maklike ynfoeging fan HTML-tags +Comment[ga]=Ionsá éascaithe de chlibeanna HTML +Comment[gl]=Introdución facilitada de marcas de HTML +Comment[he]=הוספה מובנית של תגיות HTML +Comment[hi]=एचटीएमएल टैग्स शामिल करने में मदद करता है +Comment[hr]=Olakšano umetanje HTML oznaka +Comment[hu]=HTML-tag-ek beszúrása +Comment[is]=Hjálpar til við að setja HTML merki i texta +Comment[it]=Inserimento facilitato dei tag HTML +Comment[ja]=HTML タグ挿入を簡単にします +Comment[ka]=HTML ჭდეების გამიზნული ჩადგმა +Comment[kk]=HTML тегтерін енгізуін жеңілдету +Comment[km]=ការ​បញ្ចូល​ដែល​បាន​​​សម្រួល​របស់​​ស្លាក HTML +Comment[lt]=Palengvintas HTML tagų įdėjimas +Comment[lv]=Atvieglota HTML tagu iespraušana +Comment[mk]=Го олеснува вметнувањето на HTML-ознаки +Comment[ms]=Memudahkan penyertaan tag HTML +Comment[mt]=Jiffaċilita l-użu ta' tags HTML +Comment[nb]=Forenklet innsetting av HTML-tagger +Comment[nds]=HTML-Betekers eenfacher infögen +Comment[ne]=एचटीएमएल ट्यागहरूको घुसाई सहजता +Comment[nl]=Gemakkelijke invoeging van HTML-tags +Comment[nn]=Enkel innsetjing av HTML-taggar +Comment[pl]=Uproszczone wstawianie znaczników HTML +Comment[pt]=Introdução facilitada de marcas de HTML +Comment[pt_BR]=Inserção de tags HTML facilitada +Comment[ro]=Facilitează inserarea de taguri HTML +Comment[ru]=Интеллектуальная вставка тегов HTML +Comment[sk]=Vkladanie tagov HTML +Comment[sl]=Pospešeno vstavljanje oznak HTML +Comment[sr]=Олакшано убацивање HTML ознака +Comment[sr@Latn]=Olakšano ubacivanje HTML oznaka +Comment[sv]=Kraftfull infogning av HTML-taggar +Comment[ta]=HTML கட்டளைகளை இணைக்க உதவும் +Comment[tg]=Барқарори маънавии тегҳои HTML +Comment[th]=การแทรกแท็ก HTML ที่แสนสะดวก +Comment[tr]=Kolaylaştırılmış HTML etiketleri eklenmesi +Comment[uk]=Форматування тексту мітками HTML +Comment[ven]=U dzhenisiwa zwo itwaho zwa dzi thege dza HTML +Comment[vi]=Làm dễ dàng việc chèn thẻ HTML +Comment[xh]=Ufakelo olulula lwe tags ze HTML +Comment[zh_CN]=方便地插入 HTML 标签 +Comment[zh_TW]=輔助嵌入 HTML 標籤 +Comment[zu]=Kuqhubekisiwe Ukufakwa kwamathagi e HTML diff --git a/kate/htmltools/plugin_katehtmltools.cpp b/kate/htmltools/plugin_katehtmltools.cpp new file mode 100644 index 0000000..f0764f2 --- /dev/null +++ b/kate/htmltools/plugin_katehtmltools.cpp @@ -0,0 +1,161 @@ +/*************************************************************************** + plugin_katehtmltools.cpp - description + ------------------- + begin : FRE Feb 23 2001 + copyright : (C) 2001 by Joseph Wenninger + email : jowenn@bigfoot.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "plugin_katehtmltools.h" +#include "plugin_katehtmltools.moc" + +#include +#include +#include +#include +#include +#include +#include + +K_EXPORT_COMPONENT_FACTORY( katehtmltoolsplugin, KGenericFactory( "katehtmltools" ) ) + +class PluginView : public KXMLGUIClient +{ + friend class PluginKateHtmlTools; + + public: + Kate::MainWindow *win; +}; + +PluginKateHtmlTools::PluginKateHtmlTools( QObject* parent, const char* name, const QStringList& ) + : Kate::Plugin ( (Kate::Application *)parent, name ) +{ +} + +PluginKateHtmlTools::~PluginKateHtmlTools() +{ +} + +void PluginKateHtmlTools::addView(Kate::MainWindow *win) +{ + // TODO: doesn't this have to be deleted? + PluginView *view = new PluginView (); + + (void) new KAction ( i18n("HT&ML Tag..."), /*"edit_HTML_tag",*/ ALT + Key_Minus, this, + SLOT( slotEditHTMLtag() ), view->actionCollection(), "edit_HTML_tag" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile( "plugins/katehtmltools/ui.rc" ); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void PluginKateHtmlTools::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 PluginKateHtmlTools::slotEditHTMLtag() +// PCP +{ + if (!application()->activeMainWindow()) + return; + + Kate::View *kv=application()->activeMainWindow()->viewManager()->activeView(); + if (!kv) return; + + QString text ( KatePrompt ( i18n("HTML Tag"), + i18n("Enter HTML tag contents (the <, >, and closing tag will be supplied):"), + (QWidget *)kv) + ); + + if ( !text.isEmpty () ) + slipInHTMLtag (*kv, text); // user entered something and pressed ok + +} + + +QString PluginKateHtmlTools::KatePrompt + ( + const QString & strTitle, + const QString & strPrompt, + QWidget * that + ) +{ + // TODO: Make this a "memory edit" field with a combo box + // containing prior entries + + KLineEditDlg dlg(strPrompt, QString::null, that); + dlg.setCaption(strTitle); + + if (dlg.exec()) + return dlg.text(); + else + return ""; +} + + +void PluginKateHtmlTools::slipInHTMLtag (Kate::View & view, QString text) // PCP +{ + + // We must add a heavy elaborate HTML markup system. Not! + + QStringList list = QStringList::split (' ', text); + QString marked = view.getDoc()->selection (); + uint preDeleteLine = 0, preDeleteCol = 0; + view.cursorPosition (&preDeleteLine, &preDeleteCol); + + if (marked.length() > 0) + view.keyDelete (); + uint line = 0, col = 0; + view.cursorPosition (&line, &col); + QString pre ("<" + text + ">"); + QString post; + if (list.count () > 0) post = ""; + view.insertText (pre + marked + post); + + // all this muck to leave the cursor exactly where the user + // put it... + + // Someday we will can all this (unless if it already + // is canned and I didn't find it...) + + // The second part of the if disrespects the display bugs + // when we try to reselect. TODO: fix those bugs, and we can + // un-break this if... + + if (preDeleteLine == line && -1 == marked.find ('\n')) + if (preDeleteLine == line && preDeleteCol == col) + { + view.setCursorPosition (line, col + pre.length () + marked.length () - 1); + + for (int x (marked.length()); x--;) + view.shiftCursorLeft (); + } + else + { + view.setCursorPosition (line, col += pre.length ()); + + for (int x (marked.length()); x--;) + view.shiftCursorRight (); + } + +} diff --git a/kate/htmltools/plugin_katehtmltools.h b/kate/htmltools/plugin_katehtmltools.h new file mode 100644 index 0000000..8f134ce --- /dev/null +++ b/kate/htmltools/plugin_katehtmltools.h @@ -0,0 +1,53 @@ + /*************************************************************************** + plugin_katehtmltools.h - description + ------------------- + begin : FRE Feb 23 2001 + copyright : (C) 2001 by Joseph Wenninger + email : jowenn@bigfoot.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _PLUGIN_KANT_HTMLTOOLS_H +#define _PLUGIN_KANT_HTMLTOOLS_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +class PluginKateHtmlTools : public Kate::Plugin, Kate::PluginViewInterface +{ + Q_OBJECT + +public: + PluginKateHtmlTools( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + virtual ~PluginKateHtmlTools(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + +private: + QPtrList m_views; + + QString KatePrompt (const QString & strTitle, const QString &strPrompt, + QWidget * that); + void slipInHTMLtag (Kate::View & view, QString text); + +public slots: + void slotEditHTMLtag(); +}; + +#endif // _PLUGIN_KANT_HTMLTOOLS_H diff --git a/kate/htmltools/ui.rc b/kate/htmltools/ui.rc new file mode 100644 index 0000000..885f00e --- /dev/null +++ b/kate/htmltools/ui.rc @@ -0,0 +1,8 @@ + + + + &Tools + + + + diff --git a/kate/insertcommand/Makefile.am b/kate/insertcommand/Makefile.am new file mode 100644 index 0000000..22fd871 --- /dev/null +++ b/kate/insertcommand/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = kateinsertcommandplugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +kateinsertcommandplugin_la_SOURCES = plugin_kateinsertcommand.cpp +kateinsertcommandplugin_la_LIBADD = -lkateinterfaces +kateinsertcommandplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +pluginsdir = $(kde_datadir)/kate/plugins/kateinsertcommand +plugins_DATA = ui.rc + +kde_services_DATA = kateinsertcommand.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/kateinsertcommand.pot diff --git a/kate/insertcommand/kateinsertcommand.desktop b/kate/insertcommand/kateinsertcommand.desktop new file mode 100644 index 0000000..cfd0197 --- /dev/null +++ b/kate/insertcommand/kateinsertcommand.desktop @@ -0,0 +1,119 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=kateinsertcommandplugin +X-Kate-Version=2.5 +Name=Kate InsertCommand +Name[af]=Kate Invoeg-opdrag +Name[ca]=Inserció de comandaments per a Kate +Name[cy]=MewnosodGorchymyn Kate +Name[da]=Kate Indsætningskommando +Name[de]=Befehlsausgabe einfügen für Kate +Name[el]=Εισαγωγή εντολών του Kate +Name[eo]=Komandenmeto de Kodredaktilo +Name[es]=Insertar orden en Kate +Name[et]=Kate käsu-lisaja +Name[eu]=Kateren InsertCommand +Name[fi]=Kate lisäyskomento +Name[fo]=Kate innsetingarstýriboð +Name[fr]=Insertion de commande dans Kate +Name[gl]=Inserción de Comandos para Kate +Name[he]=הוספת פקודות ל־Kate +Name[hi]=के-एटीई इंसर्ट-कमांड +Name[hr]=Kate UmetniNaredbu +Name[hu]=Kate parancsbeszúró +Name[it]=InserisciComando di Kate +Name[ja]=Kate コマンド挿入 +Name[ka]=Kate ბრძანების ჩამატება +Name[kk]=Kate-те команда шығарлымын енгізу +Name[km]=ពាក្យ​បញ្ជា​បញ្ចូល​របស់​ Kate +Name[lt]=Kate įdėti komandą +Name[lv]=Kate IespraustKomandu +Name[mk]=ВметниКоманда за Кате +Name[ms]=Kate MasukkanArahan +Name[nds]=Kate-Befehlinfögen +Name[ne]=केट घुसाउने आदेश +Name[pa]=ਕੇਟ ਕਮਾਂਡ ਸ਼ਾਮਲ +Name[pl]=Polecenie wstawiania do Kate +Name[pt]=Inserção de Comandos do Kate +Name[pt_BR]=Inserir Comando do Kate +Name[ro]=Inserare comandă Kate +Name[ru]=Вставка вывода команды в Kate +Name[sr]=„Убацивање наредбе“ за Kate +Name[sr@Latn]=„Ubacivanje naredbe“ za Kate +Name[sv]=Kate - Infoga kommando +Name[ta]=கேட் சொருகு கட்டளை +Name[th]=คำสั่งแทรกของ Kate +Name[tr]=Kate KomutEkle +Name[uk]=Команда вставлення Kate +Name[ven]=Muthetho wo dzheniswaho wa Kate +Name[vi]=Chèn lệnh Kate +Name[xh]=IKate IfakaUmyalelo +Name[zh_CN]=Kate 插入命令 +Name[zh_TW]=Kate 插入命令 +Name[zu]=Faka Inkomba ka Kate +Comment=Insert shell command output into a document +Comment[af]=Voeg by tolk opdrag uitset binnein 'n dokument +Comment[ar]=أدخل مخرجات أمر من سطر الأوامر الى مستندك +Comment[az]=Qabıq əmrə yekununu sənədə daxil et +Comment[bg]=Вмъкване на резултата от изпълнението на дадена команда в документа +Comment[bs]=Dodaj izlaz shell komande u dokument +Comment[ca]=Insereix la sortida d'un comandament de l'intèrpret de comandaments en un document +Comment[cs]=Vloží výstup příkazu shellu do dokumentu +Comment[cy]=Mewnosod allbwn o orchymyn plisgyn i mewn i ddogfen +Comment[da]=Indsæt uddata fra skalkommando i et dokument +Comment[de]=Ausgabe eines Befehlszeilenprogramms einfügen +Comment[el]=Εισαγωγή εξόδου κάποιας εντολής σε ένα έγγραφο +Comment[eo]=Enmetas la eligon de ŝelprogramo en dokumenton +Comment[es]=Inserta la salida del intérprete de órdenes en un documento +Comment[et]=Shelli käsu väljundi lisamine dokumenti +Comment[eu]=Txertatu Shell komandoaren irteera dokumentu batean +Comment[fa]=درج خروجی فرمان پوستۀ درون یک سند +Comment[fi]=Lisää komentotulkin tuloste asiakirjaan +Comment[fo]=Innset úttak frá eitt stýriboð/forrit í eitt skjal. +Comment[fr]=Insertion de la sortie d'une commande shell dans un document +Comment[fy]=Set útfier fan shellkommando yn in dokumint +Comment[ga]=Ionsáigh aschur ó ordú blaoisce isteach i gcáipéis +Comment[gl]=Inserir o resultado da execución dun comando nun documento +Comment[he]=הוספת פלט של פקודות מעטפת לתוך מסמך +Comment[hi]=एक दस्तावेज़ में शेल कमांड आउटपुट प्रविष्ट करता है +Comment[hr]=Umetanje ispisa iz naredbene ljuske u dokument +Comment[hu]=Parancs kimenetének beillesztése +Comment[is]=Setja úttak skeljarskipunar inn í skjal +Comment[it]=Inserisce l'output di un comando della shell in un documento +Comment[ja]=文書にシェルコマンドの出力を挿入します +Comment[ka]=გარსის ბრძანების გამოტანის დოკუმენტში ჩამატება +Comment[kk]=Қоршау-орта командасының шығысын құжатқа енгізу +Comment[km]=បញ្ចូល​លទ្ធផល​ពាក្យ​បញ្ជា​របស់​សែល​​ទៅ​ក្នុង​ឯកសារ​មួយ +Comment[lt]=Įdėti apvalkalo komandos išvestį į dokumentą +Comment[lv]=Iesprauž čaulas komandas izvadi dokumentā +Comment[mk]=Вметнува излез од команда од школката во документ +Comment[ms]=Memasukkan output arahan cengkerang kepada dokumen +Comment[mt]=Daħħal ir-riżultat ta' kmand tax-shell fid-dokument +Comment[nb]=Sett inn utfallet fra en skall-kommando i et dokument +Comment[nds]=Konsoolbefehl-Utgaav na en Dokment infögen +Comment[ne]=कागजातमा शेला आदेश निर्गत घुसाउनुहोस् +Comment[nl]=Voeg uitvoer van shellcommando in een document +Comment[nn]=Set inn resultatet av ein skalkommando i dokumentet +Comment[pa]=ਇੱਕ ਦਸਤਾਵੇਜ਼ ਵਿੱਚ ਇੱਕ ਸ਼ੈਲ ਕਮਾਂਡ ਆਉਟਪੁੱਟ ਦਿਓ +Comment[pl]=Wstaw wynik wykonania polecenia powłoki +Comment[pt]=Inserir o resultado da execução de um comando num documento +Comment[pt_BR]=Inserir comando de saída do shell dentro do documento +Comment[ro]=Inserează în document rezultatul comenzii de interpretor +Comment[ru]=Вставить вывод команды в документ +Comment[sk]=Vloží výstup príkazu shellu do dokumentu +Comment[sl]=Vstavi izhod lupinskega ukaza v dokument +Comment[sr]=Убаците излаз наредбе шкољке у документ +Comment[sr@Latn]=Ubacite izlaz naredbe školjke u dokument +Comment[sv]=Infoga utmatning från skalkommando till ett dokument +Comment[ta]=ஓட்டுக் கட்டளை வெளியீட்டை ஆவணத்தில் செருக உதவும் +Comment[tg]=Барқарор кардани баромади фармони лифофа дар санад +Comment[th]=แทรกผลส่งออกของคำสั่งเชลล์ไปยังเอกสาร +Comment[tr]=Kabuk komut çıktısını bir belgeye ekle +Comment[uk]=Вставити вивід команди оболонки в документ +Comment[ven]=Dzhenisani muthetho wa shele wa nnda u tshi ya kha dokhwumennte +Comment[vi]=Chèn kết xuất lệnh trình bao vào tài liệu +Comment[xh]=Faka iqokobhe lomyalelo wemveliso phakathi kuxwebhu +Comment[zh_CN]=将 Shell 命令的输出插入到文档中 +Comment[zh_TW]=在文件內嵌入 shell 命令輸出 +Comment[zu]=Faka igobodo lenkomba kwisiqephu diff --git a/kate/insertcommand/plugin_kateinsertcommand.cpp b/kate/insertcommand/plugin_kateinsertcommand.cpp new file mode 100644 index 0000000..eadbc02 --- /dev/null +++ b/kate/insertcommand/plugin_kateinsertcommand.cpp @@ -0,0 +1,417 @@ + /*************************************************************************** + plugin_kateinsertcommand.cpp - description + ------------------- + begin : THU Apr 19 2001 + copyright : (C) 2001 by Anders Lund + email : anders@alweb.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. * + * * + ***************************************************************************/ +//BEGIN includes +#include "plugin_kateinsertcommand.h" +#include "plugin_kateinsertcommand.moc" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//END includes + +K_EXPORT_COMPONENT_FACTORY( kateinsertcommandplugin, KGenericFactory( "kateinsertcommand" ) ) + +//BEGIN obligatory stuff +class PluginView : public KXMLGUIClient +{ + friend class PluginKateInsertCommand; + + public: + Kate::MainWindow *win; +}; +//END + +//BEGIN PluginKateInsertCommand +PluginKateInsertCommand::PluginKateInsertCommand( QObject* parent, const char* name, const QStringList& ) + : Kate::Plugin ( (Kate::Application *)parent, name ), + kv ( 0 ), + sh ( 0 ) +{ + config = new KConfig("kateinsertcommandpluginrc"); + cmdhist = config->readListEntry("Command History"); + wdlg = 0; + workingdir = QDir::currentDirPath(); +} + +PluginKateInsertCommand::~PluginKateInsertCommand() +{ + // write config file + config->writeEntry("Command History", cmdhist); + config->writeEntry("Dialog Settings", dialogSettings); + config->sync(); + delete config; + delete sh; +} + +void PluginKateInsertCommand::addView(Kate::MainWindow *win) +{ + // TODO: doesn't this have to be deleted? + PluginView *view = new PluginView (); + + (void) new KAction ( i18n("Insert Command..."), "", 0, this, + SLOT( slotInsertCommand() ), view->actionCollection(), + "edit_insert_command" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile("plugins/kateinsertcommand/ui.rc"); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void PluginKateInsertCommand::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 PluginKateInsertCommand::slotInsertCommand() +{ + if (!kapp->authorize("shell_access")) { + KMessageBox::sorry(0,i18n("You are not allowed to execute arbitrary external applications. If you want to be able to do this, contact your system administrator."),i18n("Access Restrictions")); + return; + } + if ( sh && sh->isRunning() ) { + KMessageBox::sorry (0, i18n("A process is currently being executed."), + i18n("Error")); + return; + } + + if (!application()->activeMainWindow() || !application()->activeMainWindow()->viewManager()->activeView()) + return; + + kv = application()->activeMainWindow()->viewManager()->activeView(); + + QString dir = workingdir; + QString docdir; + KURL docurl = kv->getDoc()->url(); + if (docurl.isLocalFile()) + docdir = docurl.directory(); + QString lwd( config->readPathEntry("Last WD") ); + switch ( (int)config->readNumEntry("Start In", 0) ) + { + case 1: + if ( ! docdir.isEmpty() ) dir = docdir; + break; + case 2: + if ( ! lwd.isEmpty() ) dir = lwd; + break; + default: + break; + } + dialogSettings = config->readNumEntry("Dialog Settings", 0); + CmdPrompt *d = new CmdPrompt((QWidget*)kv, 0, cmdhist, dir, + docdir, dialogSettings); + if ( d->exec() && ! d->command().isEmpty() ) { + if ( ! sh ) { + sh = new KShellProcess; + + connect ( sh, SIGNAL(receivedStdout(KProcess*, char*, int)), + this, SLOT(slotReceivedStdout(KProcess*, char*, int)) ); + connect ( sh, SIGNAL(receivedStderr(KProcess*, char*, int)), + this, SLOT(slotReceivedStderr(KProcess*, char*, int)) ); + connect ( sh, SIGNAL(processExited(KProcess*)), + this, SLOT(slotProcessExited(KProcess*)) ) ; + } + + sh->clearArguments(); + + bInsStdErr = d->insertStdErr(); + + if ( d->printCmd() ) { + if ( ! d->wd().isEmpty() ) + kv->insertText( d->wd() + ": "); + kv->insertText( d->command()+":\n" ); + } + if ( ! d->wd().isEmpty() ) { + *sh << "cd" << d->wd() << "&&"; + config->writePathEntry("Last WD", d->wd()); + } + *sh << QFile::encodeName(d->command()); + sh->start( KProcess::NotifyOnExit, KProcess::All ); + + // add command to history + if ( cmdhist.contains( d->command() ) ) { + cmdhist.remove( d->command() ); + } + cmdhist.prepend( d->command() ); + int cmdhistlen = config->readNumEntry("Command History Length", 20); + while ( (int)cmdhist.count() > cmdhistlen ) + cmdhist.remove( cmdhist.last() ); + // save dialog state + dialogSettings = 0; + if ( d->insertStdErr() ) + dialogSettings += 1; + if ( d->printCmd() ) + dialogSettings += 2; + + cmd = d->command(); + delete d; + // If process is still running, display a dialog to cancel... + slotShowWaitDlg(); + + config->writeEntry("Dialog Settings", dialogSettings); + config->sync(); + } +} + +void PluginKateInsertCommand::slotAbort() +{ + if ( sh->isRunning() ) + if (! sh->kill() ) + KMessageBox::sorry(0, i18n("Could not kill command."), i18n("Kill Failed")); +} + +void PluginKateInsertCommand::slotShowWaitDlg() +{ + if ( sh->isRunning() ) { + wdlg = new WaitDlg( (QWidget*)kv, i18n( + "Executing command:\n%1\n\nPress 'Cancel' to abort.").arg(cmd) ); + connect(wdlg, SIGNAL(cancelClicked()), this, SLOT(slotAbort()) ); + } + if ( sh->isRunning() ) // we may have finished while creating the dialog. + wdlg->show(); + else if (wdlg) { // process may have exited before the WaitDlg constructor returned. + delete wdlg; + wdlg = 0; + } +} + +void PluginKateInsertCommand::slotReceivedStdout( KProcess* /*p*/, char* text, + int len ) +{ + QString t = QString::fromLocal8Bit ( text ); + t.truncate(len); + kv->insertText( t ); +} + +void PluginKateInsertCommand::slotReceivedStderr( KProcess* p, char* text, + int len ) +{ + if ( bInsStdErr ) + slotReceivedStdout( p, text, len ); +} + +void PluginKateInsertCommand::slotProcessExited( KProcess* p ) +{ + if (wdlg) { + wdlg->hide(); + delete wdlg; + wdlg = 0; + } + if ( ! p->normalExit() ) + KMessageBox::sorry(0, i18n("Command exited with status %1"). + arg( p->exitStatus()), i18n("Oops!")); + kv->setFocus(); +} +//END PluginKateInsertCommand + +//BEGIN PluginConfigPage +Kate::PluginConfigPage* PluginKateInsertCommand::configPage (uint, + QWidget *w, const char */*name*/) +{ + InsertCommandConfigPage* p = new InsertCommandConfigPage(this, w); + initConfigPage( p ); + connect( p, SIGNAL(configPageApplyRequest(InsertCommandConfigPage*)), + this, SLOT(applyConfig(InsertCommandConfigPage*)) ); + return (Kate::PluginConfigPage*)p; +} + +void PluginKateInsertCommand::initConfigPage( InsertCommandConfigPage *p ) +{ + p->sb_cmdhistlen->setValue( config->readNumEntry("Command History Length", 20) ); + p->rg_startin->setButton( config->readNumEntry("Start In", 0) ); +} + +void PluginKateInsertCommand::applyConfig( InsertCommandConfigPage *p ) +{ + config->writeEntry( "Command History Length", p->sb_cmdhistlen->value() ); + // truncate the cmd hist if nessecary? + config->writeEntry( "Start In", p->rg_startin->id(p->rg_startin->selected()) ); + config->sync(); +} +//END PluginConfigPage + +//BEGIN CmdPrompt +// This is a simple dialog to retrieve a command and decide if +// stdErr should be included in the text inserted. +CmdPrompt::CmdPrompt(QWidget* parent, + const char* name, + const QStringList& cmdhist, + const QString& dir, + const QString& /*docdir*/, + int settings) + : KDialogBase (parent, name, true, i18n("Insert Command"), Ok|Cancel, Ok, true) +{ + QWidget *page = new QWidget( this ); + setMainWidget(page); + + QVBoxLayout *lo = new QVBoxLayout( page, 0, spacingHint() ); + + QLabel *l = new QLabel( i18n("Enter &command:"), page ); + lo->addWidget( l ); + cmb_cmd = new KHistoryCombo(true, page); + cmb_cmd->setHistoryItems(cmdhist, true); + cmb_cmd->setCurrentItem(0); + cmb_cmd->lineEdit()->setSelection(0, cmb_cmd->currentText().length()); + l->setBuddy(cmb_cmd); + cmb_cmd->setFocus(); + lo->addWidget(cmb_cmd); + connect( cmb_cmd->lineEdit(),SIGNAL(textChanged ( const QString & )), + this, SLOT( slotTextChanged(const QString &))); + + QLabel *lwd = new QLabel( i18n("Choose &working folder:"), page ); + lo->addWidget( lwd ); + wdreq = new KURLRequester( page ); + if ( ! dir.isEmpty() ) + wdreq->setURL( dir ); + wdreq->setMode( static_cast(KFile::Directory|KFile::LocalOnly|KFile::ExistingOnly) ); + lwd->setBuddy( wdreq ); + lo->addWidget( wdreq ); + + //kdDebug()<<"settings: "<setChecked(settings & 1); + lo->addWidget( cb_insStdErr ); + cb_printCmd = new QCheckBox( i18n("&Print command name"), page ); + cb_printCmd->setChecked(settings & 2); + lo->addWidget( cb_printCmd ); + + QWhatsThis::add( cmb_cmd, i18n( + "Enter the shell command, the output of which you want inserted into your " + "document. Feel free to use a pipe or two if you wish.") ); + QWhatsThis::add( wdreq, i18n( + "Sets the working folder of the command. The command executed is 'cd " + "&& '") ); + QWhatsThis::add( cb_insStdErr, i18n( + "Check this if you want the error output from inserted as well.\n" + "Some commands, such as locate, print everything to STDERR") ); + QWhatsThis::add( cb_printCmd, i18n( + "If you check this, the command string will be printed followed by a " + "newline before the output.") ); + slotTextChanged(cmb_cmd->lineEdit()->text()); +} + +CmdPrompt::~CmdPrompt() {} + +void CmdPrompt::slotTextChanged(const QString &text) +{ + enableButtonOK( !text.isEmpty()); +} +//END CmdPrompt + +//BEGIN WaitDlg implementation +// This is a dialog that is displayed while a command is running, +// with a cancel button to allow the user to kill the command +WaitDlg::WaitDlg(QWidget* parent, const QString& text, const QString& title) + : KDialogBase( parent, "wait dialog", true, title, Cancel, Cancel, true ) +{ + QWidget *page = new QWidget( this ); + setMainWidget( page ); + QHBoxLayout *lo = new QHBoxLayout( page, 0, spacingHint() ); + + KAnimWidget *aw = new KAnimWidget( QString::fromLatin1("kde"), 48, page ); + lo->addWidget(aw); + QLabel *l = new QLabel( text, page ); + lo->addWidget( l ); + + aw->start(); +} +WaitDlg::~WaitDlg() +{ +} +//END WaitDlg + +//BEGIN InsertCommandConfigPage +// This is the config page for this plugin. +InsertCommandConfigPage::InsertCommandConfigPage(QObject* /*parent*/, + QWidget *parentWidget) + : Kate::PluginConfigPage( parentWidget ) +{ + QVBoxLayout* lo = new QVBoxLayout( this ); + lo->setSpacing(KDialogBase::spacingHint()); + + // command history length + QHBox *hb1 = new QHBox( this ); + hb1->setSpacing(KDialogBase::spacingHint()); + (void) new QLabel( i18n("Remember"), hb1 ); + sb_cmdhistlen = new QSpinBox( hb1 ); + QLabel *l1 = new QLabel( sb_cmdhistlen, i18n("Co&mmands"), hb1); + hb1->setStretchFactor(l1, 1); + lo->addWidget( hb1 ); + + // dir history length + + // initial dir choice + rg_startin = new QButtonGroup( 1, Qt::Horizontal, i18n("Start In"), this ); + rg_startin->setRadioButtonExclusive( true ); + (void) new QRadioButton( i18n("Application &working folder"), rg_startin); + (void) new QRadioButton( i18n("&Document folder"), rg_startin); + (void) new QRadioButton( i18n("&Latest used working folder"), rg_startin); + lo->addWidget( rg_startin ); + // other? + + lo->addStretch(1); // look nice + + // Be helpfull! + QWhatsThis::add( sb_cmdhistlen, i18n( + "Sets the number of commands to remember. The command history is saved " + "over sessions.") ); + QWhatsThis::add( rg_startin, i18n( + "

Decides what is suggested as working folder for the " + "command.

Application Working Folder (default): " + "The folder from which you launched the application hosting the plugin, " + "usually your home folder.

Document Folder: The " + "folder of the document. Used only for local documents.

" + "Latest Working Folder: The folder used last time you used this " + "plugin.

") ); +} + +void InsertCommandConfigPage::apply() +{ + emit configPageApplyRequest( this ); +} +//END InsertCommandConfigPage +// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kate/insertcommand/plugin_kateinsertcommand.h b/kate/insertcommand/plugin_kateinsertcommand.h new file mode 100644 index 0000000..c948b38 --- /dev/null +++ b/kate/insertcommand/plugin_kateinsertcommand.h @@ -0,0 +1,170 @@ + /*************************************************************************** + plugin_kateinsertcommand.h - description + ------------------- + begin : THU Apr 19 2001 + copyright : (C) 2001 by Anders Lund + email : anders@alweb.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 _PLUGIN_KATE_INSERT_COMMAND_H_ +#define _PLUGIN_KATE_INSERT_COMMAND_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + + +class InsertCommandConfigPage; +namespace Kate { + class PluginConfigPage; + class PluginView; +} +class KConfig; +class KProcess; +class KShellProcess; +class QButtonGroup; +class QCheckBox; +class QSpinBox; +class QStringList; +class WaitDlg; + +class PluginKateInsertCommand : public Kate::Plugin, + Kate::PluginViewInterface, + Kate::PluginConfigInterfaceExtension +{ + Q_OBJECT + + public: + PluginKateInsertCommand( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + virtual ~PluginKateInsertCommand(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + Kate::View *kv; + + WaitDlg *wdlg; + QPtrList m_views; + + uint configPages () const { return 1; } + Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0); + QString configPageName(uint) const { return i18n("Insert Command"); } + QString configPageFullName(uint) const { + return i18n("Configure Insert Command Plugin"); } + QPixmap configPagePixmap (uint /*number = 0*/, + int /*size = KIcon::SizeSmall*/) const + { return 0L; } + + private: + void initConfigPage( InsertCommandConfigPage* ); + + KShellProcess *sh; + QString workingdir; + QString cmd; + QStringList cmdhist; + bool bInsStdErr; + int dialogSettings; + KConfig *config; + + public slots: + void slotInsertCommand(); + void slotAbort(); + void applyConfig( InsertCommandConfigPage* ); + + private slots: + void slotReceivedStdout(KProcess*, char*, int); + void slotReceivedStderr(KProcess*, char*, int); + void slotProcessExited(KProcess*); + void slotShowWaitDlg(); +}; + +class CmdPrompt : public KDialogBase +{ +Q_OBJECT +public: + CmdPrompt(QWidget* parent=0, + const char* name=0, + const QStringList& cmdhist=QStringList(), + const QString& dir=QString::null, + const QString& docdir=QString::null, + int settings=0); + ~CmdPrompt(); + QString command()const { return cmb_cmd->currentText(); } + bool insertStdErr()const { return cb_insStdErr->isChecked(); } + bool printCmd()const { return cb_printCmd->isChecked(); } + QString wd()const { return wdreq->url(); } +private slots: + void slotTextChanged(const QString &text); + + + private: + KHistoryCombo *cmb_cmd; + KURLRequester *wdreq; + QCheckBox *cb_insStdErr; + QCheckBox *cb_printCmd; + +}; + +class WaitDlg : public KDialogBase +{ + public: + WaitDlg(QWidget* parent, + const QString& text=QString::null, + const QString& title=i18n("Please Wait")); + ~WaitDlg(); +}; + +/** Config page for the plugin. */ +class InsertCommandConfigPage : public Kate::PluginConfigPage +{ + Q_OBJECT + friend class PluginKateInsertCommand; + + public: + InsertCommandConfigPage(QObject* parent = 0L, QWidget *parentWidget = 0L); + ~InsertCommandConfigPage() {} + + /** Reimplemented from Kate::PluginConfigPage + * just emits configPageApplyRequest( this ). + */ + void apply(); + + void reset () { ; } + void defaults () { ; } + + signals: + /** Ask the plugin to set initial values */ + void configPageApplyRequest( InsertCommandConfigPage* ); + /** Ask the plugin to apply changes */ + void configPageInitRequest( InsertCommandConfigPage* ); + + protected: + QSpinBox *sb_cmdhistlen; + //QCheckBox *cb_startindocdir; + QButtonGroup *rg_startin; +}; + +#endif // _PLUGIN_KATE_INSERT_COMMAND_H_ +// kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kate/insertcommand/ui.rc b/kate/insertcommand/ui.rc new file mode 100644 index 0000000..49fb61b --- /dev/null +++ b/kate/insertcommand/ui.rc @@ -0,0 +1,8 @@ + + + + &Tools + + + + diff --git a/kate/kjswrapper/Makefile.am b/kate/kjswrapper/Makefile.am new file mode 100644 index 0000000..51258f7 --- /dev/null +++ b/kate/kjswrapper/Makefile.am @@ -0,0 +1,16 @@ +SUBDIRS= . samples +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = katekjswrapperplugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +katekjswrapperplugin_la_SOURCES = plugin_katekjswrapper.cpp bindings.cpp +katekjswrapperplugin_la_LIBADD = -lkateinterfaces -lkjsembed -lkjs +katekjswrapperplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katekjswrapper.pot + diff --git a/kate/kjswrapper/bindings.cpp b/kate/kjswrapper/bindings.cpp new file mode 100644 index 0000000..fcb8d38 --- /dev/null +++ b/kate/kjswrapper/bindings.cpp @@ -0,0 +1,466 @@ +#include "bindings.h" +#include "bindings.moc" +#include "plugin_katekjswrapper.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +using namespace Kate::JS; +Bindings::Bindings(QObject *parent): KJSEmbed::Bindings::JSBindingPlugin(parent,"KateAppBindings",QStringList()) { +} + +Bindings::~Bindings() { +} + +KJS::Object Bindings::createBinding(KJSEmbed::KJSEmbedPart *jspart, KJS::ExecState *exec, const KJS::List &args) const { +/* + kdDebug() << "Loading a custom object" << endl; + DocumentManager *obj = new DocumentManager(); + JSOpaqueProxy *prx = new JSOpaqueProxy( (void *) obj, "Kate::JS::DocumentManager" ); + + KJS::Object proxyObj(prx); + DocumentManagerImp::addBindings( exec, proxyObj ); + return proxyObj; +*/ + return KJS::Object(); +} + + +void Bindings::addBindings(KJS::ExecState *exec, KJS::Object &target) const { + kdDebug()<<"Kate::JS::Bindings:: ADDING CUSTOM BINDINGS"<(proxy->object()); + if (dm) { + DocumentManager::addBindings(exec,proxy,target); + } else { + Kate::Application *app=dynamic_cast(proxy->object()); + if (app) { + Application::addBindings(exec,proxy,target); + } else { + Kate::MainWindow *win=dynamic_cast(proxy->object()); + if (win) { + MainWindow::addBindings(exec,proxy,target); + } + } + } + General::addBindings(exec,proxy,target); +} + +void DocumentManager::addBindings(KJS::ExecState *exec, KJSEmbed::JSObjectProxy *proxy,KJS::Object &object){ + RefCountedObjectDict *dict=new RefCountedObjectDict(100); + object.put(exec, "document", KJS::Object(new DocumentManager( exec, Document, proxy,dict ))); + object.put(exec, "activeDocument", KJS::Object(new DocumentManager( exec, ActiveDocument, proxy,dict ))); + object.put(exec, "documentForID", KJS::Object(new DocumentManager( exec, DocumentWithID, proxy,dict ))); + object.put(exec, "documentForURL", KJS::Object(new DocumentManager( exec, FindDocument, proxy,dict ))); + object.put(exec, "openURL", KJS::Object(new DocumentManager( exec, OpenURL, proxy,dict ))); + object.put(exec, "isOpen", KJS::Object(new DocumentManager( exec, IsOpen, proxy,dict ))); + object.put(exec, "documentCount", KJS::Object(new DocumentManager( exec, Documents, proxy,dict ))); + object.put(exec, "closeDocument", KJS::Object(new DocumentManager( exec, CloseDocument, proxy,dict ))); + object.put(exec, "closeAllDocument", KJS::Object(new DocumentManager( exec, CloseAllDocuments, proxy,dict ))); +} + +DocumentManager::DocumentManager( KJS::ExecState *exec, int id, KJSEmbed::JSObjectProxy *parent, RefCountedObjectDict *dict ):KJSEmbed::JSProxyImp(exec) { + m_dict=dict; + m_dict->incRef(); + m_id=id; + m_proxy=parent; +} + +DocumentManager::~DocumentManager() { + m_dict->decRef(); +} + +KJS::Value DocumentManager::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) { + QObject *o=m_proxy->object(); + Kate::DocumentManager *dm=dynamic_cast(o); + if (!dm) { + kdWarning()<<"Object died"<setException( err ); + return KJS::Undefined(); + } + QString mdesc; + switch (m_id) { + case Document: { + mdesc="document(int)"; + if (args.size()!=1) break; + uint index=args[0].toUInt32(exec); + if (exec->hadException()) break; + QObject *doc=dynamic_cast(dm->document(index)); + if (!doc) return KJS::Null(); + return m_dict->jsObject(exec,doc,m_proxy); } + break; + case ActiveDocument: { + mdesc="activeDocument()"; + if (args.size()!=0) break; + QObject *doc=dynamic_cast(dm->activeDocument()); + if (!doc) return KJS::Null(); + return m_dict->jsObject(exec,doc,m_proxy); } + break; + case DocumentWithID: { + mdesc="documentForID(int)"; + if (args.size()!=1) break; + uint id=args[0].toUInt32(exec); + if (exec->hadException()) break; + QObject *doc=dynamic_cast(dm->documentWithID(id)); + if (!doc) return KJS::Null(); + return m_dict->jsObject(exec,doc,m_proxy); } + break; + case FindDocument: { + mdesc="documentForURL(KURL)"; + if (args.size()!=1) break; + KURL url = QString( args[0].toString(exec).qstring() ); + if (exec->hadException()) break; + return KJS::Number(dm->findDocument(url)); } + break; + case IsOpen: { + mdesc="isOpen(KURL)"; + if (args.size()!=0) break; + KURL url = QString( args[0].toString(exec).qstring() ); + if (exec->hadException()) break; + return KJS::Boolean(dm->isOpen(url));} + + break; + case OpenURL: { + mdesc="openURL(KURL[,String encoding])"; + uint docID; + if (args.size()==1) { + KURL url = QString( args[0].toString(exec).qstring() ); + if (exec->hadException()) break; + (void)dm->openURL(url,QString::null,&docID); + return KJS::Number(docID); + } else if (args.size()==2) { + KURL url = QString( args[0].toString(exec).qstring() ); + if (exec->hadException()) break; + QString encoding=QString( args[1].toString(exec).qstring() ); + (void)dm->openURL(url,encoding,&docID); + return KJS::Number(docID); + } + } + break; + case Documents: { + mdesc="documentCount()"; + if (args.size()!=0) break; + return KJS::Number(dm->documents()); } + break; + case CloseDocument: { + mdesc="closeDocument(Kate::Document)"; + if (args.size()!=1) break; + KJSEmbed::JSObjectProxy *proxy = KJSEmbed::JSProxy::toObjectProxy( args[0].imp() ); + if (!proxy) break; + QObject *tmp=proxy->object(); + Kate::Document *tmpdoc=dynamic_cast(tmp); + if (!tmpdoc) break; + return KJS::Boolean(dm->closeDocument(tmpdoc)); } + break; + case CloseAllDocuments: { + mdesc="closeAllDocuments()"; + if (args.size()!=0) break; + return KJS::Boolean(dm->closeAllDocuments()); } + break; + default: + kdDebug()<<"calling illegal method of DocumentManager"<setException( err ); + return KJS::Undefined(); + +} + +Kate::JS::Management::Management(KJS::ExecState *exec, int id, PluginKateKJSWrapper *kateplug):KJSEmbed::JSProxyImp(exec) { + m_id=id; + m_wrapper=kateplug; +} + + +KJS::Value Kate::JS::Management::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) { + if (m_id==AddConfigPage) { + if (args.size()!=1) { + QString msg = i18n("One parameter expected"); + KJS::Object err = KJS::Error::create( exec, KJS::GeneralError, msg.utf8() ); + exec->setException( err ); + return KJS::Undefined(); + } + KJS::Value v=args[0]; +// m_wrapper->m_configPageFactories.append(v); +#warning implement me + } else if (m_id==SetConfigPages) { + if (args.size()>1) { + QString msg=i18n("One or no parameter expected"); + KJS::Object err = KJS::Error::create( exec, KJS::GeneralError, msg.utf8() ); + exec->setException( err ); + return KJS::Undefined(); + } + m_wrapper->m_configPageFactories=(args.size()>0)?args[0]:KJS::Value(); + } else if (m_id==SetWindowConfiguration) { + if (args.size()>3) { + QString msg = i18n("A maximum of three parameters expected"); + KJS::Object err = KJS::Error::create( exec, KJS::GeneralError, msg.utf8() ); + exec->setException( err ); + return KJS::Undefined(); + } + kdDebug()<<"***********************************************************************************"<m_toolViewConstructors=(args.size()>0)?args[0]:KJS::Value(); + kdDebug()<<"Kate::JS::Management::call: Object type for m_toolViewConstructors (2):"<m_toolViewConstructors.type()<m_newWindowHandler=(args.size()>1)?args[1]:KJS::Value(); + m_wrapper->m_removeWindowHandler=(args.size()>2)?args[2]:KJS::Value(); + } else if (m_id==KJSConsole) { + m_wrapper->m_part->view()->show(); + } else + kdDebug()<<"Remove not implemented yet"<(proxy->part()->parent()); + KJS::Object ToolView(new Application( exec, ToolView, proxy ,wrap)); + ToolView.put(exec,KJS::Identifier("Left"),KJS::Number(KDockWidget::DockLeft) ,KJS::ReadOnly | KJS::DontDelete); + ToolView.put(exec,KJS::Identifier("Top"),KJS::Number(KDockWidget::DockTop) ,KJS::ReadOnly | KJS::DontDelete); + ToolView.put(exec,KJS::Identifier("Right"),KJS::Number(KDockWidget::DockRight) ,KJS::ReadOnly | KJS::DontDelete); + ToolView.put(exec,KJS::Identifier("Bottom"),KJS::Number(KDockWidget::DockBottom), KJS::ReadOnly | KJS::DontDelete); + General::addBindings(exec,proxy,ToolView); + object.put(exec, "ToolView",ToolView); + + object.put(exec, KJS::Identifier("DocumentManager"),proxy->part()->bind(::Kate::documentManager()),KJS::ReadOnly | KJS::DontDelete); + + object.put(exec, "windowCount", KJS::Object(new Application( exec, WindowCount, proxy,wrap))); + object.put(exec, "activeWindow", KJS::Object(new Application( exec, ActiveWindow, proxy,wrap))); + object.put(exec, "window", KJS::Object(new Application( exec, Window, proxy,wrap ))); + +// object.put(exec, "ProjectManager",proxy->part()->bind(::Kate::projectManager()); + +/* obbject.put(exec, KJS::Identifier("WindowManager"),proxy->part + KJS::Object*/ +/* + Kate::PluginManager *pluginManager (); + + Kate::InitPluginManager *initPluginManager (); + + Kate::MainWindow *activeMainWindow ();*/ + + // uint mainWindows (); + // Kate::MainWindow *mainWindow (uint n = 0); + +} + +Kate::JS::Application::Application( KJS::ExecState *exec, int id, KJSEmbed::JSObjectProxy *parent,PluginKateKJSWrapper *plugin):KJSEmbed::JSProxyImp(exec) { + kdDebug()<<"Kate::JS::Application::Application"<object(); + Kate::Application *ka=dynamic_cast(o); + if (!ka) { + kdWarning()<<"Object died"<setException( err ); + return KJS::Undefined(); + } + QString mdesc; + switch (m_id) { + case WindowCount: { + mdesc="windowCount()"; + if (args.size()!=0) break; + return KJS::Number(ka->mainWindows()); } + break; + case Window: { + mdesc="window(int)"; + if (args.size()!=1) break; + uint index=args[0].toUInt32(exec); + if (exec->hadException()) break; + Kate::MainWindow *mw=ka->mainWindow(index); + if (!mw) return KJS::Null(); + return m_plugin->getViewObject(mw)->winObj; + } + break; + case ActiveWindow: { + mdesc="activeWindow()"; + if (args.size()!=0) break; + Kate::MainWindow *mw=ka->activeMainWindow(); + if (!mw) return KJS::Null(); + return m_plugin->getViewObject(mw)->winObj; + } + break; + + + } + QString msg = i18n("Method %1 called with wrong signature").arg(mdesc); + KJS::Object err = KJS::Error::create( exec, KJS::GeneralError, msg.utf8() ); + exec->setException( err ); + return KJS::Undefined(); + +} + + + + + + +void Kate::JS::General::addBindings(KJS::ExecState *exec, KJSEmbed::JSObjectProxy *proxy,KJS::Object &object){ +#warning "try to find a way to make the function implementations static, right now this doesn't work because of the need to retrieve the interpreter" + KJS::Object methods= KJS::Object(new General( exec,proxy->interpreter(),MethodMethods)); + KJS::Object fields= KJS::Object(new General( exec,proxy->interpreter(),MethodFields)); + object.put(exec, "methods", methods); + object.put(exec, "fields", fields); +} + +Kate::JS::General::General( KJS::ExecState *exec, KJS::Interpreter *interpreter, int id):KJSEmbed::JSProxyImp(exec) { + m_id=id; + m_interpreter=interpreter; +} + + +KJS::Value Kate::JS::General::call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ) { + switch (m_id) { + case MethodMethods: + return methodz(exec,self,args); + case MethodFields: + return fieldz(exec,self,args); + default: + return KJS::Null(); + } +} + + + + +KJS::Value Kate::JS::General::methodz(KJS::ExecState *exec, KJS::Object &obj, const KJS::List &) +{ + KJS::List items; + + KJS::ReferenceList list=obj.propList(exec, /*bool recursive*/ false); + for (KJS::ReferenceListIterator it=list.begin();it!=list.end();it++) { + if (it->getValue(exec).toObject(exec).implementsCall()) items.append(KJS::String(it->getPropertyName(exec).qstring())); + } + return KJS::Object(m_interpreter->builtinArray().construct(exec,items) ); +} + +KJS::Value Kate::JS::General::fieldz(KJS::ExecState *exec, KJS::Object &obj, const KJS::List &) +{ + KJS::List items; + + KJS::ReferenceList list=obj.propList(exec, /*bool recursive*/ false); + for (KJS::ReferenceListIterator it=list.begin();it!=list.end();it++) { + if (!(it->getValue(exec).toObject(exec).implementsCall())) items.append(KJS::String(it->getPropertyName(exec).qstring())); + } + return KJS::Object(m_interpreter->builtinArray().construct(exec,items) ); +} + + +Kate::JS::RefCountedObjectDict::RefCountedObjectDict(int size): QObject(), QPtrDict(size) { + m_usageCount=0; + setAutoDelete(true); +} + +void Kate::JS::RefCountedObjectDict::incRef() { + m_usageCount++; +} + +void Kate::JS::RefCountedObjectDict::decRef() { + kdDebug()<<"Kate::JS:RefCountedObjectDict::decCount()"<obj=proxy->part()->factory()->createProxy(exec,obj,proxy); + connect(obj,SIGNAL(destroyed()),this,SLOT(removeSender())); + insert(obj,oe); + return oe->obj; + } else return oe->obj; + +} + +void Kate::JS::RefCountedObjectDict::removeSender() { + kdDebug()<<"Trying to remove object from dict"<(proxy->object()); + if (!mw) return; + kdDebug()<<"Kate::JS::MainWindow::addBindings - 3"<(proxy->part()->parent()); + if (!wrap) return; + kdDebug()<<"Kate::JS::MainWindow::addBindings - 4"<object(); + Kate::MainWindow *mw=dynamic_cast(o); + if (!mw) { + kdWarning()<<"Object died"<setException( err ); + return KJS::Undefined(); + } + QString mdesc; + switch (m_id) { + case ActionCollection: { + mdesc="actionCollection()"; + if (args.size()!=0) break; + return m_plugin->getViewObject(mw)->actionCollectionObj; + } + break; + default: + return KJS::Undefined(); + } + QString msg = i18n("Method %1 called with wrong signature").arg(mdesc); + KJS::Object err = KJS::Error::create( exec, KJS::GeneralError, msg.utf8() ); + exec->setException( err ); + return KJS::Undefined(); +} + diff --git a/kate/kjswrapper/bindings.h b/kate/kjswrapper/bindings.h new file mode 100644 index 0000000..2e98ee8 --- /dev/null +++ b/kate/kjswrapper/bindings.h @@ -0,0 +1,150 @@ +#ifndef _KATE_JS_BINDINGS_H_ +#define _KATE_JS_BINDINGS_H_ + +#include +#include +#include +#include +#include + +class PluginKateKJSWrapper; + +namespace Kate { + namespace JS { + + + struct ObjectEntry { + KJS::Object obj; + }; + + class RefCountedObjectDict: public QObject, public QPtrDict { + Q_OBJECT + public: + RefCountedObjectDict(int size); + void incRef(); + void decRef(); + KJS::Object jsObject(KJS::ExecState *exec, QObject *obj, KJSEmbed::JSObjectProxy *proxy); + public slots: + void removeSender(); + private: + int m_usageCount; + }; + + + class Bindings: public KJSEmbed::Bindings::JSBindingPlugin { + public: + Bindings(QObject *parent); + virtual ~Bindings(); + KJS::Object createBinding(KJSEmbed::KJSEmbedPart *jspart, KJS::ExecState *exec, const KJS::List &args) const; + void addBindings(KJS::ExecState *exec, KJS::Object &target) const; + }; + + class DocumentManager: public KJSEmbed::JSProxyImp { + public: + enum MethodID { + Document, + ActiveDocument, + DocumentWithID, + FindDocument, + IsOpen, + OpenURL, + Documents, + CloseDocument, + CloseAllDocuments + }; + virtual bool implementsCall() const { return true; } + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + static void addBindings(KJS::ExecState *exec, KJSEmbed::JSObjectProxy *proxy,KJS::Object &target); + private: + DocumentManager( KJS::ExecState *exec, int id, KJSEmbed::JSObjectProxy *parent, RefCountedObjectDict *dict ); + virtual ~DocumentManager(); + private: + RefCountedObjectDict *m_dict; + int m_id; + KJSEmbed::JSObjectProxy *m_proxy; + + }; + + class Management: public KJSEmbed::JSProxyImp { + public: + enum MethodID { + AddConfigPage, + SetConfigPages, + RemoveConfigPage, + SetWindowConfiguration, + KJSConsole + }; + Management( KJS::ExecState *exec, int id, class PluginKateKJSWrapper *kateplug); + virtual bool implementsCall() const { return true; } + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + + private: + int m_id; + class PluginKateKJSWrapper *m_wrapper; + + }; + + class Application: public KJSEmbed::JSProxyImp { + public: + enum MethodID { + ToolView, + WindowCount, + Window, + ActiveWindow, + + }; + virtual bool implementsCall() const { return true; } + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + static void addBindings(KJS::ExecState *exec, KJSEmbed::JSObjectProxy *proxy,KJS::Object &target); + private: + Application( KJS::ExecState *exec, int id, KJSEmbed::JSObjectProxy *parent, PluginKateKJSWrapper *plugin ); + ~Application(); + private: + int m_id; + KJSEmbed::JSObjectProxy *m_proxy; + PluginKateKJSWrapper *m_plugin; + }; + + class General: public KJSEmbed::JSProxyImp { + public: + enum MethodID { + MethodMethods, + MethodFields + }; + virtual bool implementsCall() const { return true; } + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + virtual KJS::Value fieldz( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + virtual KJS::Value methodz( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + static void addBindings(KJS::ExecState *exec,KJSEmbed::JSObjectProxy *proxy,KJS::Object &target); + private: + General( KJS::ExecState *exec,KJS::Interpreter *interpreter,int id); + + private: + int m_id; + KJS::Interpreter *m_interpreter; + }; + + + class MainWindow: public KJSEmbed::JSProxyImp { + public: + enum MethodID { + ActionCollection + + }; + virtual bool implementsCall() const { return true; } + virtual KJS::Value call( KJS::ExecState *exec, KJS::Object &self, const KJS::List &args ); + static void addBindings(KJS::ExecState *exec, KJSEmbed::JSObjectProxy *proxy,KJS::Object &target); + private: + MainWindow( KJS::ExecState *exec, int id, KJSEmbed::JSObjectProxy *parent, PluginKateKJSWrapper *plugin ); + ~MainWindow(); + private: + int m_id; + KJSEmbed::JSObjectProxy *m_proxy; + PluginKateKJSWrapper *m_plugin; + }; + + + } +} + +#endif diff --git a/kate/kjswrapper/plugin_katekjswrapper.cpp b/kate/kjswrapper/plugin_katekjswrapper.cpp new file mode 100644 index 0000000..c3e54b7 --- /dev/null +++ b/kate/kjswrapper/plugin_katekjswrapper.cpp @@ -0,0 +1,437 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +//BEGIN includes +#include "plugin_katekjswrapper.h" +#include "plugin_katekjswrapper.moc" +#include "bindings.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//END includes + +K_EXPORT_COMPONENT_FACTORY( katekjswrapperplugin, KGenericFactory( "katekjswrapper" ) ) + +PluginKateKJSWrapperView::~PluginKateKJSWrapperView() { +} + +void PluginKateKJSWrapperView::removeFromWindow() { + kdDebug()<<"PluginKateKJSWrapperView::removeFromWindow"< >::iterator it=toolviews.begin();it!=toolviews.end();it=toolviews.begin()) { + kdDebug()<<"removeFromWindow: removing a toolview"<toolViewManager()->removeToolView (tva); + } + win->guiFactory()->removeClient (this); + } + +PluginKateKJSWrapper::PluginKateKJSWrapper( QObject* parent, const char* name, const QStringList& list) + : Kate::Plugin ( (Kate::Application *)parent, name ) { + m_views.setAutoDelete(true); + m_scriptname=list[0]; + m_kateAppBindings=new Kate::JS::Bindings(this); + KJSEmbed::JSSecurityPolicy::setDefaultPolicy( KJSEmbed::JSSecurityPolicy::CapabilityAll ); + m_part = new KJSEmbed::KJSEmbedPart(this); + KJS::Interpreter *js = m_part->interpreter(); + + KJSEmbed::JSFactory *factory=m_part->factory(); + +/* factories for kate app classes */ + factory->addQObjectPlugin("Kate::Application",m_kateAppBindings); + factory->addQObjectPlugin("Kate::DocumentManager",m_kateAppBindings); + factory->addQObjectPlugin("Kate::MainWindow",m_kateAppBindings); + factory->addQObjectPlugin("Kate::PluginManager",m_kateAppBindings); + factory->addQObjectPlugin("Kate::InitPluginManager",m_kateAppBindings); + factory->addQObjectPlugin("Kate::ProjectManager",m_kateAppBindings); + factory->addQObjectPlugin("Kate::Project",m_kateAppBindings); + factory->addQObjectPlugin("Kate::ViewManager",m_kateAppBindings); + factory->addQObjectPlugin("Kate::View",m_kateAppBindings); +/* toplevel objects*/ + KJS::Object appobj=m_part->addObject(Kate::application(),"KATE"); + js->globalObject().put( js->globalExec(), "addConfigPage", KJS::Object(new Kate::JS::Management(js->globalExec(),Kate::JS::Management::AddConfigPage,this ))); + js->globalObject().put( js->globalExec(), "setConfigPages", KJS::Object(new Kate::JS::Management(js->globalExec(),Kate::JS::Management::SetConfigPages,this ))); + js->globalObject().put( js->globalExec(), "removeConfigPage", KJS::Object(new Kate::JS::Management(js->globalExec(),Kate::JS::Management::RemoveConfigPage,this ))); + js->globalObject().put( js->globalExec(), "setWindowConfiguration", KJS::Object(new Kate::JS::Management(js->globalExec(),Kate::JS::Management::SetWindowConfiguration,this ))); + js->globalObject().put( js->globalExec(), "KJSConsole", KJS::Object(new Kate::JS::Management(js->globalExec(),Kate::JS::Management::KJSConsole,this ))); + +/* KJSEmbed::JSConsoleWidget *w=m_part->view(); + w->show(); + //w->show();*/ + kdDebug()<<"m_scriptname="<runFile(locate("appdata",QString("plugins/%1/%2.js").arg(m_scriptname).arg(m_scriptname))); +//"/home/jowenn/development/kde/cvs/kdeaddons/kate/kjswrapper/samples/test1.js"); +} + +PluginKateKJSWrapper::~PluginKateKJSWrapper() +{ + delete m_part; + m_part=0; +} + + +uint PluginKateKJSWrapper::configPages () const { + KJS::Interpreter *js = m_part->interpreter(); + KJS::ExecState *exec=js->globalExec(); + + if (! (m_configPageFactories.isNull() || (m_configPageFactories.type()==KJS::NullType))) { + KJS::Object constrs=m_configPageFactories.toObject(exec); + if (!exec->hadException()) { + if (QString(constrs.classInfo()->className)=="Array") { + kdDebug()<<"config page constructor array detected"<hadException()) { + exec->clearException(); + kdDebug()<<"Error while retrieving array length"<clearException(); + return 0; +} + + +static KJS::Object getObj(KJS::Interpreter *js, KJS::Value mightBeArray, int id) { + KJS::ExecState *exec=js->globalExec(); + KJS::Object constrs=mightBeArray.toObject(exec); + KJS::Value constr; + if (!exec->hadException()) { + if (QString(constrs.classInfo()->className)=="Array") { + kdDebug()<<"config page constructor array detected"<globalExec()); +} + +QString PluginKateKJSWrapper::configPageName(uint id) const { + if (id>=configPages()) return ""; + KJS::Interpreter *js = m_part->interpreter(); + + KJS::Object constr=getObj(js,m_configPageFactories,id); + + KJS::Value o=constr.get(js->globalExec(),KJS::Identifier("name")); + QString retVal( o.toString(js->globalExec()).qstring() ); + + kdDebug()<<"=============================================================================================="<globalExec()->clearException(); + return retVal; +} + +QString PluginKateKJSWrapper::configPageFullName(uint id) const { + if (id>=configPages()) return ""; + KJS::Interpreter *js = m_part->interpreter(); + + KJS::Object constr=getObj(js,m_configPageFactories,id); + + KJS::Value o=constr.get(js->globalExec(),KJS::Identifier("fullName")); + QString retVal( o.toString(js->globalExec()).qstring() ); + + kdDebug()<<"=============================================================================================="<globalExec()->clearException(); + return retVal; +} + +QPixmap PluginKateKJSWrapper::configPagePixmap (uint /*number = 0*/, + int /*size = KIcon::SizeSmall*/) const { + return 0; +} + + +Kate::PluginConfigPage* PluginKateKJSWrapper::configPage (uint id, + QWidget *w, const char */*name*/) { + kdDebug()<<"PluginKateKJSWrapper::configPage"<=configPages()) return 0; + KJS::Interpreter *js = m_part->interpreter(); + + KJS::Object constr=getObj(js,m_configPageFactories,id); + + if (js->globalExec()->hadException()) { + kdDebug()<<"PluginKateKJSWrapper::configPage: exit 1"<globalExec()->clearException(); + return 0; + } + + if (!constr.implementsConstruct()) { + kdWarning()<<"config page factory has to be an object constructor"<globalExec(); + params.append(win); + exec->clearException(); + int dockPos; + if (!viewConstructor.implementsConstruct()) return 0; + KJS::Value dockPosV=viewConstructor.get(exec,KJS::Identifier("startPosition")); + if (exec->hadException()) { + dockPos=KDockWidget::DockLeft; + exec->clearException(); + } else { + dockPos=dockPosV.toInteger(exec); + if (exec->hadException()) { + dockPos=KDockWidget::DockLeft; + exec->clearException(); + } + } + QString viewName; + KJS::Value viewNameV=viewConstructor.get(exec,KJS::Identifier("name")); + if (exec->hadException()) { + viewName="kjs_unknown"; + exec->clearException(); + } else { + viewName=QString( viewNameV.toString(exec).qstring() ); + if (exec->hadException()) { + viewName="kjs_unknown"; + exec->clearException(); + } + } + + Kate::JS::ToolView *tv=new Kate::JS::ToolView(viewConstructor,exec,factory,params,viewName.utf8()); + //params.append(factory->createProxy(exec,tv)); + //KJS::Object otv=viewConstructor.construct(exec,params); + if (exec->hadException()) { + kdDebug()<<"Error while calling constructor"<exception().toString(exec).qstring()<clearException(); + return 0; + } + KMDI::ToolViewAccessor *tva=winN->toolViewManager()->addToolView((KDockWidget::DockPosition)dockPos,tv, + tv->icon()?(*(tv->icon())):QPixmap(),tv->caption()); + kdDebug()<<"****************************************************************************************"<win=win; + connect(win,SIGNAL(destroyed()),this,SLOT(slotWindowDestroyed())); + m_views.insert(win,view); + KJS::Interpreter *js = m_part->interpreter(); + KJS::ExecState *exec = js->globalExec(); + view->actionCollectionObj=m_part->factory()->createProxy(exec,view->actionCollection()); + view->winObj=m_part->factory()->createProxy(exec,win); + } else kdDebug()<<"returning cached View/Window Object"<interpreter(); + KJS::ExecState *exec = js->globalExec(); + exec->clearException(); + kdDebug()<<"****************************************************************************************"<winObj); + KJS::Object newWinFunc=m_newWindowHandler.toObject(exec); + if (exec->hadException()) { + exec->clearException(); + } else { + if (newWinFunc.implementsCall()) { + newWinFunc.call(exec,js->globalObject(),param); + if (exec->hadException()) { + kdDebug()<<"Error while calling newWindowHandler"<clearException(); + } + } + } + } + if (exec->hadException()) kdDebug()<<"void PluginKateKJSWrapper::addView(Kate::MainWindow *win): exec had an exception - 1"<hadException()) { + if (QString(constrs.classInfo()->className)=="Array") { + kdDebug()<<"Toolview constructor array detected"<hadException()) { + exec->clearException(); + kdDebug()<<"Error while retrieving array length"<hadException()) { + exec->clearException(); + } else { + KMDI::ToolViewAccessor *w=createToolView(m_part->factory(),js,win,view->winObj,constrO); + if (w) { + view->toolviews.append(QGuardedPtr(w)); + } + exec->clearException(); + } + } + } + } else { + kdDebug()<<"Single toolview constructor detected"<factory(),js,win,view->winObj,constrs); + if (w) { + view->toolviews.append(QGuardedPtr(w)); + } + exec->clearException(); + } + } + + } + } else kdDebug()<<"void PluginKateKJSWrapper::addView(Kate::MainWindow *win): no toolview constructors"<hadException()) kdDebug()<<"void PluginKateKJSWrapper::addView(Kate::MainWindow *win): exec had an exception - 2"<setInstance (new KInstance("kate")); + view->setXMLFile(QString("plugins/%1/%2.rc").arg(m_scriptname).arg(m_scriptname)); + win->guiFactory()->addClient (view); +} + + +void PluginKateKJSWrapper::slotWindowDestroyed() { + m_views.remove((void*)sender()); +} + +void PluginKateKJSWrapper::removeView(Kate::MainWindow *win) +{ +//here toolviews must not be destroyed. Only cleanup functions called the view should be removed in the slot connected to the windows destroy signal only + m_views[win]->removeFromWindow(); +} + + + +void PluginKateKJSWrapper::applyConfig( KateKJSWrapperConfigPage *p ) +{ +#if 0 + config->writeEntry( "Command History Length", p->sb_cmdhistlen->value() ); + // truncate the cmd hist if nessecary? + config->writeEntry( "Start In", p->rg_startin->id(p->rg_startin->selected()) ); + config->sync(); +#endif +} + +KateKJSWrapperConfigPage::KateKJSWrapperConfigPage(KJS::Object pageConstructor,PluginKateKJSWrapper* parent, + QWidget *parentWidget) + : Kate::PluginConfigPage( parentWidget ),m_plugin(parent) +{ + QVBoxLayout *l=new QVBoxLayout(this); + l->setAutoAdd(true); + l->activate(); + KJS::Interpreter *js = parent->m_part->interpreter(); + KJS::ExecState *exec = js->globalExec(); + exec->clearException(); + KJS::List param; + param.append(parent->m_part->factory()->createProxy(exec,this,0)); + m_pageObject=pageConstructor.construct(exec,param); +} + + +static void callJS(KJSEmbed::KJSEmbedPart *p,KJS::Object o,const QString& funcName){ + KJS::Interpreter *js = p->interpreter(); + KJS::ExecState *exec = js->globalExec(); + KJS::List param; + exec->clearException(); + KJS::Value funcV=o.get(exec,KJS::Identifier(funcName)); + if (exec->hadException()) { +#warning clear exception ? + return; + } + KJS::Object func=funcV.toObject(exec); + if (exec->hadException()) { +#warning clear exception ? + return; + } + if (func.implementsCall()) { + func.call(exec,o,param); + if (js->globalExec()->hadException()) { +#warning clear exception ? + return; + } + } +} + +void KateKJSWrapperConfigPage::apply() +{ + callJS(m_plugin->m_part,m_pageObject,"apply"); +} + +void KateKJSWrapperConfigPage::reset() +{ + callJS(m_plugin->m_part,m_pageObject,"reset"); +} + +void KateKJSWrapperConfigPage::defaults() +{ + callJS(m_plugin->m_part,m_pageObject,"defaults"); +} + + +Kate::JS::ToolView::ToolView(KJS::Object constr, KJS::ExecState *exec, KJSEmbed::JSFactory *factory, KJS::List parameters, const char *name):QVBox(0,name) { + parameters.append(factory->createProxy(exec,this)); + handler=constr.construct(exec,parameters); + +} + +Kate::JS::ToolView::~ToolView() { +} + diff --git a/kate/kjswrapper/plugin_katekjswrapper.h b/kate/kjswrapper/plugin_katekjswrapper.h new file mode 100644 index 0000000..f04043e --- /dev/null +++ b/kate/kjswrapper/plugin_katekjswrapper.h @@ -0,0 +1,180 @@ +/* This file is part of the KDE project + Copyright (C) 2004 Joseph Wenninger + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _PLUGIN_KATE_KJS_WRAPPER_H_ +#define _PLUGIN_KATE_KJS_WRAPPER_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Kate { + class PluginConfigPage; + namespace JS { + class Bindings; + class Management; + class RefCountedObjectDict; + class Application; + class MainWindow; + } +} + + +namespace KJSEmbed { + class KJSEmbedPart; + class JSFactory; +} + +class KateKJSWrapperConfigPage; +class PluginKateKJSWrapperView; + +namespace KMDI { + class ToolViewAccessor; +} + +class PluginKateKJSWrapper : public Kate::Plugin, + Kate::PluginViewInterface, + Kate::PluginConfigInterfaceExtension +{ + Q_OBJECT + + public: + PluginKateKJSWrapper( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + virtual ~PluginKateKJSWrapper(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + Kate::View *kv; + + + QPtrDict m_views; + uint configPages () const; + Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0); + QString configPageName(uint) const; + QString configPageFullName(uint) const; + QPixmap configPagePixmap (uint /*number = 0*/, + int /*size = KIcon::SizeSmall*/) const; + PluginKateKJSWrapperView *getViewObject(Kate::MainWindow *win); + + public slots: + //void slotInsertCommand(); + //void slotAbort(); + void applyConfig( KateKJSWrapperConfigPage* ); + void slotWindowDestroyed(); + + private: + friend class Kate::JS::Management; + friend class KateKJSWrapperConfigPage; + KJSEmbed::KJSEmbedPart *m_part; + Kate::JS::Bindings *m_kateAppBindings; + //QValueList m_configPageFactories; + KJS::Value m_configPageFactories; + KJS::Value m_toolViewConstructors; + KJS::Value m_newWindowHandler; + KJS::Value m_removeWindowHandler; + QString m_scriptname; + }; + + +/** Config page for the plugin. */ +class KateKJSWrapperConfigPage : public Kate::PluginConfigPage +{ + Q_OBJECT + friend class PluginKateKJSWrapper; + + public: + KateKJSWrapperConfigPage(KJS::Object pageConstructor,PluginKateKJSWrapper* parent = 0L, QWidget *parentWidget = 0L); + ~KateKJSWrapperConfigPage() {}; + + /** Reimplemented from Kate::PluginConfigPage + * just emits configPageApplyRequest( this ). + */ + void apply(); + + void reset (); + void defaults (); + + signals: + /** Ask the plugin to set initial values */ + void configPageApplyRequest( KateKJSWrapperConfigPage* ); + /** Ask the plugin to apply changes */ + void configPageInitRequest( KateKJSWrapperConfigPage* ); + + private: + KJS::Object m_pageObject; + PluginKateKJSWrapper *m_plugin; + }; + +class PluginKateKJSWrapperView : public KXMLGUIClient +{ + public: + + virtual ~PluginKateKJSWrapperView(); + + private: + friend class PluginKateKJSWrapper; + friend class Kate::JS::Application; + friend class Kate::JS::MainWindow; + void removeFromWindow(); + + Kate::MainWindow *win; + KJS::Object winObj; + KJS::Object actionCollectionObj; + QValueList > toolviews; +}; + + + +namespace Kate { + namespace JS { + class ToolView: public QVBox { + Q_OBJECT + public: + ToolView(KJS::Object constr, KJS::ExecState *exec, KJSEmbed::JSFactory *factory, KJS::List parameters, const char * name); + virtual ~ToolView(); + private: + KJS::Object handler; + }; + } + +} + +#endif // _PLUGIN_KATE_KJS_WRAPPER_H_ + diff --git a/kate/kjswrapper/samples/Makefile.am b/kate/kjswrapper/samples/Makefile.am new file mode 100644 index 0000000..ee9a457 --- /dev/null +++ b/kate/kjswrapper/samples/Makefile.am @@ -0,0 +1,23 @@ + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +#pluginsdir=$(kde_datadir)/kate/plugins/katekjswrapper +#plugins_DATA=ui.rc + +plugins1dir=$(kde_datadir)/kate/plugins/katekjstest1 +plugins1_DATA=katekjstest1.js + +pluginsconsolewindowdir=$(kde_datadir)/kate/plugins/katekjsconsolewindow +pluginsconsolewindow_DATA=katekjsconsolewindow.js katekjsconsolewindow.rc + +pluginsselectdir=$(kde_datadir)/kate/plugins/katekjsselect +pluginsselect_DATA=katekjsselect.js katekjsselect.rc + +#plugins2dir = $(kde_datadir)/kate/plugins/katekjstest2 +#plugins2_DATA = katekjstest2.js + +kde_services_DATA = katekjstest1.desktop katekjsconsolewindow.desktop katekjsselect.desktop +#kde_services_DATA = katekjstest2.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kateinsertcommand.pot diff --git a/kate/kjswrapper/samples/katekjsconsolewindow.desktop b/kate/kjswrapper/samples/katekjsconsolewindow.desktop new file mode 100644 index 0000000..a882953 --- /dev/null +++ b/kate/kjswrapper/samples/katekjsconsolewindow.desktop @@ -0,0 +1,55 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katekjswrapperplugin +X-Kate-Version=2.2 +X-Kate-PluginName=katekjsconsolewindow +Name=Kate Javascript Console Window +Name[bg]=Прозорец за изхода на Javascript +Name[ca]=Finestra de consola de Javascript per a Kate +Name[cs]=Okno javscriptové konzole Kate +Name[da]=Kate Javascript konsolvindue +Name[de]=Konsolenfenster für JavaScript in Kate +Name[el]=Παράθυρο κονσόλας Javascript του Kate +Name[eo]=Javaskripta konzolfenestro por Kodredaktilo +Name[es]=Ventana de la consola de Javascript de Kate +Name[et]=Kate Javascripti konsooliaken +Name[eu]=Kate Javascript konsola leihoa +Name[fa]=پنجرۀ پیشانۀ جاوااسکریپت Kate +Name[fi]=Kate Javascript konsoli-ikkuna +Name[fr]=Console Javascript pour Kate +Name[fy]=Kate Javascript console-finster +Name[ga]=Fuinneog Chonsóil Javascript Kate +Name[gl]=Fiestra de Consola de JavaScript para Kate +Name[he]= חלון תסריטי הג'אווה של Kate +Name[hi]=केएटीई जावास्क्रिप्ट कंसोल विंडो +Name[hr]=Kate terminalski prozor za Javascript +Name[hu]=Kate Javascript-es parancsértelmező ablak +Name[is]=Kate Javascript skjáhermir +Name[it]=Finestra console JavaScript di Kate +Name[ja]=Kate Javascript コンソールウィンドウ +Name[ka]=Kate Javascript კონსოლის ფანჯარა +Name[kk]=Kate Javascript консоль терезесі +Name[km]=បង្អួច​កុងសូល​របស់ Kate Javascript +Name[mk]=прозорец со Javascript-конзола за Кате +Name[nb]=Javascript konsollvindu for Kate +Name[nds]=Javascript-Konsoolfinster för Kate +Name[ne]=केट जाभास्क्रिप्ट कन्सोल सञ्झ्याल +Name[nl]=Kate Javascript console-venster +Name[nn]=Javascript-konsollvindauge til Kate +Name[pa]=ਕੇਟ ਜਾਵਾਸਕਰਿਪ ਕੰਨਸੋਲ ਝਰੋਖਾ +Name[pl]=Okno konsoli Javascript dla Kate +Name[pt]=Janela de Consola de JavaScript do Kate +Name[pt_BR]=Janela de Console Javascript do Kate +Name[ru]=Окно консоли Javascript Kate +Name[sk]=Konzolové okno Kate Javascript +Name[sl]=Konzolno okno javascripta v Kate +Name[sr]=Конзолни прозор JavaSript-а за Kate +Name[sr@Latn]=Konzolni prozor JavaSript-a za Kate +Name[sv]=Kate Javaskript terminalfönster +Name[tg]=Тирезаи нозиргоҳи Kate Javascript +Name[tr]=Kate Javascript Konsol Penceresi +Name[uk]=Вікно консолі Javascript для Kate +Name[vi]=Cửa sổ bàn giao tiếp Javascript Kate +Name[zh_CN]=Kate Javascript 控制台窗口 +Name[zh_TW]=Kate Javascript 主控台視窗 diff --git a/kate/kjswrapper/samples/katekjsconsolewindow.js b/kate/kjswrapper/samples/katekjsconsolewindow.js new file mode 100644 index 0000000..e253ce0 --- /dev/null +++ b/kate/kjswrapper/samples/katekjsconsolewindow.js @@ -0,0 +1,18 @@ +function newWindowCallBack(mainwindow) { + var ac=mainwindow.actionCollection(); + action = new KAction( ac, 'kjsconsole_show_action' ); + action.text = 'Javascript Console Window'; + action.icon = 'konsole'; + + mainwindow.showConsole = function() + { + + KJSConsole(); + } + + action.connect( action, 'activated()', mainwindow, 'showConsole' ); + +} + +setWindowConfiguration(null,newWindowCallBack,null); + diff --git a/kate/kjswrapper/samples/katekjsconsolewindow.rc b/kate/kjswrapper/samples/katekjsconsolewindow.rc new file mode 100644 index 0000000..7ac34fc --- /dev/null +++ b/kate/kjswrapper/samples/katekjsconsolewindow.rc @@ -0,0 +1,8 @@ + + + + &Tools + + + + diff --git a/kate/kjswrapper/samples/katekjsselect.desktop b/kate/kjswrapper/samples/katekjsselect.desktop new file mode 100644 index 0000000..c4d1273 --- /dev/null +++ b/kate/kjswrapper/samples/katekjsselect.desktop @@ -0,0 +1,53 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katekjswrapperplugin +X-Kate-Version=2.2 +X-Kate-PluginName=katekjsselect +Name=Select Smallest Enclosing Block +Name[ca]=Selecció del bloc tancat més petit +Name[cs]=Zvolte nejmenší blok +Name[da]=Vælg den mindste omsluttende blok +Name[de]=Kleinsten einschließenden Block auswählen +Name[el]=Επιλογή του μικρότερου περικλυόμενου κομματιού +Name[eo]=Elektu pli mallongan entenantan blokon +Name[es]=Selecciona un bloque cerrado más pequeño +Name[et]=Vali väikseim sulgev blokk +Name[eu]=Hautatu blokerik txikiena +Name[fa]=گزینش کوچک‌ترین بلوک محصور +Name[fi]=Valitse pienin ympäröity lohko +Name[fr]=Sélection du plus petit bloc enfermé +Name[fy]=Lytste ynslutende blok selektearje +Name[gl]=Seleccionar o Menor Bloco Envolvente +Name[he]=בחר את בלוק הסגירה הכי קטן +Name[hr]=Odabir najmanjeg zatvorenog bloka +Name[hu]=A legkisebb bezáró blokk kijelölése +Name[is]=Velja minnstu umluktu blokkina +Name[it]=Seleziona il più piccolo blocco +Name[ja]=囲っている最も内側のブロックを選択します +Name[ka]=უმცირესი დახურვის ბლოკის ამორჩევა +Name[kk]=Ең шағын блокты таңдау +Name[km]=ជ្រើស​ប្លុក​ដែល​បាន​ព័ទ្ធ​ជុំវិញ​​​តូច​បំផុត +Name[lt]=Žymėti mažiausią bloką +Name[mk]=Најмал опкружувачки блок +Name[ms]=Pilih Blok Penutupan Terkecil +Name[nb]=Velg minste omsluttende blokk +Name[nds]=Den lüttsten insluten Block utsöken +Name[ne]=सामेल गरिने सबैभन्दा सानो खण्ड चयन गर्नुहोस् +Name[nl]=Kleinste insluitende blok selecteren +Name[nn]=Vel minste omsluttande blokk +Name[pl]=Wybierz najmniejszy blok zawierający +Name[pt]=Seleccionar o Menor Bloco Envolvente +Name[pt_BR]=Sleecione o Menor Bloco Aninhado +Name[ru]=Выбор наименьшего блока +Name[sk]=Zvolí najmenší ohraničujúci blok +Name[sl]=Izberite najmanjši obdajajoč blok +Name[sr]=Изаберите најмањи обухватајући блок +Name[sr@Latn]=Izaberite najmanji obuhvatajući blok +Name[sv]=Markera minsta omgivande block +Name[ta]=மிகச்சிறிய இணைப்பை தேர்ந்தெடு +Name[tr]=Çevreleyen en küçük bloğu seç +Name[uk]=Виберіть найменший блок включення +Name[vi]=Chọn khối chứa nhỏ nhất +Name[zh_CN]=选择最小的包围块 +Name[zh_TW]=選擇最小封閉區域 diff --git a/kate/kjswrapper/samples/katekjsselect.js b/kate/kjswrapper/samples/katekjsselect.js new file mode 100644 index 0000000..d6a33fb --- /dev/null +++ b/kate/kjswrapper/samples/katekjsselect.js @@ -0,0 +1,92 @@ +function newWindowCallBack(mainwindow) { + var ac=mainwindow.actionCollection(); + action = new KAction( ac, 'kjsselect_select_action' ); + action.text = 'Select enclosing block'; + //action.icon = 'konsole'; + + + mainwindow.selectIt = function() + { + endChars=Array(); + endChars['\"']="\""; + endChars['(']=")"; + endChars['[']="]"; + endChars['\'']="'"; + endChars['{']="}"; + endChar=""; + av=this.viewManager().activeView(); + d=KATE.DocumentManager.activeDocument(); + + lineCnt=d.numLines(); + x=av.cursorColumn(); + y=av.cursorLine(); + line=d.textLine(y); + sy=y; + sx=x-1; + while (true) { + if (sx<0) { + sy=sy-1; + if (sy<0) { + d.selectAll(); + return; + } + line=d.textLine(sy); + while (line.length==0) { + sy=sy-1; + if (sy<0) { + d.selectAll(); + return; + } + line=d.textLine(sy); + } + sx=line.length-1; + + } + if ( + (line[sx]=="\"") || + (line[sx]=="'") || + (line[sx]=="(") || + (line[sx]=="[") || + (line[sx]=="{") + ) { + endChar=endChars[line[sx]]; + break; + }else sx--; + } + + + alert("Searching end"); + ex=x; + ey=y; + line=d.textLine(y); + while (true) { + if (ex>=(line.length-1)) { + ey=ey+1; + if (ey>=lineCnt) { + d.selectAll(); + return; + } + line=d.textLine(ey); + while (line.length==0) { + ey=ey+1; + if (ey>=lineCnt) { + d.selectAll(); + return; + } + line=d.textLine(ey); + } + ex=0; + } + if (line[ex]==endChar) + break; else ex++; + } + d.setSelection(sy,sx,ey,ex); + + } + + action.connect( action, 'activated()', mainwindow, 'selectIt' ); + +} + +setWindowConfiguration(null,newWindowCallBack,null); + diff --git a/kate/kjswrapper/samples/katekjsselect.rc b/kate/kjswrapper/samples/katekjsselect.rc new file mode 100644 index 0000000..2b210a1 --- /dev/null +++ b/kate/kjswrapper/samples/katekjsselect.rc @@ -0,0 +1,8 @@ + + + + &Tools + + + + diff --git a/kate/kjswrapper/samples/katekjstest1.desktop b/kate/kjswrapper/samples/katekjstest1.desktop new file mode 100644 index 0000000..d5731b5 --- /dev/null +++ b/kate/kjswrapper/samples/katekjstest1.desktop @@ -0,0 +1,90 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katekjswrapperplugin +X-Kate-Version=2.2 +X-Kate-PluginName=katekjstest1 +Name=Kate KJS Test 1 +Name[bs]=Kate KJS test 1 +Name[ca]=Test 1 per KJS a Kate +Name[cs]=Kate KJS test 1 +Name[el]=Kate KJS δοκιμή 1 +Name[eo]=KJS testo 1 de Kodredaktilo +Name[et]=Kate KJS test 1 +Name[eu]=Kate KJS-ren 1 froga +Name[fa]=آزمون ۱ Kate KJS +Name[fi]=Kate KJS testi 1 +Name[fr]=Test 1 KJS pour Kate +Name[ga]=Tástáil 1 Kate KJS +Name[gl]=Proba 1 para Kate KJS +Name[he]=ניסוי KJS של Kate מספר 1 +Name[hi]=के-एटीई केजेएस जाँच 1 +Name[is]=Kate KJS prufa 1 +Name[ja]=Kate KJS テスト 1 +Name[km]=សាកល្បង Kate KJS +Name[ms]=Kate KJS Ujian 1 +Name[nds]=Kate-KJSTest 1 +Name[ne]=केट केजेएस परीक्षण १ +Name[nn]=Kate KJS-test 1 +Name[pa]=ਕੇਟ KJS Test 1 +Name[pl]=KJS Test 1 dla Kate +Name[pt]=Teste 1 Kate do KJS +Name[pt_BR]=Teste Kate KJS 1 +Name[sl]=Kate KJS preizkus 1 +Name[sr]=Kate KJS, тест 1 +Name[sr@Latn]=Kate KJS, test 1 +Name[ta]=கேட் KJS சோதனை 1 +Name[tr]=Kate KJS Deneme1 +Name[uk]=Kate KJS Тест 1 +Name[vi]=Thử thách KJS Kate 1 +Name[zh_CN]=Kate KJS 测试 1 +Comment=Test for the KJS Wrapper +Comment[bg]=Проба на обвивката на KJS +Comment[ca]=Test pel Wrapper de KJS +Comment[cs]=Test KJS wrapperu +Comment[da]=Test for KJS Wrapper +Comment[de]=Test für den KJS-Wrapper +Comment[el]=Δοκιμή για το KJS Wrapper +Comment[eo]=Testo por la KJS envolvaĵo +Comment[es]=Test para el ajuste KJS +Comment[et]=KJS Wrapperi test +Comment[eu]=KJS Wrapper-erako testua +Comment[fa]=آزمون برای سطربندی KJS +Comment[fi]=KJS Wrapperin testi +Comment[fr]=Test pour l'interface avec KJS +Comment[fy]=Test foar de KJS Wrapper +Comment[ga]=Tástáil an Rapar KJS +Comment[gl]=Proba para o Wrapper de KJS +Comment[he]=ניסיון עבור המעטפת KJS +Comment[hi]=केजेएस व्रेपर के लिए जाँच +Comment[hr]=Provjera za KJS omotač +Comment[hu]=Tesztprogram a KJS felülethez +Comment[is]=Prufa fyrir KJS eininguna +Comment[it]=Test per il wrapper KJS +Comment[ja]=KJS ラッパーのテスト +Comment[ka]=KJS Wrapper-ის შემოწმება +Comment[kk]=KJS Wrapper сынағы +Comment[km]=សាកល្បង​សម្រាប់​​កម្មវិធី​រុំ​ KJS +Comment[lt]=Bandymas KJS įdėklui +Comment[mk]=Тест за обвивката KJS +Comment[ms]=Ujian untuk Pembungkus KJS +Comment[nb]=Test for KJS-omslaget +Comment[nds]=Test för den KJS-Wrapper +Comment[ne]=केजेएस आवरणका लागि परीक्षण +Comment[nl]=Test voor de KJS Wrapper +Comment[nn]=Test for KJS-omslaget +Comment[pl]=Test obsługi KJS +Comment[pt]=Teste para o 'Wrapper' de KJS +Comment[pt_BR]=Teste para o Wrapper do KJS +Comment[ru]=Тест KJS Wrapper +Comment[sk]=Test pre obálku KJS +Comment[sl]=Preizkus za KJS Wrapper +Comment[sr]=Тест за KJS омотач +Comment[sr@Latn]=Test za KJS omotač +Comment[sv]=Test för KJS-omslutande program +Comment[ta]=KJS சுற்றுத்தாளுக்கான சோதனை +Comment[tr]=KJS Wrapper Testi +Comment[uk]=Тест для KJS Wrapper +Comment[vi]=Thử thách cho bộ bao bọc KJS +Comment[zh_CN]=KJS Wrapper 的测试 +Comment[zh_TW]=KJS 包裝測試 diff --git a/kate/kjswrapper/samples/katekjstest1.js b/kate/kjswrapper/samples/katekjstest1.js new file mode 100644 index 0000000..7e4e041 --- /dev/null +++ b/kate/kjswrapper/samples/katekjstest1.js @@ -0,0 +1,167 @@ +/**************************************************************** + First configuration page +****************************************************************/ +function Page1 (parentWidget) { + this.defaults=function() { + alert("Defaults has been called"); + } + this.apply=function() { + alert("Apply has been called"); + } + this.reset=function() { + alert("Reset defaults has been called"); + } + box=new QVBox(parentWidget); + this.button1=new QPushButton(box); + this.button1.text="P1 Button 1"; + this.button1.show(); + this.button2=new QPushButton(box); + this.button2.text="P1 Button 2"; + this.button2.show(); + box.show(); +} +Page1.name="Page1" +Page1.fullName="Test1/Page1"; + +/**************************************************************** + Second configuration page +****************************************************************/ + +function Page2 (parentWidget) { + box=new QVBox(parentWidget); + this.button1=new QPushButton(box); + this.button1.text="P2 Button 1"; + this.button1.show(); + this.button2=new QPushButton(box); + this.button2.text="P2Button 2"; + this.button2.show(); + box.show(); +} +Page2.name="Page2"; +Page2.fullName="Test1/Page2"; + +/**************************************************************** + Third configuration page +****************************************************************/ + +function Page3 (parentWidget) { + box=new QVBox(parentWidget); + this.button1=new QPushButton(box); + this.button1.text="P3 Button 1"; + this.button1.show(); + this.button2=new QPushButton(box); + this.button2.text="P3 Button 2"; + this.button2.show(); + box.show(); +} +Page3.name="Page3"; +Page3.fullName="Test1/Page3"; + + +/**************************************************************** + First toolview +****************************************************************/ + +function MyToolView1 (mainwindow,parentwidget) { + parentwidget.caption="This is my first JS Toolview"; + parentwidget.icon=StdIcons.BarIcon("yes"); + + this.lv = new KListView( parentwidget ); + + this.lv.addColumn('Pix'); + this.lv.addColumn('One'); + this.lv.addColumn('Two'); + this.lv.addColumn('Three'); + + this.lv.insertItem( StdIcons.BarIcon("no"), 'Something', "Nothing", "Thing" ); + this.lv.insertItem( StdIcons.BarIcon("no"), 'Something', "Nothing", "Thing" ); + this.lv.insertItem( StdIcons.BarIcon("no"), 'Something', "Nothing", "Thing" ); + this.lv.insertItem( StdIcons.BarIcon("no"), 'Something', "Nothing", "Thing" ); + + this.changed=function() { + alert("Item changed"); + KATE.DocumentManager.activeDocument().insertText(0,0,"TEST"); + } + this.lv.connect(this.lv,'selectionChanged()',this,'changed'); + + + this.mw=mainwindow; + this.cleanup=function() { + alert("Cleanup MyToolView1"); + } + +} +MyToolView1.startPosition=KATE.ToolView.Right; +MyToolView1.name="myfirstjstoolview" + + +/**************************************************************** + Second toolview +****************************************************************/ + +function MyToolView2 (mainwindow,parentwidget) { + parentwidget.caption="This is my second JS Toolview"; + parentwidget.icon=StdIcons.BarIcon("no"); + + this.lb=new QListBox(parentwidget); + this.mainwindow=mainwindow; + this.cleanup=function() { + alert("Cleanup MyToolView2"); + } +} +MyToolView2.startPosition=KATE.ToolView.Left; +MyToolView2.name="mysecondjstoolview" + + + +/**************************************************************** + NewWindow callback +****************************************************************/ + +function newWindowCallBack(mainwindow) { + alert("New Window has been created"); +/* + anotherToolView = function (mainwindow,parentwidget) { + parentwidget.caption="This is my third JS Toolview"; + parentwidget.icon=StdIcons.BarIcon("kate"); + + this.lb=new QListBox(parentwidget); + this.mainwindow=mainwindow; + this.cleanup=function() { + alert("Cleanup MyToolView3"); + } + } + anotherToolView.startPosition=KATE.ToolView.Left; + anotherToolView.name="mythirdjsoolview" + mainwindow.createToolView(anotherToolView);*/ +} + +/**************************************************************** + WindowRemoved callback +****************************************************************/ +function windowRemovedCallBack(mainwindow) { + alert("Window has been removed"); +} + + + + + + +/**************************************************************** + Initialization +****************************************************************/ + +cpc=new Array(); +cpc.push(Page1); +cpc.push(Page2); +setConfigPages(cpc); +//setConfigPages(Page3); +//addConfigPage(Page3); + +tvc=new Array(); +tvc.push(MyToolView1); +tvc.push(MyToolView2); +setWindowConfiguration(tvc,newWindowCallBack,windowRemovedCallBack); +//setWindowConfiguration(MyToolView1,newWindowCallBack,windowRemovedCallBack); + diff --git a/kate/kpybrowser/Makefile.am b/kate/kpybrowser/Makefile.am new file mode 100644 index 0000000..654dacc --- /dev/null +++ b/kate/kpybrowser/Makefile.am @@ -0,0 +1,18 @@ +# set the include path for X, qt and KDE +INCLUDES= $(all_includes) +METASOURCES = AUTO + +kde_module_LTLIBRARIES = katepybrowseplugin.la + +katepybrowseplugin_la_SOURCES = kpybrowser.cpp pybrowsenode.cpp pybrowse_part.cpp +katepybrowseplugin_la_LIBADD = -lkateinterfaces +katepybrowseplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +pluginsdir = $(kde_datadir)/kate/plugins/katepybrowse +plugins_DATA = ui.rc + +kde_services_DATA = katepybrowse.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katepybrowse.pot + diff --git a/kate/kpybrowser/katepybrowse.desktop b/kate/kpybrowser/katepybrowse.desktop new file mode 100644 index 0000000..8b33b1c --- /dev/null +++ b/kate/kpybrowser/katepybrowse.desktop @@ -0,0 +1,128 @@ +# KDE Config File +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katepybrowseplugin +X-Kate-Version=2.5 +Name=Kate Python Browser Plugin +Name[af]=Kate Python Blaaier Inplak +Name[ar]=ملحق متصفح Python لـKate +Name[az]=Kate Python Səyyah Əlavəsi +Name[ca]=Connector del navegador Python per a Kate +Name[cs]=Modul Python prohlížeče pro Kate +Name[cy]=Ategyn porydd Python am Kate +Name[da]=Kate Pythonlæser-plugin +Name[de]=Browser-Modul für Python +Name[el]=Πρόσθετο περιηγητή Python του Kate +Name[eo]=Pitona foliumila kromaĵo por Kodredaktilo +Name[es]=Complemento del navegador Python de Kate +Name[et]=Kate Pythoni brauseri plugin +Name[eu]=Kateren Python arakatzailearen plugina +Name[fa]=وصلۀ مرورگر Kate Python +Name[fi]=Kate Python selain -sovelma +Name[fo]=Kate Python-kagari-ístingur +Name[fr]=Module de navigation en Python pour Kate +Name[fy]=Kate Pyton Blêder Plugin +Name[gl]=Plugin de Navegación por Python para Kate +Name[he]=תוסף דפדפן Python ל־Kate +Name[hi]=के-एटीई पायथन ब्राउज़र प्लगइन +Name[hr]=Python dodatak za Kate +Name[hu]=Kate Python-böngésző bővítőmodul +Name[is]=Kate Python flakk viðbætur +Name[it]=Plugin visualizzatore Python di Kate +Name[ja]=Kate Python ブラウザプラグイン +Name[ka]=Kate-ის პითონის ბროუზერის მოდული +Name[kk]=Kate Python шолғышының плагин модулі +Name[km]=កម្មវិធី​ជំនួយ​​របស់​កម្មវិធី​រុករក Kate Python +Name[lt]=Kate Python naršyklės priedas +Name[mk]=Приклучок за пребарувач на Python во Кате +Name[ms]=Plug masuk Pelungsur Python Kate +Name[nb]=Pythonleser-programtillegg til Kate +Name[nds]=Python-Kiekermoduul för Kate +Name[ne]=केट पाइथन ब्राउजर प्लगइन +Name[nn]=Kate-programtillegg for Python-oversikt +Name[pa]=ਕੇਟ ਪਾਈਥਨ ਝਲਕਾਰਾ ਪਲੱਗਇਨ +Name[pl]=Wtyczka przeglądarki do Pythona do Kate +Name[pt]='Plugin' de Navegação no Python do Kate +Name[pt_BR]=Plug-in de Navegação Python do Kate +Name[ro]=Modul Kate de navigare Python +Name[ru]=Модуль просмотра программ на Python для Kate +Name[sk]=Modul Kate Python prehliadača +Name[sl]=Vstavek za brskanje po Pythonu v Kate +Name[sr]=Прикључак прегледача Python-а за Kate +Name[sr@Latn]=Priključak pregledača Python-a za Kate +Name[sv]=Kates Python-bläddrarinsticksprogram +Name[ta]=கேட் பைதான் உலாவி சொருகுப்பொருள் +Name[tg]=Модули аз назар гузаронидани барнома ба Python барои Kate +Name[th]=ปลั๊กอินบราวเซอร์ไพธอนของ Kate +Name[tr]=Kate Python Tarayıcı Eklentisi +Name[uk]=Втулок навігації Python для Kate +Name[uz]=Kate Python brauzer plagini +Name[uz@cyrillic]=Kate Python браузер плагини +Name[vi]=Bổ sung duyệt Python Kate +Name[xh]=IPython ye Kate yokukhangela iplagi yangaphakathi +Name[zh_CN]=Kate Python 浏览器插件 +Name[zh_TW]=Kate Python 瀏覽外掛程式 +Comment=A Python browser plugin for Kate +Comment[af]='n Python blaaier inplak vir Kate +Comment[ar]=ملحق متصفح Python لـKate +Comment[az]=Kate üçün Python səyyah əlavəsi +Comment[bg]=Приставка за разглеждане на класовете и методите на програми на Питон +Comment[bs]=Python browser plugin za Kate +Comment[ca]=Un connector per a Kate per a navegar dins del codi Python +Comment[cs]=Modul Python prohlížeče pro Kate +Comment[cy]=Ategyn porydd Python am Kate +Comment[da]=Et Pythonlæser-plugin for Kate +Comment[de]=Ein Browser-Modul für Python +Comment[el]=Ένα πρόσθετο περιηγητή Python για το Kate +Comment[eo]=Pitona foliumila kromaĵo por Kodredaktilo +Comment[es]=Un complemento de un navegador Python para Kate +Comment[et]=Pythoni brauseri plugin Kate jaoks +Comment[eu]=Python-en arakatzaile plugina Katerentzat +Comment[fa]=وصلۀ مرورگر Python برای Kate +Comment[fi]=Python selainsovelma Katelle +Comment[fo]=Ein Python-kagari-ístingur til Kate. +Comment[fr]=Un module externe de navigateur en Python pour Kate +Comment[fy]=In Pyton-blêderplugin foar Kate +Comment[ga]=Breiseán brabhsála Python le haghaidh Kate +Comment[gl]=Un plugin de navegación por Python para Kate +Comment[he]=תוסף דפדפן Python ל־Kate +Comment[hi]=के-एटीई के लिए पायथन ब्राउज़र प्लगइन +Comment[hr]=Python preglednički dodatak za Kate +Comment[hu]=Python-böngésző bővítőmodul a Kate-hez +Comment[is]=Python flakk viðbætur fyrir Kate +Comment[it]=Un plugin di visualizzazione di Python per Kate +Comment[ja]=Kate の Python ブラウザプラグイン +Comment[ka]=პითონის ბრაუზერის მოდული Kate-სთვის +Comment[kk]=Python бағдарламаларды көрсету Kate-тің плагин модулі +Comment[km]=កម្មវិធី​ជំនួយ​​របស់​កម្មវិធី​រុករក Python សម្រាប់ Kate +Comment[lt]=Python naršyklės priedas, skirtas Kate +Comment[mk]=Приклучок за пребарувач на Python во Кате +Comment[ms]=Plug masuk Pelungsur Python Kate +Comment[nb]=Et programtillegg for Pythonleseren til Kate +Comment[nds]=En Python-Kiekermoduul för Kate +Comment[ne]=केटका लागि एउटा पाइथन ब्राउजर प्लगइन +Comment[nl]=Een Python-browserplugin voor Kate +Comment[nn]=Ei Python-oversikt til Kate +Comment[pa]=ਕੇਟ ਲਈ ਪਾਈਥਨ ਝਲਕਾਰਾ ਪਲੱਗਇਨ +Comment[pl]=Wtyczka przeglądarki Pythona do Kate +Comment[pt]=Um 'plugin' de navegação no Python para o Kate +Comment[pt_BR]=Um Plugin de navegação Python para o Kate +Comment[ro]=Un modul de navigare Python pentru Kate +Comment[ru]=Модуль просмотра программ на Python для Kate +Comment[sk]=Python modul prehliadača pre Kate +Comment[sl]=Vstavek za brskanje po Pythonu v Kate +Comment[sr]=Прикључак прегледача Python-а за Kate +Comment[sr@Latn]=Priključak pregledača Python-a za Kate +Comment[sv]=Python-bläddrarinsticksprogram för Kate +Comment[ta]=கேட்-டுக்கான பைதான் உலாவி சொருகுப்பொருள் +Comment[tg]=Модули аз назар гузаронидани барнома ба Python барои Kate +Comment[th]=ปลั๊กอินบราวเซอร์ไพธอนสำหรับ Kate +Comment[tr]=Kate için Python tarayıcı programı +Comment[uk]=Втулок навігації Python для Kate +Comment[uz]=Kate uchun Python brauzer vositasi +Comment[uz@cyrillic]=Kate учун Python браузер воситаси +Comment[vi]=Bổ sung duyệt Python cho Kate +Comment[xh]=Isijongi se Python yeplagi yangaphakathi se Kate +Comment[zh_CN]=为 Kate 提供的 Python 浏览器插件 +Comment[zh_TW]=Kate 的 Python 瀏覽外掛程式 diff --git a/kate/kpybrowser/kpybrowser.cpp b/kate/kpybrowser/kpybrowser.cpp new file mode 100644 index 0000000..9023e65 --- /dev/null +++ b/kate/kpybrowser/kpybrowser.cpp @@ -0,0 +1,397 @@ +/*************************************************************************** + kpybrowser.cpp - description + ------------------- + begin : Fri Aug 24 15:11:58 MST 2001 + copyright : (C) 2001 by Christian Bird + email : chrisb@lineo.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "kpybrowser.h" +#include +#include +#include +#include + +#include "kpybrowser.moc" + +#include + +static const char *container_xpm[] = { + "16 16 119 2", + " c None", + ". c #020202", + "+ c #484848", + "@ c #141414", + "# c #CBCBCB", + "$ c #E9E9E9", + "% c #2F2F2F", + "& c #3E3E3E", + "* c #006B9E", + "= c #003D5A", + "- c #757575", + "; c #A4A4A4", + "> c #727272", + ", c #282828", + "' c #C1E1ED", + ") c #D3EDF6", + "! c #79BFD6", + "~ c #E4E4E4", + "{ c #202121", + "] c #3CB9ED", + "^ c #3AA3C5", + "/ c #77BCD6", + "( c #82C3D9", + "_ c #0873A5", + ": c #003C5B", + "< c #464646", + "[ c #1E1E1E", + "} c #19AFEE", + "| c #0787B6", + "1 c #38A2C5", + "2 c #5DB1D0", + "3 c #76BBD5", + "4 c #81C2D8", + "5 c #85C4D9", + "6 c #0770A1", + "7 c #4F4F4F", + "8 c #169ACB", + "9 c #106CA1", + "0 c #127CAD", + "a c #0784B2", + "b c #56B0CD", + "c c #72B9D4", + "d c #91C9DB", + "e c #3F3F3F", + "f c #2B2B2B", + "g c #1380B2", + "h c #0B5482", + "i c #0E5E91", + "j c #0E6597", + "k c #116FA0", + "l c #127FB1", + "m c #58AECD", + "n c #70B8D3", + "o c #454545", + "p c #FCFCFC", + "q c #E9E4E4", + "r c #8AA9B9", + "s c #296C8E", + "t c #0E5C8D", + "u c #0F6698", + "v c #1175A4", + "w c #404040", + "x c #444444", + "y c #F6F6F6", + "z c #F1F1F1", + "A c #EBEBEB", + "B c #EAEAEA", + "C c #DBD7D6", + "D c #81A0B0", + "E c #286C8F", + "F c #0F6596", + "G c #1172A4", + "H c #57A1C0", + "I c #424242", + "J c #EEEEEE", + "K c #E6E6E6", + "L c #E1E1E1", + "M c #DCDCDC", + "N c #D5D5D5", + "O c #D7D7D7", + "P c #CBC9C8", + "Q c #88A6B5", + "R c #276C8C", + "S c #276892", + "T c #363636", + "U c #C4C4C4", + "V c #DFDFDF", + "W c #DEDEDE", + "X c #DBDBDB", + "Y c #D6D6D6", + "Z c #D1D1D1", + "` c #CCCCCC", + " . c #C5C5C5", + ".. c #BFBFBF", + "+. c #C1BEBE", + "@. c #6E6D6D", + "#. c #686868", + "$. c #C0C0C0", + "%. c #CECECE", + "&. c #CACACA", + "*. c #C6C6C6", + "=. c #BBBBBB", + "-. c #B6B6B6", + ";. c #AEAEAE", + ">. c #323232", + ",. c #606060", + "'. c #AFAFAF", + "). c #B5B5B5", + "!. c #B0B0B0", + "~. c #AAAAAA", + "{. c #6C6B6B", + "]. c #2E2E2E", + "^. c #585858", + "/. c #9D9D9D", + "(. c #A7A7A7", + "_. c #6A6969", + ":. c #393939", + "<. c #292929", + "[. c #3A3835", + " . + ", + " @ # $ + + % ", + " & * = - ; # $ + . + > . ", + " , ' ) ! * = - ; # ~ $ $ . ", + " { ] ^ / ' ) ( _ : - ; # $ < ", + " [ } | 1 2 3 4 ' ) 5 6 = - 7 ", + " [ 8 9 0 a | 1 b c d ' ) ! e ", + " f g h i j k l | | 1 m n ' e ", + " o p q r s h t u v 0 | | n w ", + " x y z A B C D E h i F G H w ", + " I J B K L M N O P Q R h S w ", + " T U V W X Y Z ` ... .+.@.o ", + " . T #.$.%.&.*.$.=.-.;.@.< ", + " . >.,.'.=.).!.~.{.o ", + " . ].^./.(._.:.", + " . <.[. " +}; + +void +getOpenNodes (QValueList < QString > *open_nodes, PyBrowseNode * node) +{ + if (node == NULL) + return; + if (node->isOpen ()) + { + open_nodes->append (node->getQualifiedName ()); + } + + getOpenNodes (open_nodes, + dynamic_cast < PyBrowseNode * >(node->firstChild ())); + getOpenNodes (open_nodes, + dynamic_cast < PyBrowseNode * >(node->nextSibling ())); +} + + +KPyBrowser::KPyBrowser (QWidget * parent, const char *name): +KListView (parent, name) +{ + + addColumn(i18n("Name")); + header ()->hide (); + class_root = + new PyBrowseNode (this, QString ("Classes"), i18n("Classes"), + PYOTHER); + class_root->setPixmap (0, QPixmap (container_xpm)); + function_root = + new PyBrowseNode (this, QString ("Globals"), i18n("Globals"), + PYOTHER); + function_root->setPixmap (0, QPixmap (container_xpm)); + setRootIsDecorated (1); + connect (this, SIGNAL (executed (QListViewItem *)), this, + SLOT (nodeSelected (QListViewItem *))); + setTooltipColumn (1); + setShowToolTips (1); + tooltip = new KPBToolTip (this); +} + +KPyBrowser::~KPyBrowser () +{ +} + +void +KPyBrowser::nodeSelected (QListViewItem * node) +{ + PyBrowseNode *browse_node = dynamic_cast < PyBrowseNode * >(node); + + if (!browse_node) + { + return; + } + + QString method_name; + int line_no; + + line_no = browse_node->getLine(); + method_name = browse_node->getName(); + if (browse_node->getType () == PYCLASS) + { + method_name = QString ("class ") + browse_node->getName (); + } + else if (browse_node->getType () == PYMETHOD + || browse_node->getType () == PYFUNCTION) + { + method_name = QString ("def ") + browse_node->getName (); + } + emit selected(method_name, line_no); +} + +void +KPyBrowser::parseText (QString & pytext) +{ + QRegExp class_rx (QString ("^class [a-zA-Z0-9_,\\s\\(\\).]+:")); + QRegExp function_rx (QString ("^def [a-zA-Z_]+[^#]*:")); + QRegExp method_rx (QString ("[\\s]+def [a-zA-Z_]+[^#]*:")); + + int paren_i; + QStringList lines = QStringList::split ("\n", pytext, TRUE); + QStringList::Iterator iter; + QString *line; + QString class_name, method_name, function_name, class_sig, method_sig, + function_sig; + PyBrowseNode *last_class_node = NULL; + PyBrowseNode *last_method_node = NULL; + PyBrowseNode *last_function_node = NULL; + + QValueList < QString > open_nodes; + getOpenNodes (&open_nodes, class_root); + getOpenNodes (&open_nodes, function_root); + + + int line_no, state = 0; + + if (class_root != NULL) + { + delete class_root; + } + if (function_root != NULL) + { + delete function_root; + } + class_root = + new PyBrowseNode (this, QString ("Classes"), i18n("Classes"), + PYOTHER); + class_root->setPixmap (0, QPixmap (container_xpm)); + function_root = + new PyBrowseNode (this, QString ("Globals"), i18n("Globals"), + PYOTHER); + function_root->setPixmap (0, QPixmap (container_xpm)); + node_dict.insert (class_root->getQualifiedName (), class_root); + node_dict.insert (function_root->getQualifiedName (), function_root); + + + line_no = 0; + + for (iter = lines.begin(); iter != lines.end(); ++iter) + { + line_no++; + line = &(*iter); + if (class_rx.search(*line) >= 0) + { + //KMessageBox::information(this, *line, QString("Found class on line %1").arg(line_no)); + //strip out the beginning class and ending colon + class_sig = line->stripWhiteSpace ().mid (6); + class_sig = class_sig.left (class_sig.length () - 1); + paren_i = class_sig.find ("("); + class_name = class_sig.left (paren_i); + + last_class_node = + new PyBrowseNode (class_root, class_name, class_sig, PYCLASS); + last_class_node->setLine (line_no); + last_class_node->setClass (class_name); + node_dict.insert (last_class_node->getQualifiedName (), + last_class_node); + state = 1; + } + if ((method_rx.search(*line) >= 0) && (state == 1)) + { + //strip off the leading def and the ending colon + method_sig = line->stripWhiteSpace ().mid (4); + method_sig = method_sig.left (method_sig.find (":")); + paren_i = method_sig.find ("("); + method_name = method_sig.left (paren_i); + last_method_node = + new PyBrowseNode (last_class_node, method_name, method_sig, + PYMETHOD); + last_method_node->setLine (line_no); + last_method_node->setClass (last_class_node->getClass ()); + node_dict.insert (last_method_node->getQualifiedName (), + last_method_node); + } + if ((function_rx.search(*line) >= 0)) + { + //KMessageBox::information(this, *line, QString("Found function on line %1").arg(line_no)); + function_sig = line->stripWhiteSpace ().mid (4); + function_sig = function_sig.left (function_sig.find (":")); + paren_i = function_sig.find ("("); + function_name = function_sig.left (paren_i); + last_function_node = + new PyBrowseNode (function_root, function_name, function_sig, + PYFUNCTION); + last_function_node->setLine (line_no); + node_dict.insert (last_function_node->getQualifiedName (), + last_function_node); + state = 0; + } + } + + //now go through the list of old open nodes and open them in the new + //tree. For each node name in the open_nodes list, attempt to find that + //node and in the new dict and open it. + QValueList::iterator it; + PyBrowseNode *tmp_node; + for (it=open_nodes.begin(); it != open_nodes.end(); ++it) + { + tmp_node = node_dict[(*it)]; + if (tmp_node) + { + tmp_node->setOpen(1); + } + } + +} + + +void +KPyBrowser::tip (const QPoint & p, QRect & r, QString & str) +{ + QListViewItem *item = (QListViewItem *) itemAt (p); + if (item == NULL) + { + str = ""; + return; + } + r = itemRect (item); + //r.setY(r.y() + 10); + + PyBrowseNode *browse_node = dynamic_cast < PyBrowseNode * >(item); + + if (browse_node) + { + if (r.isValid ()) + str = browse_node->getSig (); + else + str = ""; + } + else + { + str = item->text (0); + } +} + +///////////////////////////////////////////////////////////////////// +// KateFileList::KFLToolTip implementation + +KPyBrowser::KPBToolTip::KPBToolTip (QWidget * parent):QToolTip (parent) +{ +} + +void +KPyBrowser::KPBToolTip::maybeTip (const QPoint & p) +{ + QString str; + QRect r; + + ((KPyBrowser *) parentWidget ())->tip (p, r, str); + + if (!str.isEmpty () && r.isValid ()) + tip (r, str); +} diff --git a/kate/kpybrowser/kpybrowser.desktop b/kate/kpybrowser/kpybrowser.desktop new file mode 100644 index 0000000..c045dfc --- /dev/null +++ b/kate/kpybrowser/kpybrowser.desktop @@ -0,0 +1,18 @@ +# KDE Config File +[Desktop Entry] +Type=Application +Exec=kpybrowser -caption "%c" %i %m +Icon=kpybrowser +Comment= +Terminal=false +Name=KPyBrowser +Name[cy]=KPyPorydd +Name[eo]=KPyFoliumilo +Name[fo]=KPyKagari +Name[fy]=KPyBlêder +Name[hi]=के-पीवाय-ब्राउज़र +Name[ne]=केपीवाई ब्राउजर +Name[sv]=Python-bläddrare +Name[ta]=KPyஉலாவி +Name[th]=บราวเซอร์ไพธอน +Name[tr]=KPy Tarayıcı diff --git a/kate/kpybrowser/kpybrowser.h b/kate/kpybrowser/kpybrowser.h new file mode 100644 index 0000000..ae49d3c --- /dev/null +++ b/kate/kpybrowser/kpybrowser.h @@ -0,0 +1,69 @@ +/*************************************************************************** + kpybrowser.h - description + ------------------- + begin : Fri Aug 24 15:11:58 MST 2001 + copyright : (C) 2001 by Christian Bird + email : chrisb@lineo.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KPYBROWSER_H +#define KPYBROWSER_H + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include +#include +#include +#include +#include "pybrowsenode.h" + + +/** KPyBrowser is the base class of the project */ +class KPyBrowser : public KListView +{ + Q_OBJECT + public: + /** construtor */ + KPyBrowser(QWidget* parent=0, const char *name=0); + /** destructor */ + ~KPyBrowser(); + void parseText(QString &pytext); + + //used by KPBToolTip to dynamically create the needed tooltip + void tip (const QPoint &p, QRect &r, QString &str); + + private: + PyBrowseNode *class_root, *function_root; + + //create a mapping of names to nodes + QDict node_dict; + + public slots: + void nodeSelected(QListViewItem *node); + signals: + void selected(QString, int); + private: + class KPBToolTip : public QToolTip + { + public: + KPBToolTip(QWidget *parent); + protected: + void maybeTip( const QPoint & ); + }; + KPBToolTip* tooltip; +}; + +#endif diff --git a/kate/kpybrowser/pybrowse.xpm b/kate/kpybrowser/pybrowse.xpm new file mode 100644 index 0000000..dc0b4c5 --- /dev/null +++ b/kate/kpybrowser/pybrowse.xpm @@ -0,0 +1,495 @@ +#ifndef PYBROWSE_XPM + +static const char * pybrowse_xpm[] = { +"34 34 454 2", +" c None", +". c #90826F", +"+ c #8D7F6C", +"@ c #897C6A", +"# c #857968", +"$ c #817666", +"% c #7D7364", +"& c #7A7062", +"* c #766D60", +"= c #726A5D", +"- c #6E675B", +"; c #6B6459", +"> c #676157", +", c #635E55", +"' c #5F5B53", +") c #5B5851", +"! c #848484", +"~ c #8E816D", +"{ c #C9C9C9", +"] c #C1C1C1", +"^ c #BABABA", +"/ c #ABAAAA", +"( c #8F8F8E", +"_ c #7B7B7A", +": c #616161", +"< c #8C7F6C", +"[ c #FFFFFF", +"} c #FEFEFE", +"| c #F8F8F8", +"1 c #EAEAE9", +"2 c #D1D1D1", +"3 c #A6A6A6", +"4 c #929292", +"5 c #000000", +"6 c #8A7D6B", +"7 c #FDFDFD", +"8 c #F5F5F5", +"9 c #E9E9E9", +"0 c #C3C2C2", +"a c #757575", +"b c #878787", +"c c #887B69", +"d c #DCDBD9", +"e c #FAFAFA", +"f c #ECECEC", +"g c #666666", +"h c #867968", +"i c #9D9D9D", +"j c #FBFBFB", +"k c #575757", +"l c #847867", +"m c #4E4E4E", +"n c #E0E0E0", +"o c #817665", +"p c #C6C6C6", +"q c #7F7464", +"r c #FCFCFC", +"s c #4D4D4D", +"t c #1A1A1A", +"u c #2B2B2B", +"v c #474747", +"w c #737373", +"x c #6A6A6A", +"y c #7D7263", +"z c #C8C8C8", +"A c #D9D8D6", +"B c #4D641F", +"C c #EEEEEE", +"D c #D6D5D3", +"E c #C0C0BB", +"F c #B5B3AC", +"G c #9D9A90", +"H c #837F7A", +"I c #726F6D", +"J c #5C5957", +"K c #656565", +"L c #7A6F60", +"M c #587421", +"N c #5E7D22", +"O c #5F7E22", +"P c #8EAA36", +"Q c #9AB646", +"R c #8AAE26", +"S c #728A2A", +"T c #96AE46", +"U c #869E52", +"V c #E8E8E8", +"W c #DEDEDE", +"X c #CECDCB", +"Y c #BCBCBA", +"Z c #AFAAA3", +"` c #8C8B81", +" . c #706C69", +".. c #494743", +"+. c #5E6A42", +"@. c #74902E", +"#. c #B2D252", +"$. c #729222", +"%. c #C6DE6A", +"&. c #F6FACE", +"*. c #BADA4E", +"=. c #6A8A26", +"-. c #E7EFB3", +";. c #A2C646", +">. c #CADE82", +",. c #9ABE42", +"'. c #F3F3F3", +"). c #E9E9E8", +"!. c #DBD9D6", +"~. c #CDCBC8", +"{. c #C5C0B3", +"]. c #ACA79F", +"^. c #89827B", +"/. c #312F2B", +"(. c #5D7C21", +"_. c #79952F", +":. c #AEC272", +"<. c #F2F5C6", +"[. c #5A761E", +"}. c #769626", +"|. c #96B24A", +"1. c #86AE22", +"2. c #B6D656", +"3. c #BEDA56", +"4. c #667E1A", +"5. c #8AAE36", +"6. c #86A632", +"7. c #E2EDA6", +"8. c #96B646", +"9. c #E2E0DD", +"0. c #EDEAE6", +"a. c #E8E5E1", +"b. c #E7E3DC", +"c. c #D3CFC9", +"d. c #C6C3BB", +"e. c #BBB6AD", +"f. c #928C81", +"g. c #5C7A21", +"h. c #718D28", +"i. c #A6C256", +"j. c #A2BA66", +"k. c #96BE26", +"l. c #72921E", +"m. c #565A32", +"n. c #B19549", +"o. c #926616", +"p. c #524616", +"q. c #D6E696", +"r. c #7EA226", +"s. c #769232", +"t. c #9ABE2A", +"u. c #7AA226", +"v. c #DBD6D1", +"w. c #E7E2DC", +"x. c #E8E2DA", +"y. c #E0DAD2", +"z. c #CFC9C1", +"A. c #CBC6BC", +"B. c #A1998D", +"C. c #5B7921", +"D. c #B2CE62", +"E. c #9ABE36", +"F. c #A6BE62", +"G. c #AECA56", +"H. c #4A4E16", +"I. c #E1DEB0", +"J. c #7A6E2A", +"K. c #966E16", +"L. c #4E6A1E", +"M. c #6A862E", +"N. c #8AA636", +"O. c #7A9A1E", +"P. c #C2D676", +"Q. c #CEE672", +"R. c #C2D286", +"S. c #A2C63A", +"T. c #729A2A", +"U. c #627A1E", +"V. c #525B40", +"W. c #D9D4CB", +"X. c #DED6CB", +"Y. c #CAC3B5", +"Z. c #A99F8D", +"`. c #96BA3E", +" + c #26320E", +".+ c #3E4E1A", +"++ c #D2E68A", +"@+ c #9EBE46", +"#+ c #96AE56", +"$+ c #CEE282", +"%+ c #423E0E", +"&+ c #96C226", +"*+ c #C6E262", +"=+ c #829652", +"-+ c #AEBA82", +";+ c #8EBA2A", +">+ c #AAD226", +",+ c #628222", +"'+ c #A2CE26", +")+ c #5A6A42", +"!+ c #C8C1B8", +"~+ c #D1C8BA", +"{+ c #AEA18E", +"]+ c #AECA62", +"^+ c #A6C646", +"/+ c #9AAA66", +"(+ c #BEDA62", +"_+ c #6A862A", +":+ c #9AB64E", +"<+ c #628622", +"[+ c #628626", +"}+ c #CEE284", +"|+ c #EEF2BA", +"1+ c #9EC62A", +"2+ c #7A9E22", +"3+ c #8AB22A", +"4+ c #7A9A22", +"5+ c #4B621A", +"6+ c #D2CABD", +"7+ c #989898", +"8+ c #E6DBCC", +"9+ c #DBD1C0", +"0+ c #B4A791", +"a+ c #597622", +"b+ c #82A23A", +"c+ c #AAC65A", +"d+ c #CAE27A", +"e+ c #9EB65A", +"f+ c #86A23A", +"g+ c #F1F4C5", +"h+ c #EAF2B6", +"i+ c #9EBE52", +"j+ c #AABE6E", +"k+ c #96B63A", +"l+ c #AAD22E", +"m+ c #A2B652", +"n+ c #8EAE2E", +"o+ c #6A8E26", +"p+ c #6A8E22", +"q+ c #92B626", +"r+ c #769A26", +"s+ c #627E1E", +"t+ c #9ECA2A", +"u+ c #7A924A", +"v+ c #C2B9AC", +"w+ c #DDD2C3", +"x+ c #E4D8C6", +"y+ c #DCD1BC", +"z+ c #B5A58E", +"A+ c #4D651B", +"B+ c #A6C642", +"C+ c #82A222", +"D+ c #F2F6C2", +"E+ c #526222", +"F+ c #BEDA5A", +"G+ c #42561A", +"H+ c #A6CE26", +"I+ c #5E8226", +"J+ c #668E26", +"K+ c #4A611A", +"L+ c #BDB2A3", +"M+ c #D6CBB8", +"N+ c #E3D7C2", +"O+ c #DED0BB", +"P+ c #B4A48B", +"Q+ c #4B631A", +"R+ c #4A621A", +"S+ c #4E661E", +"T+ c #66821E", +"U+ c #5E7226", +"V+ c #586826", +"W+ c #576923", +"X+ c #92BA26", +"Y+ c #729A26", +"Z+ c #5E761A", +"`+ c #92BA2A", +" @ c #6E9626", +".@ c #465E1A", +"+@ c #7EA222", +"@@ c #7A9E26", +"#@ c #82AA26", +"$@ c #4A601A", +"%@ c #E1D4BD", +"&@ c #E6D6BD", +"*@ c #B8A58B", +"=@ c #526921", +"-@ c #6A8636", +";@ c #56721E", +">@ c #627A1A", +",@ c #425216", +"'@ c #9EC626", +")@ c #6E962A", +"!@ c #AAD22A", +"~@ c #627E22", +"{@ c #8AB62A", +"]@ c #7EA626", +"^@ c #52662A", +"/@ c #939393", +"(@ c #E4D4B9", +"_@ c #B8A387", +":@ c #525E3A", +"<@ c #5A7622", +"[@ c #4A621E", +"}@ c #6E922A", +"|@ c #526A22", +"1@ c #465A26", +"2@ c #5E7E22", +"3@ c #9ABE26", +"4@ c #7B7B7B", +"5@ c #D2C2A7", +"6@ c #E2D1B3", +"7@ c #BEA989", +"8@ c #555047", +"9@ c #A5A5A5", +"0@ c #CACACA", +"a@ c #C5C5C4", +"b@ c #C4C3C0", +"c@ c #C4C1BE", +"d@ c #C3C0BA", +"e@ c #C2BDB6", +"f@ c #465A1A", +"g@ c #729622", +"h@ c #AED626", +"i@ c #5A6E32", +"j@ c #CCBB9F", +"k@ c #DECBAC", +"l@ c #BCA683", +"m@ c #5C564D", +"n@ c #BCBCBC", +"o@ c #EBEBEB", +"p@ c #E6E4E1", +"q@ c #E5E1DD", +"r@ c #E4DFDA", +"s@ c #E3DED5", +"t@ c #E0DBD3", +"u@ c #D8D1C7", +"v@ c #C8C1B6", +"w@ c #BEB6AB", +"x@ c #769A22", +"y@ c #82A62A", +"z@ c #BEAC92", +"A@ c #D7C4A6", +"B@ c #BAA27F", +"C@ c #5C564E", +"D@ c #C7C7C7", +"E@ c #FAF8F7", +"F@ c #F7F3EE", +"G@ c #F6F1EB", +"H@ c #F5EEE6", +"I@ c #F2EDE3", +"J@ c #F1EADE", +"K@ c #ECE3D7", +"L@ c #E2D9CB", +"M@ c #DDD3C4", +"N@ c #D2C7B7", +"O@ c #516822", +"P@ c #D4E398", +"Q@ c #526A1A", +"R@ c #7A9622", +"S@ c #5A7A22", +"T@ c #A2CA26", +"U@ c #6E8E1E", +"V@ c #B6A389", +"W@ c #D3BD9C", +"X@ c #BBA27F", +"Y@ c #5A554D", +"Z@ c #FBF8F6", +"`@ c #F8F4ED", +" # c #F7F1E8", +".# c #F5EFE6", +"+# c #F4EDE1", +"@# c #F3EADE", +"## c #F1E7D8", +"$# c #EFE4D2", +"%# c #EDE2CE", +"&# c #E5D8C4", +"*# c #506722", +"=# c #567222", +"-# c #B3A083", +";# c #CFB998", +"># c #BCA17A", +",# c #58544C", +"'# c #F9F5F0", +")# c #F3EBDC", +"!# c #F2E8D9", +"~# c #F1E6D4", +"{# c #F0E5D1", +"]# c #EFE1CC", +"^# c #EBDBC4", +"/# c #D5E29D", +"(# c #668A22", +"_# c #B29D7F", +":# c #CFB590", +"<# c #BBA077", +"[# c #56524B", +"}# c #F8F3EB", +"|# c #F5EEE4", +"1# c #F0E2CF", +"2# c #EFE2CC", +"3# c #EEDEC7", +"4# c #EAD9C1", +"5# c #769E26", +"6# c #B29C7F", +"7# c #BB9C73", +"8# c #545049", +"9# c #F3EADC", +"0# c #F2E8D7", +"a# c #ECDAC1", +"b# c #596E2D", +"c# c #C0DC62", +"d# c #6A8242", +"e# c #B39E80", +"f# c #D0B691", +"g# c #B99D6F", +"h# c #524E48", +"i# c #F2EEE6", +"j# c #F2EADE", +"k# c #EEEADE", +"l# c #EEE6DA", +"m# c #F2E2CE", +"n# c #EEE2CE", +"o# c #EAE2D2", +"p# c #EEDECA", +"q# c #E8D8C0", +"r# c #6A8A22", +"s# c #96C222", +"t# c #A79275", +"u# c #BBA382", +"v# c #D3B994", +"w# c #BA9A6C", +"x# c #504C47", +"y# c #C6C2B6", +"z# c #C8C1B7", +"A# c #C7BFB4", +"B# c #C6BBAB", +"C# c #C6B9A9", +"D# c #C6B8A3", +"E# c #C5B7A0", +"F# c #C4B49D", +"G# c #C4B299", +"H# c #C3B296", +"I# c #C3AE92", +"J# c #C4AD8F", +"K# c #C2AB8B", +"L# c #C1AA86", +"M# c #C0A583", +"N# c #BEA481", +"O# c #BFA37C", +"P# c #BEA279", +"Q# c #BE9E75", +"R# c #BC9F71", +"S# c #BC9C6D", +"T# c #9C7F55", +"U# c #4E4B46", +" . + @ # $ % & * = - ; > , ' ) ! ", +" ~ { { { { { { { { { ] ^ / ( _ ! : ", +" < { [ [ [ [ [ [ [ [ } | 1 2 3 ! 4 5 ", +" 6 { [ [ [ [ [ [ [ [ } 7 8 9 0 a { b 5 ", +" c { [ d 5 [ [ [ d 5 } [ [ e f g [ { b 5 ", +" h { [ 5 i [ [ 5 i [ [ [ j k [ [ { b 5 ", +" l { [ [ i [ [ [ [ i } [ [ [ [ m n [ [ { b 5 ", +" o { [ [ [ [ [ [ [ [ } [ [ [ [ m p n [ [ { 4 : ", +" q { [ [ } 7 7 r r 7 r } [ [ [ s t t u v : w x ! ", +" y z 7 A B B B B B B C | 7 } [ C D E F G H I J K ", +" L M N O P Q R S T U O O C | 7 7 V W X Y Z ` ... ", +" +.@.#.$.%.&.*.=.-.;.>.,.O O C '.f ).!.~.{.].^./. ", +" (.N (._.:.<.[.}.|.1.2.3.4.5.6.7.8.O 9.0.a.b.c.d.e.f./. ", +" (.(.g.h.i.j.k.l.m.n.o.p.}.q.<.r.2.2.s.t.u.O v.w.x.y.z.A.B./. ", +"C.(.D.D.;.<.E.F.<.G.H.I.J.K.L.M.N.O.P.Q.R.S.T.U.V.W.D 5 X.Y.Z./. ", +"(.`. +.+P ++@+#+$+2.H.%+ +H.O.&+*+R =+-+;+>+,+'+)+!+5 i ~+{+/. ", +"B ]+i.`.^+/+<.(+_+:+s.H.H.<+[+}+<.(+#+|+1+2+3+,+4+5+6+7+8+9+0+/. ", +" a+b+c+d+e+>.f+g+h+i+j+k+%.g+l+m+n+o+p+q+$.r+s+t+u+v+w+x+y+z+/. ", +" A+k.<.B+4+C+f+d+$+]+D+>.E+F+1+G+H+q+I+H+H+J+q+t+K+L+M+N+O+P+/. ", +" Q+O.[.R+R+S+T+E+U+V+W+O.l.X+Y+Z+Y+L.`+ @.@+@@@#@$@5 %@&@*@/. ", +" 5+=@&+-@&+;@&+r+>@;@,@'@Y+4+1.)@!@~@{@]@.+u.^@ /@(@_@/. ", +" 5+>@>@:@<@[@}@~@|@1@2@2@S+[.3@k.s+'@B 4@5@6@7@/. ", +" 8@9@0@a@b@c@d@e@f@f@f@R g@h@I+I+s+#@i@5+j@k@l@/. ", +" m@n@o@p@q@r@s@t@u@v@w@i@f@g@Z+h@x@y@2@f@z@A@B@/. ", +" C@D@E@F@G@H@I@J@K@L@M@N@O@P@Q@R@S@T@U@f@V@W@X@/. ", +" Y@{ Z@`@ #.#+#@###$#%#&#*#o+R h@u.@@=#f@-#;#>#/. ", +" ,#{ '# #.#+#)#!#~#{#]#^#*#/#(#2+C+h@ @f@_#:#<#/. ", +" [#{ }#|#+#)#!#~#1#2#3#4#*#}@<@r+J+5#=+f@6#:#7#/. ", +" 8#{ #+#9#0#~#1#]#3#a#b#5#c#g@h@]@}@d#B e#f#g#/. ", +" h#{ i#j#k#l#m#n#o#p#q#*#&+r#u.]@3+s#B t#u#v#w#/. ", +" x#y#z#A#B#C#D#E#F#G#H#I#J#K#L#M#N#O#P#Q#R#S#T#/. ", +" U#/././././././././././././././././././././././. ", +" ", +" "}; + +#endif + diff --git a/kate/kpybrowser/pybrowse_part.cpp b/kate/kpybrowser/pybrowse_part.cpp new file mode 100644 index 0000000..d8b7551 --- /dev/null +++ b/kate/kpybrowser/pybrowse_part.cpp @@ -0,0 +1,157 @@ +/*************************************************************************** + pybrowse_part.cpp - description + ------------------- + begin : Tue Aug 28 2001 + copyright : (C) 2001 by Christian Bird + email : chrisb@lineo.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "pybrowse_part.h" +#include "pybrowse_part.moc" +#include "kpybrowser.h" +#include "pybrowse.xpm" + +#include +#include +#include +#include +#include +#include +#include + +K_EXPORT_COMPONENT_FACTORY( katepybrowseplugin, KGenericFactory( "katepybrowse" ) ) + +PluginViewPyBrowse::PluginViewPyBrowse (Kate::MainWindow *w) + : win (w) +{ + (void) new KAction ( i18n("Update Python Browser"), 0, this, + SLOT( slotUpdatePyBrowser() ), actionCollection(), + "python_update_pybrowse" ); + + //set up the menus + setInstance(new KInstance("kate")); + setXMLFile( "plugins/katepybrowse/ui.rc" ); + win->guiFactory()->addClient(this); + + //create a python head pixmap for the tab + QPixmap *py_pixmap = new QPixmap(pybrowse_xpm); + QImage py_image = py_pixmap->convertToImage().smoothScale(20, 20); + py_pixmap->convertFromImage(py_image); + + //create the browser and put it into a dockwidget using kate's tool view manager + + Kate::ToolViewManager *tool_view_manager = win->toolViewManager(); + my_dock = tool_view_manager->createToolView("kate_plugin_kpybrowser", Kate::ToolViewManager::Left, (*py_pixmap), i18n("Python Browser")); + kpybrowser = new KPyBrowser(my_dock, "kpybrowser"); + + connect(kpybrowser, SIGNAL(selected(QString, int)), this, SLOT(slotSelected(QString, int))); +} + +PluginViewPyBrowse::~PluginViewPyBrowse () +{ + win->guiFactory()->removeClient (this); + delete my_dock; +} + + +void PluginViewPyBrowse::slotSelected(QString name, int line) +{ + //TO DO - deal with setting the active view to be the file that has this class + //if multiple files are open. + + if (name == "Classes" || name == "Globals") + return; + + Kate::View *view = win->viewManager()->activeView(); + + Kate::Document *doc = view->getDoc(); + QString docline = doc->textLine(line); + int numlines = doc->numLines(); + int done = 0, apiline = -1, forward_line = line,backward_line = line-1; + while (!done) + { + done = 1; + if (forward_line < numlines) + { + if (doc->textLine(forward_line).find(name) > -1) + { + apiline = forward_line; + break; + } + forward_line++; + done = 0; + } + if (backward_line > -1) + { + if (doc->textLine(backward_line).find(name) > -1) + { + apiline = backward_line; + break; + } + backward_line--; + done = 0; + } + } + if (apiline == -1) + { + KMessageBox::information(0, + i18n("Could not find method/class %1.").arg(name), i18n("Selection")); + } + else + { + view->setCursorPosition(apiline, 0); + } + view->setFocus(); +} + +void PluginViewPyBrowse::slotUpdatePyBrowser() +{ + Kate::ViewManager *viewManager = win->viewManager(); + if (viewManager == NULL) + return; + Kate::View *view = viewManager->activeView(); + if (view == NULL) + return; + QString pytext(view->getDoc()->text()); + kpybrowser->parseText(pytext); +} + +void PluginViewPyBrowse::slotShowPyBrowser() +{ + //TO DO implement this later so that you can turn the browser off and on +} + +KatePluginPyBrowse::KatePluginPyBrowse( QObject* parent, const char* name, const QStringList& ) + : Kate::Plugin ( (Kate::Application *)parent, name ) +{ +} + +KatePluginPyBrowse::~KatePluginPyBrowse() +{ +} + +void KatePluginPyBrowse::addView (Kate::MainWindow *win) +{ + PluginViewPyBrowse *view = new PluginViewPyBrowse(win); + m_views.append (view); +} + +void KatePluginPyBrowse::removeView(Kate::MainWindow *win) +{ + for (uint z=0; z < m_views.count(); z++) + if (m_views.at(z)->win == win) + { + PluginViewPyBrowse *view = m_views.at(z); + m_views.remove (view); + delete view; + } +} diff --git a/kate/kpybrowser/pybrowse_part.h b/kate/kpybrowser/pybrowse_part.h new file mode 100644 index 0000000..85aedbb --- /dev/null +++ b/kate/kpybrowser/pybrowse_part.h @@ -0,0 +1,72 @@ +/*************************************************************************** + pybrowse_part.h - description + ------------------- + begin : Tue Aug 28 2001 + copyright : (C) 2001 by Christian Bird + email : chrisb@lineo.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _PYBROWSE_PART_H_ +#define _PYBROWSE_PART_H_ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include "kpybrowser.h" + +class PluginViewPyBrowse : public QObject, KXMLGUIClient +{ + Q_OBJECT + + friend class KatePluginPyBrowse; + + public: + PluginViewPyBrowse (Kate::MainWindow *w); + ~PluginViewPyBrowse (); + + public slots: + void slotShowPyBrowser(); + void slotSelected(QString name, int line); + void slotUpdatePyBrowser(); + + private: + Kate::MainWindow *win; + QWidget *my_dock; + KPyBrowser *kpybrowser; +}; + +class KatePluginPyBrowse : public Kate::Plugin, public Kate::PluginViewInterface +{ + Q_OBJECT + + public: + KatePluginPyBrowse( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + ~KatePluginPyBrowse(); + + void addView(Kate::MainWindow *win); + void removeView(Kate::MainWindow *win); + + private: + QPtrList m_views; +}; + +#endif diff --git a/kate/kpybrowser/pybrowsenode.cpp b/kate/kpybrowser/pybrowsenode.cpp new file mode 100644 index 0000000..866924b --- /dev/null +++ b/kate/kpybrowser/pybrowsenode.cpp @@ -0,0 +1,209 @@ +/*************************************************************************** + pybrowsenode.cpp - description + ------------------- + begin : Mon Aug 27 2001 + copyright : (C) 2001 by Christian Bird + email : chrisb@lineo.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "pybrowsenode.h" + +static const char *py_class_xpm[] = { + "16 16 10 1", + " c None", + ". c #000000", + "+ c #A4E8FC", + "@ c #24D0FC", + "# c #001CD0", + "$ c #0080E8", + "% c #C0FFFF", + "& c #00FFFF", + "* c #008080", + "= c #00C0C0", + " .. ", + " .++.. ", + " .+++@@. ", + " .@@@@@#... ", + " .$$@@##.%%.. ", + " .$$$##.%%%&&. ", + " .$$$#.&&&&&*. ", + " ...#.==&&**. ", + " .++..===***. ", + " .+++@@.==**. ", + " .@@@@@#..=*. ", + " .$$@@##. .. ", + " .$$$###. ", + " .$$$##. ", + " ..$#. ", + " .. " +}; + +static const char *py_method_xpm[] = { + "16 16 5 1", + " c None", + ". c #000000", + "+ c #FCFC80", + "@ c #E0BC38", + "# c #F0DC5C", + " ", + " ", + " ", + " .. ", + " .++.. ", + " .+++++. ", + " .+++++@. ", + " .. .##++@@. ", + " .++..###@@@. ", + " .+++++.##@@. ", + " .+++++@..#@. ", + " .##++@@. .. ", + " .###@@@. ", + " .###@@. ", + " ..#@. ", + " .. " +}; + +static const char *py_function_xpm[] = { + "16 16 6 1", + " c None", + ". c #240000", + "+ c #000000", + "@ c #FCFC80", + "# c #E0BC38", + "$ c #F0DC5C", + " ........ ", + ". . ", + ". . ", + " ........ ++ ", + " +@@++ ", + " +@@@@@+ ", + " +@@@@@#+ ", + " ++ +$$@@##+ ", + " +@@++$$$###+ ", + " +@@@@@+$$##+ ", + " +@@@@@#++$#+ ", + " +$$@@##+ ++ ", + " +$$$###+ ", + " +$$$##+ ", + " ++$#+ ", + " ++ " +}; + + +PyBrowseNode::PyBrowseNode (QListViewItem * parent, const QString &name, + const QString &signature, int nodeType): +QListViewItem (parent, signature) +{ + init (name, signature, nodeType); +} + +PyBrowseNode::PyBrowseNode (QListView * parent, const QString &name, + const QString &signature, int nodeType): +QListViewItem (parent, signature) +{ + init (name, signature, nodeType); +} + +void +PyBrowseNode::init (const QString &a_name, const QString &a_signature, int nodeType) +{ + node_type = nodeType; + if (nodeType == PYCLASS) + setPixmap (0, QPixmap (py_class_xpm)); + if (nodeType == PYMETHOD) + setPixmap (0, QPixmap (py_method_xpm)); + if (nodeType == PYFUNCTION) + setPixmap (0, QPixmap (py_function_xpm)); + + name = a_name; + signature = a_signature; +} + +PyBrowseNode::~PyBrowseNode () +{ + setPixmap (0, QPixmap (py_class_xpm)); +} + +void +PyBrowseNode::setName (const QString &a_name) +{ + name = a_name; + setText (0, name); +} + +QString +PyBrowseNode::getName ()const +{ + return name; +} + +void +PyBrowseNode::setSig (const QString &a_signature) +{ + signature = a_signature; + +} + +QString +PyBrowseNode::getSig ()const +{ + return signature; +} + +void +PyBrowseNode::setLine (int a_line) +{ + line = a_line; +} + +int +PyBrowseNode::getLine ()const +{ + return line; +} + + +void +PyBrowseNode::setType (int type) +{ + node_type = type; +} + +int +PyBrowseNode::getType ()const +{ + return node_type; +} + +void +PyBrowseNode::setClass (const QString &a_method_class) +{ + node_class = a_method_class; +} + +QString +PyBrowseNode::getClass ()const +{ + return node_class; +} + +QString +PyBrowseNode::getQualifiedName ()const +{ + if (node_type == PYCLASS) + return node_class; + if (node_type == PYMETHOD) + return node_class + "::" + name; + if (node_type == PYFUNCTION) + return name; + return name; +} diff --git a/kate/kpybrowser/pybrowsenode.h b/kate/kpybrowser/pybrowsenode.h new file mode 100644 index 0000000..d5083f9 --- /dev/null +++ b/kate/kpybrowser/pybrowsenode.h @@ -0,0 +1,68 @@ +/*************************************************************************** + pybrowsenode.h - description + ------------------- + begin : Mon Aug 27 2001 + copyright : (C) 2001 by Christian Bird + email : chrisb@lineo.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef PYBROWSENODE_H +#define PYBROWSENODE_H + +#include +#include + +#define PYCLASS 1 +#define PYMETHOD 2 +#define PYFUNCTION 3 +#define PYVARIABLE 4 +#define PYOTHER 5 + +/** + *@author Christian Bird + */ + + + +class PyBrowseNode : public QListViewItem { +public: + QPixmap *pyClassPixmap; + + PyBrowseNode(QListView *parent, const QString &a_name, const QString &a_signature, int type); + PyBrowseNode(QListViewItem *parent, const QString &a_name, const QString &a_signature, int type); + ~PyBrowseNode(); + + void init(const QString &a_name, const QString &a_signature, int nodeType); + + void setName(const QString &name); + QString getName()const ; + void setLine(int line); + int getLine()const; + void setSig(const QString &signature); + QString getSig()const; + void setType(int type); + int getType()const; + void setClass(const QString &a_method_class); + QString getClass()const; + + QString getQualifiedName()const; + +private: + QString name; + QString signature; + QString node_class; + int line; + int node_type; + +}; + +#endif diff --git a/kate/kpybrowser/ui.rc b/kate/kpybrowser/ui.rc new file mode 100644 index 0000000..0c4e9ab --- /dev/null +++ b/kate/kpybrowser/ui.rc @@ -0,0 +1,8 @@ + + + + P&ython + + + + diff --git a/kate/make/Makefile.am b/kate/make/Makefile.am new file mode 100644 index 0000000..a110563 --- /dev/null +++ b/kate/make/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = katemakeplugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +katemakeplugin_la_SOURCES = plugin_katemake.cpp +katemakeplugin_la_LIBADD = -lkateinterfaces +katemakeplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +pluginsdir = $(kde_datadir)/kate/plugins/katemake +plugins_DATA = ui.rc + +kde_services_DATA = katemake.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katemake.pot diff --git a/kate/make/katemake.desktop b/kate/make/katemake.desktop new file mode 100644 index 0000000..9a996a0 --- /dev/null +++ b/kate/make/katemake.desktop @@ -0,0 +1,119 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katemakeplugin +X-Kate-Version=2.5 +Name=Kate Make Plugin +Name[ar]=ملحق Kate Make +Name[az]=Kate Make Əlavəsi +Name[br]=Lugent Kate Make +Name[ca]=Connector Make per a Kate +Name[cs]=Make modul pro Kate +Name[cy]=Ategyn Gwneud am Kate +Name[da]=Kate make-plugin +Name[de]=Kate Make-Modul +Name[el]=Πρόσθετο Make του Kate +Name[eo]=Make-a kromaĵo por Kodredaktilo +Name[es]=Crear complemento de Kate +Name[et]=Kate Make-plugin +Name[eu]=Kateren Make plugina +Name[fa]=وصلۀ ایجاد Kate +Name[fi]=Katen Make-liitännäinen +Name[fr]=Module Make pour Kate +Name[fy]=Kate Make-plugin +Name[ga]=Breiseán Make Kate +Name[gl]=Plugin de Make para Kate +Name[he]=תוסף Make ל־Kate +Name[hi]=के-एटीई मेक प्लगइन +Name[hr]=Kate Make dodatak +Name[hu]=Kate Make-bővítőmodul +Name[is]=Make íforrit fyrir Kate +Name[it]=Plugin di Kate per la compilazione +Name[ja]=Kate Make プラグイン +Name[ka]=Kate Make მოდული +Name[kk]=Kate Make плагин модулі +Name[km]=កម្មវិធី​ជំនួយ​របស់ Kate Make +Name[lt]=Kate Make priedas +Name[mk]=Make-приклучок во Кате +Name[ms]=Plug masuk Make Kate +Name[nb]=Kate programtillegg for Make +Name[nds]=Make-Moduul för Kate +Name[ne]=केट बनाउने प्लगइन +Name[nl]=Kate Make-plugin +Name[nn]=Kate Make-programtillegg +Name[pa]=ਕੇਟ Make ਪਲੱਗਇਨ +Name[pl]=Wtyczka Make dla Kate +Name[pt]='Plugin' de Make do Kate +Name[pt_BR]=Plugin de Make do Kate +Name[ro]=Modul "make" pentru Kate +Name[ru]=Модуль сборки для Kate +Name[sk]=Kate Make modul +Name[sl]=Vstavek za Make v Kate +Name[sr]=Справљачки прикључак за Kate +Name[sr@Latn]=Spravljački priključak za Kate +Name[sv]=Kates bygginsticksprogram +Name[ta]=கேட் உருவாக்க சொருகுப் பொருள் +Name[tg]=Модули пайвандҳо барои Kate +Name[tr]=Kate Yapılandırma Eklentisi +Name[uk]=Втулок Make для Kate +Name[uz]=Kate Make plagini +Name[uz@cyrillic]=Kate Make плагини +Name[vi]=Bổ sung Make Kate +Name[zh_CN]=Kate Make 插件 +Name[zh_TW]=Kate Make 外掛程式 +Comment=Compile and parse error messages +Comment[az]=Dərləyin və xəta ismarışlarını aşkar edin +Comment[bg]=Изпълнение на командата make и показване на резултата +Comment[bs]=Kompajlira i parsira poruke o greškama +Comment[ca]=Compila i analitza els missatges d'error +Comment[cs]=Chybové zprávy kompilace a analýzy +Comment[cy]=Negeseuon gwallau crynhoi a dosrannu +Comment[da]=Kompilér og fortolk fejlmeddelelser +Comment[de]=Kompilieren und Fehlermeldungen auswerten +Comment[el]=Μεταγλώττιση και ανάλυση μηνυμάτων λάθους +Comment[eo]=Kompilas kaj analizas erarajn mesaĝojn +Comment[es]=Compila y analiza los mensajes de error +Comment[et]=Veateadete kompileerimine ja analüüsimine +Comment[eu]=Konpilatu eta errore mezuak aztertu +Comment[fa]=ترجمه و تجزیۀ پیامهای خطا +Comment[fi]=Käännä ja jäsennä virheviestit +Comment[fr]=Compiler et analyser les messages d'erreurs +Comment[fy]=Foutmeldingen Kompilearje en Untlede +Comment[ga]=Tiomsaigh agus parsáil teachtaireachtaí earráide +Comment[gl]=Compilación e procesamento de mensaxes de erros +Comment[he]=קימפול ופענוח הודעות "שגיאות" +Comment[hi]=त्रुटि संदेशों को कम्पाइल तथा पारसे करता है +Comment[hr]=Sastavljanje i raščlanjivanje poruka o pogreškama +Comment[hu]=Programok fordítása a hibaüzenetek feldolgozásával +Comment[is]=Þýða kóða og þátta villumeldingar +Comment[it]=Compila e controlla i messaggi di errore +Comment[ja]=コンパイルしてエラーメッセージを解析します +Comment[ka]=კომპილაცია და შეცდომის შეტყობინებების ანალიზი +Comment[kk]=Компиляциялау және қате хабарларын талдау +Comment[km]=ចង​ក្រង ​និង​ញែក​សារ​កំហុស +Comment[lt]=Kompiliuoti ir išvesti klaidų pranešimus +Comment[mk]=Компилира и ги анализира пораките со грешки +Comment[ms]=Kompile dan mesej ralat huraian +Comment[nb]=Kompiler og tolk feilmeldinger +Comment[nds]=Kompileer- un Inleesfehlermellen +Comment[ne]=त्रुटि सन्देश कम्पाइल गर्नुहोस् र पदवर्णन गर्नुहोस् +Comment[nl]=Compileer en ontleed foutmeldingen +Comment[nn]=Kompiler og fortolk feilmeldingar +Comment[pa]=ਕੰਪਾਇਲ ਅਤੇ ਗਲਤੀ ਸੁਨੇਹੇ ਪਾਰਸ +Comment[pl]=Kompiluje i analizuje komunikaty o błędach +Comment[pt]=Compilação e processamento de mensagens de erros +Comment[pt_BR]=Compila e gera mensagens de erro +Comment[ro]=Compilează şi analizează mesajele de eroare +Comment[ru]=Сборка и обработка сообщений об ошибках +Comment[sk]=Kompilovať a parsovať chybové hlášky +Comment[sl]=Prevede in razčleni sporočila napak +Comment[sr]=Компилује и рашчлањује поруке о грешкама +Comment[sr@Latn]=Kompiluje i raščlanjuje poruke o greškama +Comment[sv]=Kompilera och tolka felmeddelanden +Comment[ta]= தொகுப்பு மற்றும் பாகுபடுத்தல் பிழை செய்திகள் +Comment[tg]=Васл ва коркарди маълумотҳо дар бораи хатогиҳо +Comment[tr]=Derleme ve ayrıştırma hataları +Comment[uk]=Компіляція і опрацювання повідомлень про помилки +Comment[vi]=Biên dịch và phân tách thông điệp lỗi +Comment[zh_CN]=编译并分析错误信息 +Comment[zh_TW]=編譯並剖析錯誤訊息 diff --git a/kate/make/plugin_katemake.cpp b/kate/make/plugin_katemake.cpp new file mode 100644 index 0000000..64282dd --- /dev/null +++ b/kate/make/plugin_katemake.cpp @@ -0,0 +1,736 @@ +/* plugin_katemake.h Kate Plugin +** +** Copyright (C) 2003 by Adriaan de Groot +** +** This is the hader for the Make plugin. +** +** This code was mostly copied from the GPL'ed xmlcheck plugin +** by Daniel Naber. +*/ + +/* +** This program is free software; you can redistribute it and/or modify +** it under the terms of the 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 in a file called COPYING; if not, write to +** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +** MA 02110-1301, USA. +*/ + +#include "plugin_katemake.moc" + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include + +K_EXPORT_COMPONENT_FACTORY( katemakeplugin, KGenericFactory( "katemake" ) ) + +// #define FUNCTIONSETUP kdDebug() << k_funcinfo << endl; +#define FUNCTIONSETUP + +PluginKateMake::PluginKateMake( QObject* parent, const char* name, const QStringList& ) + : Kate::Plugin ( (Kate::Application *)parent, name ) +{ + FUNCTIONSETUP; +} + + +PluginKateMake::~PluginKateMake() +{ + FUNCTIONSETUP; +} + + +void PluginKateMake::addView(Kate::MainWindow *win) +{ + FUNCTIONSETUP; + + Kate::ToolViewManager *viewmanager = win->toolViewManager(); + QWidget *w = viewmanager->createToolView("kate_plugin_make", + Kate::ToolViewManager::Bottom, + SmallIcon(QString::fromLatin1("misc")), + i18n("Make Output")); + PluginKateMakeView *view = new PluginKateMakeView (w,win, + "katemakeview"); + if( ! view ) { + kdDebug() << "Error: no plugin view" << endl; + return; + } + + if( ! win ) { + kdDebug() << "Error: no main win" << endl; + return; + } + + win->guiFactory()->addClient(view); + view->win = win; + m_views.append(view); +} + + +void PluginKateMake::removeView(Kate::MainWindow *win) +{ + FUNCTIONSETUP; + + for (unsigned int z=0; z < m_views.count(); z++) { + if (m_views.at(z)->win == win) { + PluginKateMakeView *view = m_views.at(z); + m_views.remove (view); + win->guiFactory()->removeClient (view); + } + } +} + +#define COL_LINE (1) +#define COL_FILE (0) +#define COL_MSG (2) + + +class ErrorMessage : public QListViewItem +{ +public: + ErrorMessage(QListView *parent, + const QString &filename, + int lineno, + const QString &message) : + QListViewItem(parent, + filename, + (lineno > 0 ? QString::number(lineno) : QString::null), + message) + { + m_isError = !message.contains(QString::fromLatin1("warning")); + m_lineno = lineno; + m_serial = s_serial++; + } + ErrorMessage(QListView *parent,const QString &message) : + QListViewItem(parent,QString::null,QString::null,QString::null) + { + QString m(message); + m.remove('\n'); + m.stripWhiteSpace(); + setText(COL_MSG,m); + + m_isError=false; + m_lineno=-1; + m_serial = s_serial++; + setSelectable(false); + } + ErrorMessage(QListView *parent, bool start) : + QListViewItem(parent,QString::null) + { + m_isError=false; + m_lineno=-1; + m_serial=-1; + setSelectable(false); + if (start) setText(COL_MSG,i18n("Running make...")); + else setText(COL_MSG,i18n("No Errors.")); + } + virtual ~ErrorMessage() ; + + bool isError() const { return m_isError; } + QString message() const { return text(COL_MSG); } + QString fancyMessage() const; + QString caption() const; + QString filename() const { return text(COL_FILE); } + int line() const { return m_lineno; } + int serial() const { return m_serial; } + + virtual int compare(QListViewItem *,int,bool) const; + + static void resetSerial() { s_serial=10; } + +protected: + virtual void paintCell(QPainter *,const QColorGroup &, + int,int,int); + + bool m_isError; + int m_lineno; + int m_serial; + + static int s_serial; +} ; + +/* static */ int ErrorMessage::s_serial = 0; + +/* virtual */ ErrorMessage::~ErrorMessage() +{ +} + +QString ErrorMessage::caption() const +{ + return QString::fromLatin1("%1:%2").arg(text(COL_FILE)).arg(line()); +} + +QString ErrorMessage::fancyMessage() const +{ + QString msg = QString::fromLatin1(""); + if (isError()) + { + msg.append(QString::fromLatin1("")); + } + msg.append(message()); + if (isError()) + { + msg.append(QString::fromLatin1("")); + } + msg.append(QString::fromLatin1("")); + return msg; +} + +/* virtual */ void ErrorMessage::paintCell(QPainter *p, + const QColorGroup &cg, + int column, + int width, + int align) +{ + if ((column!=COL_LINE) || (serial()<0)) + { + QListViewItem::paintCell(p,cg,column,width,align); + } + else + { + QColorGroup myCG(cg); +#if 0 + red, //darkRed, + green, //darkGreen, + blue, //darkBlue, + cyan, // darkCyan, + magenta, // darkMagenta, + yellow, //darkYellow, + gray); +#endif + myCG.setColor(QColorGroup::Light,red); + + if (!isSelected()) + { + myCG.setColor(QColorGroup::Base,gray); + myCG.setColor(QColorGroup::Text, + m_isError ? red : yellow); + } + + + QListViewItem::paintCell(p,myCG,column,width,align); + } +} + +/* virtual */ int ErrorMessage::compare(QListViewItem *i, + int /* column */ , bool /* ascending */) const +{ + kdDebug() << "In compare " << serial() << endl; + ErrorMessage *e = dynamic_cast(i); + if (!e) return 1; + if (e->serial() < serial()) return 1; + else if (e->serial() == serial()) return 0; + else return -1; +} + +class LinePopup : public KPassivePopup +{ +protected: + LinePopup( QWidget *parent=0, const char *name=0, WFlags f=0 ); + virtual ~LinePopup(); + +public: + static LinePopup *message(QWidget *, + const QPoint &p,ErrorMessage *e); + +protected: + virtual void positionSelf(); + + QPoint fLoc; + + // There should be only one + static LinePopup *one; +} ; + +/* static */ LinePopup *LinePopup::one = 0L; + +LinePopup::LinePopup(QWidget *p,const char *n,WFlags f) : + KPassivePopup(p,n,f), + fLoc(-1,-1) +{ + ASSERT(!one); + one=this; +} + +LinePopup::~LinePopup() +{ + one=0L; +} + +/* static */ LinePopup *LinePopup::message(QWidget *parent, + const QPoint &p, + ErrorMessage *e) +{ + if (one) delete one; + LinePopup *pop = new LinePopup( parent ); + pop->setAutoDelete( true ); + + + pop->setView( e->caption(), e->fancyMessage(), QPixmap() ); + // pop->hideDelay = timeout; + pop->fLoc=p; + pop->show(); + + return pop; +} + +/* virtual */ void LinePopup::positionSelf() +{ + if (fLoc.x()==-1) KPassivePopup::positionSelf(); + else + { + // Move above or below the intended line + if (fLoc.y()>320) fLoc.setY(fLoc.y()-80); + else fLoc.setY(fLoc.y()+80); + moveNear(QRect(fLoc.x(),fLoc.y(),40,30)); + } +} + +PluginKateMakeView::PluginKateMakeView(QWidget *parent, + Kate::MainWindow *mainwin, + const char* name) : + QListView(parent,name), + KXMLGUIClient(), + win(mainwin), + filenameDetector(0L), + running_indicator(0L) +{ + FUNCTIONSETUP; + + m_proc=0; + (void) new KAction ( i18n("Next Error"), KShortcut(ALT+CTRL+Key_Right), + this, SLOT( slotNext() ), + actionCollection(), "make_right" ); + + (void) new KAction ( i18n("Previous Error"), KShortcut(ALT+CTRL+Key_Left), + this, SLOT( slotPrev() ), + actionCollection(), "make_left" ); + + (void) new KAction ( i18n("Make"), KShortcut(ALT+Key_R), + this, SLOT( slotValidate() ), + actionCollection(), "make_check" ); + + (void) new KAction ( i18n("Configure..."), KShortcut(), + this, SLOT( slotConfigure() ), + actionCollection(), "make_settings" ); + + setInstance(new KInstance("kate")); + setXMLFile(QString::fromLatin1("plugins/katemake/ui.rc")); + + + setFocusPolicy(QWidget::NoFocus); + setSorting(COL_LINE); + + addColumn(i18n("File"), -1); + addColumn(i18n("Line"), -1); + setColumnAlignment(COL_LINE, AlignRight); + addColumn(i18n("Message"), -1); + setAllColumnsShowFocus(true); + setResizeMode(QListView::LastColumn); + connect(this, SIGNAL(clicked(QListViewItem *)), SLOT(slotClicked(QListViewItem *))); + + m_proc = new KProcess(); + + connect(m_proc, SIGNAL(processExited(KProcess*)), this, SLOT(slotProcExited(KProcess*))); + connect(m_proc, SIGNAL(receivedStderr(KProcess*,char*,int)), + this, SLOT(slotReceivedProcStderr(KProcess*, char*, int))); + + + KConfig c("katemakepluginrc"); + c.setGroup("Prefixes"); + source_prefix = c.readEntry("Source",QString::null); + build_prefix = c.readEntry("Build",QString::null); + +// if (source_prefix.isEmpty()) + { + filenameDetector = new QRegExp( + QString::fromLatin1("[a-zA-Z0-9_\\.\\-]*\\.[chp]*:[0-9]*:")); + } +// else + { +// filenameDetector = 0L; + } +} + + +PluginKateMakeView::~PluginKateMakeView() +{ + FUNCTIONSETUP; + + delete m_proc; + delete filenameDetector; + delete running_indicator; +} + + +void PluginKateMakeView::processLine(const QString &l) +{ + kdDebug() << "Got line " << l ; + + + if (!filenameDetector && l.find(source_prefix)!=0) + { + /* ErrorMessage *e = */ (void) new ErrorMessage(this,l); + return; + } + + if (filenameDetector && l.find(*filenameDetector)<0) + { + ErrorMessage *e = new ErrorMessage(this,l); + kdDebug() << "Got message(1) #" << e->serial() << endl; + return; + } + + int ofs1 = l.find(':'); + int ofs2 = l.find(':',ofs1+1); + // + QString m = l.mid(ofs2+1); + m.remove('\n'); + m.stripWhiteSpace(); + QString filename = l.left(ofs1); + int line = l.mid(ofs1+1,ofs2-ofs1-1).toInt(); + ErrorMessage *e = new ErrorMessage(this, + filename,line,m); + kdDebug() << "Got message(2) #" << e->serial() << endl; + + // Should cache files being found and check for + // existence. + kdDebug() << ": Looking at " << document_dir+filename << endl; + if (!QFile::exists(document_dir+filename)) + { + e->setSelectable(false); + } + if (filename.startsWith(source_prefix) && !source_prefix.isEmpty()) + { + e->setSelectable(true); + } + found_error=true; +} + + +void PluginKateMakeView::slotReceivedProcStderr(KProcess *, char *result, int len) +{ + FUNCTIONSETUP; + + QString l = QString::fromLocal8Bit( QCString(result, len+1) ); + + output_line += l; + + int nl_p = -1; + while ((nl_p = output_line.find('\n')) > 1) + { + processLine(output_line.left(nl_p+1)); + output_line.remove(0,nl_p+1); + } +} + + +void PluginKateMakeView::slotProcExited(KProcess *p) +{ + FUNCTIONSETUP; + + delete running_indicator; + running_indicator=0L; + + if (!output_line.isEmpty()) + { + processLine(output_line); + } + +#if 0 + // FIXME: doesn't work correct the first time: + if( m_dockwidget->isDockBackPossible() ) { + m_dockwidget->dockBack(); + } +#endif + + kdDebug() << "slotProcExited()" << endl; + QApplication::restoreOverrideCursor(); + + sort(); + + if ( found_error || !p->normalExit() || p->exitStatus() ) + { + QListViewItem *i = firstChild(); + while (i && !i->isSelectable()) + { + i = i->nextSibling(); + } + if (i) + { + setSelected(i,true); + slotClicked(i); + } + } + else + { + KPassivePopup::message(i18n("Make Results"), + i18n("No errors."), + this); + clear(); +#if 0 + QListViewItem *i = new QListViewItem(this,QString::null, + QString::null, + i18n("No Errors.")); + i->setSelectable(false); +#else + (void) new ErrorMessage(this,false); +#endif + } +} + + +void PluginKateMakeView::slotClicked(QListViewItem *item) +{ + FUNCTIONSETUP; + if (!item) + { + kdDebug() << ": No item clicked." << endl; + return; + } + if (!item->isSelectable()) return; + + ErrorMessage *e = dynamic_cast(item); + if (!e) return; + + ensureItemVisible(e); + + QString filename = document_dir + e->filename(); + int lineno = e->line(); + + if (!build_prefix.isEmpty()) + { + filename = e->filename(); + } + + + kdDebug() << ": Looking at " << filename + << ":" << lineno << endl; + + if (QFile::exists(filename)) + { + KURL u; + u.setPath(filename); + win->viewManager()->openURL(u); + Kate::View *kv = win->viewManager()->activeView(); + + kv->setCursorPositionReal(lineno-1,1); + + + QPoint globalPos = kv->mapToGlobal(kv->cursorCoordinates()); + kdDebug() << ": Want to map at " + << globalPos.x() << "," << globalPos.y() << endl; +#if 0 + KPassivePopup::message( + QString::fromLatin1("%1:%2").arg(filename).arg(lineno), + msg, + this); +#else + if ( ! isVisible() ) + LinePopup::message(this,globalPos,e); +#endif + } +} + +void PluginKateMakeView::slotNext() +{ + FUNCTIONSETUP; + + QListViewItem *i = selectedItem(); + if (!i) return; + + QListViewItem *n = i; + while ((n=n->nextSibling())) + { + if (n->isSelectable()) + { + if (n==i) return; + setSelected(n,true); + ensureItemVisible(n); + slotClicked(n); + return; + } + } +} + +void PluginKateMakeView::slotPrev() +{ + FUNCTIONSETUP; + + QListViewItem *i = selectedItem(); + if (!i) return; + + QListViewItem *n = i; + while ((n=n->itemAbove())) + { + if (n->isSelectable()) + { + if (n==i) return; + setSelected(n,true); + ensureItemVisible(n); + slotClicked(n); + return; + } + } +} + +bool PluginKateMakeView::slotValidate() +{ + FUNCTIONSETUP; + + clear(); + win->toolViewManager()->showToolView (this); + + m_proc->clearArguments(); + + Kate::View *kv = win->viewManager()->activeView(); + if( ! kv ) { + kdDebug() << "Error (slotValidate()): no Kate::View" << endl; + return false; + } + if( ! kv->getDoc() ) { + kdDebug() << "Error (slotValidate()): no kv->getDoc()" << endl; + return false; + } + + Kate::Document *doc = (Kate::Document*)kv->document(); + doc->save(); + KURL url(doc->url()); + + output_line = QString::null; + ErrorMessage::resetSerial(); + found_error=false; + + kdDebug() << ": Document " << url.protocol() << " : " << + url.path() << endl; + + if (!url.isLocalFile()) + { + KMessageBox::sorry(0, + i18n("The file %1 is not a local file. " + "Non-local files cannot be compiled.") + .arg(url.path())); + return false; + } + + document_dir = QFileInfo(url.path()).dirPath(true) + + QString::fromLatin1("/"); + + if (document_dir.startsWith(source_prefix)) + { + document_dir = build_prefix + document_dir.mid(source_prefix.length()); + } + + m_proc->setWorkingDirectory(document_dir); + QString make = KStandardDirs::findExe( "gmake" ); + if (make.isEmpty()) + make = KStandardDirs::findExe("make"); + *m_proc << make; + if( make.isEmpty() || ! m_proc->start(KProcess::NotifyOnExit, KProcess::AllOutput) ) { + KMessageBox::error(0, i18n("Error: Failed to run %1.").arg(make.isEmpty() ? + "make" : make)); + return false; + } + QApplication::setOverrideCursor(KCursor::waitCursor()); + running_indicator = new ErrorMessage(this,true); + return true; +} + +class Settings : public KDialogBase +{ +public: + Settings( QWidget *parent, + const QString &src, const QString &bld); + + KLineEdit *edit_src,*edit_bld; +} ; + + +Settings::Settings(QWidget *p, + const QString &s, const QString &b) : + KDialogBase(p,"settings",true, + i18n("Directories"), + KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ) +{ + QVBox *page = makeVBoxMainWidget(); + QHBox *h = new QHBox(page); + (void) new QLabel(i18n("Source prefix:"),h); + edit_src = new KLineEdit(h); + edit_src->setText(s); + + h = new QHBox(page); + (void) new QLabel(i18n("Build prefix:"),h); + edit_bld = new KLineEdit(h); + edit_bld->setText(b); +} + +void PluginKateMakeView::slotConfigure() +{ + Kate::View *kv = win->viewManager()->activeView(); + + + Settings s(kv,source_prefix,build_prefix); + + if (!s.exec()) return; + + + source_prefix = s.edit_src->text(); + build_prefix = s.edit_bld->text(); + + //if (source_prefix.isEmpty()) + { + if (!filenameDetector) + { + filenameDetector = new QRegExp( + QString::fromLatin1("[a-zA-Z0-9_\\.\\-]*\\.[chp]*:[0-9]*:")); + } + } + //else + { +// if (filenameDetector) +// { +// delete filenameDetector; +// filenameDetector = 0L; +// } + } + + KConfig c("katemakepluginrc"); + c.setGroup("Prefixes"); + c.writeEntry("Source",source_prefix); + c.writeEntry("Build",build_prefix); +} diff --git a/kate/make/plugin_katemake.h b/kate/make/plugin_katemake.h new file mode 100644 index 0000000..5042f1d --- /dev/null +++ b/kate/make/plugin_katemake.h @@ -0,0 +1,108 @@ +#ifndef _KATEMAKE_H +#define _KATEMAKE_H +/* plugin_katemake.h Kate Plugin +** +** Copyright (C) 2003 by Adriaan de Groot +** +** This is the hader for the Make plugin. +** +** This code was mostly copied from the GPL'ed xmlcheck plugin +** by Daniel Naber. +*/ + +/* +** This program is free software; you can redistribute it and/or modify +** it under the terms of the 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 in a file called COPYING; if not, write to +** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, +** MA 02110-1301, USA. +*/ + +// #define QT_NO_CAST_ASCII (1) +// #define QT_NO_ASCII_CAST (1) + +class QRegExp; + +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +class PluginKateMakeView : public QListView, public KXMLGUIClient +{ + Q_OBJECT + + public: + PluginKateMakeView(QWidget *parent, + Kate::MainWindow *mainwin, + const char* name); + virtual ~PluginKateMakeView(); + + Kate::MainWindow *win; + + public slots: + void slotClicked(QListViewItem *item); + void slotNext(); + void slotPrev(); + + bool slotValidate(); + void slotProcExited(KProcess*); + void slotReceivedProcStderr(KProcess*, char*, int); + + void slotConfigure(); + +protected: + void processLine(const QString &); + + private: + KProcess *m_proc; + + QString output_line; + QString doc_name; + QString document_dir; + QString source_prefix,build_prefix; + + QRegExp *filenameDetector; + + QListViewItem *running_indicator; + bool found_error; +}; + + +class PluginKateMake : public Kate::Plugin, Kate::PluginViewInterface +{ + Q_OBJECT + + public: + PluginKateMake( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + virtual ~PluginKateMake(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + private: + QPtrList m_views; +}; + +#endif + diff --git a/kate/make/ui.rc b/kate/make/ui.rc new file mode 100644 index 0000000..8385b8c --- /dev/null +++ b/kate/make/ui.rc @@ -0,0 +1,12 @@ + + + + &Make + + + + + + + + diff --git a/kate/modeline/Makefile.am b/kate/modeline/Makefile.am new file mode 100644 index 0000000..3afccbc --- /dev/null +++ b/kate/modeline/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = katemodelineplugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +katemodelineplugin_la_SOURCES = ModelinePlugin.cpp +katemodelineplugin_la_LIBADD = -lkateinterfaces +katemodelineplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +pluginsdir = $(kde_datadir)/kate/plugins/katemodeline +plugins_DATA = ui.rc + +kde_services_DATA = katemodeline.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katemodeline.pot diff --git a/kate/modeline/ModelinePlugin.cpp b/kate/modeline/ModelinePlugin.cpp new file mode 100644 index 0000000..b288856 --- /dev/null +++ b/kate/modeline/ModelinePlugin.cpp @@ -0,0 +1,125 @@ + /*************************************************************************** + ModelinePlugin.cpp - description + ------------------- + begin : Mon Apr 1 2002 + copyright : (C) 2002 by John Firebaugh + email : jfirebaugh@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 +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "ModelinePlugin.h" +#include "ModelinePlugin.moc" + +class PluginView : public KXMLGUIClient +{ + friend class ModelinePlugin; + + public: + Kate::MainWindow *win; +}; + +K_EXPORT_COMPONENT_FACTORY( katemodelineplugin, KGenericFactory( "katemodeline" ) ) + +ModelinePlugin::ModelinePlugin( QObject* parent, const char* name, const QStringList &args ) + : Kate::Plugin ( (Kate::Application *) parent, name ) +{ +} + +ModelinePlugin::~ModelinePlugin() +{ +} + +void ModelinePlugin::addView(Kate::MainWindow *win) +{ + // TODO: doesn't this have to be deleted? + PluginView *view = new PluginView (); + + new KAction( i18n("Apply Modeline"), 0, + this, SLOT(applyModeline()), + view->actionCollection(), "edit_apply_modeline" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile( "plugins/katemodeline/ui.rc" ); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void ModelinePlugin::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 ModelinePlugin::applyModeline() +{ + if (!application()->activeMainWindow()) + return; + + Kate::Document* doc = application()->documentManager()->activeDocument(); + Kate::View* view = application()->activeMainWindow()->viewManager()->activeView(); + if( !doc || !view ) return; + static QRegExp vim1( "\\b(?:vi:|vim:|ex:)[ \\t](.*)" ); + static QRegExp vim2( "\\b(?:vi:|vim:|ex:)[ \\t]set (.*):" ); + uint foundAtLine; + uint foundAtCol; + uint matchLen; + QString options; + if( doc->searchText( 0, 0, vim2, &foundAtLine, &foundAtCol, &matchLen ) ) { + options = vim2.cap(1); + } else if( doc->searchText( 0, 0, vim1, &foundAtLine, &foundAtCol, &matchLen ) ) { + options = vim1.cap(1); + options.replace( QRegExp( ":" ), " " ); + } + uint configFlags = doc->configFlags(); + kdDebug() << "Found modeline: " << options << endl; + if( options.find( QRegExp( "\\bnoet\\b" ) ) >= 0 ) { + kdDebug() << "Clearing replace tabs" << endl; + configFlags &= ~Kate::Document::cfReplaceTabs; + } else if( options.find( QRegExp( "\\bet\\b" ) ) >= 0 ) { + kdDebug() << "Setting replace tabs" << endl; + configFlags |= Kate::Document::cfReplaceTabs; + } + QRegExp ts( "ts=(\\d+)" ); + if( options.find( ts ) >= 0 ) { + uint tabWidth = ts.cap(1).toUInt(); + kdDebug() << "Setting tab width " << tabWidth << endl; + view->setTabWidth( tabWidth ); + } + QRegExp tw( "tw=(\\d+)" ); + if( options.find( tw ) >= 0 ) { + uint textWidth = tw.cap(1).toUInt(); + kdDebug() << "Setting text width " << textWidth << endl; + doc->setWordWrap( true ); + doc->setWordWrapAt( textWidth ); + } + doc->setConfigFlags( configFlags ); +} diff --git a/kate/modeline/ModelinePlugin.h b/kate/modeline/ModelinePlugin.h new file mode 100644 index 0000000..3f4b818 --- /dev/null +++ b/kate/modeline/ModelinePlugin.h @@ -0,0 +1,40 @@ + /*************************************************************************** + ModelinePlugin.h - description + ------------------- + begin : Mon Apr 1 2002 + copyright : (C) 2002 by John Firebaugh + email : jfirebaugh@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 _ModelinePlugin_H_ +#define _ModelinePlugin_H_ + +#include + +class ModelinePlugin : public Kate::Plugin, Kate::PluginViewInterface +{ + Q_OBJECT + +public: + ModelinePlugin( QObject* parent = 0, const char* name = 0, const QStringList &args = QStringList() ); + virtual ~ModelinePlugin(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); +private slots: + void applyModeline(); + +private: + QPtrList m_views; +}; + +#endif // _ModelinePlugin_H_ diff --git a/kate/modeline/katemodeline.desktop b/kate/modeline/katemodeline.desktop new file mode 100644 index 0000000..4d31ae6 --- /dev/null +++ b/kate/modeline/katemodeline.desktop @@ -0,0 +1,119 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katemodelineplugin +X-Kate-Version=2.5 +Name=Kate Modeline Plugin +Name[af]=Kate Moduslyn Inplak +Name[ar]=ملحق Kate Modeline +Name[az]=Kate Modeline ƏLavəsi +Name[br]=Lugent Kate Modeline +Name[ca]=Connector Modeline per a Kate +Name[cy]=Ategyn Modd-linell Kate +Name[da]=Kate Tilstandslinje-plugin +Name[de]=Kate Modeline-Modul +Name[el]=Πρόσθετο Modeline του Kate +Name[eo]=Modolinia kromaĵo por Kodredaktilo +Name[es]=Complemento Modeline de Kate +Name[et]=Kate teaterea plugin +Name[eu]=Kateren Modeline plugina +Name[fa]=وصلۀ Kate Modeline +Name[fi]=Kate Modeline -sovelma +Name[fr]=Module externe Modeline pour Kate +Name[fy]=Kate Modeline-plugin +Name[gl]=Plugin de Liña de Modo para Kate +Name[he]=תוסף Modeline ל־Kate +Name[hi]=के-एटीई मॉडलाइन प्लगइन +Name[hr]=Kate Modeline dodatak +Name[hu]=Kate módsor-bővítőmodul +Name[is]=Kate 'Modeline' viðbót +Name[it]=Plugin Modeline di Kate +Name[ja]=Kate Modeline プラグイン +Name[ka]=Kate Modeline მოდული +Name[kk]=Kate Modeline плагин модулі +Name[km]=កម្មវិធី​ជំនួយ​​របៀប​បន្ទាត់ Kate +Name[lt]=Kate Modeline priedas +Name[mk]=Modeline-приклучок за Кате +Name[ms]=Plug masuk Kate Modeline +Name[nb]=Programtillegg for Kate moduslinje +Name[nds]=Modeline-Moduul för Kate +Name[ne]=केट मोडलाइन प्लगइन +Name[nl]=Kate Modeline-plugin +Name[nn]=Kate nivålinje-tillegg +Name[pa]=ਕੇਟ ਢੰਗ-ਸਤਰ ਪਲੱਗਇਨ +Name[pl]=Wtyczka ustawień linii do Kate +Name[pt]='Plugin' de Linha de Modo do Kate +Name[pt_BR]=Plugin Modeline do Kate +Name[ro]=Modul "modeline" pentru Kate +Name[ru]=Модуль строки состояния буфера для Kate +Name[sk]=Kate Modeline modul +Name[sl]=Vstavek za Modeline v Kate +Name[sr]=Прикључак режимске линије за Kate +Name[sr@Latn]=Priključak režimske linije za Kate +Name[sv]=Kates lägesradsinsticksprogram +Name[ta]=கேட் வரிவகை சொருகுப்பொருள் +Name[tg]=Модули хатҳои ҳолати буфер барои Kate +Name[th]=ปลั๊กอินโหมดไลน์ของ Kate +Name[tr]=Kate Modeline Eklentisi +Name[uk]=Втулок Modeline для Kate +Name[vi]=Bổ sung dòng chế độ Kate +Name[xh]=Ulayini wendlela yokwenza yeplagi yangaphakathi ye Kate +Name[zh_CN]=Kate 状态行插件 +Name[zh_TW]=Kate Modeline 外掛程式 +Comment=Set document settings based on vim or emacs modelines +Comment[ar]=عيّن اعدادات المستندات على أساس ملفات modelines الخاص بـvim أو emacs +Comment[az]=Sənəd qurğularını vim ya da emacs əsaslarına görə tə'yin et +Comment[bg]=Установяване на режим базиран на редакторите vim или emacs +Comment[bs]=Podešava postavke dokumenta na osnovu vim ili emacs modeline-ova +Comment[ca]=Estableix les preferències dels documents basant-se en mode de línies de vim o emacs +Comment[cs]=Nastaví vlastnosti dokumentu v závislosti na "modeline" z Emacs nebo vi +Comment[cy]=Gosod gosodiadau dogfen wedi eu seilio ar fodd-linellau vim neu emacs +Comment[da]=Sæt dokumentindstillinger baseret på vim- eller emacs-tilstandslinjer +Comment[de]=Dokumenteinstellungen aus vim- oder emacs-Modelines lesen +Comment[el]=Καθορισμός των ρυθμίσεων του εγγράφου βασισμένες στις modelines του vim ή του emacs +Comment[eo]=Metas dokumentan agordon laŭ vim aŭ emacs modolinioj +Comment[es]=Configura las preferencias del documento basado en los modelos de vim o emacs +Comment[et]=Rakendab dokumendi puhul vim'ile või emacs'ile sarnast teaterida +Comment[eu]=Ezarri vim edo emacs-en lerro moduetan oinarritutako dokumentu ezarpenak +Comment[fa]=تنظیمات سند را براساس modeline vim یا emacs تنظیم می‌کند. +Comment[fi]=Aseta asiakirjan asetukset perustuen vim tai emacs modelineihin +Comment[fo]=Nýt ásetingar fyri skjal grundað á vim ella emacs *modelines* +Comment[fr]=Définir les réglages de document basés sur les modules de vim ou d'emacs +Comment[fy]=Dokumintynstellingen basearre op vim- of emacs-modelines ynstelle +Comment[gl]=Alterar as configuracións do documento con base nas liñas de modo de emacs ou de vim +Comment[he]=קביעת הגדרות המסמך בהתבסס על modelines של vim או emacs +Comment[hi]=वीआईएम या ईमैक्स मॉडलाइन्स आधारित दस्तावेज़ विन्यास नियत करता है +Comment[hr]=Zadavanje postavki dokumenta na osnovu modelines iz vim-a ili emacs-a +Comment[hu]=Dokumentumbeállítások VIM/emacs módleíró sorok alapján +Comment[is]=Setur stillingar skjals byggt á vim eða emacs 'modeline' +Comment[it]=Seleziona le impostazioni dei documenti basandosi sui "modeline" di emacs o vim +Comment[ja]=vim や emacs のモード行によるドキュメント設定 +Comment[ka]=vim-ზე ან emacs-ის modeline-ზე დაფუძნებულ პარამეტრებს ანიჭებს დოკუმენტს +Comment[kk]=vim не emacs modeline негіздеп, құжаттың параметрлерін орнатады +Comment[km]=កំណត់​ការ​កំណត់​​ឯកសារ​ដោយ​​ផ្អែក​លើ​របៀប​បន្ទាត់របស់ vim ឬemacs +Comment[lt]=Sukuria dokumento nustatymus pagal vim ar emacs dokumento komandas +Comment[mk]=Ги мести поставувањата на документот базирани врз линии на режим за vim или emacs +Comment[ms]=Tetapkan tetapan dokumen +Comment[nb]=Tilpass dokumentinnstillinger basert på moduslinjer for vim eller emacs +Comment[nds]=Dokmenteninstellen vun vim- oder emacs-Modelines lesen +Comment[ne]=भिम वा इमाकस मोडलाइनमा आधारित कागजात सेटिङ सेट गर्नुहोस् +Comment[nl]=Documentinstellingen gebaseerd op vim- of emacs-modelines instellen +Comment[nn]=Vel dokumentinnstillingar basert på nivålinjer for vim eller emacs +Comment[pl]=Zmienia ustawienia dokumentu zgodnie z ustawieniami linii vim lub emacs-a zapisanymi w pliku +Comment[pt]=Alterar as configurações do documento com base nas linhas de modo do emacs ou do vim +Comment[pt_BR]=Ajusta as configurações baseado no vim ou no emacs +Comment[ro]=Configurează setările documentului în funcţie de "modeline"-urile Vim sau Emacs +Comment[ru]=Показывает строку состояния буфера как в vim или emacs +Comment[sk]=Nastaví nastavenia dokumentu založené na vim alebo emacs modely +Comment[sl]=Uredi nastavitve dokumenta na podlagi določil v vim ali emacs +Comment[sr]=Поставите подешавања документа на основу Vim-ових или Emacs-ових режимских линија +Comment[sr@Latn]=Postavite podešavanja dokumenta na osnovu Vim-ovih ili Emacs-ovih režimskih linija +Comment[sv]=Ställ in dokumentalternativ baserat på Vim- eller Emacs-lägesrader +Comment[ta]=விம் அல்லது எமாக்ஸ் வரிவகை அடிப்படையிலான ஆவண அமைப்புகளை அமை +Comment[tg]=Хати ҳолати буферо мисли vim ё emacs нишон медиҳад +Comment[tr]=Belge ayarlarını vim veya emacs kipsatırına(modeline) göre yap +Comment[uk]=Встановлює параметри документа на основі рядків режимів vim або emacs +Comment[vi]=Thiết lập tài liệu dựa vào các dòng chế độ kiểu emacs hoặc vim +Comment[xh]=Cwangcisa izicwangciso zoxwebhu olusekelwe kwi vim okanye kwi ndlela yeelayini ze emacs +Comment[zh_CN]=根据 VIM 或 EMACS 状态行来设置文档 +Comment[zh_TW]=依 vim 或 emacs modelines 設定文件 diff --git a/kate/modeline/ui.rc b/kate/modeline/ui.rc new file mode 100644 index 0000000..ef8fc22 --- /dev/null +++ b/kate/modeline/ui.rc @@ -0,0 +1,8 @@ + + + + &Tools + + + + diff --git a/kate/openheader/Makefile.am b/kate/openheader/Makefile.am new file mode 100644 index 0000000..9db3328 --- /dev/null +++ b/kate/openheader/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = kateopenheaderplugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +kateopenheaderplugin_la_SOURCES = plugin_kateopenheader.cpp +kateopenheaderplugin_la_LIBADD = -lkateinterfaces +kateopenheaderplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +pluginsdir = $(kde_datadir)/kate/plugins/kateopenheader +plugins_DATA = ui.rc + +kde_services_DATA = kateopenheader.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kateopenheader.pot diff --git a/kate/openheader/kateopenheader.desktop b/kate/openheader/kateopenheader.desktop new file mode 100644 index 0000000..f5f3322 --- /dev/null +++ b/kate/openheader/kateopenheader.desktop @@ -0,0 +1,112 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=kateopenheaderplugin +X-Kate-Version=2.5 +Name=Kate OpenHeader +Name[af]=Kate Maak-opskrif-oop +Name[cy]=AgorPennawd Kate +Name[el]=Άνοιγμα επικεφαλίδας του Kate +Name[eo]=Kodredaktilo-difinmalfermilo +Name[es]=Cabecera abierta de Kate +Name[et]=Kate päisefaili avaja +Name[eu]= Kateren OpenHeader +Name[fi]=Kate avaaotsikko +Name[fo]=Kate opna høvd +Name[fr]=Ouverture d'en-tête pour Kate +Name[gl]=OpenHeader para Kate +Name[he]=פותח הכותרות של Kate +Name[hi]=के-एटीई ओपन-हेडर +Name[hr]=Kate OtvorenoZaglavlje +Name[hu]=Kate fejlécmegnyitó +Name[it]=ApriHeader di Kate +Name[ja]=Kate オープンヘッダ +Name[kk]=Kate айдар файлын ашу +Name[lv]=Kate AtvērtHederi +Name[nb]=Åpne hodefil i Kate +Name[nds]=Koppdateien opmaken för Kate +Name[ne]=केट ओपनहेडर +Name[pa]=ਕੇਟ ਫਾਇਲ-ਸਿਰਲੇਖ +Name[pl]=Kate - Otwarcie pliku nagłówkowego +Name[pt]=OpenHeader do Kate +Name[pt_BR]=Abrir Cabeçalhos do Kate +Name[ro]=Includere fişier antet pentru Kate +Name[ru]=Открытие файла заголовка для Kate +Name[sr]=Отварање заглавља за Kate +Name[sr@Latn]=Otvaranje zaglavlja za Kate +Name[ta]=கேட் திறந்த தலைப்பு +Name[tg]=Кушодани сарлавҳаи файл барои Kate +Name[th]=เปิดส่วนหัวของ Kate +Name[tr]=Kate Başlık Aç +Name[uk]=Відкрити файл заголовка Kate +Name[ven]=Kate Openeheda +Name[vi]=Phần đầu mở Kate +Name[xh]=Intloko Yokuvula ye Kate +Name[zu]=u Kate Vula isihloko +Comment=Opens the corresponding .h/[.cpp|.c] file +Comment[af]=Maak oop die ooreenstemmend .h/[.cpp|.c] lêer +Comment[ar]=تفتح ملف .h المقابل لملف [.cpp|.c] +Comment[az]=Korespond .h/[.cpp|.c] faylını açar +Comment[bg]=Отваряне на съответстващите файлове .h/[.cpp|.c] +Comment[bs]=Otvara odgovarajuću .h/[.cpp|.c] datoteku +Comment[ca]=Obre el corresponent fitxer .h/[.cpp|.c] +Comment[cs]=Otevře odpovídající soubor .h/[.cpp|.c] +Comment[cy]=Agor y ffeil .h/[.cpp|.c] addas +Comment[da]=Åbner den tilsvarende .h/[.cpp|.c]-fil +Comment[de]=Öffnet die entsprechende .h/[.cpp|.c]-Datei +Comment[el]=Ανοίγει το αντίστοιχο αρχείο .h/[.cpp|.c] +Comment[eo]=Malfermas la koncernan .h/[.cpp|.c]-dosieron +Comment[es]=Abre el archivo .h/[.cpp|.c] +Comment[et]=Vastava .h/[.cpp|.c] faili avamine +Comment[eu]= Dagokion .h/[.cpp|.c] fitxategia irekitzen du +Comment[fa]=پروندۀ متناظر .h/[.cpp|.c] را باز می‌کند. +Comment[fi]=Avaa vastaavan .h/[.cpp|.c] tiedoston +Comment[fo]=Opnar tann samsvarandi .h/[.cpp|.c]-fíla. +Comment[fr]=Ouvre le fichier correspondant .h/[.cpp|.c] +Comment[fy]=iepent de korrespondearjende .h/[.cpp|.c]-triem +Comment[ga]=Oscail an comhad .h/[.cpp|.c] a fhreagraíonn leis an gceann seo +Comment[gl]=Abre o ficheiro .h/[.cpp|.c] correspondente +Comment[he]=פתיחת קובץ הכותרת המתאים [h/[.cpp|.c. +Comment[hi]= .h/[.cpp|.c] के सदृश्य फ़ाइल खोलता है +Comment[hr]=Otvaranje odgovarajuće .h/[.cpp|.c] datoteke +Comment[hu]=A megfelelő .h/[.cpp|.c] fájl megnyitása +Comment[is]=Opnar viðkomandi .h/[.cpp|.c] skrá +Comment[it]=Apre il file .h/[.cpp|.c] corrispondente +Comment[ja]=対応する .h/[.cpp|.c] ファイルを開きます +Comment[ka]=ხსნის შესაბამის .h/[.cpp|.c] ფაილს +Comment[kk]=Керек .h/[.cpp|.c] айдар файлын ашады +Comment[km]=បើក​ការ​ទាក់ទង​ឯកសារ .h/[.cpp|.c] +Comment[lt]=Atveria atitinkamą .h/[.cpp|.c] bylą +Comment[lv]=Atver atbilstošo .h/[.cpp|.c] failu +Comment[mk]=Ја отвора соодветната .h/[.cpp|.c] датотека +Comment[ms]=Membuka fail .h/[.cpp|.c] yang sepadan. +Comment[mt]=Jiftaħ il-fajl .h/[.cpp|.c] li jikkorrispondi +Comment[nb]=Åpner den tilhørende .h/[.cpp|.c]-fila +Comment[nds]=Maakt de tohören .h/[.cpp|.c]-Datei op +Comment[ne]=सङ्गत .h/[.cpp|.c] फाइल खोल्दछ +Comment[nl]=Opent het corresponderende .h/[.cpp|.c]-bestand +Comment[nn]=Opnar .h/[.cpp|.c]-fila som høyrer til +Comment[pa]=ਅਨੁਸਾਰੀ .h/[.cpp|.c] ਫਾਇਲ ਖੋਲੋ +Comment[pl]=Otwiera odpowiadający plik h/[.cpp|.c] +Comment[pt]=Abre o ficheiro .h/[.cpp|.c] correspondente +Comment[pt_BR]=Abrir o arquivo .h[cpp|.c] correspondente +Comment[ro]=Deschide fişierul antet corespunzător .h/[.cpp|.c] +Comment[ru]=Открывает соответствующий файл .h/[.cpp|.c] +Comment[sk]=Otvorí odpovedajúci súbor .h/[.cpp|.c] +Comment[sl]=Odpre pripadajočo datoteko .h/[.cpp|.c] +Comment[sr]=Отвара одговарајући .h/[.cpp|.c] фајл +Comment[sr@Latn]=Otvara odgovarajući .h/[.cpp|.c] fajl +Comment[sv]=Öppnar den motsvarande .h/[.cpp|.c]-filen +Comment[ta]=தொடர்புடைய .h/[.cpp|.c] கோப்பினைத் திறக்கிறது +Comment[tg]=Файли мувофиқи .h/[.cpp|.c] мекушояд +Comment[th]=เปิดแฟ้มที่มีรูปแบบ .h/[.cpp|.c] +Comment[tr]=.h/[.cpp|.c] dosyasını açar +Comment[uk]=Відкриває відповідний файл .h/[.cpp|.c] +Comment[uz]=Tegishli .h/[.cpp|.c] faylini ochish +Comment[uz@cyrillic]=Тегишли .h/[.cpp|.c] файлини очиш +Comment[ven]=Tshi vula faele dzino yelana .h/[.cpp|.c] +Comment[vi]=Mở tập tin .h/[.cpp|.c] tương ứng +Comment[xh]=Ivula ungqamano .h/[.cpp|.c] file +Comment[zh_CN]=打开相应的 .h/[.cpp|.c] 文件 +Comment[zh_TW]=開啟相對應的 .h/[.cpp|.c] 檔案 +Comment[zu]=Ivula ifayela evumelenayo .h/[.cpp|.c] diff --git a/kate/openheader/plugin_kateopenheader.cpp b/kate/openheader/plugin_kateopenheader.cpp new file mode 100644 index 0000000..f404022 --- /dev/null +++ b/kate/openheader/plugin_kateopenheader.cpp @@ -0,0 +1,117 @@ +/*************************************************************************** + plugin_katetextfilter.cpp - description + ------------------- + begin : FRE Feb 23 2001 + copyright : (C) 2001 by Joseph Wenninger + email : jowenn@bigfoot.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "plugin_kateopenheader.h" +#include "plugin_kateopenheader.moc" + +#include +#include +#include +#include +#include +#include +#include + +class PluginView : public KXMLGUIClient +{ + friend class PluginKateOpenHeader; + + public: + Kate::MainWindow *win; +}; + +K_EXPORT_COMPONENT_FACTORY( kateopenheaderplugin, KGenericFactory( "kateopenheader" ) ) + +PluginKateOpenHeader::PluginKateOpenHeader( QObject* parent, const char* name, const QStringList& ) + : Kate::Plugin ( (Kate::Application *)parent, name ) +{ +} + +PluginKateOpenHeader::~PluginKateOpenHeader() +{ +} + +void PluginKateOpenHeader::addView(Kate::MainWindow *win) +{ + // TODO: doesn't this have to be deleted? + PluginView *view = new PluginView (); + + (void) new KAction( i18n("Open .h/.cpp/.c"), Key_F12, + this, SLOT( slotOpenHeader() ), + view->actionCollection(), "file_openheader" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile( "plugins/kateopenheader/ui.rc" ); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void PluginKateOpenHeader::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 PluginKateOpenHeader::slotOpenHeader () +{ + if (!application()->activeMainWindow()) + return; + + Kate::View * kv (application()->activeMainWindow()->viewManager()->activeView()); + if (!kv) return; + + KURL url=kv->document()->url(); + if ((!url.isValid()) || (url.isEmpty())) return; + + QFileInfo info( url.path() ); + QString extension = info.extension().lower(); + + QStringList headers( QStringList() << "h" << "H" << "hh" << "hpp" ); + QStringList sources( QStringList() << "c" << "cpp" << "cc" << "cp" << "cxx" ); + + if( sources.find( extension ) != sources.end() ) { + tryOpen( url, headers ); + } else if ( headers.find( extension ) != headers.end() ) { + tryOpen( url, sources ); + } +} + +void PluginKateOpenHeader::tryOpen( const KURL& url, const QStringList& extensions ) +{ + if (!application()->activeMainWindow()) + return; + + kdDebug() << "Trying to open " << url.prettyURL() << " with extensions " << extensions.join(" ") << endl; + QString basename = QFileInfo( url.path() ).baseName(); + KURL newURL( url ); + for( QStringList::ConstIterator it = extensions.begin(); it != extensions.end(); ++it ) { + newURL.setFileName( basename + "." + *it ); + if( KIO::NetAccess::exists( newURL ) ) + application()->activeMainWindow()->viewManager()->openURL( newURL ); + newURL.setFileName( basename + "." + (*it).upper() ); + if( KIO::NetAccess::exists( newURL ) ) + application()->activeMainWindow()->viewManager()->openURL( newURL ); + } +} diff --git a/kate/openheader/plugin_kateopenheader.h b/kate/openheader/plugin_kateopenheader.h new file mode 100644 index 0000000..61b6058 --- /dev/null +++ b/kate/openheader/plugin_kateopenheader.h @@ -0,0 +1,50 @@ + /*************************************************************************** + plugin_katetextfilter.h - description + ------------------- + begin : FRE Feb 23 2001 + copyright : (C) 2001 by Joseph Wenninger + email : jowenn@bigfoot.com + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef _PLUGIN_KANT_HEADER_H +#define _PLUGIN_KANT_HEADER_H + +#include + +#include +#include +#include +#include +#include +#include +#include + +class PluginKateOpenHeader : public Kate::Plugin, Kate::PluginViewInterface +{ + Q_OBJECT + + public: + PluginKateOpenHeader( QObject* parent = 0, const char* name = 0, const QStringList& = QStringList() ); + virtual ~PluginKateOpenHeader(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + public slots: + void slotOpenHeader (); + void tryOpen( const KURL& url, const QStringList& extensions ); + + private: + QPtrList m_views; +}; + +#endif // _PLUGIN_KANT_OPENHEADER_H diff --git a/kate/openheader/ui.rc b/kate/openheader/ui.rc new file mode 100644 index 0000000..5ccd8f8 --- /dev/null +++ b/kate/openheader/ui.rc @@ -0,0 +1,8 @@ + + + + &File + + + + diff --git a/kate/scripts/Makefile.am b/kate/scripts/Makefile.am new file mode 100644 index 0000000..5648dab --- /dev/null +++ b/kate/scripts/Makefile.am @@ -0,0 +1,2 @@ +katescriptsdir = $(kde_datadir)/kate/scripts +katescripts_DATA = html-tidy.desktop html-tidy.sh diff --git a/kate/scripts/html-tidy.desktop b/kate/scripts/html-tidy.desktop new file mode 100644 index 0000000..68a5c9e --- /dev/null +++ b/kate/scripts/html-tidy.desktop @@ -0,0 +1,77 @@ +[Desktop Entry] +Name=HTML Tidy +Name[cs]=Úklid HTML +Name[cy]=Tacluso HTML (HTML Tidy) +Name[eo]=HTML-purigilo +Name[es]=Ordenado de HTML +Name[fa]=Tidy زنگام +Name[hi]=एचटीएमएल टाइडी +Name[hr]=HTML preuređivanje +Name[ka]=HTML გაწმენდა +Name[nds]=HTML-Tidy +Name[ne]=एचटीएमएल स्पष्टता +Name[pl]=Sprawdzenie poprawności HTML +Name[sk]=Vyčistenie HTML +Name[sv]=HTML-tidy +Name[ta]=HTML சுத்தமாக்கம் +Name[tr]=HTML Düzenleme +Name[vi]=Làm sạch HTML +Comment=Validates the current document via HTML Tidy +Comment[ar]=التأكد من صالحية وثيقة HTML الحالية عن طريق HTML Tidy +Comment[bg]=Валидиране на текущия документ чрез HTML Tidy +Comment[bs]=Provjerava trenutni dokument sa HTML Tidy +Comment[ca]=Valida el document actual mitjançant HTML Tidy +Comment[cs]=Validuje současný dokument pomocí HTML Tidy +Comment[cy]=Dilysa'r ddogfen gyfredol drwy ddefnyddio Tacluso HTML (HTML Tidy) +Comment[da]=Godkender dette dokument via HTML Tidy +Comment[de]=Überprüft das aktuelle Dokument mit "HTML Tidy" +Comment[el]=Ελέγχει την εγκυρότητα στο τρέχον έγγραφο μέσω του HTML Tidy +Comment[eo]=Kontrolas la nunan dokumenton laŭ HTML-purigilo +Comment[es]=Valida que el documento HTML actual presente un orden correcto +Comment[et]=Kontrollib aktiivset dokumenti HTML Tidy abil +Comment[eu]=Uneko dokumentua HTML Tidy bidez balidatzen du +Comment[fa]=سند جاری را از طریق Tidy زنگام اعتبارسنجی می‌کند +Comment[fi]=Validoi nykyisen asiakirjan HTML Tidyllä +Comment[fr]=Valide le document courant grâce à HTML Tidy +Comment[fy]=Falidearret it besteande dokumint fia HTML Tidy +Comment[ga]=Bailíochtaigh an cháipéis reatha le HTML Tidy +Comment[gl]=Valida o documento actual utilizando HTML Tidy +Comment[he]=מוודא את המסמך הנוכחי באמצעות HTML Tidy +Comment[hi]=एचटीएमएल टाइडी के द्वारा मौज़ूदा दस्तावेज़ वेलिडेट करता है +Comment[hr]=Provjera valjanosti trenutnog dokumenta putem aplikacije HTML Tidy +Comment[hu]=Az aktuális dokumentum ellenőrzése a HTML Tidy programmal +Comment[is]=Staðfestir núverandi skjal með HTML Tidy +Comment[it]=Convalida il documento attuale tramite HTML Tidy +Comment[ja]=HTML Tidy で現在のドキュメントを検証します +Comment[ka]=მიმდინარე დოკუმენტს HTML-ს გაწმენდით ამოწმებს +Comment[kk]=Назардағы құжатты HTML Tidy дегенге сәйкестігін тексереді +Comment[km]=ធ្វើ​ឯកសារ​បច្ចុប្បន្ន​​មាន​សុពល​ភាព​តាមរយៈ HTML Tidy +Comment[lt]=Patikrina dabartinį dokumentą panaudojant HTML Tidy +Comment[mk]=Го проверува тековниот документ со HTML Tidy +Comment[ms]=Mengesahkan dokumen semasa melalui HTML Tidy +Comment[nb]=Validerer gjeldende dokument via HTML Tidy +Comment[nds]=Pröövt dat aktuelle Dokment mit HTML Tidy +Comment[ne]=एचटीएमएल स्पष्टताबाट हालको कागजात प्रमाणित गर्छ +Comment[nl]=Valideert het huidige document via HTML Tidy +Comment[nn]=Validerer dokumentet med HTML Tidy +Comment[pl]=Sprawdza poprawność kodu HTML aktualnego dokumentu za pomocą HTML Tidy +Comment[pt]=Valida o documento actual utilizando o HTML Tidy +Comment[pt_BR]=Valida o documento atual via HTML Tidy +Comment[ro]=Validează documentul HTML curent folosind utilitarul Tidy +Comment[ru]=Проверяет соответствие текущей HTML-страницы на соответствие стандартам +Comment[sk]=Skontroluje aktuálny dokument pomocou HTML Tidy +Comment[sl]=Potrdi trenuten dokument preko HTML Tidy +Comment[sr]=Проверава текући документ HTML Tidy-јем +Comment[sr@Latn]=Proverava tekući dokument HTML Tidy-jem +Comment[sv]=Validerar aktuellt dokument via HTML-tidy +Comment[ta]=HTML டைடி மூலமாக நடப்பு ஆவணத்தை மதிப்பிடுகிறது +Comment[tg]=Саҳифаҳои HTML -ро бо мувофиқати ҷараён дар стандарти мувофиқат, тафтиш мекунад +Comment[tr]=HTML Tidy yardımıyla +Comment[uk]=Перевіряє відповідність даного документа стандартам за допомогою HTML Tidy +Comment[uz]=Ushbu hujjatni HTML-andozasiga mosligini tekshirish +Comment[uz@cyrillic]=Ушбу ҳужжатни HTML-андозасига мослигини текшириш +Comment[vi]=Thẩm tra tài liệu hiện thời bằng Làm sạch HTML +Comment[zh_CN]=通过 HTML Tidy 校验当前文档 +Comment[zh_TW]=透過 HTML Tidy 驗證目前的文件 +Type=ShellScript/bash +X-KDE-ScriptName=html-tidy.sh diff --git a/kate/scripts/html-tidy.sh b/kate/scripts/html-tidy.sh new file mode 100644 index 0000000..02f9282 --- /dev/null +++ b/kate/scripts/html-tidy.sh @@ -0,0 +1,64 @@ +#!/bin/bash + +# Kate script interface to html tidy +# Version 1 - 13/10/03 +# by David Ross http://www.rossy.co.uk +# modified by Christoph Cullmann for Kate 2.2 (KDE 3.2) +# Version 1.1 - 15/10/03 +# Added a help message if tidy isn't installed. + +################ +# Start Config # +################ + +# Path to tidy - just use "tidy" if it is in your path +tidy="tidy" + +# Specify any options you want to pass to tidy +tidyoptions="-iu --wrap 0 --doctype transitional" + +# File to write errors to +errfile=/tmp/$$.err +infile=/tmp/$$.in +outfile=/tmp/$$.out + +# Clean up when done or when aborting. +trap "rm -f $outfile; rm -f $infile; rm -f $errfile" 0 1 2 3 15 + +# Do you want a prompt before showing errors +# If you don't have "kdialog" set to 0 +errprompt=1 + +############## +# Start Code # +############## + +# Is tidy installed +if [ `$tidy -v | grep -c "HTML Tidy"` -ne 1 ];then +kdialog --msgbox "HTML Tidy could not be found. +Please download install HTML tidy into your path, tidy can be downloaded from http://tidy.sf.net" +else +# Get the active document number +doc=`dcop $1 KateDocumentManager activeDocumentNumber` + +# Get the current html from kate +dcop $1 EditInterface#$doc text > $infile + +# Run the html through tidy +cat $infile | $tidy $tidyoptions > $outfile 2> $errfile + +# Only send back the tidied version if there is valid html +if [ `cat $outfile|grep -c "DOCTYPE"` -gt 0 ];then +dcop $1 EditInterface#$doc setText "`cat $outfile`" +fi + +# Open a new document with the error code should errors arise +if [ `cat $errfile|grep -c "No warnings or errors were found"` -eq 0 ];then +if [ $errprompt -eq 1 ];then +kdialog --yesno "Errors were found. Do you want to see them?" +fi +if [ $? -eq 0 ] || [ $errprompt -eq 0 ];then +dcop $1 KateDocumentManager openURL "$errfile" "" +fi +fi +fi diff --git a/kate/snippets/CWidgetSnippetsBase.ui b/kate/snippets/CWidgetSnippetsBase.ui new file mode 100644 index 0000000..7f370f9 --- /dev/null +++ b/kate/snippets/CWidgetSnippetsBase.ui @@ -0,0 +1,214 @@ + +CWidgetSnippetsBase + + + CWidgetSnippetsBase + + + true + + + + 0 + 0 + 531 + 740 + + + + Snippets + Snippets for Kate + + + image0 + + + + unnamed + + + 0 + + + + splitter13 + + + Vertical + + + + + Snippet + + + true + + + false + + + + lvSnippets + + + 13 + + + false + + + 2 + + + 0 + + + Manual + + + true + + + true + + + true + + + AllColumns + + + 20 + + + Accept + + + A list of Snippets + + + A list of Snippets, what else + + + + + layout24 + + + + unnamed + + + 0 + + + + layout11 + + + + unnamed + + + 0 + + + + btnNew + + + + + + image1 + + + + + btnSave + + + + + + image2 + + + + + btnDelete + + + + + + image3 + + + + + spacer1_2 + + + Horizontal + + + Expanding + + + + 200 + 20 + + + + + + + + teSnippetText + + + true + + + PlainText + + + false + + + + + + + + + + 789c7dd4476fdb401005e0bb7e05e1bd19c158ec5c0439b897b8c9dd0e725816c94d6e926b90ff9ed9d9478a0e83686d409fe6f189c2aeb430ef9dedef78f30bbdc9d44caf0aafb8344fde7cf93c1ebffff8f9ed576fcecf3cfe4b032f98fbd29b1b4cbdc2dbbdbfab2c4831545f1ee2657196e8c488f7acfd7e52c21bb5d3d05a0dad031debc8cd2bebd00fb2c0f5ddc2057ce49cf9995c4f191cc363b10efb8116dfc111bcef9ce92c177fb78efcc6723f9189faa12f367004af386b5f47e2dc3a0e78eefa3f9cb5d685f8596c1a3f582781f18dbbfe526ce2129fffcab99917700cbf58a761e2c7b219740f6bb86cecfaa67089f9b538e7fd707eb7cec2348697600df71b4b9faae0fafa35715ecf6913aef73b74ce7ce4d71bbbf9161ca39fac75d4cc0f60cce9acb63b3fb4036b78575c6465eaf6f3d059fb706c9d470656aa36cecf051c637f13d8c0917511e709f6f35c5ce606fba3adcb38aff3a9739118c92b533b77f347715504e85b84eb7e1fae70bd9c878ab7af28c5396c9ce9585c9549ee1cc006ef770a57452c7eb21e268d4f9cab007d03980f9078049b52beffaaac5d25327f150f9bebb79d8701e66f8dddefc7044ee055d80c5dfe06e687fbf121e5d6603a5b64289fbde67e97a8a092aad9ab9c18d2882e3bb92bbaa61bba95d631dd71e686d77d27f7c07d765271ea919e68229a7672cfd267d70be75ee94d9ebfd7f74d0ab90ff4d98ec5a66f89df7ff9536e057dabb4d6ea5be7dcc65fb99233139e6fb6fab63a7ddfb96f9bd788765a7dbbecbd4fb97dee1bd180d741abefb0d377c47dc77442a77486be73fe14179dfbb3c93ef91450c87d1167624a28edf4d995f167d5fc44d19a322a57852a3fdf5f730eb85355dc75c4d7d4ffcbed5c93ccd49067aabbeadcec6cfd7bcd72ff4fb673ed64fbc4ca79f9fdb5f707a32dabb2 + + + 789c5dd24b6fe2301000e03bbf222237b4a22d2259a2d51e80044a5b28ed69a5d51efc248f8600061a5aed7fdf8cc793a28da3c8df783cb623dff4bc5feba5d7bbe998233b66c213293b783d792acbcbef3f3f3f3bddbbd06bde61f3ed7eeb74fb9ef056d55641bf6cfafe773e0a2201fc20b221903b46c87720139c09093c00f990281c1592116500f42da51820f78e21f20c148160d2ee6ae6a8904f9692b824aa10b846ca018e268e218ec64019105347867c6969e7be5a2a1add39ba85b29636b940aa01b202aa6619e485a8eddc8d23436a4b45cc1d15f204d421718bd403ad8147475759b5b4a3c65247c1ed2db0768c9013a408915347869448cdb0d4d851df8d808fc48001e7c47000bc278e38f08118d99bb320727b375644bc2acf44bc0c6f44dc46bf797c868d377d8a89e6dfeb4d9a09fe15f3a554f9a6c87c9f7fe5bd2995e75956f2925fe76df36a97ee0f25c58c39aafc541467f68e79a6eed7469a3abf6467dfffb07f773c31e3b1998e4d9ccc667b9737bf5f2c1e1eeb2c4de2a7a5ab67a6abe78929b2348de3f575debc866012ff576f97256d1eacab4d5d14e94b1c5fedafaa8a62f7dad68373e41a826d3d88c139a975fffee8fc0371b41110 + + + 789c5dd44b53db301007f07b3e8507df980e58b625dbd3e9018815de2101c2a3d3c35a9209818400e1d9e9776f76572a505fe2df7f572b3913677d353a3f3a8856d73b8f0b585c9bc88ce1215ab54fd3e9dbcf5f3f7e7756848a4411a93c122bdf3a2b6b91890eef660eeff5f23e4ee84296c4322905b1468a44e4a244a6c43270e059328f9169224c46bbec11abb44c2be433321359921113642e322353e41911f25211f3c0b2413aa6945c554899caa4c89085a764021164c5cde61f0129032b83cc3c2d3346aa545a6ebe662ac13c0ce4e67d22280939b2f2acf8cca7815c1d228bac10406b0f884d219923cfaaa1e62d4fcb7c419659e011b3148d4576894d29993b9e15731b59e5953012f9ee29991744132890b0fca20dadbd241a00663fd052f32bb2c9c1311f988d62be116d03967e66b748231bc79c324dea1472e2a9988f441b78efe9980ba495069863a64d1d4d7ef254cc19d105ce3d817917d8d2a82b4fc7d50da453d66f74eee9b8f984e9fcbebd40ae369e8ab9ebe9d75aa20bd54d4f7f8c1b64dbb6d0b6c8d6b365aef92bf69f9f3268ccffd9f271daf86b06576e39ca7ccee2f135cd8f3f329898f6864213b2f8763a89db9bd9dd6c7e1f73060fb7f03831f78ba7f9fcf9855fa1d737b0307e8f9b8dcde7ad6e4d7f3253e8f51ad8de31bb7bfb0775975e266d7bfd9e85a3adc170587779deb19e9ff47b7d189e8eea33edf7d5fabc777139381cd589d6da9f4febbe48b351adf547b60c07b9acd5976c19eed485fe9aade9b2c2009ff7cff7ce5fcf2134c0 + + + 789c5dd1514fdb301007f0f77e8aa879aba6423b9a0d211e70431b284c7b44427b70ec334e89db244da165da77c7e7b393322791fcf3fd7d4e94b351f4f4fb311a9d0d762d6f0b1109cd9b6824f7c61c9fff5cff1d0c274964ef8bf36832fc36188e2311fdda6e00e78d9dc73fbeff9c5c0ae4bb631e283c67c41b2417792224f20d995f04724f20e68172868c1d65e09628a6c4bd6742fc408a99e0c47947f7ceb79e405c38cac07ba29c12d3404890779e09551f02a9aa917216987972e2c61388b52304161d5d67438429f188842470e59910db40e55abd7872a27204e0142e03a95a7902f1405453e22b52d96394422e89a1baebe8aae0991099a33ab703b9262a4e55e9a988e371cce31c1f31c6416bf68f817ad10517fd5a2cd7f05a9a4dbc155f725555178d68c4696e57b5b5debfbd9fe60e87a3f9e0377d8e31bbb9652c8e9b2eb766ac2c199bcff77d0e76cc0e9dde2efa7eb0ac18cbb2bb74f15faec8749af6fda0c4bdb5d6f77d6ec9d8cad8dd0fbaefc7586b4c6d4f39c955ed6a658acc36ecfae17786cbaefdbb1a7c029001f396 + + + + CWidgetSnippetsBase.ui.h + + + lalala() + + + init() + + + insertItem( const QString& name, bool bRename ) + + + diff --git a/kate/snippets/CWidgetSnippetsBase.ui.h b/kate/snippets/CWidgetSnippetsBase.ui.h new file mode 100644 index 0000000..816d7d8 --- /dev/null +++ b/kate/snippets/CWidgetSnippetsBase.ui.h @@ -0,0 +1,28 @@ +/**************************************************************************** +** ui.h extension file, included from the uic-generated form implementation. +** +** If you wish to add, delete or rename functions or slots use +** Qt Designer which will update this file, preserving your code. Create an +** init() function in place of a constructor, and a destroy() function in +** place of a destructor. +*****************************************************************************/ + + + +void CWidgetSnippetsBase::init() +{ + +} + + +QListViewItem* CWidgetSnippetsBase::insertItem( const QString& name, bool bRename ) +{ + QListViewItem *item = new QListViewItem(lvSnippets, name); + item->setRenameEnabled(0,true); + lvSnippets->setSelected( item, true ); + if ( bRename ) { + teSnippetText->clear(); + item->startRename (0); + } + return item; +} diff --git a/kate/snippets/Makefile.am b/kate/snippets/Makefile.am new file mode 100644 index 0000000..23bc3cf --- /dev/null +++ b/kate/snippets/Makefile.am @@ -0,0 +1,17 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = katesnippetsplugin.la + +katesnippetsplugin_la_SOURCES = plugin_katesnippets.cpp CWidgetSnippetsBase.ui cwidgetsnippets.h cwidgetsnippets.cpp csnippet.h csnippet.cpp CWidgetSnippetsBase.ui.h +katesnippetsplugin_la_LIBADD = -lkateinterfaces +katesnippetsplugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +pluginsdir = $(kde_datadir)/kate/plugins/katesnippets +plugins_DATA = plugin_katesnippets.rc + +kde_services_DATA = katesnippets.desktop + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/katesnippets.pot diff --git a/kate/snippets/csnippet.cpp b/kate/snippets/csnippet.cpp new file mode 100644 index 0000000..fc7d7e7 --- /dev/null +++ b/kate/snippets/csnippet.cpp @@ -0,0 +1,17 @@ +/*************************************************************************** + * Copyright (C) 2004 by Stephan Mres * + * Erdling@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. * + ***************************************************************************/ +#include "csnippet.h" + +CSnippet::CSnippet(QString sKey, QString sValue, QListViewItem *lvi, QObject *parent, const char *name) + : QObject(parent, name), _sKey(sKey), _sValue(sValue), _lvi(lvi) {} + +CSnippet::~CSnippet() {} + +#include "csnippet.moc" diff --git a/kate/snippets/csnippet.h b/kate/snippets/csnippet.h new file mode 100644 index 0000000..a139f03 --- /dev/null +++ b/kate/snippets/csnippet.h @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2004 by Stephan Mres * + * Erdling@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 CSNIPPET_H +#define CSNIPPET_H + +#include +#include +#include +#include + +/** +@author Stephan Mres +*/ + +class CSnippet : public QObject { + Q_OBJECT +public: + CSnippet(QString sKey, QString sValue, QListViewItem *lvi, QObject *parent = 0, const char *name = 0); + ~CSnippet(); + QString getKey() { return _sKey; } + QString getValue() { return _sValue; } + QListViewItem* getListViewItem() const { return _lvi; } + void setKey(const QString& sKey) { _sKey = sKey; } + void setValue(const QString& sValue) { _sValue = sValue; } + +protected: + QString _sKey; + QString _sValue; + QListViewItem *_lvi; +}; + +#endif diff --git a/kate/snippets/cwidgetsnippets.cpp b/kate/snippets/cwidgetsnippets.cpp new file mode 100644 index 0000000..cf44319 --- /dev/null +++ b/kate/snippets/cwidgetsnippets.cpp @@ -0,0 +1,22 @@ +/*************************************************************************** + * Copyright (C) 2004 by Stephan Mres * + * Erdling@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. * + ***************************************************************************/ +#include "cwidgetsnippets.h" + +CWidgetSnippets::CWidgetSnippets( QWidget* parent, const char* name, WFlags fl) + : CWidgetSnippetsBase(parent, name, fl) +{ +} + + +CWidgetSnippets::~CWidgetSnippets() +{ +} + + diff --git a/kate/snippets/cwidgetsnippets.h b/kate/snippets/cwidgetsnippets.h new file mode 100644 index 0000000..6d246c3 --- /dev/null +++ b/kate/snippets/cwidgetsnippets.h @@ -0,0 +1,26 @@ +/*************************************************************************** + * Copyright (C) 2004 by Stephan Mres * + * Erdling@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 CWIDGETSNIPPETS_H +#define CWIDGETSNIPPETS_H + +#include + +/** +@author Stephan Mres +*/ +class CWidgetSnippets : public CWidgetSnippetsBase { +public: + CWidgetSnippets( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + + ~CWidgetSnippets(); + +}; + +#endif diff --git a/kate/snippets/katesnippets.desktop b/kate/snippets/katesnippets.desktop new file mode 100644 index 0000000..4479b06 --- /dev/null +++ b/kate/snippets/katesnippets.desktop @@ -0,0 +1,101 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=katesnippetsplugin +X-Kate-Version=2.5 +Name=Kate Snippets +Name[ca]=Retalls del Kate +Name[cs]=Kate útržky +Name[da]=Kate-Stumper +Name[de]=Kate-Schnipsel +Name[el]=Δείγματα Kate +Name[eo]=Erilo por Kodredaktilo +Name[es]=Recorte de Kate +Name[et]=Kate koodijupid +Name[fa]=تکه‌های Kate +Name[fi]=Kate tekstipalat +Name[fr]=Fragments de codes pour Kate +Name[fy]=Kate-fragminten +Name[ga]=Blúirí Kate +Name[gl]=Anacos para Kate +Name[he]=טקעי קוד של Kate +Name[hr]=Kate isječci +Name[hu]=Kate-kódrészletek +Name[is]=Kate úrklippur +Name[it]=Frammenti di testo di Kate +Name[ja]=Kate 定型表現 +Name[ka]=Kate ფრაგმენტები +Name[km]=អត្ថបទ​ខ្លីៗ​របស់ Kate +Name[lt]=Kate teksto fragmentai +Name[mk]=Парчиња за Кате +Name[nb]=Kate-biter +Name[nds]=Kate-Snippets +Name[ne]=केट स्निपेट +Name[nl]=Kate-fragmenten +Name[nn]=Kate-snuttar +Name[pa]=ਕੇਟ ਸਨੇਪਿੱਟ +Name[pl]=Fragmenty kodu dla Kate +Name[pt]=Pedaços do Kate +Name[pt_BR]=Trechos de Código (snippets) do Kate +Name[ru]=Фрагменты текста Kate +Name[sk]=Kate štipka +Name[sl]=Odsek za Kate +Name[sr]=Исечци за Kate +Name[sr@Latn]=Isečci za Kate +Name[sv]=Kate-snuttar +Name[ta]=கேட் சிறுகுறிப்புகள் +Name[tr]=Kate Parçacıkları +Name[uk]=Kate-Snippets +Name[vi]=Đoạn Kate +Name[zh_CN]=Kate 段 +Comment=Configurable Text-Snippets for Kate +Comment[bg]=Потребителски текстови пасажи за Kate +Comment[ca]=Retalls de text configurables per al Kate +Comment[cs]=Nastavitelné textové útržky v Kate +Comment[da]=Indstillelige tekststumper for Kate +Comment[de]=Konfigurierbare Textschnipsel für Kate +Comment[el]=Ρυθμιζόμενα δείγματα κειμένου για το Kate +Comment[eo]=Agordeblaj tekseroj por Kodredaktilo +Comment[es]=Recortes de texto para Kate +Comment[et]=Kate seadistatavad tekstijupid +Comment[eu]=Text-Snippets konfiguragarria Katerako +Comment[fa]=تکه‌های متن قابل پیکربندی برای Kate +Comment[fi]=Aseteltavia tekstipaloja Kateen +Comment[fr]=Fragments de codes configurables pour Kate +Comment[fy]=Ynstelbere tekstfragminten foar Kate +Comment[ga]=Blúirí Inchumraithe Téacs do Kate +Comment[gl]=Pedazos de Texto Configurábeis para Kate +Comment[he]=הגדרת קטעי קוד עבור Kate +Comment[hi]=केएटीई हेतु कॉन्फ़िगर करने योग्य टैक्स्ट-स्निपेट्स +Comment[hr]=Konfigurabilni tekstualni isječci za Kate +Comment[hu]=Beállítható szövegrészletek a Kate-hez +Comment[is]=Stillanlegar texta úrklippur fyrir Kate +Comment[it]=Frammenti di testo configurabili per Kate +Comment[ja]=よく使う表現を登録しておきます +Comment[ka]=კონფიგურირებადი ტექსტის ფრაგმენტები Kate-სთვის +Comment[kk]=Бапталатын Kate мәтін-фрагменттері +Comment[km]=អត្ថបទ​ខ្លីៗ​​ដែល​អាច​កំណត់​រចនា​សម្ព័ន្ធ​បាន​សម្រាប់ Kate +Comment[lt]=Konfigūruoti Kate teksto fragmentų priedą +Comment[mk]=Конфигурабилни парчиња текст за Кате +Comment[ms]=Teks-Snippets boleh konfigur untuk Kate +Comment[nb]=Innstillbare tekstbiter til Kate +Comment[nds]=Instellbor Textsnippels för Kate +Comment[ne]=केटका लागि कन्फिगर योग्य पाठ- खण्ड +Comment[nl]=Instelbare tekstfragmenten voor Kate +Comment[nn]=Tilpassbare tekstsnuttar til Kate +Comment[pl]=Konfigurowalne fragmenty kodu dla Kate +Comment[pt]=Pedaços de Texto Configuráveis para o Kate +Comment[pt_BR]=Snippets configuráveis para o Kate +Comment[ru]=Настраиваемые фрагменты текста для Kate +Comment[sk]=Konfigurovateľná textová štipka pre Kate +Comment[sl]=nastavljivi besedilni odseki za Kate +Comment[sr]=Подесиви исечци текста за Kate +Comment[sr@Latn]=Podesivi isečci teksta za Kate +Comment[sv]=Anpassningsbara textsnuttar för Kate +Comment[ta]=வடிவமைக்கக்கூடிய கேட்டுக்கான உரை-குறிப்புகள் +Comment[tr]=Kate için Yapılandırılabilir Kod Parçacıkları +Comment[uk]=Текстові уривки для Kate, які можна налаштовувати +Comment[vi]=Đoạn văn bản có thể cấu hình cho Kate +Comment[zh_CN]=可配置的 Kate 文本段 +Comment[zh_TW]=設定 Kate Text-Snippets +author=Stephan Möres, Erdling@gmx.net diff --git a/kate/snippets/plugin_katesnippets.cpp b/kate/snippets/plugin_katesnippets.cpp new file mode 100644 index 0000000..07cba2b --- /dev/null +++ b/kate/snippets/plugin_katesnippets.cpp @@ -0,0 +1,321 @@ +/* + * Copyright (C) 2004 Stephan Mres + */ + +#include "plugin_katesnippets.h" + +#include +#include +#include +#include + + +// let the world know ... +K_EXPORT_COMPONENT_FACTORY(katesnippetsplugin, KGenericFactory( "katesnippets" ) ) + + +// < IMPLEMENTAIONS for KatePluginSnippetsView > +// +// + +/** + * ctor KatePluginSnippetsView + * @param w + * @return + */ +KatePluginSnippetsView::KatePluginSnippetsView(Kate::MainWindow *w, QWidget *dock) : CWidgetSnippets(dock,"snippetswidget") + , dock (dock) +{ + setInstance (new KInstance("kate")); + setXMLFile("plugins/katesnippets/plugin_katesnippets.rc"); + + w->guiFactory()->addClient (this); + win = w; + + + // + connect ( + lvSnippets, SIGNAL( selectionChanged(QListViewItem *) ), + this, SLOT( slot_lvSnippetsSelectionChanged(QListViewItem *) ) + ); + connect ( + lvSnippets, SIGNAL( doubleClicked (QListViewItem *) ), + this, SLOT( slot_lvSnippetsClicked(QListViewItem *) ) + ); + connect ( + lvSnippets, SIGNAL( itemRenamed(QListViewItem *, int, const QString &) ), + this, SLOT( slot_lvSnippetsItemRenamed(QListViewItem *, int, const QString &) ) + ); + + connect ( + btnNew, SIGNAL( clicked () ), + this, SLOT( slot_btnNewClicked() ) + ); + connect ( + btnSave, SIGNAL( clicked () ), + this, SLOT( slot_btnSaveClicked() ) + ); + connect ( + btnDelete, SIGNAL( clicked () ), + this, SLOT( slot_btnDeleteClicked() ) + ); + // + + lSnippets.setAutoDelete( TRUE ); // the list owns the objects + + config = new KConfig("katesnippetspluginrc"); + readConfig(); + + // set text of selected item at startup + slot_lvSnippetsSelectionChanged(lvSnippets->selectedItem() ); +} + + +/** + * dtor KatePluginSnippetsView + * @return + */ +KatePluginSnippetsView::~ KatePluginSnippetsView() { + writeConfig(); + + win->guiFactory()->removeClient(this); +} + + +// +// +// < IMPLEMENTAIONS for KatePluginSnippetsView > + + + + +// < IMPLEMENTAIONS for KatePluginSnippets > +// +// + +/** + * ctor KatePluginSnippets + * @param parent + * @param name + * @return + */ +KatePluginSnippets::KatePluginSnippets( QObject* parent, const char* name, const QStringList& ) + : Kate::Plugin ( (Kate::Application*)parent, name ) {} + +/** + * dtor KatePluginSnippets + * @return + */ +KatePluginSnippets::~KatePluginSnippets() {} + +/** + * + * @param win + */ +void KatePluginSnippets::addView(Kate::MainWindow *win) +{ + QWidget *dock = win->toolViewManager()->createToolView( + "kate_plugin_snippets", + Kate::ToolViewManager::Left, + SmallIcon("contents"), + i18n("Snippets")); + + KatePluginSnippetsView *view = new KatePluginSnippetsView (win,dock); + m_views.append(view); +} + + +/** + * + * @param win + */ +void KatePluginSnippets::removeView(Kate::MainWindow *win) { + for (uint z=0; z < m_views.count(); z++) + if (m_views.at(z)->win == win) { + KatePluginSnippetsView *view = m_views.at(z); + m_views.remove (view); + delete view->dock; + } +} + +/** + * + * @param item + */ +void KatePluginSnippetsView::slot_lvSnippetsSelectionChanged(QListViewItem * item) { + CSnippet *snippet; + if ( (snippet = findSnippetByListViewItem(item))!= NULL ) { + teSnippetText->setText(snippet->getValue()); + } + +} + + +/** + * Special meaning of and ... + * @param item + */ +void KatePluginSnippetsView::slot_lvSnippetsClicked (QListViewItem * item) { + Kate::View *kv = win->viewManager()->activeView(); + CSnippet *snippet; + + if (kv) { + if ( (snippet = findSnippetByListViewItem(item))!= NULL ) { + QString sText = snippet->getValue(); + QString sSelection = ""; + + if ( kv->getDoc()->hasSelection() ) { + sSelection = kv->getDoc()->selection(); + // clear selection + kv->keyDelete(); + } + + sText.replace( QRegExp(""), sSelection ); + sText.replace( QRegExp(""), QDate::currentDate().toString(Qt::LocalDate) ); + sText.replace( QRegExp("