From 6a22ccd156510e65fb91f45a81a9e87d5ad07568 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sat, 19 May 2012 14:04:48 +0000 Subject: added ZeroNotification git-svn-id: http://svn.miranda-ng.org/main/trunk@75 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ZeroNotification/Zero Notification_10.sln | 37 ++ .../ZeroNotification/Zero Notification_10.vcxproj | 618 +++++++++++++++++++++ .../Zero Notification_10.vcxproj.filters | 41 ++ plugins/ZeroNotification/common.h | 19 + plugins/ZeroNotification/main.c | 320 +++++++++++ plugins/ZeroNotification/res/ZeroNotifyW.rc | 154 +++++ plugins/ZeroNotification/res/resource.h | 20 + plugins/ZeroNotification/version.h | 24 + 8 files changed, 1233 insertions(+) create mode 100644 plugins/ZeroNotification/Zero Notification_10.sln create mode 100644 plugins/ZeroNotification/Zero Notification_10.vcxproj create mode 100644 plugins/ZeroNotification/Zero Notification_10.vcxproj.filters create mode 100644 plugins/ZeroNotification/common.h create mode 100644 plugins/ZeroNotification/main.c create mode 100644 plugins/ZeroNotification/res/ZeroNotifyW.rc create mode 100644 plugins/ZeroNotification/res/resource.h create mode 100644 plugins/ZeroNotification/version.h diff --git a/plugins/ZeroNotification/Zero Notification_10.sln b/plugins/ZeroNotification/Zero Notification_10.sln new file mode 100644 index 0000000000..bd549e9c96 --- /dev/null +++ b/plugins/ZeroNotification/Zero Notification_10.sln @@ -0,0 +1,37 @@ +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ZeroNotify", "Zero Notification_10.vcxproj", "{E37561EB-B9C5-4215-9FF9-DB559916FBA2}" +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 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Debug Unicode|Win32.ActiveCfg = Debug Unicode|Win32 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Debug Unicode|Win32.Build.0 = Debug Unicode|Win32 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Debug Unicode|x64.ActiveCfg = Debug Unicode|x64 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Debug Unicode|x64.Build.0 = Debug Unicode|x64 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Debug|Win32.ActiveCfg = Debug|Win32 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Debug|Win32.Build.0 = Debug|Win32 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Debug|x64.ActiveCfg = Debug|x64 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Debug|x64.Build.0 = Debug|x64 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Release Unicode|Win32.ActiveCfg = Release Unicode|Win32 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Release Unicode|Win32.Build.0 = Release Unicode|Win32 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Release Unicode|x64.ActiveCfg = Release Unicode|x64 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Release Unicode|x64.Build.0 = Release Unicode|x64 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Release|Win32.ActiveCfg = Release|Win32 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Release|Win32.Build.0 = Release|Win32 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Release|x64.ActiveCfg = Release|x64 + {E37561EB-B9C5-4215-9FF9-DB559916FBA2}.Release|x64.Build.0 = Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/plugins/ZeroNotification/Zero Notification_10.vcxproj b/plugins/ZeroNotification/Zero Notification_10.vcxproj new file mode 100644 index 0000000000..ba98ddecdf --- /dev/null +++ b/plugins/ZeroNotification/Zero Notification_10.vcxproj @@ -0,0 +1,618 @@ + + + + + Debug Unicode + Win32 + + + Debug Unicode + x64 + + + Debug + Win32 + + + Debug + x64 + + + Release Unicode + Win32 + + + Release Unicode + x64 + + + Release + Win32 + + + Release + x64 + + + + ZeroNotify + {E37561EB-B9C5-4215-9FF9-DB559916FBA2} + avs + + + + DynamicLibrary + false + MultiByte + true + + + DynamicLibrary + false + MultiByte + true + + + DynamicLibrary + false + Unicode + true + + + DynamicLibrary + false + Unicode + true + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.30319.1 + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + true + true + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + true + true + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + true + true + $(SolutionDir)$(Configuration)/Plugins\ + $(SolutionDir)$(Configuration)64/Plugins\ + $(SolutionDir)$(Configuration)/Obj/$(ProjectName)\ + $(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\ + true + true + $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(SolutionDir)\..\SVN\Miranda\Trunk\miranda\include + $(VCInstallDir)include;$(VCInstallDir)atlmfc\include;$(WindowsSdkDir)include;$(FrameworkSDKDir)\include;$(SolutionDir)\..\SVN\Miranda\Trunk\miranda\include + false + false + $(ProjectName)W + $(ProjectName)W + $(ProjectName)W + $(ProjectName)W + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug_Unicode/avatars.tlb + + + + + Disabled + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + false + true + EnableFastChecks + MultiThreadedDebug + false + Fast + + + + + + + + + Level3 + true + EditAndContinue + CompileAsC + + + _DEBUG;UNICODE;%(PreprocessorDefinitions) + 0x0809 + + + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + true + $(TargetDir)$(TargetName).pdb + false + + + + + + + $(IntDir)$(TargetName).lib + MachineX86 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\Debug_Unicode/avatars.tlb + + + + + Disabled + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_WARNINGS;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + false + EnableFastChecks + MultiThreadedDebug + false + Fast + + + + + + + + + Level3 + true + ProgramDatabase + CompileAsC + + + _DEBUG;UNICODE;%(PreprocessorDefinitions) + 0x0809 + + + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + true + $(TargetDir)$(TargetName).pdb + false + + + + + + + $(IntDir)$(TargetName).lib + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/avatars.tlb + + + + + Disabled + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + true + EnableFastChecks + MultiThreadedDebug + true + Fast + + + commonheaders.h + + + + + Level3 + true + EditAndContinue + 4996;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0809 + + + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + true + false + + + false + + + $(IntDir)$(TargetName).lib + MachineX86 + + + + + _DEBUG;%(PreprocessorDefinitions) + true + true + .\Debug/avatars.tlb + + + + + Disabled + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + EnableFastChecks + MultiThreadedDebug + true + Fast + + + commonheaders.h + + + + + Level3 + true + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + _DEBUG;%(PreprocessorDefinitions) + 0x0809 + + + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + true + false + + + false + + + $(IntDir)$(TargetName).lib + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release_Unicode/avatars.tlb + + + + + Full + OnlyExplicitInline + false + Size + false + false + true + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;UNICODE;_USRDLL;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + true + false + MultiThreadedDLL + false + false + NotSet + Fast + false + + + commonheaders.h + + + false + Level3 + true + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + true + false + false + + + NDEBUG;UNICODE;%(PreprocessorDefinitions) + 0x0809 + + + /IGNORE:4089 /filealign:512 %(AdditionalOptions) + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).pdb + true + true + UseLinkTimeCodeGeneration + 0x5130000 + true + + + $(IntDir)$(TargetName).lib + MachineX86 + false + false + + + $(IntDir)$(TargetName).xml + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Release_Unicode/avatars.tlb + + + + + Full + OnlyExplicitInline + false + Size + false + false + true + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;UNICODE;_USRDLL;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + true + false + MultiThreadedDLL + false + false + NotSet + Fast + false + + + commonheaders.h + + + false + Level3 + true + ProgramDatabase + CompileAsC + 4996;%(DisableSpecificWarnings) + false + false + + + NDEBUG;UNICODE;%(PreprocessorDefinitions) + 0x0809 + + + /IGNORE:4089 /filealign:512 %(AdditionalOptions) + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + $(IntDir)$(TargetName).pdb + true + true + UseLinkTimeCodeGeneration + 0x5130000 + true + + + $(IntDir)$(TargetName).lib + false + false + + + $(IntDir)$(TargetName).xml + + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/avatars.tlb + + + + + Full + OnlyExplicitInline + Size + true + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + Fast + false + + + commonheaders.h + + + + + Level3 + true + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + 0x0809 + + + /IGNORE:4089 /filealign:512 %(AdditionalOptions) + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + true + false + + + true + true + UseLinkTimeCodeGeneration + 0x5130000 + false + + + $(IntDir)$(TargetName).lib + MachineX86 + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Release/avatars.tlb + + + + + Full + OnlyExplicitInline + Size + true + ../../include;../ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;LOADAVATARS_EXPORTS;%(PreprocessorDefinitions) + true + + + MultiThreadedDLL + false + true + Fast + false + + + commonheaders.h + + + + + Level3 + true + ProgramDatabase + 4996;%(DisableSpecificWarnings) + + + NDEBUG;%(PreprocessorDefinitions) + 0x0809 + + + /IGNORE:4089 /filealign:512 %(AdditionalOptions) + comctl32.lib;msimg32.lib;%(AdditionalDependencies) + true + true + false + + + true + true + UseLinkTimeCodeGeneration + 0x5130000 + false + + + $(IntDir)$(TargetName).lib + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/plugins/ZeroNotification/Zero Notification_10.vcxproj.filters b/plugins/ZeroNotification/Zero Notification_10.vcxproj.filters new file mode 100644 index 0000000000..541bc658ad --- /dev/null +++ b/plugins/ZeroNotification/Zero Notification_10.vcxproj.filters @@ -0,0 +1,41 @@ + + + + + {fe0a3f0c-2eef-4a36-b519-d16772710072} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {5afeb58f-46e6-4fa7-ac3c-5d53e7052429} + h;hpp;hxx;hm;inl + + + {dcb10d94-3d1f-4b38-b173-39966e2f3acb} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + + + Source Files + + + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + + \ No newline at end of file diff --git a/plugins/ZeroNotification/common.h b/plugins/ZeroNotification/common.h new file mode 100644 index 0000000000..d0efafec1b --- /dev/null +++ b/plugins/ZeroNotification/common.h @@ -0,0 +1,19 @@ +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#define DEFAULT_NOSOUND 0x00000000 +#define DEFAULT_NOBLINK 0x00000000 +#define DEFAULT_NOCLCBLINK 0x00000000 + +#define DISABLE_SOUND "Disable &Sounds" +#define ENABLE_SOUND "Enable &Sounds" + diff --git a/plugins/ZeroNotification/main.c b/plugins/ZeroNotification/main.c new file mode 100644 index 0000000000..556f8ae282 --- /dev/null +++ b/plugins/ZeroNotification/main.c @@ -0,0 +1,320 @@ +/* +A small Miranda plugin, by bidyut, updated by Maat. + +Original plugin idea Anders Nilsson. +His plugin NoSound can be found at: +http://anders.nilsson.net/programs/miranda + +Miranda can be found here: +http://www.miranda-im.org/ +*/ + +#include "version.h" +#include "common.h" +#include "res\resource.h" + +HINSTANCE hInst; +PLUGINLINK *pluginLink; +static HANDLE hEventSoundSettingChange, hEventStatusModeChange, hEventOptionsInitialize, hAckEvent; +CLISTMENUITEM mi; +int noSoundMenu; +int hLangpack; + +struct CheckBoxValues_t { + DWORD style; + TCHAR *szDescr; +}; + +static const struct CheckBoxValues_t statusValues[]={ + {PF2_ONLINE, TEXT("Online")}, + {PF2_SHORTAWAY, TEXT("Away")}, + {PF2_LONGAWAY, TEXT("NA")}, + {PF2_LIGHTDND, TEXT("Occupied")}, + {PF2_HEAVYDND, TEXT("DND")}, + {PF2_FREECHAT, TEXT("Free for chat")}, + {PF2_INVISIBLE, TEXT("Invisible")}, + {PF2_OUTTOLUNCH, TEXT("Out to lunch")}, + {PF2_ONTHEPHONE, TEXT("On the phone")} +}; + +PLUGININFOEX pluginInfoEx = { + sizeof(PLUGININFOEX), + PLUGINNAME, + PLUGIN_MAKE_VERSION(VER_MAJOR, VER_MINOR, VER_RELEASE, VER_BUILD), + DESCRIPTION, + AUTHOR, + "", + COPYRIGHT, + "", +#if defined(UNICODE) | defined(_UNICODE) + UNICODE_AWARE, //not transient +#else + 0, +#endif + 0, + UID +}; + +__declspec(dllexport) PLUGININFO * MirandaPluginInfo(DWORD mirandaVersion) +{ + pluginInfoEx.cbSize = sizeof(PLUGININFO); + return (PLUGININFO*)&pluginInfoEx; + //return &pluginInfo; +} + +__declspec(dllexport) PLUGININFOEX * MirandaPluginInfoEx(DWORD mirandaVersion) +{ + if (mirandaVersion < PLUGIN_MAKE_VERSION(0, 7, 0, 0)) + return NULL; + return &pluginInfoEx; +} + +static const MUUID interfaces[] = { { 0x5ce6036a, 0x8cb5, 0x4601, { 0xbc, 0x7f, 0x25, 0x4e, 0x21, 0x2a, 0x48, 0x80 } }, MIID_LAST}; +__declspec(dllexport) const MUUID * MirandaPluginInterfaces(void) +{ + return interfaces; +} + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + hInst = hinstDLL; + return TRUE; +} + +static void FillCheckBoxTree(HWND hwndTree,const struct CheckBoxValues_t *values,int nValues,DWORD style) +{ + TVINSERTSTRUCT tvis; + int i; + + tvis.hParent=NULL; + tvis.hInsertAfter=TVI_LAST; + tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_STATE; + for(i=0;i>12==2)) flags|=tvi.lParam; + tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem); + } + return flags; +} + +//Update the name on the menu +static void UpdateMenuItem(){ + if (DBGetContactSettingByte(NULL,"Skin","UseSound",1)) + mi.pszName= Translate(DISABLE_SOUND); + else + mi.pszName= Translate(ENABLE_SOUND); +} + +//Called when the sound setting in the database is changed +static int SoundSettingChanged(WPARAM wParam,LPARAM lParam) +{ + DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; + if(lstrcmpA(cws->szModule, "Skin") || lstrcmpA(cws->szSetting, "UseSound")) return 0; + + UpdateMenuItem(); + + mi.flags = CMIM_NAME; + CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)noSoundMenu,(LPARAM)&mi); + + return 0; +} + +static int SetNotify(const long status){ + DBWriteContactSettingByte(NULL,"Skin","UseSound", (BYTE) !(DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoSound",DEFAULT_NOSOUND) & status)); + DBWriteContactSettingByte(NULL,"CList","DisableTrayFlash", (BYTE) (DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoBlink",DEFAULT_NOBLINK) & status)); + DBWriteContactSettingByte(NULL,"CList","NoIconBlink", (BYTE) (DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoCLCBlink",DEFAULT_NOCLCBLINK) & status)); + + UpdateMenuItem(); + + mi.flags = CMIM_NAME; + CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)noSoundMenu,(LPARAM)&mi); + + return 0; +} + +//Called whenever a change in status is detected +static int ProtoAck(WPARAM wParam, LPARAM lParam) +{ + ACKDATA *ack=(ACKDATA*)lParam; + PROTOCOLDESCRIPTOR **protos; + + //quit if not status event + if ( ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS ) { + long status = 0; + int i, count; + CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) & count, (LPARAM) & protos); + + for (i = 0; i < count; i++) { + status = status | Proto_Status2Flag(CallProtoService(protos[i]->szName, PS_GETSTATUS, 0, 0)); + } + + SetNotify(status); + + return 0; + } + + return 0; +} + +static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + DWORD test; + switch (msg) + { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + SetWindowLong(GetDlgItem(hwndDlg,IDC_NOSOUND),GWL_STYLE,GetWindowLong(GetDlgItem(hwndDlg,IDC_NOSOUND),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES); + SetWindowLong(GetDlgItem(hwndDlg,IDC_NOBLINK),GWL_STYLE,GetWindowLong(GetDlgItem(hwndDlg,IDC_NOBLINK),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES); + SetWindowLong(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),GWL_STYLE,GetWindowLong(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),GWL_STYLE)|TVS_NOHSCROLL|TVS_CHECKBOXES); + CheckDlgButton(hwndDlg, IDC_HIDEMENU, DBGetContactSettingByte(NULL,PLUGINNAME_SHORT,"HideMenu",1) ? BST_CHECKED : BST_UNCHECKED); + + FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOSOUND),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoSound",DEFAULT_NOSOUND)); + FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOBLINK),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoBlink",DEFAULT_NOBLINK)); + FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_NOCLCBLINK),statusValues,sizeof(statusValues)/sizeof(statusValues[0]),DBGetContactSettingDword(NULL,PLUGINNAME_SHORT,"NoCLCBlink",DEFAULT_NOCLCBLINK)); + return TRUE; + case WM_COMMAND: + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + case WM_NOTIFY: + switch(((LPNMHDR)lParam)->idFrom) { + case IDC_NOSOUND: + case IDC_NOBLINK: + case IDC_NOCLCBLINK: + if(((LPNMHDR)lParam)->code==NM_CLICK) { + TVHITTESTINFO hti; + hti.pt.x=(short)LOWORD(GetMessagePos()); + hti.pt.y=(short)HIWORD(GetMessagePos()); + ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt); + if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti)){ + if(hti.flags&TVHT_ONITEMSTATEICON) { + TVITEM tvi; + tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE; + tvi.hItem=hti.hItem; + TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi); + tvi.iImage=tvi.iSelectedImage=tvi.iImage==1?2:1; + TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + } + } + } + break; + case 0: + switch (((LPNMHDR)lParam)->code) { + case PSN_APPLY: + DBWriteContactSettingByte(NULL,PLUGINNAME_SHORT,"HideMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEMENU)); + + DBWriteContactSettingDword(NULL,PLUGINNAME_SHORT,"NoSound",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOSOUND))); + DBWriteContactSettingDword(NULL,PLUGINNAME_SHORT,"NoBlink",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOBLINK))); + DBWriteContactSettingDword(NULL,PLUGINNAME_SHORT,"NoCLCBlink",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_NOCLCBLINK))); + + test = DBGetContactSettingWord(NULL,"CList","Status",0); + SetNotify(Proto_Status2Flag(DBGetContactSettingWord(NULL,"CList","Status",0))); + return TRUE; + } + break; + } + } + return FALSE; +} +//Called when the user opened the options dialog +static int OptionsInitialize(WPARAM wParam,LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp; + + ZeroMemory(&odp,sizeof(odp)); + odp.cbSize = sizeof(odp); + odp.position = 100000000; + odp.hInstance = hInst; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOSOUND); + odp.pszTitle = PLUGINNAME_SHORT; + odp.pszTitle = "Zero Notifications"; + odp.pszGroup = Translate("Plugins"); + odp.groupPosition = 100000000; + odp.pfnDlgProc = DlgProcNoSoundOpts; + CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) &odp); + + return 0; +} + +static INT_PTR NoSoundMenuCommand(WPARAM wParam,LPARAM lParam) +{ + if (DBGetContactSettingByte(NULL,"Skin","UseSound",1)) + DBWriteContactSettingByte(NULL,"Skin","UseSound",0); +// else +// DBWriteContactSettingByte(NULL,"Skin","UseSound",1); + + return 0; +} + +int __declspec(dllexport) Load(PLUGINLINK *link) +{ + char temp[80]; + pluginLink = link; + mir_getLP(&pluginInfoEx); + + CallService(MS_SYSTEM_GETVERSIONTEXT, (WPARAM)sizeof(temp), (LPARAM)temp); + +#ifdef _UNICODE + if (strstr(temp, "Unicode") == NULL) + { + //ReportError(TranslateT("Please update "PLUGINNAME" to ANSI Version")); //debug + return 1; + } +#else + if (strstr(temp, "Unicode") != NULL) + { + //ReportError(Translate("Please update "PLUGINNAME" to Unicode Version")); + return 1; + } +#endif + + //The menu item - begin + if (!DBGetContactSettingByte(NULL,PLUGINNAME_SHORT,"HideMenu",1)) + { + CreateServiceFunction(PLUGINNAME_SHORT "/MenuCommand",NoSoundMenuCommand); + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=-0x7FFFFFFF; + mi.flags=0; + UpdateMenuItem(); + + mi.pszService=PLUGINNAME_SHORT "/MenuCommand"; + noSoundMenu = CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); + } + //The menu item - end + + + //The hooks + hAckEvent = HookEvent(ME_PROTO_ACK, ProtoAck); + hEventSoundSettingChange = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SoundSettingChanged); + hEventOptionsInitialize = HookEvent(ME_OPT_INITIALISE, OptionsInitialize); + + //Uninstall info + DBWriteContactSettingString(NULL,"Uninstall",PLUGINNAME_SHORT,PLUGINNAME_SHORT); + + return 0; +} + +int __declspec(dllexport) Unload(void) +{ + UnhookEvent(hEventSoundSettingChange); + UnhookEvent(hEventOptionsInitialize); + UnhookEvent(hAckEvent); + return 0; +} diff --git a/plugins/ZeroNotification/res/ZeroNotifyW.rc b/plugins/ZeroNotification/res/ZeroNotifyW.rc new file mode 100644 index 0000000000..5d0ab0dcc7 --- /dev/null +++ b/plugins/ZeroNotification/res/ZeroNotifyW.rc @@ -0,0 +1,154 @@ +// 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 + +///////////////////////////////////////////////////////////////////////////// +// German (Germany) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_DEU) +#ifdef _WIN32 +LANGUAGE LANG_GERMAN, SUBLANG_GERMAN +#pragma code_page(1252) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 0,0,0,5 + PRODUCTVERSION 0,0,0,5 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "080004b0" + BEGIN + VALUE "FileDescription", "Zero Notification Plugin for Miranda IM" + VALUE "FileVersion", "VER_MAJOR.VER_MINOR.VER_RELEASE.VER_BUILD" + VALUE "InternalName", "ZeroNotify" + VALUE "LegalCopyright", "© 2005 bidyut, © 2009 Maat" + VALUE "OriginalFilename", "zeronotifyw.dll" + VALUE "ProductName", "Zero Notification Plugin for Miranda IM" + VALUE "ProductVersion", "0.0.0.5" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x800, 1200 + END +END + +#endif // German (Germany) 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.\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_OPT_NOSOUND DIALOG 0, 0, 244, 145 +STYLE DS_SETFONT | DS_CENTER | WS_CHILD +FONT 8, "MS Shell Dlg" +BEGIN + CONTROL "Hide the ""toggle sound"" menu item (requires restart of Miranda)",IDC_HIDEMENU, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,4,133,234,10 + CONTROL "Tree1",IDC_NOSOUND,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_TABSTOP,4,22,77,105 + CONTROL "Tree1",IDC_NOBLINK,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_TABSTOP,87,22,73,105 + CONTROL "Tree1",IDC_NOCLCBLINK,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | TVS_NONEVENHEIGHT | WS_BORDER | WS_TABSTOP,165,22,73,105 + LTEXT "No sounds when:",IDC_STATIC,4,4,77,8 + LTEXT "No SysTray blink when:",IDC_STATIC,87,4,77,8 + LTEXT "No CLIST blink when:",IDC_STATIC,165,4,73,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_OPT_NOSOUND, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 238 + TOPMARGIN, 4 + BOTTOMMARGIN, 126 + HORZGUIDE, 109 + HORZGUIDE, 143 + 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/plugins/ZeroNotification/res/resource.h b/plugins/ZeroNotification/res/resource.h new file mode 100644 index 0000000000..ac11d8b30b --- /dev/null +++ b/plugins/ZeroNotification/res/resource.h @@ -0,0 +1,20 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by ZeroNotifyW.rc +// +#define IDD_OPT_NOSOUND 101 +#define IDC_NOSOUND 1000 +#define IDC_NOBLINK 1002 +#define IDC_NOCLCBLINK 1003 +#define IDC_HIDEMENU 1008 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 103 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1001 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/plugins/ZeroNotification/version.h b/plugins/ZeroNotification/version.h new file mode 100644 index 0000000000..729522483f --- /dev/null +++ b/plugins/ZeroNotification/version.h @@ -0,0 +1,24 @@ +#define VER_MAJOR 0 +#define VER_MINOR 0 +#define VER_RELEASE 0 +#define VER_BUILD 5 + +#define PLUGINNAME_SHORT "ZeroNotify" +#if defined(_WIN64) + #define PLUGINNAME "Zero Notifications (x64)" +#elif defined(_UNICODE) + #define PLUGINNAME "Zero Notifications (Unicode)" +#else + #define PLUGINNAME "Zero Notifications" +#endif +#define DESCRIPTION "Adds options to automatically disable notifications when a protocol is in a certain status." +#define AUTHOR "bidyut (<0.0.0.5), Maat" +#define COPYRIGHT "© 2005 bidyut, © 2009 Maat" + +#if defined(_UNICODE) + // {47D489D3-310D-4ef6-BD05-699FFFD5A4AA} + #define UID { 0x47d489d3, 0x310d, 0x4ef6, { 0xbd, 0x5, 0x69, 0x9f, 0xff, 0xd5, 0xa4, 0xaa } } +#else + // {C92FA511-EACE-4add-99B1-FDB7AA150E14} + #define UID { 0xc92fa511, 0xeace, 0x4add, { 0x99, 0xb1, 0xfd, 0xb7, 0xaa, 0x15, 0xe, 0x14 } } +#endif -- cgit v1.2.3