From bc970507965a809727b3d5877884f21605fdf1a6 Mon Sep 17 00:00:00 2001 From: watcherhd Date: Sat, 26 Nov 2011 11:03:42 +0000 Subject: Project folders rename part 1 git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@210 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- AuthState/authstate.dsp | 142 ++ AuthState/authstate.dsw | 29 + AuthState/authstate.mdsp | 100 ++ AuthState/authstate.rc | 132 ++ AuthState/authstate.sln | 19 + AuthState/authstate.vcproj | 177 +++ AuthState/authstate_10.sln | 38 + AuthState/authstate_10.vcxproj | 397 +++++ AuthState/authstate_10.vcxproj.filters | 64 + AuthState/authstate_9.vcproj | 793 ++++++++++ AuthState/commonheaders.h | 68 + AuthState/docs/authstate-readme.txt | 54 + AuthState/docs/authstate-translate.txt | 24 + AuthState/icons/auth.ico | Bin 0 -> 2038 bytes AuthState/icons/authgrant.ico | Bin 0 -> 2038 bytes AuthState/icons/grant.ico | Bin 0 -> 2038 bytes AuthState/main.cpp | 385 +++++ AuthState/options.cpp | 154 ++ AuthState/resource.h | 25 + AuthState/version.h | 28 + AuthState/version.rc | 40 + BanControl/BETA | 1 + BanControl/CHANGELOG.txt | 30 + BanControl/LICENSE.txt | 339 +++++ BanControl/README.txt | 68 + BanControl/TRANSLATION.txt | 21 + BanControl/common.arg | 63 + BanControl/inc/IcoLib.inc | 51 + BanControl/inc/m_clc.inc | 203 +++ BanControl/inc/m_clist.inc | 33 + BanControl/inc/m_database.inc | 60 + BanControl/inc/m_langpack.inc | 30 + BanControl/inc/m_metacontacts.inc | 149 ++ BanControl/inc/m_options.inc | 36 + BanControl/inc/m_protocols.inc | 14 + BanControl/inc/m_protosvc.inc | 18 + BanControl/inc/m_updater.inc | 29 + BanControl/inc/newpluginapi.inc | 44 + BanControl/inc/statusmodes.inc | 26 + BanControl/plugin/BanControl.asm | 1160 +++++++++++++++ BanControl/plugin/BanControl.def | 4 + BanControl/res/BanControl.aps | Bin 0 -> 22384 bytes BanControl/res/BanControl.rc | 141 ++ BanControl/res/ban.ico | Bin 0 -> 2550 bytes BanControl/res/resource.h | 19 + BanControl/vsproj/BanControl.sln | 21 + BanControl/vsproj/BanControl.vcproj | 147 ++ BanControl/vsproj/Resource.txt | 0 BanControl/vsproj/build.bat | 34 + BanControl/vsproj/clean.bat | 49 + BuddyExpectator/BuddyExpectator.cpp | 968 ++++++++++++ BuddyExpectator/BuddyExpectator.dsp | 119 ++ BuddyExpectator/BuddyExpectator.dsw | 29 + BuddyExpectator/BuddyExpectator.mdsp | 101 ++ BuddyExpectator/BuddyExpectator.rc | 216 +++ BuddyExpectator/BuddyExpectator10.sln | 20 + BuddyExpectator/BuddyExpectator10.vcxproj | 160 ++ BuddyExpectator/BuddyExpectator8.sln | 20 + BuddyExpectator/BuddyExpectator8.vcproj | 295 ++++ BuddyExpectator/buddyexpectator.sln | 21 + BuddyExpectator/buddyexpectator.vcproj | 185 +++ BuddyExpectator/buddyexpectator_version.txt | 1 + BuddyExpectator/common.h | 64 + BuddyExpectator/docs/BuddyExpectator-Readme.txt | 63 + BuddyExpectator/docs/BuddyExpectator-Translate.txt | 42 + BuddyExpectator/icons/disabled.ico | Bin 0 -> 2550 bytes BuddyExpectator/icons/enabled.ico | Bin 0 -> 2550 bytes BuddyExpectator/icons/hide.ico | Bin 0 -> 2550 bytes BuddyExpectator/icons/main.ico | Bin 0 -> 2550 bytes BuddyExpectator/icons/neverhide.ico | Bin 0 -> 2550 bytes BuddyExpectator/options.cpp | 628 ++++++++ BuddyExpectator/options.h | 64 + BuddyExpectator/resource.h | 56 + Console/Console.c | 1538 ++++++++++++++++++++ Console/Console.dsp | 363 +++++ Console/Console.dsw | 33 + Console/Console.opt | Bin 0 -> 49664 bytes Console/Console.plg | 49 + Console/Console.sln | 40 + Console/Console.vcproj | 634 ++++++++ Console/Console.vcxproj | 608 ++++++++ Console/Console.vcxproj.filters | 103 ++ Console/Console_history.txt | 174 +++ Console/Console_readme.txt | 21 + Console/commonheaders.c | 24 + Console/commonheaders.h | 69 + Console/gpl.txt | 340 +++++ Console/init.c | 87 ++ Console/res/arrow.ico | Bin 0 -> 422 bytes Console/res/btn_dn.ico | Bin 0 -> 894 bytes Console/res/btn_up.ico | Bin 0 -> 894 bytes Console/res/close.ico | Bin 0 -> 894 bytes Console/res/close2.ico | Bin 0 -> 894 bytes Console/res/console.ico | Bin 0 -> 11502 bytes Console/res/console_dn.bmp | Bin 0 -> 1014 bytes Console/res/console_up.bmp | Bin 0 -> 1014 bytes Console/res/copy.ico | Bin 0 -> 894 bytes Console/res/delete.ico | Bin 0 -> 894 bytes Console/res/empty.ico | Bin 0 -> 422 bytes Console/res/in.ico | Bin 0 -> 422 bytes Console/res/info.ico | Bin 0 -> 422 bytes Console/res/noscroll.ico | Bin 0 -> 894 bytes Console/res/options.ico | Bin 0 -> 894 bytes Console/res/out.ico | Bin 0 -> 422 bytes Console/res/pause.ico | Bin 0 -> 894 bytes Console/res/paused.ico | Bin 0 -> 894 bytes Console/res/save.ico | Bin 0 -> 894 bytes Console/res/scroll.ico | Bin 0 -> 894 bytes Console/res/start.ico | Bin 0 -> 894 bytes Console/res/started.ico | Bin 0 -> 894 bytes Console/resource.h | 58 + Console/resource.rc | 223 +++ Console/version.h | 51 + IgnoreState/ignore_10.vcxproj | 4 +- authstate/authstate.dsp | 142 -- authstate/authstate.dsw | 29 - authstate/authstate.mdsp | 100 -- authstate/authstate.rc | 132 -- authstate/authstate.sln | 19 - authstate/authstate.vcproj | 177 --- authstate/authstate_10.sln | 38 - authstate/authstate_10.vcxproj | 397 ----- authstate/authstate_10.vcxproj.filters | 64 - authstate/authstate_9.vcproj | 793 ---------- authstate/commonheaders.h | 68 - authstate/docs/authstate-readme.txt | 54 - authstate/docs/authstate-translate.txt | 24 - authstate/icons/auth.ico | Bin 2038 -> 0 bytes authstate/icons/authgrant.ico | Bin 2038 -> 0 bytes authstate/icons/grant.ico | Bin 2038 -> 0 bytes authstate/main.cpp | 385 ----- authstate/options.cpp | 154 -- authstate/resource.h | 25 - authstate/version.h | 28 - authstate/version.rc | 40 - bancontrol/BETA | 1 - bancontrol/CHANGELOG.txt | 30 - bancontrol/LICENSE.txt | 339 ----- bancontrol/README.txt | 68 - bancontrol/TRANSLATION.txt | 21 - bancontrol/common.arg | 63 - bancontrol/inc/IcoLib.inc | 51 - bancontrol/inc/m_clc.inc | 203 --- bancontrol/inc/m_clist.inc | 33 - bancontrol/inc/m_database.inc | 60 - bancontrol/inc/m_langpack.inc | 30 - bancontrol/inc/m_metacontacts.inc | 149 -- bancontrol/inc/m_options.inc | 36 - bancontrol/inc/m_protocols.inc | 14 - bancontrol/inc/m_protosvc.inc | 18 - bancontrol/inc/m_updater.inc | 29 - bancontrol/inc/newpluginapi.inc | 44 - bancontrol/inc/statusmodes.inc | 26 - bancontrol/plugin/BanControl.asm | 1160 --------------- bancontrol/plugin/BanControl.def | 4 - bancontrol/res/BanControl.aps | Bin 22384 -> 0 bytes bancontrol/res/BanControl.rc | 141 -- bancontrol/res/ban.ico | Bin 2550 -> 0 bytes bancontrol/res/resource.h | 19 - bancontrol/vsproj/BanControl.sln | 21 - bancontrol/vsproj/BanControl.vcproj | 147 -- bancontrol/vsproj/Resource.txt | 0 bancontrol/vsproj/build.bat | 34 - bancontrol/vsproj/clean.bat | 49 - buddyexpectator/BuddyExpectator.cpp | 968 ------------ buddyexpectator/BuddyExpectator.dsp | 119 -- buddyexpectator/BuddyExpectator.dsw | 29 - buddyexpectator/BuddyExpectator.mdsp | 101 -- buddyexpectator/BuddyExpectator.rc | 216 --- buddyexpectator/BuddyExpectator10.sln | 20 - buddyexpectator/BuddyExpectator10.vcxproj | 160 -- buddyexpectator/BuddyExpectator8.sln | 20 - buddyexpectator/BuddyExpectator8.vcproj | 295 ---- buddyexpectator/buddyexpectator.sln | 21 - buddyexpectator/buddyexpectator.vcproj | 185 --- buddyexpectator/buddyexpectator_version.txt | 1 - buddyexpectator/common.h | 64 - buddyexpectator/docs/BuddyExpectator-Readme.txt | 63 - buddyexpectator/docs/BuddyExpectator-Translate.txt | 42 - buddyexpectator/icons/disabled.ico | Bin 2550 -> 0 bytes buddyexpectator/icons/enabled.ico | Bin 2550 -> 0 bytes buddyexpectator/icons/hide.ico | Bin 2550 -> 0 bytes buddyexpectator/icons/main.ico | Bin 2550 -> 0 bytes buddyexpectator/icons/neverhide.ico | Bin 2550 -> 0 bytes buddyexpectator/options.cpp | 628 -------- buddyexpectator/options.h | 64 - buddyexpectator/resource.h | 56 - console/Console.c | 1538 -------------------- console/Console.dsp | 363 ----- console/Console.dsw | 33 - console/Console.opt | Bin 49664 -> 0 bytes console/Console.plg | 49 - console/Console.sln | 40 - console/Console.vcproj | 634 -------- console/Console.vcxproj | 608 -------- console/Console.vcxproj.filters | 103 -- console/Console_history.txt | 174 --- console/Console_readme.txt | 21 - console/commonheaders.c | 24 - console/commonheaders.h | 69 - console/gpl.txt | 340 ----- console/init.c | 87 -- console/res/arrow.ico | Bin 422 -> 0 bytes console/res/btn_dn.ico | Bin 894 -> 0 bytes console/res/btn_up.ico | Bin 894 -> 0 bytes console/res/close.ico | Bin 894 -> 0 bytes console/res/close2.ico | Bin 894 -> 0 bytes console/res/console.ico | Bin 11502 -> 0 bytes console/res/console_dn.bmp | Bin 1014 -> 0 bytes console/res/console_up.bmp | Bin 1014 -> 0 bytes console/res/copy.ico | Bin 894 -> 0 bytes console/res/delete.ico | Bin 894 -> 0 bytes console/res/empty.ico | Bin 422 -> 0 bytes console/res/in.ico | Bin 422 -> 0 bytes console/res/info.ico | Bin 422 -> 0 bytes console/res/noscroll.ico | Bin 894 -> 0 bytes console/res/options.ico | Bin 894 -> 0 bytes console/res/out.ico | Bin 422 -> 0 bytes console/res/pause.ico | Bin 894 -> 0 bytes console/res/paused.ico | Bin 894 -> 0 bytes console/res/save.ico | Bin 894 -> 0 bytes console/res/scroll.ico | Bin 894 -> 0 bytes console/res/start.ico | Bin 894 -> 0 bytes console/res/started.ico | Bin 894 -> 0 bytes console/resource.h | 58 - console/resource.rc | 223 --- console/version.h | 51 - 227 files changed, 12928 insertions(+), 12928 deletions(-) create mode 100644 AuthState/authstate.dsp create mode 100644 AuthState/authstate.dsw create mode 100644 AuthState/authstate.mdsp create mode 100644 AuthState/authstate.rc create mode 100644 AuthState/authstate.sln create mode 100644 AuthState/authstate.vcproj create mode 100644 AuthState/authstate_10.sln create mode 100644 AuthState/authstate_10.vcxproj create mode 100644 AuthState/authstate_10.vcxproj.filters create mode 100644 AuthState/authstate_9.vcproj create mode 100644 AuthState/commonheaders.h create mode 100644 AuthState/docs/authstate-readme.txt create mode 100644 AuthState/docs/authstate-translate.txt create mode 100644 AuthState/icons/auth.ico create mode 100644 AuthState/icons/authgrant.ico create mode 100644 AuthState/icons/grant.ico create mode 100644 AuthState/main.cpp create mode 100644 AuthState/options.cpp create mode 100644 AuthState/resource.h create mode 100644 AuthState/version.h create mode 100644 AuthState/version.rc create mode 100644 BanControl/BETA create mode 100644 BanControl/CHANGELOG.txt create mode 100644 BanControl/LICENSE.txt create mode 100644 BanControl/README.txt create mode 100644 BanControl/TRANSLATION.txt create mode 100644 BanControl/common.arg create mode 100644 BanControl/inc/IcoLib.inc create mode 100644 BanControl/inc/m_clc.inc create mode 100644 BanControl/inc/m_clist.inc create mode 100644 BanControl/inc/m_database.inc create mode 100644 BanControl/inc/m_langpack.inc create mode 100644 BanControl/inc/m_metacontacts.inc create mode 100644 BanControl/inc/m_options.inc create mode 100644 BanControl/inc/m_protocols.inc create mode 100644 BanControl/inc/m_protosvc.inc create mode 100644 BanControl/inc/m_updater.inc create mode 100644 BanControl/inc/newpluginapi.inc create mode 100644 BanControl/inc/statusmodes.inc create mode 100644 BanControl/plugin/BanControl.asm create mode 100644 BanControl/plugin/BanControl.def create mode 100644 BanControl/res/BanControl.aps create mode 100644 BanControl/res/BanControl.rc create mode 100644 BanControl/res/ban.ico create mode 100644 BanControl/res/resource.h create mode 100644 BanControl/vsproj/BanControl.sln create mode 100644 BanControl/vsproj/BanControl.vcproj create mode 100644 BanControl/vsproj/Resource.txt create mode 100644 BanControl/vsproj/build.bat create mode 100644 BanControl/vsproj/clean.bat create mode 100644 BuddyExpectator/BuddyExpectator.cpp create mode 100644 BuddyExpectator/BuddyExpectator.dsp create mode 100644 BuddyExpectator/BuddyExpectator.dsw create mode 100644 BuddyExpectator/BuddyExpectator.mdsp create mode 100644 BuddyExpectator/BuddyExpectator.rc create mode 100644 BuddyExpectator/BuddyExpectator10.sln create mode 100644 BuddyExpectator/BuddyExpectator10.vcxproj create mode 100644 BuddyExpectator/BuddyExpectator8.sln create mode 100644 BuddyExpectator/BuddyExpectator8.vcproj create mode 100644 BuddyExpectator/buddyexpectator.sln create mode 100644 BuddyExpectator/buddyexpectator.vcproj create mode 100644 BuddyExpectator/buddyexpectator_version.txt create mode 100644 BuddyExpectator/common.h create mode 100644 BuddyExpectator/docs/BuddyExpectator-Readme.txt create mode 100644 BuddyExpectator/docs/BuddyExpectator-Translate.txt create mode 100644 BuddyExpectator/icons/disabled.ico create mode 100644 BuddyExpectator/icons/enabled.ico create mode 100644 BuddyExpectator/icons/hide.ico create mode 100644 BuddyExpectator/icons/main.ico create mode 100644 BuddyExpectator/icons/neverhide.ico create mode 100644 BuddyExpectator/options.cpp create mode 100644 BuddyExpectator/options.h create mode 100644 BuddyExpectator/resource.h create mode 100644 Console/Console.c create mode 100644 Console/Console.dsp create mode 100644 Console/Console.dsw create mode 100644 Console/Console.opt create mode 100644 Console/Console.plg create mode 100644 Console/Console.sln create mode 100644 Console/Console.vcproj create mode 100644 Console/Console.vcxproj create mode 100644 Console/Console.vcxproj.filters create mode 100644 Console/Console_history.txt create mode 100644 Console/Console_readme.txt create mode 100644 Console/commonheaders.c create mode 100644 Console/commonheaders.h create mode 100644 Console/gpl.txt create mode 100644 Console/init.c create mode 100644 Console/res/arrow.ico create mode 100644 Console/res/btn_dn.ico create mode 100644 Console/res/btn_up.ico create mode 100644 Console/res/close.ico create mode 100644 Console/res/close2.ico create mode 100644 Console/res/console.ico create mode 100644 Console/res/console_dn.bmp create mode 100644 Console/res/console_up.bmp create mode 100644 Console/res/copy.ico create mode 100644 Console/res/delete.ico create mode 100644 Console/res/empty.ico create mode 100644 Console/res/in.ico create mode 100644 Console/res/info.ico create mode 100644 Console/res/noscroll.ico create mode 100644 Console/res/options.ico create mode 100644 Console/res/out.ico create mode 100644 Console/res/pause.ico create mode 100644 Console/res/paused.ico create mode 100644 Console/res/save.ico create mode 100644 Console/res/scroll.ico create mode 100644 Console/res/start.ico create mode 100644 Console/res/started.ico create mode 100644 Console/resource.h create mode 100644 Console/resource.rc create mode 100644 Console/version.h delete mode 100644 authstate/authstate.dsp delete mode 100644 authstate/authstate.dsw delete mode 100644 authstate/authstate.mdsp delete mode 100644 authstate/authstate.rc delete mode 100644 authstate/authstate.sln delete mode 100644 authstate/authstate.vcproj delete mode 100644 authstate/authstate_10.sln delete mode 100644 authstate/authstate_10.vcxproj delete mode 100644 authstate/authstate_10.vcxproj.filters delete mode 100644 authstate/authstate_9.vcproj delete mode 100644 authstate/commonheaders.h delete mode 100644 authstate/docs/authstate-readme.txt delete mode 100644 authstate/docs/authstate-translate.txt delete mode 100644 authstate/icons/auth.ico delete mode 100644 authstate/icons/authgrant.ico delete mode 100644 authstate/icons/grant.ico delete mode 100644 authstate/main.cpp delete mode 100644 authstate/options.cpp delete mode 100644 authstate/resource.h delete mode 100644 authstate/version.h delete mode 100644 authstate/version.rc delete mode 100644 bancontrol/BETA delete mode 100644 bancontrol/CHANGELOG.txt delete mode 100644 bancontrol/LICENSE.txt delete mode 100644 bancontrol/README.txt delete mode 100644 bancontrol/TRANSLATION.txt delete mode 100644 bancontrol/common.arg delete mode 100644 bancontrol/inc/IcoLib.inc delete mode 100644 bancontrol/inc/m_clc.inc delete mode 100644 bancontrol/inc/m_clist.inc delete mode 100644 bancontrol/inc/m_database.inc delete mode 100644 bancontrol/inc/m_langpack.inc delete mode 100644 bancontrol/inc/m_metacontacts.inc delete mode 100644 bancontrol/inc/m_options.inc delete mode 100644 bancontrol/inc/m_protocols.inc delete mode 100644 bancontrol/inc/m_protosvc.inc delete mode 100644 bancontrol/inc/m_updater.inc delete mode 100644 bancontrol/inc/newpluginapi.inc delete mode 100644 bancontrol/inc/statusmodes.inc delete mode 100644 bancontrol/plugin/BanControl.asm delete mode 100644 bancontrol/plugin/BanControl.def delete mode 100644 bancontrol/res/BanControl.aps delete mode 100644 bancontrol/res/BanControl.rc delete mode 100644 bancontrol/res/ban.ico delete mode 100644 bancontrol/res/resource.h delete mode 100644 bancontrol/vsproj/BanControl.sln delete mode 100644 bancontrol/vsproj/BanControl.vcproj delete mode 100644 bancontrol/vsproj/Resource.txt delete mode 100644 bancontrol/vsproj/build.bat delete mode 100644 bancontrol/vsproj/clean.bat delete mode 100644 buddyexpectator/BuddyExpectator.cpp delete mode 100644 buddyexpectator/BuddyExpectator.dsp delete mode 100644 buddyexpectator/BuddyExpectator.dsw delete mode 100644 buddyexpectator/BuddyExpectator.mdsp delete mode 100644 buddyexpectator/BuddyExpectator.rc delete mode 100644 buddyexpectator/BuddyExpectator10.sln delete mode 100644 buddyexpectator/BuddyExpectator10.vcxproj delete mode 100644 buddyexpectator/BuddyExpectator8.sln delete mode 100644 buddyexpectator/BuddyExpectator8.vcproj delete mode 100644 buddyexpectator/buddyexpectator.sln delete mode 100644 buddyexpectator/buddyexpectator.vcproj delete mode 100644 buddyexpectator/buddyexpectator_version.txt delete mode 100644 buddyexpectator/common.h delete mode 100644 buddyexpectator/docs/BuddyExpectator-Readme.txt delete mode 100644 buddyexpectator/docs/BuddyExpectator-Translate.txt delete mode 100644 buddyexpectator/icons/disabled.ico delete mode 100644 buddyexpectator/icons/enabled.ico delete mode 100644 buddyexpectator/icons/hide.ico delete mode 100644 buddyexpectator/icons/main.ico delete mode 100644 buddyexpectator/icons/neverhide.ico delete mode 100644 buddyexpectator/options.cpp delete mode 100644 buddyexpectator/options.h delete mode 100644 buddyexpectator/resource.h delete mode 100644 console/Console.c delete mode 100644 console/Console.dsp delete mode 100644 console/Console.dsw delete mode 100644 console/Console.opt delete mode 100644 console/Console.plg delete mode 100644 console/Console.sln delete mode 100644 console/Console.vcproj delete mode 100644 console/Console.vcxproj delete mode 100644 console/Console.vcxproj.filters delete mode 100644 console/Console_history.txt delete mode 100644 console/Console_readme.txt delete mode 100644 console/commonheaders.c delete mode 100644 console/commonheaders.h delete mode 100644 console/gpl.txt delete mode 100644 console/init.c delete mode 100644 console/res/arrow.ico delete mode 100644 console/res/btn_dn.ico delete mode 100644 console/res/btn_up.ico delete mode 100644 console/res/close.ico delete mode 100644 console/res/close2.ico delete mode 100644 console/res/console.ico delete mode 100644 console/res/console_dn.bmp delete mode 100644 console/res/console_up.bmp delete mode 100644 console/res/copy.ico delete mode 100644 console/res/delete.ico delete mode 100644 console/res/empty.ico delete mode 100644 console/res/in.ico delete mode 100644 console/res/info.ico delete mode 100644 console/res/noscroll.ico delete mode 100644 console/res/options.ico delete mode 100644 console/res/out.ico delete mode 100644 console/res/pause.ico delete mode 100644 console/res/paused.ico delete mode 100644 console/res/save.ico delete mode 100644 console/res/scroll.ico delete mode 100644 console/res/start.ico delete mode 100644 console/res/started.ico delete mode 100644 console/resource.h delete mode 100644 console/resource.rc delete mode 100644 console/version.h diff --git a/AuthState/authstate.dsp b/AuthState/authstate.dsp new file mode 100644 index 0000000..a62dc51 --- /dev/null +++ b/AuthState/authstate.dsp @@ -0,0 +1,142 @@ +# Microsoft Developer Studio Project File - Name="AuthState" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=AuthState - Win32 Debug +!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 "authstate.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 "authstate.mak" CFG="AuthState - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "AuthState - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "AuthState - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 1 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "AuthState - 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 1 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FINGER_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FINGER_EXPORTS" /FD /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /I "../../../include" /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x419 /d "NDEBUG" +# ADD RSC /l 0x809 /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 /nologo /base:"0x22620000" /verbose /dll /pdb:"../../bin/release/plugins/AuthState.pdb" /machine:I386 /out:"../../bin/release/plugins/AuthState.dll" +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "AuthState - 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 "FINGER_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FINGER_EXPORTS" /FD /GZ /c +# SUBTRACT CPP /YX +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /I "../../../../include" /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x419 /d "_DEBUG" +# ADD RSC /l 0x419 /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 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 /base:"0x22620000" /dll /debug /machine:I386 /out:"../../../bin/debug/plugins/AuthState.dll" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "AuthState - Win32 Release" +# Name "AuthState - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\main.cpp +# End Source File +# Begin Source File + +SOURCE=.\options.cpp +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\commonheaders.h +# End Source File +# Begin Source File + +SOURCE=.\m_cluiframes.h +# End Source File +# Begin Source File + +SOURCE=.\m_icolib.h +# End Source File +# Begin Source File + +SOURCE=.\resource.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 + +!IF "$(CFG)" == "AuthState - Win32 Release" + +!ELSEIF "$(CFG)" == "AuthState - Win32 Debug" + +!ENDIF + +# End Source File +# End Group +# End Target +# End Project diff --git a/AuthState/authstate.dsw b/AuthState/authstate.dsw new file mode 100644 index 0000000..169266e --- /dev/null +++ b/AuthState/authstate.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "AuthState"=".\authstate.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/AuthState/authstate.mdsp b/AuthState/authstate.mdsp new file mode 100644 index 0000000..8c794e5 --- /dev/null +++ b/AuthState/authstate.mdsp @@ -0,0 +1,100 @@ +[Project] +name=AuthState +type=2 +defaultConfig=1 + + +[Debug] +// compiler +workingDirectory= +arguments= +intermediateFilesDirectory=Debug +outputFilesDirectory=Debug +compilerPreprocessor= +extraCompilerOptions= +compilerIncludeDirectory=..\..\include +noWarning=0 +defaultWarning=0 +allWarning=1 +extraWarning=0 +isoWarning=0 +warningsAsErrors=0 +debugType=1 +debugLevel=2 +exceptionEnabled=1 +runtimeTypeEnabled=1 +optimizeLevel=4 + +// linker +libraryPath= +outputFilename=Debug\AuthState.dll +libraries= +extraLinkerOptions= +ignoreStartupFile=0 +ignoreDefaultLibs=0 +stripExecutableFile=0 + +// archive +extraArchiveOptions= + +//resource +resourcePreprocessor= +resourceIncludeDirectory= +extraResourceOptions= + +[Release] +// compiler +workingDirectory= +arguments= +intermediateFilesDirectory=Release +outputFilesDirectory=Release +compilerPreprocessor= +extraCompilerOptions= +compilerIncludeDirectory=..\..\include +noWarning=0 +defaultWarning=1 +allWarning=1 +extraWarning=0 +isoWarning=0 +warningsAsErrors=0 +debugType=0 +debugLevel=1 +exceptionEnabled=1 +runtimeTypeEnabled=1 +optimizeLevel=4 + +// linker +libraryPath= +outputFilename=Release\AuthState.dll +libraries= +extraLinkerOptions= +ignoreStartupFile=0 +ignoreDefaultLibs=0 +stripExecutableFile=1 + +// archive +extraArchiveOptions= + +//resource +resourcePreprocessor= +resourceIncludeDirectory= +extraResourceOptions= + +[Source] +1=main.cpp +2=options.cpp +[Header] +1=commonheaders.h +2=m_cluiframes.h +3=m_updater.h +4=resource.h +[Resource] +1=authstate.rc +[Other] +1=docs\authstate-readme.txt +2=docs\authstate-translate.txt +[History]commonheaders.h,1232 +docs\authstate-translate.txt,381 +options.cpp,1384 +main.cpp,1168 +docs\authstate-readme.txt,902 diff --git a/AuthState/authstate.rc b/AuthState/authstate.rc new file mode 100644 index 0000000..0bed718 --- /dev/null +++ b/AuthState/authstate.rc @@ -0,0 +1,132 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Ukrainian resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_UKR) +#ifdef _WIN32 +LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT +#pragma code_page(1251) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_AUTH ICON "icons\\auth.ico" +IDI_GRANT ICON "icons\\grant.ico" +IDI_AUTHGRANT ICON "icons\\authgrant.ico" +#endif // Ukrainian resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_AUTHSTATE_OPT DIALOGEX 0, 0, 314, 240 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + COMBOBOX IDC_ADVICON,95,127,78,81,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP,WS_EX_CLIENTEDGE + CONTROL "Show Auth icon",IDC_AUTHICON,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,76,93,167,18 + CONTROL "Show Grant icon",IDC_GRANTICON,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,76,109,167,18 + GROUPBOX "Plugin settings",IDC_STATIC,19,46,276,118 + RTEXT "Use",IDC_STATIC,40,129,49,12 + LTEXT "slot to draw the icon",IDC_STATIC,179,129,86,17 + CONTROL "Enable Menu Item (*)",IDC_ENABLEMENUITEM,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,76,65,167,13 + CONTROL "Show icons only for recently added contacts", + IDC_ICONSFORRECENT,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,76,78,167,17 + RTEXT "* Restart of Miranda required",IDC_STATIC,58,171,210,11 + LTEXT "Note: if you still don't see the icons try changing icon slot. Perhaps its used by some other plugin.", + IDC_NOTICE,54,143,198,20 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_AUTHSTATE_OPT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 307 + TOPMARGIN, 7 + BOTTOMMARGIN, 233 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/AuthState/authstate.sln b/AuthState/authstate.sln new file mode 100644 index 0000000..83ffeb1 --- /dev/null +++ b/AuthState/authstate.sln @@ -0,0 +1,19 @@ +Microsoft Visual Studio Solution File, Format Version 10.00 +# Visual C++ Express 2008 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "authstate", "authstate.vcproj", "{DB315D7D-00BB-43B2-93A6-0430CA2B9F28}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|Win32.ActiveCfg = Debug|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|Win32.Build.0 = Debug|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|Win32.ActiveCfg = Release|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/AuthState/authstate.vcproj b/AuthState/authstate.vcproj new file mode 100644 index 0000000..12c647f --- /dev/null +++ b/AuthState/authstate.vcproj @@ -0,0 +1,177 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AuthState/authstate_10.sln b/AuthState/authstate_10.sln new file mode 100644 index 0000000..6bcf6d3 --- /dev/null +++ b/AuthState/authstate_10.sln @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual C++ Express 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AuthState", "authstate_10.vcxproj", "{DB315D7D-00BB-43B2-93A6-0430CA2B9F28}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Unicode|Win32 = Debug Unicode|Win32 + Debug Unicode|x64 = Debug Unicode|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release Unicode|Win32 = Release Unicode|Win32 + Release Unicode|x64 = Release Unicode|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|Win32.ActiveCfg = Debug|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|Win32.Build.0 = Debug|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|x64.ActiveCfg = Debug|x64 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|x64.Build.0 = Debug|x64 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release Unicode|x64.Build.0 = Release Unicode|x64 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|Win32.ActiveCfg = Release|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|Win32.Build.0 = Release|Win32 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|x64.ActiveCfg = Release|x64 + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/AuthState/authstate_10.vcxproj b/AuthState/authstate_10.vcxproj new file mode 100644 index 0000000..f54aef6 --- /dev/null +++ b/AuthState/authstate_10.vcxproj @@ -0,0 +1,397 @@ + + + + + Debug Unicode + Win32 + + + Debug Unicode + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release Unicode + Win32 + + + Release Unicode + x64 + + + Release + Win32 + + + Release + x64 + + + + AuthState + {DB315D7D-00BB-43B2-93A6-0430CA2B9F28} + authstate_9 + Win32Proj + + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + DynamicLibrary + Unicode + true + + + DynamicLibrary + Unicode + + + DynamicLibrary + MultiByte + true + + + DynamicLibrary + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + AllRules.ruleset + + + + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebug + Use + Commonheaders.h + Level3 + EditAndContinue + + + true + Windows + 0x22620000 + false + + + MachineX86 + + + + + Full + OnlyExplicitInline + Size + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + Use + Commonheaders.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + true + Windows + true + true + 0x22620000 + false + + + MachineX86 + + + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebug + Use + Commonheaders.h + Level3 + EditAndContinue + 4996;%(DisableSpecificWarnings) + + + true + Windows + 0x22620000 + false + + + MachineX86 + + + + + Full + OnlyExplicitInline + Size + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + Use + Commonheaders.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + true + Windows + true + true + 0x22620000 + false + + + MachineX86 + + + + + X64 + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebug + Use + Commonheaders.h + Level3 + ProgramDatabase + + + true + Windows + 0x22620000 + false + + + $(IntDir)$(TargetName).lib + MachineX64 + + + + + X64 + + + Full + OnlyExplicitInline + Size + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + Use + Commonheaders.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + true + Windows + true + true + 0x22620000 + false + + + $(IntDir)$(TargetName).lib + MachineX64 + + + + + X64 + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) + MultiThreadedDebug + Use + Commonheaders.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + true + Windows + 0x22620000 + false + + + $(IntDir)$(TargetName).lib + MachineX64 + + + + + X64 + + + Full + OnlyExplicitInline + Size + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) + MultiThreaded + Use + Commonheaders.h + Level3 + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + true + Windows + true + true + 0x22620000 + false + + + $(IntDir)$(TargetName).lib + MachineX64 + + + + + Create + Create + Create + Create + Create + Create + Create + Create + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AuthState/authstate_10.vcxproj.filters b/AuthState/authstate_10.vcxproj.filters new file mode 100644 index 0000000..c045a6a --- /dev/null +++ b/AuthState/authstate_10.vcxproj.filters @@ -0,0 +1,64 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hpp;hxx;hm;inl;inc;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx + + + {e3d2bfb3-bac6-4574-951a-0d849c44446e} + + + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Docs + + + Docs + + + + + Resource Files + + + Resource Files + + + \ No newline at end of file diff --git a/AuthState/authstate_9.vcproj b/AuthState/authstate_9.vcproj new file mode 100644 index 0000000..bcd25c9 --- /dev/null +++ b/AuthState/authstate_9.vcproj @@ -0,0 +1,793 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AuthState/commonheaders.h b/AuthState/commonheaders.h new file mode 100644 index 0000000..746ff48 --- /dev/null +++ b/AuthState/commonheaders.h @@ -0,0 +1,68 @@ +/* + Authorization State plugin for Miranda-IM (www.miranda-im.org) + (c) 2006-2009 by Thief + + 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 + + File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/commonheaders.h $ + Revision : $Rev: 1686 $ + Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ + Last change by : $Author: ghazan $ + +*/ + +#ifndef COMMHEADERS_H +#define COMMHEADERS_H + +#define MIRANDA_VER 0x0900 +#define MIRANDA_CUSTOM_LP + +#include +#include // needed by m_utils.h +#include // needed by m_icolib.h > r9256 +#include + +// Miranda API headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "resource.h" +#include "Version.h" + +// Third party SDK headers +#include "m_updater.h" +#include "m_extraicons.h" + +static const int DefaultSlot = EXTRA_ICON_ADV2; +#define MODULENAME "AuthState" + +extern int onOptInitialise(WPARAM wParam, LPARAM lParam); +extern int onExtraImageApplying(WPARAM wParam, LPARAM lParam); +extern int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam); + +extern HINSTANCE g_hInst; +extern IconExtraColumn g_IECAuth, g_IECGrant, g_IECAuthGrant, g_IECClear; +extern INT clistIcon; +extern byte bUseAuthIcon, bUseGrantIcon, bContactMenuItem, bIconsForRecentContacts; +extern HANDLE hExtraIcon; + +#endif //COMMHEADERS_H diff --git a/AuthState/docs/authstate-readme.txt b/AuthState/docs/authstate-readme.txt new file mode 100644 index 0000000..d830076 --- /dev/null +++ b/AuthState/docs/authstate-readme.txt @@ -0,0 +1,54 @@ +Authorization State plugin for Miranda IM (http://miranda-im.org) +Homepage: http://thief.miranda.im +Version: 0.0.2.0 (c) 2006-2009 Thief +Idea by snwbrdr, icons by Faith Healer, Angeli-Ka + +This small plugin intended to show an icon in front of contacts which haven't gived us an authorization. +Another icon is displayed if there is Grant Authorization item in contact's menu. +Options to disable/enable icons for particular contact are available in contact's menu. + +I would like to say thanks to: +snwbrdr for initial idea +Faith Healer for cute icons +Kildor for several creative ideas +mirandaim.ru forum members for valuable feedback and suggestions. +eblis and baloo for WhenWasIt and SecureIM plugins (I found many useful hints on implementation in sources of these plugins) + +Changes: + +v0.0.2.0 ++ added support for extraicons service plugin + +v0.0.1.6 +! fixed wrong auth-grant icon in some cases +- minor adjustments to menu item logic + +v0.0.1.5 +* icons by Angeli-Ka ++ auth-grant icon is shown if contact wasn't added to server-side contact list + +v0.0.1.4 +! MinGW build +- small corrections and fixes + +v0.0.1.3 ++ added Miranda 0.8 support (PluginInfoEx and Interfaces) ++ optional ability to move contacts without permited authorization to a separate group (like icq official) - WORK IN PROGRESS +* fixed crash on exit (thx Joe) +* small bugfixes + +v0.0.1.2 +! fix: when changing icon slot clist was getting multiply icons +! fix: dropdown items in options weren't visible in some cases + +v0.0.1.1 +* fixes to translation + +v0.0.1.0 +- initial FL release + +v0.0.0.x +- test versions released on mirandaim.ru forum only. + +Plugin is released under GPL licence. +http://www.gnu.org/copyleft/gpl.html \ No newline at end of file diff --git a/AuthState/docs/authstate-translate.txt b/AuthState/docs/authstate-translate.txt new file mode 100644 index 0000000..4e6d872 --- /dev/null +++ b/AuthState/docs/authstate-translate.txt @@ -0,0 +1,24 @@ +[Auth State] +[Auth] +[Grant] +[Auth & Grant] +[Show Auth icon] +[Show Grant icon] +[Plugin settings] +[Use] +[slot to draw the icon] +[Enable Menu Item (*)] +[Show icons only for recently added contacts] +[* Restart of Miranda required] +[Email] +[Protocol] +[SMS] +[Advanced 1] +[Advanced 2] +[Web] +[Client] +[Advanced 3] +[Advanced 4] +[Advanced 5] +[Disable AuthState icons] +[Enable AuthState icons] \ No newline at end of file diff --git a/AuthState/icons/auth.ico b/AuthState/icons/auth.ico new file mode 100644 index 0000000..01cb6f0 Binary files /dev/null and b/AuthState/icons/auth.ico differ diff --git a/AuthState/icons/authgrant.ico b/AuthState/icons/authgrant.ico new file mode 100644 index 0000000..3f15a64 Binary files /dev/null and b/AuthState/icons/authgrant.ico differ diff --git a/AuthState/icons/grant.ico b/AuthState/icons/grant.ico new file mode 100644 index 0000000..89ce601 Binary files /dev/null and b/AuthState/icons/grant.ico differ diff --git a/AuthState/main.cpp b/AuthState/main.cpp new file mode 100644 index 0000000..ba5a006 --- /dev/null +++ b/AuthState/main.cpp @@ -0,0 +1,385 @@ +/* + Authorization State plugin for Miranda-IM (www.miranda-im.org) + (c) 2006-2010 by Thief + + 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 + + File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/main.cpp $ + Revision : $Rev: 1686 $ + Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ + Last change by : $Author: ghazan $ + +*/ + +#include "commonheaders.h" + +HINSTANCE g_hInst; +PLUGINLINK *pluginLink; +static HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL; +static HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactSettingChanged = NULL, hContactAdded = NULL; +static HANDLE hPrebuildContactMenu = NULL, hAuthMenuSelected = NULL; +static HANDLE hUserMenu = NULL; +HANDLE hExtraIcon = NULL; +struct MM_INTERFACE mmi; +int hLangpack; + +IconExtraColumn g_IECAuth = {0}; +IconExtraColumn g_IECGrant = {0}; +IconExtraColumn g_IECAuthGrant = {0}; +IconExtraColumn g_IECClear = {0}; +INT clistIcon = 0; //Icon slot to use +BYTE bUseAuthIcon = 0, bUseGrantIcon = 0, bContactMenuItem = 0, bIconsForRecentContacts = 0, bUseAuthGroup = 0; + +enum { +icon_none, +icon_auth, +icon_grant, +icon_both +}; + +PLUGININFOEX pluginInfo={ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, + 0, //doesn't replace anything built-in + {0xdace7d41, 0xdfa9, 0x4772, {0x89, 0xae, 0xa5, 0x9a, 0x61, 0x53, 0xe6, 0xb2}} +/* DACE7D41-DFA9-4772-89AE-A59A6153E6B2 */ +}; + +extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + g_hInst = hinstDLL; + return TRUE; +} + +/* 236CBB9A-57D2-419D-B5CB-0DF5926E921C */ +#define MIID_AUTHSTATE {0x236cbb9a, 0x57d2, 0x419d, {0xb5, 0xcb, 0x0d, 0xf5, 0x92, 0x6e, 0x92, 0x1c}} + +extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + static const MUUID interfaces[] = {MIID_AUTHSTATE, MIID_LAST}; + return interfaces; +} + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfo; +} + +INT_PTR getIconToUse(HANDLE hContact, LPARAM lParam) +{ + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); +// if (lParam == 1) return icon_none; + if (!DBGetContactSettingByte(hContact,"AuthState","ShowIcons",!bIconsForRecentContacts)) return icon_none; + + if (DBGetContactSettingByte(0,"ICQ","UseServerCList",0)) + if (DBGetContactSettingWord(hContact,proto,"ServerId",1) == 0) + return icon_both; + + if (bUseAuthIcon & bUseGrantIcon) + if (DBGetContactSettingByte(hContact,proto,"Auth",0) && DBGetContactSettingByte(hContact,proto,"Grant",0)) + return icon_both; + + if (bUseAuthIcon) + if (DBGetContactSettingByte(hContact,proto,"Auth",0)) + return icon_auth; + + if (bUseGrantIcon) + if (DBGetContactSettingByte(hContact,proto,"Grant",0)) + return icon_grant; + return icon_none; +} + +int onExtraImageApplying(WPARAM wParam, LPARAM lParam) +{ + if (wParam == NULL) + return 0; + + int usedIcon; + usedIcon = getIconToUse((HANDLE) wParam, lParam); + + if (hExtraIcon != NULL) + { + const char *icon; + switch (usedIcon) + { + case icon_both: icon = "authgrant_icon"; break; + case icon_grant: icon = "grant_icon"; break; + case icon_auth: icon = "auth_icon"; break; + default: icon = NULL; break; + } + ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, icon); + } + else + { + switch (usedIcon) + { + case icon_both: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECAuthGrant); break; + case icon_grant: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECGrant); break; + case icon_auth: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECAuth); break; + default: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECClear); break; + } + } + + return 0; +} + +int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam) +{ + g_IECAuth.cbSize = sizeof(IconExtraColumn); + g_IECAuth.ColumnType = clistIcon; + g_IECGrant.cbSize = sizeof(IconExtraColumn); + g_IECGrant.ColumnType = clistIcon; + g_IECAuthGrant.cbSize = sizeof(IconExtraColumn); + g_IECAuthGrant.ColumnType = clistIcon; + + if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) + { + if (ServiceExists(MS_SKIN2_ADDICON)) + { + g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"auth_icon"), (LPARAM)0); + g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"grant_icon"), (LPARAM)0); + g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"authgrant_icon"), (LPARAM)0); + } + else + { + g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_AUTH), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); + g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_GRANT), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); + g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_AUTHGRANT), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); + } + } + + return 0; +} + +int onContactSettingChanged(WPARAM wParam,LPARAM lParam) +{ + DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); + if (!proto) return 0; + + if (!lstrcmpA(cws->szModule,proto)) + if (!lstrcmpA(cws->szSetting,"Auth") || !lstrcmpA(cws->szSetting,"Grant") || !lstrcmpA(cws->szSetting,"ServerId")) + onExtraImageApplying(wParam, 1); + + return 0; +} + +int onDBContactAdded(WPARAM wParam, LPARAM lParam) +{ + // A new contact added, mark it as recent + DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", 1); + onExtraImageApplying(wParam, 0); + + return 0; +} + +INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam) +{ + byte enabled = DBGetContactSettingByte((HANDLE)wParam,"AuthState","ShowIcons",1); + DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", !enabled); + + if (enabled) + CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECClear); + else + onExtraImageApplying(wParam, 0); + + return 0; +} + +int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) +{ + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); + if (!proto) return 0; + + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(CLISTMENUITEM); + + if (!DBGetContactSettingByte((HANDLE)wParam,proto,"Auth",0) && !DBGetContactSettingByte((HANDLE)wParam,proto,"Grant",0) && DBGetContactSettingWord((HANDLE)wParam,proto,"ServerId",0)) + mi.flags = CMIF_TCHAR | CMIM_FLAGS | CMIF_HIDDEN; + else + mi.flags = CMIF_TCHAR | CMIM_FLAGS; + + if (DBGetContactSettingByte((HANDLE)wParam,"AuthState","ShowIcons",1)) + { + mi.flags |= CMIF_TCHAR | CMIM_NAME; + mi.ptszName = _T("Disable AuthState icons"); + } + else + { + mi.flags |= CMIF_TCHAR | CMIM_NAME; + mi.ptszName = _T("Enable AuthState icons"); + } + + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hUserMenu, (LPARAM)&mi); + + return 0; +} + +int onModulesLoaded(WPARAM wParam,LPARAM lParam) +{ + // hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild); + // hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying); + // IcoLib support + if (ServiceExists(MS_SKIN2_ADDICON)) + { + SKINICONDESC sid = {0}; + ZeroMemory(&sid, sizeof(sid)); + TCHAR szFile[MAX_PATH]; + sid.cbSize = sizeof(sid); + sid.flags = SIDF_ALL_TCHAR; + + sid.ptszSection = _T("Auth State"); + GetModuleFileName(g_hInst, szFile, MAX_PATH); + sid.ptszDefaultFile = szFile; + + sid.ptszDescription = _T("Auth"); + sid.pszName = "auth_icon"; + sid.iDefaultIndex = -IDI_AUTH; + CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + sid.ptszDescription = _T("Grant"); + sid.pszName = "grant_icon"; + sid.iDefaultIndex = -IDI_GRANT; + CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + sid.ptszDescription = _T("Auth & Grant"); + sid.pszName = "authgrant_icon"; + sid.iDefaultIndex = -IDI_AUTHGRANT; + CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + // hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild); + } + hExtraIcon = ExtraIcon_Register("authstate", "Auth State", "authgrant_icon"); + + if (hExtraIcon != NULL) + { + // Set initial value for all contacts + HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + while (hContact != NULL) + { + onExtraImageApplying((WPARAM)hContact, 1); + hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); + } + } + else + { + hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild); + hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild); + hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying); + onExtraImageListRebuild(0,0); + } + hOptInitialise = HookEvent(ME_OPT_INITIALISE, onOptInitialise); + if (bContactMenuItem) hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); + + // Updater support + if (ServiceExists(MS_UPDATE_REGISTER)) + { + Update update = {0}; + char szVersion[16]; + + update.cbSize = sizeof(Update); + + update.szComponentName = pluginInfo.shortName; + update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); + update.cpbVersion = lstrlenA((char *)update.pbVersion); + + update.szUpdateURL = UPDATER_AUTOREGISTER; + + // these are the three lines that matter - the archive, the page containing the version string, and the text (or data) + // before the version that we use to locate it on the page + // (note that if the update URL and the version URL point to standard file listing entries, the backend xml + // data will be used to check for updates rather than the actual web page - this is not true for beta urls) + update.szBetaUpdateURL = "http://thief.miranda.im/authstate.zip"; + update.szBetaVersionURL = "http://thief.miranda.im/updater/authstate_version.txt"; + update.szBetaChangelogURL = "http://thief.miranda.im"; + update.pbBetaVersionPrefix = (BYTE *)"AuthState "; + + update.cpbBetaVersionPrefix = lstrlenA((char *)update.pbBetaVersionPrefix); + + CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); + } + + return 0; +} + +int onSystemOKToExit(WPARAM wParam,LPARAM lParam) +{ + UnhookEvent(hHookModulesLoaded); + UnhookEvent(hHookExtraIconsRebuild); + UnhookEvent(hHookExtraIconsApply); + UnhookEvent(hOptInitialise); + UnhookEvent(hSystemOKToExit); + UnhookEvent(hContactSettingChanged); + if (hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged); + if (hContactAdded) UnhookEvent(hContactAdded); + if (hPrebuildContactMenu) + { + UnhookEvent(hPrebuildContactMenu); + UnhookEvent(hUserMenu); + } + DestroyServiceFunction(hAuthMenuSelected); + + return 0; +} + +extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) +{ + pluginLink = link; + mir_getLP(&pluginInfo); + mir_getMMI(&mmi); + + hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); + hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit); + hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); + + clistIcon = DBGetContactSettingByte(NULL, MODULENAME, "AdvancedIcon", DefaultSlot); + bUseAuthIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", 1); + bUseGrantIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", 1); + bContactMenuItem = DBGetContactSettingByte(NULL, MODULENAME, "MenuItem", 0); + bIconsForRecentContacts = DBGetContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", 0); + + hContactAdded = HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded); + + if (bContactMenuItem) + { + hAuthMenuSelected = CreateServiceFunction("AuthState/MenuItem", onAuthMenuSelected); + + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(CLISTMENUITEM); + mi.position = -1999901005; + mi.flags = CMIF_TCHAR; + mi.ptszName = _T("Enable AuthState icons"); + mi.pszService = "AuthState/MenuItem"; + hUserMenu = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi); + } + + g_IECClear.cbSize = sizeof(IconExtraColumn); + g_IECClear.ColumnType = clistIcon; + g_IECClear.hImage = (HANDLE) -1; + + return 0; +} + +extern "C" int __declspec(dllexport) Unload(void) +{ + return 0; +} diff --git a/AuthState/options.cpp b/AuthState/options.cpp new file mode 100644 index 0000000..37dbdca --- /dev/null +++ b/AuthState/options.cpp @@ -0,0 +1,154 @@ +/* + Authorization State plugin for Miranda-IM (www.miranda-im.org) + (c) 2006-2010 by Thief + + 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 + + File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/options.cpp $ + Revision : $Rev: 1686 $ + Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ + Last change by : $Author: ghazan $ + +*/ + +#include "commonheaders.h" + +const TCHAR* szAdvancedIcons[] = {_T("Email"), _T("Protocol"), _T("SMS"), _T("Advanced 1"), _T("Advanced 2"), _T("Web"), _T("Client"), _T("Advanced 3"), _T("Advanced 4"), _T("Advanced 5")}; +const INT cAdvancedIcons = sizeof(szAdvancedIcons) / sizeof(szAdvancedIcons[0]); + +INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static int bInitializing = 0; + switch (msg) + { + case WM_INITDIALOG: + { + TranslateDialogDefault(hwndDlg); + bInitializing = 1; + if (hExtraIcon==NULL) + { + for (int i = 0; i < cAdvancedIcons; i++) + { + SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szAdvancedIcons[i])); + } + SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_SETCURSEL, clistIcon-1, 0); + } + else + { + SendDlgItemMessage(hwndDlg,IDC_NOTICE, WM_SETTEXT,0,(LPARAM)TranslateT("Extraicons plugin is used, use Contact list > Extraicons for customize.")); + ShowWindow(GetDlgItem(hwndDlg, IDC_NOTICE), SW_SHOW); + EnableWindow(GetDlgItem(hwndDlg, IDC_ADVICON), 0); + } + + CheckDlgButton(hwndDlg, IDC_AUTHICON, bUseAuthIcon ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_GRANTICON, bUseGrantIcon ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ENABLEMENUITEM, bContactMenuItem ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ICONSFORRECENT, bIconsForRecentContacts ? BST_CHECKED : BST_UNCHECKED); + + bInitializing = 0; + return TRUE; + } + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_AUTHICON: + case IDC_GRANTICON: + case IDC_ENABLEMENUITEM: + case IDC_ICONSFORRECENT: + { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + } + case IDC_ADVICON: + { + if ((HIWORD(wParam) == EN_CHANGE) && (!bInitializing) || (HIWORD(wParam) == CBN_SELENDOK)) + { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + } + break; + } + } + break; + } + + case WM_NOTIFY: + { + if (((LPNMHDR)lParam)->idFrom == 0) + switch (((LPNMHDR)lParam)->code) + { + case PSN_APPLY: + { + bUseAuthIcon = IsDlgButtonChecked(hwndDlg, IDC_AUTHICON); + bUseGrantIcon = IsDlgButtonChecked(hwndDlg, IDC_GRANTICON); + bContactMenuItem = IsDlgButtonChecked(hwndDlg, IDC_ENABLEMENUITEM); + bIconsForRecentContacts = IsDlgButtonChecked(hwndDlg, IDC_ICONSFORRECENT); + + clistIcon = SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_GETCURSEL, 0, 0); + clistIcon++; + + HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + while (hContact) + { + CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&g_IECClear); + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); + } + + g_IECClear.ColumnType = clistIcon; + onExtraImageListRebuild(0,0); + + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + while (hContact) + { + onExtraImageApplying((WPARAM)hContact,0); + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); + } + + //Store options values to DB + DBWriteContactSettingByte(NULL, MODULENAME, "AdvancedIcon", clistIcon); + DBWriteContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", bUseAuthIcon); + DBWriteContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", bUseGrantIcon); + DBWriteContactSettingByte(NULL, MODULENAME, "MenuItem", bContactMenuItem); + DBWriteContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", bIconsForRecentContacts); + } + return TRUE; + } + } + + case WM_DESTROY: + break; + + } + return FALSE; +} + +int onOptInitialise(WPARAM wParam, LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp; + + ZeroMemory(&odp, sizeof(odp)); + odp.cbSize = sizeof(odp); + odp.position = 0; + odp.hInstance = g_hInst; + odp.ptszGroup = _T("Contact List"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_AUTHSTATE_OPT); + odp.ptszTitle = _T("Auth State"); + odp.pfnDlgProc = DlgProcOptions; + odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) &odp); + + return 0; +} diff --git a/AuthState/resource.h b/AuthState/resource.h new file mode 100644 index 0000000..49c8f2f --- /dev/null +++ b/AuthState/resource.h @@ -0,0 +1,25 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by authstate.rc +// +#define IDI_AUTH 101 +#define IDI_GRANT 102 +#define IDI_AUTHGRANT 103 +#define IDD_AUTHSTATE_OPT 103 +#define IDC_ADVICON 1001 +#define IDC_AUTHICON 1002 +#define IDC_GRANTICON 1003 +#define IDC_ENABLEMENUITEM 1005 +#define IDC_ICONSFORRECENT 1006 +#define IDC_NOTICE 1009 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 104 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1010 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/AuthState/version.h b/AuthState/version.h new file mode 100644 index 0000000..7894532 --- /dev/null +++ b/AuthState/version.h @@ -0,0 +1,28 @@ +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 0 +#define __RELEASE_NUM 2 +#define __BUILD_NUM 0 + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM +#define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM + +#define __STRINGIFY_IMPL(x) #x +#define __STRINGIFY(x) __STRINGIFY_IMPL(x) +#define __VERSION_STRING __STRINGIFY(__FILEVERSION_DOTS) + +#ifdef _UNICODE +#if defined(WIN64) || defined(_WIN64) + #define __PLUGIN_NAME "Authorization State (Unicode x64)" +#else + #define __PLUGIN_NAME "Authorization State (Unicode)" +#endif +#else + #define __PLUGIN_NAME "Authorization State" +#endif +#define __INTERNAL_NAME "AuthState" +#define __FILENAME "AuthState.dll" +#define __DESCRIPTION "If contact didn't authorized you this plugin puts an icon in front of contacts name." +#define __AUTHOR "Thief, idea by snwbrdr" +#define __AUTHOREMAIL "thief@miranda.im" +#define __AUTHORWEB "http://thief.miranda.im/" +#define __COPYRIGHT " 2006-2010 Alexander Turyak" diff --git a/AuthState/version.rc b/AuthState/version.rc new file mode 100644 index 0000000..2b1aaa9 --- /dev/null +++ b/AuthState/version.rc @@ -0,0 +1,40 @@ +// Microsoft Visual C++ generated resource script. +// +#include "afxres.h" +#include "version.h" + +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#endif //_WIN32 + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", __DESCRIPTION + VALUE "FileVersion", __FILEVERSION_DOTS + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME + VALUE "ProductVersion", __FILEVERSION_DOTS + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/BanControl/BETA b/BanControl/BETA new file mode 100644 index 0000000..2643c8e --- /dev/null +++ b/BanControl/BETA @@ -0,0 +1 @@ +BanControl_v.0.0.1.0 \ No newline at end of file diff --git a/BanControl/CHANGELOG.txt b/BanControl/CHANGELOG.txt new file mode 100644 index 0000000..3e86a46 --- /dev/null +++ b/BanControl/CHANGELOG.txt @@ -0,0 +1,30 @@ +/////////////////////////////////////////////////////////////////// +// Ban Control plugin for Miranda. Bans a contact for a specific time +// http://trac/BanControl/ +// Copyright (C) 2007 A. Chilaru (FlexLabs Inc. ) +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////// + + [*] Feature/code/some other change + [!] Bugfix + [+] New feature + [-] Feature remove + [c] Comment + +0.1.0.0: 2007-01-10 + --- Skeleton upload + +Copyright (C) 2006 A. Chilaru (FlexLabs Inc. ) \ No newline at end of file diff --git a/BanControl/LICENSE.txt b/BanControl/LICENSE.txt new file mode 100644 index 0000000..d511905 --- /dev/null +++ b/BanControl/LICENSE.txt @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/BanControl/README.txt b/BanControl/README.txt new file mode 100644 index 0000000..9a9a14a --- /dev/null +++ b/BanControl/README.txt @@ -0,0 +1,68 @@ +/////////////////////////////////////////////////////////////////// +// Ban Control plugin for Miranda. Bans a contact for a specific time +// http://trac/BanControl/ +// Copyright (C) 2007 A. Chilaru (FlexLabs Inc. ) +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////// + +1. About +-------- +The Ban Control plugin allows you to ban (ignore) a certain contact for some time. Options like saving history etc coming soon. + +2. Features +----------- + - Banning a contact + +4. Todo +------- + Lots of stuff + +5. History +---------- + See CHANGELOG.txt + +6. Known issues +--------------- + None known + +7. Latest development version: +------------------------------ + You can download the latest developement version from here: + http://trac/BanControl/trunk/bin/ + Alternatively, you can download the latest source code on the project homepage: + http://trac/BanControl/browser + +8. Bugs +------- + - Before sending reports check if bugs are still present in the latest developement version + - and that such a bug hasn't been submitted earlier: + http://trac/BanControl/report/3 + - [English or Russian] You can send bug reports on the project homepage: + http://trac/BanControl/newticket + +9. Discussion & Feature Requests +-------------------------------- + - Request features, discuss plugin at Miranda IM forum thread page: + http://forums.miranda-im.org/showthread.php?p= + - Or you can e-mail me them.. + - Feature requests can also be submitted ot the project homepage: + http://trac/BanControl/newticket + +10. Localisation +-------------------------------- +Coming soon + +Copyright (C) 2006 A. Chilaru (FlexLabs Inc. ) \ No newline at end of file diff --git a/BanControl/TRANSLATION.txt b/BanControl/TRANSLATION.txt new file mode 100644 index 0000000..e18fe15 --- /dev/null +++ b/BanControl/TRANSLATION.txt @@ -0,0 +1,21 @@ +/////////////////////////////////////////////////////////////////// +// Ban Control plugin for Miranda. Bans a contact for a specific time +// http://trac/BanControl/ +// Copyright (C) 2007 A. Chilaru (FlexLabs Inc. ) +// +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +/////////////////////////////////////////////////////////////////// + +This is a list of all the text lines that can be translated. I've already given them a value, so that you can see how to use them, if you don't know. Add these lines to your langpack file, and restart miranda to apply these settings. diff --git a/BanControl/common.arg b/BanControl/common.arg new file mode 100644 index 0000000..c32339f --- /dev/null +++ b/BanControl/common.arg @@ -0,0 +1,63 @@ + + STDFUNC _SetAllChildIcons@16 + "hCList" HWND + "hFirstItem" HANDLE + "iColumn" INT + "iImage" INT + END + + STDFUNC _SetListGroupIcons@16 + "hCList" HWND + "hFirstItem" HANDLE + "hParentItem" HMODULE + "groupChildCount" INT + END + + STDFUNC _SetAllContactIcons@4 + "hCList" HWND + END + + STDFUNC _ResetListOptions@4 + "hCList" HWND + END + + STDFUNC _MetaConClick@12 + "hContact" HWND + "iCount" INT + "iValue" INT + END + + STDFUNC _MetaSubClick@4 + "hParent" HWND + END + + STDFUNC _CallService@12 + "lpServiceName" ASCII + "wParam" HEX + "lParam" PTR + END + + STDFUNC _ServiceExists@4 + "lpServiceName" ASCII + END + + STDFUNC _HookEvent@8 + "lpHookNam" ASCII + "lpFunction" PTR + END + + STDFUNC _UnhookEvent@4 + "HookHandle" HANDLE + END + + STDFUNC _Translate@4 + "lpStr" ASCII + END + + STDFUNC _Error@4 + "lpStr" ASCII + END + + STDFUNC _IgnoreCheck@12 + "pStri" ASCII + END diff --git a/BanControl/inc/IcoLib.inc b/BanControl/inc/IcoLib.inc new file mode 100644 index 0000000..022dfb6 --- /dev/null +++ b/BanControl/inc/IcoLib.inc @@ -0,0 +1,51 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +SKINICONDESC struct + cbSize dd ? + pszSection dd ?;section name used to group icons + pszDescription dd ?;description for options dialog + pszName dd ?;name to refer to icon when playing and in db + ;this name is miranda-wide. so use prefixes of your plugin + ;e.g: "isee_connect", "clist_delete", etc + pszDefaultFile dd ?;default icon file to use + iDefaultIndex dd ? +SKINICONDESC ends + +SKINICONDESC2 struct + cbSize dd ? + pszSection dd ?;section name used to group icons + pszDescription dd ?;description for options dialog + pszName dd ?;name to refer to icon when playing and in db + pszDefaultFile dd ? + iDefaultIndex dd ? + hDefaultIcon dd ? +SKINICONDESC2 ends + +; +; Add a icon into options UI +; +; wParam = (WPARAM)0 +; lParam = (LPARAM)(SKINICONDESC*)sid; +; +;MS_SKIN2_ADDICON db "Skin2/Icons/AddIcon",0 +; +; Retrieve HICON with name specified in lParam +; Returned HICON SHOULDN'T be destroyed, it managed by IcoLib +; +;MS_SKIN2_GETICON "Skin2/Icons/GetIcon",0 +; +; Icons change notification +; +;ME_SKIN2_ICONSCHANGED "Skin2/IconsChanged",0 \ No newline at end of file diff --git a/BanControl/inc/m_clc.inc b/BanControl/inc/m_clc.inc new file mode 100644 index 0000000..12c13ee --- /dev/null +++ b/BanControl/inc/m_clc.inc @@ -0,0 +1,203 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +CLS_MANUALUPDATE equ 0001h ;todo +CLS_SHOWHIDDEN equ 0002h +CLS_HIDEOFFLINE equ 0004h ;hides all offline users +CLS_CHECKBOXES equ 0008h +CLS_MULTICOLUMN equ 0010h ;not true multi-column, just for ignore/vis options +CLS_HIDEEMPTYGROUPS equ 0020h ;note: this flag will be spontaneously removed if the 'new subgroup' menu item is clicked, for obvious reasons +CLS_USEGROUPS equ 0040h +CLS_NOHIDEOFFLINE equ 0080h ;overrides CLS_HIDEOFFLINE and the per-group hideoffline setting +CLS_GREYALTERNATE equ 0100h ;make every other line slightly grey +CLS_GROUPCHECKBOXES equ 0200h ;put checkboxes on groups too (managed by CLC) +CLS_CONTACTLIST equ 0400h ;this control will be the main contact list (v. 0.3.4.3+ 2004/11/02) + +CLS_EX_DISABLEDRAGDROP equ 00000001h +CLS_EX_EDITLABELS equ 00000002h +CLS_EX_SHOWSELALWAYS equ 00000004h +CLS_EX_TRACKSELECT equ 00000008h +CLS_EX_SHOWGROUPCOUNTS equ 00000010h +CLS_EX_DIVIDERONOFF equ 00000020h +CLS_EX_HIDECOUNTSWHENEMPTY equ 00000040h +CLS_EX_NOTRANSLUCENTSEL equ 00000080h +CLS_EX_LINEWITHGROUPS equ 00000100h +CLS_EX_QUICKSEARCHVISONLY equ 00000200h +CLS_EX_SORTGROUPSALPHA equ 00000400h +CLS_EX_NOSMOOTHSCROLLING equ 00000800h + + +CLM_FIRST equ 1000h ;this is the same as LVM_FIRST +CLM_LAST equ 1100h + +;messages, compare with equivalent TVM_s in the MSDN +CLM_ADDCONTACT equ (CLM_FIRST+0) ;wParam=hContact +CLM_ADDGROUP equ (CLM_FIRST+1) ;wParam=hGroup +CLM_AUTOREBUILD equ (CLM_FIRST+2) +CLM_DELETEITEM equ (CLM_FIRST+3) ;wParam=hItem +CLM_EDITLABEL equ (CLM_FIRST+4) ;wParam=hItem +CLM_ENDEDITLABELNOW equ (CLM_FIRST+5) ;wParam=cancel, 0 to save +CLM_ENSUREVISIBLE equ (CLM_FIRST+6) ;wParam=hItem, lParam=partialOk +CLE_TOGGLE equ -1 +CLE_COLLAPSE equ 0 +CLE_EXPAND equ 1 +CLE_INVALID equ FFFFh +CLM_EXPAND equ (CLM_FIRST+7) ;wParam=hItem, lParam=CLE_ +CLM_FINDCONTACT equ (CLM_FIRST+8) ;wParam=hContact, returns an hItem +CLM_FINDGROUP equ (CLM_FIRST+9) ;wParam=hGroup, returns an hItem +CLM_GETBKCOLOR equ (CLM_FIRST+10) ;returns a COLORREF +CLM_GETCHECKMARK equ (CLM_FIRST+11) ;wParam=hItem, returns 1 or 0 +CLM_GETCOUNT equ (CLM_FIRST+12) ;returns the total number of items +CLM_GETEDITCONTROL equ (CLM_FIRST+13) ;returns the HWND, or NULL +CLM_GETEXPAND equ (CLM_FIRST+14) ;wParam=hItem, returns a CLE_, CLE_INVALID if not a group +CLM_GETEXTRACOLUMNS equ (CLM_FIRST+15) ;returns number of extra columns +CLM_GETEXTRAIMAGE equ (CLM_FIRST+16) ;wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF +CLM_GETEXTRAIMAGELIST equ (CLM_FIRST+17) ;returns HIMAGELIST +CLM_GETFONT equ (CLM_FIRST+18) ;wParam=fontId, see clm_setfont. returns hFont. +CLM_GETINDENT equ (CLM_FIRST+19) ;wParam=new group indent +CLM_GETISEARCHSTRING equ (CLM_FIRST+20) ;lParam=(char*)pszStr, max 120 bytes, returns number of chars in string +CLM_GETITEMTEXT equ (CLM_FIRST+21) ;wParam=hItem, lParam=(char*)pszStr, max 120 bytes +CLM_GETSCROLLTIME equ (CLM_FIRST+22) ;returns time in ms +CLM_GETSELECTION equ (CLM_FIRST+23) ;returns hItem +CLCHT_ABOVE equ 0001h ;above client area +CLCHT_BELOW equ 0002h ;below client area +CLCHT_TOLEFT equ 0004h ;left of client area +CLCHT_TORIGHT equ 0008h ;right of client area +CLCHT_NOWHERE equ 0010h ;in client area, not on an item +CLCHT_ONITEMICON equ 0020h +CLCHT_ONITEMCHECK equ 0040h +CLCHT_ONITEMLABEL equ 0080h +CLCHT_ONITEMINDENT equ 0100h ;to the left of an item icon +CLCHT_ONITEMEXTRA equ 0200h ;on an extra icon, HIBYTE(HIWORD()) says which +CLCHT_ONITEM equ 03E0h +CLCHT_INLEFTMARGIN equ 0400h +CLCHT_BELOWITEMS equ 0800h ;in client area but below last item +CLM_HITTEST equ (CLM_FIRST+25) ;lParam=MAKELPARAM(x,y) (relative to control), wParam=(PDWORD)&hitTest (see encoding of HitTest() in clc.h, can be NULL) returns hItem or NULL +CLM_SELECTITEM equ (CLM_FIRST+26) ;wParam=hItem +CLB_TOPLEFT equ 0 +CLB_STRETCHV equ 1 +CLB_STRETCHH equ 2 ;and tile vertically +CLB_STRETCH equ 3 +CLBM_TYPE equ 00FFh +CLBF_TILEH equ 1000h +CLBF_TILEV equ 2000h +CLBF_PROPORTIONAL equ 4000h +CLBF_SCROLL equ 8000h +CLM_SETBKBITMAP equ (CLM_FIRST+27) ;wParam=mode, lParam=hBitmap (don't delete it), NULL for none +CLM_SETBKCOLOR equ (CLM_FIRST+28) ;wParam=a COLORREF, default is GetSysColor(COLOR_3DFACE) +CLM_SETCHECKMARK equ (CLM_FIRST+29) ;wParam=hItem, lParam=1 or 0 +CLM_SETEXTRACOLUMNS equ (CLM_FIRST+30) ;wParam=number of extra columns (zero to MAXEXTRACOLUMNS from clc.h, currently 16) +CLM_SETEXTRAIMAGE equ (CLM_FIRST+31) ;wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFF is a blank +CLM_SETEXTRAIMAGELIST equ (CLM_FIRST+32) ;lParam=HIMAGELIST + +FONTID_CONTACTS equ 0 +FONTID_INVIS equ 1 +FONTID_OFFLINE equ 2 +FONTID_NOTONLIST equ 3 +FONTID_GROUPS equ 4 +FONTID_GROUPCOUNTS equ 5 +FONTID_DIVIDER equ 6 +FONTID_OFFINVIS equ 7 +FONTID_STATUSMSG equ 8 +FONTID_GROUPSCLOSED equ 9 +FONTID_CONTACTSHOVER equ 10 +FONTID_MAX equ 18 + +CLM_SETFONT equ (CLM_FIRST+33) ;wParam=hFont, lParam=MAKELPARAM(fRedraw,fontId) +CLM_SETINDENT equ (CLM_FIRST+34) ;wParam=new indent, default is 3 pixels +CLM_SETITEMTEXT equ (CLM_FIRST+35) ;wParam=hItem, lParam=(char*)pszNewText +CLM_SETSCROLLTIME equ (CLM_FIRST+36) ;wParam=time in ms, default 200 + +CLM_SETHIDEEMPTYGROUPS equ (CLM_FIRST+38) ;wParam=TRUE/FALSE +GREYF_UNFOCUS equ 80000000h +MODEF_OFFLINE equ 40000000h + +;and use the PF2_ #defines from m_protosvc.h +CLM_SETGREYOUTFLAGS equ (CLM_FIRST+39) ;wParam=new flags +CLM_GETHIDEOFFLINEROOT equ (CLM_FIRST+40) ;returns TRUE/FALSE +CLM_SETHIDEOFFLINEROOT equ (CLM_FIRST+41) ;wParam=TRUE/FALSE +CLM_SETUSEGROUPS equ (CLM_FIRST+42) ;wParam=TRUE/FALSE +CLM_SETOFFLINEMODES equ (CLM_FIRST+43) ;for 'hide offline', wParam=PF2_ flags and MODEF_OFFLINE +CLM_GETEXSTYLE equ (CLM_FIRST+44) ;returns CLS_EX_ flags +CLM_SETEXSTYLE equ (CLM_FIRST+45) ;wParam=CLS_EX_ flags +CLM_GETLEFTMARGIN equ (CLM_FIRST+46) ;returns count of pixels +CLM_SETLEFTMARGIN equ (CLM_FIRST+47) ;wParam=pixels + +CLCINFOITEM struct + cbSize dd ? + pszText dd ? + hParentGroup dd ? + flags dd ? + hIcon dd ? +CLCINFOITEM ends + +CLCIIF_BELOWGROUPS equ 1 ;put it between groups and contacts, default is at top +CLCIIF_BELOWCONTACTS equ 2 ;put it at the bottom +CLCIIF_CHECKBOX equ 40h ;give this item a check box +CLCIIF_GROUPFONT equ 80h ;draw the item using FONTID_GROUPS + +CLM_ADDINFOITEMA equ (CLM_FIRST+48) ;lParam=&cii, returns hItem +CLM_ADDINFOITEMW equ (CLM_FIRST+53) ;lParam=&cii, returns hItem +IFDEF _UNICODE + CLM_ADDINFOITEM equ CLM_ADDINFOITEMW +ELSE + CLM_ADDINFOITEM equ CLM_ADDINFOITEMA +ENDIF + +CLCIT_INVALID equ -1 +CLCIT_GROUP equ 0 +CLCIT_CONTACT equ 1 +CLCIT_DIVIDER equ 2 +CLCIT_INFO equ 3 +CLM_GETITEMTYPE equ (CLM_FIRST+49) ;wParam=hItem, returns a CLCIT_ +CLGN_ROOT equ 0 +CLGN_CHILD equ 1 +CLGN_PARENT equ 2 +CLGN_NEXT equ 3 +CLGN_PREVIOUS equ 4 +CLGN_NEXTCONTACT equ 5 +CLGN_PREVIOUSCONTACT equ 6 +CLGN_NEXTGROUP equ 7 +CLGN_PREVIOUSGROUP equ 8 +CLM_GETNEXTITEM equ (CLM_FIRST+50) ;wParam=flag, lParam=hItem, returns an hItem +CLM_GETTEXTCOLOR equ (CLM_FIRST+51) ;wParam=FONTID_, returns COLORREF +CLM_SETTEXTCOLOR equ (CLM_FIRST+52) ;wParam=FONTID_, lParam=COLORREF + +;notifications (most are omitted because the control processes everything) +CLNF_ISGROUP equ 1 +CLNF_ISINFO equ 2 + +NMCLISTCONTROL struct + hdr NMHDR <> + hItem dd ? + action dd ? + iColumn dd ? ;-1 if not on an extra column + flags dd ? + pt POINT <> +NMCLISTCONTROL ends + +CLN_FIRST equ (0-100) +CLN_EXPANDED equ (CLN_FIRST-0) ;hItem=hGroup, action=CLE_* +CLN_LISTREBUILT equ (CLN_FIRST-1) +CLN_ITEMCHECKED equ (CLN_FIRST-2) ;todo //hItem,action,flags valid +CLN_DRAGGING equ (CLN_FIRST-3) ;hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed +CLN_DROPPED equ (CLN_FIRST-4) ;hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed +CLN_LISTSIZECHANGE equ (CLN_FIRST-5) ;pt.y valid. the vertical height of the visible items in the list has changed. +CLN_OPTIONSCHANGED equ (CLN_FIRST-6) ;nothing valid. If you set some extended options they have been overwritten and should be re-set +CLN_DRAGSTOP equ (CLN_FIRST-7) ;hItem,flags valid. sent when cursor goes back in to the window having been outside, return nonzero if processed +CLN_NEWCONTACT equ (CLN_FIRST-8) ;hItem,flags valid. sent when a new contact is added without a full list rebuild +CLN_CONTACTMOVED equ (CLN_FIRST-9) ;hItem,flags valid. sent when contact is moved without a full list rebuild +CLN_CHECKCHANGED equ (CLN_FIRST-10) ;hItem,flags valid. sent when any check mark is changed, but only for one change if there are many +;NM_CLICK //hItem,iColumn,pt,flags valid +;NM_KEYDOWN //NMKEY structure, only sent when key is not already processed, return nonzero to prevent further processing \ No newline at end of file diff --git a/BanControl/inc/m_clist.inc b/BanControl/inc/m_clist.inc new file mode 100644 index 0000000..e277e99 --- /dev/null +++ b/BanControl/inc/m_clist.inc @@ -0,0 +1,33 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +CLISTMENUITEM struc + cbSize dd ? + UNION NONUNIQUE + pszName dd ? + ptszName dd ? + ENDS + flags dd ? + position dd ? + hIcon HICON ? + pszService dd ? + ;UNION NONUNIQUE + pszPopupName dd ? + ; ptszPopupName dd ? + ; ENDS + popupPosition dd ? + hotKey dd ? + pszContactOwner dd ? +CLISTMENUITEM ends + diff --git a/BanControl/inc/m_database.inc b/BanControl/inc/m_database.inc new file mode 100644 index 0000000..b5cd683 --- /dev/null +++ b/BanControl/inc/m_database.inc @@ -0,0 +1,60 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +DBCONTACTGETSETTING struct + szModule dd ? + szSetting dd ? + pValue dd ? +DBCONTACTGETSETTING ends + +DBCONTACTWRITESETTING struct + szModule dd ? + szSetting dd ? + VAR1 dd ? + VAR2 dd ? + VAR3 dd ? +DBCONTACTWRITESETTING ends + +DBVT_DELETED equ 0 ;this setting just got deleted, no other values are valid +DBVT_BYTE equ 1 ;bVal and cVal are valid +DBVT_WORD equ 2 ;wVal and sVal are valid +DBVT_DWORD equ 4 ;dVal and lVal are valid +DBVT_ASCIIZ equ 255 ;pszVal is valid +DBVT_BLOB equ 254 ;cpbVal and pbVal are valid +DBVT_UTF8 equ 253 ;pszVal is valid +DBVT_WCHAR equ 252 ;pszVal is valid +DBVTF_VARIABLELENGTH equ 80h + +DBVARIANT struct + VAR1 dd ? + VAR2 dd ? + VAR3 dd ? +DBVARIANT ends + +DBEVENTINFO struct + cbSize dd ? + szModule dd ? + timestamp dd ? + flags dd ? + eventType dd ? + cbBlob dd ? + pBlob dd ? +DBEVENTINFO ends + +EVENTTYPE_MESSAGE equ 0 +EVENTTYPE_URL equ 1 +EVENTTYPE_CONTACTS equ 2 ;v0.1.2.2+ +EVENTTYPE_ADDED equ 1000 ;v0.1.1.0+: these used to be module- +EVENTTYPE_AUTHREQUEST equ 1001 ;specific codes, hence the module- +EVENTTYPE_FILE equ 1002 ;specific limit has been raised to 2000 \ No newline at end of file diff --git a/BanControl/inc/m_langpack.inc b/BanControl/inc/m_langpack.inc new file mode 100644 index 0000000..ffe77f5 --- /dev/null +++ b/BanControl/inc/m_langpack.inc @@ -0,0 +1,30 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +IFDEF _UNICODE + LANG_UNICODE equ 1000h +ELSE + LANG_UNICODE equ 0 +ENDIF + +LANGPACKTRANSLATEDIALOG struct + cbSize dd ? + flags dd ? + hwndDlg dd ? + ignoreControls dd ? +LANGPACKTRANSLATEDIALOG ends + +LPTDF_NOIGNOREEDIT equ 1 ;translate all edit controls. By default + ;non-read-only edit controls are not translated +LPTDF_NOTITLE equ 2 ;do not translate the title of the dialog diff --git a/BanControl/inc/m_metacontacts.inc b/BanControl/inc/m_metacontacts.inc new file mode 100644 index 0000000..3294ff2 --- /dev/null +++ b/BanControl/inc/m_metacontacts.inc @@ -0,0 +1,149 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +;get the handle for a contact's parent metacontact +;wParam=(HANDLE)hSubContact +;lParam=0 +;returns a handle to the parent metacontact, or null if this contact is not a subcontact +;MS_MC_GETMETACONTACT "MetaContacts/GetMeta" + +;gets the handle for the default contact +;wParam=(HANDLE)hMetaContact +;lParam=0 +;returns a handle to the default contact, or null on failure +;MS_MC_GETDEFAULTCONTACT "MetaContacts/GetDefault" + +;gets the contact number for the default contact +;wParam=(HANDLE)hMetaContact +;lParam=0 +;returns a DWORD contact number, or -1 on failure +;MS_MC_GETDEFAULTCONTACTNUM "MetaContacts/GetDefaultNum" + +;gets the handle for the 'most online' contact +;wParam=(HANDLE)hMetaContact +;lParam=0 +;returns a handle to the 'most online' contact +;MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline" + +;gets the number of subcontacts for a metacontact +;wParam=(HANDLE)hMetaContact +;lParam=0 +;returns a DWORD representing the number of subcontacts for the given metacontact +;MS_MC_GETNUMCONTACTS "MetaContacts/GetNumContacts" + +;gets the handle of a subcontact, using the subcontact's number +;wParam=(HANDLE)hMetaContact +;lParam=(DWORD)contact number +;returns a handle to the specified subcontact +;MS_MC_GETSUBCONTACT "MetaContacts/GetSubContact" + +;sets the default contact, using the subcontact's contact number +;wParam=(HANDLE)hMetaContact +;lParam=(DWORD)contact number +;returns 0 on success +;MS_MC_SETDEFAULTCONTACTNUM "MetaContacts/SetDefault" + +;sets the default contact, using the subcontact's handle +;wParam=(HANDLE)hMetaContact +;lParam=(HANDLE)hSubcontact +;returns 0 on success +;MS_MC_SETDEFAULTCONTACT "MetaContacts/SetDefaultByHandle" + +;forces the metacontact to send using a specific subcontact, using the subcontact's contact number +;wParam=(HANDLE)hMetaContact +;lParam=(DWORD)contact number +;returns 0 on success +;MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact" + +;forces the metacontact to send using a specific subcontact, using the subcontact's handle +;wParam=(HANDLE)hMetaContact +;lParam=(HANDLE)hSubcontact +;returns 0 on success (will fail if 'force default' is in effect) +;MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle" + +;'unforces' the metacontact to send using a specific subcontact +;wParam=(HANDLE)hMetaContact +;lParam=0 +;returns 0 on success (will fail if 'force default' is in effect) +;MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact" + +;'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact +; overrides (and clears) 'force send' above, and will even force use of offline contacts +; will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event +;wParam=(HANDLE)hMetaContact +;lParam=0 +;returns 1(true) or 0(false) representing new state of 'force default' +;MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault" + +; method to get state of 'force' for a metacontact +; wParam=(HANDLE)hMetaContact +; lParam= (DWORD)&contact_number or NULL +; +; if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to, +; or if none is in force, the value (DWORD)-1 will be copied +; (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above) +;MS_MC_GETFORCESTATE "MetaContacts/GetForceState" + +; fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set) +; wParam=(HANDLE)hMetaContact +; lParam=(HANDLE)hDefaultContact +;ME_MC_DEFAULTTCHANGED "MetaContacts/DefaultChanged" + +; fired when a metacontact's subcontacts change (fired upon creation of metacontact, when contacts are added or removed, and when +; contacts are reordered) - a signal to re-read metacontact data +; wParam=(HANDLE)hMetaContact +; lParam=0 +;ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged" + +; fired when a metacontact is forced to send using a specific subcontact +; wParam=(HANDLE)hMetaContact +; lParam=(HANDLE)hForceContact +;ME_MC_FORCESEND "MetaContacts/ForceSend" + +; fired when a metacontact is 'unforced' to send using a specific subcontact +; wParam=(HANDLE)hMetaContact +; lParam=0 +;ME_MC_UNFORCESEND "MetaContacts/UnforceSend" + +; method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :) +; wParam=lParam=0 +;MS_MC_GETPROTOCOLNAME "MetaContacts/GetProtoName" + + +; added 0.9.5.0 (22/3/05) +; wParam=(HANDLE)hContact +; lParam=0 +; convert a given contact into a metacontact +;MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact" + +; added 0.9.5.0 (22/3/05) +; wParam=(HANDLE)hContact +; lParam=(HANDLE)hMeta +; add an existing contact to a metacontact +;MS_MC_ADDTOMETA "MetaContacts/AddToMetacontact" + +; added 0.9.5.0 (22/3/05) +; wParam=0 +; lParam=(HANDLE)hContact +; remove a contact from a metacontact +;MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact" + + +; added 0.9.13.2 (6/10/05) +; wParam=(BOOL)disable +; lParam=0 +; enable/disable the 'hidden group hack' - for clists that support subcontact hiding using 'IsSubcontact' setting +; should be called once in the clist 'onmodulesloaded' event handler (which, since it's loaded after the db, will be called +; before the metacontact onmodulesloaded handler where the subcontact hiding is usually done) +;MS_MC_DISABLEHIDDENGROUP "MetaContacts/DisableHiddenGroup" diff --git a/BanControl/inc/m_options.inc b/BanControl/inc/m_options.inc new file mode 100644 index 0000000..cfbf539 --- /dev/null +++ b/BanControl/inc/m_options.inc @@ -0,0 +1,36 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +OPTIONSDIALOGPAGE struct + cbSize dd ? ;cbSize + position dd ? ;position + pszTitle dd ? ;*pszTitle + pfnDlgProc dd ? ;pfnDlgProc + pszTemplate dd ? ;*pszTemplate + hInstance dd ? ;hInstance + hIcon dd ? ;hIcon + pszGroup dd ? ;*pszGroup + groupPosition dd ? ;groupPosition + hGroupIcon dd ? ;hGroupIcon + flags dd ? ;flags + nIDBottomSimpleControl dd ? ;nIDBottomSimpleControl + nIDRightSimpleControl dd ? ;nIDRightSimpleControl + expertOnlyControls dd ? ;*expertOnlyControls + nExpertOnlyControls dd ? ;nExpertOnlyControls +OPTIONSDIALOGPAGE ends + +ODPF_SIMPLEONLY equ 1 ; page is only shown when in simple mode +ODPF_EXPERTONLY equ 2 ; " expert mode +ODPF_BOLDGROUPS equ 4 ; give group box titles a bold font +ODPF_UNICODE equ 8 ; string fields in OPTIONSDIALOGPAGE are WCHAR* diff --git a/BanControl/inc/m_protocols.inc b/BanControl/inc/m_protocols.inc new file mode 100644 index 0000000..bbe3542 --- /dev/null +++ b/BanControl/inc/m_protocols.inc @@ -0,0 +1,14 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + diff --git a/BanControl/inc/m_protosvc.inc b/BanControl/inc/m_protosvc.inc new file mode 100644 index 0000000..15cbb10 --- /dev/null +++ b/BanControl/inc/m_protosvc.inc @@ -0,0 +1,18 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +PFLAGNUM_1 equ 1 +PF1_IMSEND equ 00000001h ;supports IM sending +PF1_IMRECV equ 00000002h ;supports IM receiving +PF1_IM equ (PF1_IMSEND or PF1_IMRECV) \ No newline at end of file diff --git a/BanControl/inc/m_updater.inc b/BanControl/inc/m_updater.inc new file mode 100644 index 0000000..a10d992 --- /dev/null +++ b/BanControl/inc/m_updater.inc @@ -0,0 +1,29 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +UPDATE struct + cbSize dd ? + szComponentName dd ? + szVersionURL dd ? + pbVersionPrefix dd ? + cpbVersionPrefix dd ? + szUpdateURL dd ? + szBetaVersionURL dd ? + pbBetaVersionPrefix dd ? + cpbBetaVersionPrefix dd ? + szBetaUpdateURL dd ? + pbVersion dd ? + cpbVersion dd ? + szBetaChangelogURL dd ? +UPDATE ends \ No newline at end of file diff --git a/BanControl/inc/newpluginapi.inc b/BanControl/inc/newpluginapi.inc new file mode 100644 index 0000000..398d4cd --- /dev/null +++ b/BanControl/inc/newpluginapi.inc @@ -0,0 +1,44 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +PLUGININFO struc + cbSize dd ? + shortName dd ? + version dd ? + description dd ? + author dd ? + authorEmail dd ? + copyright dd ? + homepage dd ? + isTransient dd ? + replacesDefaultModule dd ? +PLUGININFO ends + +PLUGINLINK struc + lpCreateHookableEvent dd ? ;(const char *); + lpDestroyHookableEvent dd ? ;(HANDLE); + lpNotifyEventHooks dd ? ;(HANDLE,WPARAM,LPARAM); + lpHookEvent dd ? ;(const char *,MIRANDAHOOK); + lpHookEventMessage dd ? ;(const char *,HWND,UINT); + lpUnhookEvent dd ? ;(HANDLE); + lpCreateServiceFunction dd ? ;(const char *,MIRANDASERVICE) + lpCreateTransientServiceFunction dd ? ;(const char *,MIRANDASERVICE) + lpDestroyServiceFunction dd ? ;(HANDLE) + lpCallService dd ? ;(const char *,WPARAM,LPARAM) + lpServiceExists dd ? ;(const char *); //v0.1.0.1+ + lpCallServiceSync dd ? ;(const char *,WPARAM,LPARAM); //v0.3.3+ + lpCallFunctionAsync dd ? ;(void (__stdcall *)(void *), void *); //v0.3.4+ + lpSetHookDefaultForHookableEvent dd ? ;(HANDLE, MIRANDAHOOK); // v0.3.4 (2004/09/15) +PLUGINLINK ends + diff --git a/BanControl/inc/statusmodes.inc b/BanControl/inc/statusmodes.inc new file mode 100644 index 0000000..609084e --- /dev/null +++ b/BanControl/inc/statusmodes.inc @@ -0,0 +1,26 @@ +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +MAX_CONNECT_RETRIES equ 10000 +ID_STATUS_OFFLINE equ 40071 +ID_STATUS_ONLINE equ 40072 +ID_STATUS_AWAY equ 40073 +ID_STATUS_DND equ 40074 +ID_STATUS_NA equ 40075 +ID_STATUS_OCCUPIED equ 40076 +ID_STATUS_FREECHAT equ 40077 +ID_STATUS_INVISIBLE equ 40078 +ID_STATUS_ONTHEPHONE equ 40079 +ID_STATUS_OUTTOLUNCH equ 40080 +ID_STATUS_IDLE equ 40081 ;do not use as a status \ No newline at end of file diff --git a/BanControl/plugin/BanControl.asm b/BanControl/plugin/BanControl.asm new file mode 100644 index 0000000..b8e7e8d --- /dev/null +++ b/BanControl/plugin/BanControl.asm @@ -0,0 +1,1160 @@ +;Ban Control plugin for Miranda. Bans a contact for a specific time +;Copyright (C) 2007 A. Chilaru +; +;This program is free software; you can redistribute it and/or +;modify it under the terms of the GNU General Public License +;as published by the Free Software Foundation; either version 2 +;of the License, or (at your option) any later version. +; +;This program is distributed in the hope that it will be useful, +;but WITHOUT ANY WARRANTY; without even the implied warranty of +;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;GNU General Public License for more details. +; +;You should have received a copy of the GNU General Public License +;along with this program; if not, write to the Free Software +;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +.386 +.model flat,stdcall +option casemap:none +include \masm32\include\windows.inc +include \masm32\include\kernel32.inc +include \masm32\include\user32.inc +include \masm32\include\comctl32.inc +include \masm32\include\gdi32.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\IcoLib.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_clist.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_clc.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_database.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_langpack.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_options.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_protocols.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_protosvc.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_updater.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\newpluginapi.inc +include \masm32\FlexLabs\BanControl\Source\trunk\inc\statusmodes.inc + +includelib \masm32\lib\kernel32.lib +includelib \masm32\lib\user32.lib +includelib \masm32\lib\comctl32.lib +includelib \masm32\lib\gdi32.lib + + ;function definitions for debuggers + ;hook functions are C-style functions. The rest are stdcall +OptInit proto C wParam:DWORD, lParam:DWORD +Message proto C wParam:DWORD, lParam:DWORD +MdLoaded proto C wParam:DWORD, lParam:DWORD +IcoLibEv proto C wParam:DWORD, lParam: DWORD + +CallService proto lpServiceName:DWORD, wParam:DWORD, lParam:DWORD +ServiceExists proto lpServiceName:DWORD +HookEvent proto lpHookName:DWORD, lpFunction:DWORD +UnhookEvent proto HookHandle:DWORD + +Translate proto lpStr:DWORD +Error proto lpStr:DWORD +ResetListOptions proto hCList:DWORD +SetAllContactIcons proto hCList:DWORD +SetListGroupIcons proto hCList:DWORD, hFirstItem:DWORD, hParentItem:DWORD, groupChildCount:DWORD +SetAllChildIcons proto hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD +MetaConClick proto hContact:DWORD, iCount:DWORD, iValue: DWORD +MetaSubClick proto hContact:DWORD + +DLGHDR struct ;Structure to hold info about tabs + hDlg dd ? + hTab dd ? + hDisplay dd ? + rcDisplay RECT <> + hTab1 dd ? + hTab2 dd ? +DLGHDR ends + + ;Macro to create lParam DWORD from two WORDs (low WORDs used if DWORD given) +MAKELPARAM macro lowWord, highWord + push ebx + mov ebx, lowWord + mov eax, highWord + shl eax, 16 + mov ax, bx + pop ebx + ENDM + +.const + ;option controls +IDC_ENABLED equ 40071 ;Plugin enables checkbox ID +IDC_PROTO equ 40081 ;Protocol listbox ID +IDC_STARTTIME equ 40088 ;time selector +IDC_ENDTIME equ 40089 ;time selector +IDC_SHOWHIDDEN equ 50071 ;Show hidden contacts + +IDC_CLIST equ 3000 ;CList component + +IDI_BAN equ 101 ;PC icon + + ;const from miranda resource file (small dot in CListControl) +IDI_SMALLDOT equ 211 + + ;const from skin header +SKINICON_EVENT_MESSAGE equ 100 + +WM_IMGLIST equ WM_USER+273 + +.data +hInstance dd 0 ;Plugin hWnd +hApp dd 0 ;Miranda .exe hWnd +hDlgWnd dd 0 ;Option dialog hWnd +hIcoLibEv dd 0 ;IcoLib dialog hWnd +hIml dd 0 ;Image list +hItemAll dd 0 ;CListControl "Group" ** All contacts **" +hItemUnk dd 0 ;CListControl "Group" ** Unknown contacts **" + +ddRetAddr dd 0 ;Miranda proto ret. address +ddRetStack dd 0 ;Miranda proto EBP backup + +hMsgHook dd 0 ;Message hook hWnd +hOptHook dd 0 ;Options hook hWnd +hMdLHook dd 0 ;Modules loaded hook + +ddVar1 dd 0 +ddVar2 dd 0 ;Just three DWORD variables ;) +ddVar3 dd 0 +ddInt dd 0 +ddFlags dd 0 ;Various flags. Descriptions (starting from the lower bit) + ;Reserved + ;OptEditing2 On while options are loaded from the DB + ;OptEditing2 On while options are loaded from the DB + ;noUniConvert Don't convert to Unicode while translating + +sPluginInfo PLUGININFO <0> ;plugin info structure +sPluginLink PLUGINLINK <> ;miranda procedure adresses structure +sOptionsPage OPTIONSDIALOGPAGE <0> ;options struct +sDBVariant DBVARIANT <> ;DB write/get variable struct +sDBGetSetting DBCONTACTGETSETTING <> ;DB get struct +sDBWriteSetting DBCONTACTWRITESETTING <>;DB write struct +sDBEventInfo DBEVENTINFO <> ;Event ifnfo struct +sUpdate UPDATE <0> ;Updater struct +sTCITEM TCITEM <0> ;struct for tabbing +sDlgHdr DLGHDR <0> ;struct for tabbing +sSystemTime SYSTEMTIME <> ;datetime struct +sLngPackDialog LANGPACKTRANSLATEDIALOG <> ;langpack dialog struct +sClcInfoItem CLCINFOITEM <> ;contact list child item info +sSkinIconDesc SKINICONDESC <> ;IcoLib struct + + ;plugin details +szShortName db "Ban Control",0 +szShortNamev db "Ban Control " +IFDEF _UNICODE + szPlVer db "(Unicode)",0 +ELSE + szPlVer db "(ANSI)",0 +ENDIF +ddVersion dd 00000100h +szDescription db "The plugin allows banning users for a certain time.",10,13,"Allows saving history, exporting it or disabling and other options.",0 +szAuthor db "A. Chilaru",0 +szAthorEmail db "flexlabs@gmail.com",0 +szCopyright db " 2007 A. Chilaru (FlexLabs Inc.)",0 +szHomepage db "http://dev.mirandaim.ru/~flexer/",0 + + ;additional details for updater +IFDEF _UNICODE + szURL db "http://addons.miranda-im.org/",0 + szURLKey db "Ban Control (Unicode) ",0 + ddURLKeyLen dd 33h + szDnURL db "http://addons.miranda-im.org/",0 +ELSE + szURL db "http://addons.miranda-im.org/",0 + szURLKey db "Ban Control (ANSI) ",0 + ddURLKeyLen dd 30h + szDnURL db "http://addons.miranda-im.org/",0 +ENDIF +szBetaURL db "http://svn.mirandaim.ru/mainrepo/bancontrol/trunk/BETA",0 +szBetaURLKey db "BanControl_v.",0 +ddBetaURLKeyLen dd 0Dh +IFDEF _UNICODE + szBetaDnURL db "http://svn.mirandaim.ru/mainrepo/bancontrol/trunk/bin/BanControlW.dll",0 +ELSE + szBetaDnURL db "http://svn.mirandaim.ru/mainrepo/bancontrol/trunk/bin/BanControlA.dll",0 +ENDIF +szVersion db "0.0.1.0",0 +ddVersionLen dd 07h +ddBeta dd 1 ;If plugin is beta - 1. Else - 0 +szBetaChangelogURL db "http://svn.mirandaim.ru/mainrepo/bancontrol/trunk/CHANGELOG.txt",0 + + ;miranda functions +MS_DB_CONTACT_GETSETTING db "DB/Contact/GetSetting",0 +MS_DB_CONTACT_WRITESETTING db "DB/Contact/WriteSetting",0 +MS_DB_CONTACT_FINDFIRST db "DB/Contact/FindFirst",0 +MS_DB_CONTACT_FINDNEXT db "DB/Contact/FindNext",0 +MS_DB_EVENT_GET db "DB/Event/Get",0 +MS_DB_EVENT_GETBLOBSIZE db "DB/Event/GetBlobSize",0 +MS_DB_EVENT_GETCONTACT db "DB/Event/GetContact",0 +MS_PROTO_GETCONTACTBASEPROTO db "Proto/GetContactBaseProto",0 +MS_CLIST_ADDMAINMENUITEM db "CList/AddMainMenuItem",0 +MS_CLIST_GETSTATUSMODE db "CList/GetStatusMode",0 +MS_OPT_ADDPAGE db "Opt/AddPage",0 +MS_PROTO_ENUMPROTOCOLS db "Proto/EnumProtocols",0 +MS_MC_GETMETACONTACT db "MetaContacts/GetMeta",0 +MS_MC_GETSUBCONTACT db "MetaContacts/GetSubContact",0 +ME_SYSTEM_MODULESLOADED db "Miranda/System/ModulesLoaded",0 +MS_SKIN_LOADICON db "Skin/Icons/Load",0 +MS_SKIN2_ADDICON db "Skin2/Icons/AddIcon",0 +MS_SKIN2_GETICON db "Skin2/Icons/GetIcon",0 +MS_UPDATE_REGISTER db "Update/Register",0 +MS_LANGPACK_TRANSLATESTRING db "LangPack/TranslateString",0 +MS_LANGPACK_TRANSLATEDIALOG db "LangPack/TranslateDialog",0 + +PS_GETCAPS db "/GetCaps",0 ;Takes form of "PROTO/GetCaps",0 (GetCapabilities of a PROTO) + + ;miranda events +ME_DB_EVENT_ADDED db "DB/Event/Added",0 +ME_OPT_INITIALISE db "Opt/Initialise",0 +ME_SKIN2_ICONSCHANGED db "Skin2/IconsChanged",0 + + ;options +szOptGroup db "Events",0 +szOptGroupW db "Unicod",0 +szOptTitle db "Ban Control",0 +szOptTitleW db "UnicodeUnic",0 +szOModule db "BanControl",0 +szOFlags db "Flags",0 +szOTime db "Time",0 +szOEnabled db "Enabled",0 +szONotOnList db "NotOnList",0 +szOCList db "CList",0 +szOShowHidden db "ShowHidden",0 +szOMetaContacts db "MetaContacts",0 +szOMetaCount db "NumContacts",0 +szOMetaLink db "MetaLink",0 + + ;tab captions +szTab1 db "Options",0 +szTab1W db "Unicode",0 +szTab2 db "Contacts",0 +szTab2W db "UnicodeU",0 + + ;IcoLib +szIlDesc db "Enabled",0 +szIlName db "banc_icon",0 + + ;other strings +szDtFormat db "HH':'mm",0 +szError db "Default error message",0 +szAllContacts db "** All contacts **",0 +szAllContactsW db "UnicodeUnicodeUnic",0 +szUnkContacts db "** Unknown contacts **",0 +szUnkContactsW db "UnicodeUnicodeUnicodeU",0 + + ;option control info +IDC_ETYPE_MESSAGE dd 40082 +IDC_ETYPE_MESSAGE_V dd EVENTTYPE_MESSAGE +IDC_ETYPE_URL dd 40083 +IDC_ETYPE_URL_V dd EVENTTYPE_URL +IDC_ETYPE_CONTACTS dd 40084 +IDC_ETYPE_CONTACTS_V dd EVENTTYPE_CONTACTS +IDC_ETYPE_ADDED dd 40085 +IDC_ETYPE_ADDED_V dd EVENTTYPE_ADDED +IDC_ETYPE_AUTHREQUEST dd 40086 +IDC_ETYPE_AUTHREQUEST_V dd EVENTTYPE_AUTHREQUEST +IDC_ETYPE_FILE dd 40087 +IDC_ETYPE_FILE_V dd EVENTTYPE_FILE + +.data? + ;option control hWnd's +HC_CLIST dd ? +HC_ENABLED dd ? +HC_STATUS_ONLINE dd ? +HC_STATUS_AWAY dd ? +HC_STATUS_DND dd ? +HC_STATUS_NA dd ? +HC_STATUS_OCCUPIED dd ? +HC_STATUS_FREECHAT dd ? +HC_STATUS_INVISIBLE dd ? +HC_STATUS_ONTHEPHONE dd ? +HC_STATUS_OUTTOLUNCH dd ? +HC_PROTO dd ? +HC_ETYPE_MESSAGE dd ? +HC_ETYPE_URL dd ? +HC_ETYPE_CONTACTS dd ? +HC_ETYPE_ADDED dd ? +HC_ETYPE_AUTHREQUEST dd ? +HC_ETYPE_FILE dd ? +HC_STARTTIME dd ? +HC_ENDTIME dd ? + +HC_SHOWHIDDEN dd ? + + ;empty string space +szGeneral db 256 DUP(?) + +.code +DllMain proc hInst:HINSTANCE, reason:DWORD, reserved1:DWORD + push hInst + pop hInstance ;save hWnd of the library + invoke GetModuleHandle, NULL + mov hApp, eax ;save hWnd of Miranda + + mov sPluginInfo.cbSize, sizeof PLUGININFO ;set the library's info + mov sPluginInfo.shortName, offset szShortNamev + push ddVersion + pop sPluginInfo.version + mov sPluginInfo.description, offset szDescription + mov sPluginInfo.author, offset szAuthor + mov sPluginInfo.authorEmail, offset szAthorEmail + mov sPluginInfo.copyright, offset szCopyright + mov sPluginInfo.homepage, offset szHomepage + + mov eax, TRUE + ret +DllMain Endp + +MirandaPluginInfo proc + mov eax, offset sPluginInfo ;return plugin info struct + ret +MirandaPluginInfo Endp + + ;internal miranda functions. Not necessary, but allow viewing them in the debugger +CallService proc lpServiceName:DWORD, wParam:DWORD, lParam:DWORD + pop ddRetStack + pop ddRetAddr + call sPluginLink.lpCallService + push ddRetAddr + push ddRetStack + ret +CallService endp + +ServiceExists proc lpServiceName:DWORD + pop ddRetStack + pop ddRetAddr + call sPluginLink.lpServiceExists + push ddRetAddr + push ddRetStack + ret +ServiceExists endp + +HookEvent proc lpHookName:DWORD, lpFunction:DWORD + pop ddRetStack + pop ddRetAddr + call sPluginLink.lpHookEvent + push ddRetAddr + push ddRetStack + ret +HookEvent endp + +UnhookEvent proc HookHandle:DWORD + pop ddRetStack + pop ddRetAddr + call sPluginLink.lpUnhookEvent + push ddRetAddr + push ddRetStack + ret +UnhookEvent endp + + ;call to Miranda translate module +Translate proc lpString:DWORD + LOCAL ddLng:DWORD + + mov eax, ddFlags + and eax, 8 + .IF eax==0 + IFDEF _UNICODE + mov ddLng, LANG_UNICODE + ELSE + mov ddLng, 0 + ENDIF + .ELSE + and ddFlags, -9 + mov ddLng, 0 + .ENDIF + invoke CallService, offset MS_LANGPACK_TRANSLATESTRING, ddLng, lpString ;translate the string + ret +Translate endp + + ;Just an info func. Shows a message or Default error if NULL +Error proc lpString:DWORD + .IF lpString==0 + mov lpString, offset szError + .ENDIF + invoke MessageBox, NULL, lpString, addr szShortName, MB_OK + ret +Error endp + +Load proc link:DWORD + invoke RtlMoveMemory, addr sPluginLink, link, sizeof PLUGINLINK ;get miranda proc struct + + IFDEF _UNICODE + invoke lstrcpy, offset szGeneral, offset szOptGroup + invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szOptGroup, 7 + invoke lstrcpy, offset szGeneral, offset szOptTitle + invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szOptTitle, 12 + invoke lstrcpy, offset szGeneral, offset szTab1 + invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szTab1, 8 + invoke lstrcpy, offset szGeneral, offset szTab2 + invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szTab2, 9 + invoke lstrcpy, offset szGeneral, offset szAllContacts + invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szAllContacts, 19 + invoke lstrcpy, offset szGeneral, offset szUnkContacts + invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szUnkContacts, 23 + ENDIF + + mov sSystemTime.wYear, 1870 + mov sSystemTime.wMonth, 1 + mov sSystemTime.wDay, 1 + mov sOptionsPage.cbSize, sizeof OPTIONSDIALOGPAGE ;set the option dialog's properties + invoke Translate, offset szOptTitle + IFDEF _UNICODE + mov sOptionsPage.flags, ODPF_UNICODE + ENDIF + mov sOptionsPage.pszTitle, eax + mov sOptionsPage.pfnDlgProc, offset TabOptions + mov sOptionsPage.pszTemplate, 100 + push hInstance + pop sOptionsPage.hInstance + push offset szOptGroup + pop sOptionsPage.pszGroup + + invoke HookEvent, offset ME_DB_EVENT_ADDED, offset Message ;set the message hook + mov hMsgHook, eax ;save hook hWnd + invoke HookEvent, offset ME_OPT_INITIALISE, offset OptInit ;set the options hook + mov hOptHook, eax ;save hook hWnd + invoke HookEvent, offset ME_SYSTEM_MODULESLOADED, offset MdLoaded ;set the ModulesLoaded hook + mov hMdLHook, eax ;save hook hWnd + + xor eax, eax + ret +Load Endp + +IcoLibEv proc C wParam:DWORD, lParam: DWORD + invoke SendMessage, hDlgWnd, WM_IMGLIST, 0, 0 + xor eax, eax + ret +IcoLibEv endp + +;############################## +; Runs when all modules are loaded +;############################## +MdLoaded proc C wParam:DWORD, lParam:DWORD + invoke UnhookEvent, hMdLHook ;unhook + + invoke ServiceExists, offset MS_UPDATE_REGISTER + .IF eax!=0 + mov sUpdate.cbSize, sizeof UPDATE ;initialize updater struct + mov sUpdate.szComponentName, offset szShortNamev + .IF ddBeta==0 + mov sUpdate.szVersionURL, offset szURL ;check if is Beta + .ENDIF + mov sUpdate.pbVersionPrefix, offset szURLKey + push ddURLKeyLen + pop sUpdate.cpbVersionPrefix + mov sUpdate.szUpdateURL, offset szDnURL + mov sUpdate.szBetaVersionURL, offset szBetaURL + mov sUpdate.pbBetaVersionPrefix, offset szBetaURLKey + push ddBetaURLKeyLen + pop sUpdate.cpbBetaVersionPrefix + mov sUpdate.szBetaUpdateURL, offset szBetaDnURL + mov sUpdate.pbVersion, offset szVersion + push ddVersionLen + pop sUpdate.cpbVersion + mov sUpdate.szBetaChangelogURL, offset szBetaChangelogURL + invoke CallService, offset MS_UPDATE_REGISTER, 0, offset sUpdate ;register updater service + .ENDIF + + ;registering icon in IcoLib + invoke ServiceExists, offset MS_SKIN2_ADDICON + .IF eax!=0 + invoke GetModuleFileNameA, hInstance, offset szGeneral, 255 + mov sSkinIconDesc.cbSize, sizeof SKINICONDESC + mov sSkinIconDesc.pszSection, offset szShortName + or ddFlags, 8 + invoke Translate, offset szIlDesc + mov sSkinIconDesc.pszDescription, eax + mov sSkinIconDesc.pszName, offset szIlName + mov sSkinIconDesc.pszDefaultFile, offset szGeneral + mov sSkinIconDesc.iDefaultIndex, -IDI_BAN + invoke CallService, offset MS_SKIN2_ADDICON, 0, offset sSkinIconDesc + invoke HookEvent, offset ME_SKIN2_ICONSCHANGED, offset IcoLibEv ;set the IconChanged hook + mov hIcoLibEv, eax ;save hook hWnd + .ENDIF + + xor eax, eax + ret +MdLoaded endp + + ;set CListControl style defaults +ResetListOptions proc hCList:DWORD + LOCAL Col, i:DWORD + + invoke SendMessage, hCList, CLM_SETBKBITMAP, 0, 0 + invoke GetSysColor, COLOR_WINDOW + mov Col, eax + invoke SendMessage, hCList, CLM_SETBKCOLOR, Col, 0 + invoke SendMessage, hCList, CLM_SETGREYOUTFLAGS, 0, 0 + invoke SendMessage, hCList, CLM_SETLEFTMARGIN, 2, 0 + invoke SendMessage, hCList, CLM_SETINDENT, 10, 0 + invoke GetSysColor, COLOR_WINDOWTEXT + mov Col, eax + mov i, FONTID_MAX + .WHILE i!=0 + invoke SendMessage, hCList, CLM_SETTEXTCOLOR, i, Col + dec i + .ENDW + mov sDBGetSetting.szModule, offset szOModule ;load the flags + mov sDBGetSetting.szSetting, offset szOShowHidden + mov sDBGetSetting.pValue, offset sDBVariant + mov sDBVariant.VAR1, DBVT_DWORD + invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting + .IF eax==0 + .IF sDBVariant.VAR2!=0 + invoke GetWindowLong, hCList, GWL_STYLE + or eax, CLS_SHOWHIDDEN + invoke SetWindowLong, hCList, GWL_STYLE, eax + .ENDIF + .ENDIF + xor eax, eax + ret +ResetListOptions endp + + ;load per contact trigger settings from DB +SetAllContactIcons proc hCList:DWORD + LOCAL hContact, hItem, szProto, flags, flag:DWORD + + invoke CallService, offset MS_DB_CONTACT_FINDFIRST, 0, 0 + mov hContact, eax + invoke SendMessage, hCList, WM_TIMER, 14, 0 ;Note: This is a hack. Wait for the CList To be ready. Thanks to FYR + .WHILE hContact!=0 + invoke SendMessage, hCList, CLM_FINDCONTACT, hContact, 0 + mov hItem, eax + .IF eax!=0 + invoke CallService, offset MS_PROTO_GETCONTACTBASEPROTO, hContact, 0 ;get PROTO for each contact + mov szProto, eax + .IF eax==0 + mov flag, 1 + mov flags, 1 + .ELSE + ;invoke IgnoreCheck, szProto ;Check PROTO Capabilities + mov flags, eax + mov sDBGetSetting.szModule, offset szOModule ;load settings + mov sDBGetSetting.szSetting, offset szOEnabled + mov sDBGetSetting.pValue, offset sDBVariant + mov sDBVariant.VAR1, DBVT_WORD + invoke CallService, offset MS_DB_CONTACT_GETSETTING, hContact, offset sDBGetSetting + .IF eax==0 + push sDBVariant.VAR2 + pop flag + .ELSE + mov flag, 1 + .ENDIF + .ENDIF + .IF flags!=0 ;finally set the necesarry image + xor eax, eax ;Use (MAKELPARAM "column", "image") instead of just 0 + invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, eax + .IF eax==0FFh + .IF flag!=0 + mov flag, 1 + .ENDIF + MAKELPARAM 0, flag + invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax + .ENDIF + .ENDIF + .ENDIF + invoke CallService, offset MS_DB_CONTACT_FINDNEXT, hContact, 0 + mov hContact, eax + .ENDW + ret +SetAllContactIcons endp + + ;Set group icons according to the contacts inside +SetListGroupIcons proc hCList:DWORD, hFirstItem:DWORD, hParentItem:DWORD, groupChildCount:DWORD + LOCAL typeOfFirst, iconOn, childCount, iImage, hItem, hChildItem:DWORD + + mov iconOn, 1 ;assume all are enabled + mov childCount, 0 + invoke SendMessage, hCList, CLM_GETITEMTYPE,hFirstItem, 0 + mov typeOfFirst, eax + + ;check groups + .IF typeOfFirst==CLCIT_GROUP + push hFirstItem + pop hItem + .ELSE + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem + mov hItem, eax + .ENDIF + .WHILE hItem!=NULL + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem + mov hChildItem, eax + .IF eax!=0 + invoke SetListGroupIcons, hCList, hChildItem, hItem, addr childCount + .ENDIF + .IF iconOn!=0 + invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, 0 + .IF eax==0 + mov iconOn, 0 + .ENDIF + .ENDIF + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem + mov hItem, eax + .ENDW + + ;check contacts + .IF typeOfFirst==CLCIT_CONTACT + push hFirstItem + pop hItem + .ELSE + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem + mov hItem, eax + .ENDIF + .WHILE hItem!=0 + invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, 0 + .IF iconOn!=0 + .IF eax==0 + mov iconOn, 0 + .ENDIF + .ENDIF + .IF eax!=0FFh + inc childCount + .ENDIF + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem + mov hItem, eax + .ENDW + + ;set group icons + .IF childCount==0 + mov eax, 0FFh + .ELSEIF iconOn==0 + mov eax, 0 + .ELSE + mov eax, 1 + .ENDIF + MAKELPARAM 0, eax + invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hParentItem, eax + .IF groupChildCount!=0 + mov eax, [groupChildCount] + add eax, childCount + mov [groupChildCount], eax + .ENDIF + ret +SetListGroupIcons endp + + ;set group child icons +SetAllChildIcons proc hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD + LOCAL typeOfFirst, iOldIcon, hItem, hChildItem:DWORD + + invoke SendMessage, hCList, CLM_GETITEMTYPE, hFirstItem, 0 + mov typeOfFirst, eax + + ;set icons for groups + .IF typeOfFirst==CLCIT_GROUP + push hFirstItem + pop hItem + .ELSE + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem + mov hItem, eax + .ENDIF + .WHILE hItem!=0 + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem + mov hChildItem, eax + .IF hChildItem!=0 + invoke SetAllChildIcons, hCList, hChildItem, iColumn, iImage + .ENDIF + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem + mov hItem, eax + .ENDW + + ;set icons for contacts + .IF typeOfFirst==CLCIT_CONTACT + push hFirstItem + pop hItem + .ELSE + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem + mov hItem, eax + .ENDIF + .WHILE hItem!=0 + invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, iColumn + mov iOldIcon, eax + .IF iOldIcon!=0FFh + mov eax, iImage + .IF iOldIcon!=eax + MAKELPARAM iColumn, iImage + invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax + mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings + mov sDBGetSetting.szSetting, offset szOMetaCount + mov sDBGetSetting.pValue, offset sDBVariant + mov sDBVariant.VAR1, DBVT_WORD + invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting + .IF eax==0 + invoke MetaConClick, hItem, sDBVariant.VAR2, iImage + .ENDIF + .ENDIF + .ENDIF + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem + mov hItem, eax + .ENDW + ret +SetAllChildIcons endp + + ;set icons to contacts Not on list +SetUnkChildIcons proc hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD + LOCAL typeOfFirst, iOldIcon, hItem, hChildItem:DWORD + + invoke SendMessage, hCList, CLM_GETITEMTYPE, hFirstItem, 0 + mov typeOfFirst, eax + + ;set icons for groups + .IF typeOfFirst==CLCIT_GROUP + push hFirstItem + pop hItem + .ELSE + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem + mov hItem, eax + .ENDIF + .WHILE hItem!=0 + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem + mov hChildItem, eax + .IF hChildItem!=0 + invoke SetUnkChildIcons, hCList, hChildItem, iColumn, iImage + .ENDIF + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem + mov hItem, eax + .ENDW + + ;set icons for contacts + .IF typeOfFirst==CLCIT_CONTACT + push hFirstItem + pop hItem + .ELSE + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem + mov hItem, eax + .ENDIF + .WHILE hItem!=0 + invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, iColumn + mov iOldIcon, eax + .IF iOldIcon!=0FFh + mov eax, iImage + .IF iOldIcon!=eax + mov sDBGetSetting.szModule, offset szOCList + mov sDBGetSetting.szSetting, offset szONotOnList + mov sDBGetSetting.pValue, offset sDBVariant + mov sDBVariant.VAR1, DBVT_BYTE + invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting + .IF eax==0 + lea esi, sDBVariant.VAR2 + mov al, [esi] + .IF al!=0 + MAKELPARAM iColumn, iImage + invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax + .ENDIF + .ENDIF + .ENDIF + .ENDIF + invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem + mov hItem, eax + .ENDW + ret +SetUnkChildIcons endp + +MetaConClick proc hContact:DWORD, iCount:DWORD, iValue: DWORD + dec iCount + .WHILE iCount!=-1 + invoke CallService, offset MS_MC_GETSUBCONTACT, hContact, iCount + .IF eax!=0 + mov ebx, eax + MAKELPARAM 0, 0 + invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, ebx, eax + .IF eax!= 0FFh + MAKELPARAM 0, iValue + invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, ebx, eax + .ENDIF + .ENDIF + dec iCount + .ENDW + ret +MetaConClick endp + +MetaSubClick proc hContact:DWORD + LOCAL iVal, iCounter:DWORD + + invoke CallService, offset MS_MC_GETMETACONTACT, hContact, 0 + .IF eax!=0 + mov hContact, eax + mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings + mov sDBGetSetting.szSetting, offset szOMetaCount + mov sDBGetSetting.pValue, offset sDBVariant + mov sDBVariant.VAR1, DBVT_WORD + invoke CallService, offset MS_DB_CONTACT_GETSETTING, hContact, offset sDBGetSetting + .IF eax==0 + push sDBVariant.VAR2 + pop iCounter + dec iCounter + mov iVal, 1 + .WHILE iCounter!=-1 + invoke CallService, offset MS_MC_GETSUBCONTACT, hContact, iCounter + .IF eax!=0 + mov ebx, eax + MAKELPARAM 0, 0 + invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, ebx, eax + .IF eax==0 + mov iVal, 0 + .ENDIF + .ENDIF + dec iCounter + .ENDW + .ENDIF + .ENDIF + MAKELPARAM 0, iVal + invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hContact, eax + ret +MetaSubClick endp + +;############################## +; Options hook proc +;############################## +OptInit proc C wParam:DWORD, lParam:DWORD + mov eax, wParam ;init the options dialog + invoke CallService, addr MS_OPT_ADDPAGE, eax, addr sOptionsPage + xor eax, eax + ret +OptInit Endp + +;############################## +; Message hook proc +;############################## +Message proc C wParam:DWORD, lParam:DWORD + LOCAL hContact:DWORD + + xor eax, eax + ret +Message Endp + +;############################## +; First tab event proc +;############################## +Options1 proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD + .IF uMsg==WM_INITDIALOG ;if user opens options + invoke SetWindowPos, dhWnd, HWND_TOP, sDlgHdr.rcDisplay.left, sDlgHdr.rcDisplay.top, 0, 0, SWP_NOSIZE + .ELSEIF uMsg==WM_COMMAND ;if sth. happened in the dialog + .ENDIF + xor eax,eax + ret +Options1 endp + +;############################## +; Second tab event proc +;############################## +Options2 proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD + LOCAL hContact, hItem, hitFlags, iImage, itemType, i:DWORD + + push dhWnd + pop hDlgWnd + .IF uMsg==WM_INITDIALOG + invoke SetWindowPos, dhWnd, HWND_TOP, sDlgHdr.rcDisplay.left, sDlgHdr.rcDisplay.top, 0, 0, SWP_NOSIZE + invoke GetDlgItem, dhWnd, IDC_SHOWHIDDEN + mov HC_SHOWHIDDEN, eax + mov sDBGetSetting.szModule, offset szOModule ;load the flags + mov sDBGetSetting.szSetting, offset szOShowHidden + mov sDBGetSetting.pValue, offset sDBVariant + mov sDBVariant.VAR1, DBVT_DWORD + invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting + .IF eax==0 + .IF sDBVariant.VAR2!=0 + Invoke SendMessage, HC_SHOWHIDDEN, BM_SETCHECK, BST_CHECKED, 0 + .ENDIF + .ENDIF + invoke SendMessage, dhWnd, WM_IMGLIST, wParam, lParam + invoke GetDlgItem, dhWnd, IDC_CLIST + mov HC_CLIST, eax + invoke ResetListOptions, HC_CLIST + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRACOLUMNS, 1, 0 ;set no of icon columns + mov sClcInfoItem.cbSize, sizeof CLCINFOITEM ;add additional items + mov sClcInfoItem.flags, CLCIIF_GROUPFONT + invoke Translate, offset szAllContacts ;** All contacts ** + mov sClcInfoItem.pszText, eax + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_ADDINFOITEM, 0, addr sClcInfoItem + mov hItemAll, eax + invoke Translate, offset szUnkContacts ;** Unknown contacts ** + mov sClcInfoItem.pszText, eax + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_ADDINFOITEM, 0, addr sClcInfoItem + mov hItemUnk, eax + + invoke SetAllContactIcons, HC_CLIST ;Init control values + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 + invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL + mov sDBGetSetting.szModule, offset szOModule ;load the flags + mov sDBGetSetting.szSetting, offset szONotOnList + mov sDBGetSetting.pValue, offset sDBVariant + mov sDBVariant.VAR1, DBVT_DWORD + invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting + .IF eax==0 + .IF sDBVariant.VAR2!=0 + mov eax, 1 + .ENDIF + .ELSE + mov eax, 1 + .ENDIF + push eax + invoke SetUnkChildIcons, HC_CLIST, hItemUnk, 0, eax + pop eax + MAKELPARAM 0, eax + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItemUnk, eax + .ELSEIF uMsg==WM_IMGLIST + invoke GetVersion ;check win version + .IF al==5 + .IF ah!=0 + mov eax, ILC_COLOR32 or ILC_MASK + .ELSEIF + mov eax, ILC_COLOR16 or ILC_MASK + .ENDIF + .ENDIF + invoke ImageList_Create, 16, 16, eax, 3, 3 ;create image list + mov hIml, eax + invoke LoadIcon, hApp, IDI_SMALLDOT ;add icon + push eax + invoke ImageList_AddIcon, hIml, eax + pop eax + invoke DeleteObject, eax + invoke CallService, offset MS_SKIN2_GETICON, 0, offset szIlName + invoke ImageList_AddIcon, hIml, eax + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGELIST, 0, hIml ;link image list to CList + .ELSEIF uMsg==WM_SETFOCUS + invoke SetFocus, HC_CLIST + .ELSEIF uMsg==WM_COMMAND + mov eax, wParam + .IF lParam!=0 + .IF ax==IDC_SHOWHIDDEN + mov sDBWriteSetting.szModule, offset szOModule + mov sDBWriteSetting.szSetting, offset szOShowHidden + mov sDBWriteSetting.VAR1, DBVT_DWORD + invoke SendMessage, HC_SHOWHIDDEN, BM_GETCHECK, 0, 0 + .IF eax==BST_CHECKED + mov sDBWriteSetting.VAR2, 1 + invoke GetWindowLong, HC_CLIST, GWL_STYLE + or eax, CLS_SHOWHIDDEN + .ELSE + mov sDBWriteSetting.VAR2, 0 + invoke GetWindowLong, HC_CLIST, GWL_STYLE + mov ebx, -CLS_SHOWHIDDEN + dec ebx + and eax, ebx + .ENDIF + invoke SetWindowLong, HC_CLIST, GWL_STYLE, eax + invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting + invoke SendMessage, HC_CLIST, CLM_SETUSEGROUPS, 1, 0 + invoke SetAllContactIcons, HC_CLIST + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 + invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL + .ENDIF + .ENDIF + .ELSEIF uMsg==WM_NOTIFY ;if sth changes + mov edi, lParam + assume edi:ptr NMHDR + .IF [edi].idFrom==IDC_CLIST + .IF [edi].code==CLN_NEWCONTACT + invoke SetAllContactIcons, HC_CLIST + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 + invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL + .ELSEIF [edi].code==CLN_LISTREBUILT + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 + invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL + .ELSEIF [edi].code==CLN_CONTACTMOVED + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 + invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL + .ELSEIF [edi].code==CLN_OPTIONSCHANGED + invoke ResetListOptions, HC_CLIST + .ELSEIF [edi].code==NM_CLICK ;Click on the CList + assume edi:ptr NMCLISTCONTROL + .IF [edi].iColumn!=-1 + MAKELPARAM [edi].pt.x, [edi].pt.y + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_HITTEST, addr hitFlags, eax + mov hItem, eax + .IF hItem!=0 + and hitFlags, CLCHT_ONITEMEXTRA ;if click on icon, then analyze and edit + .IF hitFlags!=0 + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, [edi].iColumn + .IF eax==0 + mov iImage, 1 + .ELSE + mov iImage, 0 + .ENDIF + MAKELPARAM [edi].iColumn, 0 + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, eax + .IF eax!= 0FFh + MAKELPARAM [edi].iColumn, iImage + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItem, eax + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETITEMTYPE, hItem, 0 + mov itemType, eax + .IF itemType==CLCIT_CONTACT ;if click on contact + MAKELPARAM [edi].iColumn, iImage + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItem, eax + mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings + mov sDBGetSetting.szSetting, offset szOMetaCount + mov sDBGetSetting.pValue, offset sDBVariant + mov sDBVariant.VAR1, DBVT_WORD + invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting + .IF eax==0 + ;is MetaContact + invoke MetaConClick, hItem, sDBVariant.VAR2, iImage + .ELSE + mov sDBGetSetting.szSetting, offset szOMetaLink + invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting + .IF eax==0 + ;is subcontact + invoke MetaSubClick, hItem + .ENDIF + .ENDIF + .ENDIF + .IF itemType==CLCIT_INFO ;if click on extra item + mov eax, hItem + .IF eax==hItemAll + invoke SetAllChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage + .ELSEIF eax==hItemUnk + invoke SetUnkChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage + .ENDIF + .ENDIF + .IF itemType==CLCIT_GROUP ;if click on group + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_CHILD, hItem + mov hItem, eax + .IF hItem!=0 + invoke SetAllChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage + .ENDIF + .ENDIF + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 + invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL + invoke GetParent, dhWnd + invoke GetParent, eax + push eax + invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button + pop eax + invoke GetParent, eax + invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button + .ENDIF + .ENDIF + .ENDIF + .ENDIF + assume edi:ptr NMHDR + .ENDIF + .ELSEIF [edi].idFrom==0 + .IF [edi].code==PSN_APPLY ;if OK/Apply pressed. Save options + invoke CallService, addr MS_DB_CONTACT_FINDFIRST, 0, 0 + mov hContact, eax + .WHILE hContact!=0 + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0 + mov hItem, eax + .IF eax!=0 + xor eax, eax ;Use (MAKELPARAM "column", "image") instead of just 0 + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, eax + mov sDBWriteSetting.szModule, offset szOModule + mov sDBWriteSetting.szSetting, offset szOEnabled + mov sDBWriteSetting.VAR1, DBVT_DWORD + mov sDBWriteSetting.VAR2, eax + invoke CallService, offset MS_DB_CONTACT_WRITESETTING, hContact, offset sDBWriteSetting + .ENDIF + invoke CallService, addr MS_DB_CONTACT_FINDNEXT, hContact, 0 + mov hContact, eax + .ENDW + invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItemUnk, 0 + mov sDBWriteSetting.szModule, offset szOModule + mov sDBWriteSetting.szSetting, offset szONotOnList + mov sDBWriteSetting.VAR1, DBVT_DWORD + mov sDBWriteSetting.VAR2, eax + invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting + .ENDIF + .ENDIF + assume edi:nothing + .ELSEIF uMsg==WM_DESTROY + invoke ImageList_Destroy, hIml ;Free used resources + .ENDIF + xor eax, eax + ret +Options2 endp + +TabOptions proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD + push dhWnd + pop sDlgHdr.hDlg + .IF uMsg==WM_INITDIALOG ;if user opens options + mov ddInt, 0 + invoke InitCommonControls + invoke GetDlgItem, dhWnd, 1000 ;get hWnd of tabs control + mov sDlgHdr.hTab, eax + mov edi, offset sTCITEM ;insert tabs + mov eax, TCIF_TEXT + mov [edi], eax + invoke Translate, offset szTab1 ;translate Tab name + IFDEF _UNICODE + mov sTCITEM.pszText, eax + invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMW, 0, addr sTCITEM + ELSE + mov sTCITEM.pszText, eax + invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMA, 0, addr sTCITEM + ENDIF + mov sDlgHdr.hDisplay, NULL + + invoke SetRectEmpty, addr sDlgHdr.rcDisplay + invoke SendMessage, sDlgHdr.hTab, TCM_ADJUSTRECT, FALSE, addr sDlgHdr.rcDisplay + + invoke FindResource, hInstance, 101, RT_DIALOG ;load first tab in memory + invoke LoadResource, hInstance, eax + invoke LockResource, eax + invoke CreateDialogIndirectParam, hInstance, eax, sDlgHdr.hTab, Options1, NULL + mov sDlgHdr.hTab1, eax + mov sDlgHdr.hDisplay, eax + + invoke Translate, offset szTab2 ;translate Tab name + IFDEF _UNICODE + mov sTCITEM.pszText, eax + invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMW, 1, addr sTCITEM + ELSE + mov sTCITEM.pszText, eax + invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMA, 1, addr sTCITEM + ENDIF + invoke FindResource, hInstance, 102, RT_DIALOG ;load second tab in memory + invoke LoadResource, hInstance, eax + invoke LockResource, eax + invoke CreateDialogIndirectParam, hInstance, eax, sDlgHdr.hTab, Options2, NULL + mov sDlgHdr.hTab2, eax + invoke ShowWindow, sDlgHdr.hTab2, SW_HIDE + + mov sLngPackDialog.cbSize, sizeof LANGPACKTRANSLATEDIALOG + mov sLngPackDialog.flags, 0 + push dhWnd + pop sLngPackDialog.hwndDlg + mov sLngPackDialog.ignoreControls, 0 + invoke CallService, offset MS_LANGPACK_TRANSLATEDIALOG, LPTDF_NOTITLE, offset sLngPackDialog ;translate dialogs + + .ELSEIF uMsg==WM_NOTIFY + .IF wParam==1000 ;if message from tab control + mov edi, lParam + assume edi:ptr NMHDR + .IF [edi].code==TCN_SELCHANGE ;if tab changed + .IF sDlgHdr.hDisplay!=0 + invoke ShowWindow, sDlgHdr.hDisplay, SW_HIDE ;hide old tab + .ENDIF + invoke SendMessage, sDlgHdr.hTab, TCM_GETCURSEL, 0, 0 ;get current tab and show it + .IF eax==0 + mov eax, sDlgHdr.hTab1 + .ELSEIF eax==1 + mov eax, sDlgHdr.hTab2 + .ELSE + invoke Error, 0 + .ENDIF + mov sDlgHdr.hDisplay, eax + invoke ShowWindow, sDlgHdr.hDisplay, SW_SHOW + .ENDIF + assume edi:nothing + .ELSEIF + invoke SendMessage, sDlgHdr.hTab1, WM_NOTIFY, wParam, lParam + invoke SendMessage, sDlgHdr.hTab2, WM_NOTIFY, wParam, lParam + .ENDIF + .ENDIF + xor eax, eax + ret +TabOptions endp + +Unload proc + invoke UnhookEvent, hMsgHook ;unhook events and exit + invoke UnhookEvent, hOptHook + invoke UnhookEvent, hIcoLibEv + xor eax, eax + ret +Unload Endp + +End DllMain \ No newline at end of file diff --git a/BanControl/plugin/BanControl.def b/BanControl/plugin/BanControl.def new file mode 100644 index 0000000..dbb485e --- /dev/null +++ b/BanControl/plugin/BanControl.def @@ -0,0 +1,4 @@ +LIBRARY BanControl +EXPORTS MirandaPluginInfo +EXPORTS Load +EXPORTS Unload \ No newline at end of file diff --git a/BanControl/res/BanControl.aps b/BanControl/res/BanControl.aps new file mode 100644 index 0000000..59eef98 Binary files /dev/null and b/BanControl/res/BanControl.aps differ diff --git a/BanControl/res/BanControl.rc b/BanControl/res/BanControl.rc new file mode 100644 index 0000000..0c56743 --- /dev/null +++ b/BanControl/res/BanControl.rc @@ -0,0 +1,141 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.K.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +100 DIALOGEX 0, 0, 314, 240 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD | WS_VISIBLE +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "",IDT_MAIN,"SysTabControl32",0x0,1,1,311,237 +END + +101 DIALOGEX 0, 0, 305, 220 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN +END + +102 DIALOGEX 0, 0, 305, 220 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + LTEXT "To enable or disable the plugin for an individual contact, click on the icon to the right of it. Clicking on the group's icon, enables/disables the plugin for all the contacts in that group.", + IDC_STATIC,40,188,227,27 + CONTROL "",IDC_CLIST,"CListControl",WS_TABSTOP | 0x1c0,10,10,285, + 165,WS_EX_CLIENTEDGE + CONTROL "Show hidden",IDC_SHOWHIDDEN,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,20,177,195,10 +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,0,1,0 + PRODUCTVERSION 0,0,1,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", "BanControl" + VALUE "FileVersion", "0, 0, 1, 0" + VALUE "InternalName", "BanControl" + VALUE "LegalCopyright", "Copyright (C) 2007" + VALUE "OriginalFilename", "BanControl.dll" + VALUE "ProductName", "BanControl" + VALUE "ProductVersion", "0, 0, 1, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_BAN ICON "ban.ico" +#endif // English (U.K.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/BanControl/res/ban.ico b/BanControl/res/ban.ico new file mode 100644 index 0000000..bb71cb9 Binary files /dev/null and b/BanControl/res/ban.ico differ diff --git a/BanControl/res/resource.h b/BanControl/res/resource.h new file mode 100644 index 0000000..c7d48ff --- /dev/null +++ b/BanControl/res/resource.h @@ -0,0 +1,19 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by BanControl.rc +// +#define IDI_BAN 101 +#define IDT_MAIN 1000 +#define IDC_CLIST 3000 +#define IDC_SHOWHIDDEN 50071 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 102 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 201 +#endif +#endif diff --git a/BanControl/vsproj/BanControl.sln b/BanControl/vsproj/BanControl.sln new file mode 100644 index 0000000..61f5135 --- /dev/null +++ b/BanControl/vsproj/BanControl.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BanControl", "BanControl.vcproj", "{3018D9E2-8CFE-4E39-8834-72222BB648F4}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {3018D9E2-8CFE-4E39-8834-72222BB648F4}.Debug.ActiveCfg = Debug|Win32 + {3018D9E2-8CFE-4E39-8834-72222BB648F4}.Debug.Build.0 = Debug|Win32 + {3018D9E2-8CFE-4E39-8834-72222BB648F4}.Release.ActiveCfg = Release|Win32 + {3018D9E2-8CFE-4E39-8834-72222BB648F4}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/BanControl/vsproj/BanControl.vcproj b/BanControl/vsproj/BanControl.vcproj new file mode 100644 index 0000000..f66f0f4 --- /dev/null +++ b/BanControl/vsproj/BanControl.vcproj @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BanControl/vsproj/Resource.txt b/BanControl/vsproj/Resource.txt new file mode 100644 index 0000000..e69de29 diff --git a/BanControl/vsproj/build.bat b/BanControl/vsproj/build.bat new file mode 100644 index 0000000..c0b634b --- /dev/null +++ b/BanControl/vsproj/build.bat @@ -0,0 +1,34 @@ +@echo off + +echo Building Resources... +rc /r /fo ".\BanControl.res" ..\res\BanControl.rc + + +echo Building ANSI version... + +\masm32\bin\ml /nologo /c /coff /Zi /Fl /Fm /Cp ..\plugin\BanControl.asm + if errorlevel 1 goto errasm +\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"..\..\..\Miranda ANSI\plugins\BanControl.dll" BanControl.obj BanControl.res + if errorlevel 1 goto errlink + + +echo Building Unicode version... + +\masm32\bin\ml /nologo /D_UNICODE /c /coff /Zi /Fl /Fm /Cp ..\plugin\BanControl.asm + if errorlevel 1 goto errasm +\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"..\..\..\plugins\BanControl.dll" BanControl.obj BanControl.res + if errorlevel 1 goto errlink + +Echo Done. + +goto TheEnd +:errasm +echo _ +echo Assembly Error +goto TheEnd +:errlink +echo _ +echo Link Error + +:TheEnd +pause \ No newline at end of file diff --git a/BanControl/vsproj/clean.bat b/BanControl/vsproj/clean.bat new file mode 100644 index 0000000..19cd5ba --- /dev/null +++ b/BanControl/vsproj/clean.bat @@ -0,0 +1,49 @@ +@echo off + +echo Building Resources... +rc /r /fo ".\BanControl.res" ..\res\BanControl.rc + + +echo Building ANSI version... + +\masm32\bin\ml /nologo /c /coff /Zi /Fl /Fm /Cp ..\plugin\BanControl.asm + if errorlevel 1 goto errasm +\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib BanControl.obj BanControl.res + if errorlevel 1 goto errlink +move /Y BanControl.dll ..\bin\BanControlA_d.dll + +\masm32\bin\ml /nologo /c /coff /Cp ..\plugin\BanControl.asm + if errorlevel 1 goto errasm +\masm32\bin\Link /nologo /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib BanControl.obj BanControl.res + if errorlevel 1 goto errlink +move /Y BanControl.dll ..\bin\BanControlA.dll + + +echo Building Unicode version... + +\masm32\bin\ml /nologo /D_UNICODE /c /coff /Zi /Fl /Fm /Cp ..\plugin\BanControl.asm + if errorlevel 1 goto errasm +\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib BanControl.obj BanControl.res + if errorlevel 1 goto errlink +move /Y BanControl.dll ..\bin\BanControlW_d.dll + +\masm32\bin\ml /nologo /D_UNICODE /c /coff /Cp ..\plugin\BanControl.asm + if errorlevel 1 goto errasm +\masm32\bin\Link /nologo /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib BanControl.obj BanControl.res + if errorlevel 1 goto errlink +move /Y BanControl.dll ..\bin\BanControlW.dll + +Echo Done. +cd + +goto TheEnd +:errasm +echo _ +echo Assembly Error +goto TheEnd +:errlink +echo _ +echo Link Error + +:TheEnd +pause \ No newline at end of file diff --git a/BuddyExpectator/BuddyExpectator.cpp b/BuddyExpectator/BuddyExpectator.cpp new file mode 100644 index 0000000..6af9724 --- /dev/null +++ b/BuddyExpectator/BuddyExpectator.cpp @@ -0,0 +1,968 @@ +/* + Buddy Expectator+ plugin for Miranda-IM (www.miranda-im.org) + (c)2005 Anar Ibragimoff (ai91@mail.ru) + (c)2006 Scott Ellis (mail@scottellis.com.au) + (c)2007,2008 Alexander Turyak (thief@miranda-im.org.ua) + + 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 + + File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/BuddyExpectator.cpp $ + Revision : $Rev: 1392 $ + Last change on : $Date: 2009-04-22 17:46:08 +0300 (Ср, 22 апр 2009) $ + Last change by : $Author: Thief $ +*/ + +#include "common.h" +#include "options.h" + +HINSTANCE hInst; +PLUGINLINK *pluginLink; + +DWORD timer_id = 0; + +HANDLE hEventContactSetting = NULL; +HANDLE hEventContactAdded = NULL; +HANDLE hEventUserInfoInit = NULL; +HANDLE hPrebuildContactMenu = NULL; +HANDLE hContactMenu = NULL; +HANDLE hIcoLibIconsChanged = NULL; +HANDLE hContactReturnedAction = NULL; +HANDLE hContactStillAbsentAction = NULL; +HANDLE hMissYouAction = NULL; +HANDLE hMenuMissYouClick = NULL; +HANDLE hModulesLoaded = NULL; +HANDLE hModulesLoaded2 = NULL; +HANDLE hSystemOKToExit = NULL; +HANDLE hHookExtraIconsRebuild = NULL; +HANDLE hHookExtraIconsApply = NULL; + +HICON hIcon; +HANDLE hEnabledIcon = NULL, hDisabledIcon = NULL; + +IconExtraColumn g_IECMissYou = {0}; +IconExtraColumn g_IECClear = {0}; + +// Popup Actions +POPUPACTION missyouactions[1]; +POPUPACTION hideactions[2]; + +extern int UserinfoInit(WPARAM wparam, LPARAM lparam); + +PLUGININFOEX pluginInfo = { + sizeof(PLUGININFOEX), + "Buddy Expectator+", + PLUGIN_MAKE_VERSION(0,1,2,3), + "Reacts to the return of contacts, or the the extended absence of contacts, with notifications and other actions", + "Anar Ibragimoff, sje, Thief", + "thief@miranda.im", + "© 2005 Anar Ibragimoff, © 2006 Scott Ellis, © 2007-2009 Alexander Turyak", + "http://thief.miranda.im", + 0, + 0, + {0xddf8aec9, 0x7d37, 0x49af, {0x9d, 0x22, 0xbb, 0xbc, 0x92, 0x0e, 0x6f, 0x05}} //{DDF8AEC9-7D37-49AF-9D22-BBBC920E6F05} +}; + +PLUGININFO oldpluginInfo = { + sizeof(PLUGININFO), + pluginInfo.shortName, + pluginInfo.version, + pluginInfo.description, + pluginInfo.author, + pluginInfo.authorEmail, + pluginInfo.copyright, + pluginInfo.homepage, + pluginInfo.flags, + pluginInfo.replacesDefaultModule +}; + +/* 2D84F403-91F3-4E60-BF02-16C2F1716D86 */ +#define MIID_BUDDYEXPECTATOR {0x2d84f403, 0x91f3, 0x4e60, {0xbf, 0x02, 0x16, 0xc2, 0xf1, 0x71, 0x6d, 0x86}} + +extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + static const MUUID interfaces[] = {MIID_BUDDYEXPECTATOR, MIID_LAST}; + return interfaces; +} + +extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + hInst = hinstDLL; + return TRUE; +} + +time_t getLastSeen(HANDLE hContact) +{ + return DBGetContactSettingDword(hContact, MODULE_NAME, "LastSeen", DBGetContactSettingDword(hContact, MODULE_NAME, "CreationTime", (DWORD)-1)); +} + +void setLastSeen(HANDLE hContact) +{ + DBWriteContactSettingDword(hContact, MODULE_NAME, "LastSeen", (DWORD)time(NULL)); + if (DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0)) + DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0); +} + +time_t getLastInputMsg(HANDLE hContact) +{ + HANDLE hDbEvent; + DBEVENTINFO dbei = {0}; + + hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0); + while (hDbEvent) + { + dbei.cbSize = sizeof(dbei); + dbei.pBlob = 0; + dbei.cbBlob = 0; + CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei); + if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) + return dbei.timestamp; + hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hDbEvent, 0); + } + return -1; +} + +/** + * PopUp window procedures + */ + +int CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_COMMAND: + if (HIWORD(wParam) == STN_CLICKED) + { + DBWriteContactSettingByte(PUGetContact(hWnd), "CList", "Hidden", 1); + PUDeletePopUp(hWnd); + } + break; + case WM_CONTEXTMENU: + DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1); + PUDeletePopUp(hWnd); + break; + case UM_POPUPACTION: + if (wParam == 2) + { + DBWriteContactSettingByte(PUGetContact(hWnd), "CList", "Hidden", 1); + PUDeletePopUp(hWnd); + } + if (wParam == 3) + { + DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1); + PUDeletePopUp(hWnd); + } + break; + case UM_FREEPLUGINDATA: + return TRUE; + default: + break; + } + return DefWindowProc(hWnd, message, wParam, lParam); +} + +int CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_COMMAND: + if (HIWORD(wParam) == STN_CLICKED) + { + CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0); + if (!DBGetContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYouNotifyAlways", 0)) + { + DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0); + if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) PUGetContact(hWnd), (LPARAM) &g_IECClear); + } + PUDeletePopUp(hWnd); + } + break; + case WM_CONTEXTMENU: + PUDeletePopUp(hWnd); + break; + case UM_POPUPACTION: + if (wParam == 1) + { + DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0); + if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) PUGetContact(hWnd), (LPARAM) &g_IECClear); + PUDeletePopUp(hWnd); + } + break; + case UM_FREEPLUGINDATA: + return TRUE; + default: + break; + } + return DefWindowProc(hWnd, message, wParam, lParam); +} + +int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_COMMAND: + if (HIWORD(wParam) == STN_CLICKED) + { + CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0); + CallServiceSync("BuddyExpectator/actionReturned", (WPARAM)PUGetContact(hWnd), 0); + PUDeletePopUp(hWnd); + } + break; + case WM_CONTEXTMENU: + CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0); + setLastSeen(PUGetContact(hWnd)); + PUDeletePopUp(hWnd); + break; + case UM_FREEPLUGINDATA: + if (options.iShowEvent == 0) + { + setLastSeen(PUGetContact(hWnd)); + } + return TRUE; + default: + break; + } + return DefWindowProc(hWnd, message, wParam, lParam); +} + +int CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + switch (message) + { + case WM_COMMAND: + if (HIWORD(wParam) == STN_CLICKED) + { + CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0); + CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0); + PUDeletePopUp(hWnd); + } + break; + case WM_CONTEXTMENU: + CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0); + PUDeletePopUp(hWnd); + break; + case UM_FREEPLUGINDATA: + return TRUE; + default: + break; + } + return DefWindowProc(hWnd, message, wParam, lParam); +} + +/** + * Checks - whether user has been gone for specified number of days + */ +bool isContactGoneFor(HANDLE hContact, int days) +{ + time_t lastSeen = getLastSeen(hContact); + time_t lastInputMsg = getLastInputMsg(hContact); + time_t currentTime = time(NULL); + + int daysSinceOnline = -1; + if (lastSeen != -1) daysSinceOnline = (int)((currentTime - lastSeen)/(60*60*24)); + + int daysSinceMessage = -1; + if (lastInputMsg != -1) daysSinceMessage = (int)((currentTime - lastInputMsg)/(60*60*24)); + + if (options.hideInactive) + { + if (daysSinceMessage >= options.iSilencePeriod) + if (!DBGetContactSettingByte(hContact, "CList", "Hidden", 0) && !DBGetContactSettingByte(hContact, MODULE_NAME, "NeverHide", 0)) + { + char szInfo[200]; + + POPUPDATAT_V2 ppd = {0}; + ppd.cbSize = sizeof(POPUPDATAT_V2); + + ppd.lchContact = hContact; + ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"); + + mir_snprintf(szInfo, 200, Translate("Hiding %s (%s)"), (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0)); + strncpy(ppd.lpzContactName, szInfo, MAX_CONTACTNAME); + mir_snprintf(szInfo, 200, Translate("%d days since last message"), daysSinceMessage); + strncpy(ppd.lpzText, szInfo, MAX_SECONDLINE); + if (!options.iUsePopupColors) + { + ppd.colorBack = options.iPopUpColorBack; + ppd.colorText = options.iPopUpColorFore; + } + ppd.PluginWindowProc = (WNDPROC)HidePopupDlgProc; + ppd.PluginData = NULL; + ppd.iSeconds = -1; + + hideactions[0].flags = hideactions[1].flags = PAF_ENABLED; + ppd.lpActions = hideactions; + ppd.actionCount = 2; + + CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NEWDATA); + + SkinPlaySound("buddyExpectatorHide"); + } + } + + return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days)); +} + +void ReturnNotify(HANDLE hContact, char *message) +{ + if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1) + return; + + SkinPlaySound("buddyExpectatorReturn"); + + if (options.iShowPopUp > 0) + { + // Display PopUp + POPUPDATAT_V2 ppd = {0}; + ppd.cbSize = sizeof(POPUPDATAT_V2); + + ppd.lchContact = hContact; + ppd.lchIcon = hIcon; + strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME); + strncpy(ppd.lpzText, message, MAX_SECONDLINE); + if (!options.iUsePopupColors) + { + ppd.colorBack = options.iPopUpColorBack; + ppd.colorText = options.iPopUpColorFore; + } + ppd.PluginWindowProc = (WNDPROC)PopupDlgProc; + ppd.PluginData = NULL; + ppd.iSeconds = options.iPopUpDelay; + + CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, 0); + + } + + if (options.iShowEvent > 0) + { + CLISTEVENT cle = {0}; + + cle.cbSize = sizeof(cle); + cle.hContact = hContact; + cle.hIcon = hIcon; + cle.pszService = (char *)"BuddyExpectator/actionReturned"; + + char* nick = (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0); + char tmpMsg[512]; + mir_snprintf(tmpMsg, 512, "%s %s", nick, message); + cle.pszTooltip = tmpMsg; + + CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM) &cle); + } +} + +void GoneNotify(HANDLE hContact, char *message) +{ + if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1) + return; + + if (options.iShowPopUp2 > 0) + { + // Display PopUp + POPUPDATAT_V2 ppd = {0}; + ppd.cbSize = sizeof(POPUPDATAT_V2); + + ppd.lchContact = hContact; + ppd.lchIcon = hIcon; + strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME); + strncpy(ppd.lpzText, message, MAX_SECONDLINE); + if (!options.iUsePopupColors) + { + ppd.colorBack = options.iPopUpColorBack; + ppd.colorText = options.iPopUpColorFore; + } + ppd.PluginWindowProc = (WNDPROC)PopupDlgProcNoSet; + ppd.PluginData = NULL; + ppd.iSeconds = options.iPopUpDelay; + + CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, 0); + } + + if (options.iShowEvent2 > 0) + { + CLISTEVENT cle = {0}; + + cle.cbSize = sizeof(cle); + cle.hContact = hContact; + cle.hIcon = hIcon; + cle.pszService = (char *)"BuddyExpectator/actionStillAbsent"; + + char* nick = (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0); + char tmpMsg[512]; + mir_snprintf(tmpMsg, 512, "%s %s", nick, message); + cle.pszTooltip = tmpMsg; + + CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM) &cle); + } +} + +/** + * Miss you action (clist event click) + * when called from popup, wParam = (HANDLE)hContact and lParam == 0, + * when called from clist event, wParam = hWndCList, lParam = &CLISTEVENT + */ +int MissYouAction(WPARAM wParam, LPARAM lParam) +{ + HANDLE hContact; + if (lParam) + { + CLISTEVENT* cle = (CLISTEVENT*)lParam; + hContact = cle->hContact; + } else + hContact = (HANDLE)wParam; + + CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); + + return 0; +} + +/** + * Contact returned action (clist event click) + * when called from popup, wParam = (HANDLE)hContact and lParam == 0, + * when called from clist event, wParam = hWndCList, lParam = &CLISTEVENT + */ +int ContactReturnedAction(WPARAM wParam, LPARAM lParam) +{ + HANDLE hContact; + if (lParam) + { + CLISTEVENT* cle = (CLISTEVENT*)lParam; + hContact = cle->hContact; + } else + hContact = (HANDLE)wParam; + + if (options.iShowMessageWindow>0) + { + CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); + } + + if (options.iShowUDetails>0) + { + CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); + } + + setLastSeen(hContact); + + return 0; +} + +/** + * Contact not returned action (clist event click) + * when called from popup, wParam = (HANDLE)hContact and lParam == 0, + * when called from clist event, wParam = hWndCList, lParam = &CLISTEVENT + */ +int ContactStillAbsentAction(WPARAM wParam, LPARAM lParam) +{ + HANDLE hContact; + if (lParam) + { + CLISTEVENT* cle = (CLISTEVENT*)lParam; + hContact = cle->hContact; + } else + hContact = (HANDLE)wParam; + + switch (options.action2) + { + case GCA_DELETE: + CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); + break; + case GCA_UDETAILS: + CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); + break; + case GCA_MESSAGE: + CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); + break; + case GCA_NOACTION: + break; + } + + return 0; +} + +/** + * Load icons either from icolib or built in + */ +int onIconsChanged(WPARAM wParam, LPARAM lParam) +{ + if (ServiceExists(MS_SKIN2_ADDICON)) + { + hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"main_icon"); + } + else + { + hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, 16, 16, 0); + } + + return 0; +} + +/** + * Menu item click action + */ +int MenuMissYouClick(WPARAM wParam, LPARAM lParam) +{ + if (DBGetContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0)) + { + DBWriteContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0); + if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECClear); + } + else + { + DBWriteContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 1); + if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECMissYou); + } + + return 0; +} + +/** + * Menu is about to appear + */ +int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) +{ + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); + if (!proto) return 0; + + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(CLISTMENUITEM); + + if (DBGetContactSettingByte((HANDLE)wParam, proto, "ChatRoom", 0) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)) + mi.flags = CMIM_FLAGS | CMIF_HIDDEN; + else + mi.flags = CMIM_FLAGS; + + if (DBGetContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0)) + { + mi.flags |= CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB; + mi.pszName = Translate("Disable Miss You"); + mi.icolibItem = hEnabledIcon; + } + else + { + mi.flags |= CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB; + mi.pszName = Translate("Enable Miss You"); + mi.icolibItem = hDisabledIcon; + } + + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi); + + return 0; +} + +int onExtraImageApplying(WPARAM wParam, LPARAM lParam) +{ + if (DBGetContactSettingByte((HANDLE)wParam,MODULE_NAME,"MissYou",0)) + CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECMissYou); + + return 0; +} + +int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam) +{ + g_IECMissYou.cbSize = sizeof(IconExtraColumn); + g_IECMissYou.ColumnType = options.MissYouIcon; + + if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) + { + if (ServiceExists(MS_SKIN2_ADDICON)) + { + g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"), (LPARAM)0); + } + else + { + g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ENABLED), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); + } + } + + return 0; +} + +/** + * ContactSettingChanged callback + */ +int SettingChanged(WPARAM wParam, LPARAM lParam) +{ + HANDLE hContact = (HANDLE) wParam; + DBCONTACTWRITESETTING *inf = (DBCONTACTWRITESETTING *) lParam; + + if (hContact == NULL || inf->value.type == DBVT_DELETED || strcmp(inf->szSetting, "Status") != 0) + return 0; + + if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1) + return 0; + + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + if (proto == 0 || (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1) + || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)) + return 0; + + int currentStatus = inf->value.wVal; + int prevStatus = DBGetContactSettingWord(hContact, "UserOnline", "OldStatus", ID_STATUS_OFFLINE); + + if (currentStatus == prevStatus) + { + return 0; + } + + // Last status + DBWriteContactSettingDword(hContact, MODULE_NAME, "LastStatus", prevStatus); + + if (prevStatus == ID_STATUS_OFFLINE) + { + if (DBGetContactSettingByte(hContact, MODULE_NAME, "MissYou", 0)) + { + // Display PopUp + POPUPDATAT_V2 ppd = {0}; + ppd.cbSize = sizeof(POPUPDATAT_V2); + + ppd.lchContact = hContact; + ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"); + strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME); + strncpy(ppd.lpzText, Translate("You awaited this contact!"), MAX_SECONDLINE); + if (!options.iUsePopupColors) + { + ppd.colorBack = options.iPopUpColorBack; + ppd.colorText = options.iPopUpColorFore; + } + ppd.PluginWindowProc = (WNDPROC)MissYouPopupDlgProc; + ppd.PluginData = NULL; + ppd.iSeconds = -1; + + missyouactions[0].flags = PAF_ENABLED; + ppd.lpActions = missyouactions; + ppd.actionCount = 1; + + CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NEWDATA); + + SkinPlaySound("buddyExpectatorMissYou"); + } + } + + if (currentStatus == ID_STATUS_OFFLINE) + { + setLastSeen(hContact); + return 0; + } + + /* + if (CallService(MS_IGNORE_ISIGNORED, (WPARAM) hContact, (LPARAM) IGNOREEVENT_USERONLINE)) + { + setLastSeen(hContact); + return 0; + } + */ + + if (DBGetContactSettingDword(hContact, MODULE_NAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline) + { + ReturnNotify(hContact, Translate("has gone online for the first time.")); + + setLastSeen(hContact); + } + + unsigned int AbsencePeriod = DBGetContactSettingDword(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod); + if (isContactGoneFor(hContact, AbsencePeriod)) + { + char* message = Translate("has returned after a long absence."); + time_t tmpTime; + char tmpBuf[251] = {0}; + tmpTime = getLastSeen(hContact); + if (tmpTime != -1) + { + strftime(tmpBuf, 250, Translate("has returned after being absent since %#x"), gmtime(&tmpTime)); + message = tmpBuf; + } + else + { + tmpTime = getLastInputMsg(hContact); + if (tmpTime != -1) + { + strftime(tmpBuf, 250, Translate("has returned after being absent since %#x"), gmtime(&tmpTime)); + message = tmpBuf; + } + } + + ReturnNotify(hContact, message); + + if ((options.iShowMessageWindow == 0 && options.iShowUDetails == 0) || (options.iShowEvent == 0 && options.iShowPopUp == 0)) + { + setLastSeen(hContact); + } + } else + setLastSeen(hContact); + + return 0; +} + +void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) +{ + HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + char *proto; + while (hContact != 0) + { + proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + if (proto && (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0) == 0)) + { + DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 1); + SkinPlaySound("buddyExpectatorStillAbsent"); + + char* message = Translate("has not returned after a long absence."); + time_t tmpTime; + char tmpBuf[251] = {0}; + tmpTime = getLastSeen(hContact); + if (tmpTime != -1) + { + strftime(tmpBuf, 250, Translate("has not returned after being absent since %#x"), gmtime(&tmpTime)); + message = tmpBuf; + } + else + { + tmpTime = getLastInputMsg(hContact); + if (tmpTime != -1) + { + strftime(tmpBuf, 250, Translate("has not returned after being absent since %#x"), gmtime(&tmpTime)); + message = tmpBuf; + } + } + + GoneNotify(hContact, message); + } + + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); + } +} +/** + * Called when all the modules have had their modules loaded event handlers called (dependence of popups on fontservice :( ) + */ +int ModulesLoaded2(WPARAM wParam, LPARAM lParam) +{ + // check for 'still absent' contacts on startup + TimerProc(0, 0, 0, 0); + + return 0; +} + +/** + * Called when all the modules are loaded + */ +int ModulesLoaded(WPARAM wParam, LPARAM lParam) +{ + hEventUserInfoInit = HookEvent(ME_USERINFO_INITIALISE, UserinfoInit); + + // add sounds support + SkinAddNewSoundEx("buddyExpectatorReturn", Translate("BuddyExpectator"), Translate("Contact returned")); + SkinAddNewSoundEx("buddyExpectatorStillAbsent", Translate("BuddyExpectator"), Translate("Contact still absent")); + SkinAddNewSoundEx("buddyExpectatorMissYou", Translate("BuddyExpectator"), Translate("Miss you event")); + SkinAddNewSoundEx("buddyExpectatorHide", Translate("BuddyExpectator"), Translate("Hide contact event")); + + timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours + + hModulesLoaded2 = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded2); + if (options.MissYouIcon) + { + hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild); + hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying); + g_IECClear.cbSize = sizeof(IconExtraColumn); + g_IECClear.ColumnType = options.MissYouIcon; + g_IECClear.hImage = (HANDLE) -1; + } + + // IcoLib support + if (ServiceExists(MS_SKIN2_ADDICON)) + { + SKINICONDESC sid = {0}; + char szFile[MAX_PATH]; + GetModuleFileNameA(hInst, szFile, MAX_PATH); + sid.pszDefaultFile = szFile; + sid.cbSize = SKINICONDESC_SIZE_V1; + + sid.pszSection = Translate("BuddyExpectator"); + + sid.pszDescription = Translate("Tray/popup icon"); + sid.pszName = "main_icon"; + sid.iDefaultIndex = -IDI_MAINICON; + CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + sid.pszDescription = Translate("Enabled"); + sid.pszName = "enabled_icon"; + sid.iDefaultIndex = -IDI_ENABLED; + hEnabledIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + sid.pszDescription = Translate("Disabled"); + sid.pszName = "disabled_icon"; + sid.iDefaultIndex = -IDI_DISABLED; + hDisabledIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + sid.pszDescription = Translate("Hide"); + sid.pszName = "hide_icon"; + sid.iDefaultIndex = -IDI_HIDE; + CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + sid.pszDescription = Translate("NeverHide"); + sid.pszName = "neverhide_icon"; + sid.iDefaultIndex = -IDI_NEVERHIDE; + CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + + hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged); + } + + onIconsChanged(0,0); + + if (options.enableMissYou) + { + hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); + + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(CLISTMENUITEM); + mi.flags = CMIF_ICONFROMICOLIB; + mi.icolibItem = hDisabledIcon; + mi.position = 200000; + mi.pszName = Translate("Enable Miss You"); + mi.pszService = "BuddyExpectator/actionMissYouClick"; + hContactMenu = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi); + } + + // Updater plugin support + if (ServiceExists(MS_UPDATE_REGISTER)) + { + // register with updater + Update update = {0}; + char szVersion[16]; + + update.cbSize = sizeof(Update); + + update.szComponentName = pluginInfo.shortName; + update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); + update.cpbVersion = strlen((char *)update.pbVersion); + + update.szUpdateURL = UPDATER_AUTOREGISTER; + + // these are the three lines that matter - the archive, the page containing the version string, and the text (or data) + // before the version that we use to locate it on the page + // (note that if the update URL and the version URL point to standard file listing entries, the backend xml + // data will be used to check for updates rather than the actual web page - this is not true for beta urls) + update.szBetaUpdateURL = "http://thief.miranda.im/BuddyExpectator.zip"; + update.szBetaVersionURL = "http://thief.miranda.im/updater/buddyexpectator_version.txt"; + update.szBetaChangelogURL = "http://thief.miranda.im"; + update.pbBetaVersionPrefix = (BYTE *)"Buddy Expectator "; + + update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix); + + CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); + } + + missyouactions[0].cbSize = sizeof(POPUPACTION); + missyouactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"disabled_icon"); + lstrcpy(missyouactions[0].lpzTitle, Translate("Disable Miss You")); + missyouactions[0].wParam = missyouactions[0].lParam = 1; + + hideactions[0].cbSize = sizeof(POPUPACTION); + hideactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"hide_icon"); + lstrcpy(hideactions[0].lpzTitle, Translate("Hide contact")); + hideactions[0].wParam = hideactions[0].lParam = 2; + + hideactions[1].cbSize = sizeof(POPUPACTION); + hideactions[1].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"neverhide_icon"); + lstrcpy(hideactions[1].lpzTitle, Translate("Never hide this contact")); + hideactions[1].wParam = hideactions[1].lParam = 3; + + return 0; +} + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfo; +} + +extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) +{ + return &oldpluginInfo; +} + +int ContactAdded(WPARAM wParam, LPARAM lParam) +{ + DBWriteContactSettingDword((HANDLE)wParam, MODULE_NAME, "CreationTime", (DWORD)time(0)); + return 0; +} + +int onSystemOKToExit(WPARAM wParam,LPARAM lParam) +{ + UnhookEvent(hEventContactSetting); + UnhookEvent(hEventContactAdded); + UnhookEvent(hEventUserInfoInit); + if (hPrebuildContactMenu) UnhookEvent(hPrebuildContactMenu); + UnhookEvent(hIcoLibIconsChanged); + UnhookEvent(hModulesLoaded); + UnhookEvent(hModulesLoaded2); + UnhookEvent(hSystemOKToExit); + UnhookEvent(hHookExtraIconsRebuild); + UnhookEvent(hHookExtraIconsApply); + + DestroyServiceFunction(hContactReturnedAction); + DestroyServiceFunction(hContactStillAbsentAction); + DestroyServiceFunction(hMissYouAction); + DestroyServiceFunction(hMenuMissYouClick); + + DeinitOptions(); + + if (hIcoLibIconsChanged) + CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0); + else + DestroyIcon(hIcon); + + return 0; +} + +extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) +{ + pluginLink = link; + + setlocale(LC_ALL, "English"); // Set English locale + + InitOptions(); + + hContactReturnedAction = CreateServiceFunction("BuddyExpectator/actionReturned", ContactReturnedAction); + hContactStillAbsentAction = CreateServiceFunction("BuddyExpectator/actionStillAbsent", ContactStillAbsentAction); + hMissYouAction = CreateServiceFunction("BuddyExpectator/actionMissYou", MissYouAction); + hMenuMissYouClick = CreateServiceFunction("BuddyExpectator/actionMissYouClick", MenuMissYouClick); + + hEventContactSetting = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged); + hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); + hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit); + + hEventContactAdded = HookEvent(ME_DB_CONTACT_ADDED, ContactAdded); + + // ensure all contacts are timestamped + DBVARIANT dbv; + HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + DWORD current_time = (DWORD)time(0); + while (hContact != 0) + { + if (!DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv)) + DBFreeVariant(&dbv); + else + DBWriteContactSettingDword(hContact, MODULE_NAME, "CreationTime", current_time); + + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); + } + + return 0; +} + +extern "C" int __declspec(dllexport) Unload(void) +{ + KillTimer(0, timer_id); + + return 0; +} + diff --git a/BuddyExpectator/BuddyExpectator.dsp b/BuddyExpectator/BuddyExpectator.dsp new file mode 100644 index 0000000..b8a0eca --- /dev/null +++ b/BuddyExpectator/BuddyExpectator.dsp @@ -0,0 +1,119 @@ +# Microsoft Developer Studio Project File - Name="BuddyExpectator" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=BuddyExpectator - Win32 Debug +!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 "BuddyExpectator.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 "BuddyExpectator.mak" CFG="BuddyExpectator - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "BuddyExpectator - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "BuddyExpectator - Win32 Debug" (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)" == "BuddyExpectator - 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 Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUDDYEXPECTATOR_EXPORTS" /Yu"stdafx.h" /FD /c +# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUDDYEXPECTATOR_EXPORTS" /FD /c +# SUBTRACT CPP /YX /Yc /Yu +# 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 /nologo /dll /machine:I386 + +!ELSEIF "$(CFG)" == "BuddyExpectator - 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 Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUDDYEXPECTATOR_EXPORTS" /Yu"stdafx.h" /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUDDYEXPECTATOR_EXPORTS" /FD /GZ /c +# SUBTRACT CPP /YX /Yc /Yu +# 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 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 + +!ENDIF + +# Begin Target + +# Name "BuddyExpectator - Win32 Release" +# Name "BuddyExpectator - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\BuddyExpectator.cpp +# End Source File +# Begin Source File + +SOURCE=.\BuddyExpectator.rc +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# 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=.\icon1.ico +# End Source File +# End Group +# Begin Source File + +SOURCE=.\ReadMe.txt +# End Source File +# End Target +# End Project diff --git a/BuddyExpectator/BuddyExpectator.dsw b/BuddyExpectator/BuddyExpectator.dsw new file mode 100644 index 0000000..64425ef --- /dev/null +++ b/BuddyExpectator/BuddyExpectator.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "BuddyExpectator"=.\BuddyExpectator.dsp - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/BuddyExpectator/BuddyExpectator.mdsp b/BuddyExpectator/BuddyExpectator.mdsp new file mode 100644 index 0000000..35eb1ee --- /dev/null +++ b/BuddyExpectator/BuddyExpectator.mdsp @@ -0,0 +1,101 @@ +[Project] +name=BuddyExpectator +type=2 +defaultConfig=1 + + +[Debug] +// compiler +workingDirectory= +arguments= +intermediateFilesDirectory=Debug +outputFilesDirectory=Debug +compilerPreprocessor= +extraCompilerOptions= +compilerIncludeDirectory=..\..\include +noWarning=0 +defaultWarning=0 +allWarning=1 +extraWarning=0 +isoWarning=0 +warningsAsErrors=0 +debugType=1 +debugLevel=2 +exceptionEnabled=1 +runtimeTypeEnabled=1 +optimizeLevel=0 + +// linker +libraryPath= +outputFilename=Debug\BuddyExpectator.dll +libraries= +extraLinkerOptions= +ignoreStartupFile=0 +ignoreDefaultLibs=0 +stripExecutableFile=0 + +// archive +extraArchiveOptions= + +//resource +resourcePreprocessor= +resourceIncludeDirectory= +extraResourceOptions= + +[Release] +// compiler +workingDirectory= +arguments= +intermediateFilesDirectory=Release +outputFilesDirectory=Release +compilerPreprocessor= +extraCompilerOptions= +compilerIncludeDirectory=..\..\include +noWarning=0 +defaultWarning=0 +allWarning=1 +extraWarning=0 +isoWarning=0 +warningAsErrors=0 +debugType=0 +debugLevel=1 +exceptionEnabled=1 +runtimeTypeEnabled=1 +optimizeLevel=4 + +// linker +libraryPath= +outputFilename=Release\BuddyExpectator.dll +libraries= +extraLinkerOptions= +ignoreStartupFile=0 +ignoreDefaultLibs=0 +stripExecutableFile=1 + +// archive +extraArchiveOptions= + +//resource +resourcePreprocessor= +resourceIncludeDirectory= +extraResourceOptions= + +[Source] +1=BuddyExpectator.cpp +2=options.cpp +[Header] +1=common.h +2=options.h +3=resource.h +[Resource] +1=BuddyExpectator.rc +[Other] +1=docs\BuddyExpectator-Readme.txt +2=docs\BuddyExpectator-Translate.txt +[History] +options.cpp,3318 +common.h,1734 +options.h,1513 +docs\BuddyExpectator-Readme.txt,325 +docs\BuddyExpectator-Translate.txt,0 +BuddyExpectator.cpp,22589 diff --git a/BuddyExpectator/BuddyExpectator.rc b/BuddyExpectator/BuddyExpectator.rc new file mode 100644 index 0000000..39584af --- /dev/null +++ b/BuddyExpectator/BuddyExpectator.rc @@ -0,0 +1,216 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_OPTIONSPANEL DIALOGEX 0, 0, 227, 219 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +FONT 8, "MS Shell Dlg", 400, 0, 0xCC +BEGIN + LTEXT "When a contact returns after ",IDC_STATIC,21,16,112,8 + EDITTEXT IDC_EDIT_ABSENCE,137,13,22,13,ES_AUTOHSCROLL + COMBOBOX IDC_COMBO_PERIOD,161,13,49,51,CBS_DROPDOWNLIST | + WS_TABSTOP + CONTROL "Show a popup",IDC_CHECK_POPUP,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,21,38,189,10 + CONTROL "Add an event (flashing icon) to the contact", + IDC_CHECK_FLASHICON,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,21,51,187,10 + LTEXT "On event action (double click) or popup click:", + IDC_STATIC,21,63,187,8 + CONTROL "Open User Details",IDC_CHECK_UDETAILS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,32,75,176,10 + CONTROL "Open message window",IDC_CHECK_MSGWINDOW,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,32,86,176,10 + GROUPBOX "Return notification",IDC_STATIC,14,3,199,95 + LTEXT "When a contact is absent for",IDC_STATIC,20,114,112,8 + EDITTEXT IDC_EDIT_ABSENCE2,136,111,22,13,ES_AUTOHSCROLL + COMBOBOX IDC_COMBO_PERIOD2,160,111,49,51,CBS_DROPDOWNLIST | + WS_TABSTOP + GROUPBOX "Long time no see",IDC_STATIC,13,102,199,94 + CONTROL "or comes online for the first time", + IDC_CHECK_FIRSTSIGHT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,32,27,176,10 + CONTROL "Show a popup",IDC_CHECK_POPUP2,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,20,127,189,10 + CONTROL "Add an event (flashing icon) to the contact", + IDC_CHECK_FLASHICON2,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,20,140,187,10 + LTEXT "On event action (double click) or popup click:", + IDC_STATIC,20,152,187,8 + CONTROL "Enable ""Miss you"" feature",IDC_CHECK_MISSYOU,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,20,201,186,9 + EDITTEXT IDC_EDIT_SILENTFOR,135,179,22,13,ES_AUTOHSCROLL + COMBOBOX IDC_COMBO_PERIOD3,159,179,49,51,CBS_DROPDOWNLIST | + WS_TABSTOP + CONTROL "Hide when no messages for",IDC_CHECK_NOMSGS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,20,180,113,11 + COMBOBOX IDC_COMBO_ACTIONS,32,163,100,57,CBS_DROPDOWNLIST | + WS_TABSTOP +END + +IDD_POPUPPANEL DIALOGEX 0, 0, 190, 134 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + GROUPBOX "Colors",IDC_STATIC,7,7,176,42 + LTEXT "Background",IDC_STATIC,17,19,46,8 + LTEXT "Text",IDC_STATIC,17,34,46,8 + CONTROL "",IDC_COLOR_BGR,"ColourPicker",WS_TABSTOP,61,17,26,12 + CONTROL "",IDC_COLOR_FRG,"ColourPicker",WS_TABSTOP,61,32,26,12 + CONTROL "Use Popups colors",IDC_COLORS_POPUP,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,94,17,82,12 + CONTROL "Use Windows colors",IDC_COLORS_WIN,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,94,33,82,9 + GROUPBOX "Delay",IDC_STATIC,7,50,176,52 + CONTROL "Default",IDC_DELAY_DEF,"Button",BS_AUTORADIOBUTTON | + WS_GROUP | WS_TABSTOP,18,61,120,10 + CONTROL "Custom",IDC_DELAY_CUST,"Button",BS_AUTORADIOBUTTON,18, + 74,62,10 + CONTROL "Permanent",IDC_DELAY_PERM,"Button",BS_AUTORADIOBUTTON, + 18,87,119,10 + EDITTEXT IDC_EDIT_POPUPDELAY,81,72,30,14,ES_AUTOHSCROLL + LTEXT "sec",IDC_STATIC,116,75,34,8 + PUSHBUTTON "Preview",IDC_PREVIEW,58,106,75,17 +END + +IDD_USERINFO DIALOGEX 0, 0, 222, 132 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Last seen online:",IDC_STATIC,7,7,85,8 + EDITTEXT IDC_EDIT_LASTSEEN,99,7,116,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER + LTEXT "Last input message:",IDC_STATIC,7,22,85,8 + EDITTEXT IDC_EDIT_LASTINPUT,99,22,116,12,ES_AUTOHSCROLL | + ES_READONLY | NOT WS_BORDER + LTEXT "Custom absence period:",IDC_STATIC,7,36,85,12 + EDITTEXT IDC_EDITABSENCE,101,35,31,12,ES_AUTOHSCROLL + CONTROL "",IDC_SPINABSENCE,"msctls_updown32",UDS_SETBUDDYINT | + UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | + UDS_NOTHOUSANDS,163,14,8,13 + LTEXT "days",IDC_STATIC,138,36,77,10 + EDITTEXT IDC_EDIT_WILLNOTICE,7,93,208,30,ES_MULTILINE | + ES_READONLY | NOT WS_BORDER + CONTROL "Never hide this contact",IDC_CHECK_NEVERHIDE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,75,180,12 + CONTROL "Enable Miss You",IDC_CHECK_MISSYOU,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,7,47,200,19 + CONTROL "Notify always",IDC_CHECK_NOTIFYALWAYS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,27,64,188,10 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_OPTIONSPANEL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 220 + TOPMARGIN, 7 + BOTTOMMARGIN, 217 + END + + IDD_POPUPPANEL, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 183 + TOPMARGIN, 7 + BOTTOMMARGIN, 127 + END + + IDD_USERINFO, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 215 + VERTGUIDE, 92 + VERTGUIDE, 99 + TOPMARGIN, 7 + BOTTOMMARGIN, 125 + END +END +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_MAINICON ICON "icons\\main.ico" +IDI_ENABLED ICON "icons\\enabled.ico" +IDI_DISABLED ICON "icons\\disabled.ico" +IDI_HIDE ICON "icons\\hide.ico" +IDI_NEVERHIDE ICON "icons\\neverhide.ico" +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/BuddyExpectator/BuddyExpectator10.sln b/BuddyExpectator/BuddyExpectator10.sln new file mode 100644 index 0000000..cf4b219 --- /dev/null +++ b/BuddyExpectator/BuddyExpectator10.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BuddyExpectator", "BuddyExpectator10.vcxproj", "{8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Debug|Win32.ActiveCfg = Release|Win32 + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Debug|Win32.Build.0 = Release|Win32 + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Release|Win32.ActiveCfg = Release|Win32 + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/BuddyExpectator/BuddyExpectator10.vcxproj b/BuddyExpectator/BuddyExpectator10.vcxproj new file mode 100644 index 0000000..8bfceda --- /dev/null +++ b/BuddyExpectator/BuddyExpectator10.vcxproj @@ -0,0 +1,160 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + BuddyExpectator + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8} + BuddyExpectator + + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + true + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + AllRules.ruleset + + + AllRules.ruleset + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/BuddyExpectator.tlb + + + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + .\Debug/BuddyExpectator.pch + .\Debug/ + .\Debug/ + .\Debug/ + Level3 + true + EditAndContinue + 4996;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + + + ../../bin/$(Configuration)/plugins/BuddyExpectator.dll + true + true + .\Debug/BuddyExpectator.pdb + .\Debug/BuddyExpectator.lib + MachineX86 + + + true + .\Debug/BuddyExpectator.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/BuddyExpectator.tlb + + + + + Full + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS;%(PreprocessorDefinitions) + true + MultiThreaded + true + Level3 + true + 4996;%(DisableSpecificWarnings) + Size + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + + + true + true + MachineX86 + true + true + + + true + + + + + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BuddyExpectator/BuddyExpectator8.sln b/BuddyExpectator/BuddyExpectator8.sln new file mode 100644 index 0000000..008ccbe --- /dev/null +++ b/BuddyExpectator/BuddyExpectator8.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 9.00 +# Visual Studio 2005 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BuddyExpectator", "BuddyExpectator.vcproj", "{8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Release|Win32 = Release|Win32 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Debug|Win32.ActiveCfg = Debug|Win32 + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Debug|Win32.Build.0 = Debug|Win32 + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Release|Win32.ActiveCfg = Release|Win32 + {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Release|Win32.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/BuddyExpectator/BuddyExpectator8.vcproj b/BuddyExpectator/BuddyExpectator8.vcproj new file mode 100644 index 0000000..43b58f5 --- /dev/null +++ b/BuddyExpectator/BuddyExpectator8.vcproj @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BuddyExpectator/buddyexpectator.sln b/BuddyExpectator/buddyexpectator.sln new file mode 100644 index 0000000..058e392 --- /dev/null +++ b/BuddyExpectator/buddyexpectator.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 8.00 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "buddyexpectator", "buddyexpectator.vcproj", "{29FC6E79-39E6-469F-9899-158770B87F30}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + EndGlobalSection + GlobalSection(ProjectConfiguration) = postSolution + {29FC6E79-39E6-469F-9899-158770B87F30}.Debug.ActiveCfg = Debug|Win32 + {29FC6E79-39E6-469F-9899-158770B87F30}.Debug.Build.0 = Debug|Win32 + {29FC6E79-39E6-469F-9899-158770B87F30}.Release.ActiveCfg = Release|Win32 + {29FC6E79-39E6-469F-9899-158770B87F30}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/BuddyExpectator/buddyexpectator.vcproj b/BuddyExpectator/buddyexpectator.vcproj new file mode 100644 index 0000000..1040e28 --- /dev/null +++ b/BuddyExpectator/buddyexpectator.vcproj @@ -0,0 +1,185 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BuddyExpectator/buddyexpectator_version.txt b/BuddyExpectator/buddyexpectator_version.txt new file mode 100644 index 0000000..f867b26 --- /dev/null +++ b/BuddyExpectator/buddyexpectator_version.txt @@ -0,0 +1 @@ +Buddy Expectator 0.1.2.3 \ No newline at end of file diff --git a/BuddyExpectator/common.h b/BuddyExpectator/common.h new file mode 100644 index 0000000..6398727 --- /dev/null +++ b/BuddyExpectator/common.h @@ -0,0 +1,64 @@ +/* + Buddy Expectator+ plugin for Miranda-IM (www.miranda-im.org) + (c)2005 Anar Ibragimoff (ai91@mail.ru) + (c)2006 Scott Ellis (mail@scottellis.com.au) + (c)2007 Alexander Turyak (thief@miranda-im.org.ua) + + 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 + + File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/common.h $ + Revision : $Rev: 1392 $ + Last change on : $Date: 2009-04-22 17:46:08 +0300 (Ср, 22 апр 2009) $ + Last change by : $Author: Thief $ +*/ + +#ifndef _COMMON_INC +#define _COMMON_INC + +#include // needed by m_icolib.h > r9256 +#include +#include +#include +#include +#include +#include "resource.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "m_popup.h" +#include "m_popup2.h" +#include "m_updater.h" +#include "m_cluiframes.h" + +#define MODULE_NAME "BuddyExpectator" + +extern HINSTANCE hInst; +extern PLUGINLINK *pluginLink; + +void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD); +extern DWORD timer_id; + +#endif diff --git a/BuddyExpectator/docs/BuddyExpectator-Readme.txt b/BuddyExpectator/docs/BuddyExpectator-Readme.txt new file mode 100644 index 0000000..ea4f526 --- /dev/null +++ b/BuddyExpectator/docs/BuddyExpectator-Readme.txt @@ -0,0 +1,63 @@ +BuddyExpectator+ plugin v0.1.2.3 +This plugin notifies about contacts who has returned after an absence of long period. + +Features: + - Supports Popups module + - You may specify a sound for its' event + - Logs 'last seen' statistics (use User Details dialog) + - Uses built-in 'Ignore' list + +Version history: + +0.1.2.3 +- added extraicons for MissYou via hidden key (byte)bMissYouIcon - icon slot number +- added MissYou options to UserInfo page +- some fixes + +0.1.2.2 +- key BuddyExpectator/LastStatus is written to contact's module +- fixes to unload code + +0.1.2.1 +- bugfixes + +0.1.2.0 +- added an option to hide inactive contacts +- added an option to set custom absence perion for a contact +- addded support for Popup+ actions +- removed ignore online check +- changed icons (thanks to a0x and induction) +- implemended IcoLib API for menu icons (requires Miranda 0.7) +- implemented new plugin API +- implemented Updater support for beta versions + +0.0.0.7-0.0.1.2 (by Thief) +- percontact notification period setting +- IcoLib support +- implemented "Miss You" feature +- more popups colors options +- disabled notifications for non-IM protocols + +0.0.0.3-0.0.0.6 (by sje) +- "long time no see" feature +- first time online notification +- storing contact creation date in db +- other fixes including memleaks clearing + +0.0.0.1-0.0.0.2 +- initial version by Anar Ibragimoff + +Why +'Status notifyer'-like plugins are preety good... while your contactlist contains just 5, 10, 20 buddies. +Mine includes over 100 persons (family, friends, colleagues, messmates...). And every moment somebody goes offline, +others come back... So my left side of screen is always flickering with green/red popups ;-) +Sure, I can turn them off... But I want to be notified when somebody comes back after a vacation, business +trip, maternity leave ;-) +I found 'Contacts Notifier', but it's really inconveniently to watch for all buddies and their activity... and setup +a notifyer for everyone who has gone... +So I have thought out to notify just about contacts who were offline for a long time. +In other words, it works like 'Last seen' plugin, but with notification ;-) + +(c) 2007-2008, Alexander Turyak (turyak@gmail.com) +(c) 2006, Scott Ellis (mail@scottellis.com.au) +(c) 2005, Anar Ibragimoff, Minsk, Belarus (ai91@mail.ru) \ No newline at end of file diff --git a/BuddyExpectator/docs/BuddyExpectator-Translate.txt b/BuddyExpectator/docs/BuddyExpectator-Translate.txt new file mode 100644 index 0000000..a140810 --- /dev/null +++ b/BuddyExpectator/docs/BuddyExpectator-Translate.txt @@ -0,0 +1,42 @@ +;Translation template for BuddyExpectator+ plugin v0.1.2.x +;please do NOT change %#x and %d in your translation +[Buddy Expectator] +[has gone online for the first time.] +[has returned after a long absence.] +[has returned after being absent since %#x] +[has not returned after being absent since %#x] +[has not returned after a long absence.] +[not detected] +[not found] +[This contact has been absent for an extended period of time.] +[has returned after being absent since %d days] +[Contact returned] +[Contact still absent] +[Miss you event] +[Hide contact event] +[You awaited this contact!] +[Contact name] +[Hide contact] +[Enable Miss You] +[Disable Miss You] +[Tray/popup icon] + +;dialogs +[Last seen online:] +[Last input message:] +[Custom absence period:] +[Never hide this contact] +[Notify always] +[Return notification] +[When a contact returns after] +[or comes online for the first time] +[Show a popup] +[Add an event (flashing icon) to the contact] +[On event action (double click) or popup click:] +[Open User Details] +[Open message window] +[Long time no see] +[When a contact is absent for] +[Do nothing] +[Delete the contact] +[Enable "Miss you" feature] \ No newline at end of file diff --git a/BuddyExpectator/icons/disabled.ico b/BuddyExpectator/icons/disabled.ico new file mode 100644 index 0000000..5280ef1 Binary files /dev/null and b/BuddyExpectator/icons/disabled.ico differ diff --git a/BuddyExpectator/icons/enabled.ico b/BuddyExpectator/icons/enabled.ico new file mode 100644 index 0000000..316b22b Binary files /dev/null and b/BuddyExpectator/icons/enabled.ico differ diff --git a/BuddyExpectator/icons/hide.ico b/BuddyExpectator/icons/hide.ico new file mode 100644 index 0000000..deff488 Binary files /dev/null and b/BuddyExpectator/icons/hide.ico differ diff --git a/BuddyExpectator/icons/main.ico b/BuddyExpectator/icons/main.ico new file mode 100644 index 0000000..e7e514f Binary files /dev/null and b/BuddyExpectator/icons/main.ico differ diff --git a/BuddyExpectator/icons/neverhide.ico b/BuddyExpectator/icons/neverhide.ico new file mode 100644 index 0000000..8a6347b Binary files /dev/null and b/BuddyExpectator/icons/neverhide.ico differ diff --git a/BuddyExpectator/options.cpp b/BuddyExpectator/options.cpp new file mode 100644 index 0000000..6ebe7f3 --- /dev/null +++ b/BuddyExpectator/options.cpp @@ -0,0 +1,628 @@ +/* + Buddy Expectator+ plugin for Miranda-IM (www.miranda-im.org) + (c)2005 Anar Ibragimoff (ai91@mail.ru) + (c)2006 Scott Ellis (mail@scottellis.com.au) + (c)2007,2008 Alexander Turyak (thief@miranda-im.org.ua) + + 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 + + File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/options.cpp $ + Revision : $Rev: 1003 $ + Last change on : $Date: 2008-01-12 17:15:47 +0200 (Сб, 12 янв 2008) $ + Last change by : $Author: Thief $ +*/ + +#include "common.h" +#include "options.h" + +#define DEF_COLOR_BACK 0xCEF7AD +#define DEF_COLOR_FORE 0x000000 + +extern HICON hIcon; +extern time_t getLastSeen(HANDLE); +extern time_t getLastInputMsg(HANDLE); +extern bool isContactGoneFor(HANDLE, int); +Options options; + +void LoadOptions() +{ + options.iAbsencePeriod = DBGetContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod", 14); + options.iAbsencePeriod2 = DBGetContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod2", 30 * 3); + options.iSilencePeriod = DBGetContactSettingDword(NULL, MODULE_NAME, "iSilencePeriod", 30); + options.iShowPopUp = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowPopUp", 1); + options.iShowEvent = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowEvent", 0); + options.iShowUDetails = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowUDetails", 0); + options.iShowMessageWindow = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowMessageWindow", 1); + options.iPopUpColorBack = DBGetContactSettingDword(NULL, MODULE_NAME, "iPopUpColorBack", DEF_COLOR_BACK); + options.iPopUpColorFore = DBGetContactSettingDword(NULL, MODULE_NAME, "iPopUpColorFore", DEF_COLOR_FORE); + options.iUsePopupColors = DBGetContactSettingByte(NULL, MODULE_NAME, "iUsePopupColors", 0); + options.iUseWinColors = DBGetContactSettingByte(NULL, MODULE_NAME, "iUseWinColors", 0); + options.iPopUpDelay = DBGetContactSettingByte(NULL, MODULE_NAME, "iPopUpDelay", 0); + + options.iShowPopUp2 = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowPopUp2", 1); + options.iShowEvent2 = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowEvent2", 0); + options.action2 = (GoneContactAction)DBGetContactSettingByte(NULL, MODULE_NAME, "Action2", (BYTE)GCA_NOACTION); + options.notifyFirstOnline = DBGetContactSettingByte(NULL, MODULE_NAME, "bShowFirstSight", 0) ? true : false; + options.hideInactive = DBGetContactSettingByte(NULL, MODULE_NAME, "bHideInactive", 0) ? true : false; + options.enableMissYou = DBGetContactSettingByte(NULL, MODULE_NAME, "bMissYouEnabled", 1) ? true : false; + options.MissYouIcon = DBGetContactSettingByte(NULL, MODULE_NAME, "bMissYouIcon", 0); +} + +void SaveOptions() +{ + DBWriteContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod); + DBWriteContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod2", options.iAbsencePeriod2); + DBWriteContactSettingDword(NULL, MODULE_NAME, "iSilencePeriod", options.iSilencePeriod); + DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowPopUp", options.iShowPopUp); + DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowEvent", options.iShowEvent); + DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowUDetails", options.iShowUDetails); + DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowMessageWindow", options.iShowMessageWindow); + + DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowPopUp2", options.iShowPopUp2); + DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowEvent2", options.iShowEvent2); + DBWriteContactSettingByte(NULL, MODULE_NAME, "Action2", (BYTE)options.action2); + DBWriteContactSettingByte(NULL, MODULE_NAME, "bShowFirstSight", options.notifyFirstOnline ? 1 : 0); + DBWriteContactSettingByte(NULL, MODULE_NAME, "bHideInactive", options.hideInactive ? 1 : 0); + DBWriteContactSettingByte(NULL, MODULE_NAME, "bMissYouEnabled", options.enableMissYou ? 1 : 0); +} + + +void SavePopupOptions() +{ + DBWriteContactSettingDword(NULL, MODULE_NAME, "iPopUpColorBack", options.iPopUpColorBack); + DBWriteContactSettingDword(NULL, MODULE_NAME, "iPopUpColorFore", options.iPopUpColorFore); + DBWriteContactSettingByte(NULL, MODULE_NAME, "iUsePopupColors", options.iUsePopupColors); + DBWriteContactSettingByte(NULL, MODULE_NAME, "iUseWinColors", options.iUseWinColors); + DBWriteContactSettingByte(NULL, MODULE_NAME, "iPopUpDelay", options.iPopUpDelay); +} + +/** + * Options panel function + */ +static int CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + + if (!ServiceExists(MS_POPUP_ADDPOPUP)) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), FALSE); + } + + //iAbsencePeriod + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_RESETCONTENT, 0, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("days")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("weeks")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("months")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("years")); + if (options.iAbsencePeriod % 365 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/365, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 3, 0); + } + else if (options.iAbsencePeriod % 30 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/30, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 2, 0); + } + else if (options.iAbsencePeriod % 7 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/7, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 1, 0); + } + else + { + SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 0, 0); + } + + //iAbsencePeriod2 + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_RESETCONTENT, 0, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("days")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("weeks")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("months")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("years")); + if (options.iAbsencePeriod2 % 365 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/365, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 3, 0); + } + else if (options.iAbsencePeriod2 % 30 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/30, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 2, 0); + } + else if (options.iAbsencePeriod2 % 7 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/7, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 1, 0); + } + else + { + SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2,options.iAbsencePeriod2, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 0, 0); + } + + //iSilencePeriod + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_RESETCONTENT, 0, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("days")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("weeks")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("months")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("years")); + if (options.iSilencePeriod % 365 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/365, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 3, 0); + } + else if (options.iSilencePeriod % 30 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/30, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 2, 0); + } + else if (options.iSilencePeriod % 7 == 0) + { + SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/7, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 1, 0); + } + else + { + SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR,options.iSilencePeriod, FALSE); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 0, 0); + } + + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_SETCHECK, options.iShowPopUp > 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_SETCHECK, options.iShowEvent > 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_SETCHECK, (options.iShowUDetails > 0 ? BST_CHECKED : BST_UNCHECKED), 0); + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_SETCHECK, (options.iShowMessageWindow > 0 ? BST_CHECKED : BST_UNCHECKED), 0); + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_SETCHECK, options.notifyFirstOnline ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_SETCHECK, options.hideInactive ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_SETCHECK, options.enableMissYou ? BST_CHECKED : BST_UNCHECKED, 0); + + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_SETCHECK, options.iShowPopUp2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_SETCHECK, options.iShowEvent2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0); + + + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_RESETCONTENT, 0, 0); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Do nothing")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Delete the contact")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Open User Details")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Open message window")); + SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_SETCURSEL, options.action2, 0); + + return TRUE; + case WM_COMMAND: + if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) + || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE), EM_GETMODIFY, 0, 0))) + || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE2), EM_GETMODIFY, 0, 0))) + || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_SILENTFOR), EM_GETMODIFY, 0, 0)))) + { + SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + } + break; + case WM_NOTIFY: + { + NMHDR* nmhdr = (NMHDR*)lParam; + switch (nmhdr->code) + { + case PSN_APPLY: + + //iAbsencePeriod + int num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, 0, FALSE); + switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_GETCURSEL, 0, 0)) + { + case 1: options.iAbsencePeriod = 7 * num; break; + case 2: options.iAbsencePeriod = 30 * num; break; + case 3: options.iAbsencePeriod = 365 * num; break; + default: options.iAbsencePeriod = num; break; + } + + //iAbsencePeriod2 + num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, 0, FALSE); + switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_GETCURSEL, 0, 0)) + { + case 1: options.iAbsencePeriod2 = 7 * num; break; + case 2: options.iAbsencePeriod2 = 30 * num; break; + case 3: options.iAbsencePeriod2 = 365 * num; break; + default: options.iAbsencePeriod2 = num; break; + } + + //iSilencePeriod + num = GetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, 0, FALSE); + switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_GETCURSEL, 0, 0)) + { + case 1: options.iSilencePeriod = 7 * num; break; + case 2: options.iSilencePeriod = 30 * num; break; + case 3: options.iSilencePeriod = 365 * num; break; + default: options.iSilencePeriod = num; break; + } + + options.iShowPopUp = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowEvent = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowUDetails = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowMessageWindow = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.notifyFirstOnline = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; + options.hideInactive = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; + options.enableMissYou = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; + + options.iShowPopUp2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + options.iShowEvent2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; + + options.action2 = (GoneContactAction)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_GETCURSEL, 0, 0); + + // save values to the DB + SaveOptions(); + + // clear all notified settings + HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + while (hContact != 0) + { + if(DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0)) + DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0); + + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); + } + + // restart timer & run check + KillTimer(0, timer_id); + timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours + TimerProc(0, 0, 0, 0); + return TRUE; + } + break; + } + } + return 0; +} + +/** + * PopUp Options panel function + */ +static int CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + static int ChangeLock = 0; + switch (uMsg) + { + case WM_INITDIALOG: + + ChangeLock++; + TranslateDialogDefault(hwndDlg); + + //iPopUpColorBack + SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_SETCOLOUR, 0, options.iPopUpColorBack); + + //iPopUpColorFore + SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_SETCOLOUR, 0, options.iPopUpColorFore); + + if (options.iUsePopupColors) + { + CheckDlgButton(hwndDlg, IDC_COLORS_POPUP, BST_CHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), false); + } + + if (options.iUseWinColors) + { + CheckDlgButton(hwndDlg, IDC_COLORS_WIN, BST_CHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), false); + } + + //iPopUpDelay + SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 5, FALSE); + if (options.iPopUpDelay < 0) + { + SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_SETCHECK, BST_CHECKED, 0); + EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false); + } + else if(options.iPopUpDelay == 0) + { + SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_SETCHECK, BST_CHECKED, 0); + EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false); + } + else + { + SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_CUST), BM_SETCHECK, BST_CHECKED, 0); + SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, options.iPopUpDelay, FALSE); + } + + ChangeLock--; + return TRUE; + case WM_COMMAND: + if (LOWORD(wParam) == IDC_PREVIEW) + { + POPUPDATAEX ppd; + ZeroMemory(&ppd, sizeof(ppd)); + + //iPopUpDelay + options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE); + if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED) + { + options.iPopUpDelay = -1; + } + else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED) + { + options.iPopUpDelay = 0; + } + ppd.lchContact = NULL; + ppd.lchIcon = hIcon; + strncpy(ppd.lpzContactName, Translate("Contact name"), MAX_CONTACTNAME); + char szPreviewText[50]; + mir_snprintf(szPreviewText,50,Translate("has returned after being absent since %d days"),rand() % 30); + strncpy(ppd.lpzText, szPreviewText, MAX_SECONDLINE); + + // Get current popups colors options + if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) + { + ppd.colorBack = ppd.colorText = 0; + } + else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) + { + ppd.colorBack = GetSysColor(COLOR_BTNFACE); + ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); + } + else + { + ppd.colorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0); + ppd.colorText = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0); + } + ppd.PluginData = NULL; + ppd.iSeconds = options.iPopUpDelay; + + CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NO_HISTORY); + + strncpy(ppd.lpzText, Translate("You awaited this contact!"), MAX_SECONDLINE); + ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon");; + + CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NO_HISTORY); + } + else + { + if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) || ((HIWORD(wParam) == EN_CHANGE) && !ChangeLock)){ + SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); + } + if (LOWORD(wParam) == IDC_COLORS_POPUP) + { + if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), false); + } + else + { + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), true); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), true); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), true); + } + } + if (LOWORD(wParam) == IDC_COLORS_WIN) + { + if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), false); + } + else + { + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), true); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), true); + EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), true); + } + } + if (LOWORD(wParam) == IDC_DELAY_DEF || LOWORD(wParam) == IDC_DELAY_PERM) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false); + } + else if (LOWORD(wParam) == IDC_DELAY_CUST) + { + EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), true); + } + } + + break; + case WM_NOTIFY:{ + NMHDR* nmhdr = (NMHDR*)lParam; + switch (nmhdr->code) + { + case PSN_APPLY: + + if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) + { + options.iUsePopupColors = 1; + options.iUseWinColors = 0; + } + else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) + { + options.iUseWinColors = 1; + options.iUsePopupColors = 0; + options.iPopUpColorBack = GetSysColor(COLOR_BTNFACE); + options.iPopUpColorFore = GetSysColor(COLOR_WINDOWTEXT); + } + else + { + options.iUseWinColors = options.iUsePopupColors = 0; + options.iPopUpColorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0); + options.iPopUpColorFore = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0); + } + + //iPopUpDelay + options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE); + if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED) + { + options.iPopUpDelay = -1; + } + else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED) + { + options.iPopUpDelay = 0; + } + + // save value to the DB + SavePopupOptions(); + + return TRUE; + } + break; + } + } + return 0; +} + +/** + * Init options panel + */ +static int OptionsInit(WPARAM wParam, LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp; + ZeroMemory(&odp, sizeof(odp)); + odp.cbSize = sizeof(odp); + odp.hInstance = hInst; + odp.pszGroup = Translate("Plugins"); + odp.pszTemplate = MAKEINTRESOURCE(IDD_OPTIONSPANEL); + odp.pszTitle = Translate("Buddy Expectator"); + odp.pfnDlgProc = OptionsFrameProc; + odp.flags = ODPF_BOLDGROUPS; + CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); + + if (ServiceExists(MS_POPUP_ADDPOPUP)) + { + odp.pszGroup = Translate("PopUps"); + odp.pszTemplate = MAKEINTRESOURCE(IDD_POPUPPANEL); + odp.pfnDlgProc = PopUpOptionsFrameProc; + CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); + } + + return 0; +} + +BOOL CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) +{ + switch (msg) + { + case WM_INITDIALOG: + { + time_t tmpTime; + char tmpBuf[51] = {0}; + tmpTime = getLastSeen((HANDLE)lparam); + if (tmpTime == -1) + SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, Translate("not detected")); + else + { + /* + int status = DBGetContactSettingWord((HANDLE)lparam, MODULE_NAME, "LastStatus", ID_STATUS_OFFLINE); + char *strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)status, (LPARAM)0); + */ + strftime(tmpBuf, 50, "%#x", gmtime(&tmpTime)); + SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf); + } + + tmpTime = getLastInputMsg((HANDLE)lparam); + if (tmpTime == -1) + SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, Translate("not found")); + else + { + strftime(tmpBuf, 50, "%#x", gmtime(&tmpTime)); + SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf); + } + + unsigned int AbsencePeriod = DBGetContactSettingDword((HANDLE)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod); + + SendDlgItemMessage(hdlg, IDC_SPINABSENCE, UDM_SETRANGE, 0, MAKELONG(999, 1)); + SetDlgItemInt(hdlg, IDC_EDITABSENCE, AbsencePeriod, FALSE); + + if (isContactGoneFor((HANDLE)lparam, options.iAbsencePeriod2)) + { + SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, Translate("This contact has been absent for an extended period of time.")); + } + else + { + SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, ""); + } + + SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED, 0); + SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED, 0); + + TranslateDialogDefault(hdlg); + + return TRUE; + } + + case WM_NOTIFY: + switch (((LPNMHDR)lparam)->idFrom) + { + case 0: + switch (((LPNMHDR)lparam)->code) + { + case (PSN_APPLY): + { + HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lparam)->lParam; + if (hContact) + { + DBWriteContactSettingDword(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, 0, FALSE)); + DBWriteContactSettingByte(hContact, MODULE_NAME, "MissYou", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); + DBWriteContactSettingByte(hContact, MODULE_NAME, "MissYouNotifyAlways", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); + DBWriteContactSettingByte(hContact, MODULE_NAME, "NeverHide", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); + } + break; + } + } + break; + } + break; + + case WM_COMMAND: + if (wparam == MAKEWPARAM(IDC_EDITABSENCE, EN_CHANGE)) + SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); + else if (LOWORD(wparam) == IDCANCEL) + SendMessage(GetParent(hdlg), msg, wparam, lparam); + break; + } + + return FALSE; +} + +int UserinfoInit(WPARAM wparam, LPARAM lparam) +{ + if (lparam > 0) + { + OPTIONSDIALOGPAGE uip = {0}; + uip.cbSize = sizeof(uip); + uip.hInstance = hInst; + uip.pszTemplate = MAKEINTRESOURCE(IDD_USERINFO); + uip.pszTitle = Translate("Buddy Expectator"); + uip.pfnDlgProc = UserinfoDlgProc; + + CallService(MS_USERINFO_ADDPAGE, wparam, (LPARAM)&uip); + } + return 0; +} + + +HANDLE hEventOptInitialise; +void InitOptions() +{ + LoadOptions(); + hEventOptInitialise = HookEvent(ME_OPT_INITIALISE, OptionsInit); +} + +void DeinitOptions() +{ + UnhookEvent(hEventOptInitialise); +} diff --git a/BuddyExpectator/options.h b/BuddyExpectator/options.h new file mode 100644 index 0000000..ade65c5 --- /dev/null +++ b/BuddyExpectator/options.h @@ -0,0 +1,64 @@ +/* + Buddy Expectator+ plugin for Miranda-IM (www.miranda-im.org) + (c)2005 Anar Ibragimoff (ai91@mail.ru) + (c)2006 Scott Ellis (mail@scottellis.com.au) + (c)2007,2008 Alexander Turyak (thief@miranda-im.org.ua) + + 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 + + File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/options.h $ + Revision : $Rev: 1003 $ + Last change on : $Date: 2008-01-12 17:15:47 +0200 (Сб, 12 янв 2008) $ + Last change by : $Author: Thief $ +*/ + +#ifndef _OPTIONS_INC +#define _OPTIONS_INC + +typedef enum GoneContactAction { GCA_NOACTION, GCA_DELETE, GCA_UDETAILS, GCA_MESSAGE }; + +typedef struct { + int iAbsencePeriod; // notify period for returning contacts + int iShowPopUp; + int iShowEvent; + int iShowUDetails; + int iShowMessageWindow; + + bool notifyFirstOnline; + bool enableMissYou; + bool hideInactive; + byte MissYouIcon; + + int iAbsencePeriod2; // notify period for contacts that have remained away + int iShowPopUp2; + int iShowEvent2; + GoneContactAction action2; + + int iSilencePeriod; // notify period for contacts that didn't send messages + + int iPopUpColorBack; + int iPopUpColorFore; + int iPopUpDelay; + int iUsePopupColors; + int iUseWinColors; + +} Options; + +extern Options options; + +void InitOptions(); +void DeinitOptions(); + +#endif diff --git a/BuddyExpectator/resource.h b/BuddyExpectator/resource.h new file mode 100644 index 0000000..b06406a --- /dev/null +++ b/BuddyExpectator/resource.h @@ -0,0 +1,56 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by BuddyExpectator.rc +// +#define IDI_MAINICON 101 +#define IDI_ENABLED 102 +#define IDI_DISABLED 103 +#define IDI_HIDE 104 +#define IDI_NEVERHIDE 105 +#define IDD_OPTIONSPANEL 201 +#define IDD_POPUPPANEL 202 +#define IDD_USERINFO 203 +#define IDC_CHECK_POPUP 1000 +#define IDC_CHECK_POPUP2 1001 +#define IDC_CHECK_UDETAILS 1002 +#define IDC_CHECK_MSGWINDOW 1003 +#define IDC_CHECK_FLASHICON 1004 +#define IDC_CHECK_FLASHICON2 1005 +#define IDC_CHECK_FIRSTSIGHT 1006 +#define IDC_COMBO_PERIOD 1011 +#define IDC_COMBO_PERIOD2 1012 +#define IDC_COMBO_PERIOD3 1013 +#define IDC_COLOR_FRG 1021 +#define IDC_COLOR_BGR 1022 +#define IDC_COLORS_POPUP 1023 +#define IDC_COLORS_WIN 1024 +#define IDC_DELAY_DEF 1031 +#define IDC_DELAY_CUST 1032 +#define IDC_DELAY_PERM 1033 +#define IDC_EDIT_ABSENCE 1041 +#define IDC_EDIT_ABSENCE2 1042 +#define IDC_EDIT_POPUPDELAY 1043 +#define IDC_EDIT_SILENTFOR 1044 +#define IDC_EDIT_LASTSEEN 1045 +#define IDC_EDIT_LASTINPUT 1046 +#define IDC_EDIT_NOINPUTFOR 1047 +#define IDC_EDIT_WILLNOTICE 1048 +#define IDC_PREVIEW 1061 +#define IDC_CHECK_MISSYOU 1203 +#define IDC_EDITABSENCE 1204 +#define IDC_SPINABSENCE 1205 +#define IDC_CHECK_NOMSGS 1208 +#define IDC_COMBO_ACTIONS 1209 +#define IDC_CHECK_NEVERHIDE 1210 +#define IDC_CHECK_NOTIFYALWAYS 1211 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 106 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1212 +#define _APS_NEXT_SYMED_VALUE 121 +#endif +#endif diff --git a/Console/Console.c b/Console/Console.c new file mode 100644 index 0000000..7a05aed --- /dev/null +++ b/Console/Console.c @@ -0,0 +1,1538 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2008 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "commonheaders.h" + +#define MS_CONSOLE_SHOW_HIDE "Console/Show/Hide" + +// console toptoolbarbutton(old) integration +#define TTB 1 + +#define DEFAULT_WRAPLEN 90 +#define MIN_WRAPLEN 25 +#define MAX_WRAPLEN 255 + +#define MIN_LIMIT 1000 +#define MAX_LIMIT 1000000 + +#define IMG_EMPTY 0 +#define IMG_ARROW 1 +#define IMG_IN 2 +#define IMG_OUT 3 +#define IMG_INFO 4 + +#define LOGICONX_SIZE 10 +#define LOGICONY_SIZE 10 + +#define ICON_FIRST 3 + +#define ICON_NOSCROLL 1 +#define ICON_PAUSED 2 +#define ICON_SCROLL 3 +#define ICON_STARTED 4 + +#define HM_DUMP (WM_USER+10) +#define HM_ADD (WM_USER+11) +#define HM_REMOVE (WM_USER+12) +#define HM_SETFONT (WM_USER+13) +#define HM_SETCOLOR (WM_USER+14) +#define HM_PAUSEALL (WM_USER+15) +#define HM_RESTART (WM_USER+16) + + +typedef struct { + const char* pszHead; + const char* pszMsg; +} LOGMSG; + + +typedef struct { + char szModule[128]; + TCHAR szMsg[1]; +} DUMPMSG; + + +typedef struct { + HWND hwnd; + HANDLE hList; + char *Module; + int Scroll; + int Paused; + int newline; +} LOGWIN; + + +struct MM_INTERFACE mmi; +struct UTF8_INTERFACE utfi; +struct LIST_INTERFACE li; + +static SortedList lModules = {0}; + +static LOGWIN *pActive = NULL; +static int tabCount = 0; +static RECT rcTabs = {0}; +static HWND hTabs = NULL; +static HWND hwndConsole = NULL; + +static HIMAGELIST gImg = NULL; +static HFONT hfLogFont = NULL; + +static int gIcons = 0; +static int gVisible = 0; +static int gSingleMode = 0; +static int gLimit = 0; +static int gSeparator = 0; + +static DWORD gWrapLen = DEFAULT_WRAPLEN; + +static DWORD OutMsgs = 0; +static DWORD InMsgs = 0; + +static HICON hIcons[15] = {0}; +static HANDLE hHooks[4] = {0}; + +static HANDLE hTButton = 0; +static HANDLE hMenu = NULL; + +static void LoadSettings(); +static void ShowConsole(int show); +static int ShowHideConsole(WPARAM wParam, LPARAM lParam); +static int Openfile(TCHAR *outputFile, int selection); + +//////////////////////////////////////////////////////////////////////////////// + +#ifdef TTB +static HBITMAP BmpUp = NULL; +static HBITMAP BmpDn = NULL; +static HANDLE hTTBButt = 0; + +static int HideConsoleButt(WPARAM wParam,LPARAM lParam) +{ + ShowConsole(0); + return 0; +} + +static int ShowConsoleButt(WPARAM wParam,LPARAM lParam) +{ + ShowConsole(1); + return 0; +} + +static int OnTTBLoaded(WPARAM wParam,LPARAM lParam) +{ + + if (IsWindow(hwndConsole)) + { + TTBButton ttbb = {0}; + int state = IsWindowVisible(hwndConsole); + + CreateServiceFunction("Console/Hide", HideConsoleButt); + CreateServiceFunction("Console/Show", ShowConsoleButt); + + BmpUp = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_CONSOLE_UP)); + BmpDn = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_CONSOLE_DOWN)); + + ttbb.cbSize = sizeof(ttbb); + ttbb.hbBitmapUp = BmpUp; + ttbb.hbBitmapDown = BmpDn; + ttbb.dwFlags=(state?TTBBF_PUSHED:0)|TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP; + ttbb.pszServiceDown = "Console/Show"; + ttbb.pszServiceUp = "Console/Hide"; + ttbb.name = Translate("Show/Hide Console"); + hTTBButt = (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttbb, 0); + + if (hTTBButt) + { + CallService(MS_TTB_SETBUTTONOPTIONS,MAKEWPARAM(TTBO_TIPNAME,hTTBButt), + (LPARAM)(state?Translate("Hide Console"):Translate("Show Console"))); + + CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTBButt, (LPARAM)(state?TTBST_PUSHED:TTBST_RELEASED)); + } + } + return 0; +} +#endif + +//////////////////////////////////////////////////////////////////////////////// + +void ScrollDown(LOGWIN * dat) { + if (dat->Scroll) + ListView_EnsureVisible(dat->hList, ListView_GetItemCount( dat->hList ) - 1, FALSE); +} + +//////////////////////////////////////////////////////////////////////////////// + +static void ShowConsole(int show) +{ + HWND hwnd = NULL; + + if (!hwndConsole || !pActive) return; + + gVisible = show; + + if (show) { + hwnd = GetForegroundWindow(); + if ( InMsgs == OutMsgs ) + ScrollDown( pActive ); + } + ShowWindow(hwndConsole, (show)?SW_SHOW:SW_HIDE); + DBWriteContactSettingByte(NULL,"Console","Show",(BYTE)((show)?1:0)); + + if (hwnd) + SetForegroundWindow(hwnd); + + if (show) + RedrawWindow(pActive->hList, NULL, NULL, RDW_INVALIDATE | RDW_FRAME |RDW_UPDATENOW | RDW_ERASE); + + if (hMenu) + { + CLISTMENUITEM mi = {0}; + + mi.cbSize = sizeof(mi); + mi.ptszName=(show)?TranslateT("Hide Console"):TranslateT("Show Console"); + mi.flags = CMIM_NAME | CMIF_TCHAR;; + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenu, (LPARAM)&mi); + } + + if (hTButton) + { + CallService(MS_TB_SETBUTTONSTATEBYID, (WPARAM)"console_btn", (show)?TBST_PUSHED:TBST_RELEASED); + } + +#ifdef TTB + if (hTTBButt) + { + CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTBButt, (show)?TTBST_PUSHED:TTBST_RELEASED); + CallService(MS_TTB_SETBUTTONOPTIONS,MAKEWPARAM(TTBO_TIPNAME,hTTBButt), + (LPARAM)(show?Translate("Hide Console"):Translate("Show Console"))); + } +#endif +} + +//////////////////////////////////////////////////////////////////////////////// + +static int ShowHideConsole(WPARAM wParam, LPARAM lParam) +{ + if (hwndConsole) + ShowConsole(!IsWindowVisible(hwndConsole)); + + return 0; +} + +//////////////////////////////////////////////////////////////////////////////// + +int LogResize(HWND hwnd,LPARAM lParam,UTILRESIZECONTROL *urc) +{ + switch(urc->wId) { + case IDC_LIST: + ListView_SetColumnWidth(GetDlgItem(hwnd, IDC_LIST), 0, urc->dlgNewSize.cx - 25); + return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT; + case IDC_STARTALL: + case IDC_PAUSEALL: + case IDC_CLOSE: + return RD_ANCHORX_RIGHT|RD_ANCHORY_TOP; + default: + return RD_ANCHORX_LEFT|RD_ANCHORY_TOP; + } +} + +//////////////////////////////////////////////////////////////////////////////// + +typedef struct +{ + UINT control; + UINT icon; + int type; + TCHAR *tooltip; +} controlinfo; + + +static controlinfo ctrls[] = +{ + // IDC_SCROLL & IDC_PAUSE must be first + {IDC_SCROLL, IDI_SCROLL, BUTTONSETASFLATBTN, _T("Scrolling (Ctrl+Q)")}, + {IDC_PAUSE, IDI_STARTED, BUTTONSETASFLATBTN, _T("Pause logging(Ctrl+P)")}, + {IDC_SAVE, IDI_SAVE, BUTTONSETASFLATBTN, _T("Save log to file (Ctrl+S)")}, + {IDC_COPY, IDI_COPY, BUTTONSETASFLATBTN, _T("Copy selected log (Ctrl+C)")}, + {IDC_DELETE, IDI_DELETE, BUTTONSETASFLATBTN, _T("Delete selected (Del)")}, + {IDC_OPTIONS, IDI_OPTIONS, BUTTONSETASFLATBTN, _T("Log options (Ctrl+O)")}, + {IDC_STARTALL, IDI_START, BUTTONSETASFLATBTN, _T("Start logging in all tabs")}, + {IDC_PAUSEALL, IDI_PAUSE, BUTTONSETASFLATBTN, _T("Pause logging in all tabs")}, + {IDC_CLOSE, IDI_CLOSE, BUTTONSETASFLATBTN, _T("Close tab (Ctrl+W)")}, +}; + +//////////////////////////////////////////////////////////////////////////////// + +static LRESULT CALLBACK SubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) +{ + int ctrl = GetKeyState(VK_CONTROL)&0x8000; + + switch (msg) { + + case WM_KEYDOWN: + if ( wParam == VK_DELETE && !ctrl) { + SendMessage(GetParent(hwnd), WM_COMMAND, IDC_DELETE, 0); + break; + } + + if (wParam == VK_LEFT && ctrl) + { + NMHDR nmhdr = {0}; + int tab = TabCtrl_GetCurSel(hTabs); + + if (tab == 0) + tab = TabCtrl_GetItemCount(hTabs)-1; + else + tab--; + + TabCtrl_SetCurSel(hTabs, tab); + nmhdr.code = TCN_SELCHANGE; + SendMessage(hwndConsole, WM_NOTIFY, IDC_TABS, (LPARAM)&nmhdr); + break; + } + + if (wParam == VK_RIGHT && ctrl) + { + NMHDR nmhdr = {0}; + int tab = TabCtrl_GetCurSel(hTabs); + int count = TabCtrl_GetItemCount(hTabs); + tab = (tab + 1) % count; + + TabCtrl_SetCurSel(hTabs, tab); + nmhdr.code = TCN_SELCHANGE; + SendMessage(hwndConsole, WM_NOTIFY, IDC_TABS, (LPARAM)&nmhdr); + break; + } + + break; + + case WM_CHAR: +/* + { + char t[32]; + sprintf(t,"%u\n",wParam); + OutputDebugStringA(t); + } +*/ + // CTRL + if ( !(GetKeyState(VK_CONTROL)&0x8000) ) + break; + + switch(wParam) { + + case 1: // Ctrl+A + if ( ListView_GetSelectedCount(hwnd) != (UINT)ListView_GetItemCount(hwnd) ) + ListView_SetItemState(hwnd, -1, LVIS_SELECTED, LVIS_SELECTED); + return 0; + + case 3: // Ctrl+D + SendMessage(GetParent(hwnd), WM_COMMAND, IDC_COPY, 0); + return 0; + + case 15: // Ctrl+O + SendMessage(GetParent(hwnd), WM_COMMAND, IDC_OPTIONS, 0); + return 0; + + case 16: // Ctrl+P + SendMessage(GetParent(hwnd), WM_COMMAND, IDC_PAUSE, 0); + return 0; + + case 17: // Ctrl+Q + SendMessage(GetParent(hwnd), WM_COMMAND, IDC_SCROLL, 0); + return 0; + + case 19: // Ctrl+S + SendMessage(GetParent(hwnd), WM_COMMAND, IDC_SAVE, 0); + return 0; + + case 23: // Ctrl+W + SendMessage(GetParent(hwnd), WM_COMMAND, IDC_CLOSE, 0); + return 0; + } + break; + } + return CallWindowProc((WNDPROC)GetWindowLong(hwnd, GWLP_USERDATA),hwnd,msg,wParam,lParam); +} + +//////////////////////////////////////////////////////////////////////////////// + +static BOOL CALLBACK LogDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam) +{ + + LOGWIN *dat = (LOGWIN*)GetWindowLong(hwndDlg, GWLP_USERDATA); + + switch(message) { + case WM_INITDIALOG: + { + dat = (LOGWIN*)lParam; + + dat->hwnd = hwndDlg; + dat->Scroll = 1; + dat->Paused = 0; + dat->hList = GetDlgItem(hwndDlg, IDC_LIST); + + SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG)dat); + SetWindowLong(dat->hList, GWLP_USERDATA, SetWindowLong(dat->hList,GWLP_WNDPROC,(LONG)SubclassProc)); + + // init buttons + { + int i; + HWND hwnd; + for(i = 0; i < SIZEOF(ctrls); i++) { + hwnd = GetDlgItem(hwndDlg,ctrls[i].control); + SendMessage(hwnd, ctrls[i].type, 0, 0); + SendMessage(hwnd, BUTTONADDTOOLTIP,(WPARAM)TranslateTS(ctrls[i].tooltip), BATF_TCHAR); + SendMessage(hwnd, BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcons[i+ICON_FIRST]); + } + } + + CheckDlgButton(hwndDlg,IDC_SCROLL,dat->Scroll?BST_CHECKED:BST_UNCHECKED); + SendDlgItemMessage(hwndDlg,IDC_SCROLL,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcons[(dat->Scroll?ICON_SCROLL:ICON_NOSCROLL)]); + + if (gSingleMode) + { + ShowWindow(GetDlgItem(hwndDlg, IDC_PAUSEALL), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg, IDC_STARTALL), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg, IDC_CLOSE), SW_HIDE); + } + + // init listview + { + LVITEM lvi = {0}; + LVCOLUMN sLC; + //ListView_SetUnicodeFormat(dat->hList, FALSE); + ListView_SetImageList(dat->hList, gImg, LVSIL_SMALL); + sLC.mask = LVCF_FMT | LVCF_WIDTH; + sLC.fmt = LVCFMT_LEFT; + sLC.cx = 630; + ListView_InsertColumn(dat->hList,0,&sLC); + ListView_SetExtendedListViewStyle(dat->hList, LVS_EX_FULLROWSELECT); + + lvi.mask = LVIF_TEXT; + if (gIcons) + { + lvi.mask |= LVIF_IMAGE; + lvi.iImage = IMG_INFO; + } + + lvi.pszText = TranslateT("*** Console started ***"); + ListView_InsertItem(dat->hList,&lvi); + } + + SendMessage(hwndDlg, WM_SIZE, 0, 0); + break; + } + case HM_DUMP: + { + // lParam = DUMPMSG + if (!lParam) break; + if (dat && !dat->Paused) + { + LVITEM lvi = {0}; + int last = 0x7fffffff; + TCHAR szBreak; + DWORD len, tmplen; + DWORD wraplen = gWrapLen; + TCHAR *str = ((DUMPMSG*)lParam)->szMsg; + + lvi.iItem = 0x7fffffff; + + str = _tcstok(str, _T("\n")); + + if (gIcons && str != NULL) + { + lvi.mask = LVIF_TEXT | LVIF_IMAGE; + + if (_tcsstr(str, _T("Data received"))) + { + if (gSeparator) ListView_InsertItem(dat->hList, &lvi); + lvi.iImage = IMG_IN; + } + else + if (_tcsstr(str, _T("Data sent"))) + { + if (gSeparator) ListView_InsertItem(dat->hList, &lvi); + lvi.iImage = IMG_OUT; + } + else + { + if (gSeparator && dat->newline) + { + ListView_InsertItem(dat->hList, &lvi); + dat->newline = 0; + } + lvi.iImage = IMG_INFO; + } + } else + lvi.mask = LVIF_TEXT; + + while (str != NULL) + { + lvi.pszText = &str[0]; + tmplen = len = _tcslen(lvi.pszText); + + while(len > wraplen) + { + szBreak = lvi.pszText[wraplen]; + lvi.pszText[wraplen] = 0; + last = ListView_InsertItem(dat->hList, &lvi); + lvi.pszText[wraplen] = szBreak; + len -= wraplen; + lvi.pszText = &str[0] + tmplen - len; + + dat->newline = 1; + lvi.iImage = IMG_EMPTY; + } + + if (len && lvi.pszText[len-1] == '\r') + lvi.pszText[len-1] = 0; + + last = ListView_InsertItem(dat->hList, &lvi); + + str = _tcstok(NULL, _T("\n")); + + if (str) dat->newline = 1; + lvi.iImage = IMG_EMPTY; + } + + + if ( gVisible && dat == pActive && dat->Scroll == 1 ) + ListView_EnsureVisible(dat->hList, last, FALSE); + + if (last > gLimit) + { + int idx = last - gLimit + gLimit/4; // leave only 75% of LIMIT + + while (idx >= 0) + { + ListView_DeleteItem(dat->hList, idx); + idx--; + } + } + } + + free((DUMPMSG*)lParam); + return TRUE; + } + case WM_SIZE: + { + UTILRESIZEDIALOG urd={0}; + urd.cbSize=sizeof(urd); + urd.hInstance=hInst; + urd.hwndDlg=hwndDlg; + urd.lpTemplate=MAKEINTRESOURCEA(IDD_LOG); + urd.pfnResizer=LogResize; + SetWindowPos(hwndDlg, HWND_TOP, rcTabs.left, rcTabs.top, rcTabs.right - rcTabs.left, rcTabs.bottom - rcTabs.top, SWP_SHOWWINDOW); + CallService(MS_UTILS_RESIZEDIALOG,0,(LPARAM)&urd); + break; + } + case WM_COMMAND: + { + switch(LOWORD(wParam)) + { + if (!dat) break; + + case IDC_PAUSE: + { + LVITEM lvi = {0}; + dat->Paused = !(dat->Paused); + lvi.mask = LVIF_TEXT | LVIF_IMAGE; + lvi.iImage = IMG_INFO; + lvi.iItem = 0x7FFFFFFF; + lvi.pszText = (dat->Paused) ? TranslateT("*** Console paused ***") : TranslateT("*** Console resumed ***"); + ListView_InsertItem(dat->hList,&lvi); + CheckDlgButton(hwndDlg,IDC_PAUSE,(dat->Paused)?BST_CHECKED:BST_UNCHECKED); + SendDlgItemMessage(hwndDlg,IDC_PAUSE,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcons[((dat->Paused)?ICON_PAUSED:ICON_STARTED)]); + break; + } + case IDC_SCROLL: + { + dat->Scroll = !(dat->Scroll); + CheckDlgButton(hwndDlg,IDC_SCROLL,(dat->Scroll)?BST_CHECKED:BST_UNCHECKED); + SendDlgItemMessage(hwndDlg,IDC_SCROLL,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcons[((dat->Scroll)?ICON_SCROLL:ICON_NOSCROLL)]); + break; + } + case IDC_COPY: + { + int idx = 0; + TCHAR szText[128]; + TCHAR *src, *dst, *buf; + int flags = LVNI_BELOW; + int count = ListView_GetSelectedCount(dat->hList); + + if (count) + flags |= LVNI_SELECTED; + else + count = ListView_GetItemCount(dat->hList); + + dst = buf = malloc((count*(sizeof(szText)+1)+1)*sizeof(TCHAR)); + if (!buf) break; + + while ((idx = ListView_GetNextItem(dat->hList,idx,flags)) > 0) + { + ListView_GetItemText(dat->hList, idx, 0, szText, sizeof(szText)-1); + src = szText; + while (*dst++ = *src++); + dst--; + *dst++ = '\r'; + *dst++ = '\n'; + *dst = 0; + } + + if (dst - buf > 0 && OpenClipboard(hwndDlg)) { + HGLOBAL hClipboardData; + TCHAR* pchData; + EmptyClipboard(); + if (hClipboardData = GlobalAlloc(GMEM_DDESHARE, (dst-buf+1)*sizeof(TCHAR))) { + pchData = (TCHAR*)GlobalLock(hClipboardData); + _tcscpy(pchData, buf); + GlobalUnlock(hClipboardData); + #ifdef UNICODE + SetClipboardData(CF_UNICODETEXT,hClipboardData); + #else + SetClipboardData(CF_TEXT,hClipboardData); + #endif + } + CloseClipboard(); + } + free(buf); + break; + } + case IDC_DELETE: + { + int idx = 0; + int count = ListView_GetSelectedCount(dat->hList); + + if ( !count ) break; + + if ( count == ListView_GetItemCount(dat->hList) ) { + LVITEM lvi = {0}; + ListView_DeleteAllItems(dat->hList); + lvi.mask = LVIF_TEXT | LVIF_IMAGE; + lvi.iImage = IMG_INFO; + lvi.pszText = TranslateT("*** Console cleared ***"); + ListView_InsertItem(dat->hList,&lvi); + dat->newline = 0; + break; + } + + while ((idx = ListView_GetNextItem(dat->hList,idx,LVNI_BELOW|LVNI_SELECTED)) > 0) + { + ListView_DeleteItem(dat->hList,idx); + idx--; + } + break; + } + case IDC_SAVE: + { + FILE *fp; + TCHAR szFile[MAX_PATH]; + + if (!Openfile(szFile,ListView_GetSelectedCount(dat->hList))) break; + + fp = _tfopen(szFile, _T("wt")); + if (fp) { + int idx = 0; + TCHAR szText[128]; + int flags = LVNI_BELOW; + if (ListView_GetSelectedCount(dat->hList)) + flags |= LVNI_SELECTED; + + while ((idx = ListView_GetNextItem(dat->hList,idx,flags)) > 0) + { + ListView_GetItemText(dat->hList, idx, 0, szText, sizeof(szText)-1); + _ftprintf(fp, _T("%s\n"), szText); + } + fclose(fp); + } + break; + } + case IDC_OPTIONS: + CallServiceSync(MS_NETLIB_LOGWIN,0,0); + break; + case IDC_STARTALL: + SendMessage(hwndConsole, HM_PAUSEALL, 0, 0); + break; + case IDC_PAUSEALL: + SendMessage(hwndConsole, HM_PAUSEALL, 0, 1); + break; + case IDC_CLOSE: + if (tabCount > 1) + SendMessage(hwndDlg, WM_CLOSE, 0, 0); + break; + default: + break; + } + break; + } + case WM_CLOSE: + DestroyWindow(hwndDlg); + break; + case WM_DESTROY: + SetWindowLong(dat->hList, GWLP_WNDPROC, GetWindowLong(dat->hList,GWLP_USERDATA)); + SendMessage(hwndConsole, HM_REMOVE, 0, (LPARAM)dat); + break; + } + + return FALSE; +} + + +//////////////////////////////////////////////////////////////////////////////// + +int ConsoleResize(HWND hwnd,LPARAM lParam,UTILRESIZECONTROL *urc) +{ + switch(urc->wId) { + case IDC_TABS: + return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT; + default: + return RD_ANCHORX_LEFT|RD_ANCHORY_TOP; + } +} + + +static BOOL CALLBACK ConsoleDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam) +{ + switch(message) { + case WM_INITDIALOG: + { + char Title[512]; + char ProfileName[513]; + char ProfilePath[513]; + ProfileName[512] = 0; + ProfilePath[512] = 0; + + hTabs = GetDlgItem(hwndDlg, IDC_TABS); + //TabCtrl_SetMinTabWidth(hTabs, 100); + + // restore position + { + SAVEWINDOWPOS swp; + swp.hwnd=hwndDlg; swp.hContact=NULL; swp.szModule="Console"; swp.szNamePrefix="Console"; + CallService(MS_UTILS_RESTOREWINDOWPOSITION,RWPF_NOACTIVATE,(LPARAM)&swp); + ShowWindow(hwndDlg,SW_HIDE); + } + + if (CallService(MS_DB_GETPROFILENAME,(WPARAM)512,(LPARAM)ProfileName)) + ProfileName[0] = 0; + + if (CallService(MS_DB_GETPROFILEPATH,(WPARAM)512,(LPARAM)ProfilePath)) + ProfilePath[0] = 0; + + mir_snprintf(Title, sizeof(Title), "%s - %s\\%s", Translate("Miranda Console"), ProfilePath, ProfileName); + + SetWindowTextA(hwndDlg, Title); + SendMessage(hwndDlg,WM_SETICON,ICON_BIG,(LPARAM)hIcons[0]); + + hwndConsole = hwndDlg; + SendMessage(hwndDlg, HM_ADD, 0, 0); + PostMessage(hwndDlg, WM_SIZE, 0, 0); + break; + } + case HM_DUMP: + { + // lParam = DUMPMSG + int idx; + LOGWIN *lw; + LOGWIN lw2; + DUMPMSG *dumpMsg = (DUMPMSG*)lParam; + + if (!pActive) break; + + if (!gSingleMode) + { + lw2.Module = dumpMsg->szModule; + if (!li.List_GetIndex(&lModules, &lw2, &idx)) + SendMessage(hwndDlg, HM_ADD, (WPARAM)idx, (LPARAM)dumpMsg->szModule); + + lw = (LOGWIN*)lModules.items[idx]; + } + else + lw = pActive; + + if (lw->hwnd) + SendMessage(lw->hwnd, HM_DUMP, wParam, lParam); + else + PostMessage(hwndDlg, HM_DUMP, wParam, lParam); // loop msg until window will be ready + + return TRUE; + } + case HM_ADD: + { + // wParam = index, lParam = module name + LOGWIN *lw; + COLORREF col; + TCITEM tci = {0}; + int idx = (int)wParam; + char *str = (char*)lParam; + + if (!str) str = ""; // startup window + + lw = (LOGWIN*)mir_calloc( sizeof(LOGWIN) ); + lw->Module = (char*)mir_strdup(str); + li.List_Insert(&lModules, lw, idx); + + if (!gSingleMode && lParam) + { + tci.mask = TCIF_PARAM | TCIF_TEXT; + tci.lParam = (LPARAM)lw; +#ifdef _UNICODE + tci.pszText = mir_a2u(lw->Module); + idx = TabCtrl_InsertItem(hTabs, tabCount, &tci); + mir_free(tci.pszText); +#else + tci.pszText = lw->Module; + idx = TabCtrl_InsertItem(hTabs, tabCount, &tci); +#endif + tabCount++; + } + + GetClientRect(hTabs, &rcTabs); + TabCtrl_AdjustRect(hTabs, FALSE, &rcTabs); + + CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_LOG), hwndDlg, LogDlgProc, (LPARAM)lw); + ShowWindow(lw->hwnd, (tabCount > 1)?SW_HIDE:SW_SHOWNOACTIVATE); + + if (pActive) + { + col = ListView_GetBkColor(pActive->hList); + ListView_SetBkColor(lw->hList, col); + ListView_SetTextBkColor(lw->hList, col); + + col = ListView_GetTextColor(pActive->hList); + ListView_SetTextColor(lw->hList, col); + + if (hfLogFont) + SendMessage(lw->hList, WM_SETFONT, (WPARAM)hfLogFont, (LPARAM)TRUE); + } + + // hide startup window + if (tabCount == 1) + { + ShowWindow(pActive->hwnd, SW_HIDE); + PostMessage(pActive->hwnd, WM_CLOSE, 0, 0); + pActive = lw; + } + + if (!pActive) + pActive = lw; + + return TRUE; + } + case HM_REMOVE: + { + // lParam = LOGWIN + LOGWIN *lw = (LOGWIN*)lParam; + + if (!lw) break; + + if (lw == pActive) + { + int tab = TabCtrl_GetCurSel(hTabs); + if (tab >= 0) + { + TCITEM tci={0}; + + TabCtrl_DeleteItem(hTabs, tab); + tabCount--; + if (tabCount) + { + tab--; + if (tab < 0 ) tab = 0; + TabCtrl_SetCurSel(hTabs, tab); + + tci.mask = TCIF_PARAM; + TabCtrl_GetItem(hTabs, tab, &tci); + pActive = (LOGWIN*)tci.lParam; + SendMessage(pActive->hwnd, WM_SIZE, 0, 0); + ScrollDown(pActive); + ShowWindow(pActive->hwnd, SW_SHOWNOACTIVATE); + SetFocus(pActive->hList); + } + else + pActive = NULL; + } + } + + li.List_RemovePtr(&lModules, lw); + mir_free(lw->Module); + mir_free(lw); + return TRUE; + } + case HM_SETFONT: + { + // wParam = font, lParam = font color + int i; + LOGWIN *lw; + for ( i = 0; i < lModules.realCount; i++ ) + { + lw = (LOGWIN*)lModules.items[i]; + ListView_SetTextColor(lw->hList, (COLORREF)lParam); + if (wParam) + SendMessage(lw->hList, WM_SETFONT, wParam, (LPARAM)TRUE); + } + return TRUE; + } + case HM_SETCOLOR: + { + // wParam = font, lParam = background color + int i; + LOGWIN *lw; + for ( i = 0; i < lModules.realCount; i++ ) + { + lw = (LOGWIN*)lModules.items[i]; + ListView_SetBkColor(lw->hList, (COLORREF)lParam); + ListView_SetTextBkColor(lw->hList, (COLORREF)lParam); + if (wParam) + SendMessage(lw->hList, WM_SETFONT, wParam, (LPARAM)TRUE); + } + return TRUE; + } + case HM_PAUSEALL: + { + // lParam = 1 to pause, 0 to start + int i; + LOGWIN *lw; + for ( i = 0; i < lModules.realCount; i++ ) + { + lw = (LOGWIN*)lModules.items[i]; + if (lw->Paused != (int)lParam) + SendMessage(lw->hwnd, WM_COMMAND, IDC_PAUSE, 0); + } + return TRUE; + } + case HM_RESTART: + { + if (pActive) + { + pActive = NULL; + PostMessage(hwndDlg, HM_RESTART, 0, 0); + return TRUE; + } + // close all tabs + if (!lParam) + { + LOGWIN *lw; + TabCtrl_DeleteAllItems(hTabs); + while ( lModules.realCount ) + { + lw = (LOGWIN*)lModules.items[0]; + SendMessage(lw->hwnd, WM_CLOSE, 0, 0); + } + tabCount = 0; + PostMessage(hwndDlg, HM_RESTART, 0, 1); + return TRUE; + } + + LoadSettings(); + SendMessage(hwndDlg, HM_ADD, 0, 0); + PostMessage(hwndDlg, WM_SIZE, 0, 0); + return TRUE; + } + case WM_SETFOCUS: + if ( pActive ) { + SetFocus(pActive->hList); + } + return TRUE; + case WM_NOTIFY: + switch(wParam) { + case IDC_TABS: + { + LPNMHDR lpnmhdr = (LPNMHDR)lParam; + if (lpnmhdr->code == TCN_SELCHANGE) + { + int newTab = TabCtrl_GetCurSel(hTabs); + if (newTab >= 0 ) + { + TCITEM tci={0}; + HWND hOld = pActive->hwnd; + + tci.mask = TCIF_PARAM; + + if (!TabCtrl_GetItem(hTabs, newTab, &tci)) break; + + pActive = (LOGWIN*)tci.lParam; + + SendMessage(pActive->hwnd, WM_SIZE, 0, 0); + ScrollDown(pActive); + ShowWindow(hOld, SW_HIDE); + ShowWindow(pActive->hwnd, SW_SHOWNOACTIVATE); + SetFocus(pActive->hList); + } else + SendMessage(pActive->hwnd, WM_SIZE, 0, 0); + } + break; + } + } + break; + case WM_SIZE: + { + UTILRESIZEDIALOG urd={0}; + urd.cbSize=sizeof(urd); + urd.hInstance=hInst; + urd.hwndDlg=hwndDlg; + urd.lpTemplate=MAKEINTRESOURCEA(IDD_CONSOLE); + urd.pfnResizer=ConsoleResize; + CallService(MS_UTILS_RESIZEDIALOG,0,(LPARAM)&urd); + + GetClientRect(hTabs, &rcTabs); + TabCtrl_AdjustRect(hTabs, FALSE, &rcTabs); + + if ( pActive ) + SendMessage(pActive->hwnd, WM_SIZE, 0, 0); + break; + } + case WM_GETMINMAXINFO: + { + MINMAXINFO *mmi=(MINMAXINFO*)lParam; + mmi->ptMinTrackSize.x=400; + mmi->ptMinTrackSize.y=200; + break; + } + case WM_CLOSE: + if ( lParam != 1 ) { + Utils_SaveWindowPosition(hwndDlg,NULL,"Console","Console"); + ShowConsole(0); + return TRUE; + } else + DestroyWindow(hwndDlg); + break; + case WM_DESTROY: + pActive = NULL; + if (hfLogFont) DeleteObject(hfLogFont); + PostQuitMessage(0); + break; + } + + return FALSE; +} + + +//////////////////////////////////////////////////////////////////////////////// + + +void __cdecl ConsoleThread(void* arg) +{ + MSG msg; + HWND hwnd; + + hwnd = CreateDialog(hInst,MAKEINTRESOURCE(IDD_CONSOLE),NULL,ConsoleDlgProc); + + if (!hwnd) return; + + while( GetMessage(&msg, NULL, 0, 0) > 0 ) + { + switch(msg.message) { + case HM_DUMP: + OutMsgs++; + break; + } + + if ( IsDialogMessage(hwnd, &msg) ) + continue; + + TranslateMessage(&msg); + DispatchMessage(&msg); + } + + hwndConsole = NULL; +} + +/////////////////////////////////////////////////////////////////////////////// + +static int OnFastDump(WPARAM wParam,LPARAM lParam) +{ + if ( pActive ) + { + LOGMSG *logMsg = (LOGMSG*)lParam; + DWORD headlen = strlen(logMsg->pszHead); + DWORD msglen = strlen(logMsg->pszMsg); + DWORD len = (headlen + msglen + 1) * sizeof(TCHAR) + sizeof(DUMPMSG); + DUMPMSG *dumpMsg = (DUMPMSG*)malloc( len ); + TCHAR *str = dumpMsg->szMsg; + + strncpy(dumpMsg->szModule, ((NETLIBUSER*)wParam)->szDescriptiveName, sizeof(dumpMsg->szModule))[ sizeof(dumpMsg->szModule)-1 ] = 0; + +#ifdef _UNICODE + { + wchar_t *ucs2; + + ucs2 = mir_a2u( logMsg->pszHead ); + wcscpy(str, ucs2); + mir_free(ucs2); + + // try to detect utf8 + ucs2 = mir_utf8decodeW( logMsg->pszMsg ); + if ( !ucs2 ) + ucs2 = mir_a2u( logMsg->pszMsg ); + + wcscat( str, ucs2 ); + mir_free( ucs2 ); + } +#else + memcpy( str, logMsg->pszHead, headlen ); + memcpy( str + headlen, logMsg->pszMsg, msglen + 1 ); + + // try to detect utf8 + mir_utf8decode( str + headlen, NULL ); +#endif + InMsgs++; + PostMessage(hwndConsole, HM_DUMP, 0, (LPARAM)dumpMsg); + } + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// + +static void LoadSettings() +{ + gIcons = DBGetContactSettingByte(NULL, "Console", "ShowIcons", 1); + gSeparator = DBGetContactSettingByte(NULL, "Console", "Separator", 1); + gSingleMode = DBGetContactSettingByte(NULL, "Console", "SingleMode", 0); + + gWrapLen = DBGetContactSettingByte(NULL, "Console", "Wrap", DEFAULT_WRAPLEN); + if ( gWrapLen < MIN_WRAPLEN ) gWrapLen = DEFAULT_WRAPLEN; + + gLimit = DBGetContactSettingDword(NULL, "Console", "Limit", MAX_LIMIT); + if (gLimit > MAX_LIMIT) gLimit = MAX_LIMIT; + if (gLimit < MIN_LIMIT) gLimit = MIN_LIMIT; +} + + +static void SaveSettings(HWND hwndDlg) +{ + int len = GetDlgItemInt(hwndDlg, IDC_WRAP, NULL, FALSE); + if (len < MIN_WRAPLEN ) + len = MIN_WRAPLEN; + else + if (len > MAX_WRAPLEN) + len = MAX_WRAPLEN; + + gWrapLen = len; + SetDlgItemInt(hwndDlg, IDC_WRAP, gWrapLen, FALSE); + DBWriteContactSettingByte(NULL, "Console", "Wrap", (BYTE)len); + + len = GetDlgItemInt(hwndDlg, IDC_LIMIT, NULL, FALSE); + if (len < MIN_LIMIT ) + len = MIN_LIMIT; + else + if (len > MAX_LIMIT) + len = MAX_LIMIT; + + gLimit = len; + SetDlgItemInt(hwndDlg, IDC_LIMIT, gLimit, FALSE); + DBWriteContactSettingDword(NULL, "Console", "Limit", len); + + DBWriteContactSettingByte(NULL, "Console", "SingleMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SINGLE)); + DBWriteContactSettingByte(NULL, "Console", "Separator", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SEPARATOR)); + DBWriteContactSettingByte(NULL, "Console", "ShowIcons", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWICONS)); + + DBWriteContactSettingByte(NULL, "Console", "ShowAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_START)); +} + + +static BOOL CALLBACK OptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch(msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + CheckDlgButton(hwndDlg, IDC_START, DBGetContactSettingByte(NULL, "Console", "ShowAtStart", 0)); + CheckDlgButton(hwndDlg, IDC_SINGLE, gSingleMode); + CheckDlgButton(hwndDlg, IDC_SHOWICONS, gIcons); + CheckDlgButton(hwndDlg, IDC_SEPARATOR, gSeparator); + SetDlgItemInt(hwndDlg, IDC_WRAP, gWrapLen, FALSE); + SetDlgItemInt(hwndDlg, IDC_LIMIT, gLimit, FALSE); + break; + case WM_COMMAND: + switch (LOWORD(wParam)) { + case IDC_RESTART: + { + if (!pActive) break; + SaveSettings(hwndDlg); + PostMessage(hwndConsole, HM_RESTART, 0, 0); + break; + } + case IDC_LIMIT: + case IDC_WRAP: + if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()) + return FALSE; + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + case IDC_START: + case IDC_SEPARATOR: + case IDC_SHOWICONS: + case IDC_SINGLE: + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + } + break; + case WM_NOTIFY: + switch(((LPNMHDR)lParam)->idFrom) + { + case 0: + switch (((LPNMHDR)lParam)->code) + { + case PSN_APPLY: + { + SaveSettings(hwndDlg); + break; + } + } + break; + } + break; + } + return FALSE; +} + + +static int OptInit(WPARAM wParam,LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp={0}; + odp.cbSize = sizeof(odp); + odp.position = 0; + odp.hInstance = hInst; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); + odp.ptszGroup = TranslateT("Network"); + odp.ptszTitle = TranslateT("Console"); + odp.pfnDlgProc = OptDlgProc; + odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + odp.expertOnlyControls = NULL; + CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// + +static int OnColourChange(WPARAM wParam,LPARAM lParam) +{ + if (hwndConsole) + { + ColourID cid = {0}; + COLORREF col; + + cid.cbSize=sizeof(cid); + strcpy(cid.group,"Console"); + strcpy(cid.name,"Background"); + strcpy(cid.dbSettingsGroup,"Console"); + strcpy(cid.setting,"BgColor"); + + col = (COLORREF)CallService(MS_COLOUR_GET,(WPARAM)&cid,0); + if (col != -1) + SendMessage(hwndConsole, HM_SETCOLOR, (WPARAM)hfLogFont, (LPARAM)col); + } + return 0; +} + + +static int OnFontChange(WPARAM wParam,LPARAM lParam) +{ + if (hwndConsole) + { + COLORREF col; + HFONT hf = NULL; + LOGFONT LogFont={0}; + FontIDT fid={0}; + fid.cbSize=sizeof(fid); + + _tcscpy(fid.group,_T("Console")); + _tcscpy(fid.name,TranslateT("Text")); + + col = (COLORREF)CallService(MS_FONT_GETT,(WPARAM)&fid,(LPARAM)&LogFont); + + if (LogFont.lfHeight != 0) + { + hf=CreateFontIndirect(&LogFont); + + SendMessage(hwndConsole, HM_SETFONT, (WPARAM)hf, (LPARAM)col); + + if (hfLogFont) + DeleteObject(hfLogFont); + hfLogFont = hf; + } + } + return 0; +} + +static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) +{ + int i = 1; + if ( !hHooks[0] ) + hHooks[0] = HookEvent( ME_NETLIB_FASTDUMP, OnFastDump ); + + CreateServiceFunction(MS_CONSOLE_SHOW_HIDE, ShowHideConsole); + + + if (ServiceExists(MS_FONT_REGISTERT)) + { + FontIDT fid={0}; + + fid.cbSize=sizeof(fid); + _tcscpy(fid.group,_T("Console")); + _tcscpy(fid.name,TranslateT("Text")); + strcpy(fid.dbSettingsGroup,"Console"); + strcpy(fid.prefix,"ConsoleFont"); + + _tcscpy(fid.backgroundGroup,_T("Console")); + _tcscpy(fid.backgroundName,_T("Background")); + + fid.flags = FIDF_DEFAULTVALID; + + fid.deffontsettings.charset = DEFAULT_CHARSET; + fid.deffontsettings.colour = RGB(0, 0, 0); + fid.deffontsettings.size = 10; + fid.deffontsettings.style = 0; + _tcsncpy(fid.deffontsettings.szFace, _T("Courier"), LF_FACESIZE); + + CallService(MS_FONT_REGISTERT,(WPARAM)&fid,0); + + hHooks[i++] = HookEvent(ME_FONT_RELOAD,OnFontChange); + } + + if (ServiceExists(MS_COLOUR_REGISTERT)) + { + ColourIDT cid = {0}; + + cid.cbSize=sizeof(cid); + _tcscpy(cid.group,_T("Console")); + _tcscpy(cid.name,_T("Background")); + strcpy(cid.dbSettingsGroup,"Console"); + strcpy(cid.setting,"BgColor"); + + cid.defcolour = RGB(255,255,255); + + CallService(MS_COLOUR_REGISTERT,(WPARAM)&cid,0); + + hHooks[i++] = HookEvent(ME_COLOUR_RELOAD, OnColourChange); + } + + if (ServiceExists(MS_HOTKEY_REGISTER)) + { + HOTKEYDESC hkd = {0}; + + hkd.cbSize=sizeof(hkd); + + hkd.pszName = "Console_Show_Hide"; + hkd.pszDescription = Translate("Show/Hide Console"); + hkd.pszSection = "Main"; + hkd.pszService = MS_CONSOLE_SHOW_HIDE; + hkd.DefHotKey = HOTKEYCODE(HOTKEYF_EXT, 'C'); + + CallService(MS_HOTKEY_REGISTER,(WPARAM)0,(LPARAM)&hkd); + } + + if (ServiceExists(MS_TB_ADDBUTTON)) + { + SKINICONDESC sid={0}; + TBButton tbb = {0}; + char szModuleFileName[MAX_PATH]={0}; + + GetModuleFileNameA(hInst,szModuleFileName,MAX_PATH); + + sid.cbSize = sizeof(sid); + sid.pszSection = Translate("Console"); + sid.pszDefaultFile = szModuleFileName; + + sid.pszDescription = Translate("Show"); + sid.pszName = "Console_Up"; + sid.iDefaultIndex = -IDI_BTN_UP; + CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + + sid.pszDescription = Translate("Hide"); + sid.pszName = "Console_Down"; + sid.iDefaultIndex = -IDI_BTN_DN; + CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + + tbb.cbSize = sizeof(TBButton); + tbb.pszButtonID = "console_btn"; + tbb.pszButtonName = Translate("Show/Hide Console"); + tbb.pszServiceName = MS_CONSOLE_SHOW_HIDE; + tbb.hPrimaryIconHandle = (HANDLE)CallService(MS_SKIN2_GETICONHANDLE,0, (LPARAM)"Console_Up"); + tbb.hSecondaryIconHandle = (HANDLE)CallService(MS_SKIN2_GETICONHANDLE,0, (LPARAM)"Console_Down"); + tbb.pszTooltipUp = Translate("Show Console"); + tbb.pszTooltipDn = Translate("Hide Console"); + tbb.tbbFlags = TBBF_VISIBLE|TBBF_SHOWTOOLTIP; + tbb.defPos = 20000; + hTButton = (HANDLE)CallService(MS_TB_ADDBUTTON,0, (LPARAM)&tbb); + } + + if (hwndConsole && IsWindow(hwndConsole)) + { + CLISTMENUITEM mi={0}; +#ifdef TTB + hHooks[i++] = HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded); +#endif + mi.cbSize=sizeof(mi); + mi.flags=CMIF_TCHAR; + mi.hIcon=hIcons[0]; + mi.ptszPopupName=TranslateT("&Help"); + mi.popupPosition=2000090000; + mi.position=1000000000; + mi.ptszName=(IsWindowVisible(hwndConsole))?TranslateT("Hide Console"):TranslateT("Show Console"); + mi.pszService=MS_CONSOLE_SHOW_HIDE; + hMenu = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); + + OnFontChange(0,0); + OnColourChange(0,0); + + if (DBGetContactSettingByte(NULL,"Console","ShowAtStart",0) || DBGetContactSettingByte(NULL,"Console","Show",1)) + ShowConsole(1); + else + ShowConsole(0); + } + + return 0; +} + +static int PreshutdownConsole(WPARAM wParam,LPARAM lParam) +{ + int i; + + if (hwndConsole) { + PostMessage(hwndConsole, WM_CLOSE, 0, 1 ); + } + + for (i=0;iModule, lw2->Module ); +} + +/////////////////////////////////////////////////////////////////////////////// + +static UINT logicons[] = {IDI_EMPTY, IDI_ARROW, IDI_IN, IDI_OUT, IDI_INFO}; + + +void InitConsole() +{ + int i; + HICON hi; + + mir_getMMI(&mmi); + mir_getUTFI(&utfi); + mir_getLI(&li); + + lModules.sortFunc = stringCompare; + lModules.increment = 5; + + hIcons[0] = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONSOLE)); + hIcons[1] = (HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_NOSCROLL),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0); + hIcons[2] = (HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_PAUSED),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0); + + for(i = 0; i < SIZEOF(ctrls); i++) { + hIcons[i+ICON_FIRST] = (HICON)LoadImage(hInst,MAKEINTRESOURCE(ctrls[i].icon),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0); + } + + gImg = ImageList_Create(LOGICONX_SIZE, LOGICONY_SIZE, ILC_COLOR24 | ILC_MASK, SIZEOF(logicons), 0); + + for(i = 0; i < SIZEOF(logicons); i++) + { + hi = (HICON)LoadImage(hInst,MAKEINTRESOURCE(logicons[i]),IMAGE_ICON,LOGICONX_SIZE,LOGICONY_SIZE,0); + if (hi) + { + ImageList_AddIcon(gImg, hi); + DestroyIcon(hi); + } + } + + LoadSettings(); + + mir_forkthread(ConsoleThread, 0); + + HookEvent(ME_SYSTEM_PRESHUTDOWN, PreshutdownConsole); + HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded); + HookEvent(ME_OPT_INITIALISE, OptInit); + + hHooks[0] = HookEvent( ME_NETLIB_FASTDUMP, OnFastDump ); +} + +void ShutdownConsole(void) +{ + int i; + + li.List_Destroy(&lModules); + + if (gImg) ImageList_Destroy(gImg); + + for(i = 0; i < SIZEOF(hIcons); i++) { + if (hIcons[i]) DestroyIcon(hIcons[i]); + } + +#ifdef TBB + if (BmpUp) DeleteObject(BmpUp); + if (BmpDn) DeleteObject(BmpDn); +#endif +} + +//////////////////////////////////////////////////////////////////////////////// + +TCHAR *addstring(TCHAR *str, TCHAR *add) { + _tcscpy(str,add); + return str + _tcslen(add) + 1; +} + + +static int Openfile(TCHAR *outputFile, int selection) +{ + OPENFILENAME ofn = {0}; + TCHAR filename[MAX_PATH+2] = _T(""); + TCHAR *title; + + TCHAR *filter, *tmp, *tmp1, *tmp2; + tmp1 = TranslateT("Text Files (*.txt)"); + tmp2 = TranslateT("All Files"); + filter = tmp = (TCHAR*)_alloca((_tcslen(tmp1)+_tcslen(tmp2)+11)*sizeof(TCHAR)); + tmp = addstring(tmp, tmp1); + tmp = addstring(tmp, _T("*.TXT")); + tmp = addstring(tmp, tmp2); + tmp = addstring(tmp, _T("*")); + *tmp = 0; + + if (selection) + title = TranslateT("Save selection to file"); + else + title = TranslateT("Save log to file"); + + ofn.lStructSize = sizeof(ofn); + ofn.lpstrFile = filename; + ofn.lpstrFilter = filter; + ofn.Flags = OFN_HIDEREADONLY | OFN_SHAREAWARE | OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT; + ofn.lpstrTitle = title; + ofn.nMaxFile = MAX_PATH; + ofn.lpstrDefExt = _T("txt"); + + if (!GetSaveFileName(&ofn)) + return 0; + _tcscpy(outputFile, filename); + return 1; +} + +//////////////////////////////////////////////////////////////////////////////// diff --git a/Console/Console.dsp b/Console/Console.dsp new file mode 100644 index 0000000..292f47e --- /dev/null +++ b/Console/Console.dsp @@ -0,0 +1,363 @@ +# Microsoft Developer Studio Project File - Name="Console" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=Console - Win32 Debug +!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 "Console.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 "Console.mak" CFG="Console - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "Console - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Console - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Console - Win32 Debug Unicode" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "Console - Win32 Release Unicode" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "Perforce Project" +# PROP Scc_LocalPath "." +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "Console - 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 Target_Dir "" +# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /D "_MBCS" /FR /Yu"Commonheaders.h" /GZ /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /D "_MBCS" /FR /Yu"Commonheaders.h" /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /i "..\..\include" /d "_DEBUG" +# ADD RSC /l 0x409 /i "..\..\include" /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 /subsystem:windows /dll /incremental:no /map /debug /machine:IX86 /out:"..\..\Bin\Debug\plugins\Console.dll" /pdbtype:sept +# SUBTRACT BASE LINK32 /pdb:none +# 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 /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:IX86 /out:"..\..\Bin\Debug\plugins\Console.dll" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "Console - 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 /MD /W3 /GX /Ox /Ob2 /Gy /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /D "_MBCS" /FR /Yu"Commonheaders.h" /GF /c +# ADD CPP /nologo /MD /W3 /Zi /Ox /Ot /Os /Ob2 /Gf /Gy /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /D "_MBCS" /FR /Yu"Commonheaders.h" /GF /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /i "..\..\include" /d "NDEBUG" +# ADD RSC /l 0x409 /i "..\..\include" /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 /subsystem:windows /dll /map /machine:IX86 /out:"..\..\bin\release\plugins\Console.dll" /pdbtype:sept /ALIGN:4096 +# SUBTRACT BASE LINK32 /pdb:none +# 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 /nologo /subsystem:windows /dll /map /machine:IX86 /out:"..\..\bin\release\plugins\Console.dll" /pdbtype:sept /ALIGN:4096 +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "Console - Win32 Debug Unicode" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "$(ConfigurationName)" +# PROP BASE Intermediate_Dir "$(ConfigurationName)" +# 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 /GX /Zi /Od /I "../../include" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR /Fp".\Debug/Console.pch" /Yu"Commonheaders.h" /Fo".\Debug/" /Fd".\Debug/" /GZ /c +# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR /Fp".\Debug/Console.pch" /Yu"Commonheaders.h" /Fo".\Debug/" /Fd".\Debug/" /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /i "..\..\include" /d "_DEBUG" +# ADD RSC /l 0x409 /i "..\..\include" /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 /subsystem:windows /dll /incremental:no /pdb:".\Debug\Console.pdb" /map:".\Debug\Console.map" /debug /machine:IX86 /out:"..\..\Bin\Debug Unicode\plugins\Console.dll" /implib:".\Debug/Console.lib" /pdbtype:sept +# SUBTRACT BASE LINK32 /pdb:none +# 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 /nologo /subsystem:windows /dll /incremental:no /pdb:".\Debug\Console.pdb" /map:".\Debug\Console.map" /debug /machine:IX86 /out:"..\..\Bin\Debug Unicode\plugins\Console.dll" /implib:".\Debug/Console.lib" /pdbtype:sept +# SUBTRACT LINK32 /pdb:none + +!ELSEIF "$(CFG)" == "Console - Win32 Release Unicode" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "$(ConfigurationName)" +# PROP BASE Intermediate_Dir "$(ConfigurationName)" +# 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 /MT /W3 /GX /Ox /Ob2 /Gy /I "../../include" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR /Fo".\Release/" /GF /c +# ADD CPP /nologo /MD /W3 /Zi /Ox /Og /Gf /Gy /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /Fr /Fo".\Release/" /Fd".\Release/" /c +# SUBTRACT CPP /YX /Yc /Yu +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x409 /i "..\..\include" /d "NDEBUG" +# ADD RSC /l 0x409 /i "..\..\include" /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 /subsystem:windows /dll /pdb:".\Release\Console.pdb" /map /machine:IX86 /out:"..\..\bin\release unicode\plugins\Console.dll" /implib:".\Release/Console.lib" /pdbtype:sept /ALIGN:4096 +# SUBTRACT BASE LINK32 /pdb:none +# 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 /nologo /subsystem:windows /dll /map /debug /machine:IX86 /out:"Release_Unicode\Plugins\Console.dll" /implib:".\Release/Console.lib" +# SUBTRACT LINK32 /pdb:none + +!ENDIF + +# Begin Target + +# Name "Console - Win32 Debug" +# Name "Console - Win32 Release" +# Name "Console - Win32 Debug Unicode" +# Name "Console - Win32 Release Unicode" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=Commonheaders.c +DEP_CPP_COMMO=\ + ".\Commonheaders.h"\ + ".\m_toolbar.h"\ + ".\m_toptoolbar.h"\ + ".\version.h"\ + {$(INCLUDE)}"m_button.h"\ + {$(INCLUDE)}"m_clist.h"\ + {$(INCLUDE)}"m_clui.h"\ + {$(INCLUDE)}"m_database.h"\ + {$(INCLUDE)}"m_fontservice.h"\ + {$(INCLUDE)}"m_hotkeys.h"\ + {$(INCLUDE)}"m_icolib.h"\ + {$(INCLUDE)}"m_langpack.h"\ + {$(INCLUDE)}"m_netlib.h"\ + {$(INCLUDE)}"m_options.h"\ + {$(INCLUDE)}"m_plugins.h"\ + {$(INCLUDE)}"m_system.h"\ + {$(INCLUDE)}"m_utils.h"\ + {$(INCLUDE)}"newpluginapi.h"\ + {$(INCLUDE)}"statusmodes.h"\ + {$(INCLUDE)}"win2k.h"\ + + +!IF "$(CFG)" == "Console - Win32 Debug" + +# ADD CPP /nologo /GX /Od /FR /Yc"Commonheaders.h" /GZ + +!ELSEIF "$(CFG)" == "Console - Win32 Release" + +# ADD CPP /nologo /GX /O2 /FR /Yc"Commonheaders.h" + +!ELSEIF "$(CFG)" == "Console - Win32 Debug Unicode" + +# ADD CPP /nologo /GX /Od /FR /Yc"Commonheaders.h" /GZ + +!ELSEIF "$(CFG)" == "Console - Win32 Release Unicode" + +# ADD CPP /nologo /GX /O2 /FR + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=Console.c +DEP_CPP_CONSO=\ + ".\Commonheaders.h"\ + ".\m_toolbar.h"\ + ".\m_toptoolbar.h"\ + ".\version.h"\ + {$(INCLUDE)}"m_button.h"\ + {$(INCLUDE)}"m_clist.h"\ + {$(INCLUDE)}"m_clui.h"\ + {$(INCLUDE)}"m_database.h"\ + {$(INCLUDE)}"m_fontservice.h"\ + {$(INCLUDE)}"m_hotkeys.h"\ + {$(INCLUDE)}"m_icolib.h"\ + {$(INCLUDE)}"m_langpack.h"\ + {$(INCLUDE)}"m_netlib.h"\ + {$(INCLUDE)}"m_options.h"\ + {$(INCLUDE)}"m_plugins.h"\ + {$(INCLUDE)}"m_system.h"\ + {$(INCLUDE)}"m_utils.h"\ + {$(INCLUDE)}"newpluginapi.h"\ + {$(INCLUDE)}"statusmodes.h"\ + {$(INCLUDE)}"win2k.h"\ + + +!IF "$(CFG)" == "Console - Win32 Debug" + +# ADD CPP /nologo /GX /Od /FR /GZ + +!ELSEIF "$(CFG)" == "Console - Win32 Release" + +# ADD CPP /nologo /GX /O2 /FR + +!ELSEIF "$(CFG)" == "Console - Win32 Debug Unicode" + +# ADD CPP /nologo /GX /Od /FR /GZ + +!ELSEIF "$(CFG)" == "Console - Win32 Release Unicode" + +# ADD CPP /nologo /GX /O2 /FR + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\init.c +DEP_CPP_INIT_=\ + ".\Commonheaders.h"\ + ".\m_toolbar.h"\ + ".\m_toptoolbar.h"\ + ".\version.h"\ + {$(INCLUDE)}"m_button.h"\ + {$(INCLUDE)}"m_clist.h"\ + {$(INCLUDE)}"m_clui.h"\ + {$(INCLUDE)}"m_database.h"\ + {$(INCLUDE)}"m_fontservice.h"\ + {$(INCLUDE)}"m_hotkeys.h"\ + {$(INCLUDE)}"m_icolib.h"\ + {$(INCLUDE)}"m_langpack.h"\ + {$(INCLUDE)}"m_netlib.h"\ + {$(INCLUDE)}"m_options.h"\ + {$(INCLUDE)}"m_plugins.h"\ + {$(INCLUDE)}"m_system.h"\ + {$(INCLUDE)}"m_utils.h"\ + {$(INCLUDE)}"newpluginapi.h"\ + {$(INCLUDE)}"statusmodes.h"\ + {$(INCLUDE)}"win2k.h"\ + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=Commonheaders.h +# End Source File +# Begin Source File + +SOURCE=.\resource.h +# End Source File +# Begin Source File + +SOURCE=.\version.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=.\res\btn_dn.ico +# End Source File +# Begin Source File + +SOURCE=.\res\btn_up.ico +# End Source File +# Begin Source File + +SOURCE=.\res\close.ico +# End Source File +# Begin Source File + +SOURCE=Res\console.ico +# End Source File +# Begin Source File + +SOURCE=Res\console_dn.bmp +# End Source File +# Begin Source File + +SOURCE=Res\console_up.bmp +# End Source File +# Begin Source File + +SOURCE=.\Res\copy.ico +# End Source File +# Begin Source File + +SOURCE=.\Res\delete.ico +# End Source File +# Begin Source File + +SOURCE=.\res\noscroll.ico +# End Source File +# Begin Source File + +SOURCE=.\Res\options.ico +# End Source File +# Begin Source File + +SOURCE=.\res\pause.ico +# End Source File +# Begin Source File + +SOURCE=.\res\paused.ico +# End Source File +# Begin Source File + +SOURCE=resource.rc +# End Source File +# Begin Source File + +SOURCE=.\Res\Save.ico +# End Source File +# Begin Source File + +SOURCE=.\res\scroll.ico +# End Source File +# Begin Source File + +SOURCE=.\res\start.ico +# End Source File +# Begin Source File + +SOURCE=.\res\started.ico +# End Source File +# End Group +# End Target +# End Project diff --git a/Console/Console.dsw b/Console/Console.dsw new file mode 100644 index 0000000..3250410 --- /dev/null +++ b/Console/Console.dsw @@ -0,0 +1,33 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "Console"=Console.dsp - Package Owner=<4> + +Package=<5> +{{{ + begin source code control + Perforce Project + . + end source code control +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/Console/Console.opt b/Console/Console.opt new file mode 100644 index 0000000..8c2c900 Binary files /dev/null and b/Console/Console.opt differ diff --git a/Console/Console.plg b/Console/Console.plg new file mode 100644 index 0000000..60b675e --- /dev/null +++ b/Console/Console.plg @@ -0,0 +1,49 @@ + + +
+

Build Log

+

+--------------------Configuration: Console - Win32 Release Unicode-------------------- +

+

Command Lines

+Creating command line "rc.exe /l 0x409 /fo"Release_Unicode/resource.res" /i "..\..\include" /d "NDEBUG" "D:\Sources\svn.miranda.im\console\trunk\resource.rc"" +Creating temporary file "C:\Temp\RSPB728.tmp" with contents +[ +/nologo /MD /W3 /GX /Zi /O2 /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR"Release_Unicode/" /Fo".\Release/" /Fd".\Release/" /c +"D:\Sources\svn.miranda.im\console\trunk\Commonheaders.c" +"D:\Sources\svn.miranda.im\console\trunk\Console.c" +] +Creating command line "cl.exe @C:\Temp\RSPB728.tmp" +Creating temporary file "C:\Temp\RSPB729.tmp" with contents +[ +/nologo /MD /W3 /Zi /Ox /Og /Gf /Gy /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /Fr"Release_Unicode/" /Fo".\Release/" /Fd".\Release/" /c +"D:\Sources\svn.miranda.im\console\trunk\init.c" +] +Creating command line "cl.exe @C:\Temp\RSPB729.tmp" +Creating temporary file "C:\Temp\RSPB72A.tmp" with contents +[ +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 /subsystem:windows /dll /incremental:no /pdb:"Release_Unicode/Console.pdb" /map:"Release_Unicode/Console.map" /debug /machine:IX86 /out:"Release_Unicode\Plugins\Console.dll" /implib:".\Release/Console.lib" +.\Release\Commonheaders.obj +.\Release\Console.obj +.\Release\init.obj +.\Release_Unicode\resource.res +] +Creating command line "link.exe @C:\Temp\RSPB72A.tmp" +

Output Window

+Compiling resources... +Compiling... +Commonheaders.c +Console.c +Generating Code... +Compiling... +init.c +Linking... + Creating library .\Release/Console.lib and object .\Release/Console.exp + + + +

Results

+Console.dll - 0 error(s), 0 warning(s) +
+ + diff --git a/Console/Console.sln b/Console/Console.sln new file mode 100644 index 0000000..8387889 --- /dev/null +++ b/Console/Console.sln @@ -0,0 +1,40 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Console", "Console.vcxproj", "{A231E008-2D1A-4F24-95DD-59F56F85A499}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug Unicode|Win32 = Debug Unicode|Win32 + Debug Unicode|x64 = Debug Unicode|x64 + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release Unicode|Win32 = Release Unicode|Win32 + Release Unicode|x64 = Release Unicode|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug|Win32.ActiveCfg = Debug|Win32 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug|Win32.Build.0 = Debug|Win32 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug|x64.ActiveCfg = Debug|x64 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug|x64.Build.0 = Debug|x64 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release Unicode|x64.Build.0 = Release Unicode|x64 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release|Win32.ActiveCfg = Release|Win32 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release|Win32.Build.0 = Release|Win32 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release|x64.ActiveCfg = Release|x64 + {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(DPCodeReviewSolutionGUID) = preSolution + DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} + EndGlobalSection +EndGlobal diff --git a/Console/Console.vcproj b/Console/Console.vcproj new file mode 100644 index 0000000..e84cbfb --- /dev/null +++ b/Console/Console.vcproj @@ -0,0 +1,634 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Console/Console.vcxproj b/Console/Console.vcxproj new file mode 100644 index 0000000..83e9903 --- /dev/null +++ b/Console/Console.vcxproj @@ -0,0 +1,608 @@ + + + + + Debug Unicode + Win32 + + + Debug Unicode + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release Unicode + Win32 + + + Release Unicode + x64 + + + Release + Win32 + + + Release + x64 + + + + {A231E008-2D1A-4F24-95DD-59F56F85A499} + Console + + + + + + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + false + false + false + false + false + false + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + false + false + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/Console.tlb + + + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Use + Commonheaders.h + true + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + true + true + true + false + + + MachineX86 + + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\Debug/Console.tlb + + + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + Commonheaders.h + .\Debug/Console.pch + .\Debug/ + .\Debug/ + .\Debug/ + true + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + ../../Bin/Debug/plugins/Console.dll + true + true + .\Debug/Console.pdb + true + .\Debug/Console.map + false + + + .\Debug/Console.lib + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/Console.tlb + + + + + Full + AnySuitable + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + MultiThreaded + true + Use + Commonheaders.h + true + Level3 + true + Default + Size + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + true + true + false + + + MachineX86 + + + true + true + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Release/Console.tlb + + + + + Full + AnySuitable + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + MultiThreadedDLL + true + Use + Commonheaders.h + .\Release/Console.pch + .\Release/ + .\Release/ + .\Release/ + true + Level3 + true + Default + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + ../../bin/release/plugins/Console.dll + true + .\Release/Console.pdb + true + false + + + .\Release/Console.lib + + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/Console.tlb + + + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + _UNICODE;WIN32;_DEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + Use + Commonheaders.h + true + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + true + true + true + false + + + MachineX86 + + + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\Debug/Console.tlb + + + + + Disabled + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + _UNICODE;WIN32;_DEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebugDLL + Use + Commonheaders.h + .\Debug/Console.pch + .\Debug/ + .\Debug/ + .\Debug/ + true + Level3 + true + ProgramDatabase + Default + + + _DEBUG;%(PreprocessorDefinitions) + 0x0409 + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + ../../Bin/Debug Unicode/plugins/Console.dll + true + true + .\Debug/Console.pdb + true + .\Debug/Console.map + false + + + .\Debug/Console.lib + + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/Console.tlb + + + + + Full + AnySuitable + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + _UNICODE;WIN32;NDEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + MultiThreaded + true + Use + Commonheaders.h + true + Level3 + true + Default + Size + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + true + true + false + + + MachineX86 + + + true + true + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Release/Console.tlb + + + + + Full + AnySuitable + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + _UNICODE;WIN32;NDEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) + true + MultiThreaded + true + Use + Commonheaders.h + .\Release/Console.pch + .\Release/ + .\Release/ + .\Release/ + true + Level3 + true + Default + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0409 + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) + + + true + .\Release/Console.pdb + true + false + + + .\Release/Console.lib + + + + + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + EnableFastChecks + EnableFastChecks + Create + Create + true + true + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS + WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS + EnableFastChecks + EnableFastChecks + Create + Create + true + true + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + Create + Create + true + true + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS + WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS + Create + Create + true + true + + + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + EnableFastChecks + EnableFastChecks + true + true + Disabled + Disabled + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS + WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS + EnableFastChecks + EnableFastChecks + true + true + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + true + true + MaxSpeed + MaxSpeed + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS + WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS + true + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Console/Console.vcxproj.filters b/Console/Console.vcxproj.filters new file mode 100644 index 0000000..7a841a2 --- /dev/null +++ b/Console/Console.vcxproj.filters @@ -0,0 +1,103 @@ + + + + + {94e1a2e5-64bb-4574-a01b-61fbe40e73e2} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {a5d1caa4-5b85-489a-bedc-9709b86d7dc0} + h;hpp;hxx;hm;inl + + + {1e71008e-a4e4-44c1-a0a9-d5fd17cd53f2} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + Source Files + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + Resource Files + + + + + Resource Files + + + \ No newline at end of file diff --git a/Console/Console_history.txt b/Console/Console_history.txt new file mode 100644 index 0000000..0801dc0 --- /dev/null +++ b/Console/Console_history.txt @@ -0,0 +1,174 @@ +PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND... +ONLY MORAL SUPPORT IN SPECIAL CASES CAN BE PROVIDED 8-) +-------------------------------------------------------------------------------- + +v7.2 + +[+] console hot restart (to apply new options) +[+] always show at start option +[*] other small changes + + +v7.1 + +[+] switch tabs with CTRL+Left/Right +[+] log size limitation +[+] icons in log +[+] event separation with empty line +[-] create "(NULL)" tab only on demand +[*] dumping optimization +[*] small changes to compile in VC6 + + +v7.0 + +[+] tabbed mode support (tab for every NETLIB user) +[+] toolbar button for clist modern +[+] options page +[*] other small changes + + +v6.6 + +[+] logging pause button +[*] log scrolling hotkey was changed to Ctrl+Q +[*] more translatable strings +[-] fixed tooltips on buttons + + +v6.5 + +[+] global hotkey to show/hide console (Win+C by default) +[+] common shortcuts in console (Ctrl+C/S/D/A/O, Del) +[*] trying to hook netlib log on load +[*] hi-res console icon + + +v6.4 + +[-] some bugfixes (unicode version only) + + +v6.3 + +[!] NETLIB was removed. using netlib log hook. +[+] unicode support +[+] ansi / utf8 autodetection and conversion +[+] faster startup/shutdown/dumping +[+] variable line wrap length + + +v6.0 - 6.2 + +[!] internal builds + + +v5.4 + +[-] workaround for "\r" in console window +[*] small speed improvements in netlib log dump +[*] merge with SVN (netlib module) + + +v5.3 + +[*] PluginInfoEx was added, some code was replaced with core services (thanx Jazzy$) +[*] merge with SVN (netlib module) + + +v5.2 + +[*] merge with SVN (netlib module) +[*] fix for crash on exit (miranda 0.7 core issue) +[+] save and restore console window position + + +v5.1 + +[-] filter settings were not saved + + +v5.0 + +[+] buttons to copy/delete/save log, open options +[+] ability to select colors and font (fontservice needed) +[*] long lines (>90 chars) are wraped +[+] list-view auto width +[*] destoying all services before unload to prevent crashes + + +v4.0 + +[*] merged with lastest netlib + + +v3.3 + +[-] packet dumps still were not shown in some cases +[+] small optimizations + + +v3.2 + +[-] fixed huge memory leak +[-] packet dumps were not shown if logging to file was off + + +v3.1 + +[!] listview control console window. richedit is too slow + + +v3.0 + +[!] richedit control console window! + +v2.0 + +[?] + +v1.9 + +[+] abitity to remember last console state + +v1.8 + +[+] profile path is shown in console title + +v1.7 + +[?] + + +v1.6 + +[-] fixed AV on msg from NULL (thanx sh8an) +[*] attempt to fix windows shutdown issues with opened miranda + +v1.5 + +[+] ability to log only custom protocols (netlibusers) +[-] console window startup workaround to prevent crashes and other bugs + +v1.4 + +[+] console window writes log even in hidden state (if Log to Console is checked) +[+] ability to hide/show console from main menu and toptoolbar button +[+] open outgoing connections with delay is now optional +[*] console startup code was rewritten +[-] pressing Ctrl+C or Ctrl+Break in console window do not close Miranda any more +[-] now console window always appears on top + +v1.3 + +[+] console window from 0.3x netlib +[+] console buffer is 100 times larger +[+] console text convertion to OEM codepage +[-] close button now always disabled +[*] some changes to unloading + +-------------------------------------------------------------------------------- +[!] important note +[+] added feature +[*] improved/changed feature +[-] bug fixed diff --git a/Console/Console_readme.txt b/Console/Console_readme.txt new file mode 100644 index 0000000..6d66f9b --- /dev/null +++ b/Console/Console_readme.txt @@ -0,0 +1,21 @@ +Console window plugin for Netlib logging. + +It is designed for Miranda developers & advanced users! 8-) + + +v7 introduced tabs support. Single window mode is also avaliable. +It can be switched in options. Icons and other stuff is avaliable. + +v6 is based on the code of v5 but without NETLIB. it uses new netlib log hook instead. +Netlib filters are still in Log Options but they are not part of console any more :). + +Also: ++ faster startup/shutdown/dumping ++ unicode support ++ ansi / utf8 autodetection and conversion ++ variable line wrap length + +Console window can be opened/closed with: + - (Top)ToolBar button + - MainMenu->Help->Show/Hide Console + - Hotkey using service "Console/Show/Hide" \ No newline at end of file diff --git a/Console/commonheaders.c b/Console/commonheaders.c new file mode 100644 index 0000000..cbfb79d --- /dev/null +++ b/Console/commonheaders.c @@ -0,0 +1,24 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2008 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "commonheaders.h" \ No newline at end of file diff --git a/Console/commonheaders.h b/Console/commonheaders.h new file mode 100644 index 0000000..05a5d96 --- /dev/null +++ b/Console/commonheaders.h @@ -0,0 +1,69 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2008 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#define _WIN32_WINNT 0x0501 + +#pragma comment( lib, "comctl32.lib") + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define MIRANDA_VER 0x0800 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "m_toolbar.h" +#include "m_toptoolbar.h" +#include "resource.h" + +#include "version.h" + +HINSTANCE hInst; + +void InitConsole(); +void ShutdownConsole(); + +#define MS_NETLIB_LOGWIN "Netlib/Log/Win" diff --git a/Console/gpl.txt b/Console/gpl.txt new file mode 100644 index 0000000..45645b4 --- /dev/null +++ b/Console/gpl.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/Console/init.c b/Console/init.c new file mode 100644 index 0000000..56c1dd4 --- /dev/null +++ b/Console/init.c @@ -0,0 +1,87 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2008 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include "commonheaders.h" + +PLUGINLINK *pluginLink; +DWORD mirandaVer; + + +PLUGININFOEX pluginInfoEx={ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + __VERSION_DWORD, + __PLUGIN_LONGDESC, + __PLUGIN_AUTHOR, + __PLUGIN_EMAIL, + __PLUGIN_RIGHTS, + __PLUGIN_URL, + UNICODE_AWARE, + 0, + MIID_CONSOLE +}; + + +BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + hInst = hinstDLL; + return TRUE; +} + +//////////////////////////////////////////////////////////////////////////////// + +__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + mirandaVer = mirandaVersion; + return &pluginInfoEx; +} + +// we implement service mode interface +static const MUUID interfaces[] = {MIID_LOGWINDOW, MIID_LAST}; +__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + return interfaces; +} + +//////////////////////////////////////////////////////////////////////////////// + +int __declspec(dllexport) Load(PLUGINLINK *link) +{ + pluginLink = link; + + if (mirandaVer < PLUGIN_MAKE_VERSION(0,8,0,3)) + return -1; + else + { + InitCommonControls(); + InitConsole(); + return 0; + } +} + + +int __declspec(dllexport) Unload(void) +{ + ShutdownConsole(); + return 0; +} diff --git a/Console/res/arrow.ico b/Console/res/arrow.ico new file mode 100644 index 0000000..56d058b Binary files /dev/null and b/Console/res/arrow.ico differ diff --git a/Console/res/btn_dn.ico b/Console/res/btn_dn.ico new file mode 100644 index 0000000..f86cdc6 Binary files /dev/null and b/Console/res/btn_dn.ico differ diff --git a/Console/res/btn_up.ico b/Console/res/btn_up.ico new file mode 100644 index 0000000..d885ea0 Binary files /dev/null and b/Console/res/btn_up.ico differ diff --git a/Console/res/close.ico b/Console/res/close.ico new file mode 100644 index 0000000..81237d0 Binary files /dev/null and b/Console/res/close.ico differ diff --git a/Console/res/close2.ico b/Console/res/close2.ico new file mode 100644 index 0000000..7e9bd8a Binary files /dev/null and b/Console/res/close2.ico differ diff --git a/Console/res/console.ico b/Console/res/console.ico new file mode 100644 index 0000000..7252e62 Binary files /dev/null and b/Console/res/console.ico differ diff --git a/Console/res/console_dn.bmp b/Console/res/console_dn.bmp new file mode 100644 index 0000000..33bb07c Binary files /dev/null and b/Console/res/console_dn.bmp differ diff --git a/Console/res/console_up.bmp b/Console/res/console_up.bmp new file mode 100644 index 0000000..2cdbb8d Binary files /dev/null and b/Console/res/console_up.bmp differ diff --git a/Console/res/copy.ico b/Console/res/copy.ico new file mode 100644 index 0000000..c27f61f Binary files /dev/null and b/Console/res/copy.ico differ diff --git a/Console/res/delete.ico b/Console/res/delete.ico new file mode 100644 index 0000000..7d931ad Binary files /dev/null and b/Console/res/delete.ico differ diff --git a/Console/res/empty.ico b/Console/res/empty.ico new file mode 100644 index 0000000..567bbe8 Binary files /dev/null and b/Console/res/empty.ico differ diff --git a/Console/res/in.ico b/Console/res/in.ico new file mode 100644 index 0000000..ceda4e6 Binary files /dev/null and b/Console/res/in.ico differ diff --git a/Console/res/info.ico b/Console/res/info.ico new file mode 100644 index 0000000..bf6ada7 Binary files /dev/null and b/Console/res/info.ico differ diff --git a/Console/res/noscroll.ico b/Console/res/noscroll.ico new file mode 100644 index 0000000..76c97c8 Binary files /dev/null and b/Console/res/noscroll.ico differ diff --git a/Console/res/options.ico b/Console/res/options.ico new file mode 100644 index 0000000..2dbffa5 Binary files /dev/null and b/Console/res/options.ico differ diff --git a/Console/res/out.ico b/Console/res/out.ico new file mode 100644 index 0000000..96425d3 Binary files /dev/null and b/Console/res/out.ico differ diff --git a/Console/res/pause.ico b/Console/res/pause.ico new file mode 100644 index 0000000..6e177a1 Binary files /dev/null and b/Console/res/pause.ico differ diff --git a/Console/res/paused.ico b/Console/res/paused.ico new file mode 100644 index 0000000..2d077bd Binary files /dev/null and b/Console/res/paused.ico differ diff --git a/Console/res/save.ico b/Console/res/save.ico new file mode 100644 index 0000000..4bb07fb Binary files /dev/null and b/Console/res/save.ico differ diff --git a/Console/res/scroll.ico b/Console/res/scroll.ico new file mode 100644 index 0000000..abf4595 Binary files /dev/null and b/Console/res/scroll.ico differ diff --git a/Console/res/start.ico b/Console/res/start.ico new file mode 100644 index 0000000..9272803 Binary files /dev/null and b/Console/res/start.ico differ diff --git a/Console/res/started.ico b/Console/res/started.ico new file mode 100644 index 0000000..3bc0da2 Binary files /dev/null and b/Console/res/started.ico differ diff --git a/Console/resource.h b/Console/resource.h new file mode 100644 index 0000000..e0b9ed2 --- /dev/null +++ b/Console/resource.h @@ -0,0 +1,58 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resource.rc +// +#define IDB_CONSOLE_UP 100 +#define IDB_CONSOLE_DOWN 101 +#define IDD_MSG 111 +#define IDD_CONSOLE 112 +#define IDD_LOG 113 +#define IDD_OPTIONS 114 +#define IDI_COPY 402 +#define IDI_NOSCROLL 403 +#define IDI_SCROLL 404 +#define IDI_SAVE 405 +#define IDI_DELETE 406 +#define IDI_OPTIONS 407 +#define IDI_PAUSED 408 +#define IDI_STARTED 409 +#define IDI_BTN_UP 410 +#define IDI_BTN_DN 411 +#define IDI_CLOSE 412 +#define IDI_START 413 +#define IDI_PAUSE 414 +#define IDI_IN 415 +#define IDI_OUT 416 +#define IDI_ARROW 417 +#define IDI_INFO 418 +#define IDI_EMPTY 419 +#define IDC_TABS 1000 +#define IDC_LIST 1001 +#define IDC_SAVE 1002 +#define IDC_PAUSE 1003 +#define IDC_SCROLL 1004 +#define IDC_COPY 1005 +#define IDC_DELETE 1006 +#define IDC_OPTIONS 1007 +#define IDI_CONSOLE 1008 +#define IDC_CLOSE 1009 +#define IDC_PAUSEALL 1010 +#define IDC_STARTALL 1011 +#define IDC_SINGLE 1012 +#define IDC_WRAP 1013 +#define IDC_SHOWICONS 1014 +#define IDC_SEPARATOR 1015 +#define IDC_LIMIT 1016 +#define IDC_START 1017 +#define IDC_RESTART 1018 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 115 +#define _APS_NEXT_COMMAND_VALUE 40000 +#define _APS_NEXT_CONTROL_VALUE 1019 +#define _APS_NEXT_SYMED_VALUE 102 +#endif +#endif diff --git a/Console/resource.rc b/Console/resource.rc new file mode 100644 index 0000000..d6f054e --- /dev/null +++ b/Console/resource.rc @@ -0,0 +1,223 @@ +// Microsoft Visual C++ generated resource script. +// +#include "resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include +#include +#include +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CONSOLE DIALOGEX 0, 0, 335, 257 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | + WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME +CAPTION "Console " +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "",IDC_TABS,"SysTabControl32",TCS_FOCUSNEVER | + WS_CLIPSIBLINGS | WS_TABSTOP,0,0,335,257 +END + +IDD_LOG DIALOGEX 0, 0, 335, 257 +STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN +FONT 10, "Courier", 0, 0, 0x1 +BEGIN + CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | + LVS_SHAREIMAGELISTS | LVS_NOCOLUMNHEADER | + LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,0,18,335,239 + CONTROL "&S",IDC_SAVE,"MButtonClass",WS_TABSTOP,0,1,14,16, + 0x18000000L + CONTROL "&P",IDC_PAUSE,"MButtonClass",WS_TABSTOP,16,1,14,16, + 0x18000000L + CONTROL "&Q",IDC_SCROLL,"MButtonClass",WS_TABSTOP,32,1,14,16, + 0x18000000L + CONTROL "&C",IDC_COPY,"MButtonClass",WS_TABSTOP,48,1,14,16, + 0x18000000L + CONTROL "&D",IDC_DELETE,"MButtonClass",WS_TABSTOP,64,1,14,16, + 0x18000000L + CONTROL "&O",IDC_OPTIONS,"MButtonClass",WS_TABSTOP,80,1,14,16, + 0x18000000L + CONTROL "",IDC_STARTALL,"MButtonClass",WS_TABSTOP,278,1,14,16, + 0x18000000L + CONTROL "",IDC_PAUSEALL,"MButtonClass",WS_TABSTOP,294,1,14,16, + 0x18000000L + CONTROL "&W",IDC_CLOSE,"MButtonClass",WS_TABSTOP,320,1,14,16, + 0x18000000L +END + +IDD_OPTIONS DIALOGEX 0, 0, 314, 239 +STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "Single window mode*",IDC_SINGLE,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,8,9,297,10 + CONTROL "Show icons in log*",IDC_SHOWICONS,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,8,24,297,10 + CONTROL "New lines between events*",IDC_SEPARATOR,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,8,39,297,10 + CONTROL "Always show at start",IDC_START,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,8,54,297,10 + EDITTEXT IDC_WRAP,8,69,23,11,ES_RIGHT | ES_NUMBER + EDITTEXT IDC_LIMIT,8,86,59,11,ES_RIGHT | ES_NUMBER + LTEXT "Lines wrap length [25-255]",IDC_STATIC,35,70,272,10 + LTEXT "Log size limit [1 000 - 1 000 000 lines]",IDC_STATIC,71, + 86,236,10 + LTEXT "* Restart needed",IDC_STATIC,8,106,296,10 + PUSHBUTTON "Save settings and restart console",IDC_RESTART,12,129, + 287,17 +END + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#include \r\n" + "#include \0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,0,7,2 + PRODUCTVERSION 0,0,7,2 + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x1L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", "Console log window for Miranda 0.8.0.3+" + VALUE "FileVersion", "0.0.7.2" + VALUE "InternalName", "Console" + VALUE "LegalCopyright", " 2005-2009 Bio" + VALUE "OriginalFilename", "Console.dll" + VALUE "ProductName", "Console" + VALUE "ProductVersion", "0.0.7.2" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END + + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_COPY ICON "Res\\copy.ico" +IDI_CONSOLE ICON "res\\console.ico" +IDI_NOSCROLL ICON "Res\\noscroll.ico" +IDI_SCROLL ICON "Res\\scroll.ico" +IDI_SAVE ICON "Res\\save.ico" +IDI_DELETE ICON "Res\\delete.ico" +IDI_OPTIONS ICON "Res\\options.ico" +IDI_PAUSED ICON "Res\\paused.ico" +IDI_STARTED ICON "Res\\started.ico" +IDI_BTN_UP ICON "Res\\btn_up.ico" +IDI_BTN_DN ICON "Res\\btn_dn.ico" +IDI_CLOSE ICON "Res\\close.ico" +IDI_PAUSE ICON "Res\\pause.ico" +IDI_START ICON "Res\\start.ico" +IDI_IN ICON "Res\\in.ico" +IDI_OUT ICON "Res\\out.ico" +IDI_ARROW ICON "Res\\arrow.ico" +IDI_INFO ICON "Res\\info.ico" +IDI_EMPTY ICON "Res\\empty.ico" + +///////////////////////////////////////////////////////////////////////////// +// +// Bitmap +// + +IDB_CONSOLE_UP BITMAP "res\\console_up.bmp" +IDB_CONSOLE_DOWN BITMAP "res\\console_dn.bmp" + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_CONSOLE, DIALOG + BEGIN + BOTTOMMARGIN, 256 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED diff --git a/Console/version.h b/Console/version.h new file mode 100644 index 0000000..f7a19ef --- /dev/null +++ b/Console/version.h @@ -0,0 +1,51 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2008 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + + +#define __FILEVERSION_STRING 0,0,7,2 +#define __VERSION_STRING "0.0.7.2" +#define __VERSION_DWORD 0x00000702 + + +#define __PLUGIN_DESC "Console log window for Miranda 0.8.0.3+" +#define __PLUGIN_LONGDESC __PLUGIN_DESC ". Compiled by Bio. Enjoy! 8-) [ Built "__DATE__" "__TIME__" ]" +#define __PLUGIN_AUTHOR "Bio" +#define __PLUGIN_EMAIL "bio@msx.ru" +#define __PLUGIN_RIGHTS " 2005-2009 Bio" +#define __PLUGIN_FILE "Console.dll" +#define __PLUGIN_SHORTNAME "Console" + + +#ifdef _UNICODE + // {23D4F302-D513-45b7-9027-445F29557311} + #define MIID_CONSOLE { 0x23d4f302, 0xd513, 0x45b7, { 0x90, 0x27, 0x44, 0x5f, 0x29, 0x55, 0x73, 0x11 }} + #define __PLUGIN_NAME __PLUGIN_SHORTNAME " (Unicode)" + #define __PLUGIN_URL "http://addons.miranda-im.org/details.php?action=viewfile&id=3791" +#endif + +#ifndef _UNICODE + // {798A94B8-74F4-46fc-978B-353D22BD485E} + #define MIID_CONSOLE { 0x798a94b8, 0x74f4, 0x46fc, { 0x97, 0x8b, 0x35, 0x3d, 0x22, 0xbd, 0x48, 0x5e }} + #define __PLUGIN_NAME __PLUGIN_SHORTNAME " (ANSI)" + #define __PLUGIN_URL "http://addons.miranda-im.org/details.php?action=viewfile&id=3789" +#endif diff --git a/IgnoreState/ignore_10.vcxproj b/IgnoreState/ignore_10.vcxproj index 38c4ca0..8508d07 100644 --- a/IgnoreState/ignore_10.vcxproj +++ b/IgnoreState/ignore_10.vcxproj @@ -89,7 +89,7 @@ Disabled - ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) MultiThreadedDebug Level3 @@ -136,7 +136,7 @@ Full OnlyExplicitInline Size - ../../include;../ExternalAPI + ../include;../ExternalAPI;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) Level3 ProgramDatabase diff --git a/authstate/authstate.dsp b/authstate/authstate.dsp deleted file mode 100644 index a62dc51..0000000 --- a/authstate/authstate.dsp +++ /dev/null @@ -1,142 +0,0 @@ -# Microsoft Developer Studio Project File - Name="AuthState" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=AuthState - Win32 Debug -!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 "authstate.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 "authstate.mak" CFG="AuthState - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "AuthState - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "AuthState - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 1 -# PROP Scc_ProjName "" -# PROP Scc_LocalPath "" -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "AuthState - 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 1 -# PROP Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FINGER_EXPORTS" /YX /FD /c -# ADD CPP /nologo /MD /W3 /GX /Zi /O1 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FINGER_EXPORTS" /FD /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /I "../../../include" /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "NDEBUG" -# ADD RSC /l 0x809 /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 /nologo /base:"0x22620000" /verbose /dll /pdb:"../../bin/release/plugins/AuthState.pdb" /machine:I386 /out:"../../bin/release/plugins/AuthState.dll" -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "AuthState - 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 "FINGER_EXPORTS" /YX /FD /GZ /c -# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "FINGER_EXPORTS" /FD /GZ /c -# SUBTRACT CPP /YX -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /I "../../../../include" /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x419 /d "_DEBUG" -# ADD RSC /l 0x419 /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 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 /base:"0x22620000" /dll /debug /machine:I386 /out:"../../../bin/debug/plugins/AuthState.dll" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "AuthState - Win32 Release" -# Name "AuthState - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\main.cpp -# End Source File -# Begin Source File - -SOURCE=.\options.cpp -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=.\commonheaders.h -# End Source File -# Begin Source File - -SOURCE=.\m_cluiframes.h -# End Source File -# Begin Source File - -SOURCE=.\m_icolib.h -# End Source File -# Begin Source File - -SOURCE=.\resource.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 - -!IF "$(CFG)" == "AuthState - Win32 Release" - -!ELSEIF "$(CFG)" == "AuthState - Win32 Debug" - -!ENDIF - -# End Source File -# End Group -# End Target -# End Project diff --git a/authstate/authstate.dsw b/authstate/authstate.dsw deleted file mode 100644 index 169266e..0000000 --- a/authstate/authstate.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "AuthState"=".\authstate.dsp" - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/authstate/authstate.mdsp b/authstate/authstate.mdsp deleted file mode 100644 index 8c794e5..0000000 --- a/authstate/authstate.mdsp +++ /dev/null @@ -1,100 +0,0 @@ -[Project] -name=AuthState -type=2 -defaultConfig=1 - - -[Debug] -// compiler -workingDirectory= -arguments= -intermediateFilesDirectory=Debug -outputFilesDirectory=Debug -compilerPreprocessor= -extraCompilerOptions= -compilerIncludeDirectory=..\..\include -noWarning=0 -defaultWarning=0 -allWarning=1 -extraWarning=0 -isoWarning=0 -warningsAsErrors=0 -debugType=1 -debugLevel=2 -exceptionEnabled=1 -runtimeTypeEnabled=1 -optimizeLevel=4 - -// linker -libraryPath= -outputFilename=Debug\AuthState.dll -libraries= -extraLinkerOptions= -ignoreStartupFile=0 -ignoreDefaultLibs=0 -stripExecutableFile=0 - -// archive -extraArchiveOptions= - -//resource -resourcePreprocessor= -resourceIncludeDirectory= -extraResourceOptions= - -[Release] -// compiler -workingDirectory= -arguments= -intermediateFilesDirectory=Release -outputFilesDirectory=Release -compilerPreprocessor= -extraCompilerOptions= -compilerIncludeDirectory=..\..\include -noWarning=0 -defaultWarning=1 -allWarning=1 -extraWarning=0 -isoWarning=0 -warningsAsErrors=0 -debugType=0 -debugLevel=1 -exceptionEnabled=1 -runtimeTypeEnabled=1 -optimizeLevel=4 - -// linker -libraryPath= -outputFilename=Release\AuthState.dll -libraries= -extraLinkerOptions= -ignoreStartupFile=0 -ignoreDefaultLibs=0 -stripExecutableFile=1 - -// archive -extraArchiveOptions= - -//resource -resourcePreprocessor= -resourceIncludeDirectory= -extraResourceOptions= - -[Source] -1=main.cpp -2=options.cpp -[Header] -1=commonheaders.h -2=m_cluiframes.h -3=m_updater.h -4=resource.h -[Resource] -1=authstate.rc -[Other] -1=docs\authstate-readme.txt -2=docs\authstate-translate.txt -[History]commonheaders.h,1232 -docs\authstate-translate.txt,381 -options.cpp,1384 -main.cpp,1168 -docs\authstate-readme.txt,902 diff --git a/authstate/authstate.rc b/authstate/authstate.rc deleted file mode 100644 index 0bed718..0000000 --- a/authstate/authstate.rc +++ /dev/null @@ -1,132 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Ukrainian resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_UKR) -#ifdef _WIN32 -LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT -#pragma code_page(1251) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_AUTH ICON "icons\\auth.ico" -IDI_GRANT ICON "icons\\grant.ico" -IDI_AUTHGRANT ICON "icons\\authgrant.ico" -#endif // Ukrainian resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_AUTHSTATE_OPT DIALOGEX 0, 0, 314, 240 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - COMBOBOX IDC_ADVICON,95,127,78,81,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP,WS_EX_CLIENTEDGE - CONTROL "Show Auth icon",IDC_AUTHICON,"Button",BS_AUTOCHECKBOX | - BS_LEFTTEXT | WS_TABSTOP,76,93,167,18 - CONTROL "Show Grant icon",IDC_GRANTICON,"Button",BS_AUTOCHECKBOX | - BS_LEFTTEXT | WS_TABSTOP,76,109,167,18 - GROUPBOX "Plugin settings",IDC_STATIC,19,46,276,118 - RTEXT "Use",IDC_STATIC,40,129,49,12 - LTEXT "slot to draw the icon",IDC_STATIC,179,129,86,17 - CONTROL "Enable Menu Item (*)",IDC_ENABLEMENUITEM,"Button", - BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,76,65,167,13 - CONTROL "Show icons only for recently added contacts", - IDC_ICONSFORRECENT,"Button",BS_AUTOCHECKBOX | - BS_LEFTTEXT | WS_TABSTOP,76,78,167,17 - RTEXT "* Restart of Miranda required",IDC_STATIC,58,171,210,11 - LTEXT "Note: if you still don't see the icons try changing icon slot. Perhaps its used by some other plugin.", - IDC_NOTICE,54,143,198,20 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_AUTHSTATE_OPT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 307 - TOPMARGIN, 7 - BOTTOMMARGIN, 233 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/authstate/authstate.sln b/authstate/authstate.sln deleted file mode 100644 index 83ffeb1..0000000 --- a/authstate/authstate.sln +++ /dev/null @@ -1,19 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 10.00 -# Visual C++ Express 2008 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "authstate", "authstate.vcproj", "{DB315D7D-00BB-43B2-93A6-0430CA2B9F28}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|Win32.ActiveCfg = Debug|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|Win32.Build.0 = Debug|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|Win32.ActiveCfg = Release|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/authstate/authstate.vcproj b/authstate/authstate.vcproj deleted file mode 100644 index 12c647f..0000000 --- a/authstate/authstate.vcproj +++ /dev/null @@ -1,177 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/authstate/authstate_10.sln b/authstate/authstate_10.sln deleted file mode 100644 index 6bcf6d3..0000000 --- a/authstate/authstate_10.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual C++ Express 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AuthState", "authstate_10.vcxproj", "{DB315D7D-00BB-43B2-93A6-0430CA2B9F28}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug Unicode|x64 = Debug Unicode|x64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release Unicode|Win32 = Release Unicode|Win32 - Release Unicode|x64 = Release Unicode|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|Win32.ActiveCfg = Debug|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|Win32.Build.0 = Debug|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|x64.ActiveCfg = Debug|x64 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Debug|x64.Build.0 = Debug|x64 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|Win32.ActiveCfg = Release|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|Win32.Build.0 = Release|Win32 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|x64.ActiveCfg = Release|x64 - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/authstate/authstate_10.vcxproj b/authstate/authstate_10.vcxproj deleted file mode 100644 index f54aef6..0000000 --- a/authstate/authstate_10.vcxproj +++ /dev/null @@ -1,397 +0,0 @@ - - - - - Debug Unicode - Win32 - - - Debug Unicode - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release Unicode - Win32 - - - Release Unicode - x64 - - - Release - Win32 - - - Release - x64 - - - - AuthState - {DB315D7D-00BB-43B2-93A6-0430CA2B9F28} - authstate_9 - Win32Proj - - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - - - DynamicLibrary - Unicode - true - - - DynamicLibrary - Unicode - - - DynamicLibrary - MultiByte - true - - - DynamicLibrary - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)64/Plugins\ - $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)64/Plugins\ - $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)64/Plugins\ - $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)64/Plugins\ - $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - AllRules.ruleset - - - - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDebug - Use - Commonheaders.h - Level3 - EditAndContinue - - - true - Windows - 0x22620000 - false - - - MachineX86 - - - - - Full - OnlyExplicitInline - Size - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - Use - Commonheaders.h - Level3 - ProgramDatabase - 4996;%(DisableSpecificWarnings) - - - true - Windows - true - true - 0x22620000 - false - - - MachineX86 - - - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDebug - Use - Commonheaders.h - Level3 - EditAndContinue - 4996;%(DisableSpecificWarnings) - - - true - Windows - 0x22620000 - false - - - MachineX86 - - - - - Full - OnlyExplicitInline - Size - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - Use - Commonheaders.h - Level3 - ProgramDatabase - 4996;%(DisableSpecificWarnings) - - - true - Windows - true - true - 0x22620000 - false - - - MachineX86 - - - - - X64 - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDebug - Use - Commonheaders.h - Level3 - ProgramDatabase - - - true - Windows - 0x22620000 - false - - - $(IntDir)$(TargetName).lib - MachineX64 - - - - - X64 - - - Full - OnlyExplicitInline - Size - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - Use - Commonheaders.h - Level3 - ProgramDatabase - 4996;%(DisableSpecificWarnings) - - - true - Windows - true - true - 0x22620000 - false - - - $(IntDir)$(TargetName).lib - MachineX64 - - - - - X64 - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) - MultiThreadedDebug - Use - Commonheaders.h - Level3 - ProgramDatabase - 4996;%(DisableSpecificWarnings) - - - true - Windows - 0x22620000 - false - - - $(IntDir)$(TargetName).lib - MachineX64 - - - - - X64 - - - Full - OnlyExplicitInline - Size - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;AUTHSTATE_EXPORTS;%(PreprocessorDefinitions) - MultiThreaded - Use - Commonheaders.h - Level3 - ProgramDatabase - 4996;%(DisableSpecificWarnings) - - - true - Windows - true - true - 0x22620000 - false - - - $(IntDir)$(TargetName).lib - MachineX64 - - - - - Create - Create - Create - Create - Create - Create - Create - Create - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/authstate/authstate_10.vcxproj.filters b/authstate/authstate_10.vcxproj.filters deleted file mode 100644 index c045a6a..0000000 --- a/authstate/authstate_10.vcxproj.filters +++ /dev/null @@ -1,64 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hpp;hxx;hm;inl;inc;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx - - - {e3d2bfb3-bac6-4574-951a-0d849c44446e} - - - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Docs - - - Docs - - - - - Resource Files - - - Resource Files - - - \ No newline at end of file diff --git a/authstate/authstate_9.vcproj b/authstate/authstate_9.vcproj deleted file mode 100644 index bcd25c9..0000000 --- a/authstate/authstate_9.vcproj +++ /dev/null @@ -1,793 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/authstate/commonheaders.h b/authstate/commonheaders.h deleted file mode 100644 index 746ff48..0000000 --- a/authstate/commonheaders.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - Authorization State plugin for Miranda-IM (www.miranda-im.org) - (c) 2006-2009 by Thief - - 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 - - File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/commonheaders.h $ - Revision : $Rev: 1686 $ - Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ - Last change by : $Author: ghazan $ - -*/ - -#ifndef COMMHEADERS_H -#define COMMHEADERS_H - -#define MIRANDA_VER 0x0900 -#define MIRANDA_CUSTOM_LP - -#include -#include // needed by m_utils.h -#include // needed by m_icolib.h > r9256 -#include - -// Miranda API headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "resource.h" -#include "Version.h" - -// Third party SDK headers -#include "m_updater.h" -#include "m_extraicons.h" - -static const int DefaultSlot = EXTRA_ICON_ADV2; -#define MODULENAME "AuthState" - -extern int onOptInitialise(WPARAM wParam, LPARAM lParam); -extern int onExtraImageApplying(WPARAM wParam, LPARAM lParam); -extern int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam); - -extern HINSTANCE g_hInst; -extern IconExtraColumn g_IECAuth, g_IECGrant, g_IECAuthGrant, g_IECClear; -extern INT clistIcon; -extern byte bUseAuthIcon, bUseGrantIcon, bContactMenuItem, bIconsForRecentContacts; -extern HANDLE hExtraIcon; - -#endif //COMMHEADERS_H diff --git a/authstate/docs/authstate-readme.txt b/authstate/docs/authstate-readme.txt deleted file mode 100644 index d830076..0000000 --- a/authstate/docs/authstate-readme.txt +++ /dev/null @@ -1,54 +0,0 @@ -Authorization State plugin for Miranda IM (http://miranda-im.org) -Homepage: http://thief.miranda.im -Version: 0.0.2.0 (c) 2006-2009 Thief -Idea by snwbrdr, icons by Faith Healer, Angeli-Ka - -This small plugin intended to show an icon in front of contacts which haven't gived us an authorization. -Another icon is displayed if there is Grant Authorization item in contact's menu. -Options to disable/enable icons for particular contact are available in contact's menu. - -I would like to say thanks to: -snwbrdr for initial idea -Faith Healer for cute icons -Kildor for several creative ideas -mirandaim.ru forum members for valuable feedback and suggestions. -eblis and baloo for WhenWasIt and SecureIM plugins (I found many useful hints on implementation in sources of these plugins) - -Changes: - -v0.0.2.0 -+ added support for extraicons service plugin - -v0.0.1.6 -! fixed wrong auth-grant icon in some cases -- minor adjustments to menu item logic - -v0.0.1.5 -* icons by Angeli-Ka -+ auth-grant icon is shown if contact wasn't added to server-side contact list - -v0.0.1.4 -! MinGW build -- small corrections and fixes - -v0.0.1.3 -+ added Miranda 0.8 support (PluginInfoEx and Interfaces) -+ optional ability to move contacts without permited authorization to a separate group (like icq official) - WORK IN PROGRESS -* fixed crash on exit (thx Joe) -* small bugfixes - -v0.0.1.2 -! fix: when changing icon slot clist was getting multiply icons -! fix: dropdown items in options weren't visible in some cases - -v0.0.1.1 -* fixes to translation - -v0.0.1.0 -- initial FL release - -v0.0.0.x -- test versions released on mirandaim.ru forum only. - -Plugin is released under GPL licence. -http://www.gnu.org/copyleft/gpl.html \ No newline at end of file diff --git a/authstate/docs/authstate-translate.txt b/authstate/docs/authstate-translate.txt deleted file mode 100644 index 4e6d872..0000000 --- a/authstate/docs/authstate-translate.txt +++ /dev/null @@ -1,24 +0,0 @@ -[Auth State] -[Auth] -[Grant] -[Auth & Grant] -[Show Auth icon] -[Show Grant icon] -[Plugin settings] -[Use] -[slot to draw the icon] -[Enable Menu Item (*)] -[Show icons only for recently added contacts] -[* Restart of Miranda required] -[Email] -[Protocol] -[SMS] -[Advanced 1] -[Advanced 2] -[Web] -[Client] -[Advanced 3] -[Advanced 4] -[Advanced 5] -[Disable AuthState icons] -[Enable AuthState icons] \ No newline at end of file diff --git a/authstate/icons/auth.ico b/authstate/icons/auth.ico deleted file mode 100644 index 01cb6f0..0000000 Binary files a/authstate/icons/auth.ico and /dev/null differ diff --git a/authstate/icons/authgrant.ico b/authstate/icons/authgrant.ico deleted file mode 100644 index 3f15a64..0000000 Binary files a/authstate/icons/authgrant.ico and /dev/null differ diff --git a/authstate/icons/grant.ico b/authstate/icons/grant.ico deleted file mode 100644 index 89ce601..0000000 Binary files a/authstate/icons/grant.ico and /dev/null differ diff --git a/authstate/main.cpp b/authstate/main.cpp deleted file mode 100644 index ba5a006..0000000 --- a/authstate/main.cpp +++ /dev/null @@ -1,385 +0,0 @@ -/* - Authorization State plugin for Miranda-IM (www.miranda-im.org) - (c) 2006-2010 by Thief - - 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 - - File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/main.cpp $ - Revision : $Rev: 1686 $ - Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ - Last change by : $Author: ghazan $ - -*/ - -#include "commonheaders.h" - -HINSTANCE g_hInst; -PLUGINLINK *pluginLink; -static HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL; -static HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactSettingChanged = NULL, hContactAdded = NULL; -static HANDLE hPrebuildContactMenu = NULL, hAuthMenuSelected = NULL; -static HANDLE hUserMenu = NULL; -HANDLE hExtraIcon = NULL; -struct MM_INTERFACE mmi; -int hLangpack; - -IconExtraColumn g_IECAuth = {0}; -IconExtraColumn g_IECGrant = {0}; -IconExtraColumn g_IECAuthGrant = {0}; -IconExtraColumn g_IECClear = {0}; -INT clistIcon = 0; //Icon slot to use -BYTE bUseAuthIcon = 0, bUseGrantIcon = 0, bContactMenuItem = 0, bIconsForRecentContacts = 0, bUseAuthGroup = 0; - -enum { -icon_none, -icon_auth, -icon_grant, -icon_both -}; - -PLUGININFOEX pluginInfo={ - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESCRIPTION, - __AUTHOR, - __AUTHOREMAIL, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, - 0, //doesn't replace anything built-in - {0xdace7d41, 0xdfa9, 0x4772, {0x89, 0xae, 0xa5, 0x9a, 0x61, 0x53, 0xe6, 0xb2}} -/* DACE7D41-DFA9-4772-89AE-A59A6153E6B2 */ -}; - -extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) -{ - g_hInst = hinstDLL; - return TRUE; -} - -/* 236CBB9A-57D2-419D-B5CB-0DF5926E921C */ -#define MIID_AUTHSTATE {0x236cbb9a, 0x57d2, 0x419d, {0xb5, 0xcb, 0x0d, 0xf5, 0x92, 0x6e, 0x92, 0x1c}} - -extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) -{ - static const MUUID interfaces[] = {MIID_AUTHSTATE, MIID_LAST}; - return interfaces; -} - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfo; -} - -INT_PTR getIconToUse(HANDLE hContact, LPARAM lParam) -{ - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); -// if (lParam == 1) return icon_none; - if (!DBGetContactSettingByte(hContact,"AuthState","ShowIcons",!bIconsForRecentContacts)) return icon_none; - - if (DBGetContactSettingByte(0,"ICQ","UseServerCList",0)) - if (DBGetContactSettingWord(hContact,proto,"ServerId",1) == 0) - return icon_both; - - if (bUseAuthIcon & bUseGrantIcon) - if (DBGetContactSettingByte(hContact,proto,"Auth",0) && DBGetContactSettingByte(hContact,proto,"Grant",0)) - return icon_both; - - if (bUseAuthIcon) - if (DBGetContactSettingByte(hContact,proto,"Auth",0)) - return icon_auth; - - if (bUseGrantIcon) - if (DBGetContactSettingByte(hContact,proto,"Grant",0)) - return icon_grant; - return icon_none; -} - -int onExtraImageApplying(WPARAM wParam, LPARAM lParam) -{ - if (wParam == NULL) - return 0; - - int usedIcon; - usedIcon = getIconToUse((HANDLE) wParam, lParam); - - if (hExtraIcon != NULL) - { - const char *icon; - switch (usedIcon) - { - case icon_both: icon = "authgrant_icon"; break; - case icon_grant: icon = "grant_icon"; break; - case icon_auth: icon = "auth_icon"; break; - default: icon = NULL; break; - } - ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, icon); - } - else - { - switch (usedIcon) - { - case icon_both: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECAuthGrant); break; - case icon_grant: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECGrant); break; - case icon_auth: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECAuth); break; - default: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECClear); break; - } - } - - return 0; -} - -int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam) -{ - g_IECAuth.cbSize = sizeof(IconExtraColumn); - g_IECAuth.ColumnType = clistIcon; - g_IECGrant.cbSize = sizeof(IconExtraColumn); - g_IECGrant.ColumnType = clistIcon; - g_IECAuthGrant.cbSize = sizeof(IconExtraColumn); - g_IECAuthGrant.ColumnType = clistIcon; - - if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) - { - if (ServiceExists(MS_SKIN2_ADDICON)) - { - g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"auth_icon"), (LPARAM)0); - g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"grant_icon"), (LPARAM)0); - g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"authgrant_icon"), (LPARAM)0); - } - else - { - g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_AUTH), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); - g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_GRANT), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); - g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_AUTHGRANT), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); - } - } - - return 0; -} - -int onContactSettingChanged(WPARAM wParam,LPARAM lParam) -{ - DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); - if (!proto) return 0; - - if (!lstrcmpA(cws->szModule,proto)) - if (!lstrcmpA(cws->szSetting,"Auth") || !lstrcmpA(cws->szSetting,"Grant") || !lstrcmpA(cws->szSetting,"ServerId")) - onExtraImageApplying(wParam, 1); - - return 0; -} - -int onDBContactAdded(WPARAM wParam, LPARAM lParam) -{ - // A new contact added, mark it as recent - DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", 1); - onExtraImageApplying(wParam, 0); - - return 0; -} - -INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam) -{ - byte enabled = DBGetContactSettingByte((HANDLE)wParam,"AuthState","ShowIcons",1); - DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", !enabled); - - if (enabled) - CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECClear); - else - onExtraImageApplying(wParam, 0); - - return 0; -} - -int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) -{ - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); - if (!proto) return 0; - - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(CLISTMENUITEM); - - if (!DBGetContactSettingByte((HANDLE)wParam,proto,"Auth",0) && !DBGetContactSettingByte((HANDLE)wParam,proto,"Grant",0) && DBGetContactSettingWord((HANDLE)wParam,proto,"ServerId",0)) - mi.flags = CMIF_TCHAR | CMIM_FLAGS | CMIF_HIDDEN; - else - mi.flags = CMIF_TCHAR | CMIM_FLAGS; - - if (DBGetContactSettingByte((HANDLE)wParam,"AuthState","ShowIcons",1)) - { - mi.flags |= CMIF_TCHAR | CMIM_NAME; - mi.ptszName = _T("Disable AuthState icons"); - } - else - { - mi.flags |= CMIF_TCHAR | CMIM_NAME; - mi.ptszName = _T("Enable AuthState icons"); - } - - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hUserMenu, (LPARAM)&mi); - - return 0; -} - -int onModulesLoaded(WPARAM wParam,LPARAM lParam) -{ - // hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild); - // hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying); - // IcoLib support - if (ServiceExists(MS_SKIN2_ADDICON)) - { - SKINICONDESC sid = {0}; - ZeroMemory(&sid, sizeof(sid)); - TCHAR szFile[MAX_PATH]; - sid.cbSize = sizeof(sid); - sid.flags = SIDF_ALL_TCHAR; - - sid.ptszSection = _T("Auth State"); - GetModuleFileName(g_hInst, szFile, MAX_PATH); - sid.ptszDefaultFile = szFile; - - sid.ptszDescription = _T("Auth"); - sid.pszName = "auth_icon"; - sid.iDefaultIndex = -IDI_AUTH; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - - sid.ptszDescription = _T("Grant"); - sid.pszName = "grant_icon"; - sid.iDefaultIndex = -IDI_GRANT; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - - sid.ptszDescription = _T("Auth & Grant"); - sid.pszName = "authgrant_icon"; - sid.iDefaultIndex = -IDI_AUTHGRANT; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - - // hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild); - } - hExtraIcon = ExtraIcon_Register("authstate", "Auth State", "authgrant_icon"); - - if (hExtraIcon != NULL) - { - // Set initial value for all contacts - HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - while (hContact != NULL) - { - onExtraImageApplying((WPARAM)hContact, 1); - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); - } - } - else - { - hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild); - hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild); - hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying); - onExtraImageListRebuild(0,0); - } - hOptInitialise = HookEvent(ME_OPT_INITIALISE, onOptInitialise); - if (bContactMenuItem) hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); - - // Updater support - if (ServiceExists(MS_UPDATE_REGISTER)) - { - Update update = {0}; - char szVersion[16]; - - update.cbSize = sizeof(Update); - - update.szComponentName = pluginInfo.shortName; - update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); - update.cpbVersion = lstrlenA((char *)update.pbVersion); - - update.szUpdateURL = UPDATER_AUTOREGISTER; - - // these are the three lines that matter - the archive, the page containing the version string, and the text (or data) - // before the version that we use to locate it on the page - // (note that if the update URL and the version URL point to standard file listing entries, the backend xml - // data will be used to check for updates rather than the actual web page - this is not true for beta urls) - update.szBetaUpdateURL = "http://thief.miranda.im/authstate.zip"; - update.szBetaVersionURL = "http://thief.miranda.im/updater/authstate_version.txt"; - update.szBetaChangelogURL = "http://thief.miranda.im"; - update.pbBetaVersionPrefix = (BYTE *)"AuthState "; - - update.cpbBetaVersionPrefix = lstrlenA((char *)update.pbBetaVersionPrefix); - - CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); - } - - return 0; -} - -int onSystemOKToExit(WPARAM wParam,LPARAM lParam) -{ - UnhookEvent(hHookModulesLoaded); - UnhookEvent(hHookExtraIconsRebuild); - UnhookEvent(hHookExtraIconsApply); - UnhookEvent(hOptInitialise); - UnhookEvent(hSystemOKToExit); - UnhookEvent(hContactSettingChanged); - if (hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged); - if (hContactAdded) UnhookEvent(hContactAdded); - if (hPrebuildContactMenu) - { - UnhookEvent(hPrebuildContactMenu); - UnhookEvent(hUserMenu); - } - DestroyServiceFunction(hAuthMenuSelected); - - return 0; -} - -extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) -{ - pluginLink = link; - mir_getLP(&pluginInfo); - mir_getMMI(&mmi); - - hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); - hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit); - hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); - - clistIcon = DBGetContactSettingByte(NULL, MODULENAME, "AdvancedIcon", DefaultSlot); - bUseAuthIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", 1); - bUseGrantIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", 1); - bContactMenuItem = DBGetContactSettingByte(NULL, MODULENAME, "MenuItem", 0); - bIconsForRecentContacts = DBGetContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", 0); - - hContactAdded = HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded); - - if (bContactMenuItem) - { - hAuthMenuSelected = CreateServiceFunction("AuthState/MenuItem", onAuthMenuSelected); - - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(CLISTMENUITEM); - mi.position = -1999901005; - mi.flags = CMIF_TCHAR; - mi.ptszName = _T("Enable AuthState icons"); - mi.pszService = "AuthState/MenuItem"; - hUserMenu = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi); - } - - g_IECClear.cbSize = sizeof(IconExtraColumn); - g_IECClear.ColumnType = clistIcon; - g_IECClear.hImage = (HANDLE) -1; - - return 0; -} - -extern "C" int __declspec(dllexport) Unload(void) -{ - return 0; -} diff --git a/authstate/options.cpp b/authstate/options.cpp deleted file mode 100644 index 37dbdca..0000000 --- a/authstate/options.cpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - Authorization State plugin for Miranda-IM (www.miranda-im.org) - (c) 2006-2010 by Thief - - 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 - - File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/options.cpp $ - Revision : $Rev: 1686 $ - Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ - Last change by : $Author: ghazan $ - -*/ - -#include "commonheaders.h" - -const TCHAR* szAdvancedIcons[] = {_T("Email"), _T("Protocol"), _T("SMS"), _T("Advanced 1"), _T("Advanced 2"), _T("Web"), _T("Client"), _T("Advanced 3"), _T("Advanced 4"), _T("Advanced 5")}; -const INT cAdvancedIcons = sizeof(szAdvancedIcons) / sizeof(szAdvancedIcons[0]); - -INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static int bInitializing = 0; - switch (msg) - { - case WM_INITDIALOG: - { - TranslateDialogDefault(hwndDlg); - bInitializing = 1; - if (hExtraIcon==NULL) - { - for (int i = 0; i < cAdvancedIcons; i++) - { - SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szAdvancedIcons[i])); - } - SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_SETCURSEL, clistIcon-1, 0); - } - else - { - SendDlgItemMessage(hwndDlg,IDC_NOTICE, WM_SETTEXT,0,(LPARAM)TranslateT("Extraicons plugin is used, use Contact list > Extraicons for customize.")); - ShowWindow(GetDlgItem(hwndDlg, IDC_NOTICE), SW_SHOW); - EnableWindow(GetDlgItem(hwndDlg, IDC_ADVICON), 0); - } - - CheckDlgButton(hwndDlg, IDC_AUTHICON, bUseAuthIcon ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_GRANTICON, bUseGrantIcon ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ENABLEMENUITEM, bContactMenuItem ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ICONSFORRECENT, bIconsForRecentContacts ? BST_CHECKED : BST_UNCHECKED); - - bInitializing = 0; - return TRUE; - } - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDC_AUTHICON: - case IDC_GRANTICON: - case IDC_ENABLEMENUITEM: - case IDC_ICONSFORRECENT: - { - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - } - case IDC_ADVICON: - { - if ((HIWORD(wParam) == EN_CHANGE) && (!bInitializing) || (HIWORD(wParam) == CBN_SELENDOK)) - { - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - } - break; - } - } - break; - } - - case WM_NOTIFY: - { - if (((LPNMHDR)lParam)->idFrom == 0) - switch (((LPNMHDR)lParam)->code) - { - case PSN_APPLY: - { - bUseAuthIcon = IsDlgButtonChecked(hwndDlg, IDC_AUTHICON); - bUseGrantIcon = IsDlgButtonChecked(hwndDlg, IDC_GRANTICON); - bContactMenuItem = IsDlgButtonChecked(hwndDlg, IDC_ENABLEMENUITEM); - bIconsForRecentContacts = IsDlgButtonChecked(hwndDlg, IDC_ICONSFORRECENT); - - clistIcon = SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_GETCURSEL, 0, 0); - clistIcon++; - - HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - while (hContact) - { - CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&g_IECClear); - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); - } - - g_IECClear.ColumnType = clistIcon; - onExtraImageListRebuild(0,0); - - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - while (hContact) - { - onExtraImageApplying((WPARAM)hContact,0); - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); - } - - //Store options values to DB - DBWriteContactSettingByte(NULL, MODULENAME, "AdvancedIcon", clistIcon); - DBWriteContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", bUseAuthIcon); - DBWriteContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", bUseGrantIcon); - DBWriteContactSettingByte(NULL, MODULENAME, "MenuItem", bContactMenuItem); - DBWriteContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", bIconsForRecentContacts); - } - return TRUE; - } - } - - case WM_DESTROY: - break; - - } - return FALSE; -} - -int onOptInitialise(WPARAM wParam, LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp; - - ZeroMemory(&odp, sizeof(odp)); - odp.cbSize = sizeof(odp); - odp.position = 0; - odp.hInstance = g_hInst; - odp.ptszGroup = _T("Contact List"); - odp.pszTemplate = MAKEINTRESOURCEA(IDD_AUTHSTATE_OPT); - odp.ptszTitle = _T("Auth State"); - odp.pfnDlgProc = DlgProcOptions; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; - CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) &odp); - - return 0; -} diff --git a/authstate/resource.h b/authstate/resource.h deleted file mode 100644 index 49c8f2f..0000000 --- a/authstate/resource.h +++ /dev/null @@ -1,25 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by authstate.rc -// -#define IDI_AUTH 101 -#define IDI_GRANT 102 -#define IDI_AUTHGRANT 103 -#define IDD_AUTHSTATE_OPT 103 -#define IDC_ADVICON 1001 -#define IDC_AUTHICON 1002 -#define IDC_GRANTICON 1003 -#define IDC_ENABLEMENUITEM 1005 -#define IDC_ICONSFORRECENT 1006 -#define IDC_NOTICE 1009 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 104 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1010 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/authstate/version.h b/authstate/version.h deleted file mode 100644 index 7894532..0000000 --- a/authstate/version.h +++ /dev/null @@ -1,28 +0,0 @@ -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 0 -#define __RELEASE_NUM 2 -#define __BUILD_NUM 0 - -#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM -#define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM - -#define __STRINGIFY_IMPL(x) #x -#define __STRINGIFY(x) __STRINGIFY_IMPL(x) -#define __VERSION_STRING __STRINGIFY(__FILEVERSION_DOTS) - -#ifdef _UNICODE -#if defined(WIN64) || defined(_WIN64) - #define __PLUGIN_NAME "Authorization State (Unicode x64)" -#else - #define __PLUGIN_NAME "Authorization State (Unicode)" -#endif -#else - #define __PLUGIN_NAME "Authorization State" -#endif -#define __INTERNAL_NAME "AuthState" -#define __FILENAME "AuthState.dll" -#define __DESCRIPTION "If contact didn't authorized you this plugin puts an icon in front of contacts name." -#define __AUTHOR "Thief, idea by snwbrdr" -#define __AUTHOREMAIL "thief@miranda.im" -#define __AUTHORWEB "http://thief.miranda.im/" -#define __COPYRIGHT " 2006-2010 Alexander Turyak" diff --git a/authstate/version.rc b/authstate/version.rc deleted file mode 100644 index 2b1aaa9..0000000 --- a/authstate/version.rc +++ /dev/null @@ -1,40 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "afxres.h" -#include "version.h" - -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#endif //_WIN32 - -VS_VERSION_INFO VERSIONINFO - FILEVERSION __FILEVERSION_STRING - PRODUCTVERSION __FILEVERSION_STRING - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x0L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "FileDescription", __DESCRIPTION - VALUE "FileVersion", __FILEVERSION_DOTS - VALUE "InternalName", __PLUGIN_NAME - VALUE "LegalCopyright", __COPYRIGHT - VALUE "OriginalFilename", __FILENAME - VALUE "ProductName", __PLUGIN_NAME - VALUE "ProductVersion", __FILEVERSION_DOTS - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END diff --git a/bancontrol/BETA b/bancontrol/BETA deleted file mode 100644 index 2643c8e..0000000 --- a/bancontrol/BETA +++ /dev/null @@ -1 +0,0 @@ -BanControl_v.0.0.1.0 \ No newline at end of file diff --git a/bancontrol/CHANGELOG.txt b/bancontrol/CHANGELOG.txt deleted file mode 100644 index 3e86a46..0000000 --- a/bancontrol/CHANGELOG.txt +++ /dev/null @@ -1,30 +0,0 @@ -/////////////////////////////////////////////////////////////////// -// Ban Control plugin for Miranda. Bans a contact for a specific time -// http://trac/BanControl/ -// Copyright (C) 2007 A. Chilaru (FlexLabs Inc. ) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -/////////////////////////////////////////////////////////////////// - - [*] Feature/code/some other change - [!] Bugfix - [+] New feature - [-] Feature remove - [c] Comment - -0.1.0.0: 2007-01-10 - --- Skeleton upload - -Copyright (C) 2006 A. Chilaru (FlexLabs Inc. ) \ No newline at end of file diff --git a/bancontrol/LICENSE.txt b/bancontrol/LICENSE.txt deleted file mode 100644 index d511905..0000000 --- a/bancontrol/LICENSE.txt +++ /dev/null @@ -1,339 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Lesser General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License along - with this program; if not, write to the Free Software Foundation, Inc., - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. diff --git a/bancontrol/README.txt b/bancontrol/README.txt deleted file mode 100644 index 9a9a14a..0000000 --- a/bancontrol/README.txt +++ /dev/null @@ -1,68 +0,0 @@ -/////////////////////////////////////////////////////////////////// -// Ban Control plugin for Miranda. Bans a contact for a specific time -// http://trac/BanControl/ -// Copyright (C) 2007 A. Chilaru (FlexLabs Inc. ) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -/////////////////////////////////////////////////////////////////// - -1. About --------- -The Ban Control plugin allows you to ban (ignore) a certain contact for some time. Options like saving history etc coming soon. - -2. Features ------------ - - Banning a contact - -4. Todo -------- - Lots of stuff - -5. History ----------- - See CHANGELOG.txt - -6. Known issues ---------------- - None known - -7. Latest development version: ------------------------------- - You can download the latest developement version from here: - http://trac/BanControl/trunk/bin/ - Alternatively, you can download the latest source code on the project homepage: - http://trac/BanControl/browser - -8. Bugs -------- - - Before sending reports check if bugs are still present in the latest developement version - - and that such a bug hasn't been submitted earlier: - http://trac/BanControl/report/3 - - [English or Russian] You can send bug reports on the project homepage: - http://trac/BanControl/newticket - -9. Discussion & Feature Requests --------------------------------- - - Request features, discuss plugin at Miranda IM forum thread page: - http://forums.miranda-im.org/showthread.php?p= - - Or you can e-mail me them.. - - Feature requests can also be submitted ot the project homepage: - http://trac/BanControl/newticket - -10. Localisation --------------------------------- -Coming soon - -Copyright (C) 2006 A. Chilaru (FlexLabs Inc. ) \ No newline at end of file diff --git a/bancontrol/TRANSLATION.txt b/bancontrol/TRANSLATION.txt deleted file mode 100644 index e18fe15..0000000 --- a/bancontrol/TRANSLATION.txt +++ /dev/null @@ -1,21 +0,0 @@ -/////////////////////////////////////////////////////////////////// -// Ban Control plugin for Miranda. Bans a contact for a specific time -// http://trac/BanControl/ -// Copyright (C) 2007 A. Chilaru (FlexLabs Inc. ) -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -/////////////////////////////////////////////////////////////////// - -This is a list of all the text lines that can be translated. I've already given them a value, so that you can see how to use them, if you don't know. Add these lines to your langpack file, and restart miranda to apply these settings. diff --git a/bancontrol/common.arg b/bancontrol/common.arg deleted file mode 100644 index c32339f..0000000 --- a/bancontrol/common.arg +++ /dev/null @@ -1,63 +0,0 @@ - - STDFUNC _SetAllChildIcons@16 - "hCList" HWND - "hFirstItem" HANDLE - "iColumn" INT - "iImage" INT - END - - STDFUNC _SetListGroupIcons@16 - "hCList" HWND - "hFirstItem" HANDLE - "hParentItem" HMODULE - "groupChildCount" INT - END - - STDFUNC _SetAllContactIcons@4 - "hCList" HWND - END - - STDFUNC _ResetListOptions@4 - "hCList" HWND - END - - STDFUNC _MetaConClick@12 - "hContact" HWND - "iCount" INT - "iValue" INT - END - - STDFUNC _MetaSubClick@4 - "hParent" HWND - END - - STDFUNC _CallService@12 - "lpServiceName" ASCII - "wParam" HEX - "lParam" PTR - END - - STDFUNC _ServiceExists@4 - "lpServiceName" ASCII - END - - STDFUNC _HookEvent@8 - "lpHookNam" ASCII - "lpFunction" PTR - END - - STDFUNC _UnhookEvent@4 - "HookHandle" HANDLE - END - - STDFUNC _Translate@4 - "lpStr" ASCII - END - - STDFUNC _Error@4 - "lpStr" ASCII - END - - STDFUNC _IgnoreCheck@12 - "pStri" ASCII - END diff --git a/bancontrol/inc/IcoLib.inc b/bancontrol/inc/IcoLib.inc deleted file mode 100644 index 022dfb6..0000000 --- a/bancontrol/inc/IcoLib.inc +++ /dev/null @@ -1,51 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -SKINICONDESC struct - cbSize dd ? - pszSection dd ?;section name used to group icons - pszDescription dd ?;description for options dialog - pszName dd ?;name to refer to icon when playing and in db - ;this name is miranda-wide. so use prefixes of your plugin - ;e.g: "isee_connect", "clist_delete", etc - pszDefaultFile dd ?;default icon file to use - iDefaultIndex dd ? -SKINICONDESC ends - -SKINICONDESC2 struct - cbSize dd ? - pszSection dd ?;section name used to group icons - pszDescription dd ?;description for options dialog - pszName dd ?;name to refer to icon when playing and in db - pszDefaultFile dd ? - iDefaultIndex dd ? - hDefaultIcon dd ? -SKINICONDESC2 ends - -; -; Add a icon into options UI -; -; wParam = (WPARAM)0 -; lParam = (LPARAM)(SKINICONDESC*)sid; -; -;MS_SKIN2_ADDICON db "Skin2/Icons/AddIcon",0 -; -; Retrieve HICON with name specified in lParam -; Returned HICON SHOULDN'T be destroyed, it managed by IcoLib -; -;MS_SKIN2_GETICON "Skin2/Icons/GetIcon",0 -; -; Icons change notification -; -;ME_SKIN2_ICONSCHANGED "Skin2/IconsChanged",0 \ No newline at end of file diff --git a/bancontrol/inc/m_clc.inc b/bancontrol/inc/m_clc.inc deleted file mode 100644 index 12c13ee..0000000 --- a/bancontrol/inc/m_clc.inc +++ /dev/null @@ -1,203 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -CLS_MANUALUPDATE equ 0001h ;todo -CLS_SHOWHIDDEN equ 0002h -CLS_HIDEOFFLINE equ 0004h ;hides all offline users -CLS_CHECKBOXES equ 0008h -CLS_MULTICOLUMN equ 0010h ;not true multi-column, just for ignore/vis options -CLS_HIDEEMPTYGROUPS equ 0020h ;note: this flag will be spontaneously removed if the 'new subgroup' menu item is clicked, for obvious reasons -CLS_USEGROUPS equ 0040h -CLS_NOHIDEOFFLINE equ 0080h ;overrides CLS_HIDEOFFLINE and the per-group hideoffline setting -CLS_GREYALTERNATE equ 0100h ;make every other line slightly grey -CLS_GROUPCHECKBOXES equ 0200h ;put checkboxes on groups too (managed by CLC) -CLS_CONTACTLIST equ 0400h ;this control will be the main contact list (v. 0.3.4.3+ 2004/11/02) - -CLS_EX_DISABLEDRAGDROP equ 00000001h -CLS_EX_EDITLABELS equ 00000002h -CLS_EX_SHOWSELALWAYS equ 00000004h -CLS_EX_TRACKSELECT equ 00000008h -CLS_EX_SHOWGROUPCOUNTS equ 00000010h -CLS_EX_DIVIDERONOFF equ 00000020h -CLS_EX_HIDECOUNTSWHENEMPTY equ 00000040h -CLS_EX_NOTRANSLUCENTSEL equ 00000080h -CLS_EX_LINEWITHGROUPS equ 00000100h -CLS_EX_QUICKSEARCHVISONLY equ 00000200h -CLS_EX_SORTGROUPSALPHA equ 00000400h -CLS_EX_NOSMOOTHSCROLLING equ 00000800h - - -CLM_FIRST equ 1000h ;this is the same as LVM_FIRST -CLM_LAST equ 1100h - -;messages, compare with equivalent TVM_s in the MSDN -CLM_ADDCONTACT equ (CLM_FIRST+0) ;wParam=hContact -CLM_ADDGROUP equ (CLM_FIRST+1) ;wParam=hGroup -CLM_AUTOREBUILD equ (CLM_FIRST+2) -CLM_DELETEITEM equ (CLM_FIRST+3) ;wParam=hItem -CLM_EDITLABEL equ (CLM_FIRST+4) ;wParam=hItem -CLM_ENDEDITLABELNOW equ (CLM_FIRST+5) ;wParam=cancel, 0 to save -CLM_ENSUREVISIBLE equ (CLM_FIRST+6) ;wParam=hItem, lParam=partialOk -CLE_TOGGLE equ -1 -CLE_COLLAPSE equ 0 -CLE_EXPAND equ 1 -CLE_INVALID equ FFFFh -CLM_EXPAND equ (CLM_FIRST+7) ;wParam=hItem, lParam=CLE_ -CLM_FINDCONTACT equ (CLM_FIRST+8) ;wParam=hContact, returns an hItem -CLM_FINDGROUP equ (CLM_FIRST+9) ;wParam=hGroup, returns an hItem -CLM_GETBKCOLOR equ (CLM_FIRST+10) ;returns a COLORREF -CLM_GETCHECKMARK equ (CLM_FIRST+11) ;wParam=hItem, returns 1 or 0 -CLM_GETCOUNT equ (CLM_FIRST+12) ;returns the total number of items -CLM_GETEDITCONTROL equ (CLM_FIRST+13) ;returns the HWND, or NULL -CLM_GETEXPAND equ (CLM_FIRST+14) ;wParam=hItem, returns a CLE_, CLE_INVALID if not a group -CLM_GETEXTRACOLUMNS equ (CLM_FIRST+15) ;returns number of extra columns -CLM_GETEXTRAIMAGE equ (CLM_FIRST+16) ;wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),0), returns iImage or 0xFF -CLM_GETEXTRAIMAGELIST equ (CLM_FIRST+17) ;returns HIMAGELIST -CLM_GETFONT equ (CLM_FIRST+18) ;wParam=fontId, see clm_setfont. returns hFont. -CLM_GETINDENT equ (CLM_FIRST+19) ;wParam=new group indent -CLM_GETISEARCHSTRING equ (CLM_FIRST+20) ;lParam=(char*)pszStr, max 120 bytes, returns number of chars in string -CLM_GETITEMTEXT equ (CLM_FIRST+21) ;wParam=hItem, lParam=(char*)pszStr, max 120 bytes -CLM_GETSCROLLTIME equ (CLM_FIRST+22) ;returns time in ms -CLM_GETSELECTION equ (CLM_FIRST+23) ;returns hItem -CLCHT_ABOVE equ 0001h ;above client area -CLCHT_BELOW equ 0002h ;below client area -CLCHT_TOLEFT equ 0004h ;left of client area -CLCHT_TORIGHT equ 0008h ;right of client area -CLCHT_NOWHERE equ 0010h ;in client area, not on an item -CLCHT_ONITEMICON equ 0020h -CLCHT_ONITEMCHECK equ 0040h -CLCHT_ONITEMLABEL equ 0080h -CLCHT_ONITEMINDENT equ 0100h ;to the left of an item icon -CLCHT_ONITEMEXTRA equ 0200h ;on an extra icon, HIBYTE(HIWORD()) says which -CLCHT_ONITEM equ 03E0h -CLCHT_INLEFTMARGIN equ 0400h -CLCHT_BELOWITEMS equ 0800h ;in client area but below last item -CLM_HITTEST equ (CLM_FIRST+25) ;lParam=MAKELPARAM(x,y) (relative to control), wParam=(PDWORD)&hitTest (see encoding of HitTest() in clc.h, can be NULL) returns hItem or NULL -CLM_SELECTITEM equ (CLM_FIRST+26) ;wParam=hItem -CLB_TOPLEFT equ 0 -CLB_STRETCHV equ 1 -CLB_STRETCHH equ 2 ;and tile vertically -CLB_STRETCH equ 3 -CLBM_TYPE equ 00FFh -CLBF_TILEH equ 1000h -CLBF_TILEV equ 2000h -CLBF_PROPORTIONAL equ 4000h -CLBF_SCROLL equ 8000h -CLM_SETBKBITMAP equ (CLM_FIRST+27) ;wParam=mode, lParam=hBitmap (don't delete it), NULL for none -CLM_SETBKCOLOR equ (CLM_FIRST+28) ;wParam=a COLORREF, default is GetSysColor(COLOR_3DFACE) -CLM_SETCHECKMARK equ (CLM_FIRST+29) ;wParam=hItem, lParam=1 or 0 -CLM_SETEXTRACOLUMNS equ (CLM_FIRST+30) ;wParam=number of extra columns (zero to MAXEXTRACOLUMNS from clc.h, currently 16) -CLM_SETEXTRAIMAGE equ (CLM_FIRST+31) ;wParam=hItem, lParam=MAKELPARAM(iColumn (0 based),iImage). iImage=0xFF is a blank -CLM_SETEXTRAIMAGELIST equ (CLM_FIRST+32) ;lParam=HIMAGELIST - -FONTID_CONTACTS equ 0 -FONTID_INVIS equ 1 -FONTID_OFFLINE equ 2 -FONTID_NOTONLIST equ 3 -FONTID_GROUPS equ 4 -FONTID_GROUPCOUNTS equ 5 -FONTID_DIVIDER equ 6 -FONTID_OFFINVIS equ 7 -FONTID_STATUSMSG equ 8 -FONTID_GROUPSCLOSED equ 9 -FONTID_CONTACTSHOVER equ 10 -FONTID_MAX equ 18 - -CLM_SETFONT equ (CLM_FIRST+33) ;wParam=hFont, lParam=MAKELPARAM(fRedraw,fontId) -CLM_SETINDENT equ (CLM_FIRST+34) ;wParam=new indent, default is 3 pixels -CLM_SETITEMTEXT equ (CLM_FIRST+35) ;wParam=hItem, lParam=(char*)pszNewText -CLM_SETSCROLLTIME equ (CLM_FIRST+36) ;wParam=time in ms, default 200 - -CLM_SETHIDEEMPTYGROUPS equ (CLM_FIRST+38) ;wParam=TRUE/FALSE -GREYF_UNFOCUS equ 80000000h -MODEF_OFFLINE equ 40000000h - -;and use the PF2_ #defines from m_protosvc.h -CLM_SETGREYOUTFLAGS equ (CLM_FIRST+39) ;wParam=new flags -CLM_GETHIDEOFFLINEROOT equ (CLM_FIRST+40) ;returns TRUE/FALSE -CLM_SETHIDEOFFLINEROOT equ (CLM_FIRST+41) ;wParam=TRUE/FALSE -CLM_SETUSEGROUPS equ (CLM_FIRST+42) ;wParam=TRUE/FALSE -CLM_SETOFFLINEMODES equ (CLM_FIRST+43) ;for 'hide offline', wParam=PF2_ flags and MODEF_OFFLINE -CLM_GETEXSTYLE equ (CLM_FIRST+44) ;returns CLS_EX_ flags -CLM_SETEXSTYLE equ (CLM_FIRST+45) ;wParam=CLS_EX_ flags -CLM_GETLEFTMARGIN equ (CLM_FIRST+46) ;returns count of pixels -CLM_SETLEFTMARGIN equ (CLM_FIRST+47) ;wParam=pixels - -CLCINFOITEM struct - cbSize dd ? - pszText dd ? - hParentGroup dd ? - flags dd ? - hIcon dd ? -CLCINFOITEM ends - -CLCIIF_BELOWGROUPS equ 1 ;put it between groups and contacts, default is at top -CLCIIF_BELOWCONTACTS equ 2 ;put it at the bottom -CLCIIF_CHECKBOX equ 40h ;give this item a check box -CLCIIF_GROUPFONT equ 80h ;draw the item using FONTID_GROUPS - -CLM_ADDINFOITEMA equ (CLM_FIRST+48) ;lParam=&cii, returns hItem -CLM_ADDINFOITEMW equ (CLM_FIRST+53) ;lParam=&cii, returns hItem -IFDEF _UNICODE - CLM_ADDINFOITEM equ CLM_ADDINFOITEMW -ELSE - CLM_ADDINFOITEM equ CLM_ADDINFOITEMA -ENDIF - -CLCIT_INVALID equ -1 -CLCIT_GROUP equ 0 -CLCIT_CONTACT equ 1 -CLCIT_DIVIDER equ 2 -CLCIT_INFO equ 3 -CLM_GETITEMTYPE equ (CLM_FIRST+49) ;wParam=hItem, returns a CLCIT_ -CLGN_ROOT equ 0 -CLGN_CHILD equ 1 -CLGN_PARENT equ 2 -CLGN_NEXT equ 3 -CLGN_PREVIOUS equ 4 -CLGN_NEXTCONTACT equ 5 -CLGN_PREVIOUSCONTACT equ 6 -CLGN_NEXTGROUP equ 7 -CLGN_PREVIOUSGROUP equ 8 -CLM_GETNEXTITEM equ (CLM_FIRST+50) ;wParam=flag, lParam=hItem, returns an hItem -CLM_GETTEXTCOLOR equ (CLM_FIRST+51) ;wParam=FONTID_, returns COLORREF -CLM_SETTEXTCOLOR equ (CLM_FIRST+52) ;wParam=FONTID_, lParam=COLORREF - -;notifications (most are omitted because the control processes everything) -CLNF_ISGROUP equ 1 -CLNF_ISINFO equ 2 - -NMCLISTCONTROL struct - hdr NMHDR <> - hItem dd ? - action dd ? - iColumn dd ? ;-1 if not on an extra column - flags dd ? - pt POINT <> -NMCLISTCONTROL ends - -CLN_FIRST equ (0-100) -CLN_EXPANDED equ (CLN_FIRST-0) ;hItem=hGroup, action=CLE_* -CLN_LISTREBUILT equ (CLN_FIRST-1) -CLN_ITEMCHECKED equ (CLN_FIRST-2) ;todo //hItem,action,flags valid -CLN_DRAGGING equ (CLN_FIRST-3) ;hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed -CLN_DROPPED equ (CLN_FIRST-4) ;hItem,pt,flags valid. only sent when cursor outside window, return nonzero if processed -CLN_LISTSIZECHANGE equ (CLN_FIRST-5) ;pt.y valid. the vertical height of the visible items in the list has changed. -CLN_OPTIONSCHANGED equ (CLN_FIRST-6) ;nothing valid. If you set some extended options they have been overwritten and should be re-set -CLN_DRAGSTOP equ (CLN_FIRST-7) ;hItem,flags valid. sent when cursor goes back in to the window having been outside, return nonzero if processed -CLN_NEWCONTACT equ (CLN_FIRST-8) ;hItem,flags valid. sent when a new contact is added without a full list rebuild -CLN_CONTACTMOVED equ (CLN_FIRST-9) ;hItem,flags valid. sent when contact is moved without a full list rebuild -CLN_CHECKCHANGED equ (CLN_FIRST-10) ;hItem,flags valid. sent when any check mark is changed, but only for one change if there are many -;NM_CLICK //hItem,iColumn,pt,flags valid -;NM_KEYDOWN //NMKEY structure, only sent when key is not already processed, return nonzero to prevent further processing \ No newline at end of file diff --git a/bancontrol/inc/m_clist.inc b/bancontrol/inc/m_clist.inc deleted file mode 100644 index e277e99..0000000 --- a/bancontrol/inc/m_clist.inc +++ /dev/null @@ -1,33 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -CLISTMENUITEM struc - cbSize dd ? - UNION NONUNIQUE - pszName dd ? - ptszName dd ? - ENDS - flags dd ? - position dd ? - hIcon HICON ? - pszService dd ? - ;UNION NONUNIQUE - pszPopupName dd ? - ; ptszPopupName dd ? - ; ENDS - popupPosition dd ? - hotKey dd ? - pszContactOwner dd ? -CLISTMENUITEM ends - diff --git a/bancontrol/inc/m_database.inc b/bancontrol/inc/m_database.inc deleted file mode 100644 index b5cd683..0000000 --- a/bancontrol/inc/m_database.inc +++ /dev/null @@ -1,60 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -DBCONTACTGETSETTING struct - szModule dd ? - szSetting dd ? - pValue dd ? -DBCONTACTGETSETTING ends - -DBCONTACTWRITESETTING struct - szModule dd ? - szSetting dd ? - VAR1 dd ? - VAR2 dd ? - VAR3 dd ? -DBCONTACTWRITESETTING ends - -DBVT_DELETED equ 0 ;this setting just got deleted, no other values are valid -DBVT_BYTE equ 1 ;bVal and cVal are valid -DBVT_WORD equ 2 ;wVal and sVal are valid -DBVT_DWORD equ 4 ;dVal and lVal are valid -DBVT_ASCIIZ equ 255 ;pszVal is valid -DBVT_BLOB equ 254 ;cpbVal and pbVal are valid -DBVT_UTF8 equ 253 ;pszVal is valid -DBVT_WCHAR equ 252 ;pszVal is valid -DBVTF_VARIABLELENGTH equ 80h - -DBVARIANT struct - VAR1 dd ? - VAR2 dd ? - VAR3 dd ? -DBVARIANT ends - -DBEVENTINFO struct - cbSize dd ? - szModule dd ? - timestamp dd ? - flags dd ? - eventType dd ? - cbBlob dd ? - pBlob dd ? -DBEVENTINFO ends - -EVENTTYPE_MESSAGE equ 0 -EVENTTYPE_URL equ 1 -EVENTTYPE_CONTACTS equ 2 ;v0.1.2.2+ -EVENTTYPE_ADDED equ 1000 ;v0.1.1.0+: these used to be module- -EVENTTYPE_AUTHREQUEST equ 1001 ;specific codes, hence the module- -EVENTTYPE_FILE equ 1002 ;specific limit has been raised to 2000 \ No newline at end of file diff --git a/bancontrol/inc/m_langpack.inc b/bancontrol/inc/m_langpack.inc deleted file mode 100644 index ffe77f5..0000000 --- a/bancontrol/inc/m_langpack.inc +++ /dev/null @@ -1,30 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -IFDEF _UNICODE - LANG_UNICODE equ 1000h -ELSE - LANG_UNICODE equ 0 -ENDIF - -LANGPACKTRANSLATEDIALOG struct - cbSize dd ? - flags dd ? - hwndDlg dd ? - ignoreControls dd ? -LANGPACKTRANSLATEDIALOG ends - -LPTDF_NOIGNOREEDIT equ 1 ;translate all edit controls. By default - ;non-read-only edit controls are not translated -LPTDF_NOTITLE equ 2 ;do not translate the title of the dialog diff --git a/bancontrol/inc/m_metacontacts.inc b/bancontrol/inc/m_metacontacts.inc deleted file mode 100644 index 3294ff2..0000000 --- a/bancontrol/inc/m_metacontacts.inc +++ /dev/null @@ -1,149 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -;get the handle for a contact's parent metacontact -;wParam=(HANDLE)hSubContact -;lParam=0 -;returns a handle to the parent metacontact, or null if this contact is not a subcontact -;MS_MC_GETMETACONTACT "MetaContacts/GetMeta" - -;gets the handle for the default contact -;wParam=(HANDLE)hMetaContact -;lParam=0 -;returns a handle to the default contact, or null on failure -;MS_MC_GETDEFAULTCONTACT "MetaContacts/GetDefault" - -;gets the contact number for the default contact -;wParam=(HANDLE)hMetaContact -;lParam=0 -;returns a DWORD contact number, or -1 on failure -;MS_MC_GETDEFAULTCONTACTNUM "MetaContacts/GetDefaultNum" - -;gets the handle for the 'most online' contact -;wParam=(HANDLE)hMetaContact -;lParam=0 -;returns a handle to the 'most online' contact -;MS_MC_GETMOSTONLINECONTACT "MetaContacts/GetMostOnline" - -;gets the number of subcontacts for a metacontact -;wParam=(HANDLE)hMetaContact -;lParam=0 -;returns a DWORD representing the number of subcontacts for the given metacontact -;MS_MC_GETNUMCONTACTS "MetaContacts/GetNumContacts" - -;gets the handle of a subcontact, using the subcontact's number -;wParam=(HANDLE)hMetaContact -;lParam=(DWORD)contact number -;returns a handle to the specified subcontact -;MS_MC_GETSUBCONTACT "MetaContacts/GetSubContact" - -;sets the default contact, using the subcontact's contact number -;wParam=(HANDLE)hMetaContact -;lParam=(DWORD)contact number -;returns 0 on success -;MS_MC_SETDEFAULTCONTACTNUM "MetaContacts/SetDefault" - -;sets the default contact, using the subcontact's handle -;wParam=(HANDLE)hMetaContact -;lParam=(HANDLE)hSubcontact -;returns 0 on success -;MS_MC_SETDEFAULTCONTACT "MetaContacts/SetDefaultByHandle" - -;forces the metacontact to send using a specific subcontact, using the subcontact's contact number -;wParam=(HANDLE)hMetaContact -;lParam=(DWORD)contact number -;returns 0 on success -;MS_MC_FORCESENDCONTACTNUM "MetaContacts/ForceSendContact" - -;forces the metacontact to send using a specific subcontact, using the subcontact's handle -;wParam=(HANDLE)hMetaContact -;lParam=(HANDLE)hSubcontact -;returns 0 on success (will fail if 'force default' is in effect) -;MS_MC_FORCESENDCONTACT "MetaContacts/ForceSendContactByHandle" - -;'unforces' the metacontact to send using a specific subcontact -;wParam=(HANDLE)hMetaContact -;lParam=0 -;returns 0 on success (will fail if 'force default' is in effect) -;MS_MC_UNFORCESENDCONTACT "MetaContacts/UnforceSendContact" - -;'forces' or 'unforces' (i.e. toggles) the metacontact to send using it's default contact -; overrides (and clears) 'force send' above, and will even force use of offline contacts -; will send ME_MC_FORCESEND or ME_MC_UNFORCESEND event -;wParam=(HANDLE)hMetaContact -;lParam=0 -;returns 1(true) or 0(false) representing new state of 'force default' -;MS_MC_FORCEDEFAULT "MetaContacts/ForceSendDefault" - -; method to get state of 'force' for a metacontact -; wParam=(HANDLE)hMetaContact -; lParam= (DWORD)&contact_number or NULL -; -; if lparam supplied, the contact_number of the contatct 'in force' will be copied to the address it points to, -; or if none is in force, the value (DWORD)-1 will be copied -; (v0.8.0.8+ returns 1 if 'force default' is true with *lParam == default contact number, else returns 0 with *lParam as above) -;MS_MC_GETFORCESTATE "MetaContacts/GetForceState" - -; fired when a metacontact's default contact changes (fired upon creation of metacontact also, when default is initially set) -; wParam=(HANDLE)hMetaContact -; lParam=(HANDLE)hDefaultContact -;ME_MC_DEFAULTTCHANGED "MetaContacts/DefaultChanged" - -; fired when a metacontact's subcontacts change (fired upon creation of metacontact, when contacts are added or removed, and when -; contacts are reordered) - a signal to re-read metacontact data -; wParam=(HANDLE)hMetaContact -; lParam=0 -;ME_MC_SUBCONTACTSCHANGED "MetaContacts/SubcontactsChanged" - -; fired when a metacontact is forced to send using a specific subcontact -; wParam=(HANDLE)hMetaContact -; lParam=(HANDLE)hForceContact -;ME_MC_FORCESEND "MetaContacts/ForceSend" - -; fired when a metacontact is 'unforced' to send using a specific subcontact -; wParam=(HANDLE)hMetaContact -; lParam=0 -;ME_MC_UNFORCESEND "MetaContacts/UnforceSend" - -; method to get protocol name - used to be sure you're dealing with a "real" metacontacts plugin :) -; wParam=lParam=0 -;MS_MC_GETPROTOCOLNAME "MetaContacts/GetProtoName" - - -; added 0.9.5.0 (22/3/05) -; wParam=(HANDLE)hContact -; lParam=0 -; convert a given contact into a metacontact -;MS_MC_CONVERTTOMETA "MetaContacts/ConvertToMetacontact" - -; added 0.9.5.0 (22/3/05) -; wParam=(HANDLE)hContact -; lParam=(HANDLE)hMeta -; add an existing contact to a metacontact -;MS_MC_ADDTOMETA "MetaContacts/AddToMetacontact" - -; added 0.9.5.0 (22/3/05) -; wParam=0 -; lParam=(HANDLE)hContact -; remove a contact from a metacontact -;MS_MC_REMOVEFROMMETA "MetaContacts/RemoveFromMetacontact" - - -; added 0.9.13.2 (6/10/05) -; wParam=(BOOL)disable -; lParam=0 -; enable/disable the 'hidden group hack' - for clists that support subcontact hiding using 'IsSubcontact' setting -; should be called once in the clist 'onmodulesloaded' event handler (which, since it's loaded after the db, will be called -; before the metacontact onmodulesloaded handler where the subcontact hiding is usually done) -;MS_MC_DISABLEHIDDENGROUP "MetaContacts/DisableHiddenGroup" diff --git a/bancontrol/inc/m_options.inc b/bancontrol/inc/m_options.inc deleted file mode 100644 index cfbf539..0000000 --- a/bancontrol/inc/m_options.inc +++ /dev/null @@ -1,36 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -OPTIONSDIALOGPAGE struct - cbSize dd ? ;cbSize - position dd ? ;position - pszTitle dd ? ;*pszTitle - pfnDlgProc dd ? ;pfnDlgProc - pszTemplate dd ? ;*pszTemplate - hInstance dd ? ;hInstance - hIcon dd ? ;hIcon - pszGroup dd ? ;*pszGroup - groupPosition dd ? ;groupPosition - hGroupIcon dd ? ;hGroupIcon - flags dd ? ;flags - nIDBottomSimpleControl dd ? ;nIDBottomSimpleControl - nIDRightSimpleControl dd ? ;nIDRightSimpleControl - expertOnlyControls dd ? ;*expertOnlyControls - nExpertOnlyControls dd ? ;nExpertOnlyControls -OPTIONSDIALOGPAGE ends - -ODPF_SIMPLEONLY equ 1 ; page is only shown when in simple mode -ODPF_EXPERTONLY equ 2 ; " expert mode -ODPF_BOLDGROUPS equ 4 ; give group box titles a bold font -ODPF_UNICODE equ 8 ; string fields in OPTIONSDIALOGPAGE are WCHAR* diff --git a/bancontrol/inc/m_protocols.inc b/bancontrol/inc/m_protocols.inc deleted file mode 100644 index bbe3542..0000000 --- a/bancontrol/inc/m_protocols.inc +++ /dev/null @@ -1,14 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - diff --git a/bancontrol/inc/m_protosvc.inc b/bancontrol/inc/m_protosvc.inc deleted file mode 100644 index 15cbb10..0000000 --- a/bancontrol/inc/m_protosvc.inc +++ /dev/null @@ -1,18 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -PFLAGNUM_1 equ 1 -PF1_IMSEND equ 00000001h ;supports IM sending -PF1_IMRECV equ 00000002h ;supports IM receiving -PF1_IM equ (PF1_IMSEND or PF1_IMRECV) \ No newline at end of file diff --git a/bancontrol/inc/m_updater.inc b/bancontrol/inc/m_updater.inc deleted file mode 100644 index a10d992..0000000 --- a/bancontrol/inc/m_updater.inc +++ /dev/null @@ -1,29 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -UPDATE struct - cbSize dd ? - szComponentName dd ? - szVersionURL dd ? - pbVersionPrefix dd ? - cpbVersionPrefix dd ? - szUpdateURL dd ? - szBetaVersionURL dd ? - pbBetaVersionPrefix dd ? - cpbBetaVersionPrefix dd ? - szBetaUpdateURL dd ? - pbVersion dd ? - cpbVersion dd ? - szBetaChangelogURL dd ? -UPDATE ends \ No newline at end of file diff --git a/bancontrol/inc/newpluginapi.inc b/bancontrol/inc/newpluginapi.inc deleted file mode 100644 index 398d4cd..0000000 --- a/bancontrol/inc/newpluginapi.inc +++ /dev/null @@ -1,44 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -PLUGININFO struc - cbSize dd ? - shortName dd ? - version dd ? - description dd ? - author dd ? - authorEmail dd ? - copyright dd ? - homepage dd ? - isTransient dd ? - replacesDefaultModule dd ? -PLUGININFO ends - -PLUGINLINK struc - lpCreateHookableEvent dd ? ;(const char *); - lpDestroyHookableEvent dd ? ;(HANDLE); - lpNotifyEventHooks dd ? ;(HANDLE,WPARAM,LPARAM); - lpHookEvent dd ? ;(const char *,MIRANDAHOOK); - lpHookEventMessage dd ? ;(const char *,HWND,UINT); - lpUnhookEvent dd ? ;(HANDLE); - lpCreateServiceFunction dd ? ;(const char *,MIRANDASERVICE) - lpCreateTransientServiceFunction dd ? ;(const char *,MIRANDASERVICE) - lpDestroyServiceFunction dd ? ;(HANDLE) - lpCallService dd ? ;(const char *,WPARAM,LPARAM) - lpServiceExists dd ? ;(const char *); //v0.1.0.1+ - lpCallServiceSync dd ? ;(const char *,WPARAM,LPARAM); //v0.3.3+ - lpCallFunctionAsync dd ? ;(void (__stdcall *)(void *), void *); //v0.3.4+ - lpSetHookDefaultForHookableEvent dd ? ;(HANDLE, MIRANDAHOOK); // v0.3.4 (2004/09/15) -PLUGINLINK ends - diff --git a/bancontrol/inc/statusmodes.inc b/bancontrol/inc/statusmodes.inc deleted file mode 100644 index 609084e..0000000 --- a/bancontrol/inc/statusmodes.inc +++ /dev/null @@ -1,26 +0,0 @@ -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -MAX_CONNECT_RETRIES equ 10000 -ID_STATUS_OFFLINE equ 40071 -ID_STATUS_ONLINE equ 40072 -ID_STATUS_AWAY equ 40073 -ID_STATUS_DND equ 40074 -ID_STATUS_NA equ 40075 -ID_STATUS_OCCUPIED equ 40076 -ID_STATUS_FREECHAT equ 40077 -ID_STATUS_INVISIBLE equ 40078 -ID_STATUS_ONTHEPHONE equ 40079 -ID_STATUS_OUTTOLUNCH equ 40080 -ID_STATUS_IDLE equ 40081 ;do not use as a status \ No newline at end of file diff --git a/bancontrol/plugin/BanControl.asm b/bancontrol/plugin/BanControl.asm deleted file mode 100644 index b8e7e8d..0000000 --- a/bancontrol/plugin/BanControl.asm +++ /dev/null @@ -1,1160 +0,0 @@ -;Ban Control plugin for Miranda. Bans a contact for a specific time -;Copyright (C) 2007 A. Chilaru -; -;This program is free software; you can redistribute it and/or -;modify it under the terms of the GNU General Public License -;as published by the Free Software Foundation; either version 2 -;of the License, or (at your option) any later version. -; -;This program is distributed in the hope that it will be useful, -;but WITHOUT ANY WARRANTY; without even the implied warranty of -;MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -;GNU General Public License for more details. -; -;You should have received a copy of the GNU General Public License -;along with this program; if not, write to the Free Software -;Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - -.386 -.model flat,stdcall -option casemap:none -include \masm32\include\windows.inc -include \masm32\include\kernel32.inc -include \masm32\include\user32.inc -include \masm32\include\comctl32.inc -include \masm32\include\gdi32.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\IcoLib.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_clist.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_clc.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_database.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_langpack.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_options.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_protocols.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_protosvc.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\m_updater.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\newpluginapi.inc -include \masm32\FlexLabs\BanControl\Source\trunk\inc\statusmodes.inc - -includelib \masm32\lib\kernel32.lib -includelib \masm32\lib\user32.lib -includelib \masm32\lib\comctl32.lib -includelib \masm32\lib\gdi32.lib - - ;function definitions for debuggers - ;hook functions are C-style functions. The rest are stdcall -OptInit proto C wParam:DWORD, lParam:DWORD -Message proto C wParam:DWORD, lParam:DWORD -MdLoaded proto C wParam:DWORD, lParam:DWORD -IcoLibEv proto C wParam:DWORD, lParam: DWORD - -CallService proto lpServiceName:DWORD, wParam:DWORD, lParam:DWORD -ServiceExists proto lpServiceName:DWORD -HookEvent proto lpHookName:DWORD, lpFunction:DWORD -UnhookEvent proto HookHandle:DWORD - -Translate proto lpStr:DWORD -Error proto lpStr:DWORD -ResetListOptions proto hCList:DWORD -SetAllContactIcons proto hCList:DWORD -SetListGroupIcons proto hCList:DWORD, hFirstItem:DWORD, hParentItem:DWORD, groupChildCount:DWORD -SetAllChildIcons proto hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD -MetaConClick proto hContact:DWORD, iCount:DWORD, iValue: DWORD -MetaSubClick proto hContact:DWORD - -DLGHDR struct ;Structure to hold info about tabs - hDlg dd ? - hTab dd ? - hDisplay dd ? - rcDisplay RECT <> - hTab1 dd ? - hTab2 dd ? -DLGHDR ends - - ;Macro to create lParam DWORD from two WORDs (low WORDs used if DWORD given) -MAKELPARAM macro lowWord, highWord - push ebx - mov ebx, lowWord - mov eax, highWord - shl eax, 16 - mov ax, bx - pop ebx - ENDM - -.const - ;option controls -IDC_ENABLED equ 40071 ;Plugin enables checkbox ID -IDC_PROTO equ 40081 ;Protocol listbox ID -IDC_STARTTIME equ 40088 ;time selector -IDC_ENDTIME equ 40089 ;time selector -IDC_SHOWHIDDEN equ 50071 ;Show hidden contacts - -IDC_CLIST equ 3000 ;CList component - -IDI_BAN equ 101 ;PC icon - - ;const from miranda resource file (small dot in CListControl) -IDI_SMALLDOT equ 211 - - ;const from skin header -SKINICON_EVENT_MESSAGE equ 100 - -WM_IMGLIST equ WM_USER+273 - -.data -hInstance dd 0 ;Plugin hWnd -hApp dd 0 ;Miranda .exe hWnd -hDlgWnd dd 0 ;Option dialog hWnd -hIcoLibEv dd 0 ;IcoLib dialog hWnd -hIml dd 0 ;Image list -hItemAll dd 0 ;CListControl "Group" ** All contacts **" -hItemUnk dd 0 ;CListControl "Group" ** Unknown contacts **" - -ddRetAddr dd 0 ;Miranda proto ret. address -ddRetStack dd 0 ;Miranda proto EBP backup - -hMsgHook dd 0 ;Message hook hWnd -hOptHook dd 0 ;Options hook hWnd -hMdLHook dd 0 ;Modules loaded hook - -ddVar1 dd 0 -ddVar2 dd 0 ;Just three DWORD variables ;) -ddVar3 dd 0 -ddInt dd 0 -ddFlags dd 0 ;Various flags. Descriptions (starting from the lower bit) - ;Reserved - ;OptEditing2 On while options are loaded from the DB - ;OptEditing2 On while options are loaded from the DB - ;noUniConvert Don't convert to Unicode while translating - -sPluginInfo PLUGININFO <0> ;plugin info structure -sPluginLink PLUGINLINK <> ;miranda procedure adresses structure -sOptionsPage OPTIONSDIALOGPAGE <0> ;options struct -sDBVariant DBVARIANT <> ;DB write/get variable struct -sDBGetSetting DBCONTACTGETSETTING <> ;DB get struct -sDBWriteSetting DBCONTACTWRITESETTING <>;DB write struct -sDBEventInfo DBEVENTINFO <> ;Event ifnfo struct -sUpdate UPDATE <0> ;Updater struct -sTCITEM TCITEM <0> ;struct for tabbing -sDlgHdr DLGHDR <0> ;struct for tabbing -sSystemTime SYSTEMTIME <> ;datetime struct -sLngPackDialog LANGPACKTRANSLATEDIALOG <> ;langpack dialog struct -sClcInfoItem CLCINFOITEM <> ;contact list child item info -sSkinIconDesc SKINICONDESC <> ;IcoLib struct - - ;plugin details -szShortName db "Ban Control",0 -szShortNamev db "Ban Control " -IFDEF _UNICODE - szPlVer db "(Unicode)",0 -ELSE - szPlVer db "(ANSI)",0 -ENDIF -ddVersion dd 00000100h -szDescription db "The plugin allows banning users for a certain time.",10,13,"Allows saving history, exporting it or disabling and other options.",0 -szAuthor db "A. Chilaru",0 -szAthorEmail db "flexlabs@gmail.com",0 -szCopyright db " 2007 A. Chilaru (FlexLabs Inc.)",0 -szHomepage db "http://dev.mirandaim.ru/~flexer/",0 - - ;additional details for updater -IFDEF _UNICODE - szURL db "http://addons.miranda-im.org/",0 - szURLKey db "Ban Control (Unicode) ",0 - ddURLKeyLen dd 33h - szDnURL db "http://addons.miranda-im.org/",0 -ELSE - szURL db "http://addons.miranda-im.org/",0 - szURLKey db "Ban Control (ANSI) ",0 - ddURLKeyLen dd 30h - szDnURL db "http://addons.miranda-im.org/",0 -ENDIF -szBetaURL db "http://svn.mirandaim.ru/mainrepo/bancontrol/trunk/BETA",0 -szBetaURLKey db "BanControl_v.",0 -ddBetaURLKeyLen dd 0Dh -IFDEF _UNICODE - szBetaDnURL db "http://svn.mirandaim.ru/mainrepo/bancontrol/trunk/bin/BanControlW.dll",0 -ELSE - szBetaDnURL db "http://svn.mirandaim.ru/mainrepo/bancontrol/trunk/bin/BanControlA.dll",0 -ENDIF -szVersion db "0.0.1.0",0 -ddVersionLen dd 07h -ddBeta dd 1 ;If plugin is beta - 1. Else - 0 -szBetaChangelogURL db "http://svn.mirandaim.ru/mainrepo/bancontrol/trunk/CHANGELOG.txt",0 - - ;miranda functions -MS_DB_CONTACT_GETSETTING db "DB/Contact/GetSetting",0 -MS_DB_CONTACT_WRITESETTING db "DB/Contact/WriteSetting",0 -MS_DB_CONTACT_FINDFIRST db "DB/Contact/FindFirst",0 -MS_DB_CONTACT_FINDNEXT db "DB/Contact/FindNext",0 -MS_DB_EVENT_GET db "DB/Event/Get",0 -MS_DB_EVENT_GETBLOBSIZE db "DB/Event/GetBlobSize",0 -MS_DB_EVENT_GETCONTACT db "DB/Event/GetContact",0 -MS_PROTO_GETCONTACTBASEPROTO db "Proto/GetContactBaseProto",0 -MS_CLIST_ADDMAINMENUITEM db "CList/AddMainMenuItem",0 -MS_CLIST_GETSTATUSMODE db "CList/GetStatusMode",0 -MS_OPT_ADDPAGE db "Opt/AddPage",0 -MS_PROTO_ENUMPROTOCOLS db "Proto/EnumProtocols",0 -MS_MC_GETMETACONTACT db "MetaContacts/GetMeta",0 -MS_MC_GETSUBCONTACT db "MetaContacts/GetSubContact",0 -ME_SYSTEM_MODULESLOADED db "Miranda/System/ModulesLoaded",0 -MS_SKIN_LOADICON db "Skin/Icons/Load",0 -MS_SKIN2_ADDICON db "Skin2/Icons/AddIcon",0 -MS_SKIN2_GETICON db "Skin2/Icons/GetIcon",0 -MS_UPDATE_REGISTER db "Update/Register",0 -MS_LANGPACK_TRANSLATESTRING db "LangPack/TranslateString",0 -MS_LANGPACK_TRANSLATEDIALOG db "LangPack/TranslateDialog",0 - -PS_GETCAPS db "/GetCaps",0 ;Takes form of "PROTO/GetCaps",0 (GetCapabilities of a PROTO) - - ;miranda events -ME_DB_EVENT_ADDED db "DB/Event/Added",0 -ME_OPT_INITIALISE db "Opt/Initialise",0 -ME_SKIN2_ICONSCHANGED db "Skin2/IconsChanged",0 - - ;options -szOptGroup db "Events",0 -szOptGroupW db "Unicod",0 -szOptTitle db "Ban Control",0 -szOptTitleW db "UnicodeUnic",0 -szOModule db "BanControl",0 -szOFlags db "Flags",0 -szOTime db "Time",0 -szOEnabled db "Enabled",0 -szONotOnList db "NotOnList",0 -szOCList db "CList",0 -szOShowHidden db "ShowHidden",0 -szOMetaContacts db "MetaContacts",0 -szOMetaCount db "NumContacts",0 -szOMetaLink db "MetaLink",0 - - ;tab captions -szTab1 db "Options",0 -szTab1W db "Unicode",0 -szTab2 db "Contacts",0 -szTab2W db "UnicodeU",0 - - ;IcoLib -szIlDesc db "Enabled",0 -szIlName db "banc_icon",0 - - ;other strings -szDtFormat db "HH':'mm",0 -szError db "Default error message",0 -szAllContacts db "** All contacts **",0 -szAllContactsW db "UnicodeUnicodeUnic",0 -szUnkContacts db "** Unknown contacts **",0 -szUnkContactsW db "UnicodeUnicodeUnicodeU",0 - - ;option control info -IDC_ETYPE_MESSAGE dd 40082 -IDC_ETYPE_MESSAGE_V dd EVENTTYPE_MESSAGE -IDC_ETYPE_URL dd 40083 -IDC_ETYPE_URL_V dd EVENTTYPE_URL -IDC_ETYPE_CONTACTS dd 40084 -IDC_ETYPE_CONTACTS_V dd EVENTTYPE_CONTACTS -IDC_ETYPE_ADDED dd 40085 -IDC_ETYPE_ADDED_V dd EVENTTYPE_ADDED -IDC_ETYPE_AUTHREQUEST dd 40086 -IDC_ETYPE_AUTHREQUEST_V dd EVENTTYPE_AUTHREQUEST -IDC_ETYPE_FILE dd 40087 -IDC_ETYPE_FILE_V dd EVENTTYPE_FILE - -.data? - ;option control hWnd's -HC_CLIST dd ? -HC_ENABLED dd ? -HC_STATUS_ONLINE dd ? -HC_STATUS_AWAY dd ? -HC_STATUS_DND dd ? -HC_STATUS_NA dd ? -HC_STATUS_OCCUPIED dd ? -HC_STATUS_FREECHAT dd ? -HC_STATUS_INVISIBLE dd ? -HC_STATUS_ONTHEPHONE dd ? -HC_STATUS_OUTTOLUNCH dd ? -HC_PROTO dd ? -HC_ETYPE_MESSAGE dd ? -HC_ETYPE_URL dd ? -HC_ETYPE_CONTACTS dd ? -HC_ETYPE_ADDED dd ? -HC_ETYPE_AUTHREQUEST dd ? -HC_ETYPE_FILE dd ? -HC_STARTTIME dd ? -HC_ENDTIME dd ? - -HC_SHOWHIDDEN dd ? - - ;empty string space -szGeneral db 256 DUP(?) - -.code -DllMain proc hInst:HINSTANCE, reason:DWORD, reserved1:DWORD - push hInst - pop hInstance ;save hWnd of the library - invoke GetModuleHandle, NULL - mov hApp, eax ;save hWnd of Miranda - - mov sPluginInfo.cbSize, sizeof PLUGININFO ;set the library's info - mov sPluginInfo.shortName, offset szShortNamev - push ddVersion - pop sPluginInfo.version - mov sPluginInfo.description, offset szDescription - mov sPluginInfo.author, offset szAuthor - mov sPluginInfo.authorEmail, offset szAthorEmail - mov sPluginInfo.copyright, offset szCopyright - mov sPluginInfo.homepage, offset szHomepage - - mov eax, TRUE - ret -DllMain Endp - -MirandaPluginInfo proc - mov eax, offset sPluginInfo ;return plugin info struct - ret -MirandaPluginInfo Endp - - ;internal miranda functions. Not necessary, but allow viewing them in the debugger -CallService proc lpServiceName:DWORD, wParam:DWORD, lParam:DWORD - pop ddRetStack - pop ddRetAddr - call sPluginLink.lpCallService - push ddRetAddr - push ddRetStack - ret -CallService endp - -ServiceExists proc lpServiceName:DWORD - pop ddRetStack - pop ddRetAddr - call sPluginLink.lpServiceExists - push ddRetAddr - push ddRetStack - ret -ServiceExists endp - -HookEvent proc lpHookName:DWORD, lpFunction:DWORD - pop ddRetStack - pop ddRetAddr - call sPluginLink.lpHookEvent - push ddRetAddr - push ddRetStack - ret -HookEvent endp - -UnhookEvent proc HookHandle:DWORD - pop ddRetStack - pop ddRetAddr - call sPluginLink.lpUnhookEvent - push ddRetAddr - push ddRetStack - ret -UnhookEvent endp - - ;call to Miranda translate module -Translate proc lpString:DWORD - LOCAL ddLng:DWORD - - mov eax, ddFlags - and eax, 8 - .IF eax==0 - IFDEF _UNICODE - mov ddLng, LANG_UNICODE - ELSE - mov ddLng, 0 - ENDIF - .ELSE - and ddFlags, -9 - mov ddLng, 0 - .ENDIF - invoke CallService, offset MS_LANGPACK_TRANSLATESTRING, ddLng, lpString ;translate the string - ret -Translate endp - - ;Just an info func. Shows a message or Default error if NULL -Error proc lpString:DWORD - .IF lpString==0 - mov lpString, offset szError - .ENDIF - invoke MessageBox, NULL, lpString, addr szShortName, MB_OK - ret -Error endp - -Load proc link:DWORD - invoke RtlMoveMemory, addr sPluginLink, link, sizeof PLUGINLINK ;get miranda proc struct - - IFDEF _UNICODE - invoke lstrcpy, offset szGeneral, offset szOptGroup - invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szOptGroup, 7 - invoke lstrcpy, offset szGeneral, offset szOptTitle - invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szOptTitle, 12 - invoke lstrcpy, offset szGeneral, offset szTab1 - invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szTab1, 8 - invoke lstrcpy, offset szGeneral, offset szTab2 - invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szTab2, 9 - invoke lstrcpy, offset szGeneral, offset szAllContacts - invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szAllContacts, 19 - invoke lstrcpy, offset szGeneral, offset szUnkContacts - invoke MultiByteToWideChar, CP_ACP, MB_PRECOMPOSED, offset szGeneral, -1, offset szUnkContacts, 23 - ENDIF - - mov sSystemTime.wYear, 1870 - mov sSystemTime.wMonth, 1 - mov sSystemTime.wDay, 1 - mov sOptionsPage.cbSize, sizeof OPTIONSDIALOGPAGE ;set the option dialog's properties - invoke Translate, offset szOptTitle - IFDEF _UNICODE - mov sOptionsPage.flags, ODPF_UNICODE - ENDIF - mov sOptionsPage.pszTitle, eax - mov sOptionsPage.pfnDlgProc, offset TabOptions - mov sOptionsPage.pszTemplate, 100 - push hInstance - pop sOptionsPage.hInstance - push offset szOptGroup - pop sOptionsPage.pszGroup - - invoke HookEvent, offset ME_DB_EVENT_ADDED, offset Message ;set the message hook - mov hMsgHook, eax ;save hook hWnd - invoke HookEvent, offset ME_OPT_INITIALISE, offset OptInit ;set the options hook - mov hOptHook, eax ;save hook hWnd - invoke HookEvent, offset ME_SYSTEM_MODULESLOADED, offset MdLoaded ;set the ModulesLoaded hook - mov hMdLHook, eax ;save hook hWnd - - xor eax, eax - ret -Load Endp - -IcoLibEv proc C wParam:DWORD, lParam: DWORD - invoke SendMessage, hDlgWnd, WM_IMGLIST, 0, 0 - xor eax, eax - ret -IcoLibEv endp - -;############################## -; Runs when all modules are loaded -;############################## -MdLoaded proc C wParam:DWORD, lParam:DWORD - invoke UnhookEvent, hMdLHook ;unhook - - invoke ServiceExists, offset MS_UPDATE_REGISTER - .IF eax!=0 - mov sUpdate.cbSize, sizeof UPDATE ;initialize updater struct - mov sUpdate.szComponentName, offset szShortNamev - .IF ddBeta==0 - mov sUpdate.szVersionURL, offset szURL ;check if is Beta - .ENDIF - mov sUpdate.pbVersionPrefix, offset szURLKey - push ddURLKeyLen - pop sUpdate.cpbVersionPrefix - mov sUpdate.szUpdateURL, offset szDnURL - mov sUpdate.szBetaVersionURL, offset szBetaURL - mov sUpdate.pbBetaVersionPrefix, offset szBetaURLKey - push ddBetaURLKeyLen - pop sUpdate.cpbBetaVersionPrefix - mov sUpdate.szBetaUpdateURL, offset szBetaDnURL - mov sUpdate.pbVersion, offset szVersion - push ddVersionLen - pop sUpdate.cpbVersion - mov sUpdate.szBetaChangelogURL, offset szBetaChangelogURL - invoke CallService, offset MS_UPDATE_REGISTER, 0, offset sUpdate ;register updater service - .ENDIF - - ;registering icon in IcoLib - invoke ServiceExists, offset MS_SKIN2_ADDICON - .IF eax!=0 - invoke GetModuleFileNameA, hInstance, offset szGeneral, 255 - mov sSkinIconDesc.cbSize, sizeof SKINICONDESC - mov sSkinIconDesc.pszSection, offset szShortName - or ddFlags, 8 - invoke Translate, offset szIlDesc - mov sSkinIconDesc.pszDescription, eax - mov sSkinIconDesc.pszName, offset szIlName - mov sSkinIconDesc.pszDefaultFile, offset szGeneral - mov sSkinIconDesc.iDefaultIndex, -IDI_BAN - invoke CallService, offset MS_SKIN2_ADDICON, 0, offset sSkinIconDesc - invoke HookEvent, offset ME_SKIN2_ICONSCHANGED, offset IcoLibEv ;set the IconChanged hook - mov hIcoLibEv, eax ;save hook hWnd - .ENDIF - - xor eax, eax - ret -MdLoaded endp - - ;set CListControl style defaults -ResetListOptions proc hCList:DWORD - LOCAL Col, i:DWORD - - invoke SendMessage, hCList, CLM_SETBKBITMAP, 0, 0 - invoke GetSysColor, COLOR_WINDOW - mov Col, eax - invoke SendMessage, hCList, CLM_SETBKCOLOR, Col, 0 - invoke SendMessage, hCList, CLM_SETGREYOUTFLAGS, 0, 0 - invoke SendMessage, hCList, CLM_SETLEFTMARGIN, 2, 0 - invoke SendMessage, hCList, CLM_SETINDENT, 10, 0 - invoke GetSysColor, COLOR_WINDOWTEXT - mov Col, eax - mov i, FONTID_MAX - .WHILE i!=0 - invoke SendMessage, hCList, CLM_SETTEXTCOLOR, i, Col - dec i - .ENDW - mov sDBGetSetting.szModule, offset szOModule ;load the flags - mov sDBGetSetting.szSetting, offset szOShowHidden - mov sDBGetSetting.pValue, offset sDBVariant - mov sDBVariant.VAR1, DBVT_DWORD - invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting - .IF eax==0 - .IF sDBVariant.VAR2!=0 - invoke GetWindowLong, hCList, GWL_STYLE - or eax, CLS_SHOWHIDDEN - invoke SetWindowLong, hCList, GWL_STYLE, eax - .ENDIF - .ENDIF - xor eax, eax - ret -ResetListOptions endp - - ;load per contact trigger settings from DB -SetAllContactIcons proc hCList:DWORD - LOCAL hContact, hItem, szProto, flags, flag:DWORD - - invoke CallService, offset MS_DB_CONTACT_FINDFIRST, 0, 0 - mov hContact, eax - invoke SendMessage, hCList, WM_TIMER, 14, 0 ;Note: This is a hack. Wait for the CList To be ready. Thanks to FYR - .WHILE hContact!=0 - invoke SendMessage, hCList, CLM_FINDCONTACT, hContact, 0 - mov hItem, eax - .IF eax!=0 - invoke CallService, offset MS_PROTO_GETCONTACTBASEPROTO, hContact, 0 ;get PROTO for each contact - mov szProto, eax - .IF eax==0 - mov flag, 1 - mov flags, 1 - .ELSE - ;invoke IgnoreCheck, szProto ;Check PROTO Capabilities - mov flags, eax - mov sDBGetSetting.szModule, offset szOModule ;load settings - mov sDBGetSetting.szSetting, offset szOEnabled - mov sDBGetSetting.pValue, offset sDBVariant - mov sDBVariant.VAR1, DBVT_WORD - invoke CallService, offset MS_DB_CONTACT_GETSETTING, hContact, offset sDBGetSetting - .IF eax==0 - push sDBVariant.VAR2 - pop flag - .ELSE - mov flag, 1 - .ENDIF - .ENDIF - .IF flags!=0 ;finally set the necesarry image - xor eax, eax ;Use (MAKELPARAM "column", "image") instead of just 0 - invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, eax - .IF eax==0FFh - .IF flag!=0 - mov flag, 1 - .ENDIF - MAKELPARAM 0, flag - invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax - .ENDIF - .ENDIF - .ENDIF - invoke CallService, offset MS_DB_CONTACT_FINDNEXT, hContact, 0 - mov hContact, eax - .ENDW - ret -SetAllContactIcons endp - - ;Set group icons according to the contacts inside -SetListGroupIcons proc hCList:DWORD, hFirstItem:DWORD, hParentItem:DWORD, groupChildCount:DWORD - LOCAL typeOfFirst, iconOn, childCount, iImage, hItem, hChildItem:DWORD - - mov iconOn, 1 ;assume all are enabled - mov childCount, 0 - invoke SendMessage, hCList, CLM_GETITEMTYPE,hFirstItem, 0 - mov typeOfFirst, eax - - ;check groups - .IF typeOfFirst==CLCIT_GROUP - push hFirstItem - pop hItem - .ELSE - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem - mov hItem, eax - .ENDIF - .WHILE hItem!=NULL - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem - mov hChildItem, eax - .IF eax!=0 - invoke SetListGroupIcons, hCList, hChildItem, hItem, addr childCount - .ENDIF - .IF iconOn!=0 - invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, 0 - .IF eax==0 - mov iconOn, 0 - .ENDIF - .ENDIF - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem - mov hItem, eax - .ENDW - - ;check contacts - .IF typeOfFirst==CLCIT_CONTACT - push hFirstItem - pop hItem - .ELSE - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem - mov hItem, eax - .ENDIF - .WHILE hItem!=0 - invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, 0 - .IF iconOn!=0 - .IF eax==0 - mov iconOn, 0 - .ENDIF - .ENDIF - .IF eax!=0FFh - inc childCount - .ENDIF - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem - mov hItem, eax - .ENDW - - ;set group icons - .IF childCount==0 - mov eax, 0FFh - .ELSEIF iconOn==0 - mov eax, 0 - .ELSE - mov eax, 1 - .ENDIF - MAKELPARAM 0, eax - invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hParentItem, eax - .IF groupChildCount!=0 - mov eax, [groupChildCount] - add eax, childCount - mov [groupChildCount], eax - .ENDIF - ret -SetListGroupIcons endp - - ;set group child icons -SetAllChildIcons proc hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD - LOCAL typeOfFirst, iOldIcon, hItem, hChildItem:DWORD - - invoke SendMessage, hCList, CLM_GETITEMTYPE, hFirstItem, 0 - mov typeOfFirst, eax - - ;set icons for groups - .IF typeOfFirst==CLCIT_GROUP - push hFirstItem - pop hItem - .ELSE - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem - mov hItem, eax - .ENDIF - .WHILE hItem!=0 - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem - mov hChildItem, eax - .IF hChildItem!=0 - invoke SetAllChildIcons, hCList, hChildItem, iColumn, iImage - .ENDIF - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem - mov hItem, eax - .ENDW - - ;set icons for contacts - .IF typeOfFirst==CLCIT_CONTACT - push hFirstItem - pop hItem - .ELSE - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem - mov hItem, eax - .ENDIF - .WHILE hItem!=0 - invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, iColumn - mov iOldIcon, eax - .IF iOldIcon!=0FFh - mov eax, iImage - .IF iOldIcon!=eax - MAKELPARAM iColumn, iImage - invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax - mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings - mov sDBGetSetting.szSetting, offset szOMetaCount - mov sDBGetSetting.pValue, offset sDBVariant - mov sDBVariant.VAR1, DBVT_WORD - invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting - .IF eax==0 - invoke MetaConClick, hItem, sDBVariant.VAR2, iImage - .ENDIF - .ENDIF - .ENDIF - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem - mov hItem, eax - .ENDW - ret -SetAllChildIcons endp - - ;set icons to contacts Not on list -SetUnkChildIcons proc hCList:DWORD, hFirstItem:DWORD, iColumn:DWORD, iImage:DWORD - LOCAL typeOfFirst, iOldIcon, hItem, hChildItem:DWORD - - invoke SendMessage, hCList, CLM_GETITEMTYPE, hFirstItem, 0 - mov typeOfFirst, eax - - ;set icons for groups - .IF typeOfFirst==CLCIT_GROUP - push hFirstItem - pop hItem - .ELSE - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hFirstItem - mov hItem, eax - .ENDIF - .WHILE hItem!=0 - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_CHILD, hItem - mov hChildItem, eax - .IF hChildItem!=0 - invoke SetUnkChildIcons, hCList, hChildItem, iColumn, iImage - .ENDIF - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, hItem - mov hItem, eax - .ENDW - - ;set icons for contacts - .IF typeOfFirst==CLCIT_CONTACT - push hFirstItem - pop hItem - .ELSE - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hFirstItem - mov hItem, eax - .ENDIF - .WHILE hItem!=0 - invoke SendMessage, hCList, CLM_GETEXTRAIMAGE, hItem, iColumn - mov iOldIcon, eax - .IF iOldIcon!=0FFh - mov eax, iImage - .IF iOldIcon!=eax - mov sDBGetSetting.szModule, offset szOCList - mov sDBGetSetting.szSetting, offset szONotOnList - mov sDBGetSetting.pValue, offset sDBVariant - mov sDBVariant.VAR1, DBVT_BYTE - invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting - .IF eax==0 - lea esi, sDBVariant.VAR2 - mov al, [esi] - .IF al!=0 - MAKELPARAM iColumn, iImage - invoke SendMessage, hCList, CLM_SETEXTRAIMAGE, hItem, eax - .ENDIF - .ENDIF - .ENDIF - .ENDIF - invoke SendMessage, hCList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, hItem - mov hItem, eax - .ENDW - ret -SetUnkChildIcons endp - -MetaConClick proc hContact:DWORD, iCount:DWORD, iValue: DWORD - dec iCount - .WHILE iCount!=-1 - invoke CallService, offset MS_MC_GETSUBCONTACT, hContact, iCount - .IF eax!=0 - mov ebx, eax - MAKELPARAM 0, 0 - invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, ebx, eax - .IF eax!= 0FFh - MAKELPARAM 0, iValue - invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, ebx, eax - .ENDIF - .ENDIF - dec iCount - .ENDW - ret -MetaConClick endp - -MetaSubClick proc hContact:DWORD - LOCAL iVal, iCounter:DWORD - - invoke CallService, offset MS_MC_GETMETACONTACT, hContact, 0 - .IF eax!=0 - mov hContact, eax - mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings - mov sDBGetSetting.szSetting, offset szOMetaCount - mov sDBGetSetting.pValue, offset sDBVariant - mov sDBVariant.VAR1, DBVT_WORD - invoke CallService, offset MS_DB_CONTACT_GETSETTING, hContact, offset sDBGetSetting - .IF eax==0 - push sDBVariant.VAR2 - pop iCounter - dec iCounter - mov iVal, 1 - .WHILE iCounter!=-1 - invoke CallService, offset MS_MC_GETSUBCONTACT, hContact, iCounter - .IF eax!=0 - mov ebx, eax - MAKELPARAM 0, 0 - invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, ebx, eax - .IF eax==0 - mov iVal, 0 - .ENDIF - .ENDIF - dec iCounter - .ENDW - .ENDIF - .ENDIF - MAKELPARAM 0, iVal - invoke SendDlgItemMessage, hDlgWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hContact, eax - ret -MetaSubClick endp - -;############################## -; Options hook proc -;############################## -OptInit proc C wParam:DWORD, lParam:DWORD - mov eax, wParam ;init the options dialog - invoke CallService, addr MS_OPT_ADDPAGE, eax, addr sOptionsPage - xor eax, eax - ret -OptInit Endp - -;############################## -; Message hook proc -;############################## -Message proc C wParam:DWORD, lParam:DWORD - LOCAL hContact:DWORD - - xor eax, eax - ret -Message Endp - -;############################## -; First tab event proc -;############################## -Options1 proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD - .IF uMsg==WM_INITDIALOG ;if user opens options - invoke SetWindowPos, dhWnd, HWND_TOP, sDlgHdr.rcDisplay.left, sDlgHdr.rcDisplay.top, 0, 0, SWP_NOSIZE - .ELSEIF uMsg==WM_COMMAND ;if sth. happened in the dialog - .ENDIF - xor eax,eax - ret -Options1 endp - -;############################## -; Second tab event proc -;############################## -Options2 proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD - LOCAL hContact, hItem, hitFlags, iImage, itemType, i:DWORD - - push dhWnd - pop hDlgWnd - .IF uMsg==WM_INITDIALOG - invoke SetWindowPos, dhWnd, HWND_TOP, sDlgHdr.rcDisplay.left, sDlgHdr.rcDisplay.top, 0, 0, SWP_NOSIZE - invoke GetDlgItem, dhWnd, IDC_SHOWHIDDEN - mov HC_SHOWHIDDEN, eax - mov sDBGetSetting.szModule, offset szOModule ;load the flags - mov sDBGetSetting.szSetting, offset szOShowHidden - mov sDBGetSetting.pValue, offset sDBVariant - mov sDBVariant.VAR1, DBVT_DWORD - invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting - .IF eax==0 - .IF sDBVariant.VAR2!=0 - Invoke SendMessage, HC_SHOWHIDDEN, BM_SETCHECK, BST_CHECKED, 0 - .ENDIF - .ENDIF - invoke SendMessage, dhWnd, WM_IMGLIST, wParam, lParam - invoke GetDlgItem, dhWnd, IDC_CLIST - mov HC_CLIST, eax - invoke ResetListOptions, HC_CLIST - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRACOLUMNS, 1, 0 ;set no of icon columns - mov sClcInfoItem.cbSize, sizeof CLCINFOITEM ;add additional items - mov sClcInfoItem.flags, CLCIIF_GROUPFONT - invoke Translate, offset szAllContacts ;** All contacts ** - mov sClcInfoItem.pszText, eax - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_ADDINFOITEM, 0, addr sClcInfoItem - mov hItemAll, eax - invoke Translate, offset szUnkContacts ;** Unknown contacts ** - mov sClcInfoItem.pszText, eax - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_ADDINFOITEM, 0, addr sClcInfoItem - mov hItemUnk, eax - - invoke SetAllContactIcons, HC_CLIST ;Init control values - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 - invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL - mov sDBGetSetting.szModule, offset szOModule ;load the flags - mov sDBGetSetting.szSetting, offset szONotOnList - mov sDBGetSetting.pValue, offset sDBVariant - mov sDBVariant.VAR1, DBVT_DWORD - invoke CallService, offset MS_DB_CONTACT_GETSETTING, 0, offset sDBGetSetting - .IF eax==0 - .IF sDBVariant.VAR2!=0 - mov eax, 1 - .ENDIF - .ELSE - mov eax, 1 - .ENDIF - push eax - invoke SetUnkChildIcons, HC_CLIST, hItemUnk, 0, eax - pop eax - MAKELPARAM 0, eax - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItemUnk, eax - .ELSEIF uMsg==WM_IMGLIST - invoke GetVersion ;check win version - .IF al==5 - .IF ah!=0 - mov eax, ILC_COLOR32 or ILC_MASK - .ELSEIF - mov eax, ILC_COLOR16 or ILC_MASK - .ENDIF - .ENDIF - invoke ImageList_Create, 16, 16, eax, 3, 3 ;create image list - mov hIml, eax - invoke LoadIcon, hApp, IDI_SMALLDOT ;add icon - push eax - invoke ImageList_AddIcon, hIml, eax - pop eax - invoke DeleteObject, eax - invoke CallService, offset MS_SKIN2_GETICON, 0, offset szIlName - invoke ImageList_AddIcon, hIml, eax - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGELIST, 0, hIml ;link image list to CList - .ELSEIF uMsg==WM_SETFOCUS - invoke SetFocus, HC_CLIST - .ELSEIF uMsg==WM_COMMAND - mov eax, wParam - .IF lParam!=0 - .IF ax==IDC_SHOWHIDDEN - mov sDBWriteSetting.szModule, offset szOModule - mov sDBWriteSetting.szSetting, offset szOShowHidden - mov sDBWriteSetting.VAR1, DBVT_DWORD - invoke SendMessage, HC_SHOWHIDDEN, BM_GETCHECK, 0, 0 - .IF eax==BST_CHECKED - mov sDBWriteSetting.VAR2, 1 - invoke GetWindowLong, HC_CLIST, GWL_STYLE - or eax, CLS_SHOWHIDDEN - .ELSE - mov sDBWriteSetting.VAR2, 0 - invoke GetWindowLong, HC_CLIST, GWL_STYLE - mov ebx, -CLS_SHOWHIDDEN - dec ebx - and eax, ebx - .ENDIF - invoke SetWindowLong, HC_CLIST, GWL_STYLE, eax - invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting - invoke SendMessage, HC_CLIST, CLM_SETUSEGROUPS, 1, 0 - invoke SetAllContactIcons, HC_CLIST - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 - invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL - .ENDIF - .ENDIF - .ELSEIF uMsg==WM_NOTIFY ;if sth changes - mov edi, lParam - assume edi:ptr NMHDR - .IF [edi].idFrom==IDC_CLIST - .IF [edi].code==CLN_NEWCONTACT - invoke SetAllContactIcons, HC_CLIST - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 - invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL - .ELSEIF [edi].code==CLN_LISTREBUILT - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 - invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL - .ELSEIF [edi].code==CLN_CONTACTMOVED - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 - invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL - .ELSEIF [edi].code==CLN_OPTIONSCHANGED - invoke ResetListOptions, HC_CLIST - .ELSEIF [edi].code==NM_CLICK ;Click on the CList - assume edi:ptr NMCLISTCONTROL - .IF [edi].iColumn!=-1 - MAKELPARAM [edi].pt.x, [edi].pt.y - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_HITTEST, addr hitFlags, eax - mov hItem, eax - .IF hItem!=0 - and hitFlags, CLCHT_ONITEMEXTRA ;if click on icon, then analyze and edit - .IF hitFlags!=0 - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, [edi].iColumn - .IF eax==0 - mov iImage, 1 - .ELSE - mov iImage, 0 - .ENDIF - MAKELPARAM [edi].iColumn, 0 - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, eax - .IF eax!= 0FFh - MAKELPARAM [edi].iColumn, iImage - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItem, eax - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETITEMTYPE, hItem, 0 - mov itemType, eax - .IF itemType==CLCIT_CONTACT ;if click on contact - MAKELPARAM [edi].iColumn, iImage - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_SETEXTRAIMAGE, hItem, eax - mov sDBGetSetting.szModule, offset szOMetaContacts ;load settings - mov sDBGetSetting.szSetting, offset szOMetaCount - mov sDBGetSetting.pValue, offset sDBVariant - mov sDBVariant.VAR1, DBVT_WORD - invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting - .IF eax==0 - ;is MetaContact - invoke MetaConClick, hItem, sDBVariant.VAR2, iImage - .ELSE - mov sDBGetSetting.szSetting, offset szOMetaLink - invoke CallService, offset MS_DB_CONTACT_GETSETTING, hItem, offset sDBGetSetting - .IF eax==0 - ;is subcontact - invoke MetaSubClick, hItem - .ENDIF - .ENDIF - .ENDIF - .IF itemType==CLCIT_INFO ;if click on extra item - mov eax, hItem - .IF eax==hItemAll - invoke SetAllChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage - .ELSEIF eax==hItemUnk - invoke SetUnkChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage - .ENDIF - .ENDIF - .IF itemType==CLCIT_GROUP ;if click on group - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_CHILD, hItem - mov hItem, eax - .IF hItem!=0 - invoke SetAllChildIcons, HC_CLIST, hItem, [edi].iColumn, iImage - .ENDIF - .ENDIF - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_ROOT, 0 - invoke SetListGroupIcons, HC_CLIST, eax, hItemAll, NULL - invoke GetParent, dhWnd - invoke GetParent, eax - push eax - invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button - pop eax - invoke GetParent, eax - invoke SendMessage, eax, PSM_CHANGED, 0, 0 ;enable the Apply button - .ENDIF - .ENDIF - .ENDIF - .ENDIF - assume edi:ptr NMHDR - .ENDIF - .ELSEIF [edi].idFrom==0 - .IF [edi].code==PSN_APPLY ;if OK/Apply pressed. Save options - invoke CallService, addr MS_DB_CONTACT_FINDFIRST, 0, 0 - mov hContact, eax - .WHILE hContact!=0 - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_FINDCONTACT, hContact, 0 - mov hItem, eax - .IF eax!=0 - xor eax, eax ;Use (MAKELPARAM "column", "image") instead of just 0 - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItem, eax - mov sDBWriteSetting.szModule, offset szOModule - mov sDBWriteSetting.szSetting, offset szOEnabled - mov sDBWriteSetting.VAR1, DBVT_DWORD - mov sDBWriteSetting.VAR2, eax - invoke CallService, offset MS_DB_CONTACT_WRITESETTING, hContact, offset sDBWriteSetting - .ENDIF - invoke CallService, addr MS_DB_CONTACT_FINDNEXT, hContact, 0 - mov hContact, eax - .ENDW - invoke SendDlgItemMessage, dhWnd, IDC_CLIST, CLM_GETEXTRAIMAGE, hItemUnk, 0 - mov sDBWriteSetting.szModule, offset szOModule - mov sDBWriteSetting.szSetting, offset szONotOnList - mov sDBWriteSetting.VAR1, DBVT_DWORD - mov sDBWriteSetting.VAR2, eax - invoke CallService, offset MS_DB_CONTACT_WRITESETTING, 0, offset sDBWriteSetting - .ENDIF - .ENDIF - assume edi:nothing - .ELSEIF uMsg==WM_DESTROY - invoke ImageList_Destroy, hIml ;Free used resources - .ENDIF - xor eax, eax - ret -Options2 endp - -TabOptions proc, dhWnd:DWORD, uMsg:DWORD, wParam:DWORD, lParam:DWORD - push dhWnd - pop sDlgHdr.hDlg - .IF uMsg==WM_INITDIALOG ;if user opens options - mov ddInt, 0 - invoke InitCommonControls - invoke GetDlgItem, dhWnd, 1000 ;get hWnd of tabs control - mov sDlgHdr.hTab, eax - mov edi, offset sTCITEM ;insert tabs - mov eax, TCIF_TEXT - mov [edi], eax - invoke Translate, offset szTab1 ;translate Tab name - IFDEF _UNICODE - mov sTCITEM.pszText, eax - invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMW, 0, addr sTCITEM - ELSE - mov sTCITEM.pszText, eax - invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMA, 0, addr sTCITEM - ENDIF - mov sDlgHdr.hDisplay, NULL - - invoke SetRectEmpty, addr sDlgHdr.rcDisplay - invoke SendMessage, sDlgHdr.hTab, TCM_ADJUSTRECT, FALSE, addr sDlgHdr.rcDisplay - - invoke FindResource, hInstance, 101, RT_DIALOG ;load first tab in memory - invoke LoadResource, hInstance, eax - invoke LockResource, eax - invoke CreateDialogIndirectParam, hInstance, eax, sDlgHdr.hTab, Options1, NULL - mov sDlgHdr.hTab1, eax - mov sDlgHdr.hDisplay, eax - - invoke Translate, offset szTab2 ;translate Tab name - IFDEF _UNICODE - mov sTCITEM.pszText, eax - invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMW, 1, addr sTCITEM - ELSE - mov sTCITEM.pszText, eax - invoke SendMessage, sDlgHdr.hTab, TCM_INSERTITEMA, 1, addr sTCITEM - ENDIF - invoke FindResource, hInstance, 102, RT_DIALOG ;load second tab in memory - invoke LoadResource, hInstance, eax - invoke LockResource, eax - invoke CreateDialogIndirectParam, hInstance, eax, sDlgHdr.hTab, Options2, NULL - mov sDlgHdr.hTab2, eax - invoke ShowWindow, sDlgHdr.hTab2, SW_HIDE - - mov sLngPackDialog.cbSize, sizeof LANGPACKTRANSLATEDIALOG - mov sLngPackDialog.flags, 0 - push dhWnd - pop sLngPackDialog.hwndDlg - mov sLngPackDialog.ignoreControls, 0 - invoke CallService, offset MS_LANGPACK_TRANSLATEDIALOG, LPTDF_NOTITLE, offset sLngPackDialog ;translate dialogs - - .ELSEIF uMsg==WM_NOTIFY - .IF wParam==1000 ;if message from tab control - mov edi, lParam - assume edi:ptr NMHDR - .IF [edi].code==TCN_SELCHANGE ;if tab changed - .IF sDlgHdr.hDisplay!=0 - invoke ShowWindow, sDlgHdr.hDisplay, SW_HIDE ;hide old tab - .ENDIF - invoke SendMessage, sDlgHdr.hTab, TCM_GETCURSEL, 0, 0 ;get current tab and show it - .IF eax==0 - mov eax, sDlgHdr.hTab1 - .ELSEIF eax==1 - mov eax, sDlgHdr.hTab2 - .ELSE - invoke Error, 0 - .ENDIF - mov sDlgHdr.hDisplay, eax - invoke ShowWindow, sDlgHdr.hDisplay, SW_SHOW - .ENDIF - assume edi:nothing - .ELSEIF - invoke SendMessage, sDlgHdr.hTab1, WM_NOTIFY, wParam, lParam - invoke SendMessage, sDlgHdr.hTab2, WM_NOTIFY, wParam, lParam - .ENDIF - .ENDIF - xor eax, eax - ret -TabOptions endp - -Unload proc - invoke UnhookEvent, hMsgHook ;unhook events and exit - invoke UnhookEvent, hOptHook - invoke UnhookEvent, hIcoLibEv - xor eax, eax - ret -Unload Endp - -End DllMain \ No newline at end of file diff --git a/bancontrol/plugin/BanControl.def b/bancontrol/plugin/BanControl.def deleted file mode 100644 index dbb485e..0000000 --- a/bancontrol/plugin/BanControl.def +++ /dev/null @@ -1,4 +0,0 @@ -LIBRARY BanControl -EXPORTS MirandaPluginInfo -EXPORTS Load -EXPORTS Unload \ No newline at end of file diff --git a/bancontrol/res/BanControl.aps b/bancontrol/res/BanControl.aps deleted file mode 100644 index 59eef98..0000000 Binary files a/bancontrol/res/BanControl.aps and /dev/null differ diff --git a/bancontrol/res/BanControl.rc b/bancontrol/res/BanControl.rc deleted file mode 100644 index 0c56743..0000000 --- a/bancontrol/res/BanControl.rc +++ /dev/null @@ -1,141 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.K.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENG) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -100 DIALOGEX 0, 0, 314, 240 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD | WS_VISIBLE -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "",IDT_MAIN,"SysTabControl32",0x0,1,1,311,237 -END - -101 DIALOGEX 0, 0, 305, 220 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN -END - -102 DIALOGEX 0, 0, 305, 220 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - LTEXT "To enable or disable the plugin for an individual contact, click on the icon to the right of it. Clicking on the group's icon, enables/disables the plugin for all the contacts in that group.", - IDC_STATIC,40,188,227,27 - CONTROL "",IDC_CLIST,"CListControl",WS_TABSTOP | 0x1c0,10,10,285, - 165,WS_EX_CLIENTEDGE - CONTROL "Show hidden",IDC_SHOWHIDDEN,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,20,177,195,10 -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,1,0 - PRODUCTVERSION 0,0,1,0 - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "FileDescription", "BanControl" - VALUE "FileVersion", "0, 0, 1, 0" - VALUE "InternalName", "BanControl" - VALUE "LegalCopyright", "Copyright (C) 2007" - VALUE "OriginalFilename", "BanControl.dll" - VALUE "ProductName", "BanControl" - VALUE "ProductVersion", "0, 0, 1, 0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_BAN ICON "ban.ico" -#endif // English (U.K.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/bancontrol/res/ban.ico b/bancontrol/res/ban.ico deleted file mode 100644 index bb71cb9..0000000 Binary files a/bancontrol/res/ban.ico and /dev/null differ diff --git a/bancontrol/res/resource.h b/bancontrol/res/resource.h deleted file mode 100644 index c7d48ff..0000000 --- a/bancontrol/res/resource.h +++ /dev/null @@ -1,19 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by BanControl.rc -// -#define IDI_BAN 101 -#define IDT_MAIN 1000 -#define IDC_CLIST 3000 -#define IDC_SHOWHIDDEN 50071 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 201 -#endif -#endif diff --git a/bancontrol/vsproj/BanControl.sln b/bancontrol/vsproj/BanControl.sln deleted file mode 100644 index 61f5135..0000000 --- a/bancontrol/vsproj/BanControl.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BanControl", "BanControl.vcproj", "{3018D9E2-8CFE-4E39-8834-72222BB648F4}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {3018D9E2-8CFE-4E39-8834-72222BB648F4}.Debug.ActiveCfg = Debug|Win32 - {3018D9E2-8CFE-4E39-8834-72222BB648F4}.Debug.Build.0 = Debug|Win32 - {3018D9E2-8CFE-4E39-8834-72222BB648F4}.Release.ActiveCfg = Release|Win32 - {3018D9E2-8CFE-4E39-8834-72222BB648F4}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/bancontrol/vsproj/BanControl.vcproj b/bancontrol/vsproj/BanControl.vcproj deleted file mode 100644 index f66f0f4..0000000 --- a/bancontrol/vsproj/BanControl.vcproj +++ /dev/null @@ -1,147 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/bancontrol/vsproj/Resource.txt b/bancontrol/vsproj/Resource.txt deleted file mode 100644 index e69de29..0000000 diff --git a/bancontrol/vsproj/build.bat b/bancontrol/vsproj/build.bat deleted file mode 100644 index c0b634b..0000000 --- a/bancontrol/vsproj/build.bat +++ /dev/null @@ -1,34 +0,0 @@ -@echo off - -echo Building Resources... -rc /r /fo ".\BanControl.res" ..\res\BanControl.rc - - -echo Building ANSI version... - -\masm32\bin\ml /nologo /c /coff /Zi /Fl /Fm /Cp ..\plugin\BanControl.asm - if errorlevel 1 goto errasm -\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"..\..\..\Miranda ANSI\plugins\BanControl.dll" BanControl.obj BanControl.res - if errorlevel 1 goto errlink - - -echo Building Unicode version... - -\masm32\bin\ml /nologo /D_UNICODE /c /coff /Zi /Fl /Fm /Cp ..\plugin\BanControl.asm - if errorlevel 1 goto errasm -\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib /OUT:"..\..\..\plugins\BanControl.dll" BanControl.obj BanControl.res - if errorlevel 1 goto errlink - -Echo Done. - -goto TheEnd -:errasm -echo _ -echo Assembly Error -goto TheEnd -:errlink -echo _ -echo Link Error - -:TheEnd -pause \ No newline at end of file diff --git a/bancontrol/vsproj/clean.bat b/bancontrol/vsproj/clean.bat deleted file mode 100644 index 19cd5ba..0000000 --- a/bancontrol/vsproj/clean.bat +++ /dev/null @@ -1,49 +0,0 @@ -@echo off - -echo Building Resources... -rc /r /fo ".\BanControl.res" ..\res\BanControl.rc - - -echo Building ANSI version... - -\masm32\bin\ml /nologo /c /coff /Zi /Fl /Fm /Cp ..\plugin\BanControl.asm - if errorlevel 1 goto errasm -\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib BanControl.obj BanControl.res - if errorlevel 1 goto errlink -move /Y BanControl.dll ..\bin\BanControlA_d.dll - -\masm32\bin\ml /nologo /c /coff /Cp ..\plugin\BanControl.asm - if errorlevel 1 goto errasm -\masm32\bin\Link /nologo /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib BanControl.obj BanControl.res - if errorlevel 1 goto errlink -move /Y BanControl.dll ..\bin\BanControlA.dll - - -echo Building Unicode version... - -\masm32\bin\ml /nologo /D_UNICODE /c /coff /Zi /Fl /Fm /Cp ..\plugin\BanControl.asm - if errorlevel 1 goto errasm -\masm32\bin\Link /nologo /DEBUG /DEBUGTYPE:CV /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib BanControl.obj BanControl.res - if errorlevel 1 goto errlink -move /Y BanControl.dll ..\bin\BanControlW_d.dll - -\masm32\bin\ml /nologo /D_UNICODE /c /coff /Cp ..\plugin\BanControl.asm - if errorlevel 1 goto errasm -\masm32\bin\Link /nologo /DLL /DEF:..\plugin\BanControl.def /SUBSYSTEM:WINDOWS /LIBPATH:\masm32\lib BanControl.obj BanControl.res - if errorlevel 1 goto errlink -move /Y BanControl.dll ..\bin\BanControlW.dll - -Echo Done. -cd - -goto TheEnd -:errasm -echo _ -echo Assembly Error -goto TheEnd -:errlink -echo _ -echo Link Error - -:TheEnd -pause \ No newline at end of file diff --git a/buddyexpectator/BuddyExpectator.cpp b/buddyexpectator/BuddyExpectator.cpp deleted file mode 100644 index 6af9724..0000000 --- a/buddyexpectator/BuddyExpectator.cpp +++ /dev/null @@ -1,968 +0,0 @@ -/* - Buddy Expectator+ plugin for Miranda-IM (www.miranda-im.org) - (c)2005 Anar Ibragimoff (ai91@mail.ru) - (c)2006 Scott Ellis (mail@scottellis.com.au) - (c)2007,2008 Alexander Turyak (thief@miranda-im.org.ua) - - 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 - - File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/BuddyExpectator.cpp $ - Revision : $Rev: 1392 $ - Last change on : $Date: 2009-04-22 17:46:08 +0300 (Ср, 22 апр 2009) $ - Last change by : $Author: Thief $ -*/ - -#include "common.h" -#include "options.h" - -HINSTANCE hInst; -PLUGINLINK *pluginLink; - -DWORD timer_id = 0; - -HANDLE hEventContactSetting = NULL; -HANDLE hEventContactAdded = NULL; -HANDLE hEventUserInfoInit = NULL; -HANDLE hPrebuildContactMenu = NULL; -HANDLE hContactMenu = NULL; -HANDLE hIcoLibIconsChanged = NULL; -HANDLE hContactReturnedAction = NULL; -HANDLE hContactStillAbsentAction = NULL; -HANDLE hMissYouAction = NULL; -HANDLE hMenuMissYouClick = NULL; -HANDLE hModulesLoaded = NULL; -HANDLE hModulesLoaded2 = NULL; -HANDLE hSystemOKToExit = NULL; -HANDLE hHookExtraIconsRebuild = NULL; -HANDLE hHookExtraIconsApply = NULL; - -HICON hIcon; -HANDLE hEnabledIcon = NULL, hDisabledIcon = NULL; - -IconExtraColumn g_IECMissYou = {0}; -IconExtraColumn g_IECClear = {0}; - -// Popup Actions -POPUPACTION missyouactions[1]; -POPUPACTION hideactions[2]; - -extern int UserinfoInit(WPARAM wparam, LPARAM lparam); - -PLUGININFOEX pluginInfo = { - sizeof(PLUGININFOEX), - "Buddy Expectator+", - PLUGIN_MAKE_VERSION(0,1,2,3), - "Reacts to the return of contacts, or the the extended absence of contacts, with notifications and other actions", - "Anar Ibragimoff, sje, Thief", - "thief@miranda.im", - "© 2005 Anar Ibragimoff, © 2006 Scott Ellis, © 2007-2009 Alexander Turyak", - "http://thief.miranda.im", - 0, - 0, - {0xddf8aec9, 0x7d37, 0x49af, {0x9d, 0x22, 0xbb, 0xbc, 0x92, 0x0e, 0x6f, 0x05}} //{DDF8AEC9-7D37-49AF-9D22-BBBC920E6F05} -}; - -PLUGININFO oldpluginInfo = { - sizeof(PLUGININFO), - pluginInfo.shortName, - pluginInfo.version, - pluginInfo.description, - pluginInfo.author, - pluginInfo.authorEmail, - pluginInfo.copyright, - pluginInfo.homepage, - pluginInfo.flags, - pluginInfo.replacesDefaultModule -}; - -/* 2D84F403-91F3-4E60-BF02-16C2F1716D86 */ -#define MIID_BUDDYEXPECTATOR {0x2d84f403, 0x91f3, 0x4e60, {0xbf, 0x02, 0x16, 0xc2, 0xf1, 0x71, 0x6d, 0x86}} - -extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) -{ - static const MUUID interfaces[] = {MIID_BUDDYEXPECTATOR, MIID_LAST}; - return interfaces; -} - -extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) -{ - hInst = hinstDLL; - return TRUE; -} - -time_t getLastSeen(HANDLE hContact) -{ - return DBGetContactSettingDword(hContact, MODULE_NAME, "LastSeen", DBGetContactSettingDword(hContact, MODULE_NAME, "CreationTime", (DWORD)-1)); -} - -void setLastSeen(HANDLE hContact) -{ - DBWriteContactSettingDword(hContact, MODULE_NAME, "LastSeen", (DWORD)time(NULL)); - if (DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0)) - DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0); -} - -time_t getLastInputMsg(HANDLE hContact) -{ - HANDLE hDbEvent; - DBEVENTINFO dbei = {0}; - - hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDLAST, (WPARAM)hContact, 0); - while (hDbEvent) - { - dbei.cbSize = sizeof(dbei); - dbei.pBlob = 0; - dbei.cbBlob = 0; - CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei); - if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) - return dbei.timestamp; - hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hDbEvent, 0); - } - return -1; -} - -/** - * PopUp window procedures - */ - -int CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_COMMAND: - if (HIWORD(wParam) == STN_CLICKED) - { - DBWriteContactSettingByte(PUGetContact(hWnd), "CList", "Hidden", 1); - PUDeletePopUp(hWnd); - } - break; - case WM_CONTEXTMENU: - DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1); - PUDeletePopUp(hWnd); - break; - case UM_POPUPACTION: - if (wParam == 2) - { - DBWriteContactSettingByte(PUGetContact(hWnd), "CList", "Hidden", 1); - PUDeletePopUp(hWnd); - } - if (wParam == 3) - { - DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1); - PUDeletePopUp(hWnd); - } - break; - case UM_FREEPLUGINDATA: - return TRUE; - default: - break; - } - return DefWindowProc(hWnd, message, wParam, lParam); -} - -int CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_COMMAND: - if (HIWORD(wParam) == STN_CLICKED) - { - CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0); - if (!DBGetContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYouNotifyAlways", 0)) - { - DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0); - if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) PUGetContact(hWnd), (LPARAM) &g_IECClear); - } - PUDeletePopUp(hWnd); - } - break; - case WM_CONTEXTMENU: - PUDeletePopUp(hWnd); - break; - case UM_POPUPACTION: - if (wParam == 1) - { - DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0); - if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) PUGetContact(hWnd), (LPARAM) &g_IECClear); - PUDeletePopUp(hWnd); - } - break; - case UM_FREEPLUGINDATA: - return TRUE; - default: - break; - } - return DefWindowProc(hWnd, message, wParam, lParam); -} - -int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_COMMAND: - if (HIWORD(wParam) == STN_CLICKED) - { - CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0); - CallServiceSync("BuddyExpectator/actionReturned", (WPARAM)PUGetContact(hWnd), 0); - PUDeletePopUp(hWnd); - } - break; - case WM_CONTEXTMENU: - CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0); - setLastSeen(PUGetContact(hWnd)); - PUDeletePopUp(hWnd); - break; - case UM_FREEPLUGINDATA: - if (options.iShowEvent == 0) - { - setLastSeen(PUGetContact(hWnd)); - } - return TRUE; - default: - break; - } - return DefWindowProc(hWnd, message, wParam, lParam); -} - -int CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - switch (message) - { - case WM_COMMAND: - if (HIWORD(wParam) == STN_CLICKED) - { - CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0); - CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0); - PUDeletePopUp(hWnd); - } - break; - case WM_CONTEXTMENU: - CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0); - PUDeletePopUp(hWnd); - break; - case UM_FREEPLUGINDATA: - return TRUE; - default: - break; - } - return DefWindowProc(hWnd, message, wParam, lParam); -} - -/** - * Checks - whether user has been gone for specified number of days - */ -bool isContactGoneFor(HANDLE hContact, int days) -{ - time_t lastSeen = getLastSeen(hContact); - time_t lastInputMsg = getLastInputMsg(hContact); - time_t currentTime = time(NULL); - - int daysSinceOnline = -1; - if (lastSeen != -1) daysSinceOnline = (int)((currentTime - lastSeen)/(60*60*24)); - - int daysSinceMessage = -1; - if (lastInputMsg != -1) daysSinceMessage = (int)((currentTime - lastInputMsg)/(60*60*24)); - - if (options.hideInactive) - { - if (daysSinceMessage >= options.iSilencePeriod) - if (!DBGetContactSettingByte(hContact, "CList", "Hidden", 0) && !DBGetContactSettingByte(hContact, MODULE_NAME, "NeverHide", 0)) - { - char szInfo[200]; - - POPUPDATAT_V2 ppd = {0}; - ppd.cbSize = sizeof(POPUPDATAT_V2); - - ppd.lchContact = hContact; - ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"); - - mir_snprintf(szInfo, 200, Translate("Hiding %s (%s)"), (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0)); - strncpy(ppd.lpzContactName, szInfo, MAX_CONTACTNAME); - mir_snprintf(szInfo, 200, Translate("%d days since last message"), daysSinceMessage); - strncpy(ppd.lpzText, szInfo, MAX_SECONDLINE); - if (!options.iUsePopupColors) - { - ppd.colorBack = options.iPopUpColorBack; - ppd.colorText = options.iPopUpColorFore; - } - ppd.PluginWindowProc = (WNDPROC)HidePopupDlgProc; - ppd.PluginData = NULL; - ppd.iSeconds = -1; - - hideactions[0].flags = hideactions[1].flags = PAF_ENABLED; - ppd.lpActions = hideactions; - ppd.actionCount = 2; - - CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NEWDATA); - - SkinPlaySound("buddyExpectatorHide"); - } - } - - return (daysSinceOnline >= days && (daysSinceMessage == -1 || daysSinceMessage >= days)); -} - -void ReturnNotify(HANDLE hContact, char *message) -{ - if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1) - return; - - SkinPlaySound("buddyExpectatorReturn"); - - if (options.iShowPopUp > 0) - { - // Display PopUp - POPUPDATAT_V2 ppd = {0}; - ppd.cbSize = sizeof(POPUPDATAT_V2); - - ppd.lchContact = hContact; - ppd.lchIcon = hIcon; - strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME); - strncpy(ppd.lpzText, message, MAX_SECONDLINE); - if (!options.iUsePopupColors) - { - ppd.colorBack = options.iPopUpColorBack; - ppd.colorText = options.iPopUpColorFore; - } - ppd.PluginWindowProc = (WNDPROC)PopupDlgProc; - ppd.PluginData = NULL; - ppd.iSeconds = options.iPopUpDelay; - - CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, 0); - - } - - if (options.iShowEvent > 0) - { - CLISTEVENT cle = {0}; - - cle.cbSize = sizeof(cle); - cle.hContact = hContact; - cle.hIcon = hIcon; - cle.pszService = (char *)"BuddyExpectator/actionReturned"; - - char* nick = (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0); - char tmpMsg[512]; - mir_snprintf(tmpMsg, 512, "%s %s", nick, message); - cle.pszTooltip = tmpMsg; - - CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM) &cle); - } -} - -void GoneNotify(HANDLE hContact, char *message) -{ - if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1) - return; - - if (options.iShowPopUp2 > 0) - { - // Display PopUp - POPUPDATAT_V2 ppd = {0}; - ppd.cbSize = sizeof(POPUPDATAT_V2); - - ppd.lchContact = hContact; - ppd.lchIcon = hIcon; - strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME); - strncpy(ppd.lpzText, message, MAX_SECONDLINE); - if (!options.iUsePopupColors) - { - ppd.colorBack = options.iPopUpColorBack; - ppd.colorText = options.iPopUpColorFore; - } - ppd.PluginWindowProc = (WNDPROC)PopupDlgProcNoSet; - ppd.PluginData = NULL; - ppd.iSeconds = options.iPopUpDelay; - - CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, 0); - } - - if (options.iShowEvent2 > 0) - { - CLISTEVENT cle = {0}; - - cle.cbSize = sizeof(cle); - cle.hContact = hContact; - cle.hIcon = hIcon; - cle.pszService = (char *)"BuddyExpectator/actionStillAbsent"; - - char* nick = (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0); - char tmpMsg[512]; - mir_snprintf(tmpMsg, 512, "%s %s", nick, message); - cle.pszTooltip = tmpMsg; - - CallServiceSync(MS_CLIST_ADDEVENT, 0, (LPARAM) &cle); - } -} - -/** - * Miss you action (clist event click) - * when called from popup, wParam = (HANDLE)hContact and lParam == 0, - * when called from clist event, wParam = hWndCList, lParam = &CLISTEVENT - */ -int MissYouAction(WPARAM wParam, LPARAM lParam) -{ - HANDLE hContact; - if (lParam) - { - CLISTEVENT* cle = (CLISTEVENT*)lParam; - hContact = cle->hContact; - } else - hContact = (HANDLE)wParam; - - CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); - - return 0; -} - -/** - * Contact returned action (clist event click) - * when called from popup, wParam = (HANDLE)hContact and lParam == 0, - * when called from clist event, wParam = hWndCList, lParam = &CLISTEVENT - */ -int ContactReturnedAction(WPARAM wParam, LPARAM lParam) -{ - HANDLE hContact; - if (lParam) - { - CLISTEVENT* cle = (CLISTEVENT*)lParam; - hContact = cle->hContact; - } else - hContact = (HANDLE)wParam; - - if (options.iShowMessageWindow>0) - { - CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); - } - - if (options.iShowUDetails>0) - { - CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); - } - - setLastSeen(hContact); - - return 0; -} - -/** - * Contact not returned action (clist event click) - * when called from popup, wParam = (HANDLE)hContact and lParam == 0, - * when called from clist event, wParam = hWndCList, lParam = &CLISTEVENT - */ -int ContactStillAbsentAction(WPARAM wParam, LPARAM lParam) -{ - HANDLE hContact; - if (lParam) - { - CLISTEVENT* cle = (CLISTEVENT*)lParam; - hContact = cle->hContact; - } else - hContact = (HANDLE)wParam; - - switch (options.action2) - { - case GCA_DELETE: - CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0); - break; - case GCA_UDETAILS: - CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); - break; - case GCA_MESSAGE: - CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); - break; - case GCA_NOACTION: - break; - } - - return 0; -} - -/** - * Load icons either from icolib or built in - */ -int onIconsChanged(WPARAM wParam, LPARAM lParam) -{ - if (ServiceExists(MS_SKIN2_ADDICON)) - { - hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"main_icon"); - } - else - { - hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, 16, 16, 0); - } - - return 0; -} - -/** - * Menu item click action - */ -int MenuMissYouClick(WPARAM wParam, LPARAM lParam) -{ - if (DBGetContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0)) - { - DBWriteContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0); - if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECClear); - } - else - { - DBWriteContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 1); - if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECMissYou); - } - - return 0; -} - -/** - * Menu is about to appear - */ -int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) -{ - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); - if (!proto) return 0; - - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(CLISTMENUITEM); - - if (DBGetContactSettingByte((HANDLE)wParam, proto, "ChatRoom", 0) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)) - mi.flags = CMIM_FLAGS | CMIF_HIDDEN; - else - mi.flags = CMIM_FLAGS; - - if (DBGetContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0)) - { - mi.flags |= CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB; - mi.pszName = Translate("Disable Miss You"); - mi.icolibItem = hEnabledIcon; - } - else - { - mi.flags |= CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB; - mi.pszName = Translate("Enable Miss You"); - mi.icolibItem = hDisabledIcon; - } - - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hContactMenu, (LPARAM)&mi); - - return 0; -} - -int onExtraImageApplying(WPARAM wParam, LPARAM lParam) -{ - if (DBGetContactSettingByte((HANDLE)wParam,MODULE_NAME,"MissYou",0)) - CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECMissYou); - - return 0; -} - -int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam) -{ - g_IECMissYou.cbSize = sizeof(IconExtraColumn); - g_IECMissYou.ColumnType = options.MissYouIcon; - - if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) - { - if (ServiceExists(MS_SKIN2_ADDICON)) - { - g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"), (LPARAM)0); - } - else - { - g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ENABLED), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); - } - } - - return 0; -} - -/** - * ContactSettingChanged callback - */ -int SettingChanged(WPARAM wParam, LPARAM lParam) -{ - HANDLE hContact = (HANDLE) wParam; - DBCONTACTWRITESETTING *inf = (DBCONTACTWRITESETTING *) lParam; - - if (hContact == NULL || inf->value.type == DBVT_DELETED || strcmp(inf->szSetting, "Status") != 0) - return 0; - - if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1) - return 0; - - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); - if (proto == 0 || (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1) - || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)) - return 0; - - int currentStatus = inf->value.wVal; - int prevStatus = DBGetContactSettingWord(hContact, "UserOnline", "OldStatus", ID_STATUS_OFFLINE); - - if (currentStatus == prevStatus) - { - return 0; - } - - // Last status - DBWriteContactSettingDword(hContact, MODULE_NAME, "LastStatus", prevStatus); - - if (prevStatus == ID_STATUS_OFFLINE) - { - if (DBGetContactSettingByte(hContact, MODULE_NAME, "MissYou", 0)) - { - // Display PopUp - POPUPDATAT_V2 ppd = {0}; - ppd.cbSize = sizeof(POPUPDATAT_V2); - - ppd.lchContact = hContact; - ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"); - strncpy(ppd.lpzContactName, (char*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0), MAX_CONTACTNAME); - strncpy(ppd.lpzText, Translate("You awaited this contact!"), MAX_SECONDLINE); - if (!options.iUsePopupColors) - { - ppd.colorBack = options.iPopUpColorBack; - ppd.colorText = options.iPopUpColorFore; - } - ppd.PluginWindowProc = (WNDPROC)MissYouPopupDlgProc; - ppd.PluginData = NULL; - ppd.iSeconds = -1; - - missyouactions[0].flags = PAF_ENABLED; - ppd.lpActions = missyouactions; - ppd.actionCount = 1; - - CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NEWDATA); - - SkinPlaySound("buddyExpectatorMissYou"); - } - } - - if (currentStatus == ID_STATUS_OFFLINE) - { - setLastSeen(hContact); - return 0; - } - - /* - if (CallService(MS_IGNORE_ISIGNORED, (WPARAM) hContact, (LPARAM) IGNOREEVENT_USERONLINE)) - { - setLastSeen(hContact); - return 0; - } - */ - - if (DBGetContactSettingDword(hContact, MODULE_NAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline) - { - ReturnNotify(hContact, Translate("has gone online for the first time.")); - - setLastSeen(hContact); - } - - unsigned int AbsencePeriod = DBGetContactSettingDword(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod); - if (isContactGoneFor(hContact, AbsencePeriod)) - { - char* message = Translate("has returned after a long absence."); - time_t tmpTime; - char tmpBuf[251] = {0}; - tmpTime = getLastSeen(hContact); - if (tmpTime != -1) - { - strftime(tmpBuf, 250, Translate("has returned after being absent since %#x"), gmtime(&tmpTime)); - message = tmpBuf; - } - else - { - tmpTime = getLastInputMsg(hContact); - if (tmpTime != -1) - { - strftime(tmpBuf, 250, Translate("has returned after being absent since %#x"), gmtime(&tmpTime)); - message = tmpBuf; - } - } - - ReturnNotify(hContact, message); - - if ((options.iShowMessageWindow == 0 && options.iShowUDetails == 0) || (options.iShowEvent == 0 && options.iShowPopUp == 0)) - { - setLastSeen(hContact); - } - } else - setLastSeen(hContact); - - return 0; -} - -void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD) -{ - HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - char *proto; - while (hContact != 0) - { - proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); - if (proto && (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0) == 0)) - { - DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 1); - SkinPlaySound("buddyExpectatorStillAbsent"); - - char* message = Translate("has not returned after a long absence."); - time_t tmpTime; - char tmpBuf[251] = {0}; - tmpTime = getLastSeen(hContact); - if (tmpTime != -1) - { - strftime(tmpBuf, 250, Translate("has not returned after being absent since %#x"), gmtime(&tmpTime)); - message = tmpBuf; - } - else - { - tmpTime = getLastInputMsg(hContact); - if (tmpTime != -1) - { - strftime(tmpBuf, 250, Translate("has not returned after being absent since %#x"), gmtime(&tmpTime)); - message = tmpBuf; - } - } - - GoneNotify(hContact, message); - } - - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); - } -} -/** - * Called when all the modules have had their modules loaded event handlers called (dependence of popups on fontservice :( ) - */ -int ModulesLoaded2(WPARAM wParam, LPARAM lParam) -{ - // check for 'still absent' contacts on startup - TimerProc(0, 0, 0, 0); - - return 0; -} - -/** - * Called when all the modules are loaded - */ -int ModulesLoaded(WPARAM wParam, LPARAM lParam) -{ - hEventUserInfoInit = HookEvent(ME_USERINFO_INITIALISE, UserinfoInit); - - // add sounds support - SkinAddNewSoundEx("buddyExpectatorReturn", Translate("BuddyExpectator"), Translate("Contact returned")); - SkinAddNewSoundEx("buddyExpectatorStillAbsent", Translate("BuddyExpectator"), Translate("Contact still absent")); - SkinAddNewSoundEx("buddyExpectatorMissYou", Translate("BuddyExpectator"), Translate("Miss you event")); - SkinAddNewSoundEx("buddyExpectatorHide", Translate("BuddyExpectator"), Translate("Hide contact event")); - - timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours - - hModulesLoaded2 = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded2); - if (options.MissYouIcon) - { - hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild); - hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying); - g_IECClear.cbSize = sizeof(IconExtraColumn); - g_IECClear.ColumnType = options.MissYouIcon; - g_IECClear.hImage = (HANDLE) -1; - } - - // IcoLib support - if (ServiceExists(MS_SKIN2_ADDICON)) - { - SKINICONDESC sid = {0}; - char szFile[MAX_PATH]; - GetModuleFileNameA(hInst, szFile, MAX_PATH); - sid.pszDefaultFile = szFile; - sid.cbSize = SKINICONDESC_SIZE_V1; - - sid.pszSection = Translate("BuddyExpectator"); - - sid.pszDescription = Translate("Tray/popup icon"); - sid.pszName = "main_icon"; - sid.iDefaultIndex = -IDI_MAINICON; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - - sid.pszDescription = Translate("Enabled"); - sid.pszName = "enabled_icon"; - sid.iDefaultIndex = -IDI_ENABLED; - hEnabledIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - - sid.pszDescription = Translate("Disabled"); - sid.pszName = "disabled_icon"; - sid.iDefaultIndex = -IDI_DISABLED; - hDisabledIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - - sid.pszDescription = Translate("Hide"); - sid.pszName = "hide_icon"; - sid.iDefaultIndex = -IDI_HIDE; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - - sid.pszDescription = Translate("NeverHide"); - sid.pszName = "neverhide_icon"; - sid.iDefaultIndex = -IDI_NEVERHIDE; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); - - hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged); - } - - onIconsChanged(0,0); - - if (options.enableMissYou) - { - hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); - - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(CLISTMENUITEM); - mi.flags = CMIF_ICONFROMICOLIB; - mi.icolibItem = hDisabledIcon; - mi.position = 200000; - mi.pszName = Translate("Enable Miss You"); - mi.pszService = "BuddyExpectator/actionMissYouClick"; - hContactMenu = (HANDLE) CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM) & mi); - } - - // Updater plugin support - if (ServiceExists(MS_UPDATE_REGISTER)) - { - // register with updater - Update update = {0}; - char szVersion[16]; - - update.cbSize = sizeof(Update); - - update.szComponentName = pluginInfo.shortName; - update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); - update.cpbVersion = strlen((char *)update.pbVersion); - - update.szUpdateURL = UPDATER_AUTOREGISTER; - - // these are the three lines that matter - the archive, the page containing the version string, and the text (or data) - // before the version that we use to locate it on the page - // (note that if the update URL and the version URL point to standard file listing entries, the backend xml - // data will be used to check for updates rather than the actual web page - this is not true for beta urls) - update.szBetaUpdateURL = "http://thief.miranda.im/BuddyExpectator.zip"; - update.szBetaVersionURL = "http://thief.miranda.im/updater/buddyexpectator_version.txt"; - update.szBetaChangelogURL = "http://thief.miranda.im"; - update.pbBetaVersionPrefix = (BYTE *)"Buddy Expectator "; - - update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix); - - CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); - } - - missyouactions[0].cbSize = sizeof(POPUPACTION); - missyouactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"disabled_icon"); - lstrcpy(missyouactions[0].lpzTitle, Translate("Disable Miss You")); - missyouactions[0].wParam = missyouactions[0].lParam = 1; - - hideactions[0].cbSize = sizeof(POPUPACTION); - hideactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"hide_icon"); - lstrcpy(hideactions[0].lpzTitle, Translate("Hide contact")); - hideactions[0].wParam = hideactions[0].lParam = 2; - - hideactions[1].cbSize = sizeof(POPUPACTION); - hideactions[1].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"neverhide_icon"); - lstrcpy(hideactions[1].lpzTitle, Translate("Never hide this contact")); - hideactions[1].wParam = hideactions[1].lParam = 3; - - return 0; -} - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfo; -} - -extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) -{ - return &oldpluginInfo; -} - -int ContactAdded(WPARAM wParam, LPARAM lParam) -{ - DBWriteContactSettingDword((HANDLE)wParam, MODULE_NAME, "CreationTime", (DWORD)time(0)); - return 0; -} - -int onSystemOKToExit(WPARAM wParam,LPARAM lParam) -{ - UnhookEvent(hEventContactSetting); - UnhookEvent(hEventContactAdded); - UnhookEvent(hEventUserInfoInit); - if (hPrebuildContactMenu) UnhookEvent(hPrebuildContactMenu); - UnhookEvent(hIcoLibIconsChanged); - UnhookEvent(hModulesLoaded); - UnhookEvent(hModulesLoaded2); - UnhookEvent(hSystemOKToExit); - UnhookEvent(hHookExtraIconsRebuild); - UnhookEvent(hHookExtraIconsApply); - - DestroyServiceFunction(hContactReturnedAction); - DestroyServiceFunction(hContactStillAbsentAction); - DestroyServiceFunction(hMissYouAction); - DestroyServiceFunction(hMenuMissYouClick); - - DeinitOptions(); - - if (hIcoLibIconsChanged) - CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0); - else - DestroyIcon(hIcon); - - return 0; -} - -extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) -{ - pluginLink = link; - - setlocale(LC_ALL, "English"); // Set English locale - - InitOptions(); - - hContactReturnedAction = CreateServiceFunction("BuddyExpectator/actionReturned", ContactReturnedAction); - hContactStillAbsentAction = CreateServiceFunction("BuddyExpectator/actionStillAbsent", ContactStillAbsentAction); - hMissYouAction = CreateServiceFunction("BuddyExpectator/actionMissYou", MissYouAction); - hMenuMissYouClick = CreateServiceFunction("BuddyExpectator/actionMissYouClick", MenuMissYouClick); - - hEventContactSetting = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged); - hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); - hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit); - - hEventContactAdded = HookEvent(ME_DB_CONTACT_ADDED, ContactAdded); - - // ensure all contacts are timestamped - DBVARIANT dbv; - HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - DWORD current_time = (DWORD)time(0); - while (hContact != 0) - { - if (!DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv)) - DBFreeVariant(&dbv); - else - DBWriteContactSettingDword(hContact, MODULE_NAME, "CreationTime", current_time); - - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); - } - - return 0; -} - -extern "C" int __declspec(dllexport) Unload(void) -{ - KillTimer(0, timer_id); - - return 0; -} - diff --git a/buddyexpectator/BuddyExpectator.dsp b/buddyexpectator/BuddyExpectator.dsp deleted file mode 100644 index b8a0eca..0000000 --- a/buddyexpectator/BuddyExpectator.dsp +++ /dev/null @@ -1,119 +0,0 @@ -# Microsoft Developer Studio Project File - Name="BuddyExpectator" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=BuddyExpectator - Win32 Debug -!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 "BuddyExpectator.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 "BuddyExpectator.mak" CFG="BuddyExpectator - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "BuddyExpectator - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "BuddyExpectator - Win32 Debug" (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)" == "BuddyExpectator - 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 Target_Dir "" -# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUDDYEXPECTATOR_EXPORTS" /Yu"stdafx.h" /FD /c -# ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUDDYEXPECTATOR_EXPORTS" /FD /c -# SUBTRACT CPP /YX /Yc /Yu -# 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 /nologo /dll /machine:I386 - -!ELSEIF "$(CFG)" == "BuddyExpectator - 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 Target_Dir "" -# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUDDYEXPECTATOR_EXPORTS" /Yu"stdafx.h" /FD /GZ /c -# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "BUDDYEXPECTATOR_EXPORTS" /FD /GZ /c -# SUBTRACT CPP /YX /Yc /Yu -# 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 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 - -!ENDIF - -# Begin Target - -# Name "BuddyExpectator - Win32 Release" -# Name "BuddyExpectator - Win32 Debug" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=.\BuddyExpectator.cpp -# End Source File -# Begin Source File - -SOURCE=.\BuddyExpectator.rc -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# 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=.\icon1.ico -# End Source File -# End Group -# Begin Source File - -SOURCE=.\ReadMe.txt -# End Source File -# End Target -# End Project diff --git a/buddyexpectator/BuddyExpectator.dsw b/buddyexpectator/BuddyExpectator.dsw deleted file mode 100644 index 64425ef..0000000 --- a/buddyexpectator/BuddyExpectator.dsw +++ /dev/null @@ -1,29 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "BuddyExpectator"=.\BuddyExpectator.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/buddyexpectator/BuddyExpectator.mdsp b/buddyexpectator/BuddyExpectator.mdsp deleted file mode 100644 index 35eb1ee..0000000 --- a/buddyexpectator/BuddyExpectator.mdsp +++ /dev/null @@ -1,101 +0,0 @@ -[Project] -name=BuddyExpectator -type=2 -defaultConfig=1 - - -[Debug] -// compiler -workingDirectory= -arguments= -intermediateFilesDirectory=Debug -outputFilesDirectory=Debug -compilerPreprocessor= -extraCompilerOptions= -compilerIncludeDirectory=..\..\include -noWarning=0 -defaultWarning=0 -allWarning=1 -extraWarning=0 -isoWarning=0 -warningsAsErrors=0 -debugType=1 -debugLevel=2 -exceptionEnabled=1 -runtimeTypeEnabled=1 -optimizeLevel=0 - -// linker -libraryPath= -outputFilename=Debug\BuddyExpectator.dll -libraries= -extraLinkerOptions= -ignoreStartupFile=0 -ignoreDefaultLibs=0 -stripExecutableFile=0 - -// archive -extraArchiveOptions= - -//resource -resourcePreprocessor= -resourceIncludeDirectory= -extraResourceOptions= - -[Release] -// compiler -workingDirectory= -arguments= -intermediateFilesDirectory=Release -outputFilesDirectory=Release -compilerPreprocessor= -extraCompilerOptions= -compilerIncludeDirectory=..\..\include -noWarning=0 -defaultWarning=0 -allWarning=1 -extraWarning=0 -isoWarning=0 -warningAsErrors=0 -debugType=0 -debugLevel=1 -exceptionEnabled=1 -runtimeTypeEnabled=1 -optimizeLevel=4 - -// linker -libraryPath= -outputFilename=Release\BuddyExpectator.dll -libraries= -extraLinkerOptions= -ignoreStartupFile=0 -ignoreDefaultLibs=0 -stripExecutableFile=1 - -// archive -extraArchiveOptions= - -//resource -resourcePreprocessor= -resourceIncludeDirectory= -extraResourceOptions= - -[Source] -1=BuddyExpectator.cpp -2=options.cpp -[Header] -1=common.h -2=options.h -3=resource.h -[Resource] -1=BuddyExpectator.rc -[Other] -1=docs\BuddyExpectator-Readme.txt -2=docs\BuddyExpectator-Translate.txt -[History] -options.cpp,3318 -common.h,1734 -options.h,1513 -docs\BuddyExpectator-Readme.txt,325 -docs\BuddyExpectator-Translate.txt,0 -BuddyExpectator.cpp,22589 diff --git a/buddyexpectator/BuddyExpectator.rc b/buddyexpectator/BuddyExpectator.rc deleted file mode 100644 index 39584af..0000000 --- a/buddyexpectator/BuddyExpectator.rc +++ /dev/null @@ -1,216 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_OPTIONSPANEL DIALOGEX 0, 0, 227, 219 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0xCC -BEGIN - LTEXT "When a contact returns after ",IDC_STATIC,21,16,112,8 - EDITTEXT IDC_EDIT_ABSENCE,137,13,22,13,ES_AUTOHSCROLL - COMBOBOX IDC_COMBO_PERIOD,161,13,49,51,CBS_DROPDOWNLIST | - WS_TABSTOP - CONTROL "Show a popup",IDC_CHECK_POPUP,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,38,189,10 - CONTROL "Add an event (flashing icon) to the contact", - IDC_CHECK_FLASHICON,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,21,51,187,10 - LTEXT "On event action (double click) or popup click:", - IDC_STATIC,21,63,187,8 - CONTROL "Open User Details",IDC_CHECK_UDETAILS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,32,75,176,10 - CONTROL "Open message window",IDC_CHECK_MSGWINDOW,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,32,86,176,10 - GROUPBOX "Return notification",IDC_STATIC,14,3,199,95 - LTEXT "When a contact is absent for",IDC_STATIC,20,114,112,8 - EDITTEXT IDC_EDIT_ABSENCE2,136,111,22,13,ES_AUTOHSCROLL - COMBOBOX IDC_COMBO_PERIOD2,160,111,49,51,CBS_DROPDOWNLIST | - WS_TABSTOP - GROUPBOX "Long time no see",IDC_STATIC,13,102,199,94 - CONTROL "or comes online for the first time", - IDC_CHECK_FIRSTSIGHT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,32,27,176,10 - CONTROL "Show a popup",IDC_CHECK_POPUP2,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,20,127,189,10 - CONTROL "Add an event (flashing icon) to the contact", - IDC_CHECK_FLASHICON2,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,20,140,187,10 - LTEXT "On event action (double click) or popup click:", - IDC_STATIC,20,152,187,8 - CONTROL "Enable ""Miss you"" feature",IDC_CHECK_MISSYOU,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,20,201,186,9 - EDITTEXT IDC_EDIT_SILENTFOR,135,179,22,13,ES_AUTOHSCROLL - COMBOBOX IDC_COMBO_PERIOD3,159,179,49,51,CBS_DROPDOWNLIST | - WS_TABSTOP - CONTROL "Hide when no messages for",IDC_CHECK_NOMSGS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,20,180,113,11 - COMBOBOX IDC_COMBO_ACTIONS,32,163,100,57,CBS_DROPDOWNLIST | - WS_TABSTOP -END - -IDD_POPUPPANEL DIALOGEX 0, 0, 190, 134 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - GROUPBOX "Colors",IDC_STATIC,7,7,176,42 - LTEXT "Background",IDC_STATIC,17,19,46,8 - LTEXT "Text",IDC_STATIC,17,34,46,8 - CONTROL "",IDC_COLOR_BGR,"ColourPicker",WS_TABSTOP,61,17,26,12 - CONTROL "",IDC_COLOR_FRG,"ColourPicker",WS_TABSTOP,61,32,26,12 - CONTROL "Use Popups colors",IDC_COLORS_POPUP,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,94,17,82,12 - CONTROL "Use Windows colors",IDC_COLORS_WIN,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,94,33,82,9 - GROUPBOX "Delay",IDC_STATIC,7,50,176,52 - CONTROL "Default",IDC_DELAY_DEF,"Button",BS_AUTORADIOBUTTON | - WS_GROUP | WS_TABSTOP,18,61,120,10 - CONTROL "Custom",IDC_DELAY_CUST,"Button",BS_AUTORADIOBUTTON,18, - 74,62,10 - CONTROL "Permanent",IDC_DELAY_PERM,"Button",BS_AUTORADIOBUTTON, - 18,87,119,10 - EDITTEXT IDC_EDIT_POPUPDELAY,81,72,30,14,ES_AUTOHSCROLL - LTEXT "sec",IDC_STATIC,116,75,34,8 - PUSHBUTTON "Preview",IDC_PREVIEW,58,106,75,17 -END - -IDD_USERINFO DIALOGEX 0, 0, 222, 132 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - LTEXT "Last seen online:",IDC_STATIC,7,7,85,8 - EDITTEXT IDC_EDIT_LASTSEEN,99,7,116,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER - LTEXT "Last input message:",IDC_STATIC,7,22,85,8 - EDITTEXT IDC_EDIT_LASTINPUT,99,22,116,12,ES_AUTOHSCROLL | - ES_READONLY | NOT WS_BORDER - LTEXT "Custom absence period:",IDC_STATIC,7,36,85,12 - EDITTEXT IDC_EDITABSENCE,101,35,31,12,ES_AUTOHSCROLL - CONTROL "",IDC_SPINABSENCE,"msctls_updown32",UDS_SETBUDDYINT | - UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | - UDS_NOTHOUSANDS,163,14,8,13 - LTEXT "days",IDC_STATIC,138,36,77,10 - EDITTEXT IDC_EDIT_WILLNOTICE,7,93,208,30,ES_MULTILINE | - ES_READONLY | NOT WS_BORDER - CONTROL "Never hide this contact",IDC_CHECK_NEVERHIDE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,75,180,12 - CONTROL "Enable Miss You",IDC_CHECK_MISSYOU,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,7,47,200,19 - CONTROL "Notify always",IDC_CHECK_NOTIFYALWAYS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,27,64,188,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_OPTIONSPANEL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 220 - TOPMARGIN, 7 - BOTTOMMARGIN, 217 - END - - IDD_POPUPPANEL, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 183 - TOPMARGIN, 7 - BOTTOMMARGIN, 127 - END - - IDD_USERINFO, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 215 - VERTGUIDE, 92 - VERTGUIDE, 99 - TOPMARGIN, 7 - BOTTOMMARGIN, 125 - END -END -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_MAINICON ICON "icons\\main.ico" -IDI_ENABLED ICON "icons\\enabled.ico" -IDI_DISABLED ICON "icons\\disabled.ico" -IDI_HIDE ICON "icons\\hide.ico" -IDI_NEVERHIDE ICON "icons\\neverhide.ico" -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/buddyexpectator/BuddyExpectator10.sln b/buddyexpectator/BuddyExpectator10.sln deleted file mode 100644 index cf4b219..0000000 --- a/buddyexpectator/BuddyExpectator10.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BuddyExpectator", "BuddyExpectator10.vcxproj", "{8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Debug|Win32.ActiveCfg = Release|Win32 - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Debug|Win32.Build.0 = Release|Win32 - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Release|Win32.ActiveCfg = Release|Win32 - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/buddyexpectator/BuddyExpectator10.vcxproj b/buddyexpectator/BuddyExpectator10.vcxproj deleted file mode 100644 index 8bfceda..0000000 --- a/buddyexpectator/BuddyExpectator10.vcxproj +++ /dev/null @@ -1,160 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - - BuddyExpectator - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8} - BuddyExpectator - - - - DynamicLibrary - false - MultiByte - - - DynamicLibrary - false - MultiByte - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - true - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - AllRules.ruleset - - - AllRules.ruleset - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/BuddyExpectator.tlb - - - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS;%(PreprocessorDefinitions) - true - EnableFastChecks - MultiThreadedDebug - .\Debug/BuddyExpectator.pch - .\Debug/ - .\Debug/ - .\Debug/ - Level3 - true - EditAndContinue - 4996;%(DisableSpecificWarnings) - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - - - ../../bin/$(Configuration)/plugins/BuddyExpectator.dll - true - true - .\Debug/BuddyExpectator.pdb - .\Debug/BuddyExpectator.lib - MachineX86 - - - true - .\Debug/BuddyExpectator.bsc - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/BuddyExpectator.tlb - - - - - Full - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;BUDDYEXPECTATOR_EXPORTS;%(PreprocessorDefinitions) - true - MultiThreaded - true - Level3 - true - 4996;%(DisableSpecificWarnings) - Size - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - - - true - true - MachineX86 - true - true - - - true - - - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/buddyexpectator/BuddyExpectator8.sln b/buddyexpectator/BuddyExpectator8.sln deleted file mode 100644 index 008ccbe..0000000 --- a/buddyexpectator/BuddyExpectator8.sln +++ /dev/null @@ -1,20 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BuddyExpectator", "BuddyExpectator.vcproj", "{8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Debug|Win32.ActiveCfg = Debug|Win32 - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Debug|Win32.Build.0 = Debug|Win32 - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Release|Win32.ActiveCfg = Release|Win32 - {8CEBD7AC-CD02-4BEC-B889-A7243F3E5DD8}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/buddyexpectator/BuddyExpectator8.vcproj b/buddyexpectator/BuddyExpectator8.vcproj deleted file mode 100644 index 43b58f5..0000000 --- a/buddyexpectator/BuddyExpectator8.vcproj +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/buddyexpectator/buddyexpectator.sln b/buddyexpectator/buddyexpectator.sln deleted file mode 100644 index 058e392..0000000 --- a/buddyexpectator/buddyexpectator.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "buddyexpectator", "buddyexpectator.vcproj", "{29FC6E79-39E6-469F-9899-158770B87F30}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - EndGlobalSection - GlobalSection(ProjectConfiguration) = postSolution - {29FC6E79-39E6-469F-9899-158770B87F30}.Debug.ActiveCfg = Debug|Win32 - {29FC6E79-39E6-469F-9899-158770B87F30}.Debug.Build.0 = Debug|Win32 - {29FC6E79-39E6-469F-9899-158770B87F30}.Release.ActiveCfg = Release|Win32 - {29FC6E79-39E6-469F-9899-158770B87F30}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal diff --git a/buddyexpectator/buddyexpectator.vcproj b/buddyexpectator/buddyexpectator.vcproj deleted file mode 100644 index 1040e28..0000000 --- a/buddyexpectator/buddyexpectator.vcproj +++ /dev/null @@ -1,185 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/buddyexpectator/buddyexpectator_version.txt b/buddyexpectator/buddyexpectator_version.txt deleted file mode 100644 index f867b26..0000000 --- a/buddyexpectator/buddyexpectator_version.txt +++ /dev/null @@ -1 +0,0 @@ -Buddy Expectator 0.1.2.3 \ No newline at end of file diff --git a/buddyexpectator/common.h b/buddyexpectator/common.h deleted file mode 100644 index 6398727..0000000 --- a/buddyexpectator/common.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Buddy Expectator+ plugin for Miranda-IM (www.miranda-im.org) - (c)2005 Anar Ibragimoff (ai91@mail.ru) - (c)2006 Scott Ellis (mail@scottellis.com.au) - (c)2007 Alexander Turyak (thief@miranda-im.org.ua) - - 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 - - File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/common.h $ - Revision : $Rev: 1392 $ - Last change on : $Date: 2009-04-22 17:46:08 +0300 (Ср, 22 апр 2009) $ - Last change by : $Author: Thief $ -*/ - -#ifndef _COMMON_INC -#define _COMMON_INC - -#include // needed by m_icolib.h > r9256 -#include -#include -#include -#include -#include -#include "resource.h" -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "m_popup.h" -#include "m_popup2.h" -#include "m_updater.h" -#include "m_cluiframes.h" - -#define MODULE_NAME "BuddyExpectator" - -extern HINSTANCE hInst; -extern PLUGINLINK *pluginLink; - -void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD); -extern DWORD timer_id; - -#endif diff --git a/buddyexpectator/docs/BuddyExpectator-Readme.txt b/buddyexpectator/docs/BuddyExpectator-Readme.txt deleted file mode 100644 index ea4f526..0000000 --- a/buddyexpectator/docs/BuddyExpectator-Readme.txt +++ /dev/null @@ -1,63 +0,0 @@ -BuddyExpectator+ plugin v0.1.2.3 -This plugin notifies about contacts who has returned after an absence of long period. - -Features: - - Supports Popups module - - You may specify a sound for its' event - - Logs 'last seen' statistics (use User Details dialog) - - Uses built-in 'Ignore' list - -Version history: - -0.1.2.3 -- added extraicons for MissYou via hidden key (byte)bMissYouIcon - icon slot number -- added MissYou options to UserInfo page -- some fixes - -0.1.2.2 -- key BuddyExpectator/LastStatus is written to contact's module -- fixes to unload code - -0.1.2.1 -- bugfixes - -0.1.2.0 -- added an option to hide inactive contacts -- added an option to set custom absence perion for a contact -- addded support for Popup+ actions -- removed ignore online check -- changed icons (thanks to a0x and induction) -- implemended IcoLib API for menu icons (requires Miranda 0.7) -- implemented new plugin API -- implemented Updater support for beta versions - -0.0.0.7-0.0.1.2 (by Thief) -- percontact notification period setting -- IcoLib support -- implemented "Miss You" feature -- more popups colors options -- disabled notifications for non-IM protocols - -0.0.0.3-0.0.0.6 (by sje) -- "long time no see" feature -- first time online notification -- storing contact creation date in db -- other fixes including memleaks clearing - -0.0.0.1-0.0.0.2 -- initial version by Anar Ibragimoff - -Why -'Status notifyer'-like plugins are preety good... while your contactlist contains just 5, 10, 20 buddies. -Mine includes over 100 persons (family, friends, colleagues, messmates...). And every moment somebody goes offline, -others come back... So my left side of screen is always flickering with green/red popups ;-) -Sure, I can turn them off... But I want to be notified when somebody comes back after a vacation, business -trip, maternity leave ;-) -I found 'Contacts Notifier', but it's really inconveniently to watch for all buddies and their activity... and setup -a notifyer for everyone who has gone... -So I have thought out to notify just about contacts who were offline for a long time. -In other words, it works like 'Last seen' plugin, but with notification ;-) - -(c) 2007-2008, Alexander Turyak (turyak@gmail.com) -(c) 2006, Scott Ellis (mail@scottellis.com.au) -(c) 2005, Anar Ibragimoff, Minsk, Belarus (ai91@mail.ru) \ No newline at end of file diff --git a/buddyexpectator/docs/BuddyExpectator-Translate.txt b/buddyexpectator/docs/BuddyExpectator-Translate.txt deleted file mode 100644 index a140810..0000000 --- a/buddyexpectator/docs/BuddyExpectator-Translate.txt +++ /dev/null @@ -1,42 +0,0 @@ -;Translation template for BuddyExpectator+ plugin v0.1.2.x -;please do NOT change %#x and %d in your translation -[Buddy Expectator] -[has gone online for the first time.] -[has returned after a long absence.] -[has returned after being absent since %#x] -[has not returned after being absent since %#x] -[has not returned after a long absence.] -[not detected] -[not found] -[This contact has been absent for an extended period of time.] -[has returned after being absent since %d days] -[Contact returned] -[Contact still absent] -[Miss you event] -[Hide contact event] -[You awaited this contact!] -[Contact name] -[Hide contact] -[Enable Miss You] -[Disable Miss You] -[Tray/popup icon] - -;dialogs -[Last seen online:] -[Last input message:] -[Custom absence period:] -[Never hide this contact] -[Notify always] -[Return notification] -[When a contact returns after] -[or comes online for the first time] -[Show a popup] -[Add an event (flashing icon) to the contact] -[On event action (double click) or popup click:] -[Open User Details] -[Open message window] -[Long time no see] -[When a contact is absent for] -[Do nothing] -[Delete the contact] -[Enable "Miss you" feature] \ No newline at end of file diff --git a/buddyexpectator/icons/disabled.ico b/buddyexpectator/icons/disabled.ico deleted file mode 100644 index 5280ef1..0000000 Binary files a/buddyexpectator/icons/disabled.ico and /dev/null differ diff --git a/buddyexpectator/icons/enabled.ico b/buddyexpectator/icons/enabled.ico deleted file mode 100644 index 316b22b..0000000 Binary files a/buddyexpectator/icons/enabled.ico and /dev/null differ diff --git a/buddyexpectator/icons/hide.ico b/buddyexpectator/icons/hide.ico deleted file mode 100644 index deff488..0000000 Binary files a/buddyexpectator/icons/hide.ico and /dev/null differ diff --git a/buddyexpectator/icons/main.ico b/buddyexpectator/icons/main.ico deleted file mode 100644 index e7e514f..0000000 Binary files a/buddyexpectator/icons/main.ico and /dev/null differ diff --git a/buddyexpectator/icons/neverhide.ico b/buddyexpectator/icons/neverhide.ico deleted file mode 100644 index 8a6347b..0000000 Binary files a/buddyexpectator/icons/neverhide.ico and /dev/null differ diff --git a/buddyexpectator/options.cpp b/buddyexpectator/options.cpp deleted file mode 100644 index 6ebe7f3..0000000 --- a/buddyexpectator/options.cpp +++ /dev/null @@ -1,628 +0,0 @@ -/* - Buddy Expectator+ plugin for Miranda-IM (www.miranda-im.org) - (c)2005 Anar Ibragimoff (ai91@mail.ru) - (c)2006 Scott Ellis (mail@scottellis.com.au) - (c)2007,2008 Alexander Turyak (thief@miranda-im.org.ua) - - 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 - - File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/options.cpp $ - Revision : $Rev: 1003 $ - Last change on : $Date: 2008-01-12 17:15:47 +0200 (Сб, 12 янв 2008) $ - Last change by : $Author: Thief $ -*/ - -#include "common.h" -#include "options.h" - -#define DEF_COLOR_BACK 0xCEF7AD -#define DEF_COLOR_FORE 0x000000 - -extern HICON hIcon; -extern time_t getLastSeen(HANDLE); -extern time_t getLastInputMsg(HANDLE); -extern bool isContactGoneFor(HANDLE, int); -Options options; - -void LoadOptions() -{ - options.iAbsencePeriod = DBGetContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod", 14); - options.iAbsencePeriod2 = DBGetContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod2", 30 * 3); - options.iSilencePeriod = DBGetContactSettingDword(NULL, MODULE_NAME, "iSilencePeriod", 30); - options.iShowPopUp = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowPopUp", 1); - options.iShowEvent = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowEvent", 0); - options.iShowUDetails = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowUDetails", 0); - options.iShowMessageWindow = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowMessageWindow", 1); - options.iPopUpColorBack = DBGetContactSettingDword(NULL, MODULE_NAME, "iPopUpColorBack", DEF_COLOR_BACK); - options.iPopUpColorFore = DBGetContactSettingDword(NULL, MODULE_NAME, "iPopUpColorFore", DEF_COLOR_FORE); - options.iUsePopupColors = DBGetContactSettingByte(NULL, MODULE_NAME, "iUsePopupColors", 0); - options.iUseWinColors = DBGetContactSettingByte(NULL, MODULE_NAME, "iUseWinColors", 0); - options.iPopUpDelay = DBGetContactSettingByte(NULL, MODULE_NAME, "iPopUpDelay", 0); - - options.iShowPopUp2 = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowPopUp2", 1); - options.iShowEvent2 = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowEvent2", 0); - options.action2 = (GoneContactAction)DBGetContactSettingByte(NULL, MODULE_NAME, "Action2", (BYTE)GCA_NOACTION); - options.notifyFirstOnline = DBGetContactSettingByte(NULL, MODULE_NAME, "bShowFirstSight", 0) ? true : false; - options.hideInactive = DBGetContactSettingByte(NULL, MODULE_NAME, "bHideInactive", 0) ? true : false; - options.enableMissYou = DBGetContactSettingByte(NULL, MODULE_NAME, "bMissYouEnabled", 1) ? true : false; - options.MissYouIcon = DBGetContactSettingByte(NULL, MODULE_NAME, "bMissYouIcon", 0); -} - -void SaveOptions() -{ - DBWriteContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod); - DBWriteContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod2", options.iAbsencePeriod2); - DBWriteContactSettingDword(NULL, MODULE_NAME, "iSilencePeriod", options.iSilencePeriod); - DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowPopUp", options.iShowPopUp); - DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowEvent", options.iShowEvent); - DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowUDetails", options.iShowUDetails); - DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowMessageWindow", options.iShowMessageWindow); - - DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowPopUp2", options.iShowPopUp2); - DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowEvent2", options.iShowEvent2); - DBWriteContactSettingByte(NULL, MODULE_NAME, "Action2", (BYTE)options.action2); - DBWriteContactSettingByte(NULL, MODULE_NAME, "bShowFirstSight", options.notifyFirstOnline ? 1 : 0); - DBWriteContactSettingByte(NULL, MODULE_NAME, "bHideInactive", options.hideInactive ? 1 : 0); - DBWriteContactSettingByte(NULL, MODULE_NAME, "bMissYouEnabled", options.enableMissYou ? 1 : 0); -} - - -void SavePopupOptions() -{ - DBWriteContactSettingDword(NULL, MODULE_NAME, "iPopUpColorBack", options.iPopUpColorBack); - DBWriteContactSettingDword(NULL, MODULE_NAME, "iPopUpColorFore", options.iPopUpColorFore); - DBWriteContactSettingByte(NULL, MODULE_NAME, "iUsePopupColors", options.iUsePopupColors); - DBWriteContactSettingByte(NULL, MODULE_NAME, "iUseWinColors", options.iUseWinColors); - DBWriteContactSettingByte(NULL, MODULE_NAME, "iPopUpDelay", options.iPopUpDelay); -} - -/** - * Options panel function - */ -static int CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) - { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - - if (!ServiceExists(MS_POPUP_ADDPOPUP)) - { - EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), FALSE); - } - - //iAbsencePeriod - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("days")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("weeks")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("months")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) Translate("years")); - if (options.iAbsencePeriod % 365 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/365, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 3, 0); - } - else if (options.iAbsencePeriod % 30 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/30, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 2, 0); - } - else if (options.iAbsencePeriod % 7 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/7, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 1, 0); - } - else - { - SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 0, 0); - } - - //iAbsencePeriod2 - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("days")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("weeks")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("months")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) Translate("years")); - if (options.iAbsencePeriod2 % 365 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/365, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 3, 0); - } - else if (options.iAbsencePeriod2 % 30 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/30, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 2, 0); - } - else if (options.iAbsencePeriod2 % 7 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/7, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 1, 0); - } - else - { - SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2,options.iAbsencePeriod2, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 0, 0); - } - - //iSilencePeriod - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("days")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("weeks")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("months")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) Translate("years")); - if (options.iSilencePeriod % 365 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/365, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 3, 0); - } - else if (options.iSilencePeriod % 30 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/30, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 2, 0); - } - else if (options.iSilencePeriod % 7 == 0) - { - SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/7, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 1, 0); - } - else - { - SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR,options.iSilencePeriod, FALSE); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 0, 0); - } - - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_SETCHECK, options.iShowPopUp > 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_SETCHECK, options.iShowEvent > 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_SETCHECK, (options.iShowUDetails > 0 ? BST_CHECKED : BST_UNCHECKED), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_SETCHECK, (options.iShowMessageWindow > 0 ? BST_CHECKED : BST_UNCHECKED), 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_SETCHECK, options.notifyFirstOnline ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_SETCHECK, options.hideInactive ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_SETCHECK, options.enableMissYou ? BST_CHECKED : BST_UNCHECKED, 0); - - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_SETCHECK, options.iShowPopUp2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_SETCHECK, options.iShowEvent2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0); - - - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_RESETCONTENT, 0, 0); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Do nothing")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Delete the contact")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Open User Details")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) Translate("Open message window")); - SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_SETCURSEL, options.action2, 0); - - return TRUE; - case WM_COMMAND: - if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) - || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE), EM_GETMODIFY, 0, 0))) - || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE2), EM_GETMODIFY, 0, 0))) - || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_SILENTFOR), EM_GETMODIFY, 0, 0)))) - { - SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); - } - break; - case WM_NOTIFY: - { - NMHDR* nmhdr = (NMHDR*)lParam; - switch (nmhdr->code) - { - case PSN_APPLY: - - //iAbsencePeriod - int num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, 0, FALSE); - switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_GETCURSEL, 0, 0)) - { - case 1: options.iAbsencePeriod = 7 * num; break; - case 2: options.iAbsencePeriod = 30 * num; break; - case 3: options.iAbsencePeriod = 365 * num; break; - default: options.iAbsencePeriod = num; break; - } - - //iAbsencePeriod2 - num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, 0, FALSE); - switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_GETCURSEL, 0, 0)) - { - case 1: options.iAbsencePeriod2 = 7 * num; break; - case 2: options.iAbsencePeriod2 = 30 * num; break; - case 3: options.iAbsencePeriod2 = 365 * num; break; - default: options.iAbsencePeriod2 = num; break; - } - - //iSilencePeriod - num = GetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, 0, FALSE); - switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_GETCURSEL, 0, 0)) - { - case 1: options.iSilencePeriod = 7 * num; break; - case 2: options.iSilencePeriod = 30 * num; break; - case 3: options.iSilencePeriod = 365 * num; break; - default: options.iSilencePeriod = num; break; - } - - options.iShowPopUp = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.iShowEvent = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.iShowUDetails = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.iShowMessageWindow = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.notifyFirstOnline = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; - options.hideInactive = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; - options.enableMissYou = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false; - - options.iShowPopUp2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - options.iShowEvent2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0; - - options.action2 = (GoneContactAction)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_GETCURSEL, 0, 0); - - // save values to the DB - SaveOptions(); - - // clear all notified settings - HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - while (hContact != 0) - { - if(DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0)) - DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0); - - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); - } - - // restart timer & run check - KillTimer(0, timer_id); - timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours - TimerProc(0, 0, 0, 0); - return TRUE; - } - break; - } - } - return 0; -} - -/** - * PopUp Options panel function - */ -static int CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - static int ChangeLock = 0; - switch (uMsg) - { - case WM_INITDIALOG: - - ChangeLock++; - TranslateDialogDefault(hwndDlg); - - //iPopUpColorBack - SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_SETCOLOUR, 0, options.iPopUpColorBack); - - //iPopUpColorFore - SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_SETCOLOUR, 0, options.iPopUpColorFore); - - if (options.iUsePopupColors) - { - CheckDlgButton(hwndDlg, IDC_COLORS_POPUP, BST_CHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), false); - } - - if (options.iUseWinColors) - { - CheckDlgButton(hwndDlg, IDC_COLORS_WIN, BST_CHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), false); - } - - //iPopUpDelay - SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 5, FALSE); - if (options.iPopUpDelay < 0) - { - SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_SETCHECK, BST_CHECKED, 0); - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false); - } - else if(options.iPopUpDelay == 0) - { - SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_SETCHECK, BST_CHECKED, 0); - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false); - } - else - { - SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_CUST), BM_SETCHECK, BST_CHECKED, 0); - SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, options.iPopUpDelay, FALSE); - } - - ChangeLock--; - return TRUE; - case WM_COMMAND: - if (LOWORD(wParam) == IDC_PREVIEW) - { - POPUPDATAEX ppd; - ZeroMemory(&ppd, sizeof(ppd)); - - //iPopUpDelay - options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE); - if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED) - { - options.iPopUpDelay = -1; - } - else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED) - { - options.iPopUpDelay = 0; - } - ppd.lchContact = NULL; - ppd.lchIcon = hIcon; - strncpy(ppd.lpzContactName, Translate("Contact name"), MAX_CONTACTNAME); - char szPreviewText[50]; - mir_snprintf(szPreviewText,50,Translate("has returned after being absent since %d days"),rand() % 30); - strncpy(ppd.lpzText, szPreviewText, MAX_SECONDLINE); - - // Get current popups colors options - if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) - { - ppd.colorBack = ppd.colorText = 0; - } - else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) - { - ppd.colorBack = GetSysColor(COLOR_BTNFACE); - ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); - } - else - { - ppd.colorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0); - ppd.colorText = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0); - } - ppd.PluginData = NULL; - ppd.iSeconds = options.iPopUpDelay; - - CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NO_HISTORY); - - strncpy(ppd.lpzText, Translate("You awaited this contact!"), MAX_SECONDLINE); - ppd.lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon");; - - CallService(MS_POPUP_ADDPOPUPEX, (WPARAM) &ppd, APF_NO_HISTORY); - } - else - { - if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) || ((HIWORD(wParam) == EN_CHANGE) && !ChangeLock)){ - SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0); - } - if (LOWORD(wParam) == IDC_COLORS_POPUP) - { - if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) - { - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), false); - } - else - { - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), true); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), true); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), true); - } - } - if (LOWORD(wParam) == IDC_COLORS_WIN) - { - if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) - { - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), false); - } - else - { - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), true); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), true); - EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), true); - } - } - if (LOWORD(wParam) == IDC_DELAY_DEF || LOWORD(wParam) == IDC_DELAY_PERM) - { - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false); - } - else if (LOWORD(wParam) == IDC_DELAY_CUST) - { - EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), true); - } - } - - break; - case WM_NOTIFY:{ - NMHDR* nmhdr = (NMHDR*)lParam; - switch (nmhdr->code) - { - case PSN_APPLY: - - if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) - { - options.iUsePopupColors = 1; - options.iUseWinColors = 0; - } - else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) - { - options.iUseWinColors = 1; - options.iUsePopupColors = 0; - options.iPopUpColorBack = GetSysColor(COLOR_BTNFACE); - options.iPopUpColorFore = GetSysColor(COLOR_WINDOWTEXT); - } - else - { - options.iUseWinColors = options.iUsePopupColors = 0; - options.iPopUpColorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0); - options.iPopUpColorFore = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0); - } - - //iPopUpDelay - options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE); - if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED) - { - options.iPopUpDelay = -1; - } - else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED) - { - options.iPopUpDelay = 0; - } - - // save value to the DB - SavePopupOptions(); - - return TRUE; - } - break; - } - } - return 0; -} - -/** - * Init options panel - */ -static int OptionsInit(WPARAM wParam, LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp; - ZeroMemory(&odp, sizeof(odp)); - odp.cbSize = sizeof(odp); - odp.hInstance = hInst; - odp.pszGroup = Translate("Plugins"); - odp.pszTemplate = MAKEINTRESOURCE(IDD_OPTIONSPANEL); - odp.pszTitle = Translate("Buddy Expectator"); - odp.pfnDlgProc = OptionsFrameProc; - odp.flags = ODPF_BOLDGROUPS; - CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); - - if (ServiceExists(MS_POPUP_ADDPOPUP)) - { - odp.pszGroup = Translate("PopUps"); - odp.pszTemplate = MAKEINTRESOURCE(IDD_POPUPPANEL); - odp.pfnDlgProc = PopUpOptionsFrameProc; - CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); - } - - return 0; -} - -BOOL CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) -{ - switch (msg) - { - case WM_INITDIALOG: - { - time_t tmpTime; - char tmpBuf[51] = {0}; - tmpTime = getLastSeen((HANDLE)lparam); - if (tmpTime == -1) - SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, Translate("not detected")); - else - { - /* - int status = DBGetContactSettingWord((HANDLE)lparam, MODULE_NAME, "LastStatus", ID_STATUS_OFFLINE); - char *strptr = (char *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)status, (LPARAM)0); - */ - strftime(tmpBuf, 50, "%#x", gmtime(&tmpTime)); - SetDlgItemText(hdlg, IDC_EDIT_LASTSEEN, tmpBuf); - } - - tmpTime = getLastInputMsg((HANDLE)lparam); - if (tmpTime == -1) - SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, Translate("not found")); - else - { - strftime(tmpBuf, 50, "%#x", gmtime(&tmpTime)); - SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf); - } - - unsigned int AbsencePeriod = DBGetContactSettingDword((HANDLE)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod); - - SendDlgItemMessage(hdlg, IDC_SPINABSENCE, UDM_SETRANGE, 0, MAKELONG(999, 1)); - SetDlgItemInt(hdlg, IDC_EDITABSENCE, AbsencePeriod, FALSE); - - if (isContactGoneFor((HANDLE)lparam, options.iAbsencePeriod2)) - { - SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, Translate("This contact has been absent for an extended period of time.")); - } - else - { - SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, ""); - } - - SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED, 0); - SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED, 0); - - TranslateDialogDefault(hdlg); - - return TRUE; - } - - case WM_NOTIFY: - switch (((LPNMHDR)lparam)->idFrom) - { - case 0: - switch (((LPNMHDR)lparam)->code) - { - case (PSN_APPLY): - { - HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lparam)->lParam; - if (hContact) - { - DBWriteContactSettingDword(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, 0, FALSE)); - DBWriteContactSettingByte(hContact, MODULE_NAME, "MissYou", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); - DBWriteContactSettingByte(hContact, MODULE_NAME, "MissYouNotifyAlways", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); - DBWriteContactSettingByte(hContact, MODULE_NAME, "NeverHide", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0); - } - break; - } - } - break; - } - break; - - case WM_COMMAND: - if (wparam == MAKEWPARAM(IDC_EDITABSENCE, EN_CHANGE)) - SendMessage(GetParent(hdlg), PSM_CHANGED, 0, 0); - else if (LOWORD(wparam) == IDCANCEL) - SendMessage(GetParent(hdlg), msg, wparam, lparam); - break; - } - - return FALSE; -} - -int UserinfoInit(WPARAM wparam, LPARAM lparam) -{ - if (lparam > 0) - { - OPTIONSDIALOGPAGE uip = {0}; - uip.cbSize = sizeof(uip); - uip.hInstance = hInst; - uip.pszTemplate = MAKEINTRESOURCE(IDD_USERINFO); - uip.pszTitle = Translate("Buddy Expectator"); - uip.pfnDlgProc = UserinfoDlgProc; - - CallService(MS_USERINFO_ADDPAGE, wparam, (LPARAM)&uip); - } - return 0; -} - - -HANDLE hEventOptInitialise; -void InitOptions() -{ - LoadOptions(); - hEventOptInitialise = HookEvent(ME_OPT_INITIALISE, OptionsInit); -} - -void DeinitOptions() -{ - UnhookEvent(hEventOptInitialise); -} diff --git a/buddyexpectator/options.h b/buddyexpectator/options.h deleted file mode 100644 index ade65c5..0000000 --- a/buddyexpectator/options.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - Buddy Expectator+ plugin for Miranda-IM (www.miranda-im.org) - (c)2005 Anar Ibragimoff (ai91@mail.ru) - (c)2006 Scott Ellis (mail@scottellis.com.au) - (c)2007,2008 Alexander Turyak (thief@miranda-im.org.ua) - - 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 - - File name : $URL: http://svn.miranda.im/mainrepo/buddyexpectator/trunk/options.h $ - Revision : $Rev: 1003 $ - Last change on : $Date: 2008-01-12 17:15:47 +0200 (Сб, 12 янв 2008) $ - Last change by : $Author: Thief $ -*/ - -#ifndef _OPTIONS_INC -#define _OPTIONS_INC - -typedef enum GoneContactAction { GCA_NOACTION, GCA_DELETE, GCA_UDETAILS, GCA_MESSAGE }; - -typedef struct { - int iAbsencePeriod; // notify period for returning contacts - int iShowPopUp; - int iShowEvent; - int iShowUDetails; - int iShowMessageWindow; - - bool notifyFirstOnline; - bool enableMissYou; - bool hideInactive; - byte MissYouIcon; - - int iAbsencePeriod2; // notify period for contacts that have remained away - int iShowPopUp2; - int iShowEvent2; - GoneContactAction action2; - - int iSilencePeriod; // notify period for contacts that didn't send messages - - int iPopUpColorBack; - int iPopUpColorFore; - int iPopUpDelay; - int iUsePopupColors; - int iUseWinColors; - -} Options; - -extern Options options; - -void InitOptions(); -void DeinitOptions(); - -#endif diff --git a/buddyexpectator/resource.h b/buddyexpectator/resource.h deleted file mode 100644 index b06406a..0000000 --- a/buddyexpectator/resource.h +++ /dev/null @@ -1,56 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by BuddyExpectator.rc -// -#define IDI_MAINICON 101 -#define IDI_ENABLED 102 -#define IDI_DISABLED 103 -#define IDI_HIDE 104 -#define IDI_NEVERHIDE 105 -#define IDD_OPTIONSPANEL 201 -#define IDD_POPUPPANEL 202 -#define IDD_USERINFO 203 -#define IDC_CHECK_POPUP 1000 -#define IDC_CHECK_POPUP2 1001 -#define IDC_CHECK_UDETAILS 1002 -#define IDC_CHECK_MSGWINDOW 1003 -#define IDC_CHECK_FLASHICON 1004 -#define IDC_CHECK_FLASHICON2 1005 -#define IDC_CHECK_FIRSTSIGHT 1006 -#define IDC_COMBO_PERIOD 1011 -#define IDC_COMBO_PERIOD2 1012 -#define IDC_COMBO_PERIOD3 1013 -#define IDC_COLOR_FRG 1021 -#define IDC_COLOR_BGR 1022 -#define IDC_COLORS_POPUP 1023 -#define IDC_COLORS_WIN 1024 -#define IDC_DELAY_DEF 1031 -#define IDC_DELAY_CUST 1032 -#define IDC_DELAY_PERM 1033 -#define IDC_EDIT_ABSENCE 1041 -#define IDC_EDIT_ABSENCE2 1042 -#define IDC_EDIT_POPUPDELAY 1043 -#define IDC_EDIT_SILENTFOR 1044 -#define IDC_EDIT_LASTSEEN 1045 -#define IDC_EDIT_LASTINPUT 1046 -#define IDC_EDIT_NOINPUTFOR 1047 -#define IDC_EDIT_WILLNOTICE 1048 -#define IDC_PREVIEW 1061 -#define IDC_CHECK_MISSYOU 1203 -#define IDC_EDITABSENCE 1204 -#define IDC_SPINABSENCE 1205 -#define IDC_CHECK_NOMSGS 1208 -#define IDC_COMBO_ACTIONS 1209 -#define IDC_CHECK_NEVERHIDE 1210 -#define IDC_CHECK_NOTIFYALWAYS 1211 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 106 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1212 -#define _APS_NEXT_SYMED_VALUE 121 -#endif -#endif diff --git a/console/Console.c b/console/Console.c deleted file mode 100644 index 7a05aed..0000000 --- a/console/Console.c +++ /dev/null @@ -1,1538 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2008 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "commonheaders.h" - -#define MS_CONSOLE_SHOW_HIDE "Console/Show/Hide" - -// console toptoolbarbutton(old) integration -#define TTB 1 - -#define DEFAULT_WRAPLEN 90 -#define MIN_WRAPLEN 25 -#define MAX_WRAPLEN 255 - -#define MIN_LIMIT 1000 -#define MAX_LIMIT 1000000 - -#define IMG_EMPTY 0 -#define IMG_ARROW 1 -#define IMG_IN 2 -#define IMG_OUT 3 -#define IMG_INFO 4 - -#define LOGICONX_SIZE 10 -#define LOGICONY_SIZE 10 - -#define ICON_FIRST 3 - -#define ICON_NOSCROLL 1 -#define ICON_PAUSED 2 -#define ICON_SCROLL 3 -#define ICON_STARTED 4 - -#define HM_DUMP (WM_USER+10) -#define HM_ADD (WM_USER+11) -#define HM_REMOVE (WM_USER+12) -#define HM_SETFONT (WM_USER+13) -#define HM_SETCOLOR (WM_USER+14) -#define HM_PAUSEALL (WM_USER+15) -#define HM_RESTART (WM_USER+16) - - -typedef struct { - const char* pszHead; - const char* pszMsg; -} LOGMSG; - - -typedef struct { - char szModule[128]; - TCHAR szMsg[1]; -} DUMPMSG; - - -typedef struct { - HWND hwnd; - HANDLE hList; - char *Module; - int Scroll; - int Paused; - int newline; -} LOGWIN; - - -struct MM_INTERFACE mmi; -struct UTF8_INTERFACE utfi; -struct LIST_INTERFACE li; - -static SortedList lModules = {0}; - -static LOGWIN *pActive = NULL; -static int tabCount = 0; -static RECT rcTabs = {0}; -static HWND hTabs = NULL; -static HWND hwndConsole = NULL; - -static HIMAGELIST gImg = NULL; -static HFONT hfLogFont = NULL; - -static int gIcons = 0; -static int gVisible = 0; -static int gSingleMode = 0; -static int gLimit = 0; -static int gSeparator = 0; - -static DWORD gWrapLen = DEFAULT_WRAPLEN; - -static DWORD OutMsgs = 0; -static DWORD InMsgs = 0; - -static HICON hIcons[15] = {0}; -static HANDLE hHooks[4] = {0}; - -static HANDLE hTButton = 0; -static HANDLE hMenu = NULL; - -static void LoadSettings(); -static void ShowConsole(int show); -static int ShowHideConsole(WPARAM wParam, LPARAM lParam); -static int Openfile(TCHAR *outputFile, int selection); - -//////////////////////////////////////////////////////////////////////////////// - -#ifdef TTB -static HBITMAP BmpUp = NULL; -static HBITMAP BmpDn = NULL; -static HANDLE hTTBButt = 0; - -static int HideConsoleButt(WPARAM wParam,LPARAM lParam) -{ - ShowConsole(0); - return 0; -} - -static int ShowConsoleButt(WPARAM wParam,LPARAM lParam) -{ - ShowConsole(1); - return 0; -} - -static int OnTTBLoaded(WPARAM wParam,LPARAM lParam) -{ - - if (IsWindow(hwndConsole)) - { - TTBButton ttbb = {0}; - int state = IsWindowVisible(hwndConsole); - - CreateServiceFunction("Console/Hide", HideConsoleButt); - CreateServiceFunction("Console/Show", ShowConsoleButt); - - BmpUp = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_CONSOLE_UP)); - BmpDn = LoadBitmap(hInst,MAKEINTRESOURCE(IDB_CONSOLE_DOWN)); - - ttbb.cbSize = sizeof(ttbb); - ttbb.hbBitmapUp = BmpUp; - ttbb.hbBitmapDown = BmpDn; - ttbb.dwFlags=(state?TTBBF_PUSHED:0)|TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP; - ttbb.pszServiceDown = "Console/Show"; - ttbb.pszServiceUp = "Console/Hide"; - ttbb.name = Translate("Show/Hide Console"); - hTTBButt = (HANDLE)CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttbb, 0); - - if (hTTBButt) - { - CallService(MS_TTB_SETBUTTONOPTIONS,MAKEWPARAM(TTBO_TIPNAME,hTTBButt), - (LPARAM)(state?Translate("Hide Console"):Translate("Show Console"))); - - CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTBButt, (LPARAM)(state?TTBST_PUSHED:TTBST_RELEASED)); - } - } - return 0; -} -#endif - -//////////////////////////////////////////////////////////////////////////////// - -void ScrollDown(LOGWIN * dat) { - if (dat->Scroll) - ListView_EnsureVisible(dat->hList, ListView_GetItemCount( dat->hList ) - 1, FALSE); -} - -//////////////////////////////////////////////////////////////////////////////// - -static void ShowConsole(int show) -{ - HWND hwnd = NULL; - - if (!hwndConsole || !pActive) return; - - gVisible = show; - - if (show) { - hwnd = GetForegroundWindow(); - if ( InMsgs == OutMsgs ) - ScrollDown( pActive ); - } - ShowWindow(hwndConsole, (show)?SW_SHOW:SW_HIDE); - DBWriteContactSettingByte(NULL,"Console","Show",(BYTE)((show)?1:0)); - - if (hwnd) - SetForegroundWindow(hwnd); - - if (show) - RedrawWindow(pActive->hList, NULL, NULL, RDW_INVALIDATE | RDW_FRAME |RDW_UPDATENOW | RDW_ERASE); - - if (hMenu) - { - CLISTMENUITEM mi = {0}; - - mi.cbSize = sizeof(mi); - mi.ptszName=(show)?TranslateT("Hide Console"):TranslateT("Show Console"); - mi.flags = CMIM_NAME | CMIF_TCHAR;; - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hMenu, (LPARAM)&mi); - } - - if (hTButton) - { - CallService(MS_TB_SETBUTTONSTATEBYID, (WPARAM)"console_btn", (show)?TBST_PUSHED:TBST_RELEASED); - } - -#ifdef TTB - if (hTTBButt) - { - CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hTTBButt, (show)?TTBST_PUSHED:TTBST_RELEASED); - CallService(MS_TTB_SETBUTTONOPTIONS,MAKEWPARAM(TTBO_TIPNAME,hTTBButt), - (LPARAM)(show?Translate("Hide Console"):Translate("Show Console"))); - } -#endif -} - -//////////////////////////////////////////////////////////////////////////////// - -static int ShowHideConsole(WPARAM wParam, LPARAM lParam) -{ - if (hwndConsole) - ShowConsole(!IsWindowVisible(hwndConsole)); - - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// - -int LogResize(HWND hwnd,LPARAM lParam,UTILRESIZECONTROL *urc) -{ - switch(urc->wId) { - case IDC_LIST: - ListView_SetColumnWidth(GetDlgItem(hwnd, IDC_LIST), 0, urc->dlgNewSize.cx - 25); - return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT; - case IDC_STARTALL: - case IDC_PAUSEALL: - case IDC_CLOSE: - return RD_ANCHORX_RIGHT|RD_ANCHORY_TOP; - default: - return RD_ANCHORX_LEFT|RD_ANCHORY_TOP; - } -} - -//////////////////////////////////////////////////////////////////////////////// - -typedef struct -{ - UINT control; - UINT icon; - int type; - TCHAR *tooltip; -} controlinfo; - - -static controlinfo ctrls[] = -{ - // IDC_SCROLL & IDC_PAUSE must be first - {IDC_SCROLL, IDI_SCROLL, BUTTONSETASFLATBTN, _T("Scrolling (Ctrl+Q)")}, - {IDC_PAUSE, IDI_STARTED, BUTTONSETASFLATBTN, _T("Pause logging(Ctrl+P)")}, - {IDC_SAVE, IDI_SAVE, BUTTONSETASFLATBTN, _T("Save log to file (Ctrl+S)")}, - {IDC_COPY, IDI_COPY, BUTTONSETASFLATBTN, _T("Copy selected log (Ctrl+C)")}, - {IDC_DELETE, IDI_DELETE, BUTTONSETASFLATBTN, _T("Delete selected (Del)")}, - {IDC_OPTIONS, IDI_OPTIONS, BUTTONSETASFLATBTN, _T("Log options (Ctrl+O)")}, - {IDC_STARTALL, IDI_START, BUTTONSETASFLATBTN, _T("Start logging in all tabs")}, - {IDC_PAUSEALL, IDI_PAUSE, BUTTONSETASFLATBTN, _T("Pause logging in all tabs")}, - {IDC_CLOSE, IDI_CLOSE, BUTTONSETASFLATBTN, _T("Close tab (Ctrl+W)")}, -}; - -//////////////////////////////////////////////////////////////////////////////// - -static LRESULT CALLBACK SubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam) -{ - int ctrl = GetKeyState(VK_CONTROL)&0x8000; - - switch (msg) { - - case WM_KEYDOWN: - if ( wParam == VK_DELETE && !ctrl) { - SendMessage(GetParent(hwnd), WM_COMMAND, IDC_DELETE, 0); - break; - } - - if (wParam == VK_LEFT && ctrl) - { - NMHDR nmhdr = {0}; - int tab = TabCtrl_GetCurSel(hTabs); - - if (tab == 0) - tab = TabCtrl_GetItemCount(hTabs)-1; - else - tab--; - - TabCtrl_SetCurSel(hTabs, tab); - nmhdr.code = TCN_SELCHANGE; - SendMessage(hwndConsole, WM_NOTIFY, IDC_TABS, (LPARAM)&nmhdr); - break; - } - - if (wParam == VK_RIGHT && ctrl) - { - NMHDR nmhdr = {0}; - int tab = TabCtrl_GetCurSel(hTabs); - int count = TabCtrl_GetItemCount(hTabs); - tab = (tab + 1) % count; - - TabCtrl_SetCurSel(hTabs, tab); - nmhdr.code = TCN_SELCHANGE; - SendMessage(hwndConsole, WM_NOTIFY, IDC_TABS, (LPARAM)&nmhdr); - break; - } - - break; - - case WM_CHAR: -/* - { - char t[32]; - sprintf(t,"%u\n",wParam); - OutputDebugStringA(t); - } -*/ - // CTRL - if ( !(GetKeyState(VK_CONTROL)&0x8000) ) - break; - - switch(wParam) { - - case 1: // Ctrl+A - if ( ListView_GetSelectedCount(hwnd) != (UINT)ListView_GetItemCount(hwnd) ) - ListView_SetItemState(hwnd, -1, LVIS_SELECTED, LVIS_SELECTED); - return 0; - - case 3: // Ctrl+D - SendMessage(GetParent(hwnd), WM_COMMAND, IDC_COPY, 0); - return 0; - - case 15: // Ctrl+O - SendMessage(GetParent(hwnd), WM_COMMAND, IDC_OPTIONS, 0); - return 0; - - case 16: // Ctrl+P - SendMessage(GetParent(hwnd), WM_COMMAND, IDC_PAUSE, 0); - return 0; - - case 17: // Ctrl+Q - SendMessage(GetParent(hwnd), WM_COMMAND, IDC_SCROLL, 0); - return 0; - - case 19: // Ctrl+S - SendMessage(GetParent(hwnd), WM_COMMAND, IDC_SAVE, 0); - return 0; - - case 23: // Ctrl+W - SendMessage(GetParent(hwnd), WM_COMMAND, IDC_CLOSE, 0); - return 0; - } - break; - } - return CallWindowProc((WNDPROC)GetWindowLong(hwnd, GWLP_USERDATA),hwnd,msg,wParam,lParam); -} - -//////////////////////////////////////////////////////////////////////////////// - -static BOOL CALLBACK LogDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam) -{ - - LOGWIN *dat = (LOGWIN*)GetWindowLong(hwndDlg, GWLP_USERDATA); - - switch(message) { - case WM_INITDIALOG: - { - dat = (LOGWIN*)lParam; - - dat->hwnd = hwndDlg; - dat->Scroll = 1; - dat->Paused = 0; - dat->hList = GetDlgItem(hwndDlg, IDC_LIST); - - SetWindowLong(hwndDlg, GWLP_USERDATA, (LONG)dat); - SetWindowLong(dat->hList, GWLP_USERDATA, SetWindowLong(dat->hList,GWLP_WNDPROC,(LONG)SubclassProc)); - - // init buttons - { - int i; - HWND hwnd; - for(i = 0; i < SIZEOF(ctrls); i++) { - hwnd = GetDlgItem(hwndDlg,ctrls[i].control); - SendMessage(hwnd, ctrls[i].type, 0, 0); - SendMessage(hwnd, BUTTONADDTOOLTIP,(WPARAM)TranslateTS(ctrls[i].tooltip), BATF_TCHAR); - SendMessage(hwnd, BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcons[i+ICON_FIRST]); - } - } - - CheckDlgButton(hwndDlg,IDC_SCROLL,dat->Scroll?BST_CHECKED:BST_UNCHECKED); - SendDlgItemMessage(hwndDlg,IDC_SCROLL,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcons[(dat->Scroll?ICON_SCROLL:ICON_NOSCROLL)]); - - if (gSingleMode) - { - ShowWindow(GetDlgItem(hwndDlg, IDC_PAUSEALL), SW_HIDE); - ShowWindow(GetDlgItem(hwndDlg, IDC_STARTALL), SW_HIDE); - ShowWindow(GetDlgItem(hwndDlg, IDC_CLOSE), SW_HIDE); - } - - // init listview - { - LVITEM lvi = {0}; - LVCOLUMN sLC; - //ListView_SetUnicodeFormat(dat->hList, FALSE); - ListView_SetImageList(dat->hList, gImg, LVSIL_SMALL); - sLC.mask = LVCF_FMT | LVCF_WIDTH; - sLC.fmt = LVCFMT_LEFT; - sLC.cx = 630; - ListView_InsertColumn(dat->hList,0,&sLC); - ListView_SetExtendedListViewStyle(dat->hList, LVS_EX_FULLROWSELECT); - - lvi.mask = LVIF_TEXT; - if (gIcons) - { - lvi.mask |= LVIF_IMAGE; - lvi.iImage = IMG_INFO; - } - - lvi.pszText = TranslateT("*** Console started ***"); - ListView_InsertItem(dat->hList,&lvi); - } - - SendMessage(hwndDlg, WM_SIZE, 0, 0); - break; - } - case HM_DUMP: - { - // lParam = DUMPMSG - if (!lParam) break; - if (dat && !dat->Paused) - { - LVITEM lvi = {0}; - int last = 0x7fffffff; - TCHAR szBreak; - DWORD len, tmplen; - DWORD wraplen = gWrapLen; - TCHAR *str = ((DUMPMSG*)lParam)->szMsg; - - lvi.iItem = 0x7fffffff; - - str = _tcstok(str, _T("\n")); - - if (gIcons && str != NULL) - { - lvi.mask = LVIF_TEXT | LVIF_IMAGE; - - if (_tcsstr(str, _T("Data received"))) - { - if (gSeparator) ListView_InsertItem(dat->hList, &lvi); - lvi.iImage = IMG_IN; - } - else - if (_tcsstr(str, _T("Data sent"))) - { - if (gSeparator) ListView_InsertItem(dat->hList, &lvi); - lvi.iImage = IMG_OUT; - } - else - { - if (gSeparator && dat->newline) - { - ListView_InsertItem(dat->hList, &lvi); - dat->newline = 0; - } - lvi.iImage = IMG_INFO; - } - } else - lvi.mask = LVIF_TEXT; - - while (str != NULL) - { - lvi.pszText = &str[0]; - tmplen = len = _tcslen(lvi.pszText); - - while(len > wraplen) - { - szBreak = lvi.pszText[wraplen]; - lvi.pszText[wraplen] = 0; - last = ListView_InsertItem(dat->hList, &lvi); - lvi.pszText[wraplen] = szBreak; - len -= wraplen; - lvi.pszText = &str[0] + tmplen - len; - - dat->newline = 1; - lvi.iImage = IMG_EMPTY; - } - - if (len && lvi.pszText[len-1] == '\r') - lvi.pszText[len-1] = 0; - - last = ListView_InsertItem(dat->hList, &lvi); - - str = _tcstok(NULL, _T("\n")); - - if (str) dat->newline = 1; - lvi.iImage = IMG_EMPTY; - } - - - if ( gVisible && dat == pActive && dat->Scroll == 1 ) - ListView_EnsureVisible(dat->hList, last, FALSE); - - if (last > gLimit) - { - int idx = last - gLimit + gLimit/4; // leave only 75% of LIMIT - - while (idx >= 0) - { - ListView_DeleteItem(dat->hList, idx); - idx--; - } - } - } - - free((DUMPMSG*)lParam); - return TRUE; - } - case WM_SIZE: - { - UTILRESIZEDIALOG urd={0}; - urd.cbSize=sizeof(urd); - urd.hInstance=hInst; - urd.hwndDlg=hwndDlg; - urd.lpTemplate=MAKEINTRESOURCEA(IDD_LOG); - urd.pfnResizer=LogResize; - SetWindowPos(hwndDlg, HWND_TOP, rcTabs.left, rcTabs.top, rcTabs.right - rcTabs.left, rcTabs.bottom - rcTabs.top, SWP_SHOWWINDOW); - CallService(MS_UTILS_RESIZEDIALOG,0,(LPARAM)&urd); - break; - } - case WM_COMMAND: - { - switch(LOWORD(wParam)) - { - if (!dat) break; - - case IDC_PAUSE: - { - LVITEM lvi = {0}; - dat->Paused = !(dat->Paused); - lvi.mask = LVIF_TEXT | LVIF_IMAGE; - lvi.iImage = IMG_INFO; - lvi.iItem = 0x7FFFFFFF; - lvi.pszText = (dat->Paused) ? TranslateT("*** Console paused ***") : TranslateT("*** Console resumed ***"); - ListView_InsertItem(dat->hList,&lvi); - CheckDlgButton(hwndDlg,IDC_PAUSE,(dat->Paused)?BST_CHECKED:BST_UNCHECKED); - SendDlgItemMessage(hwndDlg,IDC_PAUSE,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcons[((dat->Paused)?ICON_PAUSED:ICON_STARTED)]); - break; - } - case IDC_SCROLL: - { - dat->Scroll = !(dat->Scroll); - CheckDlgButton(hwndDlg,IDC_SCROLL,(dat->Scroll)?BST_CHECKED:BST_UNCHECKED); - SendDlgItemMessage(hwndDlg,IDC_SCROLL,BM_SETIMAGE,IMAGE_ICON,(LPARAM)hIcons[((dat->Scroll)?ICON_SCROLL:ICON_NOSCROLL)]); - break; - } - case IDC_COPY: - { - int idx = 0; - TCHAR szText[128]; - TCHAR *src, *dst, *buf; - int flags = LVNI_BELOW; - int count = ListView_GetSelectedCount(dat->hList); - - if (count) - flags |= LVNI_SELECTED; - else - count = ListView_GetItemCount(dat->hList); - - dst = buf = malloc((count*(sizeof(szText)+1)+1)*sizeof(TCHAR)); - if (!buf) break; - - while ((idx = ListView_GetNextItem(dat->hList,idx,flags)) > 0) - { - ListView_GetItemText(dat->hList, idx, 0, szText, sizeof(szText)-1); - src = szText; - while (*dst++ = *src++); - dst--; - *dst++ = '\r'; - *dst++ = '\n'; - *dst = 0; - } - - if (dst - buf > 0 && OpenClipboard(hwndDlg)) { - HGLOBAL hClipboardData; - TCHAR* pchData; - EmptyClipboard(); - if (hClipboardData = GlobalAlloc(GMEM_DDESHARE, (dst-buf+1)*sizeof(TCHAR))) { - pchData = (TCHAR*)GlobalLock(hClipboardData); - _tcscpy(pchData, buf); - GlobalUnlock(hClipboardData); - #ifdef UNICODE - SetClipboardData(CF_UNICODETEXT,hClipboardData); - #else - SetClipboardData(CF_TEXT,hClipboardData); - #endif - } - CloseClipboard(); - } - free(buf); - break; - } - case IDC_DELETE: - { - int idx = 0; - int count = ListView_GetSelectedCount(dat->hList); - - if ( !count ) break; - - if ( count == ListView_GetItemCount(dat->hList) ) { - LVITEM lvi = {0}; - ListView_DeleteAllItems(dat->hList); - lvi.mask = LVIF_TEXT | LVIF_IMAGE; - lvi.iImage = IMG_INFO; - lvi.pszText = TranslateT("*** Console cleared ***"); - ListView_InsertItem(dat->hList,&lvi); - dat->newline = 0; - break; - } - - while ((idx = ListView_GetNextItem(dat->hList,idx,LVNI_BELOW|LVNI_SELECTED)) > 0) - { - ListView_DeleteItem(dat->hList,idx); - idx--; - } - break; - } - case IDC_SAVE: - { - FILE *fp; - TCHAR szFile[MAX_PATH]; - - if (!Openfile(szFile,ListView_GetSelectedCount(dat->hList))) break; - - fp = _tfopen(szFile, _T("wt")); - if (fp) { - int idx = 0; - TCHAR szText[128]; - int flags = LVNI_BELOW; - if (ListView_GetSelectedCount(dat->hList)) - flags |= LVNI_SELECTED; - - while ((idx = ListView_GetNextItem(dat->hList,idx,flags)) > 0) - { - ListView_GetItemText(dat->hList, idx, 0, szText, sizeof(szText)-1); - _ftprintf(fp, _T("%s\n"), szText); - } - fclose(fp); - } - break; - } - case IDC_OPTIONS: - CallServiceSync(MS_NETLIB_LOGWIN,0,0); - break; - case IDC_STARTALL: - SendMessage(hwndConsole, HM_PAUSEALL, 0, 0); - break; - case IDC_PAUSEALL: - SendMessage(hwndConsole, HM_PAUSEALL, 0, 1); - break; - case IDC_CLOSE: - if (tabCount > 1) - SendMessage(hwndDlg, WM_CLOSE, 0, 0); - break; - default: - break; - } - break; - } - case WM_CLOSE: - DestroyWindow(hwndDlg); - break; - case WM_DESTROY: - SetWindowLong(dat->hList, GWLP_WNDPROC, GetWindowLong(dat->hList,GWLP_USERDATA)); - SendMessage(hwndConsole, HM_REMOVE, 0, (LPARAM)dat); - break; - } - - return FALSE; -} - - -//////////////////////////////////////////////////////////////////////////////// - -int ConsoleResize(HWND hwnd,LPARAM lParam,UTILRESIZECONTROL *urc) -{ - switch(urc->wId) { - case IDC_TABS: - return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT; - default: - return RD_ANCHORX_LEFT|RD_ANCHORY_TOP; - } -} - - -static BOOL CALLBACK ConsoleDlgProc(HWND hwndDlg,UINT message,WPARAM wParam,LPARAM lParam) -{ - switch(message) { - case WM_INITDIALOG: - { - char Title[512]; - char ProfileName[513]; - char ProfilePath[513]; - ProfileName[512] = 0; - ProfilePath[512] = 0; - - hTabs = GetDlgItem(hwndDlg, IDC_TABS); - //TabCtrl_SetMinTabWidth(hTabs, 100); - - // restore position - { - SAVEWINDOWPOS swp; - swp.hwnd=hwndDlg; swp.hContact=NULL; swp.szModule="Console"; swp.szNamePrefix="Console"; - CallService(MS_UTILS_RESTOREWINDOWPOSITION,RWPF_NOACTIVATE,(LPARAM)&swp); - ShowWindow(hwndDlg,SW_HIDE); - } - - if (CallService(MS_DB_GETPROFILENAME,(WPARAM)512,(LPARAM)ProfileName)) - ProfileName[0] = 0; - - if (CallService(MS_DB_GETPROFILEPATH,(WPARAM)512,(LPARAM)ProfilePath)) - ProfilePath[0] = 0; - - mir_snprintf(Title, sizeof(Title), "%s - %s\\%s", Translate("Miranda Console"), ProfilePath, ProfileName); - - SetWindowTextA(hwndDlg, Title); - SendMessage(hwndDlg,WM_SETICON,ICON_BIG,(LPARAM)hIcons[0]); - - hwndConsole = hwndDlg; - SendMessage(hwndDlg, HM_ADD, 0, 0); - PostMessage(hwndDlg, WM_SIZE, 0, 0); - break; - } - case HM_DUMP: - { - // lParam = DUMPMSG - int idx; - LOGWIN *lw; - LOGWIN lw2; - DUMPMSG *dumpMsg = (DUMPMSG*)lParam; - - if (!pActive) break; - - if (!gSingleMode) - { - lw2.Module = dumpMsg->szModule; - if (!li.List_GetIndex(&lModules, &lw2, &idx)) - SendMessage(hwndDlg, HM_ADD, (WPARAM)idx, (LPARAM)dumpMsg->szModule); - - lw = (LOGWIN*)lModules.items[idx]; - } - else - lw = pActive; - - if (lw->hwnd) - SendMessage(lw->hwnd, HM_DUMP, wParam, lParam); - else - PostMessage(hwndDlg, HM_DUMP, wParam, lParam); // loop msg until window will be ready - - return TRUE; - } - case HM_ADD: - { - // wParam = index, lParam = module name - LOGWIN *lw; - COLORREF col; - TCITEM tci = {0}; - int idx = (int)wParam; - char *str = (char*)lParam; - - if (!str) str = ""; // startup window - - lw = (LOGWIN*)mir_calloc( sizeof(LOGWIN) ); - lw->Module = (char*)mir_strdup(str); - li.List_Insert(&lModules, lw, idx); - - if (!gSingleMode && lParam) - { - tci.mask = TCIF_PARAM | TCIF_TEXT; - tci.lParam = (LPARAM)lw; -#ifdef _UNICODE - tci.pszText = mir_a2u(lw->Module); - idx = TabCtrl_InsertItem(hTabs, tabCount, &tci); - mir_free(tci.pszText); -#else - tci.pszText = lw->Module; - idx = TabCtrl_InsertItem(hTabs, tabCount, &tci); -#endif - tabCount++; - } - - GetClientRect(hTabs, &rcTabs); - TabCtrl_AdjustRect(hTabs, FALSE, &rcTabs); - - CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_LOG), hwndDlg, LogDlgProc, (LPARAM)lw); - ShowWindow(lw->hwnd, (tabCount > 1)?SW_HIDE:SW_SHOWNOACTIVATE); - - if (pActive) - { - col = ListView_GetBkColor(pActive->hList); - ListView_SetBkColor(lw->hList, col); - ListView_SetTextBkColor(lw->hList, col); - - col = ListView_GetTextColor(pActive->hList); - ListView_SetTextColor(lw->hList, col); - - if (hfLogFont) - SendMessage(lw->hList, WM_SETFONT, (WPARAM)hfLogFont, (LPARAM)TRUE); - } - - // hide startup window - if (tabCount == 1) - { - ShowWindow(pActive->hwnd, SW_HIDE); - PostMessage(pActive->hwnd, WM_CLOSE, 0, 0); - pActive = lw; - } - - if (!pActive) - pActive = lw; - - return TRUE; - } - case HM_REMOVE: - { - // lParam = LOGWIN - LOGWIN *lw = (LOGWIN*)lParam; - - if (!lw) break; - - if (lw == pActive) - { - int tab = TabCtrl_GetCurSel(hTabs); - if (tab >= 0) - { - TCITEM tci={0}; - - TabCtrl_DeleteItem(hTabs, tab); - tabCount--; - if (tabCount) - { - tab--; - if (tab < 0 ) tab = 0; - TabCtrl_SetCurSel(hTabs, tab); - - tci.mask = TCIF_PARAM; - TabCtrl_GetItem(hTabs, tab, &tci); - pActive = (LOGWIN*)tci.lParam; - SendMessage(pActive->hwnd, WM_SIZE, 0, 0); - ScrollDown(pActive); - ShowWindow(pActive->hwnd, SW_SHOWNOACTIVATE); - SetFocus(pActive->hList); - } - else - pActive = NULL; - } - } - - li.List_RemovePtr(&lModules, lw); - mir_free(lw->Module); - mir_free(lw); - return TRUE; - } - case HM_SETFONT: - { - // wParam = font, lParam = font color - int i; - LOGWIN *lw; - for ( i = 0; i < lModules.realCount; i++ ) - { - lw = (LOGWIN*)lModules.items[i]; - ListView_SetTextColor(lw->hList, (COLORREF)lParam); - if (wParam) - SendMessage(lw->hList, WM_SETFONT, wParam, (LPARAM)TRUE); - } - return TRUE; - } - case HM_SETCOLOR: - { - // wParam = font, lParam = background color - int i; - LOGWIN *lw; - for ( i = 0; i < lModules.realCount; i++ ) - { - lw = (LOGWIN*)lModules.items[i]; - ListView_SetBkColor(lw->hList, (COLORREF)lParam); - ListView_SetTextBkColor(lw->hList, (COLORREF)lParam); - if (wParam) - SendMessage(lw->hList, WM_SETFONT, wParam, (LPARAM)TRUE); - } - return TRUE; - } - case HM_PAUSEALL: - { - // lParam = 1 to pause, 0 to start - int i; - LOGWIN *lw; - for ( i = 0; i < lModules.realCount; i++ ) - { - lw = (LOGWIN*)lModules.items[i]; - if (lw->Paused != (int)lParam) - SendMessage(lw->hwnd, WM_COMMAND, IDC_PAUSE, 0); - } - return TRUE; - } - case HM_RESTART: - { - if (pActive) - { - pActive = NULL; - PostMessage(hwndDlg, HM_RESTART, 0, 0); - return TRUE; - } - // close all tabs - if (!lParam) - { - LOGWIN *lw; - TabCtrl_DeleteAllItems(hTabs); - while ( lModules.realCount ) - { - lw = (LOGWIN*)lModules.items[0]; - SendMessage(lw->hwnd, WM_CLOSE, 0, 0); - } - tabCount = 0; - PostMessage(hwndDlg, HM_RESTART, 0, 1); - return TRUE; - } - - LoadSettings(); - SendMessage(hwndDlg, HM_ADD, 0, 0); - PostMessage(hwndDlg, WM_SIZE, 0, 0); - return TRUE; - } - case WM_SETFOCUS: - if ( pActive ) { - SetFocus(pActive->hList); - } - return TRUE; - case WM_NOTIFY: - switch(wParam) { - case IDC_TABS: - { - LPNMHDR lpnmhdr = (LPNMHDR)lParam; - if (lpnmhdr->code == TCN_SELCHANGE) - { - int newTab = TabCtrl_GetCurSel(hTabs); - if (newTab >= 0 ) - { - TCITEM tci={0}; - HWND hOld = pActive->hwnd; - - tci.mask = TCIF_PARAM; - - if (!TabCtrl_GetItem(hTabs, newTab, &tci)) break; - - pActive = (LOGWIN*)tci.lParam; - - SendMessage(pActive->hwnd, WM_SIZE, 0, 0); - ScrollDown(pActive); - ShowWindow(hOld, SW_HIDE); - ShowWindow(pActive->hwnd, SW_SHOWNOACTIVATE); - SetFocus(pActive->hList); - } else - SendMessage(pActive->hwnd, WM_SIZE, 0, 0); - } - break; - } - } - break; - case WM_SIZE: - { - UTILRESIZEDIALOG urd={0}; - urd.cbSize=sizeof(urd); - urd.hInstance=hInst; - urd.hwndDlg=hwndDlg; - urd.lpTemplate=MAKEINTRESOURCEA(IDD_CONSOLE); - urd.pfnResizer=ConsoleResize; - CallService(MS_UTILS_RESIZEDIALOG,0,(LPARAM)&urd); - - GetClientRect(hTabs, &rcTabs); - TabCtrl_AdjustRect(hTabs, FALSE, &rcTabs); - - if ( pActive ) - SendMessage(pActive->hwnd, WM_SIZE, 0, 0); - break; - } - case WM_GETMINMAXINFO: - { - MINMAXINFO *mmi=(MINMAXINFO*)lParam; - mmi->ptMinTrackSize.x=400; - mmi->ptMinTrackSize.y=200; - break; - } - case WM_CLOSE: - if ( lParam != 1 ) { - Utils_SaveWindowPosition(hwndDlg,NULL,"Console","Console"); - ShowConsole(0); - return TRUE; - } else - DestroyWindow(hwndDlg); - break; - case WM_DESTROY: - pActive = NULL; - if (hfLogFont) DeleteObject(hfLogFont); - PostQuitMessage(0); - break; - } - - return FALSE; -} - - -//////////////////////////////////////////////////////////////////////////////// - - -void __cdecl ConsoleThread(void* arg) -{ - MSG msg; - HWND hwnd; - - hwnd = CreateDialog(hInst,MAKEINTRESOURCE(IDD_CONSOLE),NULL,ConsoleDlgProc); - - if (!hwnd) return; - - while( GetMessage(&msg, NULL, 0, 0) > 0 ) - { - switch(msg.message) { - case HM_DUMP: - OutMsgs++; - break; - } - - if ( IsDialogMessage(hwnd, &msg) ) - continue; - - TranslateMessage(&msg); - DispatchMessage(&msg); - } - - hwndConsole = NULL; -} - -/////////////////////////////////////////////////////////////////////////////// - -static int OnFastDump(WPARAM wParam,LPARAM lParam) -{ - if ( pActive ) - { - LOGMSG *logMsg = (LOGMSG*)lParam; - DWORD headlen = strlen(logMsg->pszHead); - DWORD msglen = strlen(logMsg->pszMsg); - DWORD len = (headlen + msglen + 1) * sizeof(TCHAR) + sizeof(DUMPMSG); - DUMPMSG *dumpMsg = (DUMPMSG*)malloc( len ); - TCHAR *str = dumpMsg->szMsg; - - strncpy(dumpMsg->szModule, ((NETLIBUSER*)wParam)->szDescriptiveName, sizeof(dumpMsg->szModule))[ sizeof(dumpMsg->szModule)-1 ] = 0; - -#ifdef _UNICODE - { - wchar_t *ucs2; - - ucs2 = mir_a2u( logMsg->pszHead ); - wcscpy(str, ucs2); - mir_free(ucs2); - - // try to detect utf8 - ucs2 = mir_utf8decodeW( logMsg->pszMsg ); - if ( !ucs2 ) - ucs2 = mir_a2u( logMsg->pszMsg ); - - wcscat( str, ucs2 ); - mir_free( ucs2 ); - } -#else - memcpy( str, logMsg->pszHead, headlen ); - memcpy( str + headlen, logMsg->pszMsg, msglen + 1 ); - - // try to detect utf8 - mir_utf8decode( str + headlen, NULL ); -#endif - InMsgs++; - PostMessage(hwndConsole, HM_DUMP, 0, (LPARAM)dumpMsg); - } - return 0; -} - -/////////////////////////////////////////////////////////////////////////////// - -static void LoadSettings() -{ - gIcons = DBGetContactSettingByte(NULL, "Console", "ShowIcons", 1); - gSeparator = DBGetContactSettingByte(NULL, "Console", "Separator", 1); - gSingleMode = DBGetContactSettingByte(NULL, "Console", "SingleMode", 0); - - gWrapLen = DBGetContactSettingByte(NULL, "Console", "Wrap", DEFAULT_WRAPLEN); - if ( gWrapLen < MIN_WRAPLEN ) gWrapLen = DEFAULT_WRAPLEN; - - gLimit = DBGetContactSettingDword(NULL, "Console", "Limit", MAX_LIMIT); - if (gLimit > MAX_LIMIT) gLimit = MAX_LIMIT; - if (gLimit < MIN_LIMIT) gLimit = MIN_LIMIT; -} - - -static void SaveSettings(HWND hwndDlg) -{ - int len = GetDlgItemInt(hwndDlg, IDC_WRAP, NULL, FALSE); - if (len < MIN_WRAPLEN ) - len = MIN_WRAPLEN; - else - if (len > MAX_WRAPLEN) - len = MAX_WRAPLEN; - - gWrapLen = len; - SetDlgItemInt(hwndDlg, IDC_WRAP, gWrapLen, FALSE); - DBWriteContactSettingByte(NULL, "Console", "Wrap", (BYTE)len); - - len = GetDlgItemInt(hwndDlg, IDC_LIMIT, NULL, FALSE); - if (len < MIN_LIMIT ) - len = MIN_LIMIT; - else - if (len > MAX_LIMIT) - len = MAX_LIMIT; - - gLimit = len; - SetDlgItemInt(hwndDlg, IDC_LIMIT, gLimit, FALSE); - DBWriteContactSettingDword(NULL, "Console", "Limit", len); - - DBWriteContactSettingByte(NULL, "Console", "SingleMode", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SINGLE)); - DBWriteContactSettingByte(NULL, "Console", "Separator", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SEPARATOR)); - DBWriteContactSettingByte(NULL, "Console", "ShowIcons", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWICONS)); - - DBWriteContactSettingByte(NULL, "Console", "ShowAtStart", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_START)); -} - - -static BOOL CALLBACK OptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch(msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - CheckDlgButton(hwndDlg, IDC_START, DBGetContactSettingByte(NULL, "Console", "ShowAtStart", 0)); - CheckDlgButton(hwndDlg, IDC_SINGLE, gSingleMode); - CheckDlgButton(hwndDlg, IDC_SHOWICONS, gIcons); - CheckDlgButton(hwndDlg, IDC_SEPARATOR, gSeparator); - SetDlgItemInt(hwndDlg, IDC_WRAP, gWrapLen, FALSE); - SetDlgItemInt(hwndDlg, IDC_LIMIT, gLimit, FALSE); - break; - case WM_COMMAND: - switch (LOWORD(wParam)) { - case IDC_RESTART: - { - if (!pActive) break; - SaveSettings(hwndDlg); - PostMessage(hwndConsole, HM_RESTART, 0, 0); - break; - } - case IDC_LIMIT: - case IDC_WRAP: - if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()) - return FALSE; - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - case IDC_START: - case IDC_SEPARATOR: - case IDC_SHOWICONS: - case IDC_SINGLE: - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - } - break; - case WM_NOTIFY: - switch(((LPNMHDR)lParam)->idFrom) - { - case 0: - switch (((LPNMHDR)lParam)->code) - { - case PSN_APPLY: - { - SaveSettings(hwndDlg); - break; - } - } - break; - } - break; - } - return FALSE; -} - - -static int OptInit(WPARAM wParam,LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp={0}; - odp.cbSize = sizeof(odp); - odp.position = 0; - odp.hInstance = hInst; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); - odp.ptszGroup = TranslateT("Network"); - odp.ptszTitle = TranslateT("Console"); - odp.pfnDlgProc = OptDlgProc; - odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; - odp.expertOnlyControls = NULL; - CallService(MS_OPT_ADDPAGE, wParam, (LPARAM)&odp); - return 0; -} - -/////////////////////////////////////////////////////////////////////////////// - -static int OnColourChange(WPARAM wParam,LPARAM lParam) -{ - if (hwndConsole) - { - ColourID cid = {0}; - COLORREF col; - - cid.cbSize=sizeof(cid); - strcpy(cid.group,"Console"); - strcpy(cid.name,"Background"); - strcpy(cid.dbSettingsGroup,"Console"); - strcpy(cid.setting,"BgColor"); - - col = (COLORREF)CallService(MS_COLOUR_GET,(WPARAM)&cid,0); - if (col != -1) - SendMessage(hwndConsole, HM_SETCOLOR, (WPARAM)hfLogFont, (LPARAM)col); - } - return 0; -} - - -static int OnFontChange(WPARAM wParam,LPARAM lParam) -{ - if (hwndConsole) - { - COLORREF col; - HFONT hf = NULL; - LOGFONT LogFont={0}; - FontIDT fid={0}; - fid.cbSize=sizeof(fid); - - _tcscpy(fid.group,_T("Console")); - _tcscpy(fid.name,TranslateT("Text")); - - col = (COLORREF)CallService(MS_FONT_GETT,(WPARAM)&fid,(LPARAM)&LogFont); - - if (LogFont.lfHeight != 0) - { - hf=CreateFontIndirect(&LogFont); - - SendMessage(hwndConsole, HM_SETFONT, (WPARAM)hf, (LPARAM)col); - - if (hfLogFont) - DeleteObject(hfLogFont); - hfLogFont = hf; - } - } - return 0; -} - -static int OnSystemModulesLoaded(WPARAM wParam,LPARAM lParam) -{ - int i = 1; - if ( !hHooks[0] ) - hHooks[0] = HookEvent( ME_NETLIB_FASTDUMP, OnFastDump ); - - CreateServiceFunction(MS_CONSOLE_SHOW_HIDE, ShowHideConsole); - - - if (ServiceExists(MS_FONT_REGISTERT)) - { - FontIDT fid={0}; - - fid.cbSize=sizeof(fid); - _tcscpy(fid.group,_T("Console")); - _tcscpy(fid.name,TranslateT("Text")); - strcpy(fid.dbSettingsGroup,"Console"); - strcpy(fid.prefix,"ConsoleFont"); - - _tcscpy(fid.backgroundGroup,_T("Console")); - _tcscpy(fid.backgroundName,_T("Background")); - - fid.flags = FIDF_DEFAULTVALID; - - fid.deffontsettings.charset = DEFAULT_CHARSET; - fid.deffontsettings.colour = RGB(0, 0, 0); - fid.deffontsettings.size = 10; - fid.deffontsettings.style = 0; - _tcsncpy(fid.deffontsettings.szFace, _T("Courier"), LF_FACESIZE); - - CallService(MS_FONT_REGISTERT,(WPARAM)&fid,0); - - hHooks[i++] = HookEvent(ME_FONT_RELOAD,OnFontChange); - } - - if (ServiceExists(MS_COLOUR_REGISTERT)) - { - ColourIDT cid = {0}; - - cid.cbSize=sizeof(cid); - _tcscpy(cid.group,_T("Console")); - _tcscpy(cid.name,_T("Background")); - strcpy(cid.dbSettingsGroup,"Console"); - strcpy(cid.setting,"BgColor"); - - cid.defcolour = RGB(255,255,255); - - CallService(MS_COLOUR_REGISTERT,(WPARAM)&cid,0); - - hHooks[i++] = HookEvent(ME_COLOUR_RELOAD, OnColourChange); - } - - if (ServiceExists(MS_HOTKEY_REGISTER)) - { - HOTKEYDESC hkd = {0}; - - hkd.cbSize=sizeof(hkd); - - hkd.pszName = "Console_Show_Hide"; - hkd.pszDescription = Translate("Show/Hide Console"); - hkd.pszSection = "Main"; - hkd.pszService = MS_CONSOLE_SHOW_HIDE; - hkd.DefHotKey = HOTKEYCODE(HOTKEYF_EXT, 'C'); - - CallService(MS_HOTKEY_REGISTER,(WPARAM)0,(LPARAM)&hkd); - } - - if (ServiceExists(MS_TB_ADDBUTTON)) - { - SKINICONDESC sid={0}; - TBButton tbb = {0}; - char szModuleFileName[MAX_PATH]={0}; - - GetModuleFileNameA(hInst,szModuleFileName,MAX_PATH); - - sid.cbSize = sizeof(sid); - sid.pszSection = Translate("Console"); - sid.pszDefaultFile = szModuleFileName; - - sid.pszDescription = Translate("Show"); - sid.pszName = "Console_Up"; - sid.iDefaultIndex = -IDI_BTN_UP; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); - - sid.pszDescription = Translate("Hide"); - sid.pszName = "Console_Down"; - sid.iDefaultIndex = -IDI_BTN_DN; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); - - tbb.cbSize = sizeof(TBButton); - tbb.pszButtonID = "console_btn"; - tbb.pszButtonName = Translate("Show/Hide Console"); - tbb.pszServiceName = MS_CONSOLE_SHOW_HIDE; - tbb.hPrimaryIconHandle = (HANDLE)CallService(MS_SKIN2_GETICONHANDLE,0, (LPARAM)"Console_Up"); - tbb.hSecondaryIconHandle = (HANDLE)CallService(MS_SKIN2_GETICONHANDLE,0, (LPARAM)"Console_Down"); - tbb.pszTooltipUp = Translate("Show Console"); - tbb.pszTooltipDn = Translate("Hide Console"); - tbb.tbbFlags = TBBF_VISIBLE|TBBF_SHOWTOOLTIP; - tbb.defPos = 20000; - hTButton = (HANDLE)CallService(MS_TB_ADDBUTTON,0, (LPARAM)&tbb); - } - - if (hwndConsole && IsWindow(hwndConsole)) - { - CLISTMENUITEM mi={0}; -#ifdef TTB - hHooks[i++] = HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded); -#endif - mi.cbSize=sizeof(mi); - mi.flags=CMIF_TCHAR; - mi.hIcon=hIcons[0]; - mi.ptszPopupName=TranslateT("&Help"); - mi.popupPosition=2000090000; - mi.position=1000000000; - mi.ptszName=(IsWindowVisible(hwndConsole))?TranslateT("Hide Console"):TranslateT("Show Console"); - mi.pszService=MS_CONSOLE_SHOW_HIDE; - hMenu = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); - - OnFontChange(0,0); - OnColourChange(0,0); - - if (DBGetContactSettingByte(NULL,"Console","ShowAtStart",0) || DBGetContactSettingByte(NULL,"Console","Show",1)) - ShowConsole(1); - else - ShowConsole(0); - } - - return 0; -} - -static int PreshutdownConsole(WPARAM wParam,LPARAM lParam) -{ - int i; - - if (hwndConsole) { - PostMessage(hwndConsole, WM_CLOSE, 0, 1 ); - } - - for (i=0;iModule, lw2->Module ); -} - -/////////////////////////////////////////////////////////////////////////////// - -static UINT logicons[] = {IDI_EMPTY, IDI_ARROW, IDI_IN, IDI_OUT, IDI_INFO}; - - -void InitConsole() -{ - int i; - HICON hi; - - mir_getMMI(&mmi); - mir_getUTFI(&utfi); - mir_getLI(&li); - - lModules.sortFunc = stringCompare; - lModules.increment = 5; - - hIcons[0] = LoadIcon(hInst, MAKEINTRESOURCE(IDI_CONSOLE)); - hIcons[1] = (HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_NOSCROLL),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0); - hIcons[2] = (HICON)LoadImage(hInst,MAKEINTRESOURCE(IDI_PAUSED),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0); - - for(i = 0; i < SIZEOF(ctrls); i++) { - hIcons[i+ICON_FIRST] = (HICON)LoadImage(hInst,MAKEINTRESOURCE(ctrls[i].icon),IMAGE_ICON,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0); - } - - gImg = ImageList_Create(LOGICONX_SIZE, LOGICONY_SIZE, ILC_COLOR24 | ILC_MASK, SIZEOF(logicons), 0); - - for(i = 0; i < SIZEOF(logicons); i++) - { - hi = (HICON)LoadImage(hInst,MAKEINTRESOURCE(logicons[i]),IMAGE_ICON,LOGICONX_SIZE,LOGICONY_SIZE,0); - if (hi) - { - ImageList_AddIcon(gImg, hi); - DestroyIcon(hi); - } - } - - LoadSettings(); - - mir_forkthread(ConsoleThread, 0); - - HookEvent(ME_SYSTEM_PRESHUTDOWN, PreshutdownConsole); - HookEvent(ME_SYSTEM_MODULESLOADED, OnSystemModulesLoaded); - HookEvent(ME_OPT_INITIALISE, OptInit); - - hHooks[0] = HookEvent( ME_NETLIB_FASTDUMP, OnFastDump ); -} - -void ShutdownConsole(void) -{ - int i; - - li.List_Destroy(&lModules); - - if (gImg) ImageList_Destroy(gImg); - - for(i = 0; i < SIZEOF(hIcons); i++) { - if (hIcons[i]) DestroyIcon(hIcons[i]); - } - -#ifdef TBB - if (BmpUp) DeleteObject(BmpUp); - if (BmpDn) DeleteObject(BmpDn); -#endif -} - -//////////////////////////////////////////////////////////////////////////////// - -TCHAR *addstring(TCHAR *str, TCHAR *add) { - _tcscpy(str,add); - return str + _tcslen(add) + 1; -} - - -static int Openfile(TCHAR *outputFile, int selection) -{ - OPENFILENAME ofn = {0}; - TCHAR filename[MAX_PATH+2] = _T(""); - TCHAR *title; - - TCHAR *filter, *tmp, *tmp1, *tmp2; - tmp1 = TranslateT("Text Files (*.txt)"); - tmp2 = TranslateT("All Files"); - filter = tmp = (TCHAR*)_alloca((_tcslen(tmp1)+_tcslen(tmp2)+11)*sizeof(TCHAR)); - tmp = addstring(tmp, tmp1); - tmp = addstring(tmp, _T("*.TXT")); - tmp = addstring(tmp, tmp2); - tmp = addstring(tmp, _T("*")); - *tmp = 0; - - if (selection) - title = TranslateT("Save selection to file"); - else - title = TranslateT("Save log to file"); - - ofn.lStructSize = sizeof(ofn); - ofn.lpstrFile = filename; - ofn.lpstrFilter = filter; - ofn.Flags = OFN_HIDEREADONLY | OFN_SHAREAWARE | OFN_PATHMUSTEXIST | OFN_OVERWRITEPROMPT; - ofn.lpstrTitle = title; - ofn.nMaxFile = MAX_PATH; - ofn.lpstrDefExt = _T("txt"); - - if (!GetSaveFileName(&ofn)) - return 0; - _tcscpy(outputFile, filename); - return 1; -} - -//////////////////////////////////////////////////////////////////////////////// diff --git a/console/Console.dsp b/console/Console.dsp deleted file mode 100644 index 292f47e..0000000 --- a/console/Console.dsp +++ /dev/null @@ -1,363 +0,0 @@ -# Microsoft Developer Studio Project File - Name="Console" - Package Owner=<4> -# Microsoft Developer Studio Generated Build File, Format Version 6.00 -# ** DO NOT EDIT ** - -# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 - -CFG=Console - Win32 Debug -!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 "Console.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 "Console.mak" CFG="Console - Win32 Debug" -!MESSAGE -!MESSAGE Possible choices for configuration are: -!MESSAGE -!MESSAGE "Console - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "Console - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "Console - Win32 Debug Unicode" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE "Console - Win32 Release Unicode" (based on "Win32 (x86) Dynamic-Link Library") -!MESSAGE - -# Begin Project -# PROP AllowPerConfigDependencies 0 -# PROP Scc_ProjName "Perforce Project" -# PROP Scc_LocalPath "." -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe - -!IF "$(CFG)" == "Console - 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 Target_Dir "" -# ADD BASE CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /D "_MBCS" /FR /Yu"Commonheaders.h" /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /D "_MBCS" /FR /Yu"Commonheaders.h" /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /i "..\..\include" /d "_DEBUG" -# ADD RSC /l 0x409 /i "..\..\include" /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 /subsystem:windows /dll /incremental:no /map /debug /machine:IX86 /out:"..\..\Bin\Debug\plugins\Console.dll" /pdbtype:sept -# SUBTRACT BASE LINK32 /pdb:none -# 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 /nologo /subsystem:windows /dll /incremental:no /map /debug /machine:IX86 /out:"..\..\Bin\Debug\plugins\Console.dll" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "Console - 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 /MD /W3 /GX /Ox /Ob2 /Gy /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /D "_MBCS" /FR /Yu"Commonheaders.h" /GF /c -# ADD CPP /nologo /MD /W3 /Zi /Ox /Ot /Os /Ob2 /Gf /Gy /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /D "_MBCS" /FR /Yu"Commonheaders.h" /GF /c -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /i "..\..\include" /d "NDEBUG" -# ADD RSC /l 0x409 /i "..\..\include" /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 /subsystem:windows /dll /map /machine:IX86 /out:"..\..\bin\release\plugins\Console.dll" /pdbtype:sept /ALIGN:4096 -# SUBTRACT BASE LINK32 /pdb:none -# 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 /nologo /subsystem:windows /dll /map /machine:IX86 /out:"..\..\bin\release\plugins\Console.dll" /pdbtype:sept /ALIGN:4096 -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "Console - Win32 Debug Unicode" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 1 -# PROP BASE Output_Dir "$(ConfigurationName)" -# PROP BASE Intermediate_Dir "$(ConfigurationName)" -# 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 /GX /Zi /Od /I "../../include" /D "_UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR /Fp".\Debug/Console.pch" /Yu"Commonheaders.h" /Fo".\Debug/" /Fd".\Debug/" /GZ /c -# ADD CPP /nologo /MDd /W3 /GX /Zi /Od /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR /Fp".\Debug/Console.pch" /Yu"Commonheaders.h" /Fo".\Debug/" /Fd".\Debug/" /GZ /c -# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /i "..\..\include" /d "_DEBUG" -# ADD RSC /l 0x409 /i "..\..\include" /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 /subsystem:windows /dll /incremental:no /pdb:".\Debug\Console.pdb" /map:".\Debug\Console.map" /debug /machine:IX86 /out:"..\..\Bin\Debug Unicode\plugins\Console.dll" /implib:".\Debug/Console.lib" /pdbtype:sept -# SUBTRACT BASE LINK32 /pdb:none -# 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 /nologo /subsystem:windows /dll /incremental:no /pdb:".\Debug\Console.pdb" /map:".\Debug\Console.map" /debug /machine:IX86 /out:"..\..\Bin\Debug Unicode\plugins\Console.dll" /implib:".\Debug/Console.lib" /pdbtype:sept -# SUBTRACT LINK32 /pdb:none - -!ELSEIF "$(CFG)" == "Console - Win32 Release Unicode" - -# PROP BASE Use_MFC 0 -# PROP BASE Use_Debug_Libraries 0 -# PROP BASE Output_Dir "$(ConfigurationName)" -# PROP BASE Intermediate_Dir "$(ConfigurationName)" -# 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 /MT /W3 /GX /Ox /Ob2 /Gy /I "../../include" /D "_UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR /Fo".\Release/" /GF /c -# ADD CPP /nologo /MD /W3 /Zi /Ox /Og /Gf /Gy /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /Fr /Fo".\Release/" /Fd".\Release/" /c -# SUBTRACT CPP /YX /Yc /Yu -# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 -# ADD BASE RSC /l 0x409 /i "..\..\include" /d "NDEBUG" -# ADD RSC /l 0x409 /i "..\..\include" /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 /subsystem:windows /dll /pdb:".\Release\Console.pdb" /map /machine:IX86 /out:"..\..\bin\release unicode\plugins\Console.dll" /implib:".\Release/Console.lib" /pdbtype:sept /ALIGN:4096 -# SUBTRACT BASE LINK32 /pdb:none -# 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 /nologo /subsystem:windows /dll /map /debug /machine:IX86 /out:"Release_Unicode\Plugins\Console.dll" /implib:".\Release/Console.lib" -# SUBTRACT LINK32 /pdb:none - -!ENDIF - -# Begin Target - -# Name "Console - Win32 Debug" -# Name "Console - Win32 Release" -# Name "Console - Win32 Debug Unicode" -# Name "Console - Win32 Release Unicode" -# Begin Group "Source Files" - -# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" -# Begin Source File - -SOURCE=Commonheaders.c -DEP_CPP_COMMO=\ - ".\Commonheaders.h"\ - ".\m_toolbar.h"\ - ".\m_toptoolbar.h"\ - ".\version.h"\ - {$(INCLUDE)}"m_button.h"\ - {$(INCLUDE)}"m_clist.h"\ - {$(INCLUDE)}"m_clui.h"\ - {$(INCLUDE)}"m_database.h"\ - {$(INCLUDE)}"m_fontservice.h"\ - {$(INCLUDE)}"m_hotkeys.h"\ - {$(INCLUDE)}"m_icolib.h"\ - {$(INCLUDE)}"m_langpack.h"\ - {$(INCLUDE)}"m_netlib.h"\ - {$(INCLUDE)}"m_options.h"\ - {$(INCLUDE)}"m_plugins.h"\ - {$(INCLUDE)}"m_system.h"\ - {$(INCLUDE)}"m_utils.h"\ - {$(INCLUDE)}"newpluginapi.h"\ - {$(INCLUDE)}"statusmodes.h"\ - {$(INCLUDE)}"win2k.h"\ - - -!IF "$(CFG)" == "Console - Win32 Debug" - -# ADD CPP /nologo /GX /Od /FR /Yc"Commonheaders.h" /GZ - -!ELSEIF "$(CFG)" == "Console - Win32 Release" - -# ADD CPP /nologo /GX /O2 /FR /Yc"Commonheaders.h" - -!ELSEIF "$(CFG)" == "Console - Win32 Debug Unicode" - -# ADD CPP /nologo /GX /Od /FR /Yc"Commonheaders.h" /GZ - -!ELSEIF "$(CFG)" == "Console - Win32 Release Unicode" - -# ADD CPP /nologo /GX /O2 /FR - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=Console.c -DEP_CPP_CONSO=\ - ".\Commonheaders.h"\ - ".\m_toolbar.h"\ - ".\m_toptoolbar.h"\ - ".\version.h"\ - {$(INCLUDE)}"m_button.h"\ - {$(INCLUDE)}"m_clist.h"\ - {$(INCLUDE)}"m_clui.h"\ - {$(INCLUDE)}"m_database.h"\ - {$(INCLUDE)}"m_fontservice.h"\ - {$(INCLUDE)}"m_hotkeys.h"\ - {$(INCLUDE)}"m_icolib.h"\ - {$(INCLUDE)}"m_langpack.h"\ - {$(INCLUDE)}"m_netlib.h"\ - {$(INCLUDE)}"m_options.h"\ - {$(INCLUDE)}"m_plugins.h"\ - {$(INCLUDE)}"m_system.h"\ - {$(INCLUDE)}"m_utils.h"\ - {$(INCLUDE)}"newpluginapi.h"\ - {$(INCLUDE)}"statusmodes.h"\ - {$(INCLUDE)}"win2k.h"\ - - -!IF "$(CFG)" == "Console - Win32 Debug" - -# ADD CPP /nologo /GX /Od /FR /GZ - -!ELSEIF "$(CFG)" == "Console - Win32 Release" - -# ADD CPP /nologo /GX /O2 /FR - -!ELSEIF "$(CFG)" == "Console - Win32 Debug Unicode" - -# ADD CPP /nologo /GX /Od /FR /GZ - -!ELSEIF "$(CFG)" == "Console - Win32 Release Unicode" - -# ADD CPP /nologo /GX /O2 /FR - -!ENDIF - -# End Source File -# Begin Source File - -SOURCE=.\init.c -DEP_CPP_INIT_=\ - ".\Commonheaders.h"\ - ".\m_toolbar.h"\ - ".\m_toptoolbar.h"\ - ".\version.h"\ - {$(INCLUDE)}"m_button.h"\ - {$(INCLUDE)}"m_clist.h"\ - {$(INCLUDE)}"m_clui.h"\ - {$(INCLUDE)}"m_database.h"\ - {$(INCLUDE)}"m_fontservice.h"\ - {$(INCLUDE)}"m_hotkeys.h"\ - {$(INCLUDE)}"m_icolib.h"\ - {$(INCLUDE)}"m_langpack.h"\ - {$(INCLUDE)}"m_netlib.h"\ - {$(INCLUDE)}"m_options.h"\ - {$(INCLUDE)}"m_plugins.h"\ - {$(INCLUDE)}"m_system.h"\ - {$(INCLUDE)}"m_utils.h"\ - {$(INCLUDE)}"newpluginapi.h"\ - {$(INCLUDE)}"statusmodes.h"\ - {$(INCLUDE)}"win2k.h"\ - -# End Source File -# End Group -# Begin Group "Header Files" - -# PROP Default_Filter "h;hpp;hxx;hm;inl" -# Begin Source File - -SOURCE=Commonheaders.h -# End Source File -# Begin Source File - -SOURCE=.\resource.h -# End Source File -# Begin Source File - -SOURCE=.\version.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=.\res\btn_dn.ico -# End Source File -# Begin Source File - -SOURCE=.\res\btn_up.ico -# End Source File -# Begin Source File - -SOURCE=.\res\close.ico -# End Source File -# Begin Source File - -SOURCE=Res\console.ico -# End Source File -# Begin Source File - -SOURCE=Res\console_dn.bmp -# End Source File -# Begin Source File - -SOURCE=Res\console_up.bmp -# End Source File -# Begin Source File - -SOURCE=.\Res\copy.ico -# End Source File -# Begin Source File - -SOURCE=.\Res\delete.ico -# End Source File -# Begin Source File - -SOURCE=.\res\noscroll.ico -# End Source File -# Begin Source File - -SOURCE=.\Res\options.ico -# End Source File -# Begin Source File - -SOURCE=.\res\pause.ico -# End Source File -# Begin Source File - -SOURCE=.\res\paused.ico -# End Source File -# Begin Source File - -SOURCE=resource.rc -# End Source File -# Begin Source File - -SOURCE=.\Res\Save.ico -# End Source File -# Begin Source File - -SOURCE=.\res\scroll.ico -# End Source File -# Begin Source File - -SOURCE=.\res\start.ico -# End Source File -# Begin Source File - -SOURCE=.\res\started.ico -# End Source File -# End Group -# End Target -# End Project diff --git a/console/Console.dsw b/console/Console.dsw deleted file mode 100644 index 3250410..0000000 --- a/console/Console.dsw +++ /dev/null @@ -1,33 +0,0 @@ -Microsoft Developer Studio Workspace File, Format Version 6.00 -# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! - -############################################################################### - -Project: "Console"=Console.dsp - Package Owner=<4> - -Package=<5> -{{{ - begin source code control - Perforce Project - . - end source code control -}}} - -Package=<4> -{{{ -}}} - -############################################################################### - -Global: - -Package=<5> -{{{ -}}} - -Package=<3> -{{{ -}}} - -############################################################################### - diff --git a/console/Console.opt b/console/Console.opt deleted file mode 100644 index 8c2c900..0000000 Binary files a/console/Console.opt and /dev/null differ diff --git a/console/Console.plg b/console/Console.plg deleted file mode 100644 index 60b675e..0000000 --- a/console/Console.plg +++ /dev/null @@ -1,49 +0,0 @@ - - -
-

Build Log

-

---------------------Configuration: Console - Win32 Release Unicode-------------------- -

-

Command Lines

-Creating command line "rc.exe /l 0x409 /fo"Release_Unicode/resource.res" /i "..\..\include" /d "NDEBUG" "D:\Sources\svn.miranda.im\console\trunk\resource.rc"" -Creating temporary file "C:\Temp\RSPB728.tmp" with contents -[ -/nologo /MD /W3 /GX /Zi /O2 /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /FR"Release_Unicode/" /Fo".\Release/" /Fd".\Release/" /c -"D:\Sources\svn.miranda.im\console\trunk\Commonheaders.c" -"D:\Sources\svn.miranda.im\console\trunk\Console.c" -] -Creating command line "cl.exe @C:\Temp\RSPB728.tmp" -Creating temporary file "C:\Temp\RSPB729.tmp" with contents -[ -/nologo /MD /W3 /Zi /Ox /Og /Gf /Gy /I "../../include" /D "_UNICODE" /D "UNICODE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_USRDLL" /D "Console_EXPORTS" /Fr"Release_Unicode/" /Fo".\Release/" /Fd".\Release/" /c -"D:\Sources\svn.miranda.im\console\trunk\init.c" -] -Creating command line "cl.exe @C:\Temp\RSPB729.tmp" -Creating temporary file "C:\Temp\RSPB72A.tmp" with contents -[ -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 /subsystem:windows /dll /incremental:no /pdb:"Release_Unicode/Console.pdb" /map:"Release_Unicode/Console.map" /debug /machine:IX86 /out:"Release_Unicode\Plugins\Console.dll" /implib:".\Release/Console.lib" -.\Release\Commonheaders.obj -.\Release\Console.obj -.\Release\init.obj -.\Release_Unicode\resource.res -] -Creating command line "link.exe @C:\Temp\RSPB72A.tmp" -

Output Window

-Compiling resources... -Compiling... -Commonheaders.c -Console.c -Generating Code... -Compiling... -init.c -Linking... - Creating library .\Release/Console.lib and object .\Release/Console.exp - - - -

Results

-Console.dll - 0 error(s), 0 warning(s) -
- - diff --git a/console/Console.sln b/console/Console.sln deleted file mode 100644 index 8387889..0000000 --- a/console/Console.sln +++ /dev/null @@ -1,40 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 11.00 -# Visual Studio 2010 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Console", "Console.vcxproj", "{A231E008-2D1A-4F24-95DD-59F56F85A499}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug Unicode|Win32 = Debug Unicode|Win32 - Debug Unicode|x64 = Debug Unicode|x64 - Debug|Win32 = Debug|Win32 - Debug|x64 = Debug|x64 - Release Unicode|Win32 = Release Unicode|Win32 - Release Unicode|x64 = Release Unicode|x64 - Release|Win32 = Release|Win32 - Release|x64 = Release|x64 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug|Win32.ActiveCfg = Debug|Win32 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug|Win32.Build.0 = Debug|Win32 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug|x64.ActiveCfg = Debug|x64 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Debug|x64.Build.0 = Debug|x64 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release Unicode|x64.Build.0 = Release Unicode|x64 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release|Win32.ActiveCfg = Release|Win32 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release|Win32.Build.0 = Release|Win32 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release|x64.ActiveCfg = Release|x64 - {A231E008-2D1A-4F24-95DD-59F56F85A499}.Release|x64.Build.0 = Release|x64 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(DPCodeReviewSolutionGUID) = preSolution - DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} - EndGlobalSection -EndGlobal diff --git a/console/Console.vcproj b/console/Console.vcproj deleted file mode 100644 index e84cbfb..0000000 --- a/console/Console.vcproj +++ /dev/null @@ -1,634 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/console/Console.vcxproj b/console/Console.vcxproj deleted file mode 100644 index 83e9903..0000000 --- a/console/Console.vcxproj +++ /dev/null @@ -1,608 +0,0 @@ - - - - - Debug Unicode - Win32 - - - Debug Unicode - x64 - - - Debug - Win32 - - - Debug - x64 - - - Release Unicode - Win32 - - - Release Unicode - x64 - - - Release - Win32 - - - Release - x64 - - - - {A231E008-2D1A-4F24-95DD-59F56F85A499} - Console - - - - - - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - MultiByte - - - DynamicLibrary - false - MultiByte - - - DynamicLibrary - false - MultiByte - - - DynamicLibrary - false - MultiByte - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ProjectFileVersion>10.0.30319.1 - false - false - false - false - false - false - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - false - false - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - $(SolutionDir)$(Configuration)/Plugins\ - $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/Console.tlb - - - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - Use - Commonheaders.h - true - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - - - true - true - true - false - - - MachineX86 - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - .\Debug/Console.tlb - - - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - Commonheaders.h - .\Debug/Console.pch - .\Debug/ - .\Debug/ - .\Debug/ - true - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - - - ../../Bin/Debug/plugins/Console.dll - true - true - .\Debug/Console.pdb - true - .\Debug/Console.map - false - - - .\Debug/Console.lib - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/Console.tlb - - - - - Full - AnySuitable - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreaded - true - Use - Commonheaders.h - true - Level3 - true - Default - Size - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - - - true - true - false - - - MachineX86 - - - true - true - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/Console.tlb - - - - - Full - AnySuitable - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreadedDLL - true - Use - Commonheaders.h - .\Release/Console.pch - .\Release/ - .\Release/ - .\Release/ - true - Level3 - true - Default - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - - - ../../bin/release/plugins/Console.dll - true - .\Release/Console.pdb - true - false - - - .\Release/Console.lib - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Debug/Console.tlb - - - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - _UNICODE;WIN32;_DEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebug - Use - Commonheaders.h - true - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - - - true - true - true - false - - - MachineX86 - - - - - - - _DEBUG;%(PreprocessorDefinitions) - true - true - .\Debug/Console.tlb - - - - - Disabled - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - _UNICODE;WIN32;_DEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - EnableFastChecks - MultiThreadedDebugDLL - Use - Commonheaders.h - .\Debug/Console.pch - .\Debug/ - .\Debug/ - .\Debug/ - true - Level3 - true - ProgramDatabase - Default - - - _DEBUG;%(PreprocessorDefinitions) - 0x0409 - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - - - ../../Bin/Debug Unicode/plugins/Console.dll - true - true - .\Debug/Console.pdb - true - .\Debug/Console.map - false - - - .\Debug/Console.lib - - - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - Win32 - .\Release/Console.tlb - - - - - Full - AnySuitable - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - _UNICODE;WIN32;NDEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreaded - true - Use - Commonheaders.h - true - Level3 - true - Default - Size - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - - - true - true - false - - - MachineX86 - - - true - true - - - - - NDEBUG;%(PreprocessorDefinitions) - true - true - .\Release/Console.tlb - - - - - Full - AnySuitable - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - _UNICODE;WIN32;NDEBUG;_WINDOWS;_USRDLL;Console_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions) - true - MultiThreaded - true - Use - Commonheaders.h - .\Release/Console.pch - .\Release/ - .\Release/ - .\Release/ - true - Level3 - true - Default - true - - - NDEBUG;%(PreprocessorDefinitions) - 0x0409 - ../include;../ExternalAPI;%(AdditionalIncludeDirectories) - - - true - .\Release/Console.pdb - true - false - - - .\Release/Console.lib - - - - - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - EnableFastChecks - EnableFastChecks - Create - Create - true - true - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS - EnableFastChecks - EnableFastChecks - Create - Create - true - true - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - Create - Create - true - true - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS - Create - Create - true - true - - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - EnableFastChecks - EnableFastChecks - true - true - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS - WIN32;_DEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS - EnableFastChecks - EnableFastChecks - true - true - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - true - true - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS - WIN32;NDEBUG;_WINDOWS;_MBCS;_USRDLL;Console_EXPORTS - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/console/Console.vcxproj.filters b/console/Console.vcxproj.filters deleted file mode 100644 index 7a841a2..0000000 --- a/console/Console.vcxproj.filters +++ /dev/null @@ -1,103 +0,0 @@ - - - - - {94e1a2e5-64bb-4574-a01b-61fbe40e73e2} - cpp;c;cxx;rc;def;r;odl;idl;hpj;bat - - - {a5d1caa4-5b85-489a-bedc-9709b86d7dc0} - h;hpp;hxx;hm;inl - - - {1e71008e-a4e4-44c1-a0a9-d5fd17cd53f2} - ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe - - - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - - - Resource Files - - - \ No newline at end of file diff --git a/console/Console_history.txt b/console/Console_history.txt deleted file mode 100644 index 0801dc0..0000000 --- a/console/Console_history.txt +++ /dev/null @@ -1,174 +0,0 @@ -PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND... -ONLY MORAL SUPPORT IN SPECIAL CASES CAN BE PROVIDED 8-) --------------------------------------------------------------------------------- - -v7.2 - -[+] console hot restart (to apply new options) -[+] always show at start option -[*] other small changes - - -v7.1 - -[+] switch tabs with CTRL+Left/Right -[+] log size limitation -[+] icons in log -[+] event separation with empty line -[-] create "(NULL)" tab only on demand -[*] dumping optimization -[*] small changes to compile in VC6 - - -v7.0 - -[+] tabbed mode support (tab for every NETLIB user) -[+] toolbar button for clist modern -[+] options page -[*] other small changes - - -v6.6 - -[+] logging pause button -[*] log scrolling hotkey was changed to Ctrl+Q -[*] more translatable strings -[-] fixed tooltips on buttons - - -v6.5 - -[+] global hotkey to show/hide console (Win+C by default) -[+] common shortcuts in console (Ctrl+C/S/D/A/O, Del) -[*] trying to hook netlib log on load -[*] hi-res console icon - - -v6.4 - -[-] some bugfixes (unicode version only) - - -v6.3 - -[!] NETLIB was removed. using netlib log hook. -[+] unicode support -[+] ansi / utf8 autodetection and conversion -[+] faster startup/shutdown/dumping -[+] variable line wrap length - - -v6.0 - 6.2 - -[!] internal builds - - -v5.4 - -[-] workaround for "\r" in console window -[*] small speed improvements in netlib log dump -[*] merge with SVN (netlib module) - - -v5.3 - -[*] PluginInfoEx was added, some code was replaced with core services (thanx Jazzy$) -[*] merge with SVN (netlib module) - - -v5.2 - -[*] merge with SVN (netlib module) -[*] fix for crash on exit (miranda 0.7 core issue) -[+] save and restore console window position - - -v5.1 - -[-] filter settings were not saved - - -v5.0 - -[+] buttons to copy/delete/save log, open options -[+] ability to select colors and font (fontservice needed) -[*] long lines (>90 chars) are wraped -[+] list-view auto width -[*] destoying all services before unload to prevent crashes - - -v4.0 - -[*] merged with lastest netlib - - -v3.3 - -[-] packet dumps still were not shown in some cases -[+] small optimizations - - -v3.2 - -[-] fixed huge memory leak -[-] packet dumps were not shown if logging to file was off - - -v3.1 - -[!] listview control console window. richedit is too slow - - -v3.0 - -[!] richedit control console window! - -v2.0 - -[?] - -v1.9 - -[+] abitity to remember last console state - -v1.8 - -[+] profile path is shown in console title - -v1.7 - -[?] - - -v1.6 - -[-] fixed AV on msg from NULL (thanx sh8an) -[*] attempt to fix windows shutdown issues with opened miranda - -v1.5 - -[+] ability to log only custom protocols (netlibusers) -[-] console window startup workaround to prevent crashes and other bugs - -v1.4 - -[+] console window writes log even in hidden state (if Log to Console is checked) -[+] ability to hide/show console from main menu and toptoolbar button -[+] open outgoing connections with delay is now optional -[*] console startup code was rewritten -[-] pressing Ctrl+C or Ctrl+Break in console window do not close Miranda any more -[-] now console window always appears on top - -v1.3 - -[+] console window from 0.3x netlib -[+] console buffer is 100 times larger -[+] console text convertion to OEM codepage -[-] close button now always disabled -[*] some changes to unloading - --------------------------------------------------------------------------------- -[!] important note -[+] added feature -[*] improved/changed feature -[-] bug fixed diff --git a/console/Console_readme.txt b/console/Console_readme.txt deleted file mode 100644 index 6d66f9b..0000000 --- a/console/Console_readme.txt +++ /dev/null @@ -1,21 +0,0 @@ -Console window plugin for Netlib logging. - -It is designed for Miranda developers & advanced users! 8-) - - -v7 introduced tabs support. Single window mode is also avaliable. -It can be switched in options. Icons and other stuff is avaliable. - -v6 is based on the code of v5 but without NETLIB. it uses new netlib log hook instead. -Netlib filters are still in Log Options but they are not part of console any more :). - -Also: -+ faster startup/shutdown/dumping -+ unicode support -+ ansi / utf8 autodetection and conversion -+ variable line wrap length - -Console window can be opened/closed with: - - (Top)ToolBar button - - MainMenu->Help->Show/Hide Console - - Hotkey using service "Console/Show/Hide" \ No newline at end of file diff --git a/console/commonheaders.c b/console/commonheaders.c deleted file mode 100644 index cbfb79d..0000000 --- a/console/commonheaders.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2008 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "commonheaders.h" \ No newline at end of file diff --git a/console/commonheaders.h b/console/commonheaders.h deleted file mode 100644 index 05a5d96..0000000 --- a/console/commonheaders.h +++ /dev/null @@ -1,69 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2008 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#define _WIN32_WINNT 0x0501 - -#pragma comment( lib, "comctl32.lib") - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define MIRANDA_VER 0x0800 - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "m_toolbar.h" -#include "m_toptoolbar.h" -#include "resource.h" - -#include "version.h" - -HINSTANCE hInst; - -void InitConsole(); -void ShutdownConsole(); - -#define MS_NETLIB_LOGWIN "Netlib/Log/Win" diff --git a/console/gpl.txt b/console/gpl.txt deleted file mode 100644 index 45645b4..0000000 --- a/console/gpl.txt +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/console/init.c b/console/init.c deleted file mode 100644 index 56c1dd4..0000000 --- a/console/init.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2008 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - -#include "commonheaders.h" - -PLUGINLINK *pluginLink; -DWORD mirandaVer; - - -PLUGININFOEX pluginInfoEx={ - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - __VERSION_DWORD, - __PLUGIN_LONGDESC, - __PLUGIN_AUTHOR, - __PLUGIN_EMAIL, - __PLUGIN_RIGHTS, - __PLUGIN_URL, - UNICODE_AWARE, - 0, - MIID_CONSOLE -}; - - -BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) -{ - hInst = hinstDLL; - return TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// - -__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) -{ - mirandaVer = mirandaVersion; - return &pluginInfoEx; -} - -// we implement service mode interface -static const MUUID interfaces[] = {MIID_LOGWINDOW, MIID_LAST}; -__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) -{ - return interfaces; -} - -//////////////////////////////////////////////////////////////////////////////// - -int __declspec(dllexport) Load(PLUGINLINK *link) -{ - pluginLink = link; - - if (mirandaVer < PLUGIN_MAKE_VERSION(0,8,0,3)) - return -1; - else - { - InitCommonControls(); - InitConsole(); - return 0; - } -} - - -int __declspec(dllexport) Unload(void) -{ - ShutdownConsole(); - return 0; -} diff --git a/console/res/arrow.ico b/console/res/arrow.ico deleted file mode 100644 index 56d058b..0000000 Binary files a/console/res/arrow.ico and /dev/null differ diff --git a/console/res/btn_dn.ico b/console/res/btn_dn.ico deleted file mode 100644 index f86cdc6..0000000 Binary files a/console/res/btn_dn.ico and /dev/null differ diff --git a/console/res/btn_up.ico b/console/res/btn_up.ico deleted file mode 100644 index d885ea0..0000000 Binary files a/console/res/btn_up.ico and /dev/null differ diff --git a/console/res/close.ico b/console/res/close.ico deleted file mode 100644 index 81237d0..0000000 Binary files a/console/res/close.ico and /dev/null differ diff --git a/console/res/close2.ico b/console/res/close2.ico deleted file mode 100644 index 7e9bd8a..0000000 Binary files a/console/res/close2.ico and /dev/null differ diff --git a/console/res/console.ico b/console/res/console.ico deleted file mode 100644 index 7252e62..0000000 Binary files a/console/res/console.ico and /dev/null differ diff --git a/console/res/console_dn.bmp b/console/res/console_dn.bmp deleted file mode 100644 index 33bb07c..0000000 Binary files a/console/res/console_dn.bmp and /dev/null differ diff --git a/console/res/console_up.bmp b/console/res/console_up.bmp deleted file mode 100644 index 2cdbb8d..0000000 Binary files a/console/res/console_up.bmp and /dev/null differ diff --git a/console/res/copy.ico b/console/res/copy.ico deleted file mode 100644 index c27f61f..0000000 Binary files a/console/res/copy.ico and /dev/null differ diff --git a/console/res/delete.ico b/console/res/delete.ico deleted file mode 100644 index 7d931ad..0000000 Binary files a/console/res/delete.ico and /dev/null differ diff --git a/console/res/empty.ico b/console/res/empty.ico deleted file mode 100644 index 567bbe8..0000000 Binary files a/console/res/empty.ico and /dev/null differ diff --git a/console/res/in.ico b/console/res/in.ico deleted file mode 100644 index ceda4e6..0000000 Binary files a/console/res/in.ico and /dev/null differ diff --git a/console/res/info.ico b/console/res/info.ico deleted file mode 100644 index bf6ada7..0000000 Binary files a/console/res/info.ico and /dev/null differ diff --git a/console/res/noscroll.ico b/console/res/noscroll.ico deleted file mode 100644 index 76c97c8..0000000 Binary files a/console/res/noscroll.ico and /dev/null differ diff --git a/console/res/options.ico b/console/res/options.ico deleted file mode 100644 index 2dbffa5..0000000 Binary files a/console/res/options.ico and /dev/null differ diff --git a/console/res/out.ico b/console/res/out.ico deleted file mode 100644 index 96425d3..0000000 Binary files a/console/res/out.ico and /dev/null differ diff --git a/console/res/pause.ico b/console/res/pause.ico deleted file mode 100644 index 6e177a1..0000000 Binary files a/console/res/pause.ico and /dev/null differ diff --git a/console/res/paused.ico b/console/res/paused.ico deleted file mode 100644 index 2d077bd..0000000 Binary files a/console/res/paused.ico and /dev/null differ diff --git a/console/res/save.ico b/console/res/save.ico deleted file mode 100644 index 4bb07fb..0000000 Binary files a/console/res/save.ico and /dev/null differ diff --git a/console/res/scroll.ico b/console/res/scroll.ico deleted file mode 100644 index abf4595..0000000 Binary files a/console/res/scroll.ico and /dev/null differ diff --git a/console/res/start.ico b/console/res/start.ico deleted file mode 100644 index 9272803..0000000 Binary files a/console/res/start.ico and /dev/null differ diff --git a/console/res/started.ico b/console/res/started.ico deleted file mode 100644 index 3bc0da2..0000000 Binary files a/console/res/started.ico and /dev/null differ diff --git a/console/resource.h b/console/resource.h deleted file mode 100644 index e0b9ed2..0000000 --- a/console/resource.h +++ /dev/null @@ -1,58 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by resource.rc -// -#define IDB_CONSOLE_UP 100 -#define IDB_CONSOLE_DOWN 101 -#define IDD_MSG 111 -#define IDD_CONSOLE 112 -#define IDD_LOG 113 -#define IDD_OPTIONS 114 -#define IDI_COPY 402 -#define IDI_NOSCROLL 403 -#define IDI_SCROLL 404 -#define IDI_SAVE 405 -#define IDI_DELETE 406 -#define IDI_OPTIONS 407 -#define IDI_PAUSED 408 -#define IDI_STARTED 409 -#define IDI_BTN_UP 410 -#define IDI_BTN_DN 411 -#define IDI_CLOSE 412 -#define IDI_START 413 -#define IDI_PAUSE 414 -#define IDI_IN 415 -#define IDI_OUT 416 -#define IDI_ARROW 417 -#define IDI_INFO 418 -#define IDI_EMPTY 419 -#define IDC_TABS 1000 -#define IDC_LIST 1001 -#define IDC_SAVE 1002 -#define IDC_PAUSE 1003 -#define IDC_SCROLL 1004 -#define IDC_COPY 1005 -#define IDC_DELETE 1006 -#define IDC_OPTIONS 1007 -#define IDI_CONSOLE 1008 -#define IDC_CLOSE 1009 -#define IDC_PAUSEALL 1010 -#define IDC_STARTALL 1011 -#define IDC_SINGLE 1012 -#define IDC_WRAP 1013 -#define IDC_SHOWICONS 1014 -#define IDC_SEPARATOR 1015 -#define IDC_LIMIT 1016 -#define IDC_START 1017 -#define IDC_RESTART 1018 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 115 -#define _APS_NEXT_COMMAND_VALUE 40000 -#define _APS_NEXT_CONTROL_VALUE 1019 -#define _APS_NEXT_SYMED_VALUE 102 -#endif -#endif diff --git a/console/resource.rc b/console/resource.rc deleted file mode 100644 index d6f054e..0000000 --- a/console/resource.rc +++ /dev/null @@ -1,223 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include -#include -#include -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_CONSOLE DIALOGEX 0, 0, 335, 257 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | - WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME -CAPTION "Console " -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "",IDC_TABS,"SysTabControl32",TCS_FOCUSNEVER | - WS_CLIPSIBLINGS | WS_TABSTOP,0,0,335,257 -END - -IDD_LOG DIALOGEX 0, 0, 335, 257 -STYLE DS_SETFONT | DS_CONTROL | WS_CHILD | WS_CLIPCHILDREN -FONT 10, "Courier", 0, 0, 0x1 -BEGIN - CONTROL "List1",IDC_LIST,"SysListView32",LVS_REPORT | - LVS_SHAREIMAGELISTS | LVS_NOCOLUMNHEADER | - LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,0,18,335,239 - CONTROL "&S",IDC_SAVE,"MButtonClass",WS_TABSTOP,0,1,14,16, - 0x18000000L - CONTROL "&P",IDC_PAUSE,"MButtonClass",WS_TABSTOP,16,1,14,16, - 0x18000000L - CONTROL "&Q",IDC_SCROLL,"MButtonClass",WS_TABSTOP,32,1,14,16, - 0x18000000L - CONTROL "&C",IDC_COPY,"MButtonClass",WS_TABSTOP,48,1,14,16, - 0x18000000L - CONTROL "&D",IDC_DELETE,"MButtonClass",WS_TABSTOP,64,1,14,16, - 0x18000000L - CONTROL "&O",IDC_OPTIONS,"MButtonClass",WS_TABSTOP,80,1,14,16, - 0x18000000L - CONTROL "",IDC_STARTALL,"MButtonClass",WS_TABSTOP,278,1,14,16, - 0x18000000L - CONTROL "",IDC_PAUSEALL,"MButtonClass",WS_TABSTOP,294,1,14,16, - 0x18000000L - CONTROL "&W",IDC_CLOSE,"MButtonClass",WS_TABSTOP,320,1,14,16, - 0x18000000L -END - -IDD_OPTIONS DIALOGEX 0, 0, 314, 239 -STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "Single window mode*",IDC_SINGLE,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,8,9,297,10 - CONTROL "Show icons in log*",IDC_SHOWICONS,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,8,24,297,10 - CONTROL "New lines between events*",IDC_SEPARATOR,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,8,39,297,10 - CONTROL "Always show at start",IDC_START,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,8,54,297,10 - EDITTEXT IDC_WRAP,8,69,23,11,ES_RIGHT | ES_NUMBER - EDITTEXT IDC_LIMIT,8,86,59,11,ES_RIGHT | ES_NUMBER - LTEXT "Lines wrap length [25-255]",IDC_STATIC,35,70,272,10 - LTEXT "Log size limit [1 000 - 1 000 000 lines]",IDC_STATIC,71, - 86,236,10 - LTEXT "* Restart needed",IDC_STATIC,8,106,296,10 - PUSHBUTTON "Save settings and restart console",IDC_RESTART,12,129, - 287,17 -END - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#include \r\n" - "#include \0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 0,0,7,2 - PRODUCTVERSION 0,0,7,2 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x1L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "FileDescription", "Console log window for Miranda 0.8.0.3+" - VALUE "FileVersion", "0.0.7.2" - VALUE "InternalName", "Console" - VALUE "LegalCopyright", " 2005-2009 Bio" - VALUE "OriginalFilename", "Console.dll" - VALUE "ProductName", "Console" - VALUE "ProductVersion", "0.0.7.2" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_COPY ICON "Res\\copy.ico" -IDI_CONSOLE ICON "res\\console.ico" -IDI_NOSCROLL ICON "Res\\noscroll.ico" -IDI_SCROLL ICON "Res\\scroll.ico" -IDI_SAVE ICON "Res\\save.ico" -IDI_DELETE ICON "Res\\delete.ico" -IDI_OPTIONS ICON "Res\\options.ico" -IDI_PAUSED ICON "Res\\paused.ico" -IDI_STARTED ICON "Res\\started.ico" -IDI_BTN_UP ICON "Res\\btn_up.ico" -IDI_BTN_DN ICON "Res\\btn_dn.ico" -IDI_CLOSE ICON "Res\\close.ico" -IDI_PAUSE ICON "Res\\pause.ico" -IDI_START ICON "Res\\start.ico" -IDI_IN ICON "Res\\in.ico" -IDI_OUT ICON "Res\\out.ico" -IDI_ARROW ICON "Res\\arrow.ico" -IDI_INFO ICON "Res\\info.ico" -IDI_EMPTY ICON "Res\\empty.ico" - -///////////////////////////////////////////////////////////////////////////// -// -// Bitmap -// - -IDB_CONSOLE_UP BITMAP "res\\console_up.bmp" -IDB_CONSOLE_DOWN BITMAP "res\\console_dn.bmp" - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_CONSOLE, DIALOG - BEGIN - BOTTOMMARGIN, 256 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/console/version.h b/console/version.h deleted file mode 100644 index f7a19ef..0000000 --- a/console/version.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2008 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -This program is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License -as published by the Free Software Foundation; either version 2 -of the License, or (at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -*/ - - -#define __FILEVERSION_STRING 0,0,7,2 -#define __VERSION_STRING "0.0.7.2" -#define __VERSION_DWORD 0x00000702 - - -#define __PLUGIN_DESC "Console log window for Miranda 0.8.0.3+" -#define __PLUGIN_LONGDESC __PLUGIN_DESC ". Compiled by Bio. Enjoy! 8-) [ Built "__DATE__" "__TIME__" ]" -#define __PLUGIN_AUTHOR "Bio" -#define __PLUGIN_EMAIL "bio@msx.ru" -#define __PLUGIN_RIGHTS " 2005-2009 Bio" -#define __PLUGIN_FILE "Console.dll" -#define __PLUGIN_SHORTNAME "Console" - - -#ifdef _UNICODE - // {23D4F302-D513-45b7-9027-445F29557311} - #define MIID_CONSOLE { 0x23d4f302, 0xd513, 0x45b7, { 0x90, 0x27, 0x44, 0x5f, 0x29, 0x55, 0x73, 0x11 }} - #define __PLUGIN_NAME __PLUGIN_SHORTNAME " (Unicode)" - #define __PLUGIN_URL "http://addons.miranda-im.org/details.php?action=viewfile&id=3791" -#endif - -#ifndef _UNICODE - // {798A94B8-74F4-46fc-978B-353D22BD485E} - #define MIID_CONSOLE { 0x798a94b8, 0x74f4, 0x46fc, { 0x97, 0x8b, 0x35, 0x3d, 0x22, 0xbd, 0x48, 0x5e }} - #define __PLUGIN_NAME __PLUGIN_SHORTNAME " (ANSI)" - #define __PLUGIN_URL "http://addons.miranda-im.org/details.php?action=viewfile&id=3789" -#endif -- cgit v1.2.3