add more spacing
[personal-kdebase.git] / workspace / kwin / sm.h
blob4acc9fd48440979f8a104d3afc145f424289108d
1 /********************************************************************
2 KWin - the KDE window manager
3 This file is part of the KDE project.
5 Copyright (C) 1999, 2000 Matthias Ettrich <ettrich@kde.org>
6 Copyright (C) 2003 Lubos Lunak <l.lunak@kde.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *********************************************************************/
22 #ifndef KWIN_SM_H
23 #define KWIN_SM_H
25 #include <QDataStream>
26 #include <kapplication.h>
27 #include <ksessionmanager.h>
28 #include <X11/SM/SMlib.h>
29 #include <netwm_def.h>
30 #include <QRect>
32 class QSocketNotifier;
34 namespace KWin
37 struct SessionInfo
39 QByteArray sessionId;
40 QByteArray windowRole;
41 QByteArray wmCommand;
42 QByteArray wmClientMachine;
43 QByteArray resourceName;
44 QByteArray resourceClass;
46 QRect geometry;
47 QRect restore;
48 QRect fsrestore;
49 int maximized;
50 int fullscreen;
51 int desktop;
52 bool minimized;
53 bool onAllDesktops;
54 bool shaded;
55 bool keepAbove;
56 bool keepBelow;
57 bool skipTaskbar;
58 bool skipPager;
59 bool noBorder;
60 NET::WindowType windowType;
61 QString shortcut;
62 bool active; // means 'was active in the saved session'
63 int stackingOrder;
67 enum SMSavePhase
69 SMSavePhase0, // saving global state in "phase 0"
70 SMSavePhase2, // saving window state in phase 2
71 SMSavePhase2Full // complete saving in phase2, there was no phase 0
74 class SessionSaveDoneHelper
75 : public QObject
77 Q_OBJECT
78 public:
79 SessionSaveDoneHelper();
80 virtual ~SessionSaveDoneHelper();
81 SmcConn connection() const { return conn; }
82 void saveDone();
83 void close();
84 private slots:
85 void processData();
86 private:
87 QSocketNotifier* notifier;
88 SmcConn conn;
92 class SessionManager
93 : public KSessionManager
95 public:
96 virtual bool saveState( QSessionManager& sm );
97 virtual bool commitData( QSessionManager& sm );
100 } // namespace
102 #endif