From 48540940b6c28bb4378abfeb500ec45a625b37b6 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Tue, 15 May 2012 10:38:20 +0000 Subject: initial commit git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../AdvancedAutoAway/AdvancedAutoAway.dep | 245 +++++ .../AdvancedAutoAway/AdvancedAutoAway.dsp | 245 +++++ .../AdvancedAutoAway/AdvancedAutoAway.mak | 585 +++++++++++ .../AdvancedAutoAway/AdvancedAutoAway.vcproj | 632 ++++++++++++ .../AdvancedAutoAway/AdvancedAutoAway_10.vcxproj | 486 +++++++++ .../AdvancedAutoAway_10.vcxproj.filters | 82 ++ .../AdvancedAutoAway/AdvancedAutoAway_8.vcproj | 862 ++++++++++++++++ .../AdvancedAutoAway/AdvancedAutoAway_9.vcproj | 1055 ++++++++++++++++++++ .../AdvancedAutoAway/advancedautoaway.cpp | 638 ++++++++++++ .../AdvancedAutoAway/advancedautoaway.h | 95 ++ plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg | Bin 0 -> 62997 bytes plugins/StatusPlugins/AdvancedAutoAway/fsm.sdr | Bin 0 -> 18219 bytes plugins/StatusPlugins/AdvancedAutoAway/main.cpp | 110 ++ .../StatusPlugins/AdvancedAutoAway/msgoptions.cpp | 165 +++ plugins/StatusPlugins/AdvancedAutoAway/options.cpp | 553 ++++++++++ plugins/StatusPlugins/AdvancedAutoAway/pack.cmd | 42 + .../StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp | 161 +++ .../StatusPlugins/AdvancedAutoAway/trigger_aaa.h | 7 + plugins/StatusPlugins/AdvancedAutoAway/vc6.rc | 2 + plugins/StatusPlugins/AdvancedAutoAway/version.h | 56 ++ 20 files changed, 6021 insertions(+) create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.dep create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.dsp create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.mak create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.vcproj create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_8.vcproj create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_9.vcproj create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/fsm.sdr create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/main.cpp create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/options.cpp create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/pack.cmd create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.h create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/vc6.rc create mode 100644 plugins/StatusPlugins/AdvancedAutoAway/version.h (limited to 'plugins/StatusPlugins/AdvancedAutoAway') diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.dep b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.dep new file mode 100644 index 0000000000..879fb1d977 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.dep @@ -0,0 +1,245 @@ +# Microsoft Developer Studio Generated Dependency File, included by AdvancedAutoAway.mak + +.\advancedautoaway.cpp : \ + "..\..\..\include\m_awaymsg.h"\ + "..\..\..\include\m_button.h"\ + "..\..\..\include\m_clist.h"\ + "..\..\..\include\m_database.h"\ + "..\..\..\include\m_idle.h"\ + "..\..\..\include\m_langpack.h"\ + "..\..\..\include\m_netlib.h"\ + "..\..\..\include\m_options.h"\ + "..\..\..\include\m_plugins.h"\ + "..\..\..\include\m_popup.h"\ + "..\..\..\include\m_protocols.h"\ + "..\..\..\include\m_protosvc.h"\ + "..\..\..\include\m_system.h"\ + "..\..\..\include\m_system_cpp.h"\ + "..\..\..\include\m_utils.h"\ + "..\..\..\include\newpluginapi.h"\ + "..\..\..\include\statusmodes.h"\ + "..\..\..\include\win2k.h"\ + "..\..\helpers\gen_helpers.h"\ + "..\commonstatus.h"\ + "..\includes\m_NewAwaySys.h"\ + "..\includes\m_updater.h"\ + "..\includes\m_variables.h"\ + "..\includes\m_vsramm.h"\ + "..\m_statusplugins.h"\ + ".\advancedautoaway.h"\ + ".\version.h"\ + + +..\commonstatus.cpp : \ + "..\..\..\include\m_awaymsg.h"\ + "..\..\..\include\m_button.h"\ + "..\..\..\include\m_clist.h"\ + "..\..\..\include\m_database.h"\ + "..\..\..\include\m_langpack.h"\ + "..\..\..\include\m_netlib.h"\ + "..\..\..\include\m_plugins.h"\ + "..\..\..\include\m_popup.h"\ + "..\..\..\include\m_protocols.h"\ + "..\..\..\include\m_protosvc.h"\ + "..\..\..\include\m_system.h"\ + "..\..\..\include\m_system_cpp.h"\ + "..\..\..\include\m_utils.h"\ + "..\..\..\include\newpluginapi.h"\ + "..\..\..\include\statusmodes.h"\ + "..\..\..\include\win2k.h"\ + "..\..\helpers\gen_helpers.h"\ + "..\commonstatus.h"\ + "..\includes\m_NewAwaySys.h"\ + "..\includes\m_updater.h"\ + "..\includes\m_variables.h"\ + "..\includes\m_vsramm.h"\ + "..\m_statusplugins.h"\ + + +..\confirmdialog.cpp : \ + "..\..\..\include\m_awaymsg.h"\ + "..\..\..\include\m_button.h"\ + "..\..\..\include\m_clist.h"\ + "..\..\..\include\m_database.h"\ + "..\..\..\include\m_langpack.h"\ + "..\..\..\include\m_netlib.h"\ + "..\..\..\include\m_plugins.h"\ + "..\..\..\include\m_popup.h"\ + "..\..\..\include\m_protocols.h"\ + "..\..\..\include\m_protosvc.h"\ + "..\..\..\include\m_system.h"\ + "..\..\..\include\m_system_cpp.h"\ + "..\..\..\include\m_utils.h"\ + "..\..\..\include\newpluginapi.h"\ + "..\..\..\include\statusmodes.h"\ + "..\..\..\include\win2k.h"\ + "..\..\helpers\gen_helpers.h"\ + "..\commonstatus.h"\ + "..\includes\m_NewAwaySys.h"\ + "..\includes\m_updater.h"\ + "..\includes\m_variables.h"\ + "..\includes\m_vsramm.h"\ + "..\m_statusplugins.h"\ + + +..\..\helpers\gen_helpers.cpp : \ + "..\..\..\include\m_addcontact.h"\ + "..\..\..\include\m_awaymsg.h"\ + "..\..\..\include\m_button.h"\ + "..\..\..\include\m_clc.h"\ + "..\..\..\include\m_clist.h"\ + "..\..\..\include\m_clistint.h"\ + "..\..\..\include\m_clui.h"\ + "..\..\..\include\m_contacts.h"\ + "..\..\..\include\m_database.h"\ + "..\..\..\include\m_email.h"\ + "..\..\..\include\m_file.h"\ + "..\..\..\include\m_findadd.h"\ + "..\..\..\include\m_genmenu.h"\ + "..\..\..\include\m_history.h"\ + "..\..\..\include\m_idle.h"\ + "..\..\..\include\m_ignore.h"\ + "..\..\..\include\m_langpack.h"\ + "..\..\..\include\m_message.h"\ + "..\..\..\include\m_netlib.h"\ + "..\..\..\include\m_options.h"\ + "..\..\..\include\m_plugins.h"\ + "..\..\..\include\m_protocols.h"\ + "..\..\..\include\m_protomod.h"\ + "..\..\..\include\m_protosvc.h"\ + "..\..\..\include\m_skin.h"\ + "..\..\..\include\m_system.h"\ + "..\..\..\include\m_userinfo.h"\ + "..\..\..\include\m_utils.h"\ + "..\..\..\include\newpluginapi.h"\ + "..\..\..\include\statusmodes.h"\ + "..\..\helpers\commonheaders.h"\ + "..\..\helpers\gen_helpers.h"\ + "..\includes\m_variables.h"\ + + +.\main.cpp : \ + "..\..\..\include\m_awaymsg.h"\ + "..\..\..\include\m_button.h"\ + "..\..\..\include\m_clist.h"\ + "..\..\..\include\m_database.h"\ + "..\..\..\include\m_idle.h"\ + "..\..\..\include\m_langpack.h"\ + "..\..\..\include\m_netlib.h"\ + "..\..\..\include\m_options.h"\ + "..\..\..\include\m_plugins.h"\ + "..\..\..\include\m_popup.h"\ + "..\..\..\include\m_protocols.h"\ + "..\..\..\include\m_protosvc.h"\ + "..\..\..\include\m_system.h"\ + "..\..\..\include\m_system_cpp.h"\ + "..\..\..\include\m_utils.h"\ + "..\..\..\include\newpluginapi.h"\ + "..\..\..\include\statusmodes.h"\ + "..\..\..\include\win2k.h"\ + "..\..\helpers\gen_helpers.h"\ + "..\commonstatus.h"\ + "..\includes\m_NewAwaySys.h"\ + "..\includes\m_updater.h"\ + "..\includes\m_variables.h"\ + "..\includes\m_vsramm.h"\ + "..\m_statusplugins.h"\ + ".\advancedautoaway.h"\ + ".\version.h"\ + + +.\msgoptions.cpp : \ + "..\..\..\include\m_awaymsg.h"\ + "..\..\..\include\m_button.h"\ + "..\..\..\include\m_clist.h"\ + "..\..\..\include\m_database.h"\ + "..\..\..\include\m_idle.h"\ + "..\..\..\include\m_langpack.h"\ + "..\..\..\include\m_netlib.h"\ + "..\..\..\include\m_options.h"\ + "..\..\..\include\m_plugins.h"\ + "..\..\..\include\m_popup.h"\ + "..\..\..\include\m_protocols.h"\ + "..\..\..\include\m_protosvc.h"\ + "..\..\..\include\m_system.h"\ + "..\..\..\include\m_system_cpp.h"\ + "..\..\..\include\m_utils.h"\ + "..\..\..\include\newpluginapi.h"\ + "..\..\..\include\statusmodes.h"\ + "..\..\..\include\win2k.h"\ + "..\..\helpers\gen_helpers.h"\ + "..\commonstatus.h"\ + "..\includes\m_NewAwaySys.h"\ + "..\includes\m_updater.h"\ + "..\includes\m_variables.h"\ + "..\includes\m_vsramm.h"\ + "..\m_statusplugins.h"\ + ".\advancedautoaway.h"\ + ".\version.h"\ + + +.\options.cpp : \ + "..\..\..\include\m_awaymsg.h"\ + "..\..\..\include\m_button.h"\ + "..\..\..\include\m_clist.h"\ + "..\..\..\include\m_database.h"\ + "..\..\..\include\m_idle.h"\ + "..\..\..\include\m_langpack.h"\ + "..\..\..\include\m_netlib.h"\ + "..\..\..\include\m_options.h"\ + "..\..\..\include\m_plugins.h"\ + "..\..\..\include\m_popup.h"\ + "..\..\..\include\m_protocols.h"\ + "..\..\..\include\m_protosvc.h"\ + "..\..\..\include\m_system.h"\ + "..\..\..\include\m_system_cpp.h"\ + "..\..\..\include\m_utils.h"\ + "..\..\..\include\newpluginapi.h"\ + "..\..\..\include\statusmodes.h"\ + "..\..\..\include\win2k.h"\ + "..\..\helpers\gen_helpers.h"\ + "..\commonstatus.h"\ + "..\includes\m_NewAwaySys.h"\ + "..\includes\m_updater.h"\ + "..\includes\m_variables.h"\ + "..\includes\m_vsramm.h"\ + "..\m_statusplugins.h"\ + ".\advancedautoaway.h"\ + ".\version.h"\ + + +.\trigger_aaa.cpp : \ + "..\..\..\include\m_awaymsg.h"\ + "..\..\..\include\m_button.h"\ + "..\..\..\include\m_clist.h"\ + "..\..\..\include\m_database.h"\ + "..\..\..\include\m_idle.h"\ + "..\..\..\include\m_langpack.h"\ + "..\..\..\include\m_netlib.h"\ + "..\..\..\include\m_options.h"\ + "..\..\..\include\m_plugins.h"\ + "..\..\..\include\m_popup.h"\ + "..\..\..\include\m_protocols.h"\ + "..\..\..\include\m_protosvc.h"\ + "..\..\..\include\m_system.h"\ + "..\..\..\include\m_system_cpp.h"\ + "..\..\..\include\m_utils.h"\ + "..\..\..\include\newpluginapi.h"\ + "..\..\..\include\statusmodes.h"\ + "..\..\..\include\win2k.h"\ + "..\..\helpers\gen_helpers.h"\ + "..\commonstatus.h"\ + "..\includes\m_NewAwaySys.h"\ + "..\includes\m_trigger.h"\ + "..\includes\m_updater.h"\ + "..\includes\m_variables.h"\ + "..\includes\m_vsramm.h"\ + "..\m_statusplugins.h"\ + ".\advancedautoaway.h"\ + ".\trigger_aaa.h"\ + ".\version.h"\ + + +.\vc6.rc : \ + "..\resource.rc"\ + diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.dsp b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.dsp new file mode 100644 index 0000000000..d0c360bfed --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.dsp @@ -0,0 +1,245 @@ +# Microsoft Developer Studio Project File - Name="AdvancedAutoAway" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=AdvancedAutoAway - Win32 Debug Unicode +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "AdvancedAutoAway.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "AdvancedAutoAway.mak" CFG="AdvancedAutoAway - Win32 Debug Unicode" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "AdvancedAutoAway - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "AdvancedAutoAway - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "AdvancedAutoAway - Win32 Debug Unicode" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "AdvancedAutoAway - Win32 Release Unicode" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ADVANCEDAUTOAWAY_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../../include" /I "../includes" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ADVANCEDAUTOAWAY_EXPORTS" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib /nologo /base:"0x11bd0000" /dll /debug /machine:I386 /nodefaultlib /out:"../../../bin/release/plugins/AdvancedAutoAway.dll" + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ADVANCEDAUTOAWAY_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../includes" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ADVANCEDAUTOAWAY_EXPORTS" /FR /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /debug /machine:I386 /out:"../../../bin/debug/plugins/AdvancedAutoAway.dll" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "AdvancedAutoAway___Win32_Debug_Unicode" +# PROP BASE Intermediate_Dir "AdvancedAutoAway___Win32_Debug_Unicode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug_Unicode" +# PROP Intermediate_Dir "Debug_Unicode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../includes" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ADVANCEDAUTOAWAY_EXPORTS" /FR /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../includes" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /D "_USRDLL" /FR /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "_DEBUG" +# ADD RSC /l 0x409 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /debug /machine:I386 /out:"../../../bin/debug/plugins/AdvancedAutoAway.dll" /pdbtype:sept +# SUBTRACT BASE LINK32 /pdb:none +# ADD LINK32 comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /debug /machine:I386 /out:"../../../bin/Debug Unicode/plugins/AdvancedAutoAway.dll" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "AdvancedAutoAway___Win32_Release_Unicode" +# PROP BASE Intermediate_Dir "AdvancedAutoAway___Win32_Release_Unicode" +# PROP BASE Ignore_Export_Lib 0 +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release_Unicode" +# PROP Intermediate_Dir "Release_Unicode" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../../include" /I "../includes" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ADVANCEDAUTOAWAY_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../../include" /I "../includes" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /D "_USRDLL" /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /d "NDEBUG" +# ADD RSC /l 0x409 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib /nologo /base:"0x11bd0000" /dll /debug /machine:I386 /nodefaultlib /out:"../../../bin/release/plugins/AdvancedAutoAway.dll" +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib /nologo /base:"0x11bd0000" /dll /debug /machine:I386 /nodefaultlib /out:"../../../bin/Release Unicode/plugins/AdvancedAutoAway.dll" + +!ENDIF + +# Begin Target + +# Name "AdvancedAutoAway - Win32 Release" +# Name "AdvancedAutoAway - Win32 Debug" +# Name "AdvancedAutoAway - Win32 Debug Unicode" +# Name "AdvancedAutoAway - Win32 Release Unicode" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\advancedautoaway.cpp +# End Source File +# Begin Source File + +SOURCE=..\commonstatus.cpp +# End Source File +# Begin Source File + +SOURCE=..\confirmdialog.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\helpers\gen_helpers.cpp +# End Source File +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# Begin Source File + +SOURCE=.\msgoptions.cpp +# End Source File +# Begin Source File + +SOURCE=.\options.cpp +# End Source File +# Begin Source File + +SOURCE=.\trigger_aaa.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\advancedautoaway.h +# End Source File +# Begin Source File + +SOURCE=..\commonstatus.h +# End Source File +# Begin Source File + +SOURCE=..\m_statusplugins.h +# End Source File +# Begin Source File + +SOURCE=..\resource.h +# End Source File +# Begin Source File + +SOURCE=.\trigger_aaa.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# Begin Source File + +SOURCE=.\vc6.rc +# End Source File +# End Group +# Begin Source File + +SOURCE=.\Release\AdvancedAutoAway.txt + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + +# PROP BASE Exclude_From_Build 1 +# PROP Exclude_From_Build 1 + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + +# PROP BASE Exclude_From_Build 1 +# PROP Exclude_From_Build 1 + +!ENDIF + +# End Source File +# End Target +# End Project diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.mak b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.mak new file mode 100644 index 0000000000..d4ab6d92cb --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.mak @@ -0,0 +1,585 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on AdvancedAutoAway.dsp +!IF "$(CFG)" == "" +CFG=AdvancedAutoAway - Win32 Debug Unicode +!MESSAGE No configuration specified. Defaulting to AdvancedAutoAway - Win32 Debug Unicode. +!ENDIF + +!IF "$(CFG)" != "AdvancedAutoAway - Win32 Release" && "$(CFG)" != "AdvancedAutoAway - Win32 Debug" && "$(CFG)" != "AdvancedAutoAway - Win32 Debug Unicode" && "$(CFG)" != "AdvancedAutoAway - Win32 Release Unicode" +!MESSAGE Invalid configuration "$(CFG)" specified. +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "AdvancedAutoAway.mak" CFG="AdvancedAutoAway - Win32 Debug Unicode" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "AdvancedAutoAway - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "AdvancedAutoAway - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "AdvancedAutoAway - Win32 Debug Unicode" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "AdvancedAutoAway - Win32 Release Unicode" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE +!ERROR An invalid configuration is specified. +!ENDIF + +!IF "$(OS)" == "Windows_NT" +NULL= +!ELSE +NULL=nul +!ENDIF + +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + +OUTDIR=.\Release +INTDIR=.\Release + +ALL : "..\..\..\bin\release\plugins\AdvancedAutoAway.dll" + + +CLEAN : + -@erase "$(INTDIR)\advancedautoaway.obj" + -@erase "$(INTDIR)\commonstatus.obj" + -@erase "$(INTDIR)\confirmdialog.obj" + -@erase "$(INTDIR)\gen_helpers.obj" + -@erase "$(INTDIR)\main.obj" + -@erase "$(INTDIR)\msgoptions.obj" + -@erase "$(INTDIR)\options.obj" + -@erase "$(INTDIR)\trigger_aaa.obj" + -@erase "$(INTDIR)\vc6.res" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\AdvancedAutoAway.exp" + -@erase "$(OUTDIR)\AdvancedAutoAway.lib" + -@erase "$(OUTDIR)\AdvancedAutoAway.pdb" + -@erase "..\..\..\bin\release\plugins\AdvancedAutoAway.dll" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MD /W3 /GX /Zi /O1 /I "../../../include" /I "../includes" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ADVANCEDAUTOAWAY_EXPORTS" /Fp"$(INTDIR)\AdvancedAutoAway.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c +MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\vc6.res" /d "NDEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\AdvancedAutoAway.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib /nologo /base:"0x11bd0000" /dll /incremental:no /pdb:"$(OUTDIR)\AdvancedAutoAway.pdb" /debug /machine:I386 /nodefaultlib /out:"../../../bin/release/plugins/AdvancedAutoAway.dll" /implib:"$(OUTDIR)\AdvancedAutoAway.lib" +LINK32_OBJS= \ + "$(INTDIR)\advancedautoaway.obj" \ + "$(INTDIR)\commonstatus.obj" \ + "$(INTDIR)\confirmdialog.obj" \ + "$(INTDIR)\gen_helpers.obj" \ + "$(INTDIR)\main.obj" \ + "$(INTDIR)\msgoptions.obj" \ + "$(INTDIR)\options.obj" \ + "$(INTDIR)\trigger_aaa.obj" \ + "$(INTDIR)\vc6.res" + +"..\..\..\bin\release\plugins\AdvancedAutoAway.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + +OUTDIR=.\Debug +INTDIR=.\Debug +# Begin Custom Macros +OutDir=.\Debug +# End Custom Macros + +ALL : "..\..\..\bin\debug\plugins\AdvancedAutoAway.dll" "$(OUTDIR)\AdvancedAutoAway.bsc" + + +CLEAN : + -@erase "$(INTDIR)\advancedautoaway.obj" + -@erase "$(INTDIR)\advancedautoaway.sbr" + -@erase "$(INTDIR)\commonstatus.obj" + -@erase "$(INTDIR)\commonstatus.sbr" + -@erase "$(INTDIR)\confirmdialog.obj" + -@erase "$(INTDIR)\confirmdialog.sbr" + -@erase "$(INTDIR)\gen_helpers.obj" + -@erase "$(INTDIR)\gen_helpers.sbr" + -@erase "$(INTDIR)\main.obj" + -@erase "$(INTDIR)\main.sbr" + -@erase "$(INTDIR)\msgoptions.obj" + -@erase "$(INTDIR)\msgoptions.sbr" + -@erase "$(INTDIR)\options.obj" + -@erase "$(INTDIR)\options.sbr" + -@erase "$(INTDIR)\trigger_aaa.obj" + -@erase "$(INTDIR)\trigger_aaa.sbr" + -@erase "$(INTDIR)\vc6.res" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\AdvancedAutoAway.bsc" + -@erase "$(OUTDIR)\AdvancedAutoAway.exp" + -@erase "$(OUTDIR)\AdvancedAutoAway.lib" + -@erase "$(OUTDIR)\AdvancedAutoAway.pdb" + -@erase "..\..\..\bin\debug\plugins\AdvancedAutoAway.dll" + -@erase "..\..\..\bin\debug\plugins\AdvancedAutoAway.ilk" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../includes" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "ADVANCEDAUTOAWAY_EXPORTS" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\AdvancedAutoAway.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c +MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\vc6.res" /d "_DEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\AdvancedAutoAway.bsc" +BSC32_SBRS= \ + "$(INTDIR)\advancedautoaway.sbr" \ + "$(INTDIR)\commonstatus.sbr" \ + "$(INTDIR)\confirmdialog.sbr" \ + "$(INTDIR)\gen_helpers.sbr" \ + "$(INTDIR)\main.sbr" \ + "$(INTDIR)\msgoptions.sbr" \ + "$(INTDIR)\options.sbr" \ + "$(INTDIR)\trigger_aaa.sbr" + +"$(OUTDIR)\AdvancedAutoAway.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +LINK32_FLAGS=comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\AdvancedAutoAway.pdb" /debug /machine:I386 /out:"../../../bin/debug/plugins/AdvancedAutoAway.dll" /implib:"$(OUTDIR)\AdvancedAutoAway.lib" /pdbtype:sept +LINK32_OBJS= \ + "$(INTDIR)\advancedautoaway.obj" \ + "$(INTDIR)\commonstatus.obj" \ + "$(INTDIR)\confirmdialog.obj" \ + "$(INTDIR)\gen_helpers.obj" \ + "$(INTDIR)\main.obj" \ + "$(INTDIR)\msgoptions.obj" \ + "$(INTDIR)\options.obj" \ + "$(INTDIR)\trigger_aaa.obj" \ + "$(INTDIR)\vc6.res" + +"..\..\..\bin\debug\plugins\AdvancedAutoAway.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + +OUTDIR=.\Debug_Unicode +INTDIR=.\Debug_Unicode +# Begin Custom Macros +OutDir=.\Debug_Unicode +# End Custom Macros + +ALL : "..\..\..\bin\Debug Unicode\plugins\AdvancedAutoAway.dll" "$(OUTDIR)\AdvancedAutoAway.bsc" + + +CLEAN : + -@erase "$(INTDIR)\advancedautoaway.obj" + -@erase "$(INTDIR)\advancedautoaway.sbr" + -@erase "$(INTDIR)\commonstatus.obj" + -@erase "$(INTDIR)\commonstatus.sbr" + -@erase "$(INTDIR)\confirmdialog.obj" + -@erase "$(INTDIR)\confirmdialog.sbr" + -@erase "$(INTDIR)\gen_helpers.obj" + -@erase "$(INTDIR)\gen_helpers.sbr" + -@erase "$(INTDIR)\main.obj" + -@erase "$(INTDIR)\main.sbr" + -@erase "$(INTDIR)\msgoptions.obj" + -@erase "$(INTDIR)\msgoptions.sbr" + -@erase "$(INTDIR)\options.obj" + -@erase "$(INTDIR)\options.sbr" + -@erase "$(INTDIR)\trigger_aaa.obj" + -@erase "$(INTDIR)\trigger_aaa.sbr" + -@erase "$(INTDIR)\vc6.res" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\AdvancedAutoAway.bsc" + -@erase "$(OUTDIR)\AdvancedAutoAway.exp" + -@erase "$(OUTDIR)\AdvancedAutoAway.lib" + -@erase "$(OUTDIR)\AdvancedAutoAway.pdb" + -@erase "..\..\..\bin\Debug Unicode\plugins\AdvancedAutoAway.dll" + -@erase "..\..\..\bin\Debug Unicode\plugins\AdvancedAutoAway.ilk" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../../include" /I "../includes" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /D "_USRDLL" /FR"$(INTDIR)\\" /Fp"$(INTDIR)\AdvancedAutoAway.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c +MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\vc6.res" /d "_DEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\AdvancedAutoAway.bsc" +BSC32_SBRS= \ + "$(INTDIR)\advancedautoaway.sbr" \ + "$(INTDIR)\commonstatus.sbr" \ + "$(INTDIR)\confirmdialog.sbr" \ + "$(INTDIR)\gen_helpers.sbr" \ + "$(INTDIR)\main.sbr" \ + "$(INTDIR)\msgoptions.sbr" \ + "$(INTDIR)\options.sbr" \ + "$(INTDIR)\trigger_aaa.sbr" + +"$(OUTDIR)\AdvancedAutoAway.bsc" : "$(OUTDIR)" $(BSC32_SBRS) + $(BSC32) @<< + $(BSC32_FLAGS) $(BSC32_SBRS) +<< + +LINK32=link.exe +LINK32_FLAGS=comctl32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /incremental:yes /pdb:"$(OUTDIR)\AdvancedAutoAway.pdb" /debug /machine:I386 /out:"../../../bin/Debug Unicode/plugins/AdvancedAutoAway.dll" /implib:"$(OUTDIR)\AdvancedAutoAway.lib" /pdbtype:sept +LINK32_OBJS= \ + "$(INTDIR)\advancedautoaway.obj" \ + "$(INTDIR)\commonstatus.obj" \ + "$(INTDIR)\confirmdialog.obj" \ + "$(INTDIR)\gen_helpers.obj" \ + "$(INTDIR)\main.obj" \ + "$(INTDIR)\msgoptions.obj" \ + "$(INTDIR)\options.obj" \ + "$(INTDIR)\trigger_aaa.obj" \ + "$(INTDIR)\vc6.res" + +"..\..\..\bin\Debug Unicode\plugins\AdvancedAutoAway.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + +OUTDIR=.\Release_Unicode +INTDIR=.\Release_Unicode + +ALL : "..\..\..\bin\Release Unicode\plugins\AdvancedAutoAway.dll" + + +CLEAN : + -@erase "$(INTDIR)\advancedautoaway.obj" + -@erase "$(INTDIR)\commonstatus.obj" + -@erase "$(INTDIR)\confirmdialog.obj" + -@erase "$(INTDIR)\gen_helpers.obj" + -@erase "$(INTDIR)\main.obj" + -@erase "$(INTDIR)\msgoptions.obj" + -@erase "$(INTDIR)\options.obj" + -@erase "$(INTDIR)\trigger_aaa.obj" + -@erase "$(INTDIR)\vc6.res" + -@erase "$(INTDIR)\vc60.idb" + -@erase "$(INTDIR)\vc60.pdb" + -@erase "$(OUTDIR)\AdvancedAutoAway.exp" + -@erase "$(OUTDIR)\AdvancedAutoAway.lib" + -@erase "$(OUTDIR)\AdvancedAutoAway.pdb" + -@erase "..\..\..\bin\Release Unicode\plugins\AdvancedAutoAway.dll" + +"$(OUTDIR)" : + if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)" + +CPP_PROJ=/nologo /MD /W3 /GX /Zi /O1 /I "../../../include" /I "../includes" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /D "_USRDLL" /Fp"$(INTDIR)\AdvancedAutoAway.pch" /YX /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c +MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 +RSC_PROJ=/l 0x409 /fo"$(INTDIR)\vc6.res" /d "NDEBUG" +BSC32=bscmake.exe +BSC32_FLAGS=/nologo /o"$(OUTDIR)\AdvancedAutoAway.bsc" +BSC32_SBRS= \ + +LINK32=link.exe +LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib /nologo /base:"0x11bd0000" /dll /incremental:no /pdb:"$(OUTDIR)\AdvancedAutoAway.pdb" /debug /machine:I386 /nodefaultlib /out:"../../../bin/Release Unicode/plugins/AdvancedAutoAway.dll" /implib:"$(OUTDIR)\AdvancedAutoAway.lib" +LINK32_OBJS= \ + "$(INTDIR)\advancedautoaway.obj" \ + "$(INTDIR)\commonstatus.obj" \ + "$(INTDIR)\confirmdialog.obj" \ + "$(INTDIR)\gen_helpers.obj" \ + "$(INTDIR)\main.obj" \ + "$(INTDIR)\msgoptions.obj" \ + "$(INTDIR)\options.obj" \ + "$(INTDIR)\trigger_aaa.obj" \ + "$(INTDIR)\vc6.res" + +"..\..\..\bin\Release Unicode\plugins\AdvancedAutoAway.dll" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS) + $(LINK32) @<< + $(LINK32_FLAGS) $(LINK32_OBJS) +<< + +!ENDIF + +.c{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.obj:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.c{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cpp{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + +.cxx{$(INTDIR)}.sbr:: + $(CPP) @<< + $(CPP_PROJ) $< +<< + + +!IF "$(NO_EXTERNAL_DEPS)" != "1" +!IF EXISTS("AdvancedAutoAway.dep") +!INCLUDE "AdvancedAutoAway.dep" +!ELSE +!MESSAGE Warning: cannot find "AdvancedAutoAway.dep" +!ENDIF +!ENDIF + + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" || "$(CFG)" == "AdvancedAutoAway - Win32 Debug" || "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" || "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" +SOURCE=.\advancedautoaway.cpp + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + + +"$(INTDIR)\advancedautoaway.obj" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + + +"$(INTDIR)\advancedautoaway.obj" "$(INTDIR)\advancedautoaway.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + + +"$(INTDIR)\advancedautoaway.obj" "$(INTDIR)\advancedautoaway.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + + +"$(INTDIR)\advancedautoaway.obj" : $(SOURCE) "$(INTDIR)" + + +!ENDIF + +SOURCE=..\commonstatus.cpp + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + + +"$(INTDIR)\commonstatus.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + + +"$(INTDIR)\commonstatus.obj" "$(INTDIR)\commonstatus.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + + +"$(INTDIR)\commonstatus.obj" "$(INTDIR)\commonstatus.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + + +"$(INTDIR)\commonstatus.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\confirmdialog.cpp + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + + +"$(INTDIR)\confirmdialog.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + + +"$(INTDIR)\confirmdialog.obj" "$(INTDIR)\confirmdialog.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + + +"$(INTDIR)\confirmdialog.obj" "$(INTDIR)\confirmdialog.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + + +"$(INTDIR)\confirmdialog.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=..\..\helpers\gen_helpers.cpp + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + + +"$(INTDIR)\gen_helpers.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + + +"$(INTDIR)\gen_helpers.obj" "$(INTDIR)\gen_helpers.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + + +"$(INTDIR)\gen_helpers.obj" "$(INTDIR)\gen_helpers.sbr" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + + +"$(INTDIR)\gen_helpers.obj" : $(SOURCE) "$(INTDIR)" + $(CPP) $(CPP_PROJ) $(SOURCE) + + +!ENDIF + +SOURCE=.\main.cpp + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + + +"$(INTDIR)\main.obj" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + + +"$(INTDIR)\main.obj" "$(INTDIR)\main.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + + +"$(INTDIR)\main.obj" "$(INTDIR)\main.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + + +"$(INTDIR)\main.obj" : $(SOURCE) "$(INTDIR)" + + +!ENDIF + +SOURCE=.\msgoptions.cpp + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + + +"$(INTDIR)\msgoptions.obj" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + + +"$(INTDIR)\msgoptions.obj" "$(INTDIR)\msgoptions.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + + +"$(INTDIR)\msgoptions.obj" "$(INTDIR)\msgoptions.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + + +"$(INTDIR)\msgoptions.obj" : $(SOURCE) "$(INTDIR)" + + +!ENDIF + +SOURCE=.\options.cpp + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + + +"$(INTDIR)\options.obj" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + + +"$(INTDIR)\options.obj" "$(INTDIR)\options.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + + +"$(INTDIR)\options.obj" "$(INTDIR)\options.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + + +"$(INTDIR)\options.obj" : $(SOURCE) "$(INTDIR)" + + +!ENDIF + +SOURCE=.\trigger_aaa.cpp + +!IF "$(CFG)" == "AdvancedAutoAway - Win32 Release" + + +"$(INTDIR)\trigger_aaa.obj" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug" + + +"$(INTDIR)\trigger_aaa.obj" "$(INTDIR)\trigger_aaa.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Debug Unicode" + + +"$(INTDIR)\trigger_aaa.obj" "$(INTDIR)\trigger_aaa.sbr" : $(SOURCE) "$(INTDIR)" + + +!ELSEIF "$(CFG)" == "AdvancedAutoAway - Win32 Release Unicode" + + +"$(INTDIR)\trigger_aaa.obj" : $(SOURCE) "$(INTDIR)" + + +!ENDIF + +SOURCE=.\vc6.rc + +"$(INTDIR)\vc6.res" : $(SOURCE) "$(INTDIR)" + $(RSC) $(RSC_PROJ) $(SOURCE) + + + +!ENDIF + diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.vcproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.vcproj new file mode 100644 index 0000000000..69cbe22d19 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway.vcproj @@ -0,0 +1,632 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj new file mode 100644 index 0000000000..493bbb49ce --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj @@ -0,0 +1,486 @@ + + + + + Debug Unicode + Win32 + + + Debug Unicode + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release Unicode + Win32 + + + Release Unicode + x64 + + + Release + Win32 + + + Release + x64 + + + + AdvancedAutoAway + {66503A70-B1E8-4545-B4FF-2108DFB40C72} + AdvancedAutoAway + + + + DynamicLibrary + false + Unicode + true + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + MultiByte + true + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + true + Unicode + + + DynamicLibrary + Unicode + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + true + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + true + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + true + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + true + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/AdvancedAutoAway.tlb + + + + + Disabled + ../../../include;../includes;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ../commonstatus.h + true + Level3 + true + EditAndContinue + Default + 4996;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + comctl32.lib;%(AdditionalDependencies) + true + true + $(IntDir)$(TargetName).lib + MachineX86 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/AdvancedAutoAway.tlb + + + + + Full + OnlyExplicitInline + Size + true + ../../../include;../includes;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + Use + ../commonstatus.h + Level3 + true + ProgramDatabase + Default + 4996;%(DisableSpecificWarnings) + true + false + Fast + false + false + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + comctl32.lib;%(AdditionalDependencies) + true + true + true + true + UseLinkTimeCodeGeneration + 0x11bd0000 + $(IntDir)$(TargetName).lib + MachineX86 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/AdvancedAutoAway.tlb + + + + + Disabled + ../../../include;../includes;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + ../commonstatus.h + true + Level3 + true + EditAndContinue + Default + 4996;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + comctl32.lib;%(AdditionalDependencies) + true + true + $(IntDir)$(TargetName).lib + MachineX86 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/AdvancedAutoAway.tlb + + + + + Full + OnlyExplicitInline + Size + ../../../include;../includes;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;ADVANCEDAUTOAWAY_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + Use + ../commonstatus.h + Level3 + true + ProgramDatabase + Default + 4996;%(DisableSpecificWarnings) + true + true + false + false + false + Fast + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + comctl32.lib;%(AdditionalDependencies) + true + true + true + 0x11bd0000 + $(IntDir)$(TargetName).lib + MachineX86 + UseLinkTimeCodeGeneration + + + + + Full + + + + + OnlyExplicitInline + + + + + true + + + + + Size + + + + + true + false + true + false + MultiThreadedDLL + false + Fast + ../../../include;../includes;%(AdditionalIncludeDirectories) + Use + ../commonstatus.h + + + + + true + + + true + UseLinkTimeCodeGeneration + comctl32.lib;%(AdditionalDependencies) + true + + + + + Full + + + + + OnlyExplicitInline + + + + + Size + + + + + true + true + true + false + MultiThreadedDLL + Fast + false + false + ../../../include;../includes;%(AdditionalIncludeDirectories) + Use + ../commonstatus.h + + + + + comctl32.lib;%(AdditionalDependencies) + true + + + + + ../../../include;../includes;%(AdditionalIncludeDirectories) + Use + ../commonstatus.h + + + + + comctl32.lib;%(AdditionalDependencies) + true + + + + + ../../../include;../includes;%(AdditionalIncludeDirectories) + Use + ../commonstatus.h + + + + + comctl32.lib;%(AdditionalDependencies) + true + + + + + + Create + Create + Create + Create + commonstatus.h + commonstatus.h + commonstatus.h + commonstatus.h + Create + commonstatus.h + Create + commonstatus.h + Create + commonstatus.h + Create + commonstatus.h + + + commonstatus.h + commonstatus.h + commonstatus.h + commonstatus.h + commonstatus.h + commonstatus.h + commonstatus.h + commonstatus.h + + + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + NotUsing + + + + + + + + + + + + + + + + + + + + + + %(PreprocessorDefinitions) + \Miranda\miranda\plugins\StatusPlugins;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + \Miranda\miranda\plugins\StatusPlugins;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + \Miranda\miranda\plugins\StatusPlugins;%(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + \Miranda\miranda\plugins\StatusPlugins;%(AdditionalIncludeDirectories) + + + + + + + \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters new file mode 100644 index 0000000000..beb6fc5f03 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_10.vcxproj.filters @@ -0,0 +1,82 @@ + + + + + {6b60d98e-019d-49ff-a906-9090232d9213} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {b2e98f78-44f0-4095-880b-46a0ede02428} + h;hpp;hxx;hm;inl + + + {2d794d19-0987-4aa7-940d-2378ba7e4fdb} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_8.vcproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_8.vcproj new file mode 100644 index 0000000000..0c3c4c3645 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_8.vcproj @@ -0,0 +1,862 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_9.vcproj b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_9.vcproj new file mode 100644 index 0000000000..ccd0e03244 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/AdvancedAutoAway_9.vcproj @@ -0,0 +1,1055 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp new file mode 100644 index 0000000000..3806f9f99e --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.cpp @@ -0,0 +1,638 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + 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 + + + Some code is copied from Miranda's AutoAway module +*/ +#include "../commonstatus.h" +#include "advancedautoaway.h" +#include "../resource.h" +#include + +#ifdef _DEBUG + #define SECS_PER_MINUTE 20 /* speedup */ +#else + #define SECS_PER_MINUTE 60 /* default I believe */ +#endif + +#define TRIGGERPLUGIN /* remove this to compile without it */ + +#ifdef TRIGGERPLUGIN +extern int InitTrigger(); +extern int DeInitTrigger(); +#endif + +///////////////////////////////////////////////////////////////////////////////////////// + +int CompareSettings( const TAAAProtoSetting* p1, const TAAAProtoSetting* p2 ) +{ + return lstrcmpA( p1->szName, p2->szName ); +} + +OBJLIST autoAwaySettings( 10, CompareSettings ); + +TAAAProtoSetting::TAAAProtoSetting( PROTOACCOUNT* pa ) +{ + cbSize = sizeof(PROTOCOLSETTINGEX); + szName = pa->szModuleName; + tszAccName = pa->tszAccountName; + lastStatus = status = originalStatusMode = ID_STATUS_CURRENT; + szMsg = NULL; + curState = ACTIVE; + mStatus = FALSE; +} + +TAAAProtoSetting::~TAAAProtoSetting() +{ + if ( szMsg ) + free( szMsg ); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +typedef HDESK (WINAPI* pfnOpenInputDesktop)( DWORD, BOOL, DWORD ); +static pfnOpenInputDesktop openInputDesktop = NULL; +typedef HDESK (WINAPI* pfnCloseDesktop)( HDESK ); +static pfnCloseDesktop closeDesktop = NULL; + +extern HANDLE hStateChangedEvent; + +static BOOL ignoreLockKeys = FALSE; +static BOOL ignoreSysKeys = FALSE; +static BOOL ignoreAltCombo = FALSE; +static BOOL monitorMouse = TRUE; +static BOOL monitorKeyboard = TRUE; +static HWND confirmDialog; +static HANDLE hAutoAwayOptionsHook; +static HANDLE hAutoAwayShutDownHook; +static HANDLE hProtoAckHook; +static HANDLE hAccChangeHook; +static int mouseStationaryTimer; +HHOOK hMirandaMouseHook = NULL; +HHOOK hMirandaKeyBoardHook = NULL; +#pragma data_seg("Shared") +DWORD lastInput = 0; +POINT lastMousePos = {0}; +HHOOK hMouseHook = NULL; +HHOOK hKeyBoardHook = NULL; +#pragma data_seg() +#pragma comment(linker, "/section:Shared,rws") +DWORD lastMirandaInput = 0; +static UINT_PTR hAutoAwayTimer; +// prototypes +extern DWORD StatusModeToProtoFlag(int status); +extern int InitCommonStatus(); +static BOOL (WINAPI * MyGetLastInputInfo)(PLASTINPUTINFO); +void LoadOptions(TAAAProtoSetting** loadSettings, BOOL override); +static int HookWindowsHooks(int hookMiranda, int hookAll); +static int UnhookWindowsHooks(); +static LRESULT CALLBACK MouseHookFunction(int code, WPARAM wParam, LPARAM lParam); +static LRESULT CALLBACK KeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam); +static LRESULT CALLBACK MirandaMouseHookFunction(int code, WPARAM wParam, LPARAM lParam); +static LRESULT CALLBACK MirandaKeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam); +static BOOL IsSaverRunning(); +BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved); + +static VOID CALLBACK AutoAwayTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD dwTime); +extern int AutoAwayOptInitialise(WPARAM wParam,LPARAM lParam); +extern int AutoAwayMsgOptInitialise(WPARAM wParam,LPARAM lParam); +extern int SetStatus(WPARAM wParam, LPARAM lParam); +extern int ShowConfirmDialog(WPARAM wParam, LPARAM lParam); +extern char *StatusModeToDbSetting(int status,const char *suffix); + +///////////////////////////////////////////////////////////////////////////////////////// +// Load from DB + +void LoadOptions( OBJLIST& loadSettings, BOOL override) +{ + // if override is enabled, samesettings will be ignored (for options loading) + int monitorMiranda = FALSE; // use windows hooks? + int monitorAll = FALSE; // use windows hooks? + + if (!override) + UnhookWindowsHooks(); + if (hAutoAwayTimer != 0) + KillTimer(NULL, hAutoAwayTimer); + + ignoreLockKeys = DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNLOCK, FALSE); + ignoreSysKeys = DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE); + ignoreAltCombo = DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE); + monitorMouse = DBGetContactSettingByte(NULL, MODULENAME, SETTING_MONITORMOUSE, TRUE); + monitorKeyboard = DBGetContactSettingByte(NULL, MODULENAME, SETTING_MONITORKEYBOARD, TRUE); + lastInput = lastMirandaInput = GetTickCount(); + + for ( int i=0; i < loadSettings.getCount(); i++ ) { + char* protoName; + if ((DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)) && !override) + protoName = SETTING_ALL; + else + protoName = loadSettings[i].szName; + LoadAutoAwaySetting( loadSettings[i], protoName); + if (!override) { + if (loadSettings[i].optionFlags & FLAG_MONITORMIRANDA) + monitorMiranda = TRUE; + else if ( (MyGetLastInputInfo==NULL) || ignoreLockKeys || ignoreSysKeys || ignoreAltCombo || (monitorMouse != monitorKeyboard) ) + monitorAll = TRUE; + } } + + if (DBGetContactSettingByte(NULL, "Idle", "AAEnable", 0)) + return; + + HookWindowsHooks(monitorMiranda, monitorAll); + hAutoAwayTimer = SetTimer(NULL,0, DBGetContactSettingWord(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5)*1000,AutoAwayTimer); +} + +int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName) +{ + char setting[128]; + _snprintf(setting, sizeof(setting), "%s_OptionFlags", protoName); + autoAwaySetting.optionFlags = DBGetContactSettingByte(NULL,MODULENAME,setting,FLAG_LV2ONINACTIVE|FLAG_RESET); + _snprintf(setting, sizeof(setting), "%s_AwayTime", protoName); + autoAwaySetting.awayTime = DBGetContactSettingWord(NULL,MODULENAME,setting,SETTING_AWAYTIME_DEFAULT); + _snprintf(setting, sizeof(setting), "%s_NATime", protoName); + autoAwaySetting.naTime = DBGetContactSettingWord(NULL,MODULENAME,setting,SETTING_NATIME_DEFAULT); + _snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName); + autoAwaySetting.statusFlags = DBGetContactSettingWord(NULL,MODULENAME,setting, StatusModeToProtoFlag(ID_STATUS_ONLINE)|StatusModeToProtoFlag(ID_STATUS_FREECHAT)); + + int flags; + if (DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)) + flags = 0xFFFFFF; + else + flags = CallProtoService(protoName, PS_GETCAPS,PFLAGNUM_2,0)&~CallProtoService(protoName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); + _snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName); + autoAwaySetting.lv1Status = DBGetContactSettingWord(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_AWAY))?ID_STATUS_AWAY:ID_STATUS_OFFLINE); + _snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName); + autoAwaySetting.lv2Status = DBGetContactSettingWord(NULL, MODULENAME, setting, (flags&StatusModeToProtoFlag(ID_STATUS_NA))?ID_STATUS_NA:ID_STATUS_OFFLINE); + + return 0; +} + +static int ProcessProtoAck(WPARAM wParam,LPARAM lParam) +{ + ACKDATA *ack = ( ACKDATA* )lParam; + if ( ack->type != ACKTYPE_STATUS ) + return 0; + if ( ack->result != ACKRESULT_SUCCESS ) + return 0; + log_debugA("ProcessProtoAck: ack->szModule: %s", ack->szModule); + for ( int i=0; i < autoAwaySettings.getCount(); i++ ) { + log_debugA("chk: %s", autoAwaySettings[i].szName); + if (!strcmp(autoAwaySettings[i].szName, ack->szModule)) { + log_debugA("ack->szModule: %s autoAwaySettings[i].statusChanged: %d", ack->szModule, autoAwaySettings[i].statusChanged); + if (!autoAwaySettings[i].statusChanged) + autoAwaySettings[i].mStatus = TRUE; + + autoAwaySettings[i].statusChanged = FALSE; + } } + + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Account control event + +int OnAccChanged(WPARAM wParam,LPARAM lParam) +{ + PROTOACCOUNT* pa = ( PROTOACCOUNT* )lParam; + switch( wParam ) { + case PRAC_ADDED: + autoAwaySettings.insert( new TAAAProtoSetting( pa )); + break; + + case PRAC_REMOVED: + { + for ( int i=0; i < autoAwaySettings.getCount(); i++ ) { + if ( !lstrcmpA( autoAwaySettings[i].szName, pa->szModuleName )) { + autoAwaySettings.remove( i ); + break; + } } } + break; + } + + return 0; +} + +/* this function is from the original auto-away module */ +static BOOL IsWorkstationLocked (void) +{ + BOOL rc = FALSE; + + if (openInputDesktop != NULL) { + HDESK hDesk = openInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP); + if (hDesk == NULL) + rc = TRUE; + else if (closeDesktop != NULL) + closeDesktop(hDesk); + } + return rc; +} + +static char* status2descr( int status ) +{ + switch( status ) { + case ACTIVE: return "ACTIVE"; + case STATUS1_SET: return "STATUS1_SET"; + case STATUS2_SET: return "STATUS2_SET"; + case SET_ORGSTATUS: return "SET_ORGSTATUS"; + case HIDDEN_ACTIVE: return "HIDDEN_ACTIVE"; + } + return "ERROR"; +} + +static int changeState(TAAAProtoSetting& setting, STATES newState) +{ + if (setting.curState == newState) + return 0; + + setting.oldState = setting.curState; + setting.curState = newState; + + log_debugA("%s state change: %s -> %s", setting.szName, + status2descr(setting.oldState), status2descr(setting.curState)); + + NotifyEventHooks(hStateChangedEvent, (WPARAM)0, (LPARAM)(AUTOAWAYSETTING*)&setting); + if ( setting.curState != SET_ORGSTATUS && setting.curState != ACTIVE && setting.statusChanged ) { + /* change the awaymessage */ + if (setting.szMsg != NULL) { + free(setting.szMsg); + setting.szMsg = NULL; + } + + if (DBGetContactSettingByte(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_MSGCUSTOM), FALSE)) { + DBVARIANT dbv; + if(!DBGetContactSetting(NULL, MODULENAME, StatusModeToDbSetting(setting.status, SETTING_STATUSMSG), &dbv)) { + setting.szMsg = _strdup(dbv.pszVal); + DBFreeVariant(&dbv); + } } + } + else if (setting.szMsg != NULL) { + free(setting.szMsg); + setting.szMsg = NULL; + } + + return 0; +} + +static VOID CALLBACK AutoAwayTimer(HWND hwnd,UINT message,UINT_PTR idEvent,DWORD dwTime) +{ + int statusChanged = FALSE; + int confirm = FALSE; + + for ( int i=0; i < autoAwaySettings.getCount(); i++ ) { + TAAAProtoSetting& aas = autoAwaySettings[i]; + aas.status = ID_STATUS_DISABLED; + + BOOL screenSaver = FALSE, locked = FALSE; + + if ( aas.optionFlags & FLAG_MONITORMIRANDA ) + mouseStationaryTimer = (GetTickCount() - lastMirandaInput)/1000; + else { + if (MyGetLastInputInfo!=NULL) { + LASTINPUTINFO lii = { 0 }; + lii.cbSize = sizeof(lii); + MyGetLastInputInfo(&lii); + mouseStationaryTimer = (GetTickCount()-lii.dwTime)/1000; + } + else mouseStationaryTimer = (GetTickCount() - lastInput)/1000; + } + + int sts1Time = aas.awayTime * SECS_PER_MINUTE; + int sts2Time = aas.naTime * SECS_PER_MINUTE; + int sts1setTime = aas.sts1setTimer==0?0:(GetTickCount() - aas.sts1setTimer)/1000; + int currentMode = CallProtoService(aas.szName,PS_GETSTATUS,0, 0); + if ( aas.optionFlags & FLAG_ONSAVER ) + SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, &screenSaver, FALSE); + + if (aas.optionFlags & FLAG_ONLOCK) + locked = IsWorkstationLocked(); + + /* check states */ + if (aas.curState == ACTIVE) { + if ((( mouseStationaryTimer >= sts1Time && (aas.optionFlags & FLAG_ONMOUSE)) || screenSaver || locked ) && currentMode != aas.lv1Status && aas.statusFlags&StatusModeToProtoFlag(currentMode)) { + /* from ACTIVE to STATUS1_SET */ + aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName,PS_GETSTATUS,0, 0); + aas.status = aas.lv1Status; + aas.sts1setTimer = GetTickCount(); + sts1setTime = 0; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, STATUS1_SET); + } + else if ( mouseStationaryTimer >= sts2Time && currentMode == aas.lv1Status && currentMode != aas.lv2Status && (aas.optionFlags & FLAG_SETNA) && (aas.statusFlags & StatusModeToProtoFlag(currentMode))) { + /* from ACTIVE to STATUS2_SET */ + aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName,PS_GETSTATUS,0, 0); + aas.status = aas.lv2Status; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, STATUS2_SET); + } } + + if (aas.curState == STATUS1_SET) { + if (( mouseStationaryTimer < sts1Time && !screenSaver && !locked ) && !(aas.optionFlags & FLAG_RESET )) { + /* from STATUS1_SET to HIDDEN_ACTIVE */ + changeState(aas, HIDDEN_ACTIVE); + aas.lastStatus = CallProtoService(aas.szName,PS_GETSTATUS,0, 0); + } + else if ( ((mouseStationaryTimer < sts1Time) && (!screenSaver) && (!locked)) && + ((aas.optionFlags&FLAG_LV2ONINACTIVE) || (!(aas.optionFlags&FLAG_SETNA))) && + (aas.optionFlags&FLAG_RESET) ) { + /* from STATUS1_SET to SET_ORGSTATUS */ + changeState(aas, SET_ORGSTATUS); + } + else if (( aas.optionFlags & FLAG_SETNA) && sts1setTime >= sts2Time ) { + /* when set STATUS2, currentMode doesn't have to be in the selected status list (statusFlags) */ + /* from STATUS1_SET to STATUS2_SET */ + aas.lastStatus = CallProtoService(aas.szName,PS_GETSTATUS,0, 0); + aas.status = aas.lv2Status; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, STATUS2_SET); + } } + + if ( aas.curState == STATUS2_SET ) { + if ( mouseStationaryTimer < sts2Time && !screenSaver && !locked && ( aas.optionFlags & FLAG_RESET )) { + /* from STATUS2_SET to SET_ORGSTATUS */ + changeState(aas, SET_ORGSTATUS); + } + else if ( mouseStationaryTimer < sts2Time && !screenSaver && !locked && !( aas.optionFlags & FLAG_RESET )) { + /* from STATUS2_SET to HIDDEN_ACTIVE */ + /* Remember: after status1 is set, and "only on inactive" is NOT set, it implies !reset. */ + changeState(aas, HIDDEN_ACTIVE); + aas.lastStatus = CallProtoService(aas.szName,PS_GETSTATUS,0, 0); + } } + + if ( aas.curState == HIDDEN_ACTIVE ) { + if ( aas.mStatus ) { + /* HIDDEN_ACTIVE to ACTIVE */ + //aas.statusChanged = FALSE; + changeState(aas, ACTIVE); + aas.sts1setTimer = 0; + aas.mStatus = FALSE; + } + else if (( aas.optionFlags & FLAG_SETNA ) && currentMode == aas.lv1Status && + currentMode != aas.lv2Status && (aas.statusFlags & StatusModeToProtoFlag(currentMode)) && + (mouseStationaryTimer >= sts2Time || (sts1setTime >= sts2Time && !(aas.optionFlags & FLAG_LV2ONINACTIVE )))) { + /* HIDDEN_ACTIVE to STATUS2_SET */ + aas.lastStatus = aas.originalStatusMode = CallProtoService(aas.szName,PS_GETSTATUS,0, 0); + aas.status = aas.lv2Status; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, STATUS2_SET); + } + } + if ( aas.curState == SET_ORGSTATUS ) { + /* SET_ORGSTATUS to ACTIVE */ + aas.lastStatus = CallProtoService(aas.szName,PS_GETSTATUS,0, 0); + aas.status = aas.originalStatusMode; + confirm = (aas.optionFlags&FLAG_CONFIRM)?TRUE:confirm; + aas.statusChanged = statusChanged = TRUE; + changeState(aas, ACTIVE); + aas.sts1setTimer = 0; + } + autoAwaySettings[i].mStatus = FALSE; + } + + if ( confirm || statusChanged ) { + OBJLIST ps = autoAwaySettings; + + int i; + for ( i=0; i < ps.getCount(); i++ ) { + if ( ps[i].szMsg ) + ps[i].szMsg = _strdup( ps[i].szMsg ); + + if (ps[i].status == ID_STATUS_DISABLED) + ps[i].szName = ""; + } + + if (confirm) + confirmDialog = (HWND)CallService(MS_CS_SHOWCONFIRMDLGEX, (WPARAM)&ps, DBGetContactSettingWord(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5)); + else if (statusChanged) + CallService(MS_CS_SETSTATUSEX, (WPARAM)&ps, 0); +} } + +///////////////////////////////////////////////////////////////////////////////////////// +// Windows hooks + +static int HookWindowsHooks(int hookMiranda, int hookAll) +{ + if (hookMiranda) { + if ( monitorKeyboard && hMirandaKeyBoardHook == NULL ) + hMirandaKeyBoardHook = SetWindowsHookEx(WH_KEYBOARD,MirandaKeyBoardHookFunction,NULL,GetCurrentThreadId()); + if ( monitorMouse && hMirandaMouseHook == NULL ) + hMirandaMouseHook = SetWindowsHookEx(WH_MOUSE,MirandaMouseHookFunction,NULL,GetCurrentThreadId()); + } + if (hookAll) { + MyGetLastInputInfo=NULL; + if ( monitorKeyboard && hKeyBoardHook == NULL ) + hKeyBoardHook = SetWindowsHookEx(WH_KEYBOARD,KeyBoardHookFunction,hInst,0); + if ( monitorMouse && hMouseHook == NULL ) + hMouseHook = SetWindowsHookEx(WH_MOUSE,MouseHookFunction,hInst,0); + } + + return 0; +} + +static int UnhookWindowsHooks() +{ + UnhookWindowsHookEx(hMouseHook); + UnhookWindowsHookEx(hKeyBoardHook); + UnhookWindowsHookEx(hMirandaMouseHook); + UnhookWindowsHookEx(hMirandaKeyBoardHook); + + hMouseHook = hKeyBoardHook = hMirandaMouseHook = hMirandaKeyBoardHook = NULL; + + return 0; +} + +static LRESULT CALLBACK MirandaMouseHookFunction(int code, WPARAM wParam, LPARAM lParam) +{ + if (code >= 0) { + PMOUSEHOOKSTRUCT mouseInfo = (PMOUSEHOOKSTRUCT)lParam; + POINT pt = mouseInfo->pt; + + /* TioDuke's KeyBoardNotifyExt: only update if a Miranda window is focused */ + DWORD pid; + GetWindowThreadProcessId(GetForegroundWindow(), &pid); + if (pid != GetCurrentProcessId()) + return CallNextHookEx(hMirandaMouseHook, code, wParam, lParam); + + if (pt.x!=lastMousePos.x || pt.y!=lastMousePos.y) { + lastMousePos = pt; + lastMirandaInput = GetTickCount(); + } } + + return CallNextHookEx(hMirandaMouseHook, code, wParam, lParam); +} + +static LRESULT CALLBACK MirandaKeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam) +{ + if (code >= 0) { + if (ignoreAltCombo) {//&& ((HIWORD(lParam)&KF_ALTDOWN) || (wParam == VK_MENU)) ) { + if ( ((GetKeyState(VK_MENU) < 0) || (wParam == VK_MENU)) || + ((GetKeyState(VK_TAB) < 0) || (wParam == VK_TAB)) || + ((GetKeyState(VK_SHIFT) < 0) || (wParam == VK_SHIFT)) || + ((GetKeyState(VK_CONTROL) < 0) || (wParam == VK_CONTROL)) || + ((GetKeyState(VK_ESCAPE) < 0) || (wParam == VK_ESCAPE)) || + ((GetKeyState(VK_LWIN) < 0) || (wParam == VK_LWIN)) || + ((GetKeyState(VK_RWIN) < 0) || (wParam == VK_RWIN)) ) { + return CallNextHookEx(hMirandaKeyBoardHook, code, wParam, lParam); + } + } + switch (wParam) { + case VK_NUMLOCK: + case VK_CAPITAL: + case VK_SCROLL: + if (!ignoreLockKeys) + lastMirandaInput = GetTickCount(); + break; + + case VK_TAB: + case VK_SHIFT: + case VK_CONTROL: + case VK_MENU: + case VK_ESCAPE: + case VK_LWIN: + case VK_RWIN: + if (!ignoreSysKeys) + lastMirandaInput = GetTickCount(); + break; + + default: + lastMirandaInput = GetTickCount(); + break; + } } + + return CallNextHookEx(hMirandaKeyBoardHook, code, wParam, lParam); +} + +static LRESULT CALLBACK MouseHookFunction(int code, WPARAM wParam, LPARAM lParam) +{ + if (code >= 0) { + PMOUSEHOOKSTRUCT mouseInfo = (PMOUSEHOOKSTRUCT)lParam; + POINT pt = mouseInfo->pt; + + /* TioDuke's KeyBoardNotifyExt: also grab clicks */ + if ((wParam >= WM_NCLBUTTONDOWN && wParam <= WM_NCXBUTTONDBLCLK && wParam != 0x00AA) || (wParam >= WM_LBUTTONDOWN && wParam <= WM_XBUTTONDBLCLK)) + lastInput = GetTickCount(); + + if (pt.x!=lastMousePos.x || pt.y!=lastMousePos.y) { + lastMousePos = pt; + lastInput = GetTickCount(); + } } + + return CallNextHookEx(hMouseHook, code, wParam, lParam); +} + +static LRESULT CALLBACK KeyBoardHookFunction(int code, WPARAM wParam, LPARAM lParam) +{ + if (code >= 0) { + if (ignoreAltCombo) {//&& ((HIWORD(lParam)&KF_ALTDOWN) || (wParam == VK_MENU)) ) { + if ( ((GetKeyState(VK_MENU) < 0) || (wParam == VK_MENU)) || + ((GetKeyState(VK_TAB) < 0) || (wParam == VK_TAB)) || + ((GetKeyState(VK_SHIFT) < 0) || (wParam == VK_SHIFT)) || + ((GetKeyState(VK_CONTROL) < 0) || (wParam == VK_CONTROL)) || + ((GetKeyState(VK_ESCAPE) < 0) || (wParam == VK_ESCAPE)) || + ((GetKeyState(VK_LWIN) < 0) || (wParam == VK_LWIN)) || + ((GetKeyState(VK_RWIN) < 0) || (wParam == VK_RWIN)) ) { + return CallNextHookEx(hKeyBoardHook, code, wParam, lParam); + } + } + switch (wParam) { + case VK_NUMLOCK: + case VK_CAPITAL: + case VK_SCROLL: + if (!ignoreLockKeys) + lastInput = GetTickCount(); + break; + + case VK_TAB: + case VK_SHIFT: + case VK_CONTROL: + case VK_MENU: + case VK_ESCAPE: + case VK_LWIN: + case VK_RWIN: + if (!ignoreSysKeys) + lastInput = GetTickCount(); + break; + + default: + lastInput = GetTickCount(); + break; + } } + + return CallNextHookEx(hKeyBoardHook, code, wParam, lParam); +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Inits & stuff + +static int AutoAwayShutdown(WPARAM wParam,LPARAM lParam) +{ + KillTimer(NULL, hAutoAwayTimer); + +#ifdef TRIGGERPLUGIN + DeInitTrigger(); +#endif + UnhookEvent(hAutoAwayOptionsHook); + UnhookEvent(hAutoAwayShutDownHook); + UnhookEvent(hAccChangeHook); + UnhookEvent(hProtoAckHook); + UnhookWindowsHooks(); + DestroyHookableEvent(hStateChangedEvent); + + autoAwaySettings.destroy(); + return 0; +} + +int CSModuleLoaded(WPARAM wParam, LPARAM lParam) +{ + HMODULE hUser32 = GetModuleHandleA("user32"); + openInputDesktop = ( pfnOpenInputDesktop )GetProcAddress (hUser32, "OpenInputDesktop"); + closeDesktop = ( pfnCloseDesktop )GetProcAddress (hUser32, "CloseDesktop"); + + if ( IsWinVer2000Plus() && !DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNLOCK, FALSE)) + MyGetLastInputInfo = (BOOL (WINAPI *)(PLASTINPUTINFO))GetProcAddress(GetModuleHandleA("user32"),"GetLastInputInfo"); + else + MyGetLastInputInfo = NULL; + + hAccChangeHook = HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccChanged); + hAutoAwayOptionsHook = HookEvent(ME_OPT_INITIALISE,AutoAwayOptInitialise); + hAutoAwayShutDownHook = HookEvent(ME_SYSTEM_OKTOEXIT,AutoAwayShutdown); + hProtoAckHook = HookEvent(ME_PROTO_ACK, ProcessProtoAck); + mouseStationaryTimer = 0; + lastInput = lastMirandaInput = GetTickCount(); + + //////////////////////////////////////////////////////////////////////////////////////// + + protoList = ( OBJLIST* )&autoAwaySettings; + + int count; + PROTOACCOUNT** protos; + ProtoEnumAccounts(&count, &protos); + + for( int i=0; i < count; i++ ) + if ( IsSuitableProto( protos[i] )) + autoAwaySettings.insert( new TAAAProtoSetting( protos[i] )); + + //////////////////////////////////////////////////////////////////////////////////////// + + LoadOptions(autoAwaySettings, FALSE); + +#ifdef TRIGGERPLUGIN + InitTrigger(); +#endif + + return 0; +} diff --git a/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h new file mode 100644 index 0000000000..93fc3ba8c7 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/advancedautoaway.h @@ -0,0 +1,95 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + 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 +*/ +#ifndef __ADVANCED_AUTOAWAY_HEADER +#define __ADVANCED_AUTOAWAY_HEADER + +#include +#include +#include "version.h" + +#define SETTING_IGNLOCK "IgnoreLockKeys" +#define SETTING_IGNSYSKEYS "IgnoreSysKeys" +#define SETTING_IGNALTCOMBO "IgnoreAltCombo" +#define SETTING_SAMESETTINGS "SameAutoAwaySettings" +#define SETTING_ALL "ALLPROTOS" +#define SETTING_MSGCUSTOM "Custom" +#define SETTING_STATUSMSG "Msg" +#define SETTING_CONFIRMDELAY "ConfirmTimeout" +#define MODULENAME "AdvancedAutoAway" + +#define SETTING_AWAYTIME_DEFAULT 5 +#define SETTING_NATIME_DEFAULT 20 +#define SETTING_AWAYCHECKTIMEINSECS "CheckInterval" + +#define STATUS_RESET 1 +#define STATUS_AUTOAWAY 2 +#define STATUS_AUTONA 3 + +#define SETTING_MONITORMOUSE "MonitorMouse" +#define SETTING_MONITORKEYBOARD "MonitorKeyboard" + +#define FLAG_ONSAVER 1 // db: set lv1 status on screensaver ? +#define FLAG_ONMOUSE 2 // db: set after inactivity ? +#define FLAG_SETNA 4 // db: set NA after xx of away time ? +#define FLAG_CONFIRM 8 // db: show confirm dialog ? +#define FLAG_RESET 16 // db: restore status ? +#define FLAG_LV2ONINACTIVE 32 // db: set lv2 only on inactivity +#define FLAG_MONITORMIRANDA 64 // db: monitor miranda activity only +#define FLAG_ONLOCK 128 // db: on work station lock + +struct TAAAProtoSetting : public PROTOCOLSETTINGEX +{ + TAAAProtoSetting( PROTOACCOUNT* pa ); + ~TAAAProtoSetting(); + + __inline void* operator new( size_t size ) { return calloc( 1, size ); } + __inline void operator delete( void* p ) { free( p ); } + + int originalStatusMode; + STATES + oldState, + curState; + BOOL statusChanged; // AAA changed the status, don't update mStatus + BOOL mStatus; // status changed manually or not ? + int optionFlags, // db: see above + awayTime, // db: time to wait for inactivity + naTime, // db: time to wait after away is set + statusFlags; // db: set lv1 status if this is original status + WORD lv1Status, // db + lv2Status; // db + unsigned int sts1setTimer; +}; + +struct AAMSGSETTING +{ + short useCustom; + int status; + char* msg; +}; + +extern HINSTANCE hInst; + +int CompareSettings( const TAAAProtoSetting* p1, const TAAAProtoSetting* p2 ); + +extern OBJLIST autoAwaySettings; + +int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName); +void LoadOptions(OBJLIST& settings, BOOL override); + +#endif diff --git a/plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg b/plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg new file mode 100644 index 0000000000..21066a3939 Binary files /dev/null and b/plugins/StatusPlugins/AdvancedAutoAway/fsm.jpg differ diff --git a/plugins/StatusPlugins/AdvancedAutoAway/fsm.sdr b/plugins/StatusPlugins/AdvancedAutoAway/fsm.sdr new file mode 100644 index 0000000000..490005533b Binary files /dev/null and b/plugins/StatusPlugins/AdvancedAutoAway/fsm.sdr differ diff --git a/plugins/StatusPlugins/AdvancedAutoAway/main.cpp b/plugins/StatusPlugins/AdvancedAutoAway/main.cpp new file mode 100644 index 0000000000..f9d1bd04d9 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/main.cpp @@ -0,0 +1,110 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + 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 + + + Some code is copied from Miranda's AutoAway module +*/ + +#include "../commonstatus.h" +#include "advancedautoaway.h" +#include "../resource.h" + +// {F0FDF73A-753D-499d-8DBA-336DB79CDD41} +#define MIID_ADVAUTOAWAY { 0xf0fdf73a, 0x753d, 0x499d, { 0x8d, 0xba, 0x33, 0x6d, 0xb7, 0x9c, 0xdd, 0x41 } } + +HINSTANCE hInst; +PLUGINLINK *pluginLink; + +MM_INTERFACE mmi; +LIST_INTERFACE li; + +HANDLE hCSModuleLoadedHook; +HANDLE hStateChangedEvent; +int hLangpack = 0; + +int CSModuleLoaded(WPARAM wParam, LPARAM lParam); + +///////////////////////////////////////////////////////////////////////////////////////// +// dll entry point + +BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + hInst = hinstDLL; + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// returns plugin's extended information + +PLUGININFOEX pluginInfoEx={ + sizeof(PLUGININFOEX), + #if defined( _UNICODE ) + __PLUGIN_NAME __PLATFORM_NAME " (Unicode)", + #else + __PLUGIN_NAME, + #endif + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESC, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + 0, + MIID_ADVAUTOAWAY +}; + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfoEx; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// returns plugin's interfaces information + +static const MUUID interfaces[] = { MIID_AUTOAWAY, MIID_LAST }; + +extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + return interfaces; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin's entry point + +extern "C" __declspec(dllexport) int Load(PLUGINLINK *link) +{ + pluginLink = link; + mir_getMMI(&mmi); + mir_getLI(&li); + mir_getLP( &pluginInfoEx ); + + InitCommonStatus(); + hCSModuleLoadedHook = HookEvent(ME_SYSTEM_MODULESLOADED, CSModuleLoaded); + hStateChangedEvent = CreateHookableEvent(ME_AAA_STATECHANGED); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// plugin's exit point + +extern "C" __declspec(dllexport) int Unload(void) +{ + DestroyHookableEvent( hStateChangedEvent ); + return 0; +} diff --git a/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp new file mode 100644 index 0000000000..9f0da411cc --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/msgoptions.cpp @@ -0,0 +1,165 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + 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 "../commonstatus.h" +#include "advancedautoaway.h" +#include "../resource.h" + +extern char *StatusModeToDbSetting(int status,const char *suffix); + +INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static AAMSGSETTING** settings; + static int last, count; + int i; + + switch( msg ) { + case WM_INITDIALOG: + TranslateDialogDefault( hwndDlg ); + { + ShowWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), ServiceExists(MS_VARS_SHOWHELP)?SW_SHOW:SW_HIDE); + count = 0; + last = -1; + + PROTOACCOUNT** proto; + int protoCount; + ProtoEnumAccounts(&protoCount, &proto); + CallService(MS_PROTO_ENUMPROTOCOLS,(WPARAM)&protoCount,(LPARAM)&proto); + + DWORD protoModeMsgFlags = 0; + for( i=0; i < protoCount; i++ ) { + if ( (!(CallProtoService(proto[i]->szModuleName, PS_GETCAPS, (WPARAM)PFLAGNUM_1, 0) & PF1_MODEMSGSEND & ~PF1_INDIVMODEMSG)) ) + continue; + + protoModeMsgFlags |= CallProtoService( proto[i]->szModuleName, PS_GETCAPS, PFLAGNUM_3, 0 ); + } + settings = ( AAMSGSETTING** )malloc(sizeof(AAMSGSETTING*)); + count = 0; + for( i=0; i < SIZEOF(statusModeList); i++ ) { + if ( !( protoModeMsgFlags & Proto_Status2Flag( statusModeList[i] ))) + continue; + + int j = SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_ADDSTRING,0,(LPARAM)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,statusModeList[i],GSMDF_TCHAR)); + SendDlgItemMessage( hwndDlg, IDC_STATUS, CB_SETITEMDATA, j, statusModeList[i] ); + settings = ( AAMSGSETTING** )realloc(settings, (count+1)*sizeof(AAMSGSETTING*)); + settings[count] = ( AAMSGSETTING* )malloc(sizeof(AAMSGSETTING)); + settings[count]->status = statusModeList[i]; + + DBVARIANT dbv; + if ( !DBGetContactSetting(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i],SETTING_STATUSMSG), &dbv)) { + settings[count]->msg = ( char* )malloc(strlen(dbv.pszVal) + 1); + strcpy(settings[count]->msg, dbv.pszVal); + DBFreeVariant(&dbv); + } + else settings[count]->msg = NULL; + + settings[count]->useCustom = DBGetContactSettingByte(NULL, MODULENAME, StatusModeToDbSetting(statusModeList[i], SETTING_MSGCUSTOM), FALSE); + count += 1; + } + SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_SETCURSEL,0,0); + SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE),0); + } + break; + + case WM_COMMAND: + if ( ((HIWORD(wParam) == EN_CHANGE) || (HIWORD(wParam) == BN_CLICKED)) && ((HWND)lParam == GetFocus()) ) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + switch(LOWORD(wParam)) { + case IDC_RADUSEMIRANDA: + CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, !IsDlgButtonChecked(hwndDlg, IDC_RADUSEMIRANDA)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + settings[SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0)]->useCustom = IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM); + break; + + case IDC_RADUSECUSTOM: + CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, !IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM)); + settings[SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0)]->useCustom = IsDlgButtonChecked(hwndDlg, IDC_RADUSECUSTOM); + break; + + case IDC_STATUS: + if ( HIWORD( wParam ) == CBN_SELCHANGE ) { + i = SendDlgItemMessage(hwndDlg,IDC_STATUS,CB_GETCURSEL,0,0); + int len = SendDlgItemMessage(hwndDlg, IDC_STATUSMSG, WM_GETTEXTLENGTH, 0, 0); + if ( last != -1 ) { + if (settings[last]->msg == NULL) + settings[last]->msg = ( char* )malloc(len+1); + else + settings[last]->msg = ( char* )realloc(settings[last]->msg, len+1); + SendDlgItemMessageA(hwndDlg, IDC_STATUSMSG, WM_GETTEXT, (LPARAM)(len+1), (WPARAM)settings[last]->msg); + } + if (i != -1) { + if (settings[i]->msg != NULL) + SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, settings[i]->msg); + else if (ServiceExists(MS_AWAYMSG_GETSTATUSMSG)) { + char* msg = (char*)CallService(MS_AWAYMSG_GETSTATUSMSG, (WPARAM)settings[i]->status, 0); + if (msg != NULL) { + SetDlgItemTextA(hwndDlg, IDC_STATUSMSG, msg); + mir_free(msg); + } + } + if (settings[i]->useCustom) { + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), TRUE); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), TRUE); + CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, TRUE); + CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, FALSE); + } + else { + EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSMSG), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLESHELP), FALSE); + CheckDlgButton(hwndDlg, IDC_RADUSEMIRANDA, TRUE); + CheckDlgButton(hwndDlg, IDC_RADUSECUSTOM, FALSE); + } } + last = i; + } + break; + + case IDC_VARIABLESHELP: + CallService(MS_VARS_SHOWHELP, (WPARAM)GetDlgItem(hwndDlg, IDC_STATUSMSG), 0); + break; + } + break; + + case WM_NOTIFY: + switch (((LPNMHDR)lParam)->code) { + case PSN_APPLY: + SendMessage(hwndDlg,WM_COMMAND,MAKEWPARAM(IDC_STATUS,CBN_SELCHANGE),0); + for ( i=0; i < count; i++ ) { + DBWriteContactSettingByte(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_MSGCUSTOM), (BYTE)settings[i]->useCustom); + if ( (settings[i]->useCustom) && (settings[i]->msg != NULL) && (strlen(settings[i]->msg) > 0) ) + DBWriteContactSettingString(NULL, MODULENAME, StatusModeToDbSetting(settings[i]->status,SETTING_STATUSMSG), settings[i]->msg); + } + break; + } + break; + + case WM_DESTROY: + for ( i=0; i < count; i++ ) { + if (settings[i]->msg != NULL) + free(settings[i]->msg); + free(settings[i]); + } + free(settings); + break; + } + + return FALSE; +} diff --git a/plugins/StatusPlugins/AdvancedAutoAway/options.cpp b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp new file mode 100644 index 0000000000..7266bf5aaa --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/options.cpp @@ -0,0 +1,553 @@ +/* + AdvancedAutoAway Plugin for Miranda-IM (www.miranda-im.org) + Copyright 2003-2006 P. Boon + + 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 "../commonstatus.h" +#include "advancedautoaway.h" +#include "../resource.h" +#include + +static BOOL (WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0; + +// Thanks to TioDuke for cleaning up the ListView handling +#ifndef ListView_GetCheckState +#define ListView_GetCheckState(w,i) ((((UINT)(SNDMSG((w),LVM_GETITEMSTATE,(WPARAM)(i),LVIS_STATEIMAGEMASK)))>>12)-1) +#endif +#ifndef ListView_SetCheckState +#define ListView_SetCheckState(w,i,f) ListView_SetItemState(w,i,INDEXTOSTATEIMAGEMASK((f)+1),LVIS_STATEIMAGEMASK) +#endif + +static OBJLIST optionSettings( 10, CompareSettings ); + +int LoadAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName); + +INT_PTR CALLBACK DlgProcAutoAwayMsgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); + +static BOOL bSettingSame = FALSE; + +///////////////////////////////////////////////////////////////////////////////////////// +// Dialog service functions + +static int WriteAutoAwaySetting(TAAAProtoSetting& autoAwaySetting, char* protoName) +{ + char setting[128]; + mir_snprintf(setting, sizeof(setting), "%s_OptionFlags", protoName); + DBWriteContactSettingByte(NULL,MODULENAME,setting,(BYTE)autoAwaySetting.optionFlags); + mir_snprintf(setting, sizeof(setting), "%s_AwayTime", protoName); + DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.awayTime); + mir_snprintf(setting, sizeof(setting), "%s_NATime", protoName); + DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.naTime); + mir_snprintf(setting, sizeof(setting), "%s_StatusFlags", protoName); + DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.statusFlags); + mir_snprintf(setting, sizeof(setting), "%s_Lv1Status", protoName); + DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.lv1Status); + mir_snprintf(setting, sizeof(setting), "%s_Lv2Status", protoName); + DBWriteContactSettingWord(NULL,MODULENAME,setting,(WORD)autoAwaySetting.lv2Status); + + return 0; +} + +static void SetDialogItems(HWND hwndDlg, TAAAProtoSetting* setting) +{ + CheckDlgButton(hwndDlg, IDC_SCREENSAVE, setting->optionFlags&FLAG_ONSAVER ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ONLOCK, setting->optionFlags&FLAG_ONLOCK ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_TIMED, setting->optionFlags&FLAG_ONMOUSE ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SETNA, setting->optionFlags&FLAG_SETNA ? BST_CHECKED : BST_UNCHECKED); + SetDlgItemInt(hwndDlg,IDC_AWAYTIME, setting->awayTime,FALSE); + SetDlgItemInt(hwndDlg,IDC_NATIME, setting->naTime,FALSE); + CheckDlgButton(hwndDlg, IDC_CONFIRM, setting->optionFlags&FLAG_CONFIRM ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_RESETSTATUS, setting->optionFlags&FLAG_RESET ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MONITORMIRANDA, setting->optionFlags&FLAG_MONITORMIRANDA ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_LV2ONINACTIVE, setting->optionFlags&FLAG_LV2ONINACTIVE ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwndDlg,IDC_SETNA),IsDlgButtonChecked(hwndDlg,IDC_TIMED)); + EnableWindow(GetDlgItem(hwndDlg,IDC_LV2ONINACTIVE),(IsDlgButtonChecked(hwndDlg,IDC_TIMED)) && (IsDlgButtonChecked(hwndDlg,IDC_SETNA))); + EnableWindow(GetDlgItem(hwndDlg,IDC_MONITORMIRANDA),IsDlgButtonChecked(hwndDlg,IDC_TIMED)); + EnableWindow(GetDlgItem(hwndDlg,IDC_AWAYTIME),IsDlgButtonChecked(hwndDlg,IDC_TIMED)); + EnableWindow(GetDlgItem(hwndDlg,IDC_LV1AFTERSTR),IsDlgButtonChecked(hwndDlg,IDC_TIMED)); + EnableWindow(GetDlgItem(hwndDlg,IDC_LV1STATUS),IsDlgButtonChecked(hwndDlg,IDC_TIMED)||IsDlgButtonChecked(hwndDlg,IDC_SCREENSAVE)); + EnableWindow(GetDlgItem(hwndDlg,IDC_STATUSLIST),IsDlgButtonChecked(hwndDlg,IDC_TIMED)||IsDlgButtonChecked(hwndDlg,IDC_SCREENSAVE)); + EnableWindow(GetDlgItem(hwndDlg,IDC_RESETSTATUS),(IsDlgButtonChecked(hwndDlg,IDC_TIMED)||IsDlgButtonChecked(hwndDlg,IDC_SCREENSAVE))&&(IsDlgButtonChecked(hwndDlg, IDC_LV2ONINACTIVE))); + EnableWindow(GetDlgItem(hwndDlg,IDC_CONFIRM),(IsDlgButtonChecked(hwndDlg,IDC_TIMED)||IsDlgButtonChecked(hwndDlg,IDC_SCREENSAVE))&&(IsDlgButtonChecked(hwndDlg, IDC_LV2ONINACTIVE)&&(IsDlgButtonChecked(hwndDlg,IDC_RESETSTATUS)))); + EnableWindow(GetDlgItem(hwndDlg,IDC_NATIME),IsDlgButtonChecked(hwndDlg,IDC_SETNA)&&IsDlgButtonChecked(hwndDlg,IDC_TIMED)); + EnableWindow(GetDlgItem(hwndDlg,IDC_SETNASTR),IsDlgButtonChecked(hwndDlg,IDC_SETNA)&&IsDlgButtonChecked(hwndDlg,IDC_TIMED)); + EnableWindow(GetDlgItem(hwndDlg,IDC_SETNASTR),IsDlgButtonChecked(hwndDlg,IDC_SETNA)&&IsDlgButtonChecked(hwndDlg,IDC_TIMED)); + EnableWindow(GetDlgItem(hwndDlg,IDC_LV2STATUS),IsDlgButtonChecked(hwndDlg,IDC_SETNA)&&IsDlgButtonChecked(hwndDlg,IDC_TIMED)); + EnableWindow(GetDlgItem(hwndDlg,IDC_PROTOCOL), !bSettingSame);//DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, FALSE)); +} + +static TAAAProtoSetting* GetSetting(HWND hwndDlg, TAAAProtoSetting* sameSetting) +{ + if ( bSettingSame ) + return sameSetting; + + int iItem = SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_GETCURSEL, 0, 0); + if ( iItem == -1 ) + return NULL; + + INT_PTR iData = (INT_PTR)SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, CB_GETITEMDATA, iItem, 0); + return ( iData == -1 ) ? NULL : (TAAAProtoSetting*)iData; +} + +static void SetDialogStatus(HWND hwndDlg, TAAAProtoSetting* sameSetting) +{ + TAAAProtoSetting* setting = GetSetting(hwndDlg, sameSetting); + if ( setting ) { + + // create columns + HWND hList = GetDlgItem(hwndDlg,IDC_STATUSLIST); + ListView_SetExtendedListViewStyleEx(hList, LVS_EX_FULLROWSELECT|LVS_EX_CHECKBOXES, LVS_EX_FULLROWSELECT|LVS_EX_CHECKBOXES); + + LVCOLUMN lvCol = { 0 }; + lvCol.mask = LVCF_WIDTH|LVCF_TEXT; + lvCol.pszText = TranslateT("Status"); + lvCol.cx = 118; + ListView_InsertColumn(hList, 0, &lvCol); + + // get pointer to settings + SetDialogItems(hwndDlg, setting); +} } + + +///////////////////////////////////////////////////////////////////////////////////////// +// Rules dialog window procedure + +static INT_PTR CALLBACK DlgProcAutoAwayRulesOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static TAAAProtoSetting* sameSetting; + static int init; + + switch (msg) { + case WM_INITDIALOG: + init = TRUE; + TranslateDialogDefault(hwndDlg); + + // copy the settings + optionSettings = autoAwaySettings; + + sameSetting = ( TAAAProtoSetting* )malloc(sizeof(TAAAProtoSetting)); + LoadAutoAwaySetting(*sameSetting, SETTING_ALL); + + // fill list from currentProtoSettings + { + for ( int i=0; i < optionSettings.getCount(); i++ ) { + TAAAProtoSetting& p = optionSettings[i]; + int item = SendDlgItemMessage( hwndDlg, IDC_PROTOCOL, CB_ADDSTRING, 0, ( LPARAM )p.tszAccName ); + SendDlgItemMessage( hwndDlg, IDC_PROTOCOL, CB_SETITEMDATA, item, (LPARAM)&p ); + } + } + // set cursor to first protocol + SendDlgItemMessage(hwndDlg,IDC_PROTOCOL,CB_SETCURSEL,0,0); + + // status list + SetDialogStatus(hwndDlg, sameSetting); + + SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_PROTOCOL, (LPARAM)0x11111111); + init = FALSE; + break; + + case WM_COMMAND: + if (( HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED ) && (HWND)lParam == GetFocus()) + SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + { + TAAAProtoSetting* setting = GetSetting(hwndDlg, sameSetting); + if ( !setting ) + break; + + switch(LOWORD(wParam)) { + case IDC_PROTOCOL: + // status listview + { + int i, flags; + LVITEM lvItem; + HWND hList=GetDlgItem(hwndDlg,IDC_STATUSLIST); + + init = TRUE; + ListView_DeleteAllItems(hList); + memset(&lvItem,0,sizeof(lvItem)); + lvItem.mask=LVIF_TEXT|LVIF_PARAM; + lvItem.cchTextMax = 256; + lvItem.iItem=0; + lvItem.iSubItem=0; + if (!bSettingSame) + flags = CallProtoService(setting->szName, PS_GETCAPS,PFLAGNUM_2,0)&~CallProtoService(setting->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); + else + flags = 0; + for(i=0;istatusFlags&statusModePf2List[i]?TRUE:FALSE); + lvItem.iItem++; + } + } + init = FALSE; + } + // status dropdown boxes + { + int i, item; + int flags; + if (!bSettingSame) + flags = CallProtoService(setting->szName, PS_GETCAPS,PFLAGNUM_2,0)&~CallProtoService(setting->szName, PS_GETCAPS, (WPARAM)PFLAGNUM_5, 0); + else + flags = 0; + + // clear box and add new status, loop status and check if compatible with proto + SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0); + SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_RESETCONTENT, (WPARAM)0, (LPARAM)0); + for ( i=0; i < SIZEOF(statusModeList); i++ ) { + if ( (flags & statusModePf2List[i]) || statusModePf2List[i] == PF2_OFFLINE || bSettingSame ) { + TCHAR *statusMode = ( TCHAR* )CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, statusModeList[i], GSMDF_TCHAR ); + item = SendDlgItemMessage(hwndDlg,IDC_LV1STATUS,CB_ADDSTRING,0,(LPARAM)statusMode); + item = SendDlgItemMessage(hwndDlg,IDC_LV2STATUS,CB_ADDSTRING,0,(LPARAM)statusMode); + SendDlgItemMessage(hwndDlg,IDC_LV1STATUS,CB_SETITEMDATA,item,(LPARAM)statusModeList[i]); + SendDlgItemMessage(hwndDlg,IDC_LV2STATUS,CB_SETITEMDATA,item,(LPARAM)statusModeList[i]); + if (statusModeList[i] == setting->lv1Status) { + SendDlgItemMessage(hwndDlg,IDC_LV1STATUS,CB_SETCURSEL,(WPARAM)item,0); + + TCHAR setNaStr[256]; + mir_sntprintf( setNaStr, SIZEOF(setNaStr), TranslateT("minutes of %s mode"), statusMode ); + SetDlgItemText( hwndDlg, IDC_SETNASTR, setNaStr ); + } + if (statusModeList[i] == setting->lv2Status) + SendDlgItemMessage(hwndDlg,IDC_LV2STATUS,CB_SETCURSEL,(WPARAM)item,0); + } + } + } + SetDialogItems(hwndDlg, setting); + break; + + case IDC_LV1STATUS: + if (HIWORD(wParam) == CBN_SELCHANGE) + SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + + setting->lv1Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV1STATUS, CB_GETCURSEL, 0, 0), 0); + { + TCHAR setNaStr[256]; + mir_sntprintf(setNaStr, SIZEOF(setNaStr), TranslateT("minutes of %s mode"), + CallService( MS_CLIST_GETSTATUSMODEDESCRIPTION, setting->lv1Status, GSMDF_TCHAR )); + SetDlgItemText(hwndDlg,IDC_SETNASTR,setNaStr); + } + break; + + case IDC_LV2STATUS: + if (HIWORD(wParam) == CBN_SELCHANGE) + SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + + setting->lv2Status = (int)SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_LV2STATUS, CB_GETCURSEL, 0, 0), 0); + break; + + case IDC_SCREENSAVE: + setting->optionFlags^=FLAG_ONSAVER; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_ONLOCK: + setting->optionFlags^=FLAG_ONLOCK; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_TIMED: + setting->optionFlags^=FLAG_ONMOUSE; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_SETNA: + setting->optionFlags^=FLAG_SETNA; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_AWAYTIME: + setting->awayTime = GetDlgItemInt(hwndDlg,IDC_AWAYTIME, NULL, FALSE); + break; + + case IDC_NATIME: + setting->naTime = GetDlgItemInt(hwndDlg,IDC_NATIME, NULL, FALSE); + break; + + case IDC_LV2ONINACTIVE: + setting->optionFlags^=FLAG_LV2ONINACTIVE; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_CONFIRM: + setting->optionFlags^=FLAG_CONFIRM; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_RESETSTATUS: + setting->optionFlags^=FLAG_RESET; + SetDialogItems(hwndDlg, setting); + break; + + case IDC_MONITORMIRANDA: + setting->optionFlags^=FLAG_MONITORMIRANDA; + SetDialogItems(hwndDlg, setting); + break; + } + break; + } + + case WM_SHOWWINDOW: + init = TRUE; + { + TAAAProtoSetting* setting = GetSetting(hwndDlg, sameSetting); + if ( setting ) + SetDialogItems(hwndDlg, setting); + } + SendMessage(hwndDlg, WM_COMMAND, (WPARAM)IDC_PROTOCOL, (LPARAM)0x11111111); + init = FALSE; + break; + + case WM_NOTIFY: + switch(((NMHDR*)lParam)->idFrom) { + case IDC_STATUSLIST: + if (init) + break; + + switch(((NMHDR*)lParam)->code) { + case LVN_ITEMCHANGED: + { + NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam; + if (IsWindowVisible(GetDlgItem(hwndDlg,IDC_STATUSLIST)) && ((nmlv->uNewState^nmlv->uOldState)&LVIS_STATEIMAGEMASK)) { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + TAAAProtoSetting* setting = GetSetting(hwndDlg, sameSetting); + if ( setting ) { + HWND hList=GetDlgItem(hwndDlg,IDC_STATUSLIST); + LVITEM lvItem = { 0 }; + lvItem.mask = LVIF_PARAM; + lvItem.iItem = nmlv->iItem; + ListView_GetItem(hList, &lvItem); + int pf2Status = lvItem.lParam; + if (ListView_GetCheckState(hList, lvItem.iItem)) + setting->statusFlags |= pf2Status; + else + setting->statusFlags &= ~pf2Status; + } + } + } + break; + } + break; + } + + switch (((LPNMHDR)lParam)->code) { + case PSN_APPLY: + if (bSettingSame) + WriteAutoAwaySetting(*sameSetting, SETTING_ALL); + else { + for (int i=0; i < optionSettings.getCount(); i++ ) + WriteAutoAwaySetting(optionSettings[i], optionSettings[i].szName); + } + LoadOptions(autoAwaySettings, FALSE); + } + break; + + case WM_DESTROY: + optionSettings.destroy(); + free(sameSetting); + break; + } + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// General options window procedure + +static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + CheckDlgButton(hwndDlg, IDC_IGNLOCK, DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNLOCK, FALSE)?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_IGNSYSKEYS, DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNSYSKEYS, FALSE)?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_IGNALTCOMBO, DBGetContactSettingByte(NULL, MODULENAME, SETTING_IGNALTCOMBO, FALSE)?BST_CHECKED:BST_UNCHECKED); + SetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, DBGetContactSettingWord(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, 5), FALSE); + SetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, DBGetContactSettingWord(NULL, MODULENAME, SETTING_CONFIRMDELAY, 5), FALSE); + CheckDlgButton(hwndDlg, bSettingSame?IDC_SAMESETTINGS:IDC_PERPROTOCOLSETTINGS, BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, DBGetContactSettingByte(NULL, MODULENAME, SETTING_MONITORMOUSE, TRUE)?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, DBGetContactSettingByte(NULL, MODULENAME, SETTING_MONITORKEYBOARD, TRUE)?BST_CHECKED:BST_UNCHECKED); + ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (DBGetContactSettingByte(NULL, "Idle", "AAEnable", 0))); + break; + + case WM_SHOWWINDOW: + ShowWindow(GetDlgItem(hwndDlg, IDC_IDLEWARNING), (DBGetContactSettingByte(NULL, "Idle", "AAEnable", 0))); + break; + + case WM_COMMAND: + if (( HIWORD(wParam) == EN_CHANGE || HIWORD(wParam) == BN_CLICKED ) && (HWND)lParam == GetFocus() ) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + + switch(LOWORD(wParam)) { + case IDC_MONITORMOUSE: + CheckDlgButton(hwndDlg, IDC_MONITORMOUSE, (((!IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))&&(!IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)))||(IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))?BST_CHECKED:BST_UNCHECKED)); + break; + + case IDC_MONITORKEYBOARD: + CheckDlgButton(hwndDlg, IDC_MONITORKEYBOARD, (((!IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE))&&(!IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)))||(IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD))?BST_CHECKED:BST_UNCHECKED)); + break; + + case IDC_SAMESETTINGS: + case IDC_PERPROTOCOLSETTINGS: + bSettingSame = IsDlgButtonChecked(hwndDlg, IDC_SAMESETTINGS); + break; + } + break; + + case WM_NOTIFY: + if (((LPNMHDR)lParam)->code == PSN_APPLY ) { + DBWriteContactSettingByte(NULL, MODULENAME, SETTING_IGNLOCK, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNLOCK)); + DBWriteContactSettingByte(NULL, MODULENAME, SETTING_IGNSYSKEYS, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNSYSKEYS)); + DBWriteContactSettingByte(NULL, MODULENAME, SETTING_IGNALTCOMBO, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_IGNALTCOMBO)); + DBWriteContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, (BYTE)bSettingSame); + DBWriteContactSettingWord(NULL, MODULENAME, SETTING_AWAYCHECKTIMEINSECS, (WORD)GetDlgItemInt(hwndDlg, IDC_AWAYCHECKTIMEINSECS, NULL, FALSE)); + DBWriteContactSettingWord(NULL, MODULENAME, SETTING_CONFIRMDELAY, (WORD)GetDlgItemInt(hwndDlg, IDC_CONFIRMDELAY, NULL, FALSE)); + DBWriteContactSettingByte(NULL, MODULENAME, SETTING_MONITORMOUSE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORMOUSE)); + DBWriteContactSettingByte(NULL, MODULENAME, SETTING_MONITORKEYBOARD, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MONITORKEYBOARD)); + LoadOptions(autoAwaySettings, FALSE); + } + break; + } + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Tab window procedure + +static INT_PTR CALLBACK DlgProcAutoAwayTabs(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) { + case WM_INITDIALOG: + { + int tabCount; + HWND hTab, hShow, hPage; + TCITEM tci; + RECT rcTabs, rcOptions, rcPage; + + TranslateDialogDefault(hwndDlg); + bSettingSame = DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, FALSE); + // set tabs + tabCount = 0; + hTab = GetDlgItem(hwndDlg, IDC_TABS); + GetWindowRect(hTab, &rcTabs); + GetWindowRect(hwndDlg, &rcOptions); + ZeroMemory(&tci, sizeof(TCITEM)); + // general tab + tci.mask = TCIF_TEXT|TCIF_PARAM; + tci.pszText = TranslateT("General"); + hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_GENAUTOAWAY), hwndDlg, DlgProcAutoAwayGeneralOpts, (LPARAM)GetParent(hwndDlg)); + if (pfnEnableThemeDialogTexture) + pfnEnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + + tci.lParam = (LPARAM)hPage; + GetClientRect(hPage, &rcPage); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + ShowWindow(hPage, SW_HIDE); + TabCtrl_InsertItem(hTab, tabCount++, &tci); + hShow = hPage; + // rules tab + tci.mask = TCIF_TEXT|TCIF_PARAM; + tci.pszText = TranslateT("Rules"); + hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAY), hwndDlg, DlgProcAutoAwayRulesOpts, (LPARAM)GetParent(hwndDlg)); + if (pfnEnableThemeDialogTexture) + pfnEnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + + tci.lParam = (LPARAM)hPage; + GetClientRect(hPage, &rcPage); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + ShowWindow(hPage, SW_HIDE); + TabCtrl_InsertItem(hTab, tabCount++, &tci); + // messages tab + tci.mask = TCIF_TEXT|TCIF_PARAM; + tci.pszText = TranslateT("Status Messages"); + hPage = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_OPT_AUTOAWAYMSG), hwndDlg, DlgProcAutoAwayMsgOpts, (LPARAM)GetParent(hwndDlg)); + if (pfnEnableThemeDialogTexture) + pfnEnableThemeDialogTexture(hPage, ETDT_ENABLETAB); + + tci.lParam = (LPARAM)hPage; + GetClientRect(hPage, &rcPage); + MoveWindow(hPage, (rcTabs.left - rcOptions.left) + ((rcTabs.right-rcTabs.left)-(rcPage.right-rcPage.left))/2, 10 + (rcTabs.top - rcOptions.top) + ((rcTabs.bottom-rcTabs.top)-(rcPage.bottom-rcPage.top))/2, rcPage.right-rcPage.left, rcPage.bottom-rcPage.top, TRUE); + ShowWindow(hPage, SW_HIDE); + TabCtrl_InsertItem(hTab, tabCount++, &tci); + + ShowWindow(hShow, SW_SHOW); + } + break; + + case PSM_CHANGED: + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + + case WM_NOTIFY: + if ( (((NMHDR*)lParam)->idFrom == IDC_TABS) ) { + if (((NMHDR*)lParam)->code == TCN_SELCHANGING) { + TCITEM tci; + + tci.mask = TCIF_PARAM; + TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); + ShowWindow((HWND)tci.lParam, SW_HIDE); + } + else if (((NMHDR*)lParam)->code == TCN_SELCHANGE) { + TCITEM tci; + + tci.mask = TCIF_PARAM; + TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_TABS), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TABS)), &tci); + ShowWindow((HWND)tci.lParam, SW_SHOW); + } + } + if (((LPNMHDR)lParam)->code == PSN_APPLY) { + TCITEM tci; + int i, count; + + tci.mask = TCIF_PARAM; + count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_TABS)); + for (i=0; i < count; i++ ) { + TabCtrl_GetItem(GetDlgItem(hwndDlg,IDC_TABS), i, &tci); + SendMessage((HWND)tci.lParam, WM_NOTIFY, 0, lParam); + } } + + break; + } + + return FALSE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// Options initialization procedure + +int AutoAwayOptInitialise(WPARAM wParam,LPARAM lParam) +{ + HMODULE hUxTheme = NULL; + if(IsWinVerXPPlus()) { + hUxTheme = GetModuleHandle(_T("uxtheme.dll")); + if (hUxTheme) + pfnEnableThemeDialogTexture = (BOOL (WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture"); + } + + OPTIONSDIALOGPAGE odp = { 0 }; + odp.cbSize = sizeof(odp); + odp.position = 1000000000; + odp.hInstance = hInst; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TABS); + odp.pszTitle = LPGEN("Auto Away"); + odp.pszGroup = LPGEN("Status"); + odp.pfnDlgProc = DlgProcAutoAwayTabs; + odp.flags = ODPF_BOLDGROUPS; + CallService( MS_OPT_ADDPAGE, wParam, (LPARAM)&odp ); + return 0; +} diff --git a/plugins/StatusPlugins/AdvancedAutoAway/pack.cmd b/plugins/StatusPlugins/AdvancedAutoAway/pack.cmd new file mode 100644 index 0000000000..fb55ba37f6 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/pack.cmd @@ -0,0 +1,42 @@ +@echo off +set PluginName=AdvancedAutoAway +nmake -f %PluginName%.mak CFG="%PluginName% - Win32 Release" +nmake -f %PluginName%.mak CFG="%PluginName% - Win32 Release Unicode" +if errorlevel 1 ( + echo "Make failed" + goto :eof ) + +del "%temp%\%PluginName%.zip" > nul +del "%temp%\%PluginName%W.zip" > nul +del "%temp%\%PluginName%Src.zip" > nul +del *.user > nul + +rd /S /Q Release +rd /S /Q Release_Unicode + +for /F "tokens=1-6 delims=, " %%i in (buildnumber.h) do call :Translate %%i %%j %%k %%l %%m %%n + +"%PROGRAMFILES%\7-zip\7z.exe" a -tzip -r- -mx=9 "%temp%\%PluginName%.zip" ../../../bin/Release/Plugins/%PluginName%.dll ../statusplugins-translation.txt ../m_statusplugins.h +del ../../../bin/Release/Plugins/%PluginName%.dll >nul + +"%PROGRAMFILES%\7-zip\7z.exe" a -tzip -r- -mx=9 "%temp%\%PluginName%W.zip" "../../../bin/Release Unicode/Plugins/%PluginName%.dll" ../statusplugins-translation.txt ../m_statusplugins.h +del "../../../bin/Release Unicode/Plugins/%PluginName%.dll" >nul + +if exist "%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" ( + "%PROGRAMFILES%\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe" AdvancedAutoAway_9.vcproj /Build "Release Unicode|x64" + copy "Release Unicode64\Plugins\%PluginName%.dll" . + "%PROGRAMFILES%\7-zip\7z.exe" a -tzip -r0 -mx=9 "%temp%\%PluginName%64.zip" %PluginName%.dll ../statusplugins-translation.txt ../m_statusplugins.h + del %PluginName%.dll + rd /S /Q "Release Unicode64" ) + +cd ../.. +"%PROGRAMFILES%\7-zip\7z.exe" a -tzip -r0 -mx=9 "%temp%\%PluginName%Src.zip" -ir!helpers/*.* -ir!StatusPlugins/*.* -ir!NewTriggerPlugin/*.* -xr!StatusPlugins/KeepStatus/* -xr!StatusPlugins/StartupStatus/* -xr!.svn -x!*.cmd +goto :eof + +:Translate +if %2 == __FILEVERSION_STRING ( + pushd .. + perl lpgen.pl status version %3 %4 %5 %6 + popd) + +goto :eof diff --git a/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp b/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp new file mode 100644 index 0000000000..e803c2dab4 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.cpp @@ -0,0 +1,161 @@ +#include "../commonstatus.h" +#include "advancedautoaway.h" +#include +#include "trigger_aaa.h" +#include "../resource.h" + +extern HINSTANCE hInst; +static HANDLE hAAAStateChangedHook; + +static int AAAStateChanged(WPARAM wParam, LPARAM lParam) { + + AUTOAWAYSETTING *aas; + DWORD triggerID; + REPORTINFO ri; + TRIGGERDATA td; + BOOL bReport; + + aas = (AUTOAWAYSETTING *)lParam; + triggerID = 0; + do { + triggerID = (DWORD)CallService(MS_TRIGGER_FINDNEXTTRIGGERID, triggerID, (LPARAM)TRIGGERNAME); + if (triggerID == 0) { + continue; + } + bReport = FALSE; + switch (aas->curState) { + case STATUS1_SET: + if (DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_ENTERFIRST, 0)) { + bReport = TRUE; + } + break; + case STATUS2_SET: + if (DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_ENTERSECOND, 0)) { + bReport = TRUE; + } + break; + case SET_ORGSTATUS: + if ( (aas->oldState == STATUS1_SET) && (DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVEFIRST, 0)) ) { + bReport = TRUE;; + } + if ( (aas->oldState == STATUS2_SET) && (DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVESECOND, 0)) ) { + bReport = TRUE;; + } + break; + case HIDDEN_ACTIVE: + if (DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_BECOMEACTIVE, 0)) { + bReport = TRUE; + } + break; + case ACTIVE: + if (aas->oldState == HIDDEN_ACTIVE) { + char setting[128]; + char *szProto; + + szProto = DBGetContactSettingByte(NULL, MODULENAME, SETTING_SAMESETTINGS, 0)?SETTING_ALL:aas->protocolSetting->szName; + _snprintf(setting, sizeof(setting), "%s_Lv1Status", szProto); + if ( (aas->protocolSetting->lastStatus == DBGetContactSettingWord(NULL, MODULENAME, setting, ID_STATUS_AWAY)) && DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVEFIRST, 0) ) { + bReport = TRUE; + } + + _snprintf(setting, sizeof(setting), "%s_Lv2Status", szProto); + if ( (aas->protocolSetting->lastStatus == DBGetContactSettingWord(NULL, MODULENAME, setting, ID_STATUS_NA)) && DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVESECOND, 0) ) { + bReport = TRUE; + } + } + break; + } + if (!bReport) { + continue; + } + ZeroMemory(&td, sizeof(td)); + td.cbSize = sizeof(td); + td.dFlags = DF_PROTO|DF_STATUS|DF_TEXT; + td.szProto = td.szText = aas->protocolSetting->szName; + td.status = aas->protocolSetting->status; + ZeroMemory(&ri, sizeof(REPORTINFO)); + ri.cbSize = sizeof(REPORTINFO); + ri.triggerID = triggerID; + ri.pszName = TRIGGERNAME; + ri.flags = TRG_PERFORM; + ri.td = &td; + CallService(MS_TRIGGER_REPORTEVENT, 0, (LPARAM)&ri); + } while (triggerID != 0); + + return 0; +} + +static INT_PTR CALLBACK DlgProcOptsAAAStateChange(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { + + switch (msg) { + case WM_INITDIALOG: { + DWORD triggerID; + + TranslateDialogDefault(hwndDlg); + triggerID = (DWORD)lParam; + CheckDlgButton(hwndDlg, IDC_ENTERFIRST, DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_ENTERFIRST, 0)?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ENTERSECOND, DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_ENTERSECOND, 0)?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_LEAVEFIRST, DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVEFIRST, 0)?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_LEAVESECOND, DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVESECOND, 0)?BST_CHECKED:BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_BECOMEACTIVE, DBGetTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_BECOMEACTIVE, 0)?BST_CHECKED:BST_UNCHECKED); + break; + } + + case TM_ADDTRIGGER: { + // wParam = trigger ID + DWORD triggerID; + + triggerID = (DWORD)wParam; + DBWriteTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_ENTERFIRST, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ENTERFIRST)); + DBWriteTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_ENTERSECOND, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ENTERSECOND)); + DBWriteTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVEFIRST, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LEAVEFIRST)); + DBWriteTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_LEAVESECOND, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_LEAVESECOND)); + DBWriteTriggerSettingByte(triggerID, NULL, MODULENAME, SETTING_BECOMEACTIVE, (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BECOMEACTIVE)); + break; + } + + case TM_DELTRIGGER: { + // wParam = triggerID + DWORD triggerID; + REMOVETRIGGERSETTINGS rts; + + triggerID = (DWORD)wParam; + rts.cbSize = sizeof(REMOVETRIGGERSETTINGS); + rts.prefix = PREFIX_TRIGGERID; + rts.id = triggerID; + rts.hContact = NULL; + rts.szModule = MODULENAME; + CallService(MS_TRIGGER_REMOVESETTINGS, 0, (LPARAM)&rts); + break; + } + } + + return FALSE; +} + +int InitTrigger() { + + TRIGGERREGISTER tr; + + if (!ServiceExists(MS_TRIGGER_REGISTERTRIGGER)) { + return -1; + } + ZeroMemory(&tr, sizeof(tr)); + tr.cbSize = sizeof(tr); + tr.pszName = TRIGGERNAME; + tr.hInstance = hInst; + tr.pfnDlgProc = DlgProcOptsAAAStateChange; + tr.pszTemplate = MAKEINTRESOURCEA(IDD_TRG_AAASTATECHANGE); + tr.dFlags = DF_STATUS|DF_PROTO; + CallService(MS_TRIGGER_REGISTERTRIGGER, 0, (LPARAM)&tr); + hAAAStateChangedHook = HookEvent(ME_AAA_STATECHANGED, AAAStateChanged); + + return 0; +} + +int DeInitTrigger() { + + UnhookEvent(hAAAStateChangedHook); + + return 0; +} \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.h b/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.h new file mode 100644 index 0000000000..52b15edd00 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/trigger_aaa.h @@ -0,0 +1,7 @@ +#define TRIGGERNAME "Auto-Away: State change" + +#define SETTING_ENTERFIRST "trigger_EnterFirst" +#define SETTING_ENTERSECOND "trigger_EnterSecond" +#define SETTING_LEAVEFIRST "trigger_LeaveFirst" +#define SETTING_LEAVESECOND "trigger_LeaveSecond" +#define SETTING_BECOMEACTIVE "trigger_BecomeActive" \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/vc6.rc b/plugins/StatusPlugins/AdvancedAutoAway/vc6.rc new file mode 100644 index 0000000000..730cf1e916 --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/vc6.rc @@ -0,0 +1,2 @@ +#include "..\resource.rc" +#include "..\version.rc" \ No newline at end of file diff --git a/plugins/StatusPlugins/AdvancedAutoAway/version.h b/plugins/StatusPlugins/AdvancedAutoAway/version.h new file mode 100644 index 0000000000..9c0462460d --- /dev/null +++ b/plugins/StatusPlugins/AdvancedAutoAway/version.h @@ -0,0 +1,56 @@ +// Set the version number here - it will affect the version resource and the version field of the pluginInfo structure +// (Be careful that you don't have the resource file open when you change this and rebuild, otherwise the changes may not +// take effect within the version resource) +// Do not forget to define symbol "_DEBUG" for resource compiler if you use debug configuration (in VisualStudio you can +// find it under Project properties - Configuration properties - Resource - General - Preprocessor definitions) + +// plugin version part +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 8 +#define __RELEASE_NUM 0 +#define __BUILD_NUM 42 + +// minimal MirandaIM version number, with which this plugin supposed to work +#define __PROD_MAJOR_VERSION 0 +#define __PROD_MINOR_VERSION 8 +#define __PROD_RELEASE_NUM 0 +#define __PROD_BUILD_NUM 0 +// if your plugin works only with Miranda core beginning from specific revision, you can include this information in Product Version resource +//#define __PROD_REV_NUM 1234 + +// stuff that will be used in PluginInfo section and in Version resource +#define __PLUGIN_NAME "Advanced Auto Away" +#define __FILENAME "AdvancedAutoAway.dll" +#define __DESC "AdvancedAutoAway, an Auto Away module with some more options than the original." +#define __AUTHOR "P Boon" +#define __AUTHOREMAIL "unregistered@users.sourceforge.net" +#define __AUTHORWEB "http://www.miranda-im.org/" +#define __COPYRIGHT "(c) 2003-08 P. Boon, 2008-11 George Hazan" + +// other stuff for Version resource +#define __STRINGIFY_IMPL(x) #x +#define __STRINGIFY(x) __STRINGIFY_IMPL(x) + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM +#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM +#ifdef _UNICODE +#ifdef __REV_NUM +#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS rev. __REV_NUM Unicode) +#else +#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS Unicode) +#endif +#else +#ifdef __REV_NUM +#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS rev. __REV_NUM) +#else +#define __VERSION_STRING __STRINGIFY(__FILEVERSION_STRING_DOTS) +#endif +#endif + +#define __PRODVERSION_STRING __PROD_MAJOR_VERSION,__PROD_MINOR_VERSION,__PROD_RELEASE_NUM,__PROD_BUILD_NUM +#define __PRODVERSION_STRING_DOTS __PROD_MAJOR_VERSION.__PROD_MINOR_VERSION.__PROD_RELEASE_NUM.__PROD_BUILD_NUM +#ifdef __PROD_REV_NUM +#define __PROD_VERSION_STRING __STRINGIFY(__PRODVERSION_STRING_DOTS rev. __PROD_REV_NUM) +#else +#define __PROD_VERSION_STRING __STRINGIFY(__PRODVERSION_STRING_DOTS+) +#endif -- cgit v1.2.3