From fc771dfd08bb363fb3767285ab88503edfebdf98 Mon Sep 17 00:00:00 2001 From: "wishmaster51@gmail.com" Date: Wed, 21 Mar 2012 15:06:28 +0000 Subject: HistoryEvents: -x64 version -destroy service functions -support for costum langpacks -updated header files -updated copyrights git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@238 c086bb3d-8645-0410-b8da-73a8550f86e7 --- Plugins/historyevents/commons.h | 4 +- Plugins/historyevents/historyevents.cpp | 97 ++-- Plugins/historyevents/historyevents.sln | 26 - Plugins/historyevents/historyevents.vcxproj | 541 +++++++++++++++++++++ .../historyevents/historyevents.vcxproj.filters | 70 +++ Plugins/historyevents/historyevents_10.sln | 38 ++ Plugins/historyevents/options.cpp | 15 +- Plugins/historyevents/sdk/m_metacontacts.h | 4 + Plugins/historyevents/sdk/m_updater.h | 4 + Plugins/historyevents/sdk/m_variables.h | 33 +- 10 files changed, 733 insertions(+), 99 deletions(-) delete mode 100644 Plugins/historyevents/historyevents.sln create mode 100644 Plugins/historyevents/historyevents.vcxproj create mode 100644 Plugins/historyevents/historyevents.vcxproj.filters create mode 100644 Plugins/historyevents/historyevents_10.sln diff --git a/Plugins/historyevents/commons.h b/Plugins/historyevents/commons.h index 6af20b2..ecbcaa9 100644 --- a/Plugins/historyevents/commons.h +++ b/Plugins/historyevents/commons.h @@ -1,5 +1,5 @@ /* -Copyright (C) 2006 Ricardo Pescuma Domenecci +Copyright (C) 2006-2012 Ricardo Pescuma Domenecci This is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -30,6 +30,7 @@ Boston, MA 02111-1307, USA. // Miranda headers #define MIRANDA_VER 0x0700 +#define MIRANDA_CUSTOM_LP #include #include @@ -59,7 +60,6 @@ Boston, MA 02111-1307, USA. // Global Variables extern HINSTANCE hInst; -extern PLUGINLINK *pluginLink; extern LIST handlers; #define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]) ) diff --git a/Plugins/historyevents/historyevents.cpp b/Plugins/historyevents/historyevents.cpp index af59899..d33a626 100644 --- a/Plugins/historyevents/historyevents.cpp +++ b/Plugins/historyevents/historyevents.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 2006 Ricardo Pescuma Domenecci +Copyright (C) 2006-2012 Ricardo Pescuma Domenecci This is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -28,7 +28,9 @@ Boston, MA 02111-1307, USA. PLUGININFOEX pluginInfo={ sizeof(PLUGININFOEX), -#ifdef UNICODE +#ifdef _WIN64 + "History Events (x64)", +#elif UNICODE "History Events (Unicode)", #else "History Events", @@ -37,11 +39,13 @@ PLUGININFOEX pluginInfo={ "A service plugin to handle custom history events", "Ricardo Pescuma Domenecci", "", - "© 2007 Ricardo Pescuma Domenecci", + "© 2007-2012 Ricardo Pescuma Domenecci", "http://pescuma.mirandaim.ru/miranda/historyevents", UNICODE_AWARE, 0, //doesn't replace anything built-in -#ifdef UNICODE +#ifdef _WIN64 + { 0xc79ed89c, 0xa34b, 0x4d4d, { 0x90, 0x5f, 0x71, 0x60, 0x63, 0xb7, 0x1e, 0x98 } } // {C79ED89C-A34B-4D4D-905F-716063B71E98} +#elif UNICODE { 0x25b9a055, 0x1e7f, 0x4505, { 0x99, 0xef, 0x9b, 0xc7, 0x6e, 0x3f, 0x1b, 0xd0 } } // {25B9A055-1E7F-4505-99EF-9BC76E3F1BD0} #else { 0xe502920c, 0xd4b9, 0x44d0, { 0xad, 0x29, 0xf0, 0x3, 0x93, 0x75, 0xc4, 0xf9 } } // {E502920C-D4B9-44d0-AD29-F0039375C4F9} @@ -54,27 +58,29 @@ PLUGINLINK *pluginLink; MM_INTERFACE mmi; UTF8_INTERFACE utfi; LIST_INTERFACE li; +int hLangpack = 0; int SortHandlers(const HISTORY_EVENT_HANDLER *type1, const HISTORY_EVENT_HANDLER *type2); LIST handlers(20, SortHandlers); static HANDLE hHooks[4] = {0}; +static HANDLE hServices[10] = {0}; int ModulesLoaded(WPARAM wParam, LPARAM lParam); int PreShutdown(WPARAM wParam, LPARAM lParam); int DbEventFilterAdd(WPARAM wParam, LPARAM lParam); int DbEventAdded(WPARAM wParam, LPARAM lParam); -int ServiceGetCount(WPARAM wParam, LPARAM lParam); -int ServiceGetEvent(WPARAM wParam, LPARAM lParam); -int ServiceRegister(WPARAM wParam, LPARAM lParam); -int ServiceCanHandle(WPARAM wParam, LPARAM lParam); -int ServiceGetIcon(WPARAM wParam, LPARAM lParam); -int ServiceGetFlags(WPARAM wParam, LPARAM lParam); -int ServiceGetText(WPARAM wParam, LPARAM lParam); -int ServiceReleaseText(WPARAM wParam, LPARAM lParam); -int ServiceAddToHistory(WPARAM wParam, LPARAM lParam); -int ServiceIsEnabledTemplate(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceGetCount(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceGetEvent(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceRegister(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceCanHandle(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceGetIcon(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceGetFlags(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceGetText(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceReleaseText(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceAddToHistory(WPARAM wParam, LPARAM lParam); +INT_PTR ServiceIsEnabledTemplate(WPARAM wParam, LPARAM lParam); HANDLE hDeleteThreadEvent; DWORD WINAPI DeleteThread(LPVOID vParam); @@ -119,16 +125,8 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvRe } -extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) -{ - pluginInfo.cbSize = sizeof(PLUGININFO); - return (PLUGININFO*) &pluginInfo; -} - - extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { - pluginInfo.cbSize = sizeof(PLUGININFOEX); return &pluginInfo; } @@ -147,6 +145,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) mir_getMMI(&mmi); mir_getUTFI(&utfi); mir_getLI(&li); + mir_getLP(&pluginInfo); hDeleteThreadEvent = CreateEvent(NULL, FALSE, FALSE, NULL); @@ -170,16 +169,16 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link) | HISTORYEVENTS_FLAG_EXPECT_CONTACT_NAME_BEFORE, "core_main_3", GetFileHistoryEventText); - CreateServiceFunction(MS_HISTORYEVENTS_GET_COUNT, ServiceGetCount); - CreateServiceFunction(MS_HISTORYEVENTS_GET_EVENT, ServiceGetEvent); - CreateServiceFunction(MS_HISTORYEVENTS_REGISTER, ServiceRegister); - CreateServiceFunction(MS_HISTORYEVENTS_CAN_HANDLE, ServiceCanHandle); - CreateServiceFunction(MS_HISTORYEVENTS_GET_ICON, ServiceGetIcon); - CreateServiceFunction(MS_HISTORYEVENTS_GET_FLAGS, ServiceGetFlags); - CreateServiceFunction(MS_HISTORYEVENTS_GET_TEXT, ServiceGetText); - CreateServiceFunction(MS_HISTORYEVENTS_RELEASE_TEXT, ServiceReleaseText); - CreateServiceFunction(MS_HISTORYEVENTS_ADD_TO_HISTORY, ServiceAddToHistory); - CreateServiceFunction(MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE, ServiceIsEnabledTemplate); + hServices[0] = CreateServiceFunction(MS_HISTORYEVENTS_GET_COUNT, ServiceGetCount); + hServices[1] = CreateServiceFunction(MS_HISTORYEVENTS_GET_EVENT, ServiceGetEvent); + hServices[2] = CreateServiceFunction(MS_HISTORYEVENTS_REGISTER, ServiceRegister); + hServices[3] = CreateServiceFunction(MS_HISTORYEVENTS_CAN_HANDLE, ServiceCanHandle); + hServices[4] = CreateServiceFunction(MS_HISTORYEVENTS_GET_ICON, ServiceGetIcon); + hServices[5] = CreateServiceFunction(MS_HISTORYEVENTS_GET_FLAGS, ServiceGetFlags); + hServices[6] = CreateServiceFunction(MS_HISTORYEVENTS_GET_TEXT, ServiceGetText); + hServices[7] = CreateServiceFunction(MS_HISTORYEVENTS_RELEASE_TEXT, ServiceReleaseText); + hServices[8] = CreateServiceFunction(MS_HISTORYEVENTS_ADD_TO_HISTORY, ServiceAddToHistory); + hServices[9] = CreateServiceFunction(MS_HISTORYEVENTS_IS_ENABLED_TEMPLATE, ServiceIsEnabledTemplate); // hooks hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); @@ -218,13 +217,15 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) upd.szBetaChangelogURL = "http://pescuma.org/miranda/historyevents#Changelog"; upd.pbBetaVersionPrefix = (BYTE *)"HistoryEvents "; upd.cpbBetaVersionPrefix = strlen((char *)upd.pbBetaVersionPrefix); -#ifdef UNICODE +#ifdef _WIN64 + upd.szBetaUpdateURL = "http://pescuma.org/miranda/historyevents64.zip"; +#elif UNICODE upd.szBetaUpdateURL = "http://pescuma.org/miranda/historyeventsW.zip"; #else upd.szBetaUpdateURL = "http://pescuma.org/miranda/historyevents.zip"; #endif - upd.pbVersion = (BYTE *)CreateVersionStringPlugin((PLUGININFO*) &pluginInfo, szCurrentVersion); + upd.pbVersion = (BYTE *)CreateVersionStringPluginEx(&pluginInfo, szCurrentVersion); upd.cpbVersion = strlen((char *)upd.pbVersion); CallService(MS_UPDATE_REGISTER, 0, (LPARAM)&upd); @@ -253,6 +254,10 @@ int PreShutdown(WPARAM wParam, LPARAM lParam) if (hHooks[i] != NULL) UnhookEvent(hHooks[i]); + for(int i = 0; i < MAX_REGS(hServices); i++) + if (hServices[i] != NULL) + DestroyServiceFunction(hServices[i]); + while(handlers.getCount() > 0) { mir_free(handlers[0]->templates); @@ -341,7 +346,7 @@ void RegisterDefaultEventType(char *name, char *description, WORD eventType, int SKINICONDESC sid = {0}; sid.cbSize = sizeof(SKINICONDESC); sid.flags = SIDF_SORTED; - sid.pszSection = Translate("History/Events"); + sid.pszSection = LPGEN("History/Events"); sid.pszDescription = heh->description; sid.pszName = heh->defaultIconName; CallService(MS_SKIN2_ADDICON, 0, (LPARAM) &sid); @@ -351,7 +356,7 @@ void RegisterDefaultEventType(char *name, char *description, WORD eventType, int } -int ServiceRegister(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceRegister(WPARAM wParam, LPARAM lParam) { HISTORY_EVENT_HANDLER *orig = (HISTORY_EVENT_HANDLER *) wParam; if (orig == NULL @@ -391,7 +396,7 @@ int ServiceRegister(WPARAM wParam, LPARAM lParam) SKINICONDESC sid = {0}; sid.cbSize = sizeof(SKINICONDESC); sid.flags = SIDF_SORTED; - sid.pszSection = Translate("History/Events"); + sid.pszSection = LPGEN("History/Events"); sid.pszDescription = heh->description; sid.pszName = heh->defaultIconName; sid.hDefaultIcon = orig->defaultIcon; @@ -417,14 +422,14 @@ int ServiceRegister(WPARAM wParam, LPARAM lParam) } -int ServiceCanHandle(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceCanHandle(WPARAM wParam, LPARAM lParam) { HISTORY_EVENT_HANDLER *heh = GetHandler(wParam); return heh != NULL; } -int ServiceGetIcon(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceGetIcon(WPARAM wParam, LPARAM lParam) { // Get handler HISTORY_EVENT_HANDLER *heh = GetHandler(wParam); @@ -436,7 +441,7 @@ int ServiceGetIcon(WPARAM wParam, LPARAM lParam) } -int ServiceGetFlags(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceGetFlags(WPARAM wParam, LPARAM lParam) { // Get handler HISTORY_EVENT_HANDLER *heh = GetHandler(wParam); @@ -448,7 +453,7 @@ int ServiceGetFlags(WPARAM wParam, LPARAM lParam) } -int ServiceGetText(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceGetText(WPARAM wParam, LPARAM lParam) { HISTORY_EVENT_PARAM *hep = (HISTORY_EVENT_PARAM *) wParam; if (hep == NULL @@ -550,7 +555,7 @@ int ServiceGetText(WPARAM wParam, LPARAM lParam) } -int ServiceReleaseText(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceReleaseText(WPARAM wParam, LPARAM lParam) { mir_free((void *) wParam); return 0; @@ -594,7 +599,7 @@ HANDLE GetMetaContact(HANDLE hContact) } -int ServiceAddToHistory(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceAddToHistory(WPARAM wParam, LPARAM lParam) { HISTORY_EVENT_ADD * heaIn = (HISTORY_EVENT_ADD *) wParam; if (heaIn == NULL || (heaIn->cbSize < sizeof(HISTORY_EVENT_ADD) && heaIn->cbSize != SIZEOF_HISTORY_EVENT_ADD_V1) || heaIn->templateNum < 0) @@ -659,7 +664,7 @@ int ServiceAddToHistory(WPARAM wParam, LPARAM lParam) return (int) ret; } -int ServiceIsEnabledTemplate(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceIsEnabledTemplate(WPARAM wParam, LPARAM lParam) { WORD eventType = wParam; int templateNum = lParam; @@ -1228,13 +1233,13 @@ int DbEventAdded(WPARAM wParam, LPARAM lParam) } -int ServiceGetCount(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceGetCount(WPARAM wParam, LPARAM lParam) { return handlers.getCount(); } -int ServiceGetEvent(WPARAM wParam, LPARAM lParam) +INT_PTR ServiceGetEvent(WPARAM wParam, LPARAM lParam) { int pos = (int) wParam; if (pos >= 0) diff --git a/Plugins/historyevents/historyevents.sln b/Plugins/historyevents/historyevents.sln deleted file mode 100644 index 8cf097f..0000000 --- a/Plugins/historyevents/historyevents.sln +++ /dev/null @@ -1,26 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual Studio 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "historyevents", "historyevents.vcproj", "{20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Win32 = Debug|Win32 - Release|Win32 = Release|Win32 - Unicode Debug|Win32 = Unicode Debug|Win32 - Unicode Release|Win32 = Unicode Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Debug|Win32.ActiveCfg = Debug|Win32 - {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Debug|Win32.Build.0 = Debug|Win32 - {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Release|Win32.ActiveCfg = Release|Win32 - {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Release|Win32.Build.0 = Release|Win32 - {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 - {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 - {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 - {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/Plugins/historyevents/historyevents.vcxproj b/Plugins/historyevents/historyevents.vcxproj new file mode 100644 index 0000000..4c6a8b9 --- /dev/null +++ b/Plugins/historyevents/historyevents.vcxproj @@ -0,0 +1,541 @@ + + + + + Debug + Win32 + + + Debug + x64 + + + Release + Win32 + + + Release + x64 + + + Unicode Debug + Win32 + + + Unicode Debug + x64 + + + Unicode Release + Win32 + + + Unicode Release + x64 + + + + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C} + historyevents + + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + Unicode + + + DynamicLibrary + false + MultiByte + + + DynamicLibrary + false + MultiByte + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_ProjectFileVersion>10.0.40219.1 + false + false + false + false + true + true + true + true + aa_historyevents + aa_historyevents + aa_historyevents + aa_historyevents + aa_historyevents + aa_historyevents + aa_historyevents + aa_historyevents + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Release/historyevents.tlb + + + + + MaxSpeed + Default + ../../include;sdk;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + true + MultiThreaded + true + .\Release/historyevents.pch + .\Release/ + .\Release/ + .\Release/ + true + .\Release/ + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0417 + + + /ALIGN:4096 /filealign:0x200 /ignore:4108 %(AdditionalOptions) + true + .\Release/aa_historyevents.pdb + true + .\Release/aa_historyevents.map + 0x3EC20000 + MachineX86 + + + true + .\Release/historyevents.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Release/historyevents.tlb + + + + + MaxSpeed + Default + ../../include;sdk;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + true + MultiThreaded + true + .\Release/historyevents.pch + .\Release/ + .\Release/ + .\Release/ + true + .\Release/ + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0417 + + + /ALIGN:4096 /filealign:0x200 /ignore:4108 %(AdditionalOptions) + true + .\Release/aa_historyevents.pdb + true + .\Release/aa_historyevents.map + 0x3EC20000 + + + true + .\Release/historyevents.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Unicode_Release/historyevents.tlb + + + + + MaxSpeed + Default + ../../include;sdk;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;UNICODE;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + true + MultiThreaded + true + .\Unicode_Release/historyevents.pch + .\Unicode_Release/ + .\Unicode_Release/ + .\Unicode_Release/ + true + .\Unicode_Release/ + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0417 + + + /ALIGN:4096 /filealign:0x200 /ignore:4108 %(AdditionalOptions) + true + .\Unicode_Release/aa_historyeventsW.pdb + true + .\Unicode_Release/aa_historyeventsW.map + 0x3EC20000 + MachineX86 + + + true + .\Unicode_Release/historyevents.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Unicode_Release/historyevents.tlb + + + + + MaxSpeed + Default + ../../include;sdk;%(AdditionalIncludeDirectories) + WIN32;NDEBUG;_WINDOWS;UNICODE;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + true + MultiThreaded + true + .\Unicode_Release/historyevents.pch + .\Unicode_Release/ + .\Unicode_Release/ + .\Unicode_Release/ + true + .\Unicode_Release/ + Level3 + true + + + NDEBUG;%(PreprocessorDefinitions) + 0x0417 + + + /ALIGN:4096 /filealign:0x200 /ignore:4108 %(AdditionalOptions) + true + .\Unicode_Release/aa_historyeventsW.pdb + true + .\Unicode_Release/aa_historyeventsW.map + 0x3EC20000 + + + true + .\Unicode_Release/historyevents.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Debug/historyevents.tlb + + + + + Disabled + ../../include;sdk;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + .\Debug/historyevents.pch + .\Debug/ + .\Debug/ + .\Debug/ + true + Level3 + true + EditAndContinue + + + NDEBUG;%(PreprocessorDefinitions) + 0x0417 + + + /ALIGN:4096 /filealign:0x200 /ignore:4108 %(AdditionalOptions) + true + true + .\Debug/aa_historyevents.pdb + 0x3EC20000 + MachineX86 + + + true + .\Debug/historyevents.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Debug/historyevents.tlb + + + + + Disabled + ../../include;sdk;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + .\Debug/historyevents.pch + .\Debug/ + .\Debug/ + .\Debug/ + true + Level3 + true + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0417 + + + /ALIGN:4096 /filealign:0x200 /ignore:4108 %(AdditionalOptions) + true + true + .\Debug/aa_historyevents.pdb + 0x3EC20000 + + + true + .\Debug/historyevents.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + Win32 + .\Unicode_Debug/historyevents.tlb + + + + + Disabled + ../../include;sdk;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;UNICODE;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + .\Unicode_Debug/historyevents.pch + .\Unicode_Debug/ + .\Unicode_Debug/ + .\Unicode_Debug/ + true + Level3 + true + EditAndContinue + + + NDEBUG;%(PreprocessorDefinitions) + 0x0417 + + + /ALIGN:4096 /filealign:0x200 /ignore:4108 %(AdditionalOptions) + true + true + .\Unicode_Debug/aa_historyeventsW.pdb + 0x3EC20000 + MachineX86 + + + true + .\Unicode_Debug/historyevents.bsc + + + + + NDEBUG;%(PreprocessorDefinitions) + true + true + .\Unicode_Debug/historyevents.tlb + + + + + Disabled + ../../include;sdk;%(AdditionalIncludeDirectories) + WIN32;_DEBUG;_WINDOWS;UNICODE;_USRDLL;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) + MultiThreadedDebug + .\Unicode_Debug/historyevents.pch + .\Unicode_Debug/ + .\Unicode_Debug/ + .\Unicode_Debug/ + true + Level3 + true + ProgramDatabase + + + NDEBUG;%(PreprocessorDefinitions) + 0x0417 + + + /ALIGN:4096 /filealign:0x200 /ignore:4108 %(AdditionalOptions) + true + true + .\Unicode_Debug/aa_historyeventsW.pdb + 0x3EC20000 + + + true + .\Unicode_Debug/historyevents.bsc + + + + + + + + + + + + + + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + %(AdditionalIncludeDirectories) + %(AdditionalIncludeDirectories) + %(PreprocessorDefinitions) + %(PreprocessorDefinitions) + + + + + + + + + + + \ No newline at end of file diff --git a/Plugins/historyevents/historyevents.vcxproj.filters b/Plugins/historyevents/historyevents.vcxproj.filters new file mode 100644 index 0000000..aa48967 --- /dev/null +++ b/Plugins/historyevents/historyevents.vcxproj.filters @@ -0,0 +1,70 @@ + + + + + {307dc0f0-f414-4177-a210-84371221f00d} + h;hpp;hxx;hm;inl + + + {5831fdd2-ee0b-418b-80fc-d9daa85c835b} + ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe + + + {0d9fae21-d0c9-4f54-9925-259833dd7ee3} + cpp;c;cxx;rc;def;r;odl;idl;hpj;bat + + + {074a15a4-3af5-45a0-8130-43cace77b6a2} + + + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + Header Files + + + + + Resource Files + + + + + Source Files + + + Source Files + + + Source Files + + + + + Docs + + + Docs + + + Docs + + + \ No newline at end of file diff --git a/Plugins/historyevents/historyevents_10.sln b/Plugins/historyevents/historyevents_10.sln new file mode 100644 index 0000000..59cdca2 --- /dev/null +++ b/Plugins/historyevents/historyevents_10.sln @@ -0,0 +1,38 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "historyevents", "historyevents.vcxproj", "{20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Win32 = Debug|Win32 + Debug|x64 = Debug|x64 + Release|Win32 = Release|Win32 + Release|x64 = Release|x64 + Unicode Debug|Win32 = Unicode Debug|Win32 + Unicode Debug|x64 = Unicode Debug|x64 + Unicode Release|Win32 = Unicode Release|Win32 + Unicode Release|x64 = Unicode Release|x64 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Debug|Win32.ActiveCfg = Debug|Win32 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Debug|Win32.Build.0 = Debug|Win32 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Debug|x64.ActiveCfg = Debug|x64 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Debug|x64.Build.0 = Debug|x64 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Release|Win32.ActiveCfg = Release|Win32 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Release|Win32.Build.0 = Release|Win32 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Release|x64.ActiveCfg = Release|x64 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Release|x64.Build.0 = Release|x64 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Debug|Win32.ActiveCfg = Unicode Debug|Win32 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Debug|Win32.Build.0 = Unicode Debug|Win32 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Debug|x64.ActiveCfg = Unicode Debug|x64 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Debug|x64.Build.0 = Unicode Debug|x64 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Release|Win32.ActiveCfg = Unicode Release|Win32 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Release|Win32.Build.0 = Unicode Release|Win32 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Release|x64.ActiveCfg = Unicode Release|x64 + {20DC63C3-E2DE-4E0E-8DBB-133F32CFDE1C}.Unicode Release|x64.Build.0 = Unicode Release|x64 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Plugins/historyevents/options.cpp b/Plugins/historyevents/options.cpp index fb2bf53..03aeecd 100644 --- a/Plugins/historyevents/options.cpp +++ b/Plugins/historyevents/options.cpp @@ -1,5 +1,5 @@ /* -Copyright (C) 2006 Ricardo Pescuma Domenecci +Copyright (C) 2006-2012 Ricardo Pescuma Domenecci This is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public @@ -26,7 +26,7 @@ Boston, MA 02111-1307, USA. HANDLE hOptHook = NULL; -static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); +static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); void GetTemplare(Buffer *buffer, HISTORY_EVENT_HANDLER *heh, int templates); @@ -120,8 +120,8 @@ int InitOptionsCallback(WPARAM wParam,LPARAM lParam) OPTIONSDIALOGPAGE odp = {0}; odp.cbSize = sizeof(odp); odp.hInstance = hInst; - odp.ptszGroup = TranslateT("History"); - odp.ptszTitle = TranslateT("Events"); + odp.ptszGroup = LPGENT("History"); + odp.ptszTitle = LPGENT("Events"); odp.pfnDlgProc = OptionsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; @@ -151,14 +151,11 @@ void DeInitOptions() BOOL ScreenToClient(HWND hWnd, LPRECT lpRect) { - BOOL ret; - POINT pt; - pt.x = lpRect->left; pt.y = lpRect->top; - ret = ScreenToClient(hWnd, &pt); + BOOL ret = ScreenToClient(hWnd, &pt); if (!ret) return ret; @@ -188,7 +185,7 @@ static void GetTextMetric(HFONT hFont, TEXTMETRIC *tm) } -static BOOL CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { static int avaiable = 0; static int total = 0; diff --git a/Plugins/historyevents/sdk/m_metacontacts.h b/Plugins/historyevents/sdk/m_metacontacts.h index 1da12b9..9f348bd 100644 --- a/Plugins/historyevents/sdk/m_metacontacts.h +++ b/Plugins/historyevents/sdk/m_metacontacts.h @@ -23,6 +23,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_METACONTACTS_H__ #define M_METACONTACTS_H__ 1 +#ifndef MIID_METACONTACTS +#define MIID_METACONTACTS {0xc0325019, 0xc1a7, 0x40f5, { 0x83, 0x65, 0x4f, 0x46, 0xbe, 0x21, 0x86, 0x3e}} +#endif + //get the handle for a contact's parent metacontact //wParam=(HANDLE)hSubContact //lParam=0 diff --git a/Plugins/historyevents/sdk/m_updater.h b/Plugins/historyevents/sdk/m_updater.h index 371b743..488d372 100644 --- a/Plugins/historyevents/sdk/m_updater.h +++ b/Plugins/historyevents/sdk/m_updater.h @@ -63,6 +63,10 @@ __inline static char *CreateVersionStringPlugin(PLUGININFO *pluginInfo, char *bu return CreateVersionString(pluginInfo->version, buf); } +__inline static char *CreateVersionStringPluginEx(PLUGININFOEX *pluginInfo, char *buf) { + return CreateVersionString(pluginInfo->version, buf); +} + // register the 'easy' way - use this method if you have no beta URL and the plugin is on the miranda file listing // NOTE: the plugin version string on the file listing must be the string version of the version in pluginInfo (i.e. 0.0.0.1, diff --git a/Plugins/historyevents/sdk/m_variables.h b/Plugins/historyevents/sdk/m_variables.h index 3f13c96..1264643 100644 --- a/Plugins/historyevents/sdk/m_variables.h +++ b/Plugins/historyevents/sdk/m_variables.h @@ -28,6 +28,10 @@ #include #endif +#ifndef SIZEOF +#include +#endif + // -------------------------------------------------------------------------- // Memory management // -------------------------------------------------------------------------- @@ -578,41 +582,38 @@ __inline static int variables_skin_helpbutton(HWND hwndDlg, UINT uIDButton) { hIcon = NULL; res = 0; - if (ServiceExists(MS_VARS_GETSKINITEM)) { + if (ServiceExists(MS_VARS_GETSKINITEM)) hIcon = (HICON)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPICON); - } - GetClassName(GetDlgItem(hwndDlg, uIDButton), tszClass, sizeof(tszClass)); + + GetClassName(GetDlgItem(hwndDlg, uIDButton), tszClass, SIZEOF(tszClass)); if (!_tcscmp(tszClass, _T("Button"))) { if (hIcon != NULL) { - SetWindowLong(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLong(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)|BS_ICON); + SetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)|BS_ICON); SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon); } else { - SetWindowLong(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLong(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)&~BS_ICON); + SetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, uIDButton), GWL_STYLE)&~BS_ICON); SetDlgItemText(hwndDlg, uIDButton, _T("V")); } } else if (!_tcscmp(tszClass, MIRANDABUTTONCLASS)) { if (hIcon != NULL) { - char *szTipInfo; + char *szTipInfo = NULL; SendMessage(GetDlgItem(hwndDlg, uIDButton), BM_SETIMAGE, (WPARAM)IMAGE_ICON, (LPARAM)hIcon); - if (ServiceExists(MS_VARS_GETSKINITEM)) { + if (ServiceExists(MS_VARS_GETSKINITEM)) szTipInfo = (char *)CallService(MS_VARS_GETSKINITEM, 0, (LPARAM)VSI_HELPTIPTEXT); - } - if (szTipInfo == NULL) { + + if (szTipInfo == NULL) szTipInfo = Translate("Open String Formatting Help"); - } + SendMessage(GetDlgItem(hwndDlg, uIDButton), BUTTONADDTOOLTIP, (WPARAM)szTipInfo, 0); SendDlgItemMessage(hwndDlg, uIDButton, BUTTONSETASFLATBTN, 0, 0); } - else { - SetDlgItemText(hwndDlg, uIDButton, _T("V")); - } - } - else { - res = -1; + else SetDlgItemText(hwndDlg, uIDButton, _T("V")); } + else res = -1; + ShowWindow(GetDlgItem(hwndDlg, uIDButton), ServiceExists(MS_VARS_FORMATSTRING)); return res; -- cgit v1.2.3