Changeset View
Changeset View
Standalone View
Standalone View
sm.h
Show All 21 Lines | |||||
22 | #ifndef KWIN_SM_H | 22 | #ifndef KWIN_SM_H | ||
23 | #define KWIN_SM_H | 23 | #define KWIN_SM_H | ||
24 | 24 | | |||
25 | #include <QDataStream> | 25 | #include <QDataStream> | ||
26 | #include <kwinglobals.h> | 26 | #include <kwinglobals.h> | ||
27 | #include <QStringList> | 27 | #include <QStringList> | ||
28 | #include <netwm_def.h> | 28 | #include <netwm_def.h> | ||
29 | #include <QRect> | 29 | #include <QRect> | ||
30 | 30 | | |||
31 | #include <X11/SM/SMlib.h> | | |||
32 | #include <fixx11h.h> | | |||
33 | | ||||
34 | class QSocketNotifier; | | |||
35 | | ||||
36 | namespace KWin | 31 | namespace KWin | ||
zzag: Unused forward declaration. | |||||
37 | { | 32 | { | ||
38 | 33 | | |||
39 | class X11Client; | 34 | class X11Client; | ||
40 | 35 | | |||
36 | class SessionManager : public QObject | ||||
zzag: Style: Put whitespace between `SessionManager` and `:`. | |||||
37 | { | ||||
38 | Q_OBJECT | ||||
39 | public: | ||||
40 | SessionManager(QObject *parent); | ||||
41 | ~SessionManager() override; | ||||
zzag: Nitpick: In order to be consistent with other code, add `override` keyword. | |||||
42 | | ||||
43 | SessionState state() const; | ||||
44 | | ||||
45 | Q_SIGNALS: | ||||
46 | void stateChanged(); | ||||
47 | | ||||
48 | public Q_SLOTS: // DBus API | ||||
49 | void setState(uint state); | ||||
50 | | ||||
51 | private: | ||||
52 | void setState(SessionState state); | ||||
53 | SessionState m_sessionState; | ||||
54 | }; | ||||
55 | | ||||
41 | struct SessionInfo { | 56 | struct SessionInfo { | ||
42 | QByteArray sessionId; | 57 | QByteArray sessionId; | ||
43 | QByteArray windowRole; | 58 | QByteArray windowRole; | ||
44 | QByteArray wmCommand; | 59 | QByteArray wmCommand; | ||
45 | QByteArray wmClientMachine; | 60 | QByteArray wmClientMachine; | ||
46 | QByteArray resourceName; | 61 | QByteArray resourceName; | ||
47 | QByteArray resourceClass; | 62 | QByteArray resourceClass; | ||
48 | 63 | | |||
Show All 22 Lines | |||||
71 | }; | 86 | }; | ||
72 | 87 | | |||
73 | 88 | | |||
74 | enum SMSavePhase { | 89 | enum SMSavePhase { | ||
75 | SMSavePhase0, // saving global state in "phase 0" | 90 | SMSavePhase0, // saving global state in "phase 0" | ||
76 | SMSavePhase2, // saving window state in phase 2 | 91 | SMSavePhase2, // saving window state in phase 2 | ||
77 | SMSavePhase2Full // complete saving in phase2, there was no phase 0 | 92 | SMSavePhase2Full // complete saving in phase2, there was no phase 0 | ||
78 | }; | 93 | }; | ||
79 | 94 | | |||
80 | class KWIN_EXPORT SessionSaveDoneHelper | | |||
81 | : public QObject | | |||
82 | { | | |||
83 | Q_OBJECT | | |||
84 | public: | | |||
85 | SessionSaveDoneHelper(); | | |||
86 | ~SessionSaveDoneHelper() override; | | |||
87 | SmcConn connection() const { | | |||
88 | return conn; | | |||
89 | } | | |||
90 | void saveDone(); | | |||
91 | void close(); | | |||
92 | private Q_SLOTS: | | |||
93 | void processData(); | | |||
94 | private: | | |||
95 | QSocketNotifier* notifier; | | |||
96 | SmcConn conn; | | |||
97 | }; | | |||
98 | | ||||
99 | } // namespace | 95 | } // namespace | ||
zzag: Style: Put whitespace before colon. | |||||
100 | 96 | | |||
101 | #endif | 97 | #endif |
Unused forward declaration.