summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-06-13 18:16:13 +0300
committerGeorge Hazan <ghazan@miranda.im>2018-06-13 18:16:13 +0300
commit723bc42a5dfe925c655cced2c184ddfdfc144ada (patch)
tree0de1f13f2510af9761821d53039ba4684b37f218 /src/core
parente71725076a18bf48579275e196886dc2edb9aee1 (diff)
System idle:
- plugin StdIdle that had been acting as an options dialog for StdAutoAway removed; - service MS_IDLE_GETIDLEINFO moved into the core and replaced with Idle_GetInfo(); - new function Idle_Enter() is available to tell the core that Miranda is idle; - StdAutoAway & StatusManager adapted for these changes;
Diffstat (limited to 'src/core')
-rw-r--r--src/core/stdautoaway/res/resource.rc31
-rw-r--r--src/core/stdautoaway/src/idle.cpp87
-rw-r--r--src/core/stdautoaway/src/main.cpp17
-rw-r--r--src/core/stdautoaway/src/options.cpp (renamed from src/core/stdidle/src/options.cpp)30
-rw-r--r--src/core/stdautoaway/src/stdafx.h12
-rw-r--r--src/core/stdidle/CMakeLists.txt2
-rw-r--r--src/core/stdidle/res/resource.rc90
-rw-r--r--src/core/stdidle/res/version.rc9
-rw-r--r--src/core/stdidle/src/idle.cpp146
-rw-r--r--src/core/stdidle/src/main.cpp66
-rw-r--r--src/core/stdidle/src/stdafx.cxx2
-rw-r--r--src/core/stdidle/src/stdafx.h105
-rw-r--r--src/core/stdidle/src/version.h11
-rw-r--r--src/core/stdidle/stdidle.vcxproj28
-rw-r--r--src/core/stdidle/stdidle.vcxproj.filters4
15 files changed, 160 insertions, 480 deletions
diff --git a/src/core/stdautoaway/res/resource.rc b/src/core/stdautoaway/res/resource.rc
index 16038b37b3..ac6ee6fb77 100644
--- a/src/core/stdautoaway/res/resource.rc
+++ b/src/core/stdautoaway/res/resource.rc
@@ -25,6 +25,37 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
// Dialog
//
+IDD_OPT_IDLE DIALOGEX 0, 0, 312, 193
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ CONTROL "Become idle if the following is left unattended:",IDC_IDLESHORT,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,18,259,9
+ CONTROL "Windows",IDC_IDLEONWINDOWS,"Button",BS_AUTORADIOBUTTON,45,31,104,9
+ CONTROL "Miranda",IDC_IDLEONMIRANDA,"Button",BS_AUTORADIOBUTTON,45,43,103,9
+ EDITTEXT IDC_IDLE1STTIME,59,59,27,14,ES_AUTOHSCROLL | ES_NUMBER
+ CONTROL "Spin2",IDC_IDLESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,86,59,11,14
+ CONTROL "Become idle if the screen saver is active",IDC_SCREENSAVER,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,83,265,9
+ CONTROL "Become idle if the computer is locked",IDC_LOCKED,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,105,265,9
+ CONTROL "Become idle if a terminal session is disconnected",IDC_IDLETERMINAL,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,116,265,10
+ CONTROL "Do not let protocols report any idle information",IDC_IDLEPRIVATE,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,131,251,9
+ LTEXT "minute(s)",IDC_STATIC,99,61,76,9
+ RTEXT "for",IDC_STATIC,12,62,41,8
+ COMBOBOX IDC_AASTATUS,161,146,64,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
+ CONTROL "Change my status mode to:",IDC_AASHORTIDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,147,132,11
+ CONTROL "Do not set status back to online when returning from idle",IDC_IDLESTATUSLOCK,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,164,254,10
+ GROUPBOX "Idle options",IDC_STATIC,3,1,304,192
+ CONTROL "Become idle if application full screen",IDC_FULLSCREEN,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,94,265,9
+ CONTROL "Disable sounds on idle",IDC_IDLESOUNDSOFF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,177,265,9
+END
+
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdautoaway/src/idle.cpp b/src/core/stdautoaway/src/idle.cpp
new file mode 100644
index 0000000000..add27610b8
--- /dev/null
+++ b/src/core/stdautoaway/src/idle.cpp
@@ -0,0 +1,87 @@
+/*
+
+Miranda NG: the free IM client for Microsoft* Windows*
+
+Copyright (c) 2012-18 Miranda NG team (https://miranda-ng.org),
+Copyright (c) 2000-12 Miranda IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+This program is free software; you can redistribute it and/or
+modify it under the terms of the GNU General Public License
+as published by the Free Software Foundation; either version 2
+of the License, or (at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+*/
+
+#include "stdafx.h"
+
+static UINT_PTR g_hTimer;
+
+int IdleOptInit(WPARAM wParam, LPARAM);
+
+static int IdleObject_IsUserIdle()
+{
+ if (g_plugin.bIdleMethod) {
+ DWORD dwTick;
+ CallService(MS_SYSTEM_GETIDLE, 0, (LPARAM)&dwTick);
+ return GetTickCount() - dwTick > (g_plugin.iIdleTime1st * 60 * 1000);
+ }
+
+ LASTINPUTINFO ii = { sizeof(ii) };
+ if (GetLastInputInfo(&ii))
+ return GetTickCount() - ii.dwTime > (g_plugin.iIdleTime1st * 60 * 1000);
+
+ return FALSE;
+}
+
+static void CALLBACK IdleTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
+{
+ if (g_hTimer == idEvent) {
+ if (g_plugin.bIdleCheck && IdleObject_IsUserIdle())
+ Idle_Enter(1);
+
+ else if (g_plugin.bIdleOnSaver && IsScreenSaverRunning())
+ Idle_Enter(2);
+
+ else if (g_plugin.bIdleOnFullScr && IsFullScreen())
+ Idle_Enter(3);
+
+ else if (g_plugin.bIdleOnLock && IsWorkstationLocked())
+ Idle_Enter(4);
+
+ else if (g_plugin.bIdleOnTerminal && IsTerminalDisconnected())
+ Idle_Enter(5);
+ }
+}
+
+void IdleObject_Create()
+{
+ g_hTimer = SetTimer(nullptr, 0, 2000, IdleTimer);
+}
+
+void IdleObject_Destroy()
+{
+ KillTimer(nullptr, g_hTimer);
+}
+
+int LoadIdleModule(void)
+{
+ IdleObject_Create();
+
+ HookEvent(ME_OPT_INITIALISE, IdleOptInit);
+ return 0;
+}
+
+void UnloadIdleModule()
+{
+ IdleObject_Destroy();
+}
diff --git a/src/core/stdautoaway/src/main.cpp b/src/core/stdautoaway/src/main.cpp
index 08cb2a891c..4aed198a66 100644
--- a/src/core/stdautoaway/src/main.cpp
+++ b/src/core/stdautoaway/src/main.cpp
@@ -41,8 +41,21 @@ PLUGININFOEX pluginInfoEx = {
};
CMPlugin::CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
-{}
+ PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx),
+ bIdleCheck(IDLENAME, "UserIdleCheck", 0),
+ bIdleMethod(IDLENAME, "IdleMethod", 0),
+ bIdleOnSaver(IDLENAME, "IdleOnSaver", 0),
+ bIdleOnFullScr(IDLENAME, "IdleOnFullScr", 0),
+ bIdleOnLock(IDLENAME, "IdleOnLock", 0),
+ bIdlePrivate(IDLENAME, "IdlePrivate", 0),
+ bIdleSoundsOff(IDLENAME, "IdleSoundsOff", 1),
+ bIdleOnTerminal(IDLENAME, "IdleOnTerminalDisconnect", 0),
+ bIdleStatusLock(IDLENAME, "IdleStatusLock", 0),
+ bAAEnable(IDLENAME, "AAEnable", 0),
+ bAAStatus(IDLENAME, "AAStatus", 0),
+ iIdleTime1st(IDLENAME, "IdleTime1st", 10)
+{
+}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdidle/src/options.cpp b/src/core/stdautoaway/src/options.cpp
index 71b8c14f27..e8ee0669da 100644
--- a/src/core/stdidle/src/options.cpp
+++ b/src/core/stdautoaway/src/options.cpp
@@ -73,41 +73,41 @@ public:
chkFullScreen(this, IDC_FULLSCREEN),
chkScreenSaver(this, IDC_SCREENSAVER)
{
- CreateLink(chkShort, S.bIdleCheck);
- CreateLink(chkLocked, S.bIdleOnLock);
- CreateLink(chkPrivate, S.bIdlePrivate);
- CreateLink(chkTerminal, S.bIdleOnTerminal);
- CreateLink(chkShortIdle, S.bAAEnable);
- CreateLink(chkOnMiranda, S.bIdleMethod);
- CreateLink(chkSoundsOff, S.bIdleSoundsOff);
- CreateLink(chkStatusLock, S.bIdleStatusLock);
- CreateLink(chkFullScreen, S.bIdleOnFullScr);
- CreateLink(chkScreenSaver, S.bIdleOnSaver);
+ CreateLink(chkShort, g_plugin.bIdleCheck);
+ CreateLink(chkLocked, g_plugin.bIdleOnLock);
+ CreateLink(chkPrivate, g_plugin.bIdlePrivate);
+ CreateLink(chkTerminal, g_plugin.bIdleOnTerminal);
+ CreateLink(chkShortIdle, g_plugin.bAAEnable);
+ CreateLink(chkOnMiranda, g_plugin.bIdleMethod);
+ CreateLink(chkSoundsOff, g_plugin.bIdleSoundsOff);
+ CreateLink(chkStatusLock, g_plugin.bIdleStatusLock);
+ CreateLink(chkFullScreen, g_plugin.bIdleOnFullScr);
+ CreateLink(chkScreenSaver, g_plugin.bIdleOnSaver);
chkShortIdle.OnChange = chkShort.OnChange = Callback(this, &COptionsDlg::onChange);
}
virtual void OnInitDialog() override
{
- chkOnWindows.SetState(!S.bIdleMethod);
+ chkOnWindows.SetState(!g_plugin.bIdleMethod);
spinIdle.SetRange(60, 1);
- spinIdle.SetPosition(S.iIdleTime1st);
+ spinIdle.SetPosition(g_plugin.iIdleTime1st);
for (auto &it : aa_Status)
cmbAAStatus.AddString(Clist_GetStatusModeDescription(it, 0));
- cmbAAStatus.SetCurSel(IdleGetStatusIndex(S.bAAStatus));
+ cmbAAStatus.SetCurSel(IdleGetStatusIndex(g_plugin.bAAStatus));
ShowHide();
}
virtual void OnApply() override
{
- S.iIdleTime1st = spinIdle.GetPosition();
+ g_plugin.iIdleTime1st = spinIdle.GetPosition();
int curSel = cmbAAStatus.GetCurSel();
if (curSel != CB_ERR)
- S.bAAStatus = aa_Status[curSel];
+ g_plugin.bAAStatus = aa_Status[curSel];
// destroy any current idle and reset settings.
IdleObject_Destroy();
diff --git a/src/core/stdautoaway/src/stdafx.h b/src/core/stdautoaway/src/stdafx.h
index 6c55b9c1b5..98f1ef29c5 100644
--- a/src/core/stdautoaway/src/stdafx.h
+++ b/src/core/stdautoaway/src/stdafx.h
@@ -45,6 +45,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <newpluginapi.h>
#include <m_utils.h>
#include <m_netlib.h>
+#include <m_clist.h>
#include <m_crypto.h>
#include <m_langpack.h>
#include <m_button.h>
@@ -60,16 +61,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_idle.h>
#include <m_icolib.h>
#include <m_timezones.h>
+#include <m_gui.h>
#include "version.h"
#include "../../mir_app/src/resource.h"
#define MODULENAME "AutoAway"
+#define IDLENAME "Idle"
struct CMPlugin : public PLUGIN<CMPlugin>
{
CMPlugin();
int Load() override;
+
+ CMOption<BYTE> bIdleCheck, bIdleMethod, bIdleOnSaver, bIdleOnFullScr, bIdleOnLock;
+ CMOption<BYTE> bIdlePrivate, bIdleSoundsOff, bIdleOnTerminal, bIdleStatusLock;
+ CMOption<BYTE> bAAEnable;
+ CMOption<WORD> bAAStatus;
+ CMOption<DWORD> iIdleTime1st;
};
+
+void IdleObject_Destroy();
+void IdleObject_Create();
diff --git a/src/core/stdidle/CMakeLists.txt b/src/core/stdidle/CMakeLists.txt
deleted file mode 100644
index 67735cfc07..0000000000
--- a/src/core/stdidle/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-set(TARGET StdIdle)
-include(${CMAKE_SOURCE_DIR}/cmake/core.cmake) \ No newline at end of file
diff --git a/src/core/stdidle/res/resource.rc b/src/core/stdidle/res/resource.rc
deleted file mode 100644
index 1b926065de..0000000000
--- a/src/core/stdidle/res/resource.rc
+++ /dev/null
@@ -1,90 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#include "..\..\mir_app\src\resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include <windows.h>
-#include <winres.h>
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (United States) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_OPT_IDLE DIALOGEX 0, 0, 312, 193
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
- CONTROL "Become idle if the following is left unattended:",IDC_IDLESHORT,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,18,259,9
- CONTROL "Windows",IDC_IDLEONWINDOWS,"Button",BS_AUTORADIOBUTTON,45,31,104,9
- CONTROL "Miranda",IDC_IDLEONMIRANDA,"Button",BS_AUTORADIOBUTTON,45,43,103,9
- EDITTEXT IDC_IDLE1STTIME,59,59,27,14,ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "Spin2",IDC_IDLESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,86,59,11,14
- CONTROL "Become idle if the screen saver is active",IDC_SCREENSAVER,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,83,265,9
- CONTROL "Become idle if the computer is locked",IDC_LOCKED,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,105,265,9
- CONTROL "Become idle if a terminal session is disconnected",IDC_IDLETERMINAL,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,116,265,10
- CONTROL "Do not let protocols report any idle information",IDC_IDLEPRIVATE,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,131,251,9
- LTEXT "minute(s)",IDC_STATIC,99,61,76,9
- RTEXT "for",IDC_STATIC,12,62,41,8
- COMBOBOX IDC_AASTATUS,161,146,64,50,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
- CONTROL "Change my status mode to:",IDC_AASHORTIDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,147,132,11
- CONTROL "Do not set status back to online when returning from idle",IDC_IDLESTATUSLOCK,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,35,164,254,10
- GROUPBOX "Idle options",IDC_STATIC,3,1,304,192
- CONTROL "Become idle if application full screen",IDC_FULLSCREEN,
- "Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,94,265,9
- CONTROL "Disable sounds on idle",IDC_IDLESOUNDSOFF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,177,265,9
-END
-
-#endif // APSTUDIO_INVOKED
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE
-BEGIN
- "..\..\mir_app\src\resource.h\0"
-END
-
-2 TEXTINCLUDE
-BEGIN
- "#include <windows.h>\r\n"
- "#include <winres.h>\r\n"
- "\0"
-END
-
-3 TEXTINCLUDE
-BEGIN
- "\r\n"
- "\0"
-END
-
-#endif // APSTUDIO_INVOKED
diff --git a/src/core/stdidle/res/version.rc b/src/core/stdidle/res/version.rc
deleted file mode 100644
index 5a5ddd63ed..0000000000
--- a/src/core/stdidle/res/version.rc
+++ /dev/null
@@ -1,9 +0,0 @@
-// Microsoft Visual C++ generated resource script.
-//
-#ifdef APSTUDIO_INVOKED
-#error this file is not editable by Microsoft Visual C++
-#endif //APSTUDIO_INVOKED
-
-#include "..\src\version.h"
-
-#include "..\..\build\Version.rc"
diff --git a/src/core/stdidle/src/idle.cpp b/src/core/stdidle/src/idle.cpp
deleted file mode 100644
index 309375ed67..0000000000
--- a/src/core/stdidle/src/idle.cpp
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (c) 2012-18 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-12 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#include "stdafx.h"
-
-Settings S;
-
-static bool bModuleInitialized = false;
-
-static UINT_PTR g_hTimer;
-static int g_idleType;
-static int g_bIsIdle;
-
-static HANDLE hIdleEvent;
-
-void CALLBACK IdleTimer(HWND hwnd, UINT umsg, UINT_PTR idEvent, DWORD dwTime);
-int IdleOptInit(WPARAM wParam, LPARAM);
-
-void IdleObject_Create()
-{
- g_idleType = g_bIsIdle = 0;
- g_hTimer = SetTimer(nullptr, 0, 2000, IdleTimer);
-}
-
-void IdleObject_Destroy()
-{
- if (g_bIsIdle) {
- NotifyEventHooks(hIdleEvent, 0, 0);
- g_bIsIdle = false;
- }
- KillTimer(nullptr, g_hTimer);
-}
-
-static int IdleObject_IsUserIdle()
-{
- if (S.bIdleMethod) {
- DWORD dwTick;
- CallService(MS_SYSTEM_GETIDLE, 0, (LPARAM)&dwTick);
- return GetTickCount() - dwTick > (S.iIdleTime1st * 60 * 1000);
- }
-
- LASTINPUTINFO ii = { sizeof(ii) };
- if (GetLastInputInfo(&ii))
- return GetTickCount() - ii.dwTime > (S.iIdleTime1st * 60 * 1000);
-
- return FALSE;
-}
-
-static void IdleObject_Tick()
-{
- bool idle = false;
- int idleType = 0, flags = 0;
-
- if (S.bIdleCheck && IdleObject_IsUserIdle()) {
- idleType = 1; idle = true;
- }
- else if (S.bIdleOnSaver && IsScreenSaverRunning()) {
- idleType = 2; idle = true;
- }
- else if (S.bIdleOnFullScr && IsFullScreen()) {
- idleType = 5; idle = true;
- }
- else if (S.bIdleOnLock && IsWorkstationLocked()) {
- idleType = 3; idle = true;
- }
- else if (S.bIdleOnTerminal && IsTerminalDisconnected()) {
- idleType = 4; idle = true;
- }
-
- if (S.bIdlePrivate)
- flags |= IDF_PRIVACY;
-
- if (!g_bIsIdle && idle) {
- g_bIsIdle = true;
- g_idleType = idleType;
- NotifyEventHooks(hIdleEvent, 0, IDF_ISIDLE | flags);
- }
-
- if (g_bIsIdle && !idle) {
- g_bIsIdle = false;
- g_idleType = 0;
- NotifyEventHooks(hIdleEvent, 0, flags);
- }
-}
-
-void CALLBACK IdleTimer(HWND, UINT, UINT_PTR idEvent, DWORD)
-{
- if (g_hTimer == idEvent)
- IdleObject_Tick();
-}
-
-static INT_PTR IdleGetInfo(WPARAM, LPARAM lParam)
-{
- MIRANDA_IDLE_INFO *mii = (MIRANDA_IDLE_INFO*)lParam;
- if (!mii)
- return 1;
-
- mii->idleTime = S.iIdleTime1st;
- mii->privacy = S.bIdlePrivate;
- mii->aaStatus = (S.bAAEnable) ? S.bAAStatus : 0;
- mii->aaLock = S.bIdleStatusLock;
- mii->idlesoundsoff = S.bIdleSoundsOff;
- mii->idleType = g_idleType;
- return 0;
-}
-
-int LoadIdleModule(void)
-{
- bModuleInitialized = TRUE;
-
- hIdleEvent = CreateHookableEvent(ME_IDLE_CHANGED);
- IdleObject_Create();
- CreateServiceFunction(MS_IDLE_GETIDLEINFO, IdleGetInfo);
- HookEvent(ME_OPT_INITIALISE, IdleOptInit);
- return 0;
-}
-
-void UnloadIdleModule()
-{
- if (!bModuleInitialized) return;
-
- IdleObject_Destroy();
- DestroyHookableEvent(hIdleEvent);
- hIdleEvent = nullptr;
-}
diff --git a/src/core/stdidle/src/main.cpp b/src/core/stdidle/src/main.cpp
deleted file mode 100644
index a77bcba4d3..0000000000
--- a/src/core/stdidle/src/main.cpp
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
-
-Standard idle state module for Miranda NG
-
-Copyright (c) 2012-18 Miranda NG team (https://miranda-ng.org)
-
-This program is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2 of the License, or
-(at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License along
-with this program; if not, write to the Free Software Foundation, Inc.,
-51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-*/
-
-#include "stdafx.h"
-
-int LoadIdleModule(void);
-void UnloadIdleModule(void);
-
-CMPlugin g_plugin;
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-PLUGININFOEX pluginInfoEx = {
- sizeof(PLUGININFOEX),
- __PLUGIN_NAME,
- MIRANDA_VERSION_DWORD,
- __DESCRIPTION,
- __AUTHOR,
- __COPYRIGHT,
- __AUTHORWEB,
- UNICODE_AWARE,
- // 53ac190b-e223-4341-825f-709d8520215b
- { 0x53ac190b, 0xe223, 0x4341, {0x82, 0x5f, 0x70, 0x9d, 0x85, 0x20, 0x21, 0x5b}}
-};
-
-CMPlugin::CMPlugin() :
- PLUGIN<CMPlugin>(MODULENAME, pluginInfoEx)
-{}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_IDLE, MIID_LAST };
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-int CMPlugin::Load()
-{
- LoadIdleModule();
- return 0;
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-int CMPlugin::Unload()
-{
- UnloadIdleModule();
- return 0;
-}
diff --git a/src/core/stdidle/src/stdafx.cxx b/src/core/stdidle/src/stdafx.cxx
deleted file mode 100644
index 716dda68f1..0000000000
--- a/src/core/stdidle/src/stdafx.cxx
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "stdafx.h"
-
diff --git a/src/core/stdidle/src/stdafx.h b/src/core/stdidle/src/stdafx.h
deleted file mode 100644
index 1efc351565..0000000000
--- a/src/core/stdidle/src/stdafx.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
-
-Miranda NG: the free IM client for Microsoft* Windows*
-
-Copyright (c) 2012-18 Miranda NG team (https://miranda-ng.org),
-Copyright (c) 2000-12 Miranda IM project,
-all portions of this codebase are copyrighted to the people
-listed in contributors.txt.
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This program is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with this program; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-*/
-
-#pragma once
-
-#include <winsock2.h>
-#include <shlobj.h>
-#include <commctrl.h>
-#include <vssym32.h>
-
-#include <stdio.h>
-#include <time.h>
-#include <stddef.h>
-#include <process.h>
-#include <io.h>
-#include <limits.h>
-#include <string.h>
-#include <locale.h>
-#include <direct.h>
-#include <malloc.h>
-
-#include <win2k.h>
-#include <m_system.h>
-#include <newpluginapi.h>
-#include <m_utils.h>
-#include <m_netlib.h>
-#include <m_langpack.h>
-#include <m_clistint.h>
-#include <m_button.h>
-#include <m_protosvc.h>
-#include <m_protocols.h>
-#include <m_options.h>
-#include <m_skin.h>
-#include <m_gui.h>
-#include <m_contacts.h>
-#include <m_message.h>
-#include <m_userinfo.h>
-#include <m_findadd.h>
-#include <m_idle.h>
-#include <m_icolib.h>
-#include <m_timezones.h>
-
-#include "version.h"
-
-#include "../../mir_app/src/resource.h"
-
-#define MODULENAME "Idle"
-
-struct CMPlugin : public PLUGIN<CMPlugin>
-{
- CMPlugin();
-
- int Load() override;
- int Unload() override;
-};
-
-struct Settings
-{
- Settings() :
- bIdleCheck(MODULENAME, "UserIdleCheck", 0),
- bIdleMethod(MODULENAME, "IdleMethod", 0),
- bIdleOnSaver(MODULENAME, "IdleOnSaver", 0),
- bIdleOnFullScr(MODULENAME, "IdleOnFullScr", 0),
- bIdleOnLock(MODULENAME, "IdleOnLock", 0),
- bIdlePrivate(MODULENAME, "IdlePrivate", 0),
- bIdleSoundsOff(MODULENAME, "IdleSoundsOff", 1),
- bIdleOnTerminal(MODULENAME, "IdleOnTerminalDisconnect", 0),
- bIdleStatusLock(MODULENAME, "IdleStatusLock", 0),
- bAAEnable(MODULENAME, "AAEnable", 0),
- bAAStatus(MODULENAME, "AAStatus", 0),
- iIdleTime1st(MODULENAME, "IdleTime1st", 10)
- {}
-
- CMOption<BYTE> bIdleCheck, bIdleMethod, bIdleOnSaver, bIdleOnFullScr, bIdleOnLock;
- CMOption<BYTE> bIdlePrivate, bIdleSoundsOff, bIdleOnTerminal, bIdleStatusLock;
- CMOption<BYTE> bAAEnable;
- CMOption<WORD> bAAStatus;
- CMOption<DWORD> iIdleTime1st;
-};
-
-extern Settings S;
-
-void IdleObject_Destroy();
-void IdleObject_Create();
diff --git a/src/core/stdidle/src/version.h b/src/core/stdidle/src/version.h
deleted file mode 100644
index 0c72bc1c1e..0000000000
--- a/src/core/stdidle/src/version.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <m_version.h>
-
-#define __FILEVERSION_STRING MIRANDA_VERSION_FILEVERSION
-#define __VERSION_STRING MIRANDA_VERSION_STRING
-
-#define __PLUGIN_NAME "Standard Idle module"
-#define __FILENAME "stdidle.dll"
-#define __DESCRIPTION "Core module for idle state processing."
-#define __AUTHOR "Miranda NG team"
-#define __AUTHORWEB "https://miranda-ng.org/p/StdIdle/"
-#define __COPYRIGHT "© 2012-18 Miranda NG team"
diff --git a/src/core/stdidle/stdidle.vcxproj b/src/core/stdidle/stdidle.vcxproj
deleted file mode 100644
index 28b53db407..0000000000
--- a/src/core/stdidle/stdidle.vcxproj
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug|Win32">
- <Configuration>Debug</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Debug|x64">
- <Configuration>Debug</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|Win32">
- <Configuration>Release</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release|x64">
- <Configuration>Release</Configuration>
- <Platform>x64</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectName>StdIdle</ProjectName>
- <ProjectGuid>{36c40ba6-e0b5-438a-919c-6a991933b313}</ProjectGuid>
- </PropertyGroup>
- <ImportGroup Label="PropertySheets">
- <Import Project="$(ProjectDir)..\..\..\build\vc.common\core.props" />
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/src/core/stdidle/stdidle.vcxproj.filters b/src/core/stdidle/stdidle.vcxproj.filters
deleted file mode 100644
index e39f86d5d6..0000000000
--- a/src/core/stdidle/stdidle.vcxproj.filters
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <Import Project="$(ProjectDir)..\..\..\build\vc.common\common.filters" />
-</Project> \ No newline at end of file