Changeset View
Changeset View
Standalone View
Standalone View
sm.h
Show All 22 Lines | |||||
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; | 31 | class QSocketNotifier; | ||
zzag: Unused forward declaration. | |||||
35 | 32 | | |||
36 | namespace KWin | 33 | namespace KWin | ||
37 | { | 34 | { | ||
38 | 35 | | |||
39 | class X11Client; | 36 | class X11Client; | ||
40 | 37 | | |||
41 | struct SessionInfo { | 38 | struct SessionInfo { | ||
zzag: Style: Put whitespace between `SessionManager` and `:`. | |||||
42 | QByteArray sessionId; | 39 | QByteArray sessionId; | ||
43 | QByteArray windowRole; | 40 | QByteArray windowRole; | ||
44 | QByteArray wmCommand; | 41 | QByteArray wmCommand; | ||
45 | QByteArray wmClientMachine; | 42 | QByteArray wmClientMachine; | ||
46 | QByteArray resourceName; | 43 | QByteArray resourceName; | ||
zzag: Nitpick: In order to be consistent with other code, add `override` keyword. | |||||
47 | QByteArray resourceClass; | 44 | QByteArray resourceClass; | ||
48 | 45 | | |||
49 | QRect geometry; | 46 | QRect geometry; | ||
50 | QRect restore; | 47 | QRect restore; | ||
51 | QRect fsrestore; | 48 | QRect fsrestore; | ||
52 | int maximized; | 49 | int maximized; | ||
53 | int fullscreen; | 50 | int fullscreen; | ||
54 | int desktop; | 51 | int desktop; | ||
Show All 17 Lines | |||||
72 | 69 | | |||
73 | 70 | | |||
74 | enum SMSavePhase { | 71 | enum SMSavePhase { | ||
75 | SMSavePhase0, // saving global state in "phase 0" | 72 | SMSavePhase0, // saving global state in "phase 0" | ||
76 | SMSavePhase2, // saving window state in phase 2 | 73 | SMSavePhase2, // saving window state in phase 2 | ||
77 | SMSavePhase2Full // complete saving in phase2, there was no phase 0 | 74 | SMSavePhase2Full // complete saving in phase2, there was no phase 0 | ||
78 | }; | 75 | }; | ||
79 | 76 | | |||
80 | class KWIN_EXPORT SessionSaveDoneHelper | 77 | class SessionManager: public QObject | ||
zzag: Style: Put whitespace before colon. | |||||
81 | : public QObject | | |||
82 | { | 78 | { | ||
83 | Q_OBJECT | 79 | Q_OBJECT | ||
84 | public: | 80 | public: | ||
85 | SessionSaveDoneHelper(); | 81 | SessionManager(QObject *parent); | ||
86 | ~SessionSaveDoneHelper() override; | 82 | ~SessionManager(); | ||
87 | SmcConn connection() const { | 83 | public Q_SLOTS: | ||
88 | return conn; | 84 | void setState(const QString &state); | ||
89 | } | | |||
90 | void saveDone(); | | |||
91 | void close(); | | |||
92 | private Q_SLOTS: | | |||
93 | void processData(); | | |||
94 | private: | | |||
95 | QSocketNotifier* notifier; | | |||
96 | SmcConn conn; | | |||
97 | }; | 85 | }; | ||
98 | 86 | | |||
99 | } // namespace | 87 | } // namespace | ||
100 | 88 | | |||
101 | #endif | 89 | #endif |
Unused forward declaration.