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 --- languages/cpp/app_templates/opieinput/.kdev_ignore | 0 languages/cpp/app_templates/opieinput/Example.png | Bin 0 -> 1262 bytes languages/cpp/app_templates/opieinput/Makefile.am | 17 +++ languages/cpp/app_templates/opieinput/app.kdevelop | 159 +++++++++++++++++++++ languages/cpp/app_templates/opieinput/app.pro | 38 +++++ .../app_templates/opieinput/opieinput.kdevtemplate | 129 +++++++++++++++++ .../cpp/app_templates/opieinput/opieinput.png | Bin 0 -> 483 bytes .../cpp/app_templates/opieinput/simpleimpl.cpp | 157 ++++++++++++++++++++ languages/cpp/app_templates/opieinput/simpleimpl.h | 50 +++++++ 9 files changed, 550 insertions(+) create mode 100644 languages/cpp/app_templates/opieinput/.kdev_ignore create mode 100644 languages/cpp/app_templates/opieinput/Example.png create mode 100644 languages/cpp/app_templates/opieinput/Makefile.am create mode 100644 languages/cpp/app_templates/opieinput/app.kdevelop create mode 100644 languages/cpp/app_templates/opieinput/app.pro create mode 100644 languages/cpp/app_templates/opieinput/opieinput.kdevtemplate create mode 100644 languages/cpp/app_templates/opieinput/opieinput.png create mode 100644 languages/cpp/app_templates/opieinput/simpleimpl.cpp create mode 100644 languages/cpp/app_templates/opieinput/simpleimpl.h (limited to 'languages/cpp/app_templates/opieinput') diff --git a/languages/cpp/app_templates/opieinput/.kdev_ignore b/languages/cpp/app_templates/opieinput/.kdev_ignore new file mode 100644 index 00000000..e69de29b diff --git a/languages/cpp/app_templates/opieinput/Example.png b/languages/cpp/app_templates/opieinput/Example.png new file mode 100644 index 00000000..f63d0bc7 Binary files /dev/null and b/languages/cpp/app_templates/opieinput/Example.png differ diff --git a/languages/cpp/app_templates/opieinput/Makefile.am b/languages/cpp/app_templates/opieinput/Makefile.am new file mode 100644 index 00000000..d748092c --- /dev/null +++ b/languages/cpp/app_templates/opieinput/Makefile.am @@ -0,0 +1,17 @@ +dataFiles = Makefile.am Example.png app.kdevelop app.pro \ + simpleimpl.cpp simpleimpl.h +templateName = opieinput + +### no need to change below: +template_DATA = $(templateName).kdevtemplate +templatedir = ${appwizarddatadir}/templates + +appwizarddatadir = ${kde_datadir}/kdevappwizard +$(templateName).tar.gz: ${dataFiles} + $(TAR) -cf $(templateName).tar -C $(srcdir) ${dataFiles} + $(GZIP_COMMAND) -f9 $(templateName).tar + +archivedir = ${appwizarddatadir} +archive_DATA = $(templateName).tar.gz ${templateName}.png + +CLEANFILES = *.tar.gz diff --git a/languages/cpp/app_templates/opieinput/app.kdevelop b/languages/cpp/app_templates/opieinput/app.kdevelop new file mode 100644 index 00000000..639a3215 --- /dev/null +++ b/languages/cpp/app_templates/opieinput/app.kdevelop @@ -0,0 +1,159 @@ + + + + %{AUTHOR} + %{EMAIL} + %{VERSION} + KDevTrollProject + C++ + + Qt + C++ + Code + + + + + + + + + + + + false + *.o,*.lo,CVS + + + + + gtk + gnustep + python + php + perl + w3c-dom-level2-html + kdev3api + sdl + w3c-svg + w3c-uaag10 + + + Guide to the Qt Translation Tools + qmake User Guide + Qt Assistant Manual + Qt Designer Manual + Qt Referrence Documentation + + + bonobo-activation + gconf + gtksourceview + libbonobo + libbonoboui + + + + + + -qws + + true + false + false + + + false + true + + + + + false + + + + plugins/inputmethods + + %{APPNAMELC} + 0 +
opie/inputmethods
+ %{AUTHOR} %{EMAIL} + arm + task-opie-minimal + %{VERSION} + Empty +
+ + #!/bin/sh +if pidof -s qpe >/dev/null; then + /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadInputMethods()" +else + exit 0 +fi + + #!/bin/sh +if pidof -s qpe >/dev/null; then + /opt/QtPalmtop/bin/qcop QPE/TaskBar "reloadInputMethods()" +else + exit 0 +fi + + +
+ + + + + qpe + -qws + + +
+ + + + + + + + + + + + + + false + false + + + + false + + + .h + .cpp + true + + + + true + 2 + + + -f + + -dP + + -f + -u3 -p + + + + + + Doxygen Documentation Collection + %{APPNAMELC}.tag + + +
diff --git a/languages/cpp/app_templates/opieinput/app.pro b/languages/cpp/app_templates/opieinput/app.pro new file mode 100644 index 00000000..1711c78f --- /dev/null +++ b/languages/cpp/app_templates/opieinput/app.pro @@ -0,0 +1,38 @@ +TEMPLATE = lib +CONFIG = qt dll qtopia warn_on release zecke-libqpe zecke-libopie opie-input +HEADERS = %{APPNAMELC}.h +SOURCES = %{APPNAMELC}.cpp +TARGET = %{APPNAMELC} + + +QUICK_SPEC_FOO = $$(OPIE_BUILD_QUICK_APP) +contains( TEMPLATE, quick-template ){ + contains( QUICK_SPEC_FOO, quick-app-lib ){ + message( "foo" ) + system( rm $$TARGET ) + system( ln -s $$(OPIEDIR)/bin/quicklauncher $$TARGET) + DEFINES += OPIE_APP_INTERFACE + TEMPLATE = lib + CONFIG += dll + }else{ + LI = $$join( TARGET, "lib", "lib", ".so*" ) + system( rm $$LI ) + TEMPLATE = app + } +} + + +QMAKE_LIBDIR= $$(OPIEDIR)/lib +OPIE-SPEC=6 + +zecke-libqpe { + INCLUDEPATH += $$(OPIEDIR)/include + LIBS += -lqpe + DEPENDPATH += $$(OPIEDIR)/include +} + +zecke-libopie { + INCLUDEPATH += $$(OPIEDIR)/include + DEPENDPATH += $$(OPIEDIR)/include + LIBS += -lopie +} diff --git a/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate b/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate new file mode 100644 index 00000000..39250370 --- /dev/null +++ b/languages/cpp/app_templates/opieinput/opieinput.kdevtemplate @@ -0,0 +1,129 @@ +# KDE Config File +[General] +Name=Opie Input +Name[ca]=Entrada per a Opie +Name[da]=Opie-input +Name[de]=Opie-Eingabe +Name[el]=Μέθοδος εισαγωγής Opie +Name[es]=Entrada para Opie +Name[et]=Opie sisestus +Name[eu]=Opie sarrera +Name[fa]=ورودی Opie +Name[fr]=Entrée Opie +Name[ga]=Ionchur Opie +Name[gl]=Entrada Opie +Name[hu]=Opie-s bemeneti modul +Name[it]=Input di Opie +Name[ja]=Opie 入力 +Name[nds]=Opie-Ingaav +Name[ne]=ओपिइ आगत +Name[nl]=Opie-invoer +Name[pl]=Wejście Opie +Name[pt]=Introdução de Dados do Opie +Name[pt_BR]=Introdução de Dados do Opie +Name[ru]=Модуль ввода Opie +Name[sk]=Opie vstup +Name[sr]=Opie унос +Name[sr@Latn]=Opie unos +Name[sv]=Opie-inmatning +Name[tr]=Opie Girdisi +Name[zh_CN]=Opie 输入法 +Name[zh_TW]=Opie 輸入 +Icon=qmakeapp.png +Category=C++/Embedded +Comment=Generate an Opie input method plugin. +Comment[ca]=Genera un connector de mètode d'entrada per a Opie. +Comment[da]=Generér en Opie input-metode-plugin. +Comment[de]=Erstellt ein Eingabemethode-Modul für Opie. +Comment[el]=Δημιουργία ενός πρόσθετου μεθόδου εισαγωγής. +Comment[es]=Genera un complemento de método de entrada para Opie. +Comment[et]=Opie sisestusmeetodi plugina loomine. +Comment[eu]=Sortu Opie-ren sarrera-metodoaren plugin bat. +Comment[fa]=یک وصلۀ روش ورودی Opie تولید می‌کند. +Comment[fr]=Génère un module externe de méthode d'entrée Opie. +Comment[gl]=Xera unha extensión de método de entrada para Opie. +Comment[hu]=Létrehoz egy Opie-s bemeneti modult. +Comment[it]=Genera un plugin per il metodo di input Opie. +Comment[nds]=Stellt en Ingaavmetood-Moduul för Opie op. +Comment[ne]=ओपिइ आगत विधि प्लगइन उत्पन्न गर्नुहोस् +Comment[nl]=Genereert een Opie-invoermethode-plugin. +Comment[pl]=Generuje wtyczkę z metodą wejściową dla Opie. +Comment[pt]=Gera um 'plugin' de introdução de dados do Opie. +Comment[pt_BR]=Gera um 'plugin' de introdução de dados do Opie. +Comment[ru]=Создание модуля ввода данных для среды Opie. +Comment[sk]=Vygeneruje Opie vstupný modul. +Comment[sr]=Прави прикључак за Opie метод уноса. +Comment[sr@Latn]=Pravi priključak za Opie metod unosa. +Comment[sv]=Skapa ett insticksprogram för Opie-inmatning. +Comment[tr]=Bir Opie girdi yöntemi eklentisi yarat +Comment[zh_CN]=生成一个 Opie 输入法插件。 +Comment[zh_TW]=產生一個 Opie 輸入法外掛程式 +FileTemplates=h,CStyle,cpp,CStyle +ShowFilesAfterGeneration=%{dest}/%{APPNAMELC}.cpp +Archive=opieinput.tar.gz + +[FILE1] +Type=install +EscapeXML=true +Source=%{src}/app.kdevelop +Dest=%{dest}/%{APPNAMELC}.kdevelop + +[MkDir0] +Type=mkdir +Dir=%{dest}/pics + +[MkDir1] +Type=mkdir +Dir=%{dest}/pics/%{APPNAMELC} + +[FILE2] +Type=install +Source=%{src}/Example.png +Dest=%{dest}/pics/%{APPNAMELC}/%{APPNAMELC}.png +Process=false + +[FILE3] +Type=install +Source=%{src}/app.pro +Dest=%{dest}/%{APPNAMELC}.pro + +[FILE4] +Type=install +Source=%{src}/simpleimpl.cpp +Dest=%{dest}/%{APPNAMELC}.cpp + +[FILE5] +Type=install +Source=%{src}/simpleimpl.h +Dest=%{dest}/%{APPNAMELC}.h + +[MSG] +Type=message +Comment=An opie input method plugin was created in %{dest} +Comment[ca]=Un connector de mètode d'entrada per a Opie ha estat creat en %{dest} +Comment[da]=At opie input-metode-plugin blev oprettet i %{dest} +Comment[de]=Ein Eingabemethode-Modul für Opie wurde in %{dest} erstellt. +Comment[el]=Ένα πρόσθετο μεθόδου εισαγωγής opie δημιουργήθηκε στο %{dest} +Comment[es]=Un complemento de método de entrada para Opie ha sido creado en %{dest} +Comment[et]=Opie sisestusmeetodi plugin loodi asukohta %{dest} +Comment[eu]=Opie-ren sarrera-metodoaren plugin bat sortu da hemen: %{dest} +Comment[fa]=یک وصلۀ روش ورودی opie در %{dest} ایجاد شد +Comment[fr]=Un module externe de méthode d'entrée Opie a été créé dans %{dest} +Comment[gl]=Creouse unha extensión de método de entrada para opie en %{dest} +Comment[hu]=Létrejött egy Opie-s bemeneti modul itt: %{dest} +Comment[it]=È stato creato un plugin per il metodo di input Opie in %{dest} +Comment[nds]=In %{dest} wöör en Opie-Ingaavmetoodmoduul opstellt +Comment[ne]=ओपिइ आगत विधि प्लगइन %{dest} मा सिर्जना गरियो +Comment[nl]=Een Opie-invoermethode-plugins is aangemaakt in %{dest} +Comment[pl]=Wtyczka z metodą wejściową dla Opie została utworzona w %{dest} +Comment[pt]=Foi criado um 'plugin' de introdução de dados em %{dest} +Comment[pt_BR]=Foi criado um 'plugin' de introdução de dados em %{dest} +Comment[ru]=Модуль ввода Opie создан в %{dest} +Comment[sk]=Opie vstupný modul bol vytvorený v %{dest} +Comment[sr]=Прикључак за Opie метод уноса направљен је у %{dest} +Comment[sr@Latn]=Priključak za Opie metod unosa napravljen je u %{dest} +Comment[sv]=Ett insticksprogram för Opie-inmatning skapades i %{dest} +Comment[tr]=Bir opie girdi yöntemi eklentisi %{dest} içinde yaratıldı. +Comment[zh_CN]=在 %{dest} 中创建了一个 opie 输入法 +Comment[zh_TW]=一個 Opie 輸入法外掛程式已建立於 %{dest} + diff --git a/languages/cpp/app_templates/opieinput/opieinput.png b/languages/cpp/app_templates/opieinput/opieinput.png new file mode 100644 index 00000000..840a953c Binary files /dev/null and b/languages/cpp/app_templates/opieinput/opieinput.png differ diff --git a/languages/cpp/app_templates/opieinput/simpleimpl.cpp b/languages/cpp/app_templates/opieinput/simpleimpl.cpp new file mode 100644 index 00000000..6da986eb --- /dev/null +++ b/languages/cpp/app_templates/opieinput/simpleimpl.cpp @@ -0,0 +1,157 @@ +#include +#include +#include +#include +#include +#include + +#include "%{APPNAMELC}.h" + +%{APPNAME}::%{APPNAME}(QWidget* par, WFlags fl ) + : QHBox(par, "name", fl ) +{ + QCheckBox *box1 = new QCheckBox(tr("Alt"),this); + connect(box1,SIGNAL(toggled(bool)), + this,SLOT(slotAlt(bool))); + m_alt = box1; + box1 = new QCheckBox(tr("Shift"),this ); + connect(box1,SIGNAL(toggled(bool)), + this,SLOT(slotShift(bool))); + m_shi = box1; + box1 = new QCheckBox(tr("Ctrl","Control Shortcut on keyboard"),this ); + connect(box1,SIGNAL(toggled(bool)), + this,SLOT(slotCtrl(bool))); + m_ctrl = box1; + + QSignalMapper *map = new QSignalMapper(this); + QPushButton *btn = new QPushButton("a",this); + map->setMapping(btn,0); + connect(btn,SIGNAL(clicked()),map,SLOT(map())); + + btn = new QPushButton("b",this); + map->setMapping(btn,1); + connect(btn,SIGNAL(clicked()),map,SLOT(map())); + + btn = new QPushButton("c",this); + map->setMapping(btn,2); + connect(btn,SIGNAL(clicked()),map,SLOT(map())); + + connect(map,SIGNAL(mapped(int)), + this,SLOT(slotKey(int))); + resetState(); +} + +%{APPNAME}::~%{APPNAME}(){ +} + +void %{APPNAME}::resetState(){ + m_state = 0; + m_shi->setChecked(false); + m_ctrl->setChecked(false); + m_alt->setChecked(false); +} + +void %{APPNAME}::slotKey(int _ke){ + int ke = _ke + 0x61; // 0 + 65 = 0x41 == A + if(m_state & ShiftButton ) + ke -= 0x20; + + /* + * Send the key + * ke is the unicode + * _ke + 0x41 is the keycode + * m_state Normally the state + * down/up + * auto repeat + */ + emit key(ke, _ke +0x41,m_state,true,false); + emit key(ke, _ke + 0x41,m_state,false,false); +} + +void %{APPNAME}::slotShift(bool b){ + if(b) + m_state |= ShiftButton; + else + m_state &= ~ShiftButton; +} + +void %{APPNAME}::slotAlt(bool b){ + if(b) + m_state |= AltButton; + else + m_state &= ~AltButton; +} + +void %{APPNAME}::slotCtrl(bool b){ + if(b) + m_state |= ControlButton; + else + m_state &= ~ControlButton; +} + + + +%{APPNAME}Impl::%{APPNAME}Impl() + : m_pickboard(0), m_icn(0) +{ +} + +%{APPNAME}Impl::~%{APPNAME}Impl() +{ + delete m_pickboard; + delete m_icn; +} + +QWidget *%{APPNAME}Impl::inputMethod( QWidget *parent, Qt::WFlags f ) +{ + if ( !m_pickboard ) + m_pickboard = new %{APPNAME}( parent, f ); + return m_pickboard; +} + +void %{APPNAME}Impl::resetState() +{ + if ( m_pickboard ) + m_pickboard->resetState(); +} + +QPixmap *%{APPNAME}Impl::icon() +{ + if ( !m_icn ) + m_icn = new QPixmap(Resource::loadPixmap("Tux")); + return m_icn; +} + +QString %{APPNAME}Impl::name() +{ + return QObject::tr("Example Input"); +} + +void %{APPNAME}Impl::onKeyPress( QObject *receiver, const char *slot ) +{ + if ( m_pickboard ) + QObject::connect( m_pickboard, SIGNAL(key(ushort,ushort,ushort,bool,bool)), receiver, slot ); +} + +#ifndef QT_NO_COMPONENT +QRESULT %{APPNAME}Impl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) +{ + *iface = 0; + if ( uuid == IID_QUnknown ) + *iface = this; + else if ( uuid == IID_InputMethod ) + *iface = this; + else + return QS_FALSE; + + if ( *iface ) + (*iface)->addRef(); + return QS_OK; +} + +Q_EXPORT_INTERFACE() +{ + Q_CREATE_INSTANCE( %{APPNAME}Impl ) +} +#endif + diff --git a/languages/cpp/app_templates/opieinput/simpleimpl.h b/languages/cpp/app_templates/opieinput/simpleimpl.h new file mode 100644 index 00000000..362e59b3 --- /dev/null +++ b/languages/cpp/app_templates/opieinput/simpleimpl.h @@ -0,0 +1,50 @@ +#ifndef %{APPNAME}IMPL_H +#define %{APPNAME}IMPL_H + +#include + +#include + +class QPixmap; +class QCheckBox; +class %{APPNAME} : public QHBox { + Q_OBJECT +public: + %{APPNAME}( QWidget *par, WFlags f ); + ~%{APPNAME}(); + void resetState(); +private slots: + void slotKey(int); + void slotShift(bool); + void slotAlt(bool); + void slotCtrl(bool); +signals: + void key(ushort,ushort,ushort,bool,bool); +private: + int m_state; + QCheckBox *m_alt,*m_shi,*m_ctrl; +}; + +class %{APPNAME}Impl : public InputMethodInterface +{ +public: + %{APPNAME}Impl(); + virtual ~%{APPNAME}Impl(); + +#ifndef QT_NO_COMPONENT + QRESULT queryInterface( const QUuid&, QUnknownInterface** ); + Q_REFCOUNT +#endif + + virtual QWidget *inputMethod( QWidget *parent, Qt::WFlags f ); + virtual void resetState(); + virtual QPixmap *icon(); + virtual QString name(); + virtual void onKeyPress( QObject *receiver, const char *slot ); + +private: + %{APPNAME} *m_pickboard; + QPixmap *m_icn; +}; + +#endif -- cgit v1.2.1