aboutsummaryrefslogtreecommitdiffstats
path: root/src/modules/my/idle_win.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/my/idle_win.cpp')
-rw-r--r--src/modules/my/idle_win.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/modules/my/idle_win.cpp b/src/modules/my/idle_win.cpp
index c304ee4ed..3a1469928 100644
--- a/src/modules/my/idle_win.cpp
+++ b/src/modules/my/idle_win.cpp
@@ -20,15 +20,15 @@
#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)
#include "idle.h"
-
+
#include <QLibrary>
#include< windows.h>
-
+
typedef struct tagLASTINPUTINFO {
UINT cbSize;
DWORD dwTime;
} LASTINPUTINFO, *PLASTINPUTINFO;
-
+
class IdlePlatform::Private
{
public:
@@ -38,29 +38,29 @@
IdleUIGetLastInputTime = 0;
lib = 0;
}
-
+
BOOL (__stdcall * GetLastInputInfo)(PLASTINPUTINFO);
DWORD (__stdcall * IdleUIGetLastInputTime)(void);
QLibrary *lib;
};
-
+
IdlePlatform::IdlePlatform()
{
d = new Private;
}
-
+
IdlePlatform::~IdlePlatform()
{
delete d->lib;
delete d;
}
-
+
bool IdlePlatform::init()
{
if(d->lib)
return true;
void *p;
-
+
// try to find the built-in Windows 2000 function
d->lib = new QLibrary("user32");
if(d->lib->load() && (p = d->lib->resolve("GetLastInputInfo"))) {
@@ -71,7 +71,7 @@
delete d->lib;
d->lib = 0;
}
-
+
// fall back on idleui
d->lib = new QLibrary("idleui");
if(d->lib->load() && (p = d->lib->resolve("IdleUIGetLastInputTime"))) {
@@ -82,10 +82,10 @@
delete d->lib;
d->lib = 0;
}
-
+
return false;
}
-
+
int IdlePlatform::secondsIdle()
{
int i;
@@ -102,7 +102,7 @@
}
else
return 0;
-
+
return (GetTickCount() - i) / 1000;
}