From 2f902255436ccd6bc66f26a0f22d25fe4c115f37 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 20 Feb 2001 01:20:38 +0000 Subject: [PATCH] Put stuff in KWinInternal namespace. Export client.h, workspace.h and options.h so that people can write plugins. svn path=/trunk/kdebase/kwin/; revision=83707 --- Makefile.am | 3 +++ client.cpp | 36 ++++++++++++++++------------- client.h | 7 +++++- clients/b2/b2client.cpp | 2 ++ clients/b2/b2client.h | 7 +++--- clients/kde1/kde1client.cpp | 2 ++ clients/kde1/kde1client.h | 5 +++- clients/kstep/nextclient.cpp | 2 ++ clients/kstep/nextclient.h | 6 ++--- clients/kwmtheme/kwmthemeclient.cpp | 3 ++- clients/kwmtheme/kwmthemeclient.h | 6 ++++- clients/laptop/laptopclient.cpp | 2 ++ clients/laptop/laptopclient.h | 6 ++--- clients/modernsystem/modernsys.cpp | 2 ++ clients/modernsystem/modernsys.h | 4 +++- clients/mwm/mwmclient.cpp | 2 ++ clients/mwm/mwmclient.h | 6 ++--- clients/riscos/Manager.cpp | 12 +++++----- clients/riscos/Manager.h | 8 +++---- clients/system/systemclient.cpp | 2 ++ clients/system/systemclient.h | 5 +++- clients/win2k/win2k.cpp | 2 ++ clients/win2k/win2k.h | 4 +++- default/kdedefault.cpp | 2 ++ default/kdedefault.h | 6 ++--- killwindow.cpp | 2 ++ killwindow.h | 4 ++++ main.cpp | 2 ++ main.h | 2 +- plugins.cpp | 4 +++- plugins.h | 6 +++-- tabbox.cpp | 2 ++ tabbox.h | 7 +++++- workspace.cpp | 29 +++++++++++++---------- workspace.h | 12 ++++++---- 35 files changed, 142 insertions(+), 70 deletions(-) diff --git a/Makefile.am b/Makefile.am index 6fa1521c9d..0659f03ded 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,9 @@ kwin_la_LDFLAGS = $(all_libraries) -module -avoid-version include_HEADERS = KWinInterface.h +kwinincludedir = $(includedir)/kwin +kwininclude_HEADERS = options.h client.h workspace.h + kwin_SOURCES = kwin_main.cpp kwin_LDADD = kwin.la kwin_LDFLAGS = $(all_libraries) $(KDE_RPATH) diff --git a/client.cpp b/client.cpp index 11277f9f04..b1975c727d 100644 --- a/client.cpp +++ b/client.cpp @@ -33,23 +33,16 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include -extern Atom qt_wm_state; -extern Time kwin_time; - -static bool resizeHorizontalDirectionFixed = FALSE; -static bool resizeVerticalDirectionFixed = FALSE; -static bool blockAnimation = FALSE; - - -static QRect* visible_bound = 0; +namespace KWinInternal { // NET WM Protocol handler class -class WinInfo : public NETWinInfo { +class WinInfo : public NETWinInfo +{ public: - WinInfo(::Client * c, Display * display, Window window, + WinInfo(KWinInternal::Client * c, Display * display, Window window, Window rwin, unsigned long pr ) : NETWinInfo( display, window, rwin, pr, NET::WindowManager ) { - m_client = c; + m_client = c; } virtual void changeDesktop(int desktop) { @@ -70,9 +63,9 @@ public: if ( (mask & NET::Max) == NET::Max ) { m_client->maximizeRaw( state & NET::MaxVert, state & NET::MaxHoriz ); } else if ( mask & NET::MaxVert ) { - m_client->maximizeRaw( state & NET::MaxVert, m_client->maximizeMode() & Client::MaximizeHorizontal ); + m_client->maximizeRaw( state & NET::MaxVert, m_client->maximizeMode() & KWinInternal::Client::MaximizeHorizontal ); } else if ( mask & NET::MaxHoriz ) { - m_client->maximizeRaw( m_client->maximizeMode() & Client::MaximizeVertical, state & NET::MaxHoriz ); + m_client->maximizeRaw( m_client->maximizeMode() & KWinInternal::Client::MaximizeVertical, state & NET::MaxHoriz ); } if ( mask & NET::StaysOnTop) { m_client->setStaysOnTop( (state & NET::StaysOnTop) != 0 ); @@ -81,9 +74,21 @@ public: } } private: - ::Client * m_client; + KWinInternal::Client * m_client; }; +}; + +using namespace KWinInternal; + +extern Atom qt_wm_state; +extern Time kwin_time; + +static bool resizeHorizontalDirectionFixed = FALSE; +static bool resizeVerticalDirectionFixed = FALSE; +static bool blockAnimation = FALSE; + +static QRect* visible_bound = 0; void Client::drawbound( const QRect& geom ) { @@ -2950,4 +2955,3 @@ QPixmap * kwin_get_menu_pix_hack() #include "client.moc" - diff --git a/client.h b/client.h index 8d52b44327..75ba435e46 100644 --- a/client.h +++ b/client.h @@ -16,10 +16,13 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include +class NETWinInfo; + +namespace KWinInternal { + class Workspace; class Client; class WinInfo; -class NETWinInfo; class WindowWrapper : public QWidget { @@ -452,4 +455,6 @@ public: void setShade( bool , int ){} }; +}; + #endif diff --git a/clients/b2/b2client.cpp b/clients/b2/b2client.cpp index b31eee6af7..d205aa5aa6 100644 --- a/clients/b2/b2client.cpp +++ b/clients/b2/b2client.cpp @@ -13,6 +13,8 @@ #include "../../options.h" #include "bitmaps.h" +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w, int) diff --git a/clients/b2/b2client.h b/clients/b2/b2client.h index 1883c22be3..b3328fc6c5 100644 --- a/clients/b2/b2client.h +++ b/clients/b2/b2client.h @@ -10,6 +10,8 @@ class QLabel; //class QHBoxLayout; class QGridLayout; +namespace KWinInternal { + class B2Button : public QButton { Q_OBJECT @@ -71,7 +73,7 @@ protected: B2Client *client; }; -class B2Client : public Client +class B2Client : public KWinInternal::Client { Q_OBJECT friend class B2Titlebar; @@ -113,7 +115,6 @@ private: }; - - +}; #endif diff --git a/clients/kde1/kde1client.cpp b/clients/kde1/kde1client.cpp index 9acd7c5e3d..e5feda2945 100644 --- a/clients/kde1/kde1client.cpp +++ b/clients/kde1/kde1client.cpp @@ -20,6 +20,8 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include "kde1client_bitmaps.h" +using namespace KWinInternal; + extern "C" { Client * allocate(Workspace * workSpace, WId winId, int tool ) diff --git a/clients/kde1/kde1client.h b/clients/kde1/kde1client.h index 90ee2576ca..26a0d75266 100644 --- a/clients/kde1/kde1client.h +++ b/clients/kde1/kde1client.h @@ -10,7 +10,9 @@ Copyright (C) 1999, 2000 Matthias Ettrich class QLabel; class QSpacerItem; -class StdClient : public Client +namespace KWinInternal { + +class StdClient : public KWinInternal::Client { Q_OBJECT public: @@ -106,5 +108,6 @@ private: }; +}; #endif diff --git a/clients/kstep/nextclient.cpp b/clients/kstep/nextclient.cpp index a7250380f8..b154deaf4c 100644 --- a/clients/kstep/nextclient.cpp +++ b/clients/kstep/nextclient.cpp @@ -11,6 +11,8 @@ #include "../../workspace.h" #include "../../options.h" +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w, int ) diff --git a/clients/kstep/nextclient.h b/clients/kstep/nextclient.h index 5bc1972312..ad0ca28781 100644 --- a/clients/kstep/nextclient.h +++ b/clients/kstep/nextclient.h @@ -8,6 +8,7 @@ class QLabel; class QSpacerItem; +namespace KWinInternal { // get rid of autohide :P class NextButton : public QButton @@ -25,7 +26,7 @@ protected: Client *client; }; -class NextClient : public Client +class NextClient : public KWinInternal::Client { Q_OBJECT public: @@ -50,7 +51,6 @@ private: QSpacerItem* titlebar; }; - - +}; #endif diff --git a/clients/kwmtheme/kwmthemeclient.cpp b/clients/kwmtheme/kwmthemeclient.cpp index 845d50367b..dbb9a0037e 100644 --- a/clients/kwmtheme/kwmthemeclient.cpp +++ b/clients/kwmtheme/kwmthemeclient.cpp @@ -17,6 +17,8 @@ #include "../../workspace.h" #include "../../options.h" +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w) @@ -26,7 +28,6 @@ extern "C" } - enum FramePixmap{FrameTop=0, FrameBottom, FrameLeft, FrameRight, FrameTopLeft, FrameTopRight, FrameBottomLeft, FrameBottomRight}; diff --git a/clients/kwmtheme/kwmthemeclient.h b/clients/kwmtheme/kwmthemeclient.h index a80ab8a500..3b1041fcfa 100644 --- a/clients/kwmtheme/kwmthemeclient.h +++ b/clients/kwmtheme/kwmthemeclient.h @@ -8,6 +8,8 @@ class QLabel; class QSpacerItem; +namespace KWinInternal { + // QToolButton uses a 1 pixel border :P class MyButton : public QToolButton { @@ -18,7 +20,7 @@ protected: void drawButtonLabel(QPainter *p); }; -class KWMThemeClient : public Client +class KWMThemeClient : public KWinInternal::Client { Q_OBJECT public: @@ -46,5 +48,7 @@ private: QSpacerItem *titlebar; }; +}; + #endif diff --git a/clients/laptop/laptopclient.cpp b/clients/laptop/laptopclient.cpp index 75075c9775..c50dc41e1f 100644 --- a/clients/laptop/laptopclient.cpp +++ b/clients/laptop/laptopclient.cpp @@ -16,6 +16,8 @@ #include "../../workspace.h" #include "../../options.h" +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w, int) diff --git a/clients/laptop/laptopclient.h b/clients/laptop/laptopclient.h index 2bf8cceecd..260a85d83f 100644 --- a/clients/laptop/laptopclient.h +++ b/clients/laptop/laptopclient.h @@ -9,6 +9,7 @@ class QLabel; class QSpacerItem; class QHBoxLayout; +namespace KWinInternal { // get rid of autohide :P class LaptopClientButton : public QButton @@ -41,7 +42,7 @@ protected: Client *client; }; -class LaptopClient : public Client +class LaptopClient : public KWinInternal::Client { Q_OBJECT public: @@ -80,7 +81,6 @@ private: int lastBufferWidth; }; - - +}; #endif diff --git a/clients/modernsystem/modernsys.cpp b/clients/modernsystem/modernsys.cpp index 9c7f4750ff..2d5480fe0b 100644 --- a/clients/modernsystem/modernsys.cpp +++ b/clients/modernsystem/modernsys.cpp @@ -16,6 +16,8 @@ #include "buttondata.h" #include "btnhighcolor.h" +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w, int) diff --git a/clients/modernsystem/modernsys.h b/clients/modernsystem/modernsys.h index 589b655ea1..cdd4d97b90 100644 --- a/clients/modernsystem/modernsys.h +++ b/clients/modernsystem/modernsys.h @@ -8,6 +8,7 @@ class QLabel; class QSpacerItem; +namespace KWinInternal { // get rid of autohide :P class ModernButton : public QButton @@ -31,7 +32,7 @@ public: int last_button; }; -class ModernSys : public Client +class ModernSys : public KWinInternal::Client { Q_OBJECT public: @@ -62,5 +63,6 @@ private: QString oldTitle; }; +}; #endif diff --git a/clients/mwm/mwmclient.cpp b/clients/mwm/mwmclient.cpp index 7b5274efda..06738bc423 100644 --- a/clients/mwm/mwmclient.cpp +++ b/clients/mwm/mwmclient.cpp @@ -11,6 +11,8 @@ #include "../../workspace.h" #include "../../options.h" +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w) diff --git a/clients/mwm/mwmclient.h b/clients/mwm/mwmclient.h index 3359d91c62..6c56d449d1 100644 --- a/clients/mwm/mwmclient.h +++ b/clients/mwm/mwmclient.h @@ -8,6 +8,7 @@ class QLabel; class QSpacerItem; +namespace KWinInternal { // get rid of autohide :P class MwmButton : public QButton @@ -24,7 +25,7 @@ protected: QBitmap deco; }; -class MwmClient : public Client +class MwmClient : public KWinInternal::Client { Q_OBJECT public: @@ -45,8 +46,7 @@ private: QSpacerItem* titlebar; }; - - +}; #endif diff --git a/clients/riscos/Manager.cpp b/clients/riscos/Manager.cpp index e4b2bf26ff..8f9b8d95c0 100644 --- a/clients/riscos/Manager.cpp +++ b/clients/riscos/Manager.cpp @@ -45,7 +45,7 @@ extern "C" { - Client * allocate(Workspace * workSpace, WId winId, int tool) + KWinInternal::Client * allocate(KWinInternal::Workspace * workSpace, WId winId, int tool) { if (tool) return new RiscOS::ToolManager(workSpace, winId); @@ -59,12 +59,12 @@ namespace RiscOS Manager::Manager( - Workspace * workSpace, + KWinInternal::Workspace * workSpace, WId id, QWidget * parent, const char * name ) - : Client(workSpace, id, parent, name) + : KWinInternal::Client(workSpace, id, parent, name) { setBackgroundMode(NoBackground); @@ -192,7 +192,7 @@ Manager::paintEvent(QPaintEvent * e) void Manager::resizeEvent(QResizeEvent * e) { - Client::resizeEvent(e); + KWinInternal::Client::resizeEvent(e); updateButtonVisibility(); updateTitleBuffer(); repaint(); @@ -292,7 +292,7 @@ Manager::updateTitleBuffer() p.drawPixmap(tr.width() - 3, 0, s->titleTextRight(active)); } - Client::MousePosition +KWinInternal::Client::MousePosition Manager::mousePosition(const QPoint & p) const { MousePosition m = Center; @@ -580,7 +580,7 @@ void Manager::animate(bool iconify, int style) ToolManager::ToolManager( - Workspace * workSpace, + KWinInternal::Workspace * workSpace, WId id, QWidget * parent, const char * name diff --git a/clients/riscos/Manager.h b/clients/riscos/Manager.h index 1e85250388..67d21665f0 100644 --- a/clients/riscos/Manager.h +++ b/clients/riscos/Manager.h @@ -40,13 +40,13 @@ class StickyButton; class HelpButton; class Button; -class Manager : public Client +class Manager : public KWinInternal::Client { Q_OBJECT public: - Manager(Workspace *, WId, QWidget * parent = 0, const char * name = 0); + Manager(KWinInternal::Workspace *, WId, QWidget * parent = 0, const char * name = 0); ~Manager(); signals: @@ -65,7 +65,7 @@ class Manager : public Client protected: - Client::MousePosition mousePosition(const QPoint &) const; + KWinInternal::Client::MousePosition mousePosition(const QPoint &) const; void paletteChange(const QPalette &); void activeChange(bool); void maximizeChange(bool); @@ -105,7 +105,7 @@ class ToolManager : public Manager public: - ToolManager(Workspace *, WId, QWidget * parent = 0, const char * name = 0); + ToolManager(KWinInternal::Workspace *, WId, QWidget * parent = 0, const char * name = 0); ~ToolManager(); }; diff --git a/clients/system/systemclient.cpp b/clients/system/systemclient.cpp index 097fa60e17..4c8ca1687f 100644 --- a/clients/system/systemclient.cpp +++ b/clients/system/systemclient.cpp @@ -13,6 +13,8 @@ #include "../../workspace.h" #include "../../options.h" +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w, int) diff --git a/clients/system/systemclient.h b/clients/system/systemclient.h index 4aac90e5f2..49991427bb 100644 --- a/clients/system/systemclient.h +++ b/clients/system/systemclient.h @@ -12,6 +12,8 @@ class QLabel; class QSpacerItem; +namespace KWinInternal { + class SystemButton : public QToolButton { Q_OBJECT @@ -40,7 +42,7 @@ private: }; -class SystemClient : public Client +class SystemClient : public KWinInternal::Client { Q_OBJECT public: @@ -72,5 +74,6 @@ private: QString oldTitle; }; +}; #endif diff --git a/clients/win2k/win2k.cpp b/clients/win2k/win2k.cpp index b914f68582..fdad9a269b 100644 --- a/clients/win2k/win2k.cpp +++ b/clients/win2k/win2k.cpp @@ -25,6 +25,8 @@ #include "../../options.h" #include +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w, int) diff --git a/clients/win2k/win2k.h b/clients/win2k/win2k.h index aca8fe6ca5..d269474d7e 100644 --- a/clients/win2k/win2k.h +++ b/clients/win2k/win2k.h @@ -19,6 +19,7 @@ class QLabel; class QSpacerItem; class QHBoxLayout; +namespace KWinInternal { class GalliumButton : public QButton { @@ -58,7 +59,7 @@ protected: }; -class GalliumClient : public Client +class GalliumClient : public KWinInternal::Client { Q_OBJECT @@ -92,5 +93,6 @@ private: QHBoxLayout* hb; }; +}; #endif diff --git a/default/kdedefault.cpp b/default/kdedefault.cpp index 9907eccfdb..6204b93a54 100644 --- a/default/kdedefault.cpp +++ b/default/kdedefault.cpp @@ -20,6 +20,8 @@ Matthias Ettrich #include "../workspace.h" #include "../options.h" +using namespace KWinInternal; + extern "C" { Client *allocate(Workspace *ws, WId w, int) diff --git a/default/kdedefault.h b/default/kdedefault.h index abe99d738e..cc123e86e1 100644 --- a/default/kdedefault.h +++ b/default/kdedefault.h @@ -9,6 +9,7 @@ class QLabel; class QSpacerItem; class QHBoxLayout; +namespace KWinInternal { // get rid of autohide :P class KDEDefaultClientButton : public QToolButton @@ -46,7 +47,7 @@ protected: bool isMouseOver; }; -class KDEClient : public Client +class KDEClient : public KWinInternal::Client { Q_OBJECT public: @@ -87,7 +88,6 @@ private: KPixmap lightIcon; }; - - +}; #endif diff --git a/killwindow.cpp b/killwindow.cpp index d0d400d524..bde98e981c 100644 --- a/killwindow.cpp +++ b/killwindow.cpp @@ -17,6 +17,8 @@ Copyright (C) 1999, 2000 Matthias Ettrich #define None 0L #endif +using namespace KWinInternal; + KillWindow::KillWindow( Workspace* ws ) : workspace( ws ) {} diff --git a/killwindow.h b/killwindow.h index ce443d435c..a33e9e174e 100644 --- a/killwindow.h +++ b/killwindow.h @@ -8,6 +8,8 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include "workspace.h" +namespace KWinInternal { + class KillWindow { public: @@ -21,4 +23,6 @@ private: Workspace* workspace; }; +}; + #endif diff --git a/main.cpp b/main.cpp index 1530e06a06..0c3dc27539 100644 --- a/main.cpp +++ b/main.cpp @@ -35,6 +35,8 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include +using namespace KWinInternal; + Options* options; Atoms* atoms; diff --git a/main.h b/main.h index 21819ab8f1..c189b6a4ed 100644 --- a/main.h +++ b/main.h @@ -9,7 +9,7 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include "workspace.h" -typedef QValueList WorkspaceList; +typedef QValueList WorkspaceList; class Application : public KApplication { public: diff --git a/plugins.cpp b/plugins.cpp index fe9ff6ca52..e99614269c 100644 --- a/plugins.cpp +++ b/plugins.cpp @@ -20,6 +20,8 @@ Copyright (C) 1999, 2000 Daniel M. Duley #include "plugins.h" #include "kdedefault.h" +using namespace KWinInternal; + PluginMenu::PluginMenu(PluginMgr *manager, QWidget *parent, const char *name) : QPopupMenu(parent, name) { @@ -155,7 +157,7 @@ void PluginMgr::loadPlugin(QString nameStr) // Rikkus: temporary change in semantics. - if (!nameStr) + if (nameStr.isEmpty()) nameStr = "default"; if(!dlregistered){ diff --git a/plugins.h b/plugins.h index a340793ac5..5c02f01a17 100644 --- a/plugins.h +++ b/plugins.h @@ -10,12 +10,13 @@ Copyright (C) 1999, 2000 Daniel M. Duley #include #include +class QFileInfo; + +namespace KWinInternal { class Client; class Workspace; -class QFileInfo; - class PluginMgr : public QObject { Q_OBJECT @@ -51,5 +52,6 @@ protected: PluginMgr *mgr; }; +}; #endif diff --git a/tabbox.cpp b/tabbox.cpp index 4f1f53625e..7c5a252c35 100644 --- a/tabbox.cpp +++ b/tabbox.cpp @@ -15,6 +15,8 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include +using namespace KWinInternal; + const bool options_traverse_all = FALSE; // TODO TabBox::TabBox( Workspace *ws, const char *name ) diff --git a/tabbox.h b/tabbox.h index 6a491ca713..f14f101a77 100644 --- a/tabbox.h +++ b/tabbox.h @@ -8,9 +8,12 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include +class QLabel; + +namespace KWinInternal { + class Workspace; class Client; -class QLabel; typedef QValueList ClientList; class TabBox : public QWidget @@ -72,4 +75,6 @@ inline TabBox::Mode TabBox::mode() const return m; } +}; + #endif diff --git a/workspace.cpp b/workspace.cpp index 31d38cb84a..2de5af3b7a 100644 --- a/workspace.cpp +++ b/workspace.cpp @@ -42,15 +42,13 @@ const int XIconicState = IconicState; #include #include - -extern int kwin_screen_number; - +namespace KWinInternal { // NET WM Protocol handler class class RootInfo : public NETRootInfo { public: - RootInfo( Workspace* ws, Display *dpy, Window w, const char *name, unsigned long pr, int scr= -1) + RootInfo( KWinInternal::Workspace* ws, Display *dpy, Window w, const char *name, unsigned long pr, int scr= -1) : NETRootInfo( dpy, w, name, pr, scr ) { workspace = ws; } @@ -59,12 +57,12 @@ public: void changeNumberOfDesktops(int n) { workspace->setNumberOfDesktops( n ); } void changeCurrentDesktop(int d) { workspace->setCurrentDesktop( d ); } void changeActiveWindow(Window w) { - ::Client* c = workspace->findClient( (WId) w ); + KWinInternal::Client* c = workspace->findClient( (WId) w ); if ( c ) workspace->activateClient( c ); } void closeWindow(Window w) { - ::Client* c = workspace->findClient( (WId) w ); + KWinInternal::Client* c = workspace->findClient( (WId) w ); if ( c ) { c->closeWindow(); } @@ -72,9 +70,14 @@ public: void moveResize(Window, int, int, unsigned long) { } private: - Workspace* workspace; + KWinInternal::Workspace* workspace; }; +}; + +using namespace KWinInternal; + +extern int kwin_screen_number; QString Workspace::desktopName( int desk ) { @@ -167,7 +170,7 @@ Client* Workspace::clientFactory( WId w ) } case NET::Tool: - return ( mgr.allocateClient( this, w, true ) ); + return ( mgr->allocateClient( this, w, true ) ); case NET::Menu: case NET::Dock: @@ -187,7 +190,7 @@ Client* Workspace::clientFactory( WId w ) if ( Shape::hasShape( w ) ){ return new NoBorderClient( this, w ); } - return ( mgr.allocateClient( this, w, false ) ); + return ( mgr->allocateClient( this, w, false ) ); } // Rikkus: This class is too complex. It needs splitting further. @@ -218,6 +221,7 @@ Workspace::Workspace( bool restore ) keys (0), root (0) { + mgr = new PluginMgr; root = qt_xrootwin(); default_colormap = DefaultColormap(qt_xdisplay(), qt_xscreen() ); installed_colormap = default_colormap; @@ -330,7 +334,7 @@ void Workspace::init() connect(&resetTimer, SIGNAL(timeout()), this, SLOT(slotResetAllClients())); - connect(&mgr, SIGNAL(resetAllClients()), this, + connect(mgr, SIGNAL(resetAllClients()), this, SLOT(slotResetAllClients())); connect(kapp, SIGNAL(appearanceChanged()), this, SLOT(slotResetAllClientsDelayed())); @@ -406,6 +410,7 @@ Workspace::~Workspace() delete rootInfo; delete supportWindow; + delete mgr; } @@ -1213,7 +1218,7 @@ QPopupMenu* Workspace::clientPopup( Client* c ) connect( popup, SIGNAL( aboutToShow() ), this, SLOT( clientPopupAboutToShow() ) ); connect( popup, SIGNAL( activated(int) ), this, SLOT( clientPopupActivated(int) ) ); - PluginMenu *deco = new PluginMenu(&mgr, popup); + PluginMenu *deco = new PluginMenu(mgr, popup); deco->setFont(KGlobalSettings::menuFont()); desk_popup = new QPopupMenu( popup ); @@ -1625,7 +1630,7 @@ void Workspace::unclutterDesktop() void Workspace::reconfigure() { KGlobal::config()->reparseConfiguration(); - if ( mgr.updatePlugin() ) + if ( mgr->updatePlugin() ) slotResetAllClientsDelayed(); options->reload(); keys->readSettings(); diff --git a/workspace.h b/workspace.h index cf35d57593..72352581e7 100644 --- a/workspace.h +++ b/workspace.h @@ -14,18 +14,19 @@ Copyright (C) 1999, 2000 Matthias Ettrich #include #include #include "options.h" -#include "plugins.h" #include "KWinInterface.h" #include +class KConfig; +class KGlobalAccel; + +namespace KWinInternal { class Client; class TabBox; - -class KConfig; -class KGlobalAccel; class RootInfo; +class PluginMgr; typedef QValueList ClientList; @@ -341,7 +342,7 @@ private: KGlobalAccel *keys; WId root; - PluginMgr mgr; + PluginMgr *mgr; RootInfo *rootInfo; QWidget* supportWindow; @@ -386,5 +387,6 @@ inline const ClientList& Workspace::stackingOrder() const return stacking_order; } +}; #endif