From 102a413497df49bd2af8ee0a1770718fa0ecfcc2 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Sun, 10 Mar 2013 12:42:08 +0000 Subject: added precompiled header added version info git-svn-id: http://svn.miranda-ng.org/main/trunk@3956 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TooltipNotify/res/main.rc | 22 +++--------- plugins/TooltipNotify/res/version.rc | 37 ++++++-------------- plugins/TooltipNotify/src/DbHelpers.cpp | 1 - plugins/TooltipNotify/src/DbHelpers.h | 2 -- plugins/TooltipNotify/src/Settings.h | 2 -- plugins/TooltipNotify/src/Tooltip.cpp | 3 -- plugins/TooltipNotify/src/Tooltip.h | 2 -- plugins/TooltipNotify/src/TooltipNotify.cpp | 20 ++++------- plugins/TooltipNotify/src/TooltipNotify.h | 2 -- plugins/TooltipNotify/src/Utils.cpp | 1 - plugins/TooltipNotify/src/Utils.h | 2 -- plugins/TooltipNotify/src/main.cpp | 42 +++++------------------ plugins/TooltipNotify/src/stdafx.h | 18 +++++----- plugins/TooltipNotify/src/version.h | 21 +++++++----- plugins/TooltipNotify/ttnotify_10.vcxproj | 17 ++++++--- plugins/TooltipNotify/ttnotify_10.vcxproj.filters | 3 ++ plugins/TooltipNotify/ttnotify_11.vcxproj | 17 ++++++--- plugins/TooltipNotify/ttnotify_11.vcxproj.filters | 3 ++ 18 files changed, 80 insertions(+), 135 deletions(-) diff --git a/plugins/TooltipNotify/res/main.rc b/plugins/TooltipNotify/res/main.rc index 74f0c4221b..ee7687fbeb 100644 --- a/plugins/TooltipNotify/res/main.rc +++ b/plugins/TooltipNotify/res/main.rc @@ -8,7 +8,7 @@ // Generated from the TEXTINCLUDE 2 resource. // #define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" +#include "winres.h" #undef APSTUDIO_HIDDEN_SYMBOLS ///////////////////////////////////////////////////////////////////////////// @@ -36,31 +36,17 @@ END 2 TEXTINCLUDE BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" + "#include ""winres.h""\r\n" "\0" END 3 TEXTINCLUDE BEGIN - "#include ""version.rc2""\0" + "\0" END #endif // APSTUDIO_INVOKED -#endif // Russian 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 ///////////////////////////////////////////////////////////////////////////// // @@ -188,7 +174,7 @@ BEGIN END #endif // APSTUDIO_INVOKED -#endif // English (U.S.) resources +#endif // Russian resources ///////////////////////////////////////////////////////////////////////////// diff --git a/plugins/TooltipNotify/res/version.rc b/plugins/TooltipNotify/res/version.rc index 6ee2caea43..5bfbab4754 100644 --- a/plugins/TooltipNotify/res/version.rc +++ b/plugins/TooltipNotify/res/version.rc @@ -1,23 +1,15 @@ +// Microsoft Visual C++ generated resource script. // -// version.rc2 - resources Microsoft Visual C++ does not edit directly -// - #ifdef APSTUDIO_INVOKED #error this file is not editable by Microsoft Visual C++ #endif //APSTUDIO_INVOKED - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - #include "afxres.h" #include "..\src\version.h" VS_VERSION_INFO VERSIONINFO - FILEVERSION MAJOR,MINOR,BUILD,REVISION - PRODUCTVERSION MAJOR,MINOR,BUILD,REVISION + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING FILEFLAGSMASK 0x17L #ifdef _DEBUG FILEFLAGS 0x1L @@ -25,29 +17,22 @@ VS_VERSION_INFO VERSIONINFO FILEFLAGS 0x0L #endif FILEOS 0x4L - FILETYPE 0x2L + FILETYPE 0x0L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN - BLOCK "040904b0" + BLOCK "000004b0" BEGIN - VALUE "Comments", "Shows a small tooltip above system tray area when a contact status is changed." - VALUE "CompanyName", "Gneedah software" - VALUE "FileDescription", "Tooltip Notify plugin for Miranda NG." - VALUE "FileVersion", "*,*,*,*" - VALUE "InternalName", "ttnotify.dll" - VALUE "LegalCopyright", "© 2004-2008 Gneedah software" - VALUE "OriginalFilename", "ttnotify.dll" - VALUE "ProductName", "Tooltip Notify" - VALUE "ProductVersion", "*,*,*,*" + VALUE "FileDescription", __DESCRIPTION + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME END END BLOCK "VarFileInfo" BEGIN - VALUE "Translation", 0x409, 1200 + VALUE "Translation", 0x0, 1200 END END - - -///////////////////////////////////////////////////////////////////////////// diff --git a/plugins/TooltipNotify/src/DbHelpers.cpp b/plugins/TooltipNotify/src/DbHelpers.cpp index 930206486d..4a4fad9c1f 100644 --- a/plugins/TooltipNotify/src/DbHelpers.cpp +++ b/plugins/TooltipNotify/src/DbHelpers.cpp @@ -3,7 +3,6 @@ ////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "DbHelpers.h" typedef std::vector SettingsList; diff --git a/plugins/TooltipNotify/src/DbHelpers.h b/plugins/TooltipNotify/src/DbHelpers.h index aea3c9a9b2..374df04c05 100644 --- a/plugins/TooltipNotify/src/DbHelpers.h +++ b/plugins/TooltipNotify/src/DbHelpers.h @@ -2,8 +2,6 @@ // ////////////////////////////////////////////////////////////////////// -#pragma once - bool ModuleSettingsExists(HANDLE hContact, const char* pszModuleName); void DeleteModuleSettings(HANDLE hContact, const char* pszModuleName); void RenameModule(HANDLE hContact, const char* pszOldName, const char* pszNewName); diff --git a/plugins/TooltipNotify/src/Settings.h b/plugins/TooltipNotify/src/Settings.h index ce705ef514..e248c8e245 100644 --- a/plugins/TooltipNotify/src/Settings.h +++ b/plugins/TooltipNotify/src/Settings.h @@ -2,8 +2,6 @@ // Settings.h // -#pragma once - // Settings related #define DEF_LOGPIXELSY 96 #define PROTO_TT_ON_INT_BIT 0x01 diff --git a/plugins/TooltipNotify/src/Tooltip.cpp b/plugins/TooltipNotify/src/Tooltip.cpp index 42022fa692..e9804ea8b9 100644 --- a/plugins/TooltipNotify/src/Tooltip.cpp +++ b/plugins/TooltipNotify/src/Tooltip.cpp @@ -3,9 +3,6 @@ ////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "Tooltip.h" -#include "Settings.h" -#include "TooltipNotify.h" /*static*/ const TCHAR *CTooltip::s_szTooltipClass = _T("MimTooltipNotify"); diff --git a/plugins/TooltipNotify/src/Tooltip.h b/plugins/TooltipNotify/src/Tooltip.h index fc97348370..ed79eefcd0 100644 --- a/plugins/TooltipNotify/src/Tooltip.h +++ b/plugins/TooltipNotify/src/Tooltip.h @@ -2,8 +2,6 @@ // ////////////////////////////////////////////////////////////////////// -#pragma once - class CTooltipNotify; class CTooltip diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 7e4a09b11d..c24034ad00 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -3,12 +3,6 @@ ////////////////////////////////////////////////////////////////////// #include "stdafx.h" -#include "resource.h" -#include "TooltipNotify.h" -#include "Tooltip.h" -#include "Settings.h" -#include "DbHelpers.h" -#include "Utils.h" #define ReadSettingByte(c, d) DBGetContactSettingByte(NULL, s_szModuleName, c, d) #define ReadSettingWord(c, d) DBGetContactSettingWord(NULL, s_szModuleName, c, d) @@ -111,7 +105,7 @@ void CTooltipNotify::RegisterFonts() colorId.defcolour = DEF_SETTING_BGCOLOR; colorId.order = 0; - for (int i=0; iszModuleName, - (int)strlen(ppProtos[i]->szModuleName), wszProto, ARRAY_SIZE(wszProto)); + (int)strlen(ppProtos[i]->szModuleName), wszProto, SIZEOF(wszProto)); wszProto[lLen] = L'\0'; lvi.pszText = wszProto; @@ -750,7 +744,7 @@ BOOL CTooltipNotify::ProtosDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lP { TCHAR szProto[64]; - ListView_GetItemText(GetDlgItem(hDlg,IDC_PROTOS), i, 0, szProto, ARRAY_SIZE(szProto)); + ListView_GetItemText(GetDlgItem(hDlg,IDC_PROTOS), i, 0, szProto, SIZEOF(szProto)); char szMultiByteProto[128]; long lLen = WideCharToMultiByte(CP_ACP, 0, szProto, lstrlen(szProto), @@ -979,7 +973,7 @@ TCHAR *CTooltipNotify::StatusToString(int iStatus, TCHAR *szStatus, int iBufSize TCHAR *CTooltipNotify::MakeTooltipString(HANDLE hContact, int iStatus, TCHAR *szString, int iBufSize) { TCHAR szStatus[32]; - StatusToString(iStatus, szStatus, ARRAY_SIZE(szStatus)); + StatusToString(iStatus, szStatus, SIZEOF(szStatus)); // "proro: user is online" const TCHAR *szFormatString = m_sOptions.bPrefixProto ? _T("%s%s%s") : _T("%.0s%.0s%s"); @@ -994,7 +988,7 @@ TCHAR *CTooltipNotify::MakeTooltipString(HANDLE hContact, int iStatus, TCHAR *sz WCHAR wszProto[32]; - long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, (int)strlen(szProto), wszProto, ARRAY_SIZE(wszProto)); + long lLen = MultiByteToWideChar(CP_ACP, 0, szProto, (int)strlen(szProto), wszProto, SIZEOF(wszProto)); wszProto[lLen] = _T('\0'); _sntprintf(szString, iBufSize-1, szFormatString, wszProto, _T(": "), szContactName); diff --git a/plugins/TooltipNotify/src/TooltipNotify.h b/plugins/TooltipNotify/src/TooltipNotify.h index 00ed0bb932..9e31c5e383 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.h +++ b/plugins/TooltipNotify/src/TooltipNotify.h @@ -2,8 +2,6 @@ // ////////////////////////////////////////////////////////////////////// -#pragma once - class CTooltip; class CTooltipNotify diff --git a/plugins/TooltipNotify/src/Utils.cpp b/plugins/TooltipNotify/src/Utils.cpp index 67b9b670b6..7b777b73db 100644 --- a/plugins/TooltipNotify/src/Utils.cpp +++ b/plugins/TooltipNotify/src/Utils.cpp @@ -3,7 +3,6 @@ // #include "stdafx.h" -#include "Utils.h" BOOL IsNt50() { diff --git a/plugins/TooltipNotify/src/Utils.h b/plugins/TooltipNotify/src/Utils.h index 7264e4c27c..b0baf7c0da 100644 --- a/plugins/TooltipNotify/src/Utils.h +++ b/plugins/TooltipNotify/src/Utils.h @@ -2,7 +2,5 @@ // Utils.h // -#pragma once - BOOL IsNt50(); void TruncateWithDots(TCHAR* szString, size_t iNewLen); \ No newline at end of file diff --git a/plugins/TooltipNotify/src/main.cpp b/plugins/TooltipNotify/src/main.cpp index 8819529e1c..d3112e752e 100644 --- a/plugins/TooltipNotify/src/main.cpp +++ b/plugins/TooltipNotify/src/main.cpp @@ -3,8 +3,6 @@ *////////////////////////////////////////////// #include "stdafx.h" -#include "version.h" -#include "TooltipNotify.h" static int InitializeOptions(WPARAM wParam,LPARAM lParam); static int ModulesLoaded(WPARAM wParam,LPARAM lParam); @@ -18,7 +16,6 @@ static HANDLE g_hModulesLoaded = 0; static HANDLE g_hProtoAck = 0; static HANDLE g_hProtoContactIsTyping = 0; static HINSTANCE g_hInstDLL = 0; -static bool g_bRightModule = false; // i.e. ansi for win9x, and unicode for winnt // Main global object static CTooltipNotify *g_pTooltipNotify = 0; @@ -31,41 +28,20 @@ int hLangpack; BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpvReserved) { - switch(fdwReason) - { - case DLL_PROCESS_ATTACH: - { - DisableThreadLibraryCalls(hInstDLL); - g_hInstDLL = hInstDLL; - - OSVERSIONINFO OsVersionInfo; - OsVersionInfo.dwOSVersionInfoSize = sizeof(OsVersionInfo); - GetVersionEx(&OsVersionInfo); - - - g_bRightModule = (OsVersionInfo.dwPlatformId == VER_PLATFORM_WIN32_NT); - - - break; - } - - case DLL_PROCESS_DETACH: - break; - } - + g_hInstDLL = hInstDLL; return TRUE; } static PLUGININFOEX sPluginInfo = { sizeof(PLUGININFOEX), - "Tooltip Notify", - PLUGIN_MAKE_VERSION(MAJOR,MINOR,BUILD,REVISION), // major, minor, revision, build - "Shows a small tooltip above system tray area when a contact status is changed.", - "perf", - "perf@mail333.com", - "© 2004-2008 Gneedah software", - "http://miranda-ng.org/", + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, UNICODE_AWARE, // {5906A545-F31A-4726-B48F-03A09F060318} {0x5906a545, 0xf31a, 0x4726, {0xb4, 0x8f, 0x3, 0xa0, 0x9f, 0x6, 0x3, 0x18}} @@ -78,8 +54,6 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda extern "C" int __declspec(dllexport) Load(void) { - if (!g_bRightModule) return 0; - mir_getLP(&sPluginInfo); g_pTooltipNotify = new CTooltipNotify(g_hInstDLL); diff --git a/plugins/TooltipNotify/src/stdafx.h b/plugins/TooltipNotify/src/stdafx.h index d00b996556..72c8c13416 100644 --- a/plugins/TooltipNotify/src/stdafx.h +++ b/plugins/TooltipNotify/src/stdafx.h @@ -3,35 +3,33 @@ // are changed infrequently // -#pragma once - #define _CRT_SECURE_NO_WARNINGS #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers #define _WIN32_WINNT 0x0500 -// Windows header files #include #include -#include - -// C/C++ header files #include #include #include -// Miranda IM header files #include #include #include -#include #include #include #include #include #include #include -#include #include #include +#include -#define ARRAY_SIZE(arr) (sizeof(arr)/sizeof(arr[0])) \ No newline at end of file +#include "version.h" +#include "TooltipNotify.h" +#include "DbHelpers.h" +#include "Tooltip.h" +#include "Settings.h" +#include "resource.h" +#include "Utils.h" diff --git a/plugins/TooltipNotify/src/version.h b/plugins/TooltipNotify/src/version.h index 9de12d2cee..6a60505c7c 100644 --- a/plugins/TooltipNotify/src/version.h +++ b/plugins/TooltipNotify/src/version.h @@ -1,11 +1,14 @@ -/*********************************************************************/ -// -// Tooltip Notify version file -// -/*********************************************************************/ +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 6 +#define __RELEASE_NUM 0 +#define __BUILD_NUM 47 +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM -#define MAJOR 0 -#define MINOR 6 -#define BUILD 0 -#define REVISION 47 +#define __PLUGIN_NAME "Tooltip notify" +#define __FILENAME "TooltipNotify.dll" +#define __DESCRIPTION "Shows a small tooltip above system tray area when a contact status is changed." +#define __AUTHOR "perf" +#define __AUTHOREMAIL "perf@mail333.com" +#define __AUTHORWEB "http://miranda-ng.org/" +#define __COPYRIGHT "© 2004-2008 Gneedah software" diff --git a/plugins/TooltipNotify/ttnotify_10.vcxproj b/plugins/TooltipNotify/ttnotify_10.vcxproj index 0d32ffc680..d5563fcc75 100644 --- a/plugins/TooltipNotify/ttnotify_10.vcxproj +++ b/plugins/TooltipNotify/ttnotify_10.vcxproj @@ -72,13 +72,14 @@ Disabled - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + ..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue + Use true @@ -95,11 +96,12 @@ Disabled - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + ..\..\include;%(AdditionalIncludeDirectories) WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 + Use true @@ -118,11 +120,12 @@ Full OnlyExplicitInline Size - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + ..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Fast Level3 true + Use true @@ -144,11 +147,12 @@ Full OnlyExplicitInline Size - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + ..\..\include;%(AdditionalIncludeDirectories) WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Fast Level3 true + Use true @@ -168,7 +172,9 @@ - + + Create + @@ -181,6 +187,7 @@ + diff --git a/plugins/TooltipNotify/ttnotify_10.vcxproj.filters b/plugins/TooltipNotify/ttnotify_10.vcxproj.filters index dbbaafbbf1..4da494c29b 100644 --- a/plugins/TooltipNotify/ttnotify_10.vcxproj.filters +++ b/plugins/TooltipNotify/ttnotify_10.vcxproj.filters @@ -56,6 +56,9 @@ Header Files + + Header Files + diff --git a/plugins/TooltipNotify/ttnotify_11.vcxproj b/plugins/TooltipNotify/ttnotify_11.vcxproj index 860c8c200f..1ef271e82c 100644 --- a/plugins/TooltipNotify/ttnotify_11.vcxproj +++ b/plugins/TooltipNotify/ttnotify_11.vcxproj @@ -76,13 +76,14 @@ Disabled - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + ..\..\include;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL Level3 EditAndContinue + Use true @@ -99,11 +100,12 @@ Disabled - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + ..\..\include;%(AdditionalIncludeDirectories) WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebugDLL Level3 + Use true @@ -122,11 +124,12 @@ Full OnlyExplicitInline Size - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + ..\..\include;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Fast Level3 true + Use true @@ -148,11 +151,12 @@ Full OnlyExplicitInline Size - ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) + ..\..\include;%(AdditionalIncludeDirectories) WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) Fast Level3 true + Use true @@ -172,7 +176,9 @@ - + + Create + @@ -185,6 +191,7 @@ + diff --git a/plugins/TooltipNotify/ttnotify_11.vcxproj.filters b/plugins/TooltipNotify/ttnotify_11.vcxproj.filters index dbbaafbbf1..4da494c29b 100644 --- a/plugins/TooltipNotify/ttnotify_11.vcxproj.filters +++ b/plugins/TooltipNotify/ttnotify_11.vcxproj.filters @@ -56,6 +56,9 @@ Header Files + + Header Files + -- cgit v1.2.3