2000-03-24 22:23:02 +00:00
|
|
|
/*****************************************************************
|
|
|
|
kwin - the KDE window manager
|
2000-09-25 15:30:51 +00:00
|
|
|
|
2000-03-24 22:23:02 +00:00
|
|
|
Copyright (C) 1999, 2000 Daniel M. Duley <mosfet@kde.org>
|
|
|
|
******************************************************************/
|
1999-12-24 01:36:47 +00:00
|
|
|
#ifndef __PLUGINS_H
|
|
|
|
#define __PLUGINS_H
|
|
|
|
|
|
|
|
#include <qpopupmenu.h>
|
|
|
|
#include <qstringlist.h>
|
|
|
|
#include <ltdl.h>
|
|
|
|
|
|
|
|
|
|
|
|
class Client;
|
|
|
|
class Workspace;
|
|
|
|
|
|
|
|
class QFileInfo;
|
|
|
|
|
|
|
|
class PluginMgr : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PluginMgr();
|
|
|
|
~PluginMgr();
|
2000-09-25 15:30:51 +00:00
|
|
|
Client *allocateClient(Workspace *ws, WId w, bool tool);
|
1999-12-24 01:36:47 +00:00
|
|
|
void loadPlugin(QString name);
|
2000-09-11 05:30:24 +00:00
|
|
|
QString currentPlugin() { return pluginStr; }
|
2001-02-15 23:19:07 +00:00
|
|
|
public slots:
|
|
|
|
bool updatePlugin();
|
1999-12-24 01:36:47 +00:00
|
|
|
signals:
|
|
|
|
void resetAllClients();
|
|
|
|
protected:
|
2000-09-25 15:30:51 +00:00
|
|
|
Client* (*alloc_ptr)(Workspace *ws, WId w, int tool);
|
1999-12-24 01:36:47 +00:00
|
|
|
lt_dlhandle handle;
|
2000-09-11 05:30:24 +00:00
|
|
|
QString pluginStr;
|
1999-12-24 01:36:47 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class PluginMenu : public QPopupMenu
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
PluginMenu(PluginMgr *manager, QWidget *parent=0, const char *name=0);
|
|
|
|
protected slots:
|
|
|
|
void slotAboutToShow();
|
|
|
|
void slotActivated(int id);
|
|
|
|
protected:
|
|
|
|
void parseDesktop(QFileInfo *fi);
|
|
|
|
QStringList fileList;
|
|
|
|
int idCount;
|
2000-09-11 05:30:24 +00:00
|
|
|
int idCurrent;
|
1999-12-24 01:36:47 +00:00
|
|
|
PluginMgr *mgr;
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|