diff options
author | Christian Klinger | 2016-09-29 15:40:18 +0200 |
---|---|---|
committer | Christian Klinger | 2016-09-29 15:40:18 +0200 |
commit | 3d82bfc698165bb20f3c38d42f2b77ab855c1edf (patch) | |
tree | 2c170bcdd5c89259bb0b530fa11fdfe701c99850 /src/client/util | |
parent | added an information dialog that displays ip and hostname. (diff) | |
download | pvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.tar.gz pvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.tar.xz pvs2-3d82bfc698165bb20f3c38d42f2b77ab855c1edf.zip |
astyle.
Diffstat (limited to 'src/client/util')
-rw-r--r--[-rwxr-xr-x] | src/client/util/platform/blankscreen.h | 16 | ||||
-rw-r--r--[-rwxr-xr-x] | src/client/util/platform/blankscreen_Win32.cpp | 82 | ||||
-rw-r--r--[-rwxr-xr-x] | src/client/util/platform/blankscreen_X11.cpp | 17 | ||||
-rw-r--r-- | src/client/util/room.h | 29 | ||||
-rw-r--r-- | src/client/util/util.h | 4 |
5 files changed, 75 insertions, 73 deletions
diff --git a/src/client/util/platform/blankscreen.h b/src/client/util/platform/blankscreen.h index e42043c..35cf297 100755..100644 --- a/src/client/util/platform/blankscreen.h +++ b/src/client/util/platform/blankscreen.h @@ -11,16 +11,16 @@ class BlankScreen : public QDialog { Q_OBJECT public: - BlankScreen(); - virtual ~BlankScreen(); - void draw(bool force = false); - bool lock(const QString& message); - bool unlock(); + BlankScreen(); + virtual ~BlankScreen(); + void draw(bool force = false); + bool lock(const QString& message); + bool unlock(); private: - bool _locked; - QString _message; - BlankScreen_Sysdep* _sysdep; + bool _locked; + QString _message; + BlankScreen_Sysdep* _sysdep; }; #endif diff --git a/src/client/util/platform/blankscreen_Win32.cpp b/src/client/util/platform/blankscreen_Win32.cpp index 2bba1cf..1d1dd12 100755..100644 --- a/src/client/util/platform/blankscreen_Win32.cpp +++ b/src/client/util/platform/blankscreen_Win32.cpp @@ -1,41 +1,41 @@ -
-#include "blankscreen.h"
-#include <qwidget.h>
-
-struct BlankScreen_Sysdep {
-
- bool locked;
- QWidget* blankwin;
-
- QString lockMsg;
- int blackColor, whiteColor;
- int offX, offY;
-};
-
-BlankScreen::BlankScreen()
-{
- _sysdep = new BlankScreen_Sysdep;
- _sysdep->blankwin = new QWidget(0, Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint);
- _sysdep->blankwin->setWindowState(Qt::WindowFullScreen);
- _sysdep->blankwin->show();
-}
-
-BlankScreen::~BlankScreen()
-{
- delete _sysdep;
-}
-
-void BlankScreen::draw(bool force)
-{
-
-}
-
-bool BlankScreen::lock(const QString& message)
-{
- return true;
-}
-
-bool BlankScreen::unlock()
-{
- return true;
-}
+ +#include "blankscreen.h" +#include <qwidget.h> + +struct BlankScreen_Sysdep { + + bool locked; + QWidget* blankwin; + + QString lockMsg; + int blackColor, whiteColor; + int offX, offY; +}; + +BlankScreen::BlankScreen() +{ + _sysdep = new BlankScreen_Sysdep; + _sysdep->blankwin = new QWidget(0, Qt::X11BypassWindowManagerHint | Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint); + _sysdep->blankwin->setWindowState(Qt::WindowFullScreen); + _sysdep->blankwin->show(); +} + +BlankScreen::~BlankScreen() +{ + delete _sysdep; +} + +void BlankScreen::draw(bool force) +{ + +} + +bool BlankScreen::lock(const QString& message) +{ + return true; +} + +bool BlankScreen::unlock() +{ + return true; +} diff --git a/src/client/util/platform/blankscreen_X11.cpp b/src/client/util/platform/blankscreen_X11.cpp index db8873b..66c9f1f 100755..100644 --- a/src/client/util/platform/blankscreen_X11.cpp +++ b/src/client/util/platform/blankscreen_X11.cpp @@ -11,8 +11,7 @@ #include <cassert> #include <cstring> -struct BlankScreen_Sysdep -{ +struct BlankScreen_Sysdep { Display *dpy; }; @@ -55,9 +54,9 @@ bool BlankScreen::lock(const QString& message) XGrabPointer(_sysdep->dpy, DefaultRootWindow(_sysdep->dpy) , false, 0, GrabModeAsync, GrabModeAsync, None, 0, CurrentTime); - QProcess ungrabP; - ungrabP.start("/bin/bash", QStringList() << "/opt/openslx/pvs2/kb-lock.sh"); - ungrabP.waitForFinished(); + QProcess ungrabP; + ungrabP.start("/bin/bash", QStringList() << "/opt/openslx/pvs2/kb-lock.sh"); + ungrabP.waitForFinished(); _locked = true; return true; @@ -77,10 +76,10 @@ bool BlankScreen::unlock() XFlush(_sysdep->dpy); - /* start the kb-unlock.sh script */ - QProcess regrabP; - regrabP.start("/bin/bash", QStringList() << "/opt/openslx/pvs2/kb-unlock.sh"); - regrabP.waitForFinished(); + /* start the kb-unlock.sh script */ + QProcess regrabP; + regrabP.start("/bin/bash", QStringList() << "/opt/openslx/pvs2/kb-unlock.sh"); + regrabP.waitForFinished(); _locked = false; return true; diff --git a/src/client/util/room.h b/src/client/util/room.h index bfc70d0..86939f7 100644 --- a/src/client/util/room.h +++ b/src/client/util/room.h @@ -2,22 +2,25 @@ #define ROOM_H struct Room { - QString mgr; - QString name; - int priority; - Room (QString _name, QString _mgr, int _priority) { - mgr = _mgr; - name = _name; - priority = _priority; - }; + QString mgr; + QString name; + int priority; + Room (QString _name, QString _mgr, int _priority) + { + mgr = _mgr; + name = _name; + priority = _priority; + }; }; -inline QDebug operator<<(QDebug debug, const Room& r) { - debug << r.name << "{mgr=" << r.mgr << ",prio=" << r.priority << "}"; - return debug; +inline QDebug operator<<(QDebug debug, const Room& r) +{ + debug << r.name << "{mgr=" << r.mgr << ",prio=" << r.priority << "}"; + return debug; } -inline bool operator<(const Room& a, const Room& b) { - return a.priority < b.priority; +inline bool operator<(const Room& a, const Room& b) +{ + return a.priority < b.priority; } #endif diff --git a/src/client/util/util.h b/src/client/util/util.h index b47d3b1..dc604e8 100644 --- a/src/client/util/util.h +++ b/src/client/util/util.h @@ -26,8 +26,8 @@ QDir settingsDir(); inline QTextStream& qStdout() { - static QTextStream r{stdout}; - return r; + static QTextStream r {stdout}; + return r; } |