blob: bed31ed9bf7a0b4bb2b7b835682fd43a1e17a34d (
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
|
//===========================================
// Lumina-DE source code
// Copyright (c) 2015, Ken Moore
// Available under the 3-clause BSD license
// See the LICENSE file for full details
//===========================================
#include "WMSession.h"
#define DEBUG 1
// ==========
// PUBLIC
// ==========
WMSession::WMSession(){
if(DEBUG){ qDebug() << "Creating Event Filter..."; }
EFILTER = new EventFilter();
if(DEBUG){ qDebug() << "Creating Screen Saver..."; }
SS = new LScreenSaver();
//Setup connections
connect(EFILTER, SIGNAL(NewInputEvent()), SS, SLOT(newInputEvent()) );
}
WMSession::~WMSession(){
}
void WMSession::start(bool SSONLY){
//Get the screensaver initialized/ready
if(DEBUG){ qDebug() << "Starting Screen Saver..."; }
SS->start();
if(SSONLY){ return; }
//Now start pulling/filtering events
if(DEBUG){ qDebug() << "Starting Event Filter..."; }
EFILTER->start();
if(DEBUG){ qDebug() << "Done Starting WM session..."; }
}
// ==========
// Public Slots
// ==========
void WMSession::reloadIcons(){
}
void WMSession::newInputsAvailable(QStringList inputs){
for(int i=0; i<inputs.length(); i++){
if(inputs[i]=="--lock-now" || inputs[i]=="--test-ss"){
QTimer::singleShot(0,SS, SLOT(LockScreenNow()) );
}
}
}
|