From 114a878c64ce6f8223cfd22d76a20eb16d177e5e 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/kdevelop@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- .../cpp/app_templates/kpartplugin/.kdev_ignore | 0 .../cpp/app_templates/kpartplugin/Makefile.am | 19 ++ .../kpartplugin/hi16-action-plugin.png | Bin 0 -> 292 bytes .../kpartplugin/hi22-action-plugin.png | Bin 0 -> 1151 bytes .../kpartplugin/kpartplugin.kdevtemplate | 204 +++++++++++++++++++++ .../cpp/app_templates/kpartplugin/kpartplugin.png | Bin 0 -> 16772 bytes .../cpp/app_templates/kpartplugin/plugin.kdevelop | 114 ++++++++++++ .../cpp/app_templates/kpartplugin/plugin_app.cpp | 109 +++++++++++ .../cpp/app_templates/kpartplugin/plugin_app.h | 34 ++++ .../cpp/app_templates/kpartplugin/plugin_app.rc | 11 ++ .../cpp/app_templates/kpartplugin/src-Makefile.am | 22 +++ languages/cpp/app_templates/kpartplugin/subdirs | 3 + 12 files changed, 516 insertions(+) create mode 100644 languages/cpp/app_templates/kpartplugin/.kdev_ignore create mode 100644 languages/cpp/app_templates/kpartplugin/Makefile.am create mode 100644 languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png create mode 100644 languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png create mode 100644 languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate create mode 100644 languages/cpp/app_templates/kpartplugin/kpartplugin.png create mode 100644 languages/cpp/app_templates/kpartplugin/plugin.kdevelop create mode 100644 languages/cpp/app_templates/kpartplugin/plugin_app.cpp create mode 100644 languages/cpp/app_templates/kpartplugin/plugin_app.h create mode 100644 languages/cpp/app_templates/kpartplugin/plugin_app.rc create mode 100644 languages/cpp/app_templates/kpartplugin/src-Makefile.am create mode 100644 languages/cpp/app_templates/kpartplugin/subdirs (limited to 'languages/cpp/app_templates/kpartplugin') diff --git a/languages/cpp/app_templates/kpartplugin/.kdev_ignore b/languages/cpp/app_templates/kpartplugin/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kpartplugin/Makefile.am b/languages/cpp/app_templates/kpartplugin/Makefile.am new file mode 100644 index 00000000..170bdd6d --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h \ + plugin_app.rc hi16-action-plugin.png hi22-action-plugin.png \ + kpartplugin.png plugin.kdevelop subdirs + +templateName = kpartplugin + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png b/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png new file mode 100644 index 00000000..e2d7bab8 Binary files /dev/null and b/languages/cpp/app_templates/kpartplugin/hi16-action-plugin.png differ diff --git a/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png b/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png new file mode 100644 index 00000000..4082bf10 Binary files /dev/null and b/languages/cpp/app_templates/kpartplugin/hi22-action-plugin.png differ diff --git a/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate b/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate new file mode 100644 index 00000000..f331c6cf --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/kpartplugin.kdevtemplate @@ -0,0 +1,204 @@ +# KDE Config File +[General] +Name=KHTMLPart plugin +Name[br]=Lugent KHTMLPart +Name[ca]=Connector per a KHTMLPart +Name[de]=KHTMLPart-Modul +Name[el]=Πρόσθετο KHTMLPart +Name[es]=Complemento para KHTMLPart +Name[eu]=KHTMLPart plugina +Name[fa]=وصلۀ KHTMLPart +Name[fr]=Module externe pour le composant KHTML +Name[ga]=Breiseán KHTMLPart +Name[gl]=Extensión para KHTMLPart +Name[hu]=KHTML-bővítőmodul +Name[it]=Plugin KHTMLPart +Name[ja]=KHTMLPart プラグイン +Name[nds]=KHTMLPart-Moduul +Name[ne]=KHTMLPart प्लगइन +Name[nl]=KHTMLPart-plugin +Name[pl]=Wtyczka do KHTMLPart +Name[pt]='Plugin' do KHTMLPart +Name[pt_BR]='Plugin' do KHTMLPart +Name[ru]=Модуль KHTMLPart +Name[sk]=KHTMLPart modul +Name[sl]=Vstavek za KHTMLPart +Name[sr]=Прикључак за део KHTML +Name[sr@Latn]=Priključak za deo KHTML +Name[sv]=Insticksprogram för KHTML-delprogram +Name[tr]=KHTMLPart Eklentisi +Name[zh_CN]=KHTMLPart 插件 +Name[zh_TW]=KHTMLPart 外掛程式 +Icon=kpartplugin.png +Category=C++/KDE +Comment=Generates a plugin for the KHTML part. +Comment[ca]=Genera un connector per a la part KHTML. +Comment[da]=Genererer et plugin for KHTML parten. +Comment[de]=Erstellt ein Modul für die Komponente KHTML +Comment[el]=Δημιουργεί ένα πρόσθετο για το τμήμα KHTML. +Comment[es]=Genera un complemento para KHTMLPart. +Comment[et]=KHTML-komponendi plugina loomine. +Comment[eu]=KHTML zatirako plugin bat sortzen du. +Comment[fa]=یک وصله برای جزء KHTML تولید می‌کند +Comment[fr]=Génère un module externe pour le composant KHTML. +Comment[gl]=Xera unha extensión para o 'part' KHTML. +Comment[hu]=Létrehoz egy KHTML-bővítőmodult. +Comment[it]=Genera un plugin per la part KHTML. +Comment[ja]=KHTML パートのためのプラグインを作成します +Comment[nds]=Stellt en Moduul för de Komponent KHTML op. +Comment[ne]=KHTML भागका लागि प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Genereert een plugin voor de KHTML-part. +Comment[pl]=Generuje wtyczkę do KHTML part. +Comment[pt]=Gera um 'plugin' para a componente KHTML. +Comment[pt_BR]=Gera um 'plugin' para a componente KHTML. +Comment[ru]=Создание модуля для компонента KHTML. +Comment[sk]=Vygeneruje modul pre KHTML part. +Comment[sr]=Прави прикључак за део KHTML. +Comment[sr@Latn]=Pravi priključak za deo KHTML. +Comment[sv]=Skapar ett insticksprogram för KHTML-delprogrammet +Comment[zh_CN]=生成 KHTML 部件的插件。 +Comment[zh_TW]=產生一個 KHTML part 的外掛程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}.cpp +Archive=kpartplugin.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/plugin_app.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp + +[FILE13] +Type=install +Source=%{src}/plugin_app.h +Dest=%{dest}/src/plugin_%{APPNAMELC}.h + +[FILE14] +Type=install +EscapeXML=true +Source=%{src}/plugin_app.rc +Dest=%{dest}/src/plugin_%{APPNAMELC}.rc + +[FILE15] +Type=install +Source=%{src}/hi16-action-plugin.png +Dest=%{dest}/src/hi16-action-plugin.png +Process=false + +[FILE16] +Type=install +Source=%{src}/hi22-action-plugin.png +Dest=%{dest}/src/hi32-action-plugin.png +Process=false + +[MSG] +Type=message +Comment=A KHTMLPart plugin was created in %{dest} +Comment[ca]=Un connector per a KHTMLPart ha estat creat en %{dest} +Comment[da]=Et KHTMLPart plugin blev oprettet i %{dest} +Comment[de]=Ein Modul für die Komponente KHTML wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο τμήμα KHTML δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento para KHTMLPart ha sido creado en %{dest} +Comment[et]=KHTMLPart plugin loodi asukohta %{dest} +Comment[eu]=KHTMLPart plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ جزء KHTML در %{dest} ایجاد شد +Comment[fr]=Un module externe pour KHTMLPart a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán KHTMLPart i %{dest} +Comment[gl]=Creouse unha extensión para KHTMLPart en %{dest} +Comment[hu]=Létrejött egy KHTML-bővítőmodul itt: %{dest} +Comment[it]=È stato creato un plugin KHTMLPart in %{dest} +Comment[ja]=KHTMLPart プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en KHTMLPart-Moduul opstellt +Comment[ne]=KHTMLPart प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een KHTMLPart-plugin is aangemaakt in %{dest} +Comment[pl]=Wtyczka do KHTMLPart została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' KHTMLPart em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' KHTMLPart em %{dest} +Comment[ru]=Модуль для компонента KHTML создан в %{dest} +Comment[sk]=KHTML modul bol vytvorený v %{dest} +Comment[sr]=Прикључак за део KHTML направљен је у %{dest} +Comment[sr@Latn]=Priključak za deo KHTML napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för KHTML-delprogrammet skapades i %{dest} +Comment[tr]=Bir KHTMLPart eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 KHTMLPart 插件 +Comment[zh_TW]=一個 KHTML 外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kpartplugin/kpartplugin.png b/languages/cpp/app_templates/kpartplugin/kpartplugin.png new file mode 100644 index 00000000..7d90241a Binary files /dev/null and b/languages/cpp/app_templates/kpartplugin/kpartplugin.png differ diff --git a/languages/cpp/app_templates/kpartplugin/plugin.kdevelop b/languages/cpp/app_templates/kpartplugin/plugin.kdevelop new file mode 100644 index 00000000..dc1b3e25 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/plugin.kdevelop @@ -0,0 +1,114 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + + src/lib%{APPNAMELC}.la + debug + + + + optimized + kdevgccoptions + kdevgppoptions + kdevg77options + -O2 -g0 + + + --enable-debug=full + debug + kdevgccoptions + kdevgppoptions + kdevg77options + -O0 -g3 + + + + + + + + + + + + + + + ada + ada_bugs_gcc + bash + bash_bugs + clanlib + fortran_bugs_gcc + gnome1 + gnustep + gtk + gtk_bugs + haskell + haskell_bugs_ghc + java_bugs_gcc + java_bugs_sun + opengl + pascal_bugs_fp + php + php_bugs + perl + perl_bugs + python + python_bugs + ruby + ruby_bugs + sdl + stl + sw + w3c-dom-level2-html + w3c-svg + w3c-uaag10 + wxwidgets_bugs + + + qmake User Guide + + + + + libtool + + + + + + + + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + + diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.cpp b/languages/cpp/app_templates/kpartplugin/plugin_app.cpp new file mode 100644 index 00000000..a9ee55a3 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/plugin_app.cpp @@ -0,0 +1,109 @@ + +#include "plugin_%{APPNAMELC}.h" + +#include +#include +#include +#include +#include +#include + +Plugin%{APPNAME}::Plugin%{APPNAME}( QObject* parent, const char* name ) + : Plugin( parent, name ) +{ + // Instantiate all of your actions here. These will appear in + // Konqueror's menu and toolbars. + (void) new KAction( i18n("&Plugin Action"), "%{APPNAMELC}", 0, + this, SLOT(slotAction()), + actionCollection(), "plugin_action" ); +} + +Plugin%{APPNAME}::~Plugin%{APPNAME}() +{ +} + +void Plugin%{APPNAME}::slotAction() +{ + // This plugin assumes KHTMLPart. If your plugin can handle more + // than this or a different Part than this, simply delete or + // change the following block. + if ( !parent()->inherits("KHTMLPart") ) + { + QString title( i18n( "Cannot Translate Source" ) ); + QString text( i18n( "You cannot translate anything except web pages " + "with this plugin." ) ); + + KMessageBox::sorry( 0, text, title ); + return; + } + + // Get a handle on our parent so we may get the necessary data for + // processing + KHTMLPart *part = dynamic_cast(parent()); + + // This plugin only uses the URL. You may use whatever data you + // need. + KURL url( part->url() ); + + // This is a standard check to make sure we are dealing with a + // valid URL + if ( !url.isValid() ) + { + QString title( i18n( "Malformed URL" ) ); + QString text( i18n( "The URL you entered is not valid, please " + "correct it and try again" ) ); + + KMessageBox::sorry( 0, text, title ); + return; + } + +// The following block is very plugin specific. In this example, we +// translate the current page with AltaVista's BabelFish. You will +// definitely want to change this. +// BEGIN + KURL work( "http://babel.altavista.com/translate.dyn" ); + + QString query( "urltext=" ); + query += KURL::encode_string( url.url() ); + work.setQuery( query ); +// END + + // Finally, execute the request + part->openURL( work ); +} + +%{APPNAME}Factory::%{APPNAME}Factory() + : KLibFactory() +{ +} + +%{APPNAME}Factory::~%{APPNAME}Factory() +{ + delete s_instance; + s_instance = 0; +} + +QObject* %{APPNAME}Factory::createObject( QObject* parent, const char* name, const char*, const QStringList & ) +{ + return new Plugin%{APPNAME}( parent, name ); +} + +KInstance *%{APPNAME}Factory::instance() +{ + if ( !s_instance ) + s_instance = new KInstance( "%{APPNAMELC}" ); + return s_instance; +} + +extern "C" +{ + void* init_lib%{APPNAMELC}plugin() + { + KGlobal::locale()->insertCatalogue("%{APPNAMELC}"); + return new %{APPNAME}Factory; + } +} + +KInstance* %{APPNAME}Factory::s_instance = 0L; + +#include "plugin_%{APPNAMELC}.moc" diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.h b/languages/cpp/app_templates/kpartplugin/plugin_app.h new file mode 100644 index 00000000..e70ad1c1 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/plugin_app.h @@ -0,0 +1,34 @@ + +#ifndef _PLUGIN_%{APPNAMEUC}_H_ +#define _PLUGIN_%{APPNAMEUC}_H_ + +#include +#include + +class Plugin%{APPNAME} : public KParts::Plugin +{ + Q_OBJECT +public: + Plugin%{APPNAME}( QObject* parent = 0, const char* name = 0 ); + virtual ~Plugin%{APPNAME}(); + +public slots: + void slotAction(); +}; + +class %{APPNAME}Factory : public KLibFactory +{ + Q_OBJECT +public: + %{APPNAME}Factory(); + virtual ~%{APPNAME}Factory(); + + virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() ); + + static KInstance* instance(); + +private: + static KInstance* s_instance; +}; + +#endif // _PLUGIN_%{APPNAMEUC}_H_ diff --git a/languages/cpp/app_templates/kpartplugin/plugin_app.rc b/languages/cpp/app_templates/kpartplugin/plugin_app.rc new file mode 100644 index 00000000..a38ee14e --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/plugin_app.rc @@ -0,0 +1,11 @@ + + + + &Tools + + + + + + + diff --git a/languages/cpp/app_templates/kpartplugin/src-Makefile.am b/languages/cpp/app_templates/kpartplugin/src-Makefile.am new file mode 100644 index 00000000..52e29c09 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/src-Makefile.am @@ -0,0 +1,22 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +KDE_ICON = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = lib%{APPNAMELC}plugin.la + +# This is all standard. Remove the LIB_KHTML reference if you are not +# using the KHTML Part +lib%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp +lib%{APPNAMELC}plugin_la_LIBADD = $(LIB_KPARTS) $(LIB_KHTML) +lib%{APPNAMELC}plugin_la_LDFLAGS = -module -avoid-version -no-undefined $(KDE_PLUGIN) $(all_libraries) + +# Install the .rc file in the Part's directory (in this case, the part +# is KHTMLPart) +pluginsdir = $(kde_datadir)/khtml/kpartplugins +plugins_DATA = plugin_%{APPNAMELC}.rc + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot diff --git a/languages/cpp/app_templates/kpartplugin/subdirs b/languages/cpp/app_templates/kpartplugin/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kpartplugin/subdirs @@ -0,0 +1,3 @@ +doc +po +src -- cgit v1.2.1