blob: dafd2ae1c6be7b7f3943e20d6f1db1cfd61ac343 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
|
//===========================================================================
//
// This file is part of the TDE project
//
// Copyright (c) 1999 Martin R. Jones <mjones@kde.org>
// Copyright (c) 2003 Oswald Buddenhagen <ossi@kde.org>
// Copyright (c) 2010 - 2015 Timothy Pearson <kb9vqf@pearsoncomputing.net>
//
#ifndef __LOCKENG_H__
#define __LOCKENG_H__
#include <ksslcertificate.h>
#include <tdehardwaredevices.h>
#include <tdecryptographiccarddevice.h>
#include <kgreeterplugin.h>
#include <kprocess.h>
#include <kpixmap.h>
#include <krootpixmap.h>
#include <tqwidget.h>
#include <tqtimer.h>
#include <tqvaluestack.h>
#include <tqmessagebox.h>
#include <tqpixmap.h>
#include <tqdatetime.h>
#include <tqthread.h>
#include <X11/Xlib.h>
class KLibrary;
class KWinModule;
class KSMModalDialog;
class LockProcess;
struct GreeterPluginHandle {
KLibrary *library;
kgreeterplugin_info *info;
};
#define FIFO_DIR "/tmp/tdesocket-global"
#define FIFO_FILE "/tmp/tdesocket-global/kdesktoplockcontrol-%d"
#define FIFO_FILE_OUT "/tmp/tdesocket-global/kdesktoplockcontrol_out-%d"
typedef TQValueList<Window> TQXLibWindowList;
//===========================================================================
//
// Control pipe handler
//
class ControlPipeHandlerObject : public TQObject
{
Q_OBJECT
public:
ControlPipeHandlerObject();
~ControlPipeHandlerObject();
public slots:
void run();
void terminateThread();
signals:
void processCommand(TQString);
public:
LockProcess* mParent;
private:
bool mRunning;
bool mTerminate;
pthread_t mThreadID;
};
//===========================================================================
//
// Screen saver handling process. Handles screensaver window,
// starting screensaver hacks, and password entry.
//
class LockProcess : public TQWidget
{
Q_OBJECT
public:
LockProcess();
~LockProcess();
void init(bool child_saver = false, bool useBlankOnly = false);
bool lock();
bool defaultSave();
bool dontLock();
bool runSecureDialog();
bool inSecureDialog();
void setChildren(TQValueList<int> children) { child_sockets = children; }
void setParent(int fd) { mParent = fd; }
void msgBox( TQMessageBox::Icon type, const TQString &txt );
int execDialog( TQDialog* dlg );
signals:
void terminateHelperThread();
public slots:
void quitSaver();
void preparePopup();
void cleanupPopup();
void desktopResized();
void doDesktopResizeFinish();
void doFunctionKeyBroadcast();
void slotPaintBackground(const TQPixmap &pm);
void slotForcePaintBackground();
protected:
virtual bool x11Event(XEvent *);
virtual void timerEvent(TQTimerEvent *);
virtual void resizeEvent(TQResizeEvent *);
private slots:
void hackExited(TDEProcess *);
void signalPipeSignal();
bool startLock();
void suspend();
void checkDPMSActive();
void slotDeadTimePassed();
void windowAdded( WId );
void resumeUnforced();
void displayLockDialogIfNeeded();
void closeDialogAndStartHack();
bool closeCurrentWindow();
void repaintRootWindowIfNeeded();
void startSecureDialog();
void slotMouseActivity(XEvent *event);
void processInputPipeCommand(TQString command);
void cryptographicCardInserted(TDECryptographicCardDevice*);
void cryptographicCardRemoved(TDECryptographicCardDevice*);
void cryptographicCardPinRequested(TQString prompt, TDECryptographicCardDevice* cdevice);
void signalPassDlgToAttemptCardLogin();
void signalPassDlgToAttemptCardAbort();
private:
void configure();
void readSaver();
void createSaverWindow();
void hideSaverWindow();
void saveVRoot();
void setVRoot(Window win, Window rw);
void removeVRoot(Window win);
void setTransparentBackgroundARGB();
bool grabKeyboard();
bool grabMouse();
bool grabInput();
void ungrabInput();
void cantLock(const TQString &reason);
bool startSaver(bool notify_ready = false);
void stopSaver();
bool startHack();
void stopHack();
void setupSignals();
bool checkPass();
void stayOnTop();
void lockXF86();
void unlockXF86();
void showVkbd();
void hideVkbd();
void saverReady();
void saverReadyIfNeeded();
bool forwardVkbdEvent( XEvent* event );
void sendVkbdFocusInOut( WId window, Time t );
void windowAdded( WId window, bool managed );
void resume( bool force );
static TQVariant getConf(void *ctx, const char *key, const TQVariant &dflt);
void generateBackingImages();
void fullyOnline();
bool mLocked;
int mLockGrace;
int mPriority;
bool mBusy;
TDEProcess mHackProc;
int mRootWidth;
int mRootHeight;
TQString mSaverExec;
TQString mSaver;
bool mOpenGLVisual;
bool child_saver;
TQValueList<int> child_sockets;
int mParent;
bool mUseBlankOnly;
bool mShowLockDateTime;
bool mSuspended;
TQTimer mSuspendTimer;
bool mVisibility;
TQTimer mCheckDPMS;
TQValueStack< TQWidget* > mDialogs;
bool mRestoreXF86Lock;
bool mForbidden;
TQStringList mPlugins, mPluginOptions;
TQString mMethod;
GreeterPluginHandle greetPlugin;
TQPixmap mSavedScreen;
int mAutoLogoutTimerId;
int mAutoLogoutTimeout;
bool mAutoLogout;
TQTimer *resizeTimer;
unsigned int mkeyCode;
TQTimer *hackResumeTimer;
TDEProcess* mVkbdProcess;
KWinModule* mKWinModule;
struct VkbdWindow {
WId id;
TQRect rect;
};
TQValueList< VkbdWindow > mVkbdWindows;
WId mVkbdLastEventWindow;
bool mPipeOpen;
int mPipe_fd;
bool mPipeOpen_out;
int mPipe_fd_out;
bool mInfoMessageDisplayed;
bool mDialogControlLock;
bool mForceReject;
TQDialog *currentDialog;
TQTimer* mEnsureScreenHiddenTimer;
TQTimer* mForceContinualLockDisplayTimer;
TQTimer* mEnsureVRootWindowSecurityTimer;
TQTimer* mHackDelayStartupTimer;
int mHackDelayStartupTimeout;
bool mHackStartupEnabled;
bool mOverrideHackStartupEnabled;
bool mResizingDesktopLock;
bool mFullyOnlineSent;
bool mClosingWindows;
bool mInSecureDialog;
bool mHackActive;
TQPixmap backingPixmap;
KRootPixmap *m_rootPixmap;
int mBackingStartupDelayTimer;
TQPixmap mArgbTransparentBackgroundPixmap;
KSMModalDialog* m_startupStatusDialog;
TQDateTime mlockDateTime;
bool m_mouseDown;
int m_mousePrevX;
int m_mousePrevY;
int m_dialogPrevX;
int m_dialogPrevY;
bool m_notifyReadyRequested;
TQWidget* m_maskWidget;
Window m_saverRootWindow;
ControlPipeHandlerObject* mControlPipeHandler;
TQEventLoopThread* mControlPipeHandlerThread;
friend class ControlPipeHandlerObject;
};
#endif
|