summaryrefslogtreecommitdiffstats
path: root/kicker/applets/swallow
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit4aed2c8219774f5d797760606b8489a92ddc5163 (patch)
tree3f8c130f7d269626bf6a9447407ef6c35954426a /kicker/applets/swallow
downloadtdebase-4aed2c8219774f5d797760606b8489a92ddc5163.tar.gz
tdebase-4aed2c8219774f5d797760606b8489a92ddc5163.zip
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/kdebase@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kicker/applets/swallow')
-rw-r--r--kicker/applets/swallow/Makefile.am18
-rw-r--r--kicker/applets/swallow/prefwidget.cpp39
-rw-r--r--kicker/applets/swallow/prefwidget.h34
-rw-r--r--kicker/applets/swallow/prefwidgetbase.ui134
-rw-r--r--kicker/applets/swallow/swallow.cpp348
-rw-r--r--kicker/applets/swallow/swallow.h114
-rw-r--r--kicker/applets/swallow/swallowapplet.desktop142
7 files changed, 829 insertions, 0 deletions
diff --git a/kicker/applets/swallow/Makefile.am b/kicker/applets/swallow/Makefile.am
new file mode 100644
index 000000000..1b88a0c10
--- /dev/null
+++ b/kicker/applets/swallow/Makefile.am
@@ -0,0 +1,18 @@
+INCLUDES = $(all_includes)
+
+kde_module_LTLIBRARIES = swallow_panelapplet.la
+
+swallow_panelapplet_la_LDFLAGS = -module $(KDE_PLUGIN) $(all_libraries)
+swallow_panelapplet_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
+
+swallow_panelapplet_la_SOURCES = swallow.cpp prefwidgetbase.ui prefwidget.cpp
+
+noinst_HEADERS = swallow.h prefwidget.h prefwidgetbase.h
+
+swallow_panelapplet_la_METASOURCES = AUTO
+
+applnk_DATA = swallowapplet.desktop
+applnkdir = $(kde_datadir)/kicker/applets
+
+#messages: rc.cpp
+# $(XGETTEXT) *.cpp -o $(podir)/swallowapplet.pot
diff --git a/kicker/applets/swallow/prefwidget.cpp b/kicker/applets/swallow/prefwidget.cpp
new file mode 100644
index 000000000..2e443a6b2
--- /dev/null
+++ b/kicker/applets/swallow/prefwidget.cpp
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2001 Daniel Molkentin <[email protected]>
+ *
+ * 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
+ */
+
+#include <keditlistbox.h>
+
+#include "prefwidget.h"
+
+PreferencesWidget::PreferencesWidget( SwallowCommandList *swc, QWidget *parent )
+ : PreferencesWidgetBase(parent)
+{
+
+ SwallowCommandListIterator it( *swc );
+ SwallowCommand *currentCL;
+ while ( ( currentCL = it.current() ) != 0 )
+ {
+ ++it;
+ klebDockApps->insertItem( currentCL->title );
+ }
+}
+/*
+PreferencesWidget::~PreferencesWidget()
+{
+}
+*/
+#include "prefwidget.moc"
diff --git a/kicker/applets/swallow/prefwidget.h b/kicker/applets/swallow/prefwidget.h
new file mode 100644
index 000000000..76ecce35e
--- /dev/null
+++ b/kicker/applets/swallow/prefwidget.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2001 Daniel Molkentin <[email protected]>
+ *
+ * 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
+ */
+
+#ifndef PREFWIDGET_H
+#define PREFWIDGET_H
+
+#include "prefwidgetbase.h"
+#include "swallow.h"
+
+class PreferencesWidget : public PreferencesWidgetBase
+{
+ Q_OBJECT
+
+public:
+ PreferencesWidget( SwallowCommandList* swc, QWidget* parent = 0 );
+// ~PreferencesWidget();
+
+};
+
+#endif
diff --git a/kicker/applets/swallow/prefwidgetbase.ui b/kicker/applets/swallow/prefwidgetbase.ui
new file mode 100644
index 000000000..bd2673efa
--- /dev/null
+++ b/kicker/applets/swallow/prefwidgetbase.ui
@@ -0,0 +1,134 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>PreferencesWidgetBase</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>PreferencesWidgetBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>409</width>
+ <height>366</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>AppDock Preferences</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton" row="3" column="2">
+ <property name="name">
+ <cstring>PushButton1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;OK</string>
+ </property>
+ <property name="on">
+ <bool>false</bool>
+ </property>
+ <property name="default">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="KEditListBox" row="1" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>klebDockApps</cstring>
+ </property>
+ <property name="title">
+ <string>Applications to Dock</string>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>GroupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Entry Details</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>leName</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Command &amp;line:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>urlCommandLine</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>leName</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Specify a short name for the application.</string>
+ </property>
+ </widget>
+ <widget class="KURLRequester" row="1" column="1">
+ <property name="name">
+ <cstring>urlCommandLine</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Specify a path to the application. This may include startup parameters. You can use the folder icon to select the application.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="3" column="3">
+ <property name="name">
+ <cstring>PushButton2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <spacer row="3" column="1">
+ <property name="name">
+ <cstring>Spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<includes>
+ <include location="local" impldecl="in implementation">kdialog.h</include>
+</includes>
+<layoutdefaults spacing="3" margin="6"/>
+<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
+<includehints>
+ <includehint>keditlistbox.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>klineedit.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kicker/applets/swallow/swallow.cpp b/kicker/applets/swallow/swallow.cpp
new file mode 100644
index 000000000..b1224986b
--- /dev/null
+++ b/kicker/applets/swallow/swallow.cpp
@@ -0,0 +1,348 @@
+/*
+ * Copyright (c) 2000 Matthias Elter <[email protected]>
+ * 2000 Carsten Pfeiffer <[email protected]>
+ * based on keyes (C) 1999 by Jerome Tollet <[email protected]>
+ *
+ * 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
+ */
+
+
+#include <stdlib.h>
+
+#include <qlayout.h>
+#include <qstringlist.h>
+
+#include <kapplication.h>
+#include <kcmdlineargs.h>
+#include <kconfig.h>
+#include <kdebug.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kprocess.h>
+#include <kshell.h>
+#include <kwin.h>
+#include <kwinmodule.h>
+
+#include <X11/Xlib.h>
+#include <X11/Xutil.h>
+
+#include "swallow.h"
+#include "prefwidget.h"
+
+template class QPtrList<SwallowApp>;
+typedef QPtrListIterator<SwallowApp> SwallowAppListIterator;
+template class QPtrList<SwallowCommand>;
+
+
+// init static variables
+SwallowAppList * SwallowApplet::appList = 0L;
+SwallowAppList * SwallowApplet::embeddedList = 0L;
+KWinModule * SwallowApplet::wModule = 0L;
+SwallowApplet * SwallowApplet::self = 0L;
+
+extern "C"
+{
+ KDE_EXPORT KPanelApplet* init(QWidget *parent, const QString& configFile) {
+ return new SwallowApplet(configFile, parent, "kswallow applet");
+ }
+}
+
+
+SwallowApplet::SwallowApplet( const QString& configFile,
+ QWidget *parent, const char *name )
+ : KPanelApplet( configFile, Normal, Preferences, parent, name )
+{
+ resize( 30, 30 );
+ kdDebug() << "**** constructing swallow applet (" << configFile << ") ****" << endl;
+ self = this;
+ m_swcList = new SwallowCommandList;
+ m_swcList->setAutoDelete( true );
+ wModule = new KWinModule(this);
+ embeddedList = new SwallowAppList;
+ embeddedList->setAutoDelete( false );
+ appList = new SwallowAppList;
+ appList->setAutoDelete( true );
+
+ QBoxLayout::Direction d = (orientation() == Horizontal) ?
+ QBoxLayout::LeftToRight : QBoxLayout::TopToBottom;
+ m_layout = new QBoxLayout( this, d, 0, 2 ); // make stretch configurable?
+ m_layout->setAutoAdd( false );
+
+ // read the config file and start all the configured apps
+ createApps( readConfig() );
+
+ if ( appList->count() == 0 ) {
+ if ( KMessageBox::questionYesNo(0L, i18n("There is no swallowed application, "
+ "do you want to configure or quit?"), i18n("No Swallowed Application"),
+ KGuiItem(i18n("Configure"),"configure"), KStdGuiItem::quit()) == KMessageBox::Yes )
+ preferences();
+ else {
+ delete this;
+ ::exit(0);
+ }
+ }
+
+ emit updateLayout();
+}
+
+SwallowApplet::~SwallowApplet()
+{
+ kdDebug() << "********************** DELETING ************************" << endl;
+
+ delete m_swcList;
+ delete embeddedList;
+ delete appList;
+ delete wModule;
+ wModule = 0L;
+}
+
+
+SwallowCommandList* SwallowApplet::readConfig()
+{
+ m_swcList->clear();
+ KConfig *kc = config();
+
+ kc->setGroup("General");
+ int count = kc->readNumEntry("Number of apps");
+ kdDebug() << "*** Registered " << count << " App(s) to be swallow'ed!" << endl;
+ QString group = "SwallowApp %1";
+ QString title, cmd;
+ ushort errors = 0;
+ SwallowCommand *swc = 0L;
+
+ for ( int i = 1; i <= count; i++ ) {
+ kc->setGroup( group.arg(i) );
+ cmd = kc->readPathEntry("Commandline");
+ title = kc->readEntry("Window title");
+ kdDebug() << "*** Found Entry: Cmd-Line: " << cmd << " Window-Title: " << title << endl;
+
+ if ( !cmd.isEmpty() && !title.isEmpty() ) {
+ swc = new SwallowCommand;
+ swc->cmdline = cmd;
+ swc->title = title;
+ m_swcList->append( swc );
+ }
+ // remember items with non-null cmdline or title,
+ // discard items with empty cmdline and empty title
+ else if ( !(cmd.isEmpty() && title.isEmpty()) )
+ errors++;
+ }
+
+ if ( errors > 0 ) {
+ QString entry = (errors == 1) ? i18n("entry") : i18n("entries");
+ if ( KMessageBox::questionYesNo(0L, i18n("I found %1 invalid/incomplete %2\nin the configuration file.\n\nBoth the window title and the commandline\n of the to be swallowed application\nare required.\n\n.Do you want to correct this?").arg(errors).arg(entry), i18n("Configuration Error"),i18n("Correct"),i18n("Ignore Error")) == KMessageBox::Yes)
+ preferences();
+ }
+
+ return m_swcList;
+}
+
+
+void SwallowApplet::createApps( SwallowCommandList* list )
+{
+ SwallowApp *app = 0L;
+
+ SwallowCommandListIterator it( *list );
+ while ( (it.current()) ) {
+ app = new SwallowApp( it.current(), this );
+ app->hide();
+ connect( app, SIGNAL( embedded(SwallowApp *)),
+ SLOT( embedded(SwallowApp *)));
+ appList->append( app );
+ ++it;
+ kapp->processEvents();
+ }
+
+ m_layout->activate();
+}
+
+
+void SwallowApplet::embedded( SwallowApp *app )
+{
+ kdDebug() << " -> embedding " << app << ", current size is: " << width() << ", " << height() << endl;
+ if ( orientation() == Horizontal )
+ app->resize(height() * app->sizeRatio(), height() );
+ else
+ app->resize(width(), width() * app->sizeRatio());
+
+ kdDebug() << "--> ratio: " << app->sizeRatio() << endl;
+ kdDebug() << "**** " << app << " is embedded now, with (" << app->width() << ", " << app->height() << ")" << endl;
+
+ disconnect( app, SIGNAL( embedded(SwallowApp *)),
+ this, SLOT( embedded(SwallowApp *)));
+
+ embeddedList->append( app );
+
+ if ( orientation() == Horizontal )
+ resize( widthForHeight( height() ), height() );
+ else
+ resize( width(), heightForWidth( width() ));
+
+ m_layout->addWidget( app );
+ app->show();
+ updateGeometry();
+ emit updateLayout();
+}
+
+void SwallowApplet::preferences()
+{
+ PreferencesWidget *prefs = new PreferencesWidget(m_swcList,this);
+ prefs->show();
+}
+
+
+int SwallowApplet::widthForHeight(int he)
+{
+ kdDebug() << "**** width for h: " << he << endl;
+ int w = embeddedList->isEmpty() ? 30 : 0;
+ layoutApps();
+ SwallowAppListIterator it( *embeddedList );
+ while ( it.current() ) {
+ kdDebug() << "current: " << it.current()->width() << endl;
+ w += (it.current())->width();
+ ++it;
+ }
+
+ kdDebug() << "**** wfh: " << w << " : count: " << embeddedList->count() << endl;
+ return w;
+}
+
+
+int SwallowApplet::heightForWidth(int)
+{
+ int h = embeddedList->isEmpty() ? 30 : 0;
+ layoutApps();
+ SwallowAppListIterator it( *embeddedList );
+ while ( it.current() ) {
+ h += (it.current())->height();
+ ++it;
+ }
+
+ kdDebug() << "**** hfw: " << h << endl;
+ return h;
+}
+
+void SwallowApplet::layoutApps()
+{
+ if ( KPanelApplet::orientation() == Horizontal )
+ m_layout->setDirection( QBoxLayout::LeftToRight );
+ else
+ m_layout->setDirection( QBoxLayout::TopToBottom );
+}
+
+
+void SwallowApplet::removeApplet( SwallowApp *app )
+{
+ embeddedList->removeRef( app );
+ appList->remove( app );
+ emit self->updateLayout();
+}
+
+
+///////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+///////////////////////////////////////////////////////////////////
+
+
+static void parseCommand(KProcess *proc, QString cmd)
+{
+ int pos;
+
+ cmd += " ";
+
+ pos = cmd.find(' ');
+ *proc << cmd.left(pos);
+ cmd.remove(0,pos);
+ cmd = cmd.stripWhiteSpace();
+ *proc << KShell::splitArgs(cmd, KShell::TildeExpand | KShell::AbortOnMeta);
+}
+
+
+SwallowApp::SwallowApp(const SwallowCommand *swc, QWidget* parent,
+ const char* /* name */)
+ : QXEmbed( parent )
+{
+ wh_ratio = 1;
+ setAutoDelete( false );
+ QXEmbed::initialize();
+
+ winTitle = swc->title;
+ connect(SwallowApplet::winModule(), SIGNAL(windowAdded(WId)),
+ this, SLOT(windowAdded(WId)));
+
+ if (!swc->cmdline.isEmpty()) {
+ KProcess *process = new KProcess;
+ parseCommand(process, swc->cmdline);
+
+ // move window out of sight
+ // *process << "-geometry";
+ // *process << QString("32x32+%1+%2").arg(kapp->desktop()->width()).arg(kapp->desktop()->height());
+
+ connect(process, SIGNAL(processExited(KProcess*)),
+ this, SLOT(processExited(KProcess*)));
+
+ process->start();
+ }
+}
+
+
+SwallowApp::~SwallowApp()
+{
+ delete process;
+}
+
+
+void SwallowApp::windowAdded(WId win)
+{
+ // determine title of newly mapped window
+ XTextProperty nameProp;
+ XGetWMName(qt_xdisplay(), win, &nameProp);
+ char **names;
+ int count;
+ XTextPropertyToStringList(&nameProp, &names, &count);
+ if (count < 1) {
+ XFreeStringList(names);
+ return;
+ }
+
+ // is this our client?
+ if (winTitle == names[0]) {
+ kdDebug()<< "embedding window with title: "<<winTitle.latin1() << endl;
+
+ QRect r = KWin::windowInfo(win).geometry();
+ int h = r.height();
+ if ( h == 0 ) h = 1;
+ wh_ratio = (float) r.width() / (float) h;
+ kdDebug() << " - - - win is: " << r.width() << ", " << r.height() << endl;
+ resize( r.width(), r.height() );
+
+ embed(win);
+ XReparentWindow(qt_xdisplay(), win, winId(), 0, 0);
+
+ disconnect(SwallowApplet::winModule(), SIGNAL(windowAdded(WId)),
+ this, SLOT(windowAdded(WId)));
+
+ emit embedded( this );
+ }
+
+ XFreeStringList(names);
+}
+
+
+void SwallowApp::processExited(KProcess *)
+{
+ SwallowApplet::removeApplet( this ); // also deletes this app
+}
+
+#include "swallow.moc"
diff --git a/kicker/applets/swallow/swallow.h b/kicker/applets/swallow/swallow.h
new file mode 100644
index 000000000..8e472f415
--- /dev/null
+++ b/kicker/applets/swallow/swallow.h
@@ -0,0 +1,114 @@
+/*
+ * Copyright (c) 2000 Matthias H�lzer-Kl�pfel <[email protected]>
+ 2000 Carsten Pfeiffer <[email protected]>
+ *
+ * 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
+ */
+
+#ifndef __swallow_h__
+#define __swallow_h__
+
+
+#include <qevent.h>
+#include <qptrlist.h>
+#include <qxembed.h>
+
+#include <kpanelapplet.h>
+
+class QBoxLayout;
+class KConfig;
+class KProcess;
+class KWinModule;
+
+class SwallowApp;
+
+typedef struct _SwallowCommand {
+ QString cmdline;
+ QString title;
+} SwallowCommand;
+
+typedef QPtrList<SwallowCommand> SwallowCommandList;
+typedef QPtrListIterator<SwallowCommand> SwallowCommandListIterator;
+typedef QPtrList<SwallowApp> SwallowAppList;
+
+class SwallowApplet : public KPanelApplet
+{
+ Q_OBJECT
+
+public:
+ SwallowApplet( const QString& configFile, QWidget *parent,
+ const char *name = 0L );
+ ~SwallowApplet();
+
+ // returns 0L if we don't have a SwallowApplet object yet,
+ // but who cares
+ static KWinModule * winModule() { return wModule; }
+ static void removeApplet( SwallowApp * );
+
+public: // for KPanelApplet
+ int widthForHeight( int w );
+ int heightForWidth( int h );
+
+ void windowAdded(WId win);
+ void processExited(KProcess *proc);
+
+public slots:
+ virtual void preferences();
+
+private slots:
+ void embedded( SwallowApp * );
+
+private:
+ void layoutApps();
+ SwallowCommandList* readConfig();
+ void createApps( SwallowCommandList * );
+
+
+ static SwallowApplet *self;
+ static SwallowAppList *appList;
+ static SwallowAppList *embeddedList;
+ static KWinModule *wModule;
+
+ SwallowCommandList * m_swcList;
+ QBoxLayout *m_layout;
+
+};
+
+
+class SwallowApp : public QXEmbed
+{
+ Q_OBJECT
+
+public:
+ SwallowApp( const SwallowCommand * swc, QWidget* parent = 0,
+ const char* name = 0);
+ ~SwallowApp();
+
+ float sizeRatio() const { return wh_ratio; }
+
+signals:
+ void embedded( SwallowApp * );
+
+protected slots:
+ void windowAdded(WId win);
+ void processExited(KProcess *proc);
+
+private:
+ KProcess *process;
+ QString winTitle;
+ float wh_ratio;
+
+};
+
+#endif // __swallow_h__
diff --git a/kicker/applets/swallow/swallowapplet.desktop b/kicker/applets/swallow/swallowapplet.desktop
new file mode 100644
index 000000000..2ea055461
--- /dev/null
+++ b/kicker/applets/swallow/swallowapplet.desktop
@@ -0,0 +1,142 @@
+[Desktop Entry]
+Type=Plugin
+Name=Swallow Applet
+Name[af]=Sluk Miniprogram
+Name[ar]=بريمج Swallow
+Name[az]=Batıq Proqramcıq
+Name[be]=Аплет праглынання
+Name[bn]=সোয়্যালো অ্যাপলেট
+Name[bs]=Applet - gutač
+Name[ca]=Applet contenidor
+Name[cs]=Pohlcovací applet
+Name[csb]=Aplet do zanurzaniô jinszëch
+Name[cy]=Rhaglennig Llyncu
+Name[da]=Swallow-panelprogram
+Name[de]=Einbettungsprogramm
+Name[el]=Ενσωμάτωση μικροεφαρμογής
+Name[eo]=Sistemaplikaĵetejo
+Name[es]=Miniaplicación contenedora
+Name[et]=Põimimise aplett
+Name[eu]=Swallow appleta
+Name[fa]=برنامک Swallow
+Name[fi]=Upotussovelma
+Name[fr]=Applet englobante
+Name[fy]=Ynslúte applet
+Name[gl]=Applet Swallow
+Name[he]=יישומון מעגן
+Name[hi]=स्वालो ऐपलेट
+Name[hr]=Progutaj aplet
+Name[hu]=Elnyelő kisalkalmazás
+Name[is]=Gleypi smáforrit
+Name[it]=Applet che ingloba
+Name[ja]=Swallow アプレット
+Name[ka]=მშთანთქავი აპლეტი
+Name[kk]=Сіңіру апплеті
+Name[km]=អាប់ភ្លេត Swallow
+Name[lt]=Swallow priemonė
+Name[mk]=Аплет „Голтни“
+Name[mn]=Шигтгэгч-програм
+Name[ms]=Aplet Lelayang
+Name[mt]=Applet "Swallow"
+Name[nb]=Svelge-panelprogram
+Name[nds]=Lüttprogramm för't Inbetten
+Name[ne]=स्वालो एप्लेट
+Name[nl]=Inbeddingsapplet
+Name[nn]=Svelge-applet
+Name[nso]=Applet ya Mometso
+Name[pa]=ਸਵਾਲੋਓ ਐਪਲਿਟ
+Name[pl]=Programik do zanurzania innych
+Name[pt]='Applet' Swallow
+Name[pt_BR]=Mini-aplicativo de integração
+Name[ro]=Miniaplicație de înglobare
+Name[ru]=Аплет поглощения
+Name[rw]=Kwemera Apuleti
+Name[se]=Njeallan-prográmmaš
+Name[sk]=Pohlcovací applet
+Name[sl]=Vstavek z lastovko
+Name[sr]=Аплет за гутање
+Name[sr@Latn]=Aplet za gutanje
+Name[sv]=Uppslukande miniprogram
+Name[ta]=உள்வாங்கும் சிறுநிரல்
+Name[te]=స్వాలొ అప్లేట్
+Name[tg]=Барномаи қурт доданӣ
+Name[tr]=Batık Programcık
+Name[tt]=Yotu Applete
+Name[uk]=Аплет Swallow
+Name[ven]=Apulete ya Swallow
+Name[vi]=Tiểu ứng dụng Chim nhạn
+Name[wa]=Aplikete avaleuse
+Name[zh_CN]=Swallow 小程序
+Name[zh_TW]=Swallow 面板小程式
+Name[zu]=I-Applet yokugwinya
+Comment=The swallow panel applet
+Comment[af]=Die sluk paneel miniprogram
+Comment[az]=Batıq panel
+Comment[be]=Аплет праглынання для панэлі
+Comment[bn]=সোয়্যালো প্যানেল অ্যাপলেট
+Comment[bs]=Applet koji "guta" aplikacije u panel
+Comment[ca]=L'applet contenidor del plafó
+Comment[cs]=Pohlcovací applet pro panel
+Comment[csb]=Aplet dlô panelu jaczi ùsôdzô òbéńdã do zanurzaniô jinszëch
+Comment[cy]=Rhaglennig llyncu i'r panel
+Comment[da]=Swallow-panelprogrammet
+Comment[de]=Leiste zum Einbetten von X-Anwendungen
+Comment[el]=Μικροεφαρμογή του πίνακα που "καταπίνει"
+Comment[eo]=La panelaplikaĵeto enhavanta la dokitajn programojn
+Comment[es]=La miniaplicación del panel contenedora
+Comment[et]=Paneelil töötav põimimise aplett
+Comment[eu]=Swallow paneleko appleta
+Comment[fa]=برنامک تابلوی Swallow
+Comment[fi]=Paneelin upotussovelma
+Comment[fr]=L'applet englobante du tableau de bord
+Comment[fy]=Applet foar it ynlúte fan X-toepassingen
+Comment[gl]=O applet swallow para o painel
+Comment[he]=יישומון מעגן עבור הלוח
+Comment[hi]=स्वालो फलक ऐपलेट
+Comment[hr]=Gutač apleta za ploču
+Comment[hu]=Egy elnyelő panel-kisalkalmazás
+Comment[id]=Aplet panel swallow
+Comment[is]=Gleypispjalds smáforritið
+Comment[it]=Applet per inglobare le applicazioni nel pannello
+Comment[ja]=swallow パネルアプレット
+Comment[ka]=პანელის მშთანთქავი აპლეტი
+Comment[kk]=Сіңіру панель апплеті
+Comment[km]=អាប់ភ្លេត​បន្ទះ swallow
+Comment[lt]=Swallow pulto priemonė
+Comment[mk]=Аплетот „Голтни“ од панелот
+Comment[mn]=X-програмуудыг холбогч програм
+Comment[ms]=Aplet panel lelayang
+Comment[mt]=Applet għall-pannell "swallow"
+Comment[nb]=Et panelprogram som svelger andre panelprogrammer
+Comment[nds]=Paneel för't Inbetten vun X-Programmen
+Comment[ne]=स्वालो प्यानल एप्लेट
+Comment[nl]=Applet voor het inbedden van X-toepassingen
+Comment[nn]=Svelge-panelappleten
+Comment[nso]=Applet ya panel ya mometso
+Comment[pa]=ਸਵਾਲੋਓ ਪੈਨਲ ਐਪਲਿਟ
+Comment[pl]=Programik dla panelu tworzący przestrzeń do zanurzania innych
+Comment[pt]=A 'applet' do painel swallow
+Comment[pt_BR]=Mini-aplicativo de integração para o painel
+Comment[ro]=Miniaplicație de panou pentru înglobare altor programe
+Comment[ru]=Аплет панели поглощения
+Comment[rw]=Apuleti y'umwanya kumira
+Comment[se]=Njeallan-panelprográmmaš
+Comment[sk]=Pohlcovací applet pre panel
+Comment[sl]=Vstavek lastovke za na pult
+Comment[sr]=Аплет панела за гутање
+Comment[sr@Latn]=Aplet panela za gutanje
+Comment[sv]=Uppslukande miniprogram för panelen
+Comment[ta]=உள்வாங்கும் பலக சிறுநிரல்
+Comment[tg]=Барномаи қурт додани сафҳа
+Comment[th]=แอพเพล็ต swallow
+Comment[tr]=Batık panel
+Comment[tt]=Yotuçı taqta applete
+Comment[uk]=Аплет панелі swallow
+Comment[vi]=Tiểu ứng dụng chạy bảng điều khiển chim nhạn
+Comment[wa]=L' aplikete avaleuse do scriftôr
+Comment[xh]=I window eneenkcukacha ye swallow applet
+Comment[zh_CN]=Swallow 面板小程序
+Comment[zh_TW]=swallow 面板小程式
+Comment[zu]=I-applet lewindi lemininingwane lokugwinya
+X-KDE-Library=swallow_panelapplet
+X-KDE-UniqueApplet=true