From 0a3cc6ed06a3eac9f9c2243c432c6d4443603aae Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Tue, 3 Jul 2012 18:25:01 +0000 Subject: AvatarHistory adopted git-svn-id: http://svn.miranda-ng.org/main/trunk@739 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AvatarHistory/AvatarDlg.cpp | 2 +- plugins/AvatarHistory/AvatarHistory.cpp | 44 +- plugins/AvatarHistory/AvatarHistory.h | 23 +- plugins/AvatarHistory/AvatarHistory.vcxproj | 480 +++------------------ .../AvatarHistory/AvatarHistory.vcxproj.filters | 3 - plugins/AvatarHistory/icolib.cpp | 4 +- plugins/AvatarHistory/options.cpp | 4 +- 7 files changed, 86 insertions(+), 474 deletions(-) (limited to 'plugins/AvatarHistory') diff --git a/plugins/AvatarHistory/AvatarDlg.cpp b/plugins/AvatarHistory/AvatarDlg.cpp index 4abe154016..0e829b4d9c 100644 --- a/plugins/AvatarHistory/AvatarDlg.cpp +++ b/plugins/AvatarHistory/AvatarDlg.cpp @@ -551,7 +551,7 @@ void InitMenuItem() mi.position = 1000090010; mi.hIcon = createDefaultOverlayedIcon(FALSE); mi.pszService = MS_AVATARHISTORY_SHOWDIALOG; - hMenu = (HANDLE)CallService(MS_CLIST_ADDCONTACTMENUITEM, 0, (LPARAM)&mi); + hMenu = Menu_AddContactMenuItem(&mi); DestroyIcon(mi.hIcon); } diff --git a/plugins/AvatarHistory/AvatarHistory.cpp b/plugins/AvatarHistory/AvatarHistory.cpp index 8dca674f77..9b6eb6c774 100644 --- a/plugins/AvatarHistory/AvatarHistory.cpp +++ b/plugins/AvatarHistory/AvatarHistory.cpp @@ -36,8 +36,6 @@ char *metacontacts_proto = NULL; TCHAR profilePath[MAX_PATH]; // database profile path (read at startup only) TCHAR basedir[MAX_PATH]; -MM_INTERFACE mmi; -UTF8_INTERFACE utfi; int hLangpack = 0; HANDLE hAvatarWindowsList = NULL; @@ -60,32 +58,18 @@ static INT_PTR GetCachedAvatar(WPARAM wParam, LPARAM lParam); TCHAR * GetCachedAvatar(char *proto, TCHAR *hash); BOOL CreateShortcut(TCHAR *file, TCHAR *shortcut); - - PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), -#ifdef _WIN64 - "Avatar History (x64)", -#elif _UNICODE - "Avatar History (Unicode)", -#else - "Avatar History (Ansi)", -#endif + "Avatar History", PLUGIN_MAKE_VERSION(0,0,3,3), - "This plugin keeps backups of all your contacts' avatar changes and/or shows popups", + "This plugin keeps backups of all your contacts' avatar changes and/or shows popups.", "Matthew Wild (MattJ), Ricardo Pescuma Domenecci", "mwild1@gmail.com", "© 2006-2012 Matthew Wild, Ricardo Pescuma Domenecci", "http://pescuma.org/miranda/avatarhist", UNICODE_AWARE, 0, //doesn't replace anything built-in -#ifdef _WIN64 - { 0xe04702a2, 0x379, 0x4c69, { 0xbf, 0x8a, 0x84, 0xd5, 0xd0, 0xc9, 0x19, 0xcc } } // {E04702A2-0379-4C69-BF8A-84D5D0C919CC} -#elif _UNICODE { 0xdbe8c990, 0x7aa0, 0x458d, { 0xba, 0xb7, 0x33, 0xeb, 0x7, 0x23, 0x8e, 0x71 } } // {DBE8C990-7AA0-458d-BAB7-33EB07238E71} -#else - { 0x4079923c, 0x8aa1, 0x4a2e, { 0x95, 0x8b, 0x9d, 0xc, 0xd0, 0xe8, 0x2e, 0xb2 } } // {4079923C-8AA1-4a2e-958B-9D0CD0E82EB2} -#endif }; extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) @@ -96,16 +80,11 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvRese extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { - if(mirandaVersion < PLUGIN_MAKE_VERSION(0,9,50,3)) - { - MessageBox(NULL,_T("AvatarHistory requires Miranda IM 0.9.50 or later."),_T("Avatar History"),MB_OK); - return NULL; - } - mirVer = mirandaVersion; return &pluginInfo; } static const MUUID interfaces[] = { MIID_AVATAR_CHANGE_LOGGER, MIID_AVATAR_CHANGE_NOTIFIER, MIID_LAST }; + extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) { return interfaces; @@ -159,20 +138,8 @@ static INT_PTR CALLBACK FirstRunDlgProc(HWND hwnd,UINT uMsg,WPARAM wParam,LPARAM return FALSE; } -extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) +extern "C" __declspec(dllexport) int Load(void) { - pluginLink=link; - - if(mir_getMMI(&mmi)) - { - MessageBox(NULL,_T("Avatar History"),_T("Miranda Memory manager not initialized, plugin cannot load.\nPlease update Miranda IM to the latest version."),MB_OK | MB_TOPMOST); - return 1; - } - if(mir_getUTFI(&utfi)) - { - MessageBox(NULL,_T("Avatar History"),_T("Miranda UTF8 interface not initialized, plugin cannot load.\nPlease update Miranda IM to the latest version."),MB_OK | MB_TOPMOST); - return 1; - } mir_getLP(&pluginInfo); // Is first run? @@ -319,7 +286,6 @@ BOOL ProtocolEnabled(const char *proto) return (BOOL) DBGetContactSettingByte(NULL, MODULE_NAME, setting, TRUE); } - BOOL ContactEnabled(HANDLE hContact, char *setting, int def) { if (hContact == NULL) @@ -621,7 +587,7 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam) return 0; } -extern "C" int __declspec(dllexport) Unload(void) +extern "C" __declspec(dllexport) int Unload(void) { return 0; } diff --git a/plugins/AvatarHistory/AvatarHistory.h b/plugins/AvatarHistory/AvatarHistory.h index 25ec454de2..e6d7c185d5 100644 --- a/plugins/AvatarHistory/AvatarHistory.h +++ b/plugins/AvatarHistory/AvatarHistory.h @@ -1,3 +1,5 @@ +#define _CRT_SECURE_NO_WARNINGS +#define MIRANDA_VER 0x0A00 #include #include #include @@ -8,8 +10,6 @@ #include #include - -#define MIRANDA_VER 0x0900 #include #include #include @@ -21,27 +21,26 @@ #include #include #include -#include #include -#include #include -#include #include #include +#include +#include +#include +#include "m_avatarhist.h" +#include "m_historyevents.h" + +#include "resource.h" +#include "../utils/mir_buffer.h" + // Globals extern HINSTANCE hInst; extern HANDLE hMenu; extern DWORD mirVer; extern HANDLE hAvatarWindowsList; -#include "resource.h" -#include "m_avatarhist.h" - -#include "../utils/mir_buffer.h" - -#include "../historyevents/m_historyevents.h" - #define MODULE_NAME "AvatarHistory" #define AVH_DEF_POPUPFG 0 diff --git a/plugins/AvatarHistory/AvatarHistory.vcxproj b/plugins/AvatarHistory/AvatarHistory.vcxproj index e5b0fb0b25..5cfac18ca4 100644 --- a/plugins/AvatarHistory/AvatarHistory.vcxproj +++ b/plugins/AvatarHistory/AvatarHistory.vcxproj @@ -17,532 +17,182 @@ Release x64 - - Unicode Debug - Win32 - - - Unicode Debug - x64 - - - Unicode Release - Win32 - - - Unicode Release - x64 - - - - - DynamicLibrary - false - Unicode - - - DynamicLibrary - false - Unicode - DynamicLibrary - false - MultiByte - - - DynamicLibrary - false - MultiByte - - - DynamicLibrary - false Unicode + true - + DynamicLibrary - false Unicode + true DynamicLibrary - false - MultiByte + Unicode DynamicLibrary - false - MultiByte + Unicode - - - - - - - - - - - - - - - - - - - - - - true - avatarhistW - $(SolutionDir)$(Platform)\$(Configuration)\Plugins\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - - - true - avatarhistW - $(SolutionDir)$(Platform)\$(Configuration)\Plugins\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - - - true - avatarhistW - $(SolutionDir)$(Platform)\$(Configuration)\Plugins\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - - - true - avatarhistW - $(SolutionDir)$(Platform)\$(Configuration)\Plugins\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - - - false - avatarhistW - $(SolutionDir)$(Platform)\$(Configuration)\Plugins\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - - - false - avatarhistW - $(SolutionDir)$(Platform)\$(Configuration)\Plugins\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - - - false - avatarhistW - $(SolutionDir)$(Platform)\$(Configuration)\Plugins\ - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - - - false - avatarhistW - $(SolutionDir)obj\$(Platform)\$(Configuration)\ - $(SolutionDir)$(Platform)\$(Configuration)\Plugins\ + + <_ProjectFileVersion>10.0.30319.1 + $(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)\ + true - MultiThreadedDebug - Default + MultiThreadedDebugDLL false Disabled - true Level3 true EditAndContinue - ../../include;sdk;%(AdditionalIncludeDirectories) - DBGPOPUPS;WIN32;_DEBUG;_WINDOWS;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) - false + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks AvatarHistory.h + Use - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\AvatarHistory.tlb - true - Win32 - - 0x0809 _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi - - true - $(IntDir)$(TargetName).bsc - - true true true - Console - .\Debug\avatarhist.lib + Windows comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).pdb + false + $(IntDir)$(TargetName).lib + $(SolutionDir)\lib - - if not exist "$(OutputPath)Docs\" mkdir "$(OutputPath)Docs\" -copy "$(ProjectDir)Docs\*.*" "$(OutputPath)Docs\" - - - Preparing Release - - MultiThreadedDebug - Default + MultiThreadedDebugDLL false Disabled - true Level3 - ProgramDatabase - ../../include;sdk;%(AdditionalIncludeDirectories) - DBGPOPUPS;_WIN64;_DEBUG;_WINDOWS;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) - false + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + WIN64;_DEBUG;_WINDOWS;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) EnableFastChecks AvatarHistory.h + Use - - true - _DEBUG;%(PreprocessorDefinitions) - .\Debug\AvatarHistory.tlb - true - - 0x0809 _DEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi - - true - $(IntDir)$(TargetName).bsc - - true true true - Console - .\Debug\avatarhist.lib + Windows comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).pdb + false + $(IntDir)$(TargetName).lib + $(SolutionDir)\lib - - if not exist "$(OutputPath)Docs\" mkdir "$(OutputPath)Docs\" -copy "$(ProjectDir)Docs\*.*" "$(OutputPath)Docs\" - - - Preparing Release - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - true - EditAndContinue - ../../include;sdk;%(AdditionalIncludeDirectories) - DBGPOPUPS;WIN32;_DEBUG;_WINDOWS;_UNICODE;UNICODE;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) - false - EnableFastChecks - AvatarHistory.h - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Unicode_Debug\AvatarHistory.tlb - true - Win32 - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - $(IntDir)$(TargetName).bsc - - - true - true - true - Console - comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).pdb - - - if not exist "$(OutputPath)Docs\" mkdir "$(OutputPath)Docs\" -copy "$(ProjectDir)Docs\*.*" "$(OutputPath)Docs\" - - - Preparing Release - - - - - MultiThreadedDebug - Default - false - Disabled - true - Level3 - ProgramDatabase - ../../include;sdk;%(AdditionalIncludeDirectories) - DBGPOPUPS;_WIN64;_DEBUG;_WINDOWS;_UNICODE;UNICODE;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) - false - EnableFastChecks - AvatarHistory.h - - - true - _DEBUG;%(PreprocessorDefinitions) - .\Unicode_Debug\AvatarHistory.tlb - true - - - 0x0809 - _DEBUG;%(PreprocessorDefinitions) - - - true - $(IntDir)$(TargetName).bsc - - - true - true - true - Console - comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).pdb - - - if not exist "$(OutputPath)Docs\" mkdir "$(OutputPath)Docs\" -copy "$(ProjectDir)Docs\*.*" "$(OutputPath)Docs\" - - - Preparing Release - - MultiThreadedDLL OnlyExplicitInline true true - MinSpace - true + Full Level3 - ../../include;sdk;%(AdditionalIncludeDirectories) + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) - false AvatarHistory.h + Use + Size - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\AvatarHistory.tlb - true - Win32 - - 0x0809 NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi - - true - $(IntDir)$(TargetName).bsc - - true true - Console - false + Windows comctl32.lib;%(AdditionalDependencies) - false - $(OutDir)$(TargetName).pdb + true + $(IntDir)$(TargetName).lib + true + true + false + $(SolutionDir)\lib - - if not exist "$(OutputPath)Docs\" mkdir "$(OutputPath)Docs\" -copy "$(ProjectDir)Docs\*.*" "$(OutputPath)Docs\" - - - Preparing Release - - MultiThreadedDLL - OnlyExplicitInline - true - true - MinSpace - true - Level3 - ../../include;sdk;%(AdditionalIncludeDirectories) - _WIN64;NDEBUG;_WINDOWS;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) - false - AvatarHistory.h - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Release\AvatarHistory.tlb - true - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - $(IntDir)$(TargetName).bsc - - - true - true - Console - false - .\Release\avatarhist.lib - comctl32.lib;%(AdditionalDependencies) - false - $(OutDir)$(TargetName).pdb - - - if not exist "$(OutputPath)Docs\" mkdir "$(OutputPath)Docs\" -copy "$(ProjectDir)Docs\*.*" "$(OutputPath)Docs\" - - - Preparing Release - - - - - MultiThreadedDLL - OnlyExplicitInline - true - true - MinSpace - true - Level3 - ../../include;sdk;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_UNICODE;UNICODE;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) - false - AvatarHistory.h - - - true - NDEBUG;%(PreprocessorDefinitions) - .\Unicode_Release\AvatarHistory.tlb - true - Win32 - - - 0x0809 - NDEBUG;%(PreprocessorDefinitions) - - - true - $(IntDir)$(TargetName).bsc - - - true - true - Console - false - comctl32.lib;%(AdditionalDependencies) - false - $(OutDir)$(TargetName).pdb - - - if not exist "$(OutputPath)Docs\" mkdir "$(OutputPath)Docs\" -copy "$(ProjectDir)Docs\*.*" "$(OutputPath)Docs\" - - - Preparing Release - - - - - MultiThreadedDLL OnlyExplicitInline true true - MinSpace - true + Full Level3 - ../../include;sdk;%(AdditionalIncludeDirectories) - _WIN64;NDEBUG;_WINDOWS;_UNICODE;UNICODE;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) - false + ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + WIN64;NDEBUG;_WINDOWS;_USRDLL;AvatarHistory_EXPORTS;%(PreprocessorDefinitions) AvatarHistory.h + Use + Size - - true - NDEBUG;%(PreprocessorDefinitions) - .\Unicode_Release\AvatarHistory.tlb - true - - 0x0809 NDEBUG;%(PreprocessorDefinitions) + ..\..\include\msapi - - true - $(IntDir)$(TargetName).bsc - - true true - Console - false + Windows comctl32.lib;%(AdditionalDependencies) - $(OutDir)$(TargetName).pdb - false + true + $(IntDir)$(TargetName).lib + true + true + false + $(SolutionDir)\lib - - if not exist "$(OutputPath)Docs\" mkdir "$(OutputPath)Docs\" -copy "$(ProjectDir)Docs\*.*" "$(OutputPath)Docs\" - - - Preparing Release - - + + Create + - + + NotUsing + - diff --git a/plugins/AvatarHistory/AvatarHistory.vcxproj.filters b/plugins/AvatarHistory/AvatarHistory.vcxproj.filters index b405a21122..01f2a4ea0a 100644 --- a/plugins/AvatarHistory/AvatarHistory.vcxproj.filters +++ b/plugins/AvatarHistory/AvatarHistory.vcxproj.filters @@ -41,9 +41,6 @@ Header Files - - Header Files - Header Files diff --git a/plugins/AvatarHistory/icolib.cpp b/plugins/AvatarHistory/icolib.cpp index b8e54b0807..a4105eef3c 100644 --- a/plugins/AvatarHistory/icolib.cpp +++ b/plugins/AvatarHistory/icolib.cpp @@ -70,7 +70,7 @@ void SetupIcoLib() GetModuleFileName(hInst, path, sizeof(path)); - sid.cbSize = SKINICONDESC_SIZE; + sid.cbSize = sizeof(sid); sid.ptszSection = LPGENT("Avatar History"); sid.ptszDefaultFile = path; sid.flags = SIDF_ALL_TCHAR; @@ -82,7 +82,7 @@ void SetupIcoLib() sid.ptszDescription = iconList[i].szDescr; sid.pszName = iconList[i].szName; sid.iDefaultIndex = -iconList[i].defIconID; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + Skin_AddIcon(&sid); } } } diff --git a/plugins/AvatarHistory/options.cpp b/plugins/AvatarHistory/options.cpp index 2d1a75116a..bd4da44d7f 100644 --- a/plugins/AvatarHistory/options.cpp +++ b/plugins/AvatarHistory/options.cpp @@ -79,7 +79,7 @@ int OptInit(WPARAM wParam,LPARAM lParam) odp.pfnDlgProc = OptionsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR | ODPF_EXPERTONLY; - CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); + Options_AddPage(wParam, &odp); if(ServiceExists(MS_POPUP_ADDPOPUPT)) { @@ -96,7 +96,7 @@ int OptInit(WPARAM wParam,LPARAM lParam) odp.nExpertOnlyControls = MAX_REGS(popupsExpertControls); odp.nIDBottomSimpleControl = IDC_POPUPS; odp.nIDRightSimpleControl = IDC_POPUPS; - CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp); + Options_AddPage(wParam, &odp); } return 0; -- cgit v1.2.3