From f70609f71f4e104597b1edf4db9baebec0719f03 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 4 Jul 2012 15:53:43 +0000 Subject: AuthState: changed folder structure git-svn-id: http://svn.miranda-ng.org/main/trunk@760 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/AuthState/authstate-translation.txt | 18 -- plugins/AuthState/authstate.rc | 132 --------- plugins/AuthState/authstate_10.vcxproj | 26 +- plugins/AuthState/authstate_10.vcxproj.filters | 22 +- plugins/AuthState/authstate_10.vcxproj.user | 3 + plugins/AuthState/commonheaders.h | 67 ----- plugins/AuthState/docs/authstate-translation.txt | 18 ++ plugins/AuthState/icons/auth.ico | Bin 2038 -> 0 bytes plugins/AuthState/icons/authgrant.ico | Bin 2038 -> 0 bytes plugins/AuthState/icons/grant.ico | Bin 2038 -> 0 bytes plugins/AuthState/main.cpp | 362 ----------------------- plugins/AuthState/options.cpp | 151 ---------- plugins/AuthState/res/auth.ico | Bin 0 -> 2038 bytes plugins/AuthState/res/authgrant.ico | Bin 0 -> 2038 bytes plugins/AuthState/res/authstate.rc | 132 +++++++++ plugins/AuthState/res/grant.ico | Bin 0 -> 2038 bytes plugins/AuthState/res/version.rc | 40 +++ plugins/AuthState/resource.h | 25 -- plugins/AuthState/src/commonheaders.h | 67 +++++ plugins/AuthState/src/main.cpp | 362 +++++++++++++++++++++++ plugins/AuthState/src/options.cpp | 151 ++++++++++ plugins/AuthState/src/resource.h | 25 ++ plugins/AuthState/src/version.h | 20 ++ plugins/AuthState/version.h | 20 -- plugins/AuthState/version.rc | 40 --- 25 files changed, 844 insertions(+), 837 deletions(-) delete mode 100644 plugins/AuthState/authstate-translation.txt delete mode 100644 plugins/AuthState/authstate.rc create mode 100644 plugins/AuthState/authstate_10.vcxproj.user delete mode 100644 plugins/AuthState/commonheaders.h create mode 100644 plugins/AuthState/docs/authstate-translation.txt delete mode 100644 plugins/AuthState/icons/auth.ico delete mode 100644 plugins/AuthState/icons/authgrant.ico delete mode 100644 plugins/AuthState/icons/grant.ico delete mode 100644 plugins/AuthState/main.cpp delete mode 100644 plugins/AuthState/options.cpp create mode 100644 plugins/AuthState/res/auth.ico create mode 100644 plugins/AuthState/res/authgrant.ico create mode 100644 plugins/AuthState/res/authstate.rc create mode 100644 plugins/AuthState/res/grant.ico create mode 100644 plugins/AuthState/res/version.rc delete mode 100644 plugins/AuthState/resource.h create mode 100644 plugins/AuthState/src/commonheaders.h create mode 100644 plugins/AuthState/src/main.cpp create mode 100644 plugins/AuthState/src/options.cpp create mode 100644 plugins/AuthState/src/resource.h create mode 100644 plugins/AuthState/src/version.h delete mode 100644 plugins/AuthState/version.h delete mode 100644 plugins/AuthState/version.rc (limited to 'plugins/AuthState') diff --git a/plugins/AuthState/authstate-translation.txt b/plugins/AuthState/authstate-translation.txt deleted file mode 100644 index 86733c7b88..0000000000 --- a/plugins/AuthState/authstate-translation.txt +++ /dev/null @@ -1,18 +0,0 @@ -; Common strings that belong to many files -;[] - -; ../../plugins/AuthState/authstate.rc -;[* Restart of Miranda required] -;[Enable Menu Item (*)] -;[Note: if you still don't see the icons try changing icon slot. Perhaps its used by some other plugin.] -;[Plugin settings] -;[Show Auth icon] -;[Show Grant icon] -;[Show icons only for recently added contacts] -;[Use] -;[slot to draw the icon] - -; ../../plugins/AuthState/options.cpp -;[Auth State] -;[Contact List] -;[Extraicons plugin is used, use Contact list > Extraicons for customize.] diff --git a/plugins/AuthState/authstate.rc b/plugins/AuthState/authstate.rc deleted file mode 100644 index 0bed71895b..0000000000 --- a/plugins/AuthState/authstate.rc +++ /dev/null @@ -1,132 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// Ukrainian resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_UKR) -#ifdef _WIN32 -LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT -#pragma code_page(1251) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_AUTH ICON "icons\\auth.ico" -IDI_GRANT ICON "icons\\grant.ico" -IDI_AUTHGRANT ICON "icons\\authgrant.ico" -#endif // Ukrainian resources -///////////////////////////////////////////////////////////////////////////// - - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_AUTHSTATE_OPT DIALOGEX 0, 0, 314, 240 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - COMBOBOX IDC_ADVICON,95,127,78,81,CBS_DROPDOWNLIST | WS_VSCROLL | - WS_TABSTOP,WS_EX_CLIENTEDGE - CONTROL "Show Auth icon",IDC_AUTHICON,"Button",BS_AUTOCHECKBOX | - BS_LEFTTEXT | WS_TABSTOP,76,93,167,18 - CONTROL "Show Grant icon",IDC_GRANTICON,"Button",BS_AUTOCHECKBOX | - BS_LEFTTEXT | WS_TABSTOP,76,109,167,18 - GROUPBOX "Plugin settings",IDC_STATIC,19,46,276,118 - RTEXT "Use",IDC_STATIC,40,129,49,12 - LTEXT "slot to draw the icon",IDC_STATIC,179,129,86,17 - CONTROL "Enable Menu Item (*)",IDC_ENABLEMENUITEM,"Button", - BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,76,65,167,13 - CONTROL "Show icons only for recently added contacts", - IDC_ICONSFORRECENT,"Button",BS_AUTOCHECKBOX | - BS_LEFTTEXT | WS_TABSTOP,76,78,167,17 - RTEXT "* Restart of Miranda required",IDC_STATIC,58,171,210,11 - LTEXT "Note: if you still don't see the icons try changing icon slot. Perhaps its used by some other plugin.", - IDC_NOTICE,54,143,198,20 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_AUTHSTATE_OPT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 307 - TOPMARGIN, 7 - BOTTOMMARGIN, 233 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/AuthState/authstate_10.vcxproj b/plugins/AuthState/authstate_10.vcxproj index 4147eef3f0..cee8ba568a 100644 --- a/plugins/AuthState/authstate_10.vcxproj +++ b/plugins/AuthState/authstate_10.vcxproj @@ -90,6 +90,7 @@ $(SolutionDir)\lib + _DEBUG;%(PreprocessorDefinitions) ..\..\include\msapi @@ -116,6 +117,7 @@ $(SolutionDir)\lib + NDEBUG;%(PreprocessorDefinitions) ..\..\include\msapi @@ -139,6 +141,7 @@ $(SolutionDir)\lib + _DEBUG;%(PreprocessorDefinitions) ..\..\include\msapi @@ -165,30 +168,31 @@ $(SolutionDir)\lib + NDEBUG;%(PreprocessorDefinitions) ..\..\include\msapi - + Create - + - - - + + + - - - + + + - + - - + + diff --git a/plugins/AuthState/authstate_10.vcxproj.filters b/plugins/AuthState/authstate_10.vcxproj.filters index c045a6a4b2..72395ac048 100644 --- a/plugins/AuthState/authstate_10.vcxproj.filters +++ b/plugins/AuthState/authstate_10.vcxproj.filters @@ -18,46 +18,46 @@ - + Source Files - + Source Files - + Header Files - + Header Files - + Header Files - + Resource Files - + Resource Files - + Resource Files Docs - + Docs - + Resource Files - + Resource Files diff --git a/plugins/AuthState/authstate_10.vcxproj.user b/plugins/AuthState/authstate_10.vcxproj.user new file mode 100644 index 0000000000..695b5c78b9 --- /dev/null +++ b/plugins/AuthState/authstate_10.vcxproj.user @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/plugins/AuthState/commonheaders.h b/plugins/AuthState/commonheaders.h deleted file mode 100644 index beead07b56..0000000000 --- a/plugins/AuthState/commonheaders.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - Authorization State plugin for Miranda-IM (www.miranda-im.org) - (c) 2006-2009 by Thief - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/commonheaders.h $ - Revision : $Rev: 1686 $ - Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ - Last change by : $Author: ghazan $ - -*/ - -#ifndef COMMHEADERS_H -#define COMMHEADERS_H - -#define MIRANDA_VER 0x0A00 - -#include -#include // needed by m_utils.h -#include // needed by m_icolib.h > r9256 -#include - -// Miranda API headers -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include "resource.h" -#include "Version.h" - -// Third party SDK headers -#include "m_updater.h" -#include "m_extraicons.h" - -static const int DefaultSlot = EXTRA_ICON_ADV2; -#define MODULENAME "AuthState" - -extern int onOptInitialise(WPARAM wParam, LPARAM lParam); -extern int onExtraImageApplying(WPARAM wParam, LPARAM lParam); -extern int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam); - -extern HINSTANCE g_hInst; -extern IconExtraColumn g_IECAuth, g_IECGrant, g_IECAuthGrant, g_IECClear; -extern INT clistIcon; -extern byte bUseAuthIcon, bUseGrantIcon, bContactMenuItem, bIconsForRecentContacts; -extern HANDLE hExtraIcon; - -#endif //COMMHEADERS_H diff --git a/plugins/AuthState/docs/authstate-translation.txt b/plugins/AuthState/docs/authstate-translation.txt new file mode 100644 index 0000000000..86733c7b88 --- /dev/null +++ b/plugins/AuthState/docs/authstate-translation.txt @@ -0,0 +1,18 @@ +; Common strings that belong to many files +;[] + +; ../../plugins/AuthState/authstate.rc +;[* Restart of Miranda required] +;[Enable Menu Item (*)] +;[Note: if you still don't see the icons try changing icon slot. Perhaps its used by some other plugin.] +;[Plugin settings] +;[Show Auth icon] +;[Show Grant icon] +;[Show icons only for recently added contacts] +;[Use] +;[slot to draw the icon] + +; ../../plugins/AuthState/options.cpp +;[Auth State] +;[Contact List] +;[Extraicons plugin is used, use Contact list > Extraicons for customize.] diff --git a/plugins/AuthState/icons/auth.ico b/plugins/AuthState/icons/auth.ico deleted file mode 100644 index 01cb6f019f..0000000000 Binary files a/plugins/AuthState/icons/auth.ico and /dev/null differ diff --git a/plugins/AuthState/icons/authgrant.ico b/plugins/AuthState/icons/authgrant.ico deleted file mode 100644 index 3f15a64183..0000000000 Binary files a/plugins/AuthState/icons/authgrant.ico and /dev/null differ diff --git a/plugins/AuthState/icons/grant.ico b/plugins/AuthState/icons/grant.ico deleted file mode 100644 index 89ce6012ed..0000000000 Binary files a/plugins/AuthState/icons/grant.ico and /dev/null differ diff --git a/plugins/AuthState/main.cpp b/plugins/AuthState/main.cpp deleted file mode 100644 index 0f168c0fe1..0000000000 --- a/plugins/AuthState/main.cpp +++ /dev/null @@ -1,362 +0,0 @@ -/* - Authorization State plugin for Miranda-IM (www.miranda-im.org) - (c) 2006-2010 by Thief - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/main.cpp $ - Revision : $Rev: 1686 $ - Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ - Last change by : $Author: ghazan $ - -*/ - -#include "commonheaders.h" - -HINSTANCE g_hInst; -static HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL; -static HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactSettingChanged = NULL, hContactAdded = NULL; -static HANDLE hPrebuildContactMenu = NULL, hAuthMenuSelected = NULL; -static HANDLE hUserMenu = NULL; -HANDLE hExtraIcon = NULL; -int hLangpack; - -IconExtraColumn g_IECAuth = {0}; -IconExtraColumn g_IECGrant = {0}; -IconExtraColumn g_IECAuthGrant = {0}; -IconExtraColumn g_IECClear = {0}; -INT clistIcon = 0; //Icon slot to use -BYTE bUseAuthIcon = 0, bUseGrantIcon = 0, bContactMenuItem = 0, bIconsForRecentContacts = 0, bUseAuthGroup = 0; - -enum { -icon_none, -icon_auth, -icon_grant, -icon_both -}; - -PLUGININFOEX pluginInfo={ - sizeof(PLUGININFOEX), - __PLUGIN_NAME, - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - __DESCRIPTION, - __AUTHOR, - __AUTHOREMAIL, - __COPYRIGHT, - __AUTHORWEB, - UNICODE_AWARE, //doesn't replace anything built-in - {0xdace7d41, 0xdfa9, 0x4772, {0x89, 0xae, 0xa5, 0x9a, 0x61, 0x53, 0xe6, 0xb2}} -/* DACE7D41-DFA9-4772-89AE-A59A6153E6B2 */ -}; - -extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) -{ - g_hInst = hinstDLL; - return TRUE; -} - -/* 236CBB9A-57D2-419D-B5CB-0DF5926E921C */ -#define MIID_AUTHSTATE {0x236cbb9a, 0x57d2, 0x419d, {0xb5, 0xcb, 0x0d, 0xf5, 0x92, 0x6e, 0x92, 0x1c}} - -extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) -{ - static const MUUID interfaces[] = {MIID_AUTHSTATE, MIID_LAST}; - return interfaces; -} - -extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfo; -} - -INT_PTR getIconToUse(HANDLE hContact, LPARAM lParam) -{ - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); -// if (lParam == 1) return icon_none; - if (!DBGetContactSettingByte(hContact,"AuthState","ShowIcons",!bIconsForRecentContacts)) return icon_none; - - if (DBGetContactSettingByte(0,"ICQ","UseServerCList",0)) - if (DBGetContactSettingWord(hContact,proto,"ServerId",1) == 0) - return icon_both; - - if (bUseAuthIcon & bUseGrantIcon) - if (DBGetContactSettingByte(hContact,proto,"Auth",0) && DBGetContactSettingByte(hContact,proto,"Grant",0)) - return icon_both; - - if (bUseAuthIcon) - if (DBGetContactSettingByte(hContact,proto,"Auth",0)) - return icon_auth; - - if (bUseGrantIcon) - if (DBGetContactSettingByte(hContact,proto,"Grant",0)) - return icon_grant; - return icon_none; -} - -int onExtraImageApplying(WPARAM wParam, LPARAM lParam) -{ - if (wParam == NULL) - return 0; - - int usedIcon; - usedIcon = getIconToUse((HANDLE) wParam, lParam); - - if (hExtraIcon != NULL) - { - const char *icon; - switch (usedIcon) - { - case icon_both: icon = "authgrant_icon"; break; - case icon_grant: icon = "grant_icon"; break; - case icon_auth: icon = "auth_icon"; break; - default: icon = NULL; break; - } - ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, icon); - } - else - { - switch (usedIcon) - { - case icon_both: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECAuthGrant); break; - case icon_grant: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECGrant); break; - case icon_auth: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECAuth); break; - default: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECClear); break; - } - } - - return 0; -} - -int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam) -{ - g_IECAuth.cbSize = sizeof(IconExtraColumn); - g_IECAuth.ColumnType = clistIcon; - g_IECGrant.cbSize = sizeof(IconExtraColumn); - g_IECGrant.ColumnType = clistIcon; - g_IECAuthGrant.cbSize = sizeof(IconExtraColumn); - g_IECAuthGrant.ColumnType = clistIcon; - - if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) { - g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"auth_icon"), (LPARAM)0); - g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"grant_icon"), (LPARAM)0); - g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"authgrant_icon"), (LPARAM)0); - } - - return 0; -} - -int onContactSettingChanged(WPARAM wParam,LPARAM lParam) -{ - DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); - if (!proto) return 0; - - if (!lstrcmpA(cws->szModule,proto)) - if (!lstrcmpA(cws->szSetting,"Auth") || !lstrcmpA(cws->szSetting,"Grant") || !lstrcmpA(cws->szSetting,"ServerId")) - onExtraImageApplying(wParam, 1); - - return 0; -} - -int onDBContactAdded(WPARAM wParam, LPARAM lParam) -{ - // A new contact added, mark it as recent - DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", 1); - onExtraImageApplying(wParam, 0); - - return 0; -} - -INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam) -{ - byte enabled = DBGetContactSettingByte((HANDLE)wParam,"AuthState","ShowIcons",1); - DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", !enabled); - - if (enabled) - CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECClear); - else - onExtraImageApplying(wParam, 0); - - return 0; -} - -int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) -{ - char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); - if (!proto) return 0; - - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(CLISTMENUITEM); - - if (!DBGetContactSettingByte((HANDLE)wParam,proto,"Auth",0) && !DBGetContactSettingByte((HANDLE)wParam,proto,"Grant",0) && DBGetContactSettingWord((HANDLE)wParam,proto,"ServerId",0)) - mi.flags = CMIF_TCHAR | CMIM_FLAGS | CMIF_HIDDEN; - else - mi.flags = CMIF_TCHAR | CMIM_FLAGS; - - if (DBGetContactSettingByte((HANDLE)wParam,"AuthState","ShowIcons",1)) - { - mi.flags |= CMIF_TCHAR | CMIM_NAME; - mi.ptszName = _T("Disable AuthState icons"); - } - else - { - mi.flags |= CMIF_TCHAR | CMIM_NAME; - mi.ptszName = _T("Enable AuthState icons"); - } - - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hUserMenu, (LPARAM)&mi); - - return 0; -} - -int onModulesLoaded(WPARAM wParam,LPARAM lParam) -{ - // IcoLib support - SKINICONDESC sid = {0}; - ZeroMemory(&sid, sizeof(sid)); - TCHAR szFile[MAX_PATH]; - sid.cbSize = sizeof(sid); - sid.flags = SIDF_ALL_TCHAR; - - sid.ptszSection = _T("Auth State"); - GetModuleFileName(g_hInst, szFile, MAX_PATH); - sid.ptszDefaultFile = szFile; - - sid.ptszDescription = _T("Auth"); - sid.pszName = "auth_icon"; - sid.iDefaultIndex = -IDI_AUTH; - Skin_AddIcon(&sid); - - sid.ptszDescription = _T("Grant"); - sid.pszName = "grant_icon"; - sid.iDefaultIndex = -IDI_GRANT; - Skin_AddIcon(&sid); - - sid.ptszDescription = _T("Auth & Grant"); - sid.pszName = "authgrant_icon"; - sid.iDefaultIndex = -IDI_AUTHGRANT; - Skin_AddIcon(&sid); - - // extra icons - hExtraIcon = ExtraIcon_Register("authstate", "Auth State", "authgrant_icon"); - if (hExtraIcon != NULL) - { - // Set initial value for all contacts - HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - while (hContact != NULL) - { - onExtraImageApplying((WPARAM)hContact, 1); - hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); - } - } - else { - hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild); - hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild); - hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying); - onExtraImageListRebuild(0,0); - } - hOptInitialise = HookEvent(ME_OPT_INITIALISE, onOptInitialise); - if (bContactMenuItem) hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); - - // Updater support - if (ServiceExists(MS_UPDATE_REGISTER)) { - Update update = {0}; - char szVersion[16]; - - update.cbSize = sizeof(Update); - - update.szComponentName = pluginInfo.shortName; - update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); - update.cpbVersion = lstrlenA((char *)update.pbVersion); - - update.szUpdateURL = UPDATER_AUTOREGISTER; - - // these are the three lines that matter - the archive, the page containing the version string, and the text (or data) - // before the version that we use to locate it on the page - // (note that if the update URL and the version URL point to standard file listing entries, the backend xml - // data will be used to check for updates rather than the actual web page - this is not true for beta urls) - update.szBetaUpdateURL = "http://thief.miranda.im/authstate.zip"; - update.szBetaVersionURL = "http://thief.miranda.im/updater/authstate_version.txt"; - update.szBetaChangelogURL = "http://thief.miranda.im"; - update.pbBetaVersionPrefix = (BYTE *)"AuthState "; - - update.cpbBetaVersionPrefix = lstrlenA((char *)update.pbBetaVersionPrefix); - - CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); - } - - return 0; -} - -int onSystemOKToExit(WPARAM wParam,LPARAM lParam) -{ - UnhookEvent(hHookModulesLoaded); - UnhookEvent(hHookExtraIconsRebuild); - UnhookEvent(hHookExtraIconsApply); - UnhookEvent(hOptInitialise); - UnhookEvent(hSystemOKToExit); - UnhookEvent(hContactSettingChanged); - if (hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged); - if (hContactAdded) UnhookEvent(hContactAdded); - if (hPrebuildContactMenu) - { - UnhookEvent(hPrebuildContactMenu); - UnhookEvent(hUserMenu); - } - DestroyServiceFunction(hAuthMenuSelected); - - return 0; -} - -extern "C" int __declspec(dllexport) Load(void) -{ - mir_getLP(&pluginInfo); - - hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); - hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit); - hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); - - clistIcon = DBGetContactSettingByte(NULL, MODULENAME, "AdvancedIcon", DefaultSlot); - bUseAuthIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", 1); - bUseGrantIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", 1); - bContactMenuItem = DBGetContactSettingByte(NULL, MODULENAME, "MenuItem", 0); - bIconsForRecentContacts = DBGetContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", 0); - - hContactAdded = HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded); - - if (bContactMenuItem) - { - hAuthMenuSelected = CreateServiceFunction("AuthState/MenuItem", onAuthMenuSelected); - - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(CLISTMENUITEM); - mi.position = -1999901005; - mi.flags = CMIF_TCHAR; - mi.ptszName = _T("Enable AuthState icons"); - mi.pszService = "AuthState/MenuItem"; - hUserMenu = Menu_AddContactMenuItem(&mi); - } - - g_IECClear.cbSize = sizeof(IconExtraColumn); - g_IECClear.ColumnType = clistIcon; - g_IECClear.hImage = (HANDLE) -1; - - return 0; -} - -extern "C" int __declspec(dllexport) Unload(void) -{ - return 0; -} diff --git a/plugins/AuthState/options.cpp b/plugins/AuthState/options.cpp deleted file mode 100644 index d2248d9e44..0000000000 --- a/plugins/AuthState/options.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - Authorization State plugin for Miranda-IM (www.miranda-im.org) - (c) 2006-2010 by Thief - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/options.cpp $ - Revision : $Rev: 1686 $ - Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ - Last change by : $Author: ghazan $ - -*/ - -#include "commonheaders.h" - -const TCHAR* szAdvancedIcons[] = {_T("Email"), _T("Protocol"), _T("SMS"), _T("Advanced 1"), _T("Advanced 2"), _T("Web"), _T("Client"), _T("Advanced 3"), _T("Advanced 4"), _T("Advanced 5")}; -const INT cAdvancedIcons = sizeof(szAdvancedIcons) / sizeof(szAdvancedIcons[0]); - -INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static int bInitializing = 0; - switch (msg) - { - case WM_INITDIALOG: - { - TranslateDialogDefault(hwndDlg); - bInitializing = 1; - if (hExtraIcon==NULL) - { - for (int i = 0; i < cAdvancedIcons; i++) - { - SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szAdvancedIcons[i])); - } - SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_SETCURSEL, clistIcon-1, 0); - } - else - { - SendDlgItemMessage(hwndDlg,IDC_NOTICE, WM_SETTEXT,0,(LPARAM)TranslateT("Extraicons plugin is used, use Contact list > Extraicons for customize.")); - ShowWindow(GetDlgItem(hwndDlg, IDC_NOTICE), SW_SHOW); - EnableWindow(GetDlgItem(hwndDlg, IDC_ADVICON), 0); - } - - CheckDlgButton(hwndDlg, IDC_AUTHICON, bUseAuthIcon ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_GRANTICON, bUseGrantIcon ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ENABLEMENUITEM, bContactMenuItem ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ICONSFORRECENT, bIconsForRecentContacts ? BST_CHECKED : BST_UNCHECKED); - - bInitializing = 0; - return TRUE; - } - - case WM_COMMAND: - { - switch (LOWORD(wParam)) - { - case IDC_AUTHICON: - case IDC_GRANTICON: - case IDC_ENABLEMENUITEM: - case IDC_ICONSFORRECENT: - { - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - } - case IDC_ADVICON: - { - if ((HIWORD(wParam) == EN_CHANGE) && (!bInitializing) || (HIWORD(wParam) == CBN_SELENDOK)) - { - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - } - break; - } - } - break; - } - - case WM_NOTIFY: - { - if (((LPNMHDR)lParam)->idFrom == 0) - switch (((LPNMHDR)lParam)->code) - { - case PSN_APPLY: - { - bUseAuthIcon = IsDlgButtonChecked(hwndDlg, IDC_AUTHICON); - bUseGrantIcon = IsDlgButtonChecked(hwndDlg, IDC_GRANTICON); - bContactMenuItem = IsDlgButtonChecked(hwndDlg, IDC_ENABLEMENUITEM); - bIconsForRecentContacts = IsDlgButtonChecked(hwndDlg, IDC_ICONSFORRECENT); - - clistIcon = SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_GETCURSEL, 0, 0); - clistIcon++; - - HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - while (hContact) - { - CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&g_IECClear); - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); - } - - g_IECClear.ColumnType = clistIcon; - onExtraImageListRebuild(0,0); - - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); - while (hContact) - { - onExtraImageApplying((WPARAM)hContact,0); - hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); - } - - //Store options values to DB - DBWriteContactSettingByte(NULL, MODULENAME, "AdvancedIcon", clistIcon); - DBWriteContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", bUseAuthIcon); - DBWriteContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", bUseGrantIcon); - DBWriteContactSettingByte(NULL, MODULENAME, "MenuItem", bContactMenuItem); - DBWriteContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", bIconsForRecentContacts); - } - return TRUE; - } - } - - case WM_DESTROY: - break; - - } - return FALSE; -} - -int onOptInitialise(WPARAM wParam, LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp = { 0 }; - odp.cbSize = sizeof(odp); - odp.hInstance = g_hInst; - odp.pszGroup = LPGEN("Contact List"); - odp.pszTemplate = MAKEINTRESOURCEA(IDD_AUTHSTATE_OPT); - odp.pszTitle = LPGEN("Auth State"); - odp.pfnDlgProc = DlgProcOptions; - odp.flags = ODPF_BOLDGROUPS; - Options_AddPage(wParam, &odp); - - return 0; -} diff --git a/plugins/AuthState/res/auth.ico b/plugins/AuthState/res/auth.ico new file mode 100644 index 0000000000..01cb6f019f Binary files /dev/null and b/plugins/AuthState/res/auth.ico differ diff --git a/plugins/AuthState/res/authgrant.ico b/plugins/AuthState/res/authgrant.ico new file mode 100644 index 0000000000..3f15a64183 Binary files /dev/null and b/plugins/AuthState/res/authgrant.ico differ diff --git a/plugins/AuthState/res/authstate.rc b/plugins/AuthState/res/authstate.rc new file mode 100644 index 0000000000..92e9024d9f --- /dev/null +++ b/plugins/AuthState/res/authstate.rc @@ -0,0 +1,132 @@ +// Microsoft Visual C++ generated resource script. +// +#include "..\src\resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include "afxres.h" + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// Ukrainian resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_UKR) +#ifdef _WIN32 +LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT +#pragma code_page(1251) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Icon +// + +// Icon with lowest ID value placed first to ensure application icon +// remains consistent on all systems. +IDI_AUTH ICON "auth.ico" +IDI_GRANT ICON "grant.ico" +IDI_AUTHGRANT ICON "authgrant.ico" +#endif // Ukrainian resources +///////////////////////////////////////////////////////////////////////////// + + +///////////////////////////////////////////////////////////////////////////// +// English (U.S.) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "..\src\resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include ""afxres.h""\r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_AUTHSTATE_OPT DIALOGEX 0, 0, 314, 240 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + COMBOBOX IDC_ADVICON,95,127,78,81,CBS_DROPDOWNLIST | WS_VSCROLL | + WS_TABSTOP,WS_EX_CLIENTEDGE + CONTROL "Show Auth icon",IDC_AUTHICON,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,76,93,167,18 + CONTROL "Show Grant icon",IDC_GRANTICON,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,76,109,167,18 + GROUPBOX "Plugin settings",IDC_STATIC,19,46,276,118 + RTEXT "Use",IDC_STATIC,40,129,49,12 + LTEXT "slot to draw the icon",IDC_STATIC,179,129,86,17 + CONTROL "Enable Menu Item (*)",IDC_ENABLEMENUITEM,"Button", + BS_AUTOCHECKBOX | BS_LEFTTEXT | WS_TABSTOP,76,65,167,13 + CONTROL "Show icons only for recently added contacts", + IDC_ICONSFORRECENT,"Button",BS_AUTOCHECKBOX | + BS_LEFTTEXT | WS_TABSTOP,76,78,167,17 + RTEXT "* Restart of Miranda required",IDC_STATIC,58,171,210,11 + LTEXT "Note: if you still don't see the icons try changing icon slot. Perhaps its used by some other plugin.", + IDC_NOTICE,54,143,198,20 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_AUTHSTATE_OPT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 307 + TOPMARGIN, 7 + BOTTOMMARGIN, 233 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/plugins/AuthState/res/grant.ico b/plugins/AuthState/res/grant.ico new file mode 100644 index 0000000000..89ce6012ed Binary files /dev/null and b/plugins/AuthState/res/grant.ico differ diff --git a/plugins/AuthState/res/version.rc b/plugins/AuthState/res/version.rc new file mode 100644 index 0000000000..2325cd192f --- /dev/null +++ b/plugins/AuthState/res/version.rc @@ -0,0 +1,40 @@ +// Microsoft Visual C++ generated resource script. +// +#include "afxres.h" +#include "..\src\version.h" + +#ifdef _WIN32 +LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL +#endif //_WIN32 + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x0L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "000004b0" + BEGIN + VALUE "FileDescription", __DESCRIPTION + VALUE "FileVersion", __FILEVERSION_DOTS + VALUE "InternalName", __PLUGIN_NAME + VALUE "LegalCopyright", __COPYRIGHT + VALUE "OriginalFilename", __FILENAME + VALUE "ProductName", __PLUGIN_NAME + VALUE "ProductVersion", __FILEVERSION_DOTS + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x0, 1200 + END +END diff --git a/plugins/AuthState/resource.h b/plugins/AuthState/resource.h deleted file mode 100644 index 49c8f2fb6a..0000000000 --- a/plugins/AuthState/resource.h +++ /dev/null @@ -1,25 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by authstate.rc -// -#define IDI_AUTH 101 -#define IDI_GRANT 102 -#define IDI_AUTHGRANT 103 -#define IDD_AUTHSTATE_OPT 103 -#define IDC_ADVICON 1001 -#define IDC_AUTHICON 1002 -#define IDC_GRANTICON 1003 -#define IDC_ENABLEMENUITEM 1005 -#define IDC_ICONSFORRECENT 1006 -#define IDC_NOTICE 1009 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 104 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1010 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/plugins/AuthState/src/commonheaders.h b/plugins/AuthState/src/commonheaders.h new file mode 100644 index 0000000000..beead07b56 --- /dev/null +++ b/plugins/AuthState/src/commonheaders.h @@ -0,0 +1,67 @@ +/* + Authorization State plugin for Miranda-IM (www.miranda-im.org) + (c) 2006-2009 by Thief + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/commonheaders.h $ + Revision : $Rev: 1686 $ + Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ + Last change by : $Author: ghazan $ + +*/ + +#ifndef COMMHEADERS_H +#define COMMHEADERS_H + +#define MIRANDA_VER 0x0A00 + +#include +#include // needed by m_utils.h +#include // needed by m_icolib.h > r9256 +#include + +// Miranda API headers +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "resource.h" +#include "Version.h" + +// Third party SDK headers +#include "m_updater.h" +#include "m_extraicons.h" + +static const int DefaultSlot = EXTRA_ICON_ADV2; +#define MODULENAME "AuthState" + +extern int onOptInitialise(WPARAM wParam, LPARAM lParam); +extern int onExtraImageApplying(WPARAM wParam, LPARAM lParam); +extern int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam); + +extern HINSTANCE g_hInst; +extern IconExtraColumn g_IECAuth, g_IECGrant, g_IECAuthGrant, g_IECClear; +extern INT clistIcon; +extern byte bUseAuthIcon, bUseGrantIcon, bContactMenuItem, bIconsForRecentContacts; +extern HANDLE hExtraIcon; + +#endif //COMMHEADERS_H diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp new file mode 100644 index 0000000000..0f168c0fe1 --- /dev/null +++ b/plugins/AuthState/src/main.cpp @@ -0,0 +1,362 @@ +/* + Authorization State plugin for Miranda-IM (www.miranda-im.org) + (c) 2006-2010 by Thief + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/main.cpp $ + Revision : $Rev: 1686 $ + Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ + Last change by : $Author: ghazan $ + +*/ + +#include "commonheaders.h" + +HINSTANCE g_hInst; +static HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL; +static HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactSettingChanged = NULL, hContactAdded = NULL; +static HANDLE hPrebuildContactMenu = NULL, hAuthMenuSelected = NULL; +static HANDLE hUserMenu = NULL; +HANDLE hExtraIcon = NULL; +int hLangpack; + +IconExtraColumn g_IECAuth = {0}; +IconExtraColumn g_IECGrant = {0}; +IconExtraColumn g_IECAuthGrant = {0}; +IconExtraColumn g_IECClear = {0}; +INT clistIcon = 0; //Icon slot to use +BYTE bUseAuthIcon = 0, bUseGrantIcon = 0, bContactMenuItem = 0, bIconsForRecentContacts = 0, bUseAuthGroup = 0; + +enum { +icon_none, +icon_auth, +icon_grant, +icon_both +}; + +PLUGININFOEX pluginInfo={ + sizeof(PLUGININFOEX), + __PLUGIN_NAME, + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + __DESCRIPTION, + __AUTHOR, + __AUTHOREMAIL, + __COPYRIGHT, + __AUTHORWEB, + UNICODE_AWARE, //doesn't replace anything built-in + {0xdace7d41, 0xdfa9, 0x4772, {0x89, 0xae, 0xa5, 0x9a, 0x61, 0x53, 0xe6, 0xb2}} +/* DACE7D41-DFA9-4772-89AE-A59A6153E6B2 */ +}; + +extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + g_hInst = hinstDLL; + return TRUE; +} + +/* 236CBB9A-57D2-419D-B5CB-0DF5926E921C */ +#define MIID_AUTHSTATE {0x236cbb9a, 0x57d2, 0x419d, {0xb5, 0xcb, 0x0d, 0xf5, 0x92, 0x6e, 0x92, 0x1c}} + +extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + static const MUUID interfaces[] = {MIID_AUTHSTATE, MIID_LAST}; + return interfaces; +} + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfo; +} + +INT_PTR getIconToUse(HANDLE hContact, LPARAM lParam) +{ + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); +// if (lParam == 1) return icon_none; + if (!DBGetContactSettingByte(hContact,"AuthState","ShowIcons",!bIconsForRecentContacts)) return icon_none; + + if (DBGetContactSettingByte(0,"ICQ","UseServerCList",0)) + if (DBGetContactSettingWord(hContact,proto,"ServerId",1) == 0) + return icon_both; + + if (bUseAuthIcon & bUseGrantIcon) + if (DBGetContactSettingByte(hContact,proto,"Auth",0) && DBGetContactSettingByte(hContact,proto,"Grant",0)) + return icon_both; + + if (bUseAuthIcon) + if (DBGetContactSettingByte(hContact,proto,"Auth",0)) + return icon_auth; + + if (bUseGrantIcon) + if (DBGetContactSettingByte(hContact,proto,"Grant",0)) + return icon_grant; + return icon_none; +} + +int onExtraImageApplying(WPARAM wParam, LPARAM lParam) +{ + if (wParam == NULL) + return 0; + + int usedIcon; + usedIcon = getIconToUse((HANDLE) wParam, lParam); + + if (hExtraIcon != NULL) + { + const char *icon; + switch (usedIcon) + { + case icon_both: icon = "authgrant_icon"; break; + case icon_grant: icon = "grant_icon"; break; + case icon_auth: icon = "auth_icon"; break; + default: icon = NULL; break; + } + ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, icon); + } + else + { + switch (usedIcon) + { + case icon_both: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECAuthGrant); break; + case icon_grant: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECGrant); break; + case icon_auth: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECAuth); break; + default: CallService(MS_CLIST_EXTRA_SET_ICON, wParam, (LPARAM) &g_IECClear); break; + } + } + + return 0; +} + +int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam) +{ + g_IECAuth.cbSize = sizeof(IconExtraColumn); + g_IECAuth.ColumnType = clistIcon; + g_IECGrant.cbSize = sizeof(IconExtraColumn); + g_IECGrant.ColumnType = clistIcon; + g_IECAuthGrant.cbSize = sizeof(IconExtraColumn); + g_IECAuthGrant.ColumnType = clistIcon; + + if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) { + g_IECAuth.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"auth_icon"), (LPARAM)0); + g_IECGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"grant_icon"), (LPARAM)0); + g_IECAuthGrant.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"authgrant_icon"), (LPARAM)0); + } + + return 0; +} + +int onContactSettingChanged(WPARAM wParam,LPARAM lParam) +{ + DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam; + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); + if (!proto) return 0; + + if (!lstrcmpA(cws->szModule,proto)) + if (!lstrcmpA(cws->szSetting,"Auth") || !lstrcmpA(cws->szSetting,"Grant") || !lstrcmpA(cws->szSetting,"ServerId")) + onExtraImageApplying(wParam, 1); + + return 0; +} + +int onDBContactAdded(WPARAM wParam, LPARAM lParam) +{ + // A new contact added, mark it as recent + DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", 1); + onExtraImageApplying(wParam, 0); + + return 0; +} + +INT_PTR onAuthMenuSelected(WPARAM wParam, LPARAM lParam) +{ + byte enabled = DBGetContactSettingByte((HANDLE)wParam,"AuthState","ShowIcons",1); + DBWriteContactSettingByte((HANDLE)wParam, MODULENAME, "ShowIcons", !enabled); + + if (enabled) + CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECClear); + else + onExtraImageApplying(wParam, 0); + + return 0; +} + +int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam) +{ + char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0); + if (!proto) return 0; + + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(CLISTMENUITEM); + + if (!DBGetContactSettingByte((HANDLE)wParam,proto,"Auth",0) && !DBGetContactSettingByte((HANDLE)wParam,proto,"Grant",0) && DBGetContactSettingWord((HANDLE)wParam,proto,"ServerId",0)) + mi.flags = CMIF_TCHAR | CMIM_FLAGS | CMIF_HIDDEN; + else + mi.flags = CMIF_TCHAR | CMIM_FLAGS; + + if (DBGetContactSettingByte((HANDLE)wParam,"AuthState","ShowIcons",1)) + { + mi.flags |= CMIF_TCHAR | CMIM_NAME; + mi.ptszName = _T("Disable AuthState icons"); + } + else + { + mi.flags |= CMIF_TCHAR | CMIM_NAME; + mi.ptszName = _T("Enable AuthState icons"); + } + + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hUserMenu, (LPARAM)&mi); + + return 0; +} + +int onModulesLoaded(WPARAM wParam,LPARAM lParam) +{ + // IcoLib support + SKINICONDESC sid = {0}; + ZeroMemory(&sid, sizeof(sid)); + TCHAR szFile[MAX_PATH]; + sid.cbSize = sizeof(sid); + sid.flags = SIDF_ALL_TCHAR; + + sid.ptszSection = _T("Auth State"); + GetModuleFileName(g_hInst, szFile, MAX_PATH); + sid.ptszDefaultFile = szFile; + + sid.ptszDescription = _T("Auth"); + sid.pszName = "auth_icon"; + sid.iDefaultIndex = -IDI_AUTH; + Skin_AddIcon(&sid); + + sid.ptszDescription = _T("Grant"); + sid.pszName = "grant_icon"; + sid.iDefaultIndex = -IDI_GRANT; + Skin_AddIcon(&sid); + + sid.ptszDescription = _T("Auth & Grant"); + sid.pszName = "authgrant_icon"; + sid.iDefaultIndex = -IDI_AUTHGRANT; + Skin_AddIcon(&sid); + + // extra icons + hExtraIcon = ExtraIcon_Register("authstate", "Auth State", "authgrant_icon"); + if (hExtraIcon != NULL) + { + // Set initial value for all contacts + HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + while (hContact != NULL) + { + onExtraImageApplying((WPARAM)hContact, 1); + hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0); + } + } + else { + hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild); + hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild); + hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying); + onExtraImageListRebuild(0,0); + } + hOptInitialise = HookEvent(ME_OPT_INITIALISE, onOptInitialise); + if (bContactMenuItem) hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); + + // Updater support + if (ServiceExists(MS_UPDATE_REGISTER)) { + Update update = {0}; + char szVersion[16]; + + update.cbSize = sizeof(Update); + + update.szComponentName = pluginInfo.shortName; + update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion); + update.cpbVersion = lstrlenA((char *)update.pbVersion); + + update.szUpdateURL = UPDATER_AUTOREGISTER; + + // these are the three lines that matter - the archive, the page containing the version string, and the text (or data) + // before the version that we use to locate it on the page + // (note that if the update URL and the version URL point to standard file listing entries, the backend xml + // data will be used to check for updates rather than the actual web page - this is not true for beta urls) + update.szBetaUpdateURL = "http://thief.miranda.im/authstate.zip"; + update.szBetaVersionURL = "http://thief.miranda.im/updater/authstate_version.txt"; + update.szBetaChangelogURL = "http://thief.miranda.im"; + update.pbBetaVersionPrefix = (BYTE *)"AuthState "; + + update.cpbBetaVersionPrefix = lstrlenA((char *)update.pbBetaVersionPrefix); + + CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); + } + + return 0; +} + +int onSystemOKToExit(WPARAM wParam,LPARAM lParam) +{ + UnhookEvent(hHookModulesLoaded); + UnhookEvent(hHookExtraIconsRebuild); + UnhookEvent(hHookExtraIconsApply); + UnhookEvent(hOptInitialise); + UnhookEvent(hSystemOKToExit); + UnhookEvent(hContactSettingChanged); + if (hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged); + if (hContactAdded) UnhookEvent(hContactAdded); + if (hPrebuildContactMenu) + { + UnhookEvent(hPrebuildContactMenu); + UnhookEvent(hUserMenu); + } + DestroyServiceFunction(hAuthMenuSelected); + + return 0; +} + +extern "C" int __declspec(dllexport) Load(void) +{ + mir_getLP(&pluginInfo); + + hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded); + hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit); + hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged); + + clistIcon = DBGetContactSettingByte(NULL, MODULENAME, "AdvancedIcon", DefaultSlot); + bUseAuthIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", 1); + bUseGrantIcon = DBGetContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", 1); + bContactMenuItem = DBGetContactSettingByte(NULL, MODULENAME, "MenuItem", 0); + bIconsForRecentContacts = DBGetContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", 0); + + hContactAdded = HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded); + + if (bContactMenuItem) + { + hAuthMenuSelected = CreateServiceFunction("AuthState/MenuItem", onAuthMenuSelected); + + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(CLISTMENUITEM); + mi.position = -1999901005; + mi.flags = CMIF_TCHAR; + mi.ptszName = _T("Enable AuthState icons"); + mi.pszService = "AuthState/MenuItem"; + hUserMenu = Menu_AddContactMenuItem(&mi); + } + + g_IECClear.cbSize = sizeof(IconExtraColumn); + g_IECClear.ColumnType = clistIcon; + g_IECClear.hImage = (HANDLE) -1; + + return 0; +} + +extern "C" int __declspec(dllexport) Unload(void) +{ + return 0; +} diff --git a/plugins/AuthState/src/options.cpp b/plugins/AuthState/src/options.cpp new file mode 100644 index 0000000000..d2248d9e44 --- /dev/null +++ b/plugins/AuthState/src/options.cpp @@ -0,0 +1,151 @@ +/* + Authorization State plugin for Miranda-IM (www.miranda-im.org) + (c) 2006-2010 by Thief + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + File name : $URL: http://svn.miranda.im/mainrepo/authstate/trunk/options.cpp $ + Revision : $Rev: 1686 $ + Last change on : $Date: 2010-10-06 08:26:58 +0200 (Ср, 06 окт 2010) $ + Last change by : $Author: ghazan $ + +*/ + +#include "commonheaders.h" + +const TCHAR* szAdvancedIcons[] = {_T("Email"), _T("Protocol"), _T("SMS"), _T("Advanced 1"), _T("Advanced 2"), _T("Web"), _T("Client"), _T("Advanced 3"), _T("Advanced 4"), _T("Advanced 5")}; +const INT cAdvancedIcons = sizeof(szAdvancedIcons) / sizeof(szAdvancedIcons[0]); + +INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static int bInitializing = 0; + switch (msg) + { + case WM_INITDIALOG: + { + TranslateDialogDefault(hwndDlg); + bInitializing = 1; + if (hExtraIcon==NULL) + { + for (int i = 0; i < cAdvancedIcons; i++) + { + SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_ADDSTRING, 0, (LPARAM) TranslateTS(szAdvancedIcons[i])); + } + SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_SETCURSEL, clistIcon-1, 0); + } + else + { + SendDlgItemMessage(hwndDlg,IDC_NOTICE, WM_SETTEXT,0,(LPARAM)TranslateT("Extraicons plugin is used, use Contact list > Extraicons for customize.")); + ShowWindow(GetDlgItem(hwndDlg, IDC_NOTICE), SW_SHOW); + EnableWindow(GetDlgItem(hwndDlg, IDC_ADVICON), 0); + } + + CheckDlgButton(hwndDlg, IDC_AUTHICON, bUseAuthIcon ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_GRANTICON, bUseGrantIcon ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ENABLEMENUITEM, bContactMenuItem ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ICONSFORRECENT, bIconsForRecentContacts ? BST_CHECKED : BST_UNCHECKED); + + bInitializing = 0; + return TRUE; + } + + case WM_COMMAND: + { + switch (LOWORD(wParam)) + { + case IDC_AUTHICON: + case IDC_GRANTICON: + case IDC_ENABLEMENUITEM: + case IDC_ICONSFORRECENT: + { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + } + case IDC_ADVICON: + { + if ((HIWORD(wParam) == EN_CHANGE) && (!bInitializing) || (HIWORD(wParam) == CBN_SELENDOK)) + { + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + } + break; + } + } + break; + } + + case WM_NOTIFY: + { + if (((LPNMHDR)lParam)->idFrom == 0) + switch (((LPNMHDR)lParam)->code) + { + case PSN_APPLY: + { + bUseAuthIcon = IsDlgButtonChecked(hwndDlg, IDC_AUTHICON); + bUseGrantIcon = IsDlgButtonChecked(hwndDlg, IDC_GRANTICON); + bContactMenuItem = IsDlgButtonChecked(hwndDlg, IDC_ENABLEMENUITEM); + bIconsForRecentContacts = IsDlgButtonChecked(hwndDlg, IDC_ICONSFORRECENT); + + clistIcon = SendMessage(GetDlgItem(hwndDlg, IDC_ADVICON), CB_GETCURSEL, 0, 0); + clistIcon++; + + HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + while (hContact) + { + CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&g_IECClear); + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); + } + + g_IECClear.ColumnType = clistIcon; + onExtraImageListRebuild(0,0); + + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0); + while (hContact) + { + onExtraImageApplying((WPARAM)hContact,0); + hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0); + } + + //Store options values to DB + DBWriteContactSettingByte(NULL, MODULENAME, "AdvancedIcon", clistIcon); + DBWriteContactSettingByte(NULL, MODULENAME, "EnableAuthIcon", bUseAuthIcon); + DBWriteContactSettingByte(NULL, MODULENAME, "EnableGrantIcon", bUseGrantIcon); + DBWriteContactSettingByte(NULL, MODULENAME, "MenuItem", bContactMenuItem); + DBWriteContactSettingByte(NULL, MODULENAME, "EnableOnlyForRecent", bIconsForRecentContacts); + } + return TRUE; + } + } + + case WM_DESTROY: + break; + + } + return FALSE; +} + +int onOptInitialise(WPARAM wParam, LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.cbSize = sizeof(odp); + odp.hInstance = g_hInst; + odp.pszGroup = LPGEN("Contact List"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_AUTHSTATE_OPT); + odp.pszTitle = LPGEN("Auth State"); + odp.pfnDlgProc = DlgProcOptions; + odp.flags = ODPF_BOLDGROUPS; + Options_AddPage(wParam, &odp); + + return 0; +} diff --git a/plugins/AuthState/src/resource.h b/plugins/AuthState/src/resource.h new file mode 100644 index 0000000000..49c8f2fb6a --- /dev/null +++ b/plugins/AuthState/src/resource.h @@ -0,0 +1,25 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by authstate.rc +// +#define IDI_AUTH 101 +#define IDI_GRANT 102 +#define IDI_AUTHGRANT 103 +#define IDD_AUTHSTATE_OPT 103 +#define IDC_ADVICON 1001 +#define IDC_AUTHICON 1002 +#define IDC_GRANTICON 1003 +#define IDC_ENABLEMENUITEM 1005 +#define IDC_ICONSFORRECENT 1006 +#define IDC_NOTICE 1009 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 104 +#define _APS_NEXT_COMMAND_VALUE 40001 +#define _APS_NEXT_CONTROL_VALUE 1010 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/plugins/AuthState/src/version.h b/plugins/AuthState/src/version.h new file mode 100644 index 0000000000..3c39613d72 --- /dev/null +++ b/plugins/AuthState/src/version.h @@ -0,0 +1,20 @@ +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 0 +#define __RELEASE_NUM 2 +#define __BUILD_NUM 0 + +#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM +#define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM + +#define __STRINGIFY_IMPL(x) #x +#define __STRINGIFY(x) __STRINGIFY_IMPL(x) +#define __VERSION_STRING __STRINGIFY(__FILEVERSION_DOTS) + +#define __PLUGIN_NAME "Authorization State" +#define __INTERNAL_NAME "AuthState" +#define __FILENAME "AuthState.dll" +#define __DESCRIPTION "If contact didn't authorized you this plugin puts an icon in front of contacts name." +#define __AUTHOR "Thief, idea by snwbrdr" +#define __AUTHOREMAIL "thief@miranda.im" +#define __AUTHORWEB "http://thief.miranda.im/" +#define __COPYRIGHT "© 2006-2010 Alexander Turyak" diff --git a/plugins/AuthState/version.h b/plugins/AuthState/version.h deleted file mode 100644 index 3c39613d72..0000000000 --- a/plugins/AuthState/version.h +++ /dev/null @@ -1,20 +0,0 @@ -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 0 -#define __RELEASE_NUM 2 -#define __BUILD_NUM 0 - -#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM -#define __FILEVERSION_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM - -#define __STRINGIFY_IMPL(x) #x -#define __STRINGIFY(x) __STRINGIFY_IMPL(x) -#define __VERSION_STRING __STRINGIFY(__FILEVERSION_DOTS) - -#define __PLUGIN_NAME "Authorization State" -#define __INTERNAL_NAME "AuthState" -#define __FILENAME "AuthState.dll" -#define __DESCRIPTION "If contact didn't authorized you this plugin puts an icon in front of contacts name." -#define __AUTHOR "Thief, idea by snwbrdr" -#define __AUTHOREMAIL "thief@miranda.im" -#define __AUTHORWEB "http://thief.miranda.im/" -#define __COPYRIGHT "© 2006-2010 Alexander Turyak" diff --git a/plugins/AuthState/version.rc b/plugins/AuthState/version.rc deleted file mode 100644 index 2b1aaa9768..0000000000 --- a/plugins/AuthState/version.rc +++ /dev/null @@ -1,40 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "afxres.h" -#include "version.h" - -#ifdef _WIN32 -LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL -#endif //_WIN32 - -VS_VERSION_INFO VERSIONINFO - FILEVERSION __FILEVERSION_STRING - PRODUCTVERSION __FILEVERSION_STRING - FILEFLAGSMASK 0x17L -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x4L - FILETYPE 0x0L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "000004b0" - BEGIN - VALUE "FileDescription", __DESCRIPTION - VALUE "FileVersion", __FILEVERSION_DOTS - VALUE "InternalName", __PLUGIN_NAME - VALUE "LegalCopyright", __COPYRIGHT - VALUE "OriginalFilename", __FILENAME - VALUE "ProductName", __PLUGIN_NAME - VALUE "ProductVersion", __FILEVERSION_DOTS - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x0, 1200 - END -END -- cgit v1.2.3