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/kateplugin2/.kdev_ignore | 0 .../cpp/app_templates/kateplugin2/Makefile.am | 19 ++ .../kateplugin2/hi16-action-plugin.png | Bin 0 -> 292 bytes .../kateplugin2/hi22-action-plugin.png | Bin 0 -> 1151 bytes .../kateplugin2/kateplugin2.kdevtemplate | 214 +++++++++++++++++++++ .../cpp/app_templates/kateplugin2/kateplugin2.png | Bin 0 -> 12901 bytes .../cpp/app_templates/kateplugin2/plugin.desktop | 76 ++++++++ .../cpp/app_templates/kateplugin2/plugin.kdevelop | 114 +++++++++++ .../cpp/app_templates/kateplugin2/plugin_app.cpp | 140 ++++++++++++++ .../cpp/app_templates/kateplugin2/plugin_app.h | 91 +++++++++ .../cpp/app_templates/kateplugin2/plugin_app.rc | 11 ++ .../cpp/app_templates/kateplugin2/src-Makefile.am | 21 ++ languages/cpp/app_templates/kateplugin2/subdirs | 3 + 13 files changed, 689 insertions(+) create mode 100644 languages/cpp/app_templates/kateplugin2/.kdev_ignore create mode 100644 languages/cpp/app_templates/kateplugin2/Makefile.am create mode 100644 languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png create mode 100644 languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png create mode 100644 languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate create mode 100644 languages/cpp/app_templates/kateplugin2/kateplugin2.png create mode 100644 languages/cpp/app_templates/kateplugin2/plugin.desktop create mode 100644 languages/cpp/app_templates/kateplugin2/plugin.kdevelop create mode 100644 languages/cpp/app_templates/kateplugin2/plugin_app.cpp create mode 100644 languages/cpp/app_templates/kateplugin2/plugin_app.h create mode 100644 languages/cpp/app_templates/kateplugin2/plugin_app.rc create mode 100644 languages/cpp/app_templates/kateplugin2/src-Makefile.am create mode 100644 languages/cpp/app_templates/kateplugin2/subdirs (limited to 'languages/cpp/app_templates/kateplugin2') diff --git a/languages/cpp/app_templates/kateplugin2/.kdev_ignore b/languages/cpp/app_templates/kateplugin2/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/kateplugin2/Makefile.am b/languages/cpp/app_templates/kateplugin2/Makefile.am new file mode 100644 index 00000000..29aea978 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/Makefile.am @@ -0,0 +1,19 @@ +dataFiles = src-Makefile.am plugin_app.cpp plugin_app.h \ + plugin_app.rc hi16-action-plugin.png hi22-action-plugin.png \ + kateplugin2.png plugin.kdevelop subdirs plugin.desktop + +templateName = kateplugin2 + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz \ No newline at end of file diff --git a/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png b/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png new file mode 100644 index 00000000..e2d7bab8 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin2/hi16-action-plugin.png differ diff --git a/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png b/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png new file mode 100644 index 00000000..4082bf10 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin2/hi22-action-plugin.png differ diff --git a/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate b/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate new file mode 100644 index 00000000..b98ab94f --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/kateplugin2.kdevtemplate @@ -0,0 +1,214 @@ +# KDE Config File +[General] +Name=Kate plugin with config page +Name[ca]=Connector per a Kate amb pàgina de configuració +Name[da]=Kate plugin med indstillingsside +Name[de]=Kate-Modul mit Einstellungsseite +Name[el]=Πρόσθετο Kate με σελίδα ρύθμισης +Name[es]=Complemento para Kate con página de configuración +Name[et]=Kate plugin seadistustedialoogiga +Name[eu]=Konfigurazio orridun Kate plugina +Name[fa]=وصلۀ Kate با صفحۀ پیکربندی +Name[fr]=Module externe pour Kate comprenant une page de configuration +Name[ga]=Breiseán Kate le leathanach cumraíochta +Name[gl]=Extensión para Kate con páxina de configuración +Name[hu]=Kate-bővítőmodul beállítólappal +Name[it]=Plugin per Kate con pagina di configurazione +Name[ja]=設定ページのある Kate プラグイン +Name[nds]=Kate-Moduul mit Instellensiet +Name[ne]=कन्फिग पृष्ठसँग केट प्लगइन +Name[nl]=Kate-plugin met config page +Name[pl]=Wtyczka do Kate ze stroną konfiguracyjną +Name[pt]='Plugin' do Kate com página de configuração +Name[pt_BR]='Plugin' do Kate com página de configuração +Name[ru]=Модуль Kate с диалогом настройки +Name[sk]=Kate modul s konfiguračnou stránkou +Name[sl]=Vstavek z nastavitveno stranjo za Kate +Name[sr]=Прикључак за Kate са страном за подешавања +Name[sr@Latn]=Priključak za Kate sa stranom za podešavanja +Name[sv]=Kate-insticksprogram med inställningssida +Name[tr]=Ayar sayfası olan bir Kate eklentisi +Name[zh_CN]=带配置页的 Kate 插件 +Name[zh_TW]=Kate 外掛程式,內含設定頁面 +Icon=kateplugin2.png +Category=C++/KDE +Comment=Generates a plugin with config page for Kate the text editor. +Comment[ca]=Genera un connector amb pàgina de configuració per a l'editor de text Kate. +Comment[da]=Generere et plugin med indstillingsside for teksteditoren Kate. +Comment[de]=Erstellt ein Modul mit Konfigurationsseite für den Texteditor Kate. +Comment[el]=Δημιουργεί ένα πρόσθετο με σελίδα ρύθμισης για το Kate τον επεξεργαστή κειμένου. +Comment[es]=Genera un complemento con página de configuración para el editor de texto Kate. +Comment[et]=Seadistustedialoogiga plugina loomine tekstiredaktorile Kate. +Comment[eu]=Konfigurazio orridun Kate plugin bat sortzen du. +Comment[fa]=وصله‌ای با صفحۀ پیکربندی ویرایشگر متن Kate تولید می‌کند. +Comment[fr]=Génère un module externe comprenant une page de configuration pour l'éditeur de texte Kate. +Comment[ga]=Cruthaíodh breiseán le leathanach cumraíochta le haghaidh eagarthóra téacs Kate. +Comment[gl]=Xera unha extensión con páxina de configuración para o editor de textos Kate. +Comment[hu]=Létrehoz egy bővítőmodult beállítólappal a Kate szövegszerkesztőhöz. +Comment[it]=Genera un plugin con pagina di configurazione per l'editor di testo Kate. +Comment[ja]=テキストエディタ Kate のための設定ページのあるプラグインを作成します。 +Comment[nds]=Stellt en Moduul mit Instellensiet för den Texteditor "Kate" op. +Comment[ne]=केट पाठ सम्पादकका लागि कन्फिग पृष्ठसँग प्लगइन उत्पन्न गर्दछ । +Comment[nl]=Genereert een plugin met een config page voor de Kate-teksteditor +Comment[pl]=Generuje wtyczke wraz ze stroną konfiguracyjną do edytora tekstu Kate. +Comment[pt]=Gera um 'plugin' com uma página de configuração para o Kate, o editor de texto. +Comment[pt_BR]=Gera um 'plugin' com uma página de configuração para o Kate, o editor de texto. +Comment[ru]=Создание модуля для текстового редактора Kate с диалогом настройки. +Comment[sk]=Vygeneruje modul s konfiguračnou stránkou pre textový editor Kate. +Comment[sl]=Ustvari vstavek z nastavitveno stranjo za urejevalnik besedil Kate. +Comment[sr]=Прави прикључак са страном за подешавање за уређивач текста Kate. +Comment[sr@Latn]=Pravi priključak sa stranom za podešavanje za uređivač teksta Kate. +Comment[sv]=Skapar ett insticksprogram för texteditorn Kate med en inställningssida. +Comment[tr]=Kate metin düzenleyicisi için ayar sayfası olan bir eklenti yaratır. +Comment[zh_CN]=生成带配置页的 Kate 文本编辑器插件。 +Comment[zh_TW]=產生一個 Kate 文字編輯器的外掛程式,內含設定頁面。 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/src/plugin_%{APPNAMELC}.cpp +Archive=kateplugin2.tar.gz + +[ADMIN] +Type=include +File=%{kdevelop}/template-common/admin.kdevtemplate + +[GNU] +Type=include +File=%{kdevelop}/template-common/gnu.kdevtemplate + +[MKDIR_DOCBOOK1] +Type=mkdir +Dir=%{dest}/doc + +[MKDIR_DOCBOOK2] +Type=mkdir +Dir=%{dest}/doc/en + +[FILE1] +Type=install +Source=%{kdevelop}/template-common/kde-doc-Makefile.am +Dest=%{dest}/doc/Makefile.am + +[FILE2] +Type=install +Source=%{kdevelop}/template-common/kde-doc-en-Makefile.am +Dest=%{dest}/doc/en/Makefile.am + +[FILE3] +Type=install +EscapeXML=true +Source=%{kdevelop}/template-common/kde-index.docbook +Dest=%{dest}/doc/en/index.docbook + +[FILE4] +Type=install +EscapeXML=true +Source=%{src}/plugin.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[FILE5] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.cvs +Dest=%{dest}/Makefile.cvs + +[FILE6] +Type=install +Source=%{kdevelop}/template-common/kde-Makefile.am +Dest=%{dest}/Makefile.am + +[FILE7] +Type=install +Source=%{kdevelop}/template-common/kde-configure.in.in +Dest=%{dest}/configure.in.in + +[MkDir3] +Type=mkdir +Dir=%{dest}/src + +[FILE8] +Type=install +Source=%{kdevelop}/template-common/kde-app.lsm +Dest=%{dest}/src/%{APPNAMELC}.lsm + +[MkDir4] +Type=mkdir +Dir=%{dest}/po + +[FILE9] +Type=install +Source=%{kdevelop}/template-common/kde-po-Makefile.am +Dest=%{dest}/po/Makefile.am + +[FILE10] +Type=install +Source=%{src}/subdirs +Dest=%{dest}/subdirs + +[FILE11] +Type=install +Source=%{src}/src-Makefile.am +Dest=%{dest}/src/Makefile.am + +[FILE12] +Type=install +Source=%{src}/plugin.desktop +Dest=%{dest}/src/%{APPNAMELC}.desktop + +[FILE13] +Type=install +Source=%{src}/plugin_app.cpp +Dest=%{dest}/src/plugin_%{APPNAMELC}.cpp + +[FILE14] +Type=install +Source=%{src}/plugin_app.h +Dest=%{dest}/src/plugin_%{APPNAMELC}.h + +[FILE15] +Type=install +EscapeXML=true +Source=%{src}/plugin_app.rc +Dest=%{dest}/src/plugin_%{APPNAMELC}.rc + +[FILE16] +Type=install +Source=%{src}/hi16-action-plugin.png +Dest=%{dest}/src/hi16-action-plugin.png +Process=false + +[FILE17] +Type=install +Source=%{src}/hi22-action-plugin.png +Dest=%{dest}/src/hi32-action-plugin.png +Process=false + +[MSG] +Type=message +Comment=A plugin for Kate with a config page was created in %{dest} +Comment[ca]=Un connector per a Kate amb pàgina de configuració ha estat creat en %{dest} +Comment[da]=Et plugin for Kate med en indstillingsside blev oprettet i %{dest} +Comment[de]=Ein Modul für Kate mit Konfigurationsseite wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο για το Kate με μια σελίδα ρύθμισης δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento para Kate con una página de configuración ha sido creado en %{dest} +Comment[et]=Seadistustedialoogiga Kate plugin loodi asukohta %{dest} +Comment[eu]=Konfigurazio orridun Kate plugin bat sortu da hemen:%{dest} +Comment[fa]=وصله‌ای برای Kate با یک صفحۀ پیکربندی در %{dest} ایجاد شد +Comment[fr]=Un module externe pour Kate comprenant une page de configuration a été créé dans %{dest} +Comment[ga]=Cruthaíodh breiseán Kate le leathanach cumraíochta i %{dest} +Comment[gl]=Creouse unha extensión para Kate con páxina de configuración en %{dest} +Comment[hu]=Létrejött egy Kate-bővítőmodul (beállítólappal) itt: %{dest} +Comment[it]=È stato creato un plugin per Kate con pagina di configurazione in %{dest} +Comment[ja]=設定ページのある Kate プラグインを %{dest} に作成しました +Comment[nds]=In %{dest} wöör en Moduul för Kate mit Instellensiet opstellt +Comment[ne]=कन्फिग पृष्ठसँग केटका लागि प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een plugin voor Kate met een config page is aangemaakt in %{dest} +Comment[pl]=Wtyczka do Kate wraz ze stroną konfiguracyjną została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' para o Kate, com uma página de configuração, em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' para o Kate, com uma página de configuração, em %{dest} +Comment[ru]=Модуль Kate с диалогом настройки создан в %{dest} +Comment[sk]=Modul pre Kate s konfiguračnou stránkou bol vytvorený v %{dest} +Comment[sl]=Vstavek z nastavitveno stranjo za Kate je bil ustvarjen v %{dest} +Comment[sr]=Прикључак за Kate са страном за подешавања направљен је у %{dest} +Comment[sr@Latn]=Priključak za Kate sa stranom za podešavanja napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för Kate med en inställningssida skapades i %{dest} +Comment[tr]=Kate için ayar sayfası olan bir eklenti %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个带配置页的 Kate 插件 +Comment[zh_TW]=一個內含設定頁面的 Kate 外掛程式已建立於 %{dest} diff --git a/languages/cpp/app_templates/kateplugin2/kateplugin2.png b/languages/cpp/app_templates/kateplugin2/kateplugin2.png new file mode 100644 index 00000000..b442a706 Binary files /dev/null and b/languages/cpp/app_templates/kateplugin2/kateplugin2.png differ diff --git a/languages/cpp/app_templates/kateplugin2/plugin.desktop b/languages/cpp/app_templates/kateplugin2/plugin.desktop new file mode 100644 index 00000000..761ac763 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin.desktop @@ -0,0 +1,76 @@ +[Desktop Entry] +Type=Service +ServiceTypes=Kate/Plugin +X-KDE-Library=lib%{APPNAMELC}plugin +X-Kate-Version=2.2 +Name=My First Kate Plugin +Name[br]=Ma lugent Kate kentañ +Name[ca]=El meu primer connector per a Kate +Name[cy]=F'ategyn cyntaf Kate +Name[da]=Mit første Kate plugin +Name[de]=Mein erstes Kate-Modul +Name[el]=Το πρώτο μου πρόσθετο για το Kate +Name[es]=Mi primer complemento para Kate +Name[et]=Minu esimene Kate plugin +Name[eu]=Nire lehenengo Kate plugina +Name[fa]=اولین وصلۀ Kate من +Name[fr]=Mon premier module externe pour Kate +Name[ga]=Mo Chéad Bhreiseán Kate +Name[gl]=A miña primeira extensión para Kate +Name[hu]=Mintapélda Kate-bővítőmodulra +Name[it]=Il mio primo plugin di Kate +Name[ja]=はじめての Kate プラグイン +Name[ms]=Plugin Kate Pertama Saya +Name[nds]=Mien eerst Kate-Moduul +Name[ne]=मेरो पहिलो केट प्लगइन +Name[nl]=Mijn eerste Kate-plugin +Name[pl]=Moja pierwsza wtyczka do Kate +Name[pt]=O Meu Primeiro 'Plugin' para o Kate +Name[pt_BR]=Meu Primeiro Plug-in do Kate +Name[ru]=Мой первый модуль к Kate +Name[sk]=Môj prvý Kate modul +Name[sl]=Moj prvi vstavek za Kate +Name[sr]=Мој први прикључак за Kate +Name[sr@Latn]=Moj prvi priključak za Kate +Name[sv]=Mitt första insticksprogram för Kate +Name[tr]=İlk Kate Eklentim +Name[zh_CN]=我的第一个 Kate 插件 +Name[zh_TW]=我的第一個 Kate 外掛程式 +Comment=Your short description about the plugin goes here +Comment[ca]=Aquí va la descripció curta referent al connector +Comment[cy]=Mae eich disgrifiad byr am yr ategyn yn mynd yma +Comment[da]=Din korte beskrivelse af plugin skal være her +Comment[de]=Hierhin gehört eine kurze Beschreibung des Moduls +Comment[el]=Η σύντομη περιγραφή σας σχετικά με το πρόσθετο πηγαίνει εδώ +Comment[es]=Aquí va la descripción corta sobre el complemento +Comment[et]=Sinu plugina lühikirjeldus +Comment[eu]=Hemen dihoa plugin-aren buruzko zure deskribapen motza +Comment[fa]=توصیف کوتاه شما در مورد وصله در اینجا می‌آید +Comment[fr]=Une courte description de votre module externe s'insère ici +Comment[ga]=Cuir do chur síos gearr ar an mbreiseán anseo +Comment[gl]=A súa descrición breve sobre a extensión vai aquí. +Comment[hi]=प्लगइन के बारे में आपका छोटा सा वर्णन यहाँ जाएगा +Comment[hu]=Itt lehet egy rövid leírást adni a bővítőmodulról +Comment[is]=Hér ætti að vera smá lýsing á viðbótinni +Comment[it]=La tua breve descrizione sui plugin va qui +Comment[ja]=プラグインに関する短い説明をここに記述します。 +Comment[lt]=Čia turėtų būti trumpas priedo aprašymas +Comment[ms]=Huraian ringkas anda tentang plugin anda di sini +Comment[nds]=Hier kannst Du en kort Moduulbeschrieven ingeven +Comment[ne]=प्लगइनका बारेमा तपाईँको छोटो भनाइ यस्तो छ +Comment[nl]=Hier kunt u een korte omschrijving opgeven +Comment[pl]=Tu powinien się pojawić krótki opis wtyczki +Comment[pt]=Aqui deverá colocar uma descrição do 'plugin' +Comment[pt_BR]=Sua descrição sumária sobre o plug-in vai aqui +Comment[ru]=Здесь располагается краткое описание модуля +Comment[sk]=Sem vložte krátky popis modulu +Comment[sl]=Tukaj je kratek opis o vstavku +Comment[sr]=Овде иде ваш кратак опис прикључка +Comment[sr@Latn]=Ovde ide vaš kratak opis priključka +Comment[sv]=En kort beskrivningen av vad insticksprogrammet gör +Comment[ta]=உங்கள் சொருகின் சிறு விவரம் இங்கிருக்கும் +Comment[tg]=Дар инҷо тасвири кӯтоҳи модул ҷойгир аст +Comment[tr]=Eklenti hakkında kısa bir tanımı buraya yazın. +Comment[zh_CN]=关于这个插件的简短描述 +Comment[zh_TW]=您對此外掛程式的描述寫在這裡 +author=%{AUTHOR}, %{EMAIL} diff --git a/languages/cpp/app_templates/kateplugin2/plugin.kdevelop b/languages/cpp/app_templates/kateplugin2/plugin.kdevelop new file mode 100644 index 00000000..cbed4cac --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin.kdevelop @@ -0,0 +1,114 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevKDEAutoProject + C++ + + C++ + Code + Qt + KDE + + + + + 3 + true + 3 + EmbeddedKDevDesigner + + + + + src/lib%{APPNAMELC}plugin.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/kateplugin2/plugin_app.cpp b/languages/cpp/app_templates/kateplugin2/plugin_app.cpp new file mode 100644 index 00000000..99d78eff --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin_app.cpp @@ -0,0 +1,140 @@ +%{CPP_TEMPLATE} + +#include "plugin_%{APPNAMELC}.h" + +#include +#include +#include +#include + +#include +#include + +class PluginView : public KXMLGUIClient +{ + friend class KatePlugin%{APPNAME}; + +public: + Kate::MainWindow *win; +}; + +extern "C" +{ + void* init_lib%{APPNAMELC}plugin() + { + KGlobal::locale()->insertCatalogue("kate%{APPNAMELC}"); + return new KatePluginFactory; + } +} + +KatePluginFactory::KatePluginFactory() +{ + s_instance = new KInstance( "kate" ); +} + +KatePluginFactory::~KatePluginFactory() +{ + delete s_instance; +} + +QObject* KatePluginFactory::createObject( QObject* parent, const char* name, const char*, const QStringList & ) +{ + return new KatePlugin%{APPNAME}( parent, name ); +} + +KInstance* KatePluginFactory::s_instance = 0L; + +KatePlugin%{APPNAME}::KatePlugin%{APPNAME}( QObject* parent, const char* name ) + : Kate::Plugin ( (Kate::Application*)parent, name ) +{ +} + +KatePlugin%{APPNAME}::~KatePlugin%{APPNAME}() +{ +} + +void KatePlugin%{APPNAME}::addView(Kate::MainWindow *win) +{ + /// @todo doesn't this have to be deleted? + PluginView *view = new PluginView (); + + (void) new KAction ( i18n("Insert Hello World"), 0, this, + SLOT( slotInsertHello() ), view->actionCollection(), + "edit_insert_%{APPNAMELC}" ); + + view->setInstance (new KInstance("kate")); + view->setXMLFile("plugins/%{APPNAMELC}/plugin_%{APPNAMELC}.rc"); + win->guiFactory()->addClient (view); + view->win = win; + + m_views.append (view); +} + +void KatePlugin%{APPNAME}::removeView(Kate::MainWindow *win) +{ + for (uint z=0; z < m_views.count(); z++) + if (m_views.at(z)->win == win) + { + PluginView *view = m_views.at(z); + m_views.remove (view); + win->guiFactory()->removeClient (view); + delete view; + } +} + +void KatePlugin%{APPNAME}::slotInsertHello() +{ + Kate::View *kv = application()->activeMainWindow()->viewManager()->activeView(); + + if (kv) + kv->insertText ("Hello World"); +} + +Kate::PluginConfigPage* KatePlugin%{APPNAME}::configPage (uint, QWidget *w, const char* name) +{ + %{APPNAME}ConfigPage* p = new %{APPNAME}ConfigPage(this, w); + initConfigPage( p ); + connect( p, SIGNAL(configPageApplyRequest(%{APPNAME}ConfigPage*)), this, SLOT(slotApplyConfig(%{APPNAME}ConfigPage*)) ); + return (Kate::PluginConfigPage*)p; +} + +void KatePlugin%{APPNAME}::initConfigPage( %{APPNAME}ConfigPage* p ) +{ + // TODO: initialize %{APPNAME}ConfigPage here + // NOTE: KatePlugin%{APPNAME} is friend of %{APPNAME}ConfigPage +} + +void KatePlugin%{APPNAME}::slotApplyConfig( %{APPNAME}ConfigPage* p ) +{ + // TODO: save %{APPNAME}ConfigPage here + // NOTE: KatePlugin%{APPNAME} is friend of %{APPNAME}ConfigPage +} + + +/** + * %{APPNAME}ConfigPage + */ +%{APPNAME}ConfigPage::%{APPNAME}ConfigPage (QObject* parent /*= 0L*/, QWidget *parentWidget /*= 0L*/) + : Kate::PluginConfigPage( parentWidget ) +{ + QVBoxLayout* lo = new QVBoxLayout( this, 0, 0, "config_page_layout" ); + lo->setSpacing(KDialogBase::spacingHint()); + + QLabel* lab = new QLabel("KatePlugin%{APPNAME}'s config page", this); + + lo->addWidget(lab); + + // TODO: add connection to emit SLOT( changed() ) +} + +%{APPNAME}ConfigPage::~%{APPNAME}ConfigPage() +{ +} + +void %{APPNAME}ConfigPage::apply() +{ + emit configPageApplyRequest( this ); +} + +#include "plugin_%{APPNAMELC}.moc" + diff --git a/languages/cpp/app_templates/kateplugin2/plugin_app.h b/languages/cpp/app_templates/kateplugin2/plugin_app.h new file mode 100644 index 00000000..e4f97d00 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin_app.h @@ -0,0 +1,91 @@ +%{H_TEMPLATE} + +#ifndef _PLUGIN_%{APPNAMEUC}_H_ +#define _PLUGIN_%{APPNAMEUC}_H_ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +class %{APPNAME}ConfigPage; + +class KatePluginFactory : public KLibFactory +{ + Q_OBJECT + +public: + KatePluginFactory(); + virtual ~KatePluginFactory(); + + virtual QObject* createObject( QObject* parent = 0, const char* pname = 0, const char* name = "QObject", const QStringList &args = QStringList() ); + +private: + static KInstance* s_instance; +}; + +class KatePlugin%{APPNAME} : public Kate::Plugin, Kate::PluginViewInterface, Kate::PluginConfigInterfaceExtension +{ + Q_OBJECT + +public: + KatePlugin%{APPNAME}( QObject* parent = 0, const char* name = 0 ); + virtual ~KatePlugin%{APPNAME}(); + + void addView (Kate::MainWindow *win); + void removeView (Kate::MainWindow *win); + + /** overwrite some functions */ + uint configPages () const { return 1; } + Kate::PluginConfigPage *configPage (uint , QWidget *w, const char *name=0); + QString configPageName(uint) const { return i18n("%{APPNAME}"); }; + QString configPageFullName(uint) const { return i18n("Configure KatePlugin%{APPNAME}"); }; + QPixmap configPagePixmap (uint number = 0, int size = KIcon::SizeSmall) const { return 0L; }; + +public slots: + void slotInsertHello(); + void slotApplyConfig(%{APPNAME}ConfigPage*); + +private: + void initConfigPage( %{APPNAME}ConfigPage* ); + +private: + QPtrList m_views; +}; + + +class %{APPNAME}ConfigPage : public Kate::PluginConfigPage +{ + Q_OBJECT + friend class KatePlugin%{APPNAME}; + +public: + %{APPNAME}ConfigPage (QObject* parent = 0L, QWidget *parentWidget = 0L); + ~%{APPNAME}ConfigPage (); + + /** Reimplemented from Kate::PluginConfigPage; just emits configPageApplyRequest( this ). */ + virtual void apply(); + + virtual void reset () { ; }; + virtual void defaults () { ; }; + +signals: + /** Ask the plugin to set initial values */ + void configPageApplyRequest( %{APPNAME}ConfigPage* ); + /** Ask the plugin to apply changes */ + void configPageInitRequest( %{APPNAME}ConfigPage* ); + +private: // variables + +}; + +#endif // _PLUGIN_%{APPNAMEUC}_H_ + diff --git a/languages/cpp/app_templates/kateplugin2/plugin_app.rc b/languages/cpp/app_templates/kateplugin2/plugin_app.rc new file mode 100644 index 00000000..fe98416f --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/plugin_app.rc @@ -0,0 +1,11 @@ + + + + &Tools + + + + + + + diff --git a/languages/cpp/app_templates/kateplugin2/src-Makefile.am b/languages/cpp/app_templates/kateplugin2/src-Makefile.am new file mode 100644 index 00000000..2dbd9367 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/src-Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = $(all_includes) +METASOURCES = AUTO + +KDE_ICON = AUTO + +# Install this plugin in the KDE modules directory +kde_module_LTLIBRARIES = lib%{APPNAMELC}plugin.la + +lib%{APPNAMELC}plugin_la_SOURCES = plugin_%{APPNAMELC}.cpp +lib%{APPNAMELC}plugin_la_LIBADD = -lkateinterfaces +lib%{APPNAMELC}plugin_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries) + +pluginsdir = $(kde_datadir)/kate/plugins/%{APPNAMELC} +plugins_DATA = plugin_%{APPNAMELC}.rc + +kde_services_DATA = %{APPNAMELC}.desktop + +messages: rc.cpp + $(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/%{APPNAMELC}.pot + diff --git a/languages/cpp/app_templates/kateplugin2/subdirs b/languages/cpp/app_templates/kateplugin2/subdirs new file mode 100644 index 00000000..0e678106 --- /dev/null +++ b/languages/cpp/app_templates/kateplugin2/subdirs @@ -0,0 +1,3 @@ +doc +po +src -- cgit v1.2.1