00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __swallow_h__
00020 #define __swallow_h__
00021
00022
00023 #include <tqevent.h>
00024 #include <tqptrlist.h>
00025 #include <qxembed.h>
00026
00027 #include <kpanelapplet.h>
00028
00029 class TQBoxLayout;
00030 class KConfig;
00031 class KProcess;
00032 class KWinModule;
00033
00034 class SwallowApp;
00035
00036 typedef struct _SwallowCommand {
00037 TQString cmdline;
00038 TQString title;
00039 } SwallowCommand;
00040
00041 typedef TQPtrList<SwallowCommand> SwallowCommandList;
00042 typedef TQPtrListIterator<SwallowCommand> SwallowCommandListIterator;
00043 typedef TQPtrList<SwallowApp> SwallowAppList;
00044
00045 class SwallowApplet : public KPanelApplet
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 SwallowApplet( const TQString& configFile, TQWidget *parent,
00051 const char *name = 0L );
00052 ~SwallowApplet();
00053
00054
00055
00056 static KWinModule * winModule() { return wModule; }
00057 static void removeApplet( SwallowApp * );
00058
00059 public:
00060 int widthForHeight( int w );
00061 int heightForWidth( int h );
00062
00063 void windowAdded(WId win);
00064 void processExited(KProcess *proc);
00065
00066 public slots:
00067 virtual void preferences();
00068
00069 private slots:
00070 void embedded( SwallowApp * );
00071
00072 private:
00073 void layoutApps();
00074 SwallowCommandList* readConfig();
00075 void createApps( SwallowCommandList * );
00076
00077
00078 static SwallowApplet *self;
00079 static SwallowAppList *appList;
00080 static SwallowAppList *embeddedList;
00081 static KWinModule *wModule;
00082
00083 SwallowCommandList * m_swcList;
00084 TQBoxLayout *m_layout;
00085
00086 };
00087
00088
00089 class SwallowApp : public QXEmbed
00090 {
00091 Q_OBJECT
00092
00093 public:
00094 SwallowApp( const SwallowCommand * swc, TQWidget* parent = 0,
00095 const char* name = 0);
00096 ~SwallowApp();
00097
00098 float sizeRatio() const { return wh_ratio; }
00099
00100 signals:
00101 void embedded( SwallowApp * );
00102
00103 protected slots:
00104 void windowAdded(WId win);
00105 void processExited(KProcess *proc);
00106
00107 private:
00108 KProcess *process;
00109 TQString winTitle;
00110 float wh_ratio;
00111
00112 };
00113
00114 #endif // __swallow_h__