From f08f5e316f64fc81f765e5d94273149540de6f58 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Fri, 13 Jul 2012 06:16:40 +0000 Subject: ClientChangeNotify and Clist_classic: changed folder structure git-svn-id: http://svn.miranda-ng.org/main/trunk@934 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ClientChangeNotify/ClientChangeNotify.cpp | 481 ----------------- .../ClientChangeNotify/ClientChangeNotify.vcxproj | 30 +- .../ClientChangeNotify.vcxproj.filters | 22 +- plugins/ClientChangeNotify/Common.h | 142 ----- plugins/ClientChangeNotify/Misc.h | 83 --- plugins/ClientChangeNotify/OptDlg.cpp | 215 -------- plugins/ClientChangeNotify/Resources.rc | 202 ------- plugins/ClientChangeNotify/Resources.rc2 | 50 -- plugins/ClientChangeNotify/VersionNo.h | 11 - plugins/ClientChangeNotify/ccn_readme.txt | 81 --- plugins/ClientChangeNotify/ccn_translation.txt | 69 --- .../clientchangenotify-translation.txt | 58 -- plugins/ClientChangeNotify/copying.txt | 340 ------------ plugins/ClientChangeNotify/docs/ccn_readme.txt | 81 +++ .../ClientChangeNotify/docs/ccn_translation.txt | 69 +++ .../docs/clientchangenotify-translation.txt | 58 ++ plugins/ClientChangeNotify/docs/copying.txt | 340 ++++++++++++ plugins/ClientChangeNotify/res/Resources.rc | 202 +++++++ plugins/ClientChangeNotify/res/Resources.rc2 | 50 ++ plugins/ClientChangeNotify/resource.h | 42 -- .../ClientChangeNotify/src/ClientChangeNotify.cpp | 481 +++++++++++++++++ plugins/ClientChangeNotify/src/Common.h | 142 +++++ plugins/ClientChangeNotify/src/Misc.h | 83 +++ plugins/ClientChangeNotify/src/OptDlg.cpp | 215 ++++++++ plugins/ClientChangeNotify/src/VersionNo.h | 11 + plugins/ClientChangeNotify/src/resource.h | 42 ++ plugins/Clist_classic/clc.h | 83 --- plugins/Clist_classic/clcfonts.cpp | 137 ----- plugins/Clist_classic/clcopts.cpp | 479 ----------------- plugins/Clist_classic/clcpaint.cpp | 596 --------------------- plugins/Clist_classic/clist-translation.txt | 166 ------ plugins/Clist_classic/clist_10.vcxproj | 36 +- plugins/Clist_classic/clist_10.vcxproj.filters | 24 +- .../Clist_classic/clist_classic-translation.txt | 166 ------ plugins/Clist_classic/clistmenus.cpp | 36 -- plugins/Clist_classic/clistopts.cpp | 279 ---------- plugins/Clist_classic/cluiopts.cpp | 394 -------------- plugins/Clist_classic/commonheaders.h | 78 --- plugins/Clist_classic/docs/clist-translation.txt | 166 ++++++ .../docs/clist_classic-translation.txt | 166 ++++++ plugins/Clist_classic/init.cpp | 180 ------- plugins/Clist_classic/res/resource.rc | 532 ++++++++++++++++++ plugins/Clist_classic/res/version.rc | 56 ++ plugins/Clist_classic/resource.h | 163 ------ plugins/Clist_classic/resource.rc | 532 ------------------ plugins/Clist_classic/src/clc.h | 83 +++ plugins/Clist_classic/src/clcfonts.cpp | 137 +++++ plugins/Clist_classic/src/clcopts.cpp | 479 +++++++++++++++++ plugins/Clist_classic/src/clcpaint.cpp | 596 +++++++++++++++++++++ plugins/Clist_classic/src/clistmenus.cpp | 36 ++ plugins/Clist_classic/src/clistopts.cpp | 279 ++++++++++ plugins/Clist_classic/src/cluiopts.cpp | 394 ++++++++++++++ plugins/Clist_classic/src/commonheaders.h | 78 +++ plugins/Clist_classic/src/init.cpp | 180 +++++++ plugins/Clist_classic/src/resource.h | 163 ++++++ plugins/Clist_classic/src/version.h | 5 + plugins/Clist_classic/version.h | 5 - plugins/Clist_classic/version.rc | 58 -- 58 files changed, 5178 insertions(+), 5184 deletions(-) delete mode 100644 plugins/ClientChangeNotify/ClientChangeNotify.cpp delete mode 100644 plugins/ClientChangeNotify/Common.h delete mode 100644 plugins/ClientChangeNotify/Misc.h delete mode 100644 plugins/ClientChangeNotify/OptDlg.cpp delete mode 100644 plugins/ClientChangeNotify/Resources.rc delete mode 100644 plugins/ClientChangeNotify/Resources.rc2 delete mode 100644 plugins/ClientChangeNotify/VersionNo.h delete mode 100644 plugins/ClientChangeNotify/ccn_readme.txt delete mode 100644 plugins/ClientChangeNotify/ccn_translation.txt delete mode 100644 plugins/ClientChangeNotify/clientchangenotify-translation.txt delete mode 100644 plugins/ClientChangeNotify/copying.txt create mode 100644 plugins/ClientChangeNotify/docs/ccn_readme.txt create mode 100644 plugins/ClientChangeNotify/docs/ccn_translation.txt create mode 100644 plugins/ClientChangeNotify/docs/clientchangenotify-translation.txt create mode 100644 plugins/ClientChangeNotify/docs/copying.txt create mode 100644 plugins/ClientChangeNotify/res/Resources.rc create mode 100644 plugins/ClientChangeNotify/res/Resources.rc2 delete mode 100644 plugins/ClientChangeNotify/resource.h create mode 100644 plugins/ClientChangeNotify/src/ClientChangeNotify.cpp create mode 100644 plugins/ClientChangeNotify/src/Common.h create mode 100644 plugins/ClientChangeNotify/src/Misc.h create mode 100644 plugins/ClientChangeNotify/src/OptDlg.cpp create mode 100644 plugins/ClientChangeNotify/src/VersionNo.h create mode 100644 plugins/ClientChangeNotify/src/resource.h delete mode 100644 plugins/Clist_classic/clc.h delete mode 100644 plugins/Clist_classic/clcfonts.cpp delete mode 100644 plugins/Clist_classic/clcopts.cpp delete mode 100644 plugins/Clist_classic/clcpaint.cpp delete mode 100644 plugins/Clist_classic/clist-translation.txt delete mode 100644 plugins/Clist_classic/clist_classic-translation.txt delete mode 100644 plugins/Clist_classic/clistmenus.cpp delete mode 100644 plugins/Clist_classic/clistopts.cpp delete mode 100644 plugins/Clist_classic/cluiopts.cpp delete mode 100644 plugins/Clist_classic/commonheaders.h create mode 100644 plugins/Clist_classic/docs/clist-translation.txt create mode 100644 plugins/Clist_classic/docs/clist_classic-translation.txt delete mode 100644 plugins/Clist_classic/init.cpp create mode 100644 plugins/Clist_classic/res/resource.rc create mode 100644 plugins/Clist_classic/res/version.rc delete mode 100644 plugins/Clist_classic/resource.h delete mode 100644 plugins/Clist_classic/resource.rc create mode 100644 plugins/Clist_classic/src/clc.h create mode 100644 plugins/Clist_classic/src/clcfonts.cpp create mode 100644 plugins/Clist_classic/src/clcopts.cpp create mode 100644 plugins/Clist_classic/src/clcpaint.cpp create mode 100644 plugins/Clist_classic/src/clistmenus.cpp create mode 100644 plugins/Clist_classic/src/clistopts.cpp create mode 100644 plugins/Clist_classic/src/cluiopts.cpp create mode 100644 plugins/Clist_classic/src/commonheaders.h create mode 100644 plugins/Clist_classic/src/init.cpp create mode 100644 plugins/Clist_classic/src/resource.h create mode 100644 plugins/Clist_classic/src/version.h delete mode 100644 plugins/Clist_classic/version.h delete mode 100644 plugins/Clist_classic/version.rc diff --git a/plugins/ClientChangeNotify/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/ClientChangeNotify.cpp deleted file mode 100644 index 3318c3ec92..0000000000 --- a/plugins/ClientChangeNotify/ClientChangeNotify.cpp +++ /dev/null @@ -1,481 +0,0 @@ -/* - ClientChangeNotify - Plugin for Miranda IM - Copyright (c) 2006-2008 Chervov Dmitry - - 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 -*/ - -#include "Common.h" -#include "Misc.h" -#include "VersionNo.h" -#include "m_message.h" -#include "m_userinfo.h" -#include "m_history.h" -#include "m_protocols.h" -#include "m_updater.h" -#include "m_protosvc.h" -#include "m_metacontacts.h" -#include "m_icolib.h" -#include "m_genmenu.h" -#include "m_ContactSettings.h" - -HINSTANCE g_hInstance; -HANDLE g_hMainThread; -HANDLE g_hTogglePopupsMenuItem; -int hLangpack; -TMyArray hHooks, hServices; -COptPage *g_PreviewOptPage; // we need to show popup even for the NULL contact if g_PreviewOptPage is not NULL (used for popup preview) - -PLUGININFOEX pluginInfo = { - sizeof(PLUGININFOEX), - "ClientChangeNotify", - PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), - "ClientChangeNotify plugin for Miranda IM.", - "Deathdemon", - "dchervov@yahoo.com", - "© 2006-2008 Chervov Dmitry", - "http://deathdemon.int.ru/", - UNICODE_AWARE, - // {B68A8906-748B-435d-930E-21CC6E8F3B3F} - {0xb68a8906, 0x748b, 0x435d, {0x93, 0xe, 0x21, 0xcc, 0x6e, 0x8f, 0x3b, 0x3f}} -}; - -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) -{ - g_hInstance = hinstDLL; - return TRUE; -} - -#define MIID_CLIENTCHANGENOTIFY {0xe9d1f0d4, 0xd65d, 0x4840, {0x87, 0xbd, 0x59, 0xd7, 0xb4, 0x70, 0x2c, 0x47}} -// {E9D1F0D4-D65D-4840-87BD-59D7B4702C47} - -static const MUUID interfaces[] = {MIID_CLIENTCHANGENOTIFY, MIID_LAST}; -extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces(void) -{ - return interfaces; -} - -extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfo; -} - -static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) - { - case WM_MEASUREITEM: - { - return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); - } - case WM_DRAWITEM: - { - return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); - } - } - return DefWindowProc(hWnd, uMsg, wParam, lParam); -} - - -static VOID NTAPI ShowContactMenu(ULONG_PTR wParam) -// wParam = hContact -{ - POINT pt; - HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), _T(MOD_NAME)_T("_MenuWindow"), 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL); - SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG)(WNDPROC)MenuWndProc); - HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)wParam, 0); - GetCursorPos(&pt); - SetForegroundWindow(hMenuWnd); - CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hMenuWnd, NULL), MPCF_CONTACTMENU), (LPARAM)wParam); - PostMessage(hMenuWnd, WM_NULL, 0, 0); - DestroyMenu(hMenu); - DestroyWindow(hMenuWnd); -} - - -void Popup_DoAction(HWND hWnd, BYTE Action, PLUGIN_DATA *pdata) -{ - HANDLE hContact = (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hWnd, 0); - switch (Action) { - case PCA_OPENMESSAGEWND: // open message window - if (hContact && hContact != INVALID_HANDLE_VALUE) - CallServiceSync(ServiceExists("SRMsg/LaunchMessageWindow") ? "SRMsg/LaunchMessageWindow" : MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); - break; - - case PCA_OPENMENU: // open contact menu - if (hContact && hContact != INVALID_HANDLE_VALUE) - QueueUserAPC(ShowContactMenu, g_hMainThread, (ULONG_PTR)hContact); - break; - - case PCA_OPENDETAILS: // open contact details window - if (hContact != INVALID_HANDLE_VALUE) - CallServiceSync(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); - break; - - case PCA_OPENHISTORY: // open contact history - if (hContact != INVALID_HANDLE_VALUE) - CallServiceSync(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)hContact, 0); - break; - - case PCA_OPENLOG: // open log file - { - TCString LogFilePath; - LS_LOGINFO li = {0}; - li.cbSize = sizeof(li); - li.szID = LOG_ID; - li.hContact = hContact; - li.Flags = LSLI_TCHAR; - li.tszLogPath = LogFilePath.GetBuffer(MAX_PATH); - if (!CallService(MS_LOGSERVICE_GETLOGINFO, (WPARAM)&li, 0)) { - LogFilePath.ReleaseBuffer(); - ShowLog(LogFilePath); - } - else LogFilePath.ReleaseBuffer(); - break; - } - case PCA_CLOSEPOPUP: // close popup - PUDeletePopUp(hWnd); - break; - - case PCA_DONOTHING: // do nothing - break; - } -} - - -static LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) -{ - PLUGIN_DATA *pdata = (PLUGIN_DATA*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, 0); - if (pdata) { - switch (message) { - case WM_COMMAND: - if (HIWORD(wParam) == STN_CLICKED) { // left mouse button - Popup_DoAction(hWnd, pdata->PopupLClickAction, pdata); - return true; - } - break; - - case WM_CONTEXTMENU: // right mouse button - Popup_DoAction(hWnd, pdata->PopupRClickAction, pdata); - return true; - - case UM_FREEPLUGINDATA: - if (pdata->hIcon) - DestroyIcon(pdata->hIcon); - - free(pdata); - return false; - break; - } - } - return DefWindowProc(hWnd, message, wParam, lParam); -} - - -void ShowPopup(SHOWPOPUP_DATA *sd) -{ - TCString PopupText; - if (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT)) { - mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s (was %s)"), (const TCHAR*)sd->MirVer, (const TCHAR*)sd->OldMirVer); - PopupText.ReleaseBuffer(); - } - else { - mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s"), (const TCHAR*)sd->MirVer); - PopupText.ReleaseBuffer(); - } - - PLUGIN_DATA *pdata = (PLUGIN_DATA*)calloc(1, sizeof(PLUGIN_DATA)); - POPUPDATAT ppd = {0}; - ppd.lchContact = sd->hContact; - char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)sd->hContact, 0); - pdata->hIcon = ppd.lchIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)(const char*)TCHAR2ANSI(sd->MirVer), false); - _ASSERT(ppd.lchIcon); - if (!ppd.lchIcon || (DWORD)ppd.lchIcon == CALLSERVICE_NOTFOUND) { - // if we didn't succeed retrieving client icon, show the usual status icon instead - ppd.lchIcon = LoadSkinnedProtoIcon(szProto, DBGetContactSettingWord(sd->hContact, szProto, "Status", ID_STATUS_OFFLINE)); - pdata->hIcon = NULL; - } - _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)sd->hContact, GCDNF_TCHAR), lengthof(ppd.lptzContactName) - 1); - _tcsncpy(ppd.lptzText, PopupText, lengthof(ppd.lptzText) - 1); - ppd.colorBack = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFBGCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_BGCOLOUR)); - ppd.colorText = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFTEXTCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_TEXTCOLOUR)); - ppd.PluginWindowProc = PopupWndProc; - pdata->PopupLClickAction = sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_LCLICK_ACTION); - pdata->PopupRClickAction = sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_RCLICK_ACTION); - ppd.iSeconds = sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_POPUPDELAY); - ppd.PluginData = pdata; - PUAddPopUpT(&ppd); -} - -int ContactSettingChanged(WPARAM wParam, LPARAM lParam) -{ - DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; - if (!lstrcmpA(cws->szSetting, DB_MIRVER)) { - HANDLE hContact = (HANDLE)wParam; - SHOWPOPUP_DATA sd = {0}; - char *szProto = NULL; - if (g_PreviewOptPage) - sd.MirVer = _T("Miranda IM 0.6.0.1 (ICQ v0.3.7 alpha)"); - else { - if (!hContact) // exit if hContact == NULL and it's not a popup preview - return 0; - - szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); - _ASSERT(szProto); - if (ServiceExists(MS_MC_GETPROTOCOLNAME) && !strcmp(szProto, (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0))) // workaround for metacontacts - return 0; - - sd.MirVer = DBGetContactSettingString(hContact, szProto, DB_MIRVER, _T("")); - if (sd.MirVer.IsEmpty()) - return 0; - } - sd.OldMirVer = DBGetContactSettingString(hContact, MOD_NAME, DB_OLDMIRVER, _T("")); - DBWriteContactSettingTString(hContact, MOD_NAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later - if (sd.OldMirVer.IsEmpty()) // looks like it's the right way to do - return 0; - - COptPage PopupOptPage; - if (g_PreviewOptPage) - PopupOptPage = *g_PreviewOptPage; - else { - PopupOptPage = g_PopupOptPage; - PopupOptPage.DBToMem(); - } - - HANDLE hContactOrMeta = (hContact && ServiceExists(MS_MC_GETMETACONTACT)) ? (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0) : hContact; - if (!hContactOrMeta) - hContactOrMeta = hContact; - - if (hContact && DBGetContactSettingByte(hContactOrMeta, "CList", "Hidden", 0)) - return 0; - - int PerContactSetting = hContact ? DBGetContactSettingByte(hContact, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL) : NOTIFY_ALWAYS; // NOTIFY_ALWAYS for preview - if (PerContactSetting == NOTIFY_USEGLOBAL && hContactOrMeta != hContact) // subcontact setting has a priority over a metacontact setting - PerContactSetting = DBGetContactSettingByte(hContactOrMeta, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL); - - if (PerContactSetting && (PerContactSetting == NOTIFY_ALMOST_ALWAYS || PerContactSetting == NOTIFY_ALWAYS || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG) || !(DBGetContactSettingDword(hContactOrMeta, "Ignore", "Mask1", 0) & 0x8))) { // check if we need to notify at all - sd.hContact = hContact; - sd.PopupOptPage = &PopupOptPage; - if (!PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWVER)) { - CString OldMirVerA = TCHAR2ANSI(sd.OldMirVer); - CString MirVerA = TCHAR2ANSI(sd.MirVer); - if (ServiceExists(MS_FP_SAMECLIENTS)) { - char *szOldClient = (char*)CallService(MS_FP_SAMECLIENTS, (WPARAM)(const char*)OldMirVerA, (LPARAM)(const char*)OldMirVerA); // remove version from MirVer strings. I know, the way in which MS_FP_SAMECLIENTS is used here is pretty ugly, but at least it gives necessary results - char *szClient = (char*)CallService(MS_FP_SAMECLIENTS, (WPARAM)(const char*)MirVerA, (LPARAM)(const char*)MirVerA); - if (szOldClient && szClient) { - if (PerContactSetting != NOTIFY_ALMOST_ALWAYS && PerContactSetting != NOTIFY_ALWAYS && !PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) && !strcmp(szClient, szOldClient)) - return 0; - - if (!PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWVER)) { - sd.MirVer = ANSI2TCHAR(szClient); - sd.OldMirVer = ANSI2TCHAR(szOldClient); - } - } - } - } - if (sd.MirVer == (const TCHAR*)sd.OldMirVer) { - _ASSERT(hContact); - return 0; - } - if (PerContactSetting == NOTIFY_ALWAYS || (PopupOptPage.GetValue(IDC_POPUPOPTDLG_POPUPNOTIFY) && (g_PreviewOptPage || PerContactSetting == NOTIFY_ALMOST_ALWAYS || !PcreCheck(sd.MirVer)))) { - ShowPopup(&sd); - SkinPlaySound(CLIENTCHANGED_SOUND); - } - } - if (hContact) { - TCString ClientName; - if (PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT) && sd.OldMirVer.GetLen()) { - mir_sntprintf(ClientName.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("%s (was %s)"), (const TCHAR*)sd.MirVer, (const TCHAR*)sd.OldMirVer); - ClientName.ReleaseBuffer(); - } - else ClientName = sd.MirVer; - - if (ServiceExists(MS_VARS_FORMATSTRING)) - logservice_log(LOG_ID, hContact, ClientName); - else { - _ASSERT(szProto); - TCString szUID(_T("")); - char *uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); - if (uid && (int)uid != CALLSERVICE_NOTFOUND) - szUID = DBGetContactSettingAsString(hContact, szProto, uid, _T("")); - - logservice_log(LOG_ID, hContact, TCString((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)) + _T(" (") + szUID + TranslateT(") changed client to ") + ClientName); - } - } - _ASSERT(sd.MirVer.GetLen()); // save the last known MirVer value even if the new one is empty - } - return 0; -} - -static int ContactSettingsInit(WPARAM wParam, LPARAM lParam) -{ - CONTACTSETTINGSINIT *csi = (CONTACTSETTINGSINIT*)wParam; - char *szProto = (csi->Type == CSIT_CONTACT) ? (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)csi->hContact, 0) : NULL; - if ((csi->Type == CSIT_GROUP) || (szProto && csi->Type == CSIT_CONTACT)) { - int Flag1 = (csi->Type == CSIT_CONTACT) ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : PF1_IM; // if it's a group settings dialog, we assume that there are possibly some contacts in the group with PF1_IM capability - if (Flag1 & (PF1_IMRECV | PF1_URLRECV | PF1_FILERECV)) { // I hope, these flags are sufficient to describe which protocols can theoretically have a client - CONTACTSETTINGSCONTROL csc = {0}; - csc.cbSize = sizeof(csc); - csc.cbStateSize = sizeof(CSCONTROLSTATE); - csc.Position = CSPOS_SORTBYALPHABET; - csc.Flags = CSCF_TCHAR; - csc.ControlType = CSCT_COMBOBOX; - csc.ptszTitle = LPGENT("Client change notifications:"); - csc.ptszGroup = CSGROUP_NOTIFICATIONS; - csc.szModule = MOD_NAME; - csc.szSetting = DB_CCN_NOTIFY; - csc.StateNum = 4; - csc.DefState = 3; - CSCONTROLSTATE States[] = {CSCONTROLSTATE(LPGENT("Never, ignore client changes for this contact"), (BYTE)NOTIFY_IGNORE), CSCONTROLSTATE(LPGENT("Always except when client change notifications are disabled globally"), (BYTE)NOTIFY_ALMOST_ALWAYS), CSCONTROLSTATE(LPGENT("Always, even when client change notifications are disabled globally"), (BYTE)NOTIFY_ALWAYS), CSCONTROLSTATE(LPGENT("Use global settings (default)"), (BYTE)NOTIFY_USEGLOBAL)}; - csc.pStates = States; - CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); - } - } - return 0; -} - - -static INT_PTR srvTogglePopups(WPARAM wParam, LPARAM lParam) -{ - g_PopupOptPage.SetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY, !g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY)); - return 0; -} - - -static int PrebuildMainMenu(WPARAM wParam, LPARAM lParam) -{ - // we have to use ME_CLIST_PREBUILDMAINMENU instead of updating menu items only on settings change, because "popup_enabled" and "popup_disabled" icons are not always available yet in ModulesLoaded - if (ServiceExists(MS_POPUP_ADDPOPUPT)) { - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(mi); - mi.flags = CMIF_TCHAR | CMIM_NAME | CMIM_ICON; - if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY)) { - mi.ptszName = LPGENT("Disable c&lient change notification"); - mi.hIcon = ServiceExists(MS_SKIN2_GETICON) ? (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"popup_enabled") : NULL; - } - else { - mi.ptszName = LPGENT("Enable c&lient change notification"); - mi.hIcon = ServiceExists(MS_SKIN2_GETICON) ? (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"popup_disabled") : NULL; - } - mi.ptszPopupName = LPGENT("PopUps"); - CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hTogglePopupsMenuItem, (LPARAM)&mi); - } - return 0; -} - -INT_PTR CALLBACK CCNErrorDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) -{ - switch (uMsg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - return true; - - case WM_COMMAND: - if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) - DestroyWindow(hwndDlg); - break; - - case WM_DESTROY: - if (IsDlgButtonChecked(hwndDlg, IDC_DONTREMIND)) - DBWriteContactSettingByte(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 1); - break; - } - return 0; -} - -int MirandaLoaded(WPARAM wParam, LPARAM lParam) -{ - InitPcre(); - COptPage PopupOptPage(g_PopupOptPage); - PopupOptPage.DBToMem(); - RecompileRegexps(*(TCString*)PopupOptPage.GetValue(IDC_POPUPOPTDLG_IGNORESTRINGS)); - hHooks.AddElem(HookEvent(ME_OPT_INITIALISE, OptionsDlgInit)); - hHooks.AddElem(HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged)); - hHooks.AddElem(HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit)); - SkinAddNewSoundEx(CLIENTCHANGED_SOUND, NULL, LPGEN("ClientChangeNotify: Client changed")); -// updater plugin support - Update update = {0}; - char szVersion[16]; - update.cbSize = sizeof(Update); - update.szComponentName = pluginInfo.shortName; - update.pbVersion = (BYTE*)CreateVersionString(PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), szVersion); - update.cpbVersion = (int)strlen((char*)update.pbVersion); - update.szUpdateURL = "http://deathdemon.int.ru/projects/ClientChangeNotifyW.zip"; - update.szVersionURL = "http://deathdemon.int.ru/updaterinfo.php"; - update.pbVersionPrefix = (BYTE*)"ClientChangeNotify Unicode version "; - update.cpbVersionPrefix = (int)strlen((char*)update.pbVersionPrefix); - CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); - - if (ServiceExists(MS_POPUP_ADDPOPUPT)) { - hServices.AddElem(CreateServiceFunction(MS_CCN_TOGGLEPOPUPS, srvTogglePopups)); - hHooks.AddElem(HookEvent(ME_CLIST_PREBUILDMAINMENU, PrebuildMainMenu)); - CLISTMENUITEM mi = {0}; - mi.cbSize = sizeof(mi); - mi.flags = CMIF_TCHAR; - if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY)) - mi.ptszName = LPGENT("Disable c&lient change notification"); - else - mi.ptszName = LPGENT("Enable c&lient change notification"); - - mi.pszService = MS_CCN_TOGGLEPOPUPS; - mi.ptszPopupName = LPGENT("PopUps"); - g_hTogglePopupsMenuItem = Menu_AddMainMenuItem(&mi); - } - - // seems that Fingerprint is not installed - if ((!ServiceExists(MS_FP_SAMECLIENTS) || !ServiceExists(MS_FP_GETCLIENTICON)) && !DBGetContactSettingByte(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 0)) - CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_CCN_ERROR), NULL, CCNErrorDlgProc); - - logservice_register(LOG_ID, LPGENT("ClientChangeNotify"), _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), TranslateT("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%")); - return 0; -} - - -extern "C" int __declspec(dllexport) Load(void) -{ - mir_getLP( &pluginInfo ); - - hHooks.AddElem(HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded)); - DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &g_hMainThread, THREAD_SET_CONTEXT, false, 0); - InitOptions(); - if (DBGetContactSettingString(NULL, "KnownModules", MOD_NAME, (char*)NULL) == NULL) - DBWriteContactSettingString(NULL, "KnownModules", MOD_NAME, MOD_NAME); - - if (DBGetContactSettingByte(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) { - TCString Str; - Str = DBGetContactSettingString(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, _T("")); - if (Str.GetLen()) // fix incorrect regexp from v0.1.1.0 - DBWriteContactSettingTString(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, Str.Replace(_T("/Miranda[0-9A-F]{8}/"), _T("/[0-9A-F]{8}(\\W|$)/"))); - - DBWriteContactSettingByte(NULL, MOD_NAME, DB_SETTINGSVER, 1); - } - return 0; -} - -extern "C" int __declspec(dllexport) Unload() -{ - CloseHandle(g_hMainThread); - int I; - for (I = 0; I < hHooks.GetSize(); I++) - if (hHooks[I]) - UnhookEvent(hHooks[I]); - - for (I = 0; I < hServices.GetSize(); I++) - if (hServices[I]) - DestroyServiceFunction(hServices[I]); - - UninitPcre(); - return 0; -} diff --git a/plugins/ClientChangeNotify/ClientChangeNotify.vcxproj b/plugins/ClientChangeNotify/ClientChangeNotify.vcxproj index c5690ca2b9..c1e90d0cc9 100644 --- a/plugins/ClientChangeNotify/ClientChangeNotify.vcxproj +++ b/plugins/ClientChangeNotify/ClientChangeNotify.vcxproj @@ -77,7 +77,7 @@ Use Level3 EditAndContinue - Common.h + src\Common.h true @@ -99,7 +99,7 @@ MultiThreadedDebugDLL Use Level3 - Common.h + src\Common.h true @@ -124,7 +124,7 @@ true Use Level3 - Common.h + src\Common.h Size @@ -152,7 +152,7 @@ true Use Level3 - Common.h + src\Common.h Size @@ -170,33 +170,33 @@ - + Create - + - + - + - + - + - + + - - - - + + + diff --git a/plugins/ClientChangeNotify/ClientChangeNotify.vcxproj.filters b/plugins/ClientChangeNotify/ClientChangeNotify.vcxproj.filters index b711c6c5e0..8fc754f832 100644 --- a/plugins/ClientChangeNotify/ClientChangeNotify.vcxproj.filters +++ b/plugins/ClientChangeNotify/ClientChangeNotify.vcxproj.filters @@ -18,13 +18,13 @@ - + Source Files Source Files - + Source Files @@ -35,13 +35,13 @@ - + Header Files Header Files - + Header Files @@ -53,32 +53,32 @@ Header Files - + Header Files Header Files - + Header Files - + Resource Files - + Resource Files - + Documentation - + Documentation - + Documentation diff --git a/plugins/ClientChangeNotify/Common.h b/plugins/ClientChangeNotify/Common.h deleted file mode 100644 index 62d41732a7..0000000000 --- a/plugins/ClientChangeNotify/Common.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - ClientChangeNotify - Plugin for Miranda IM - Copyright (c) 2006-2008 Chervov Dmitry - - 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 -*/ - -#pragma once - -#define _CRT_SECURE_NO_WARNINGS -#define WIN32_LEAN_AND_MEAN - -#define CHARARRAY_CONVERT - -#include -#include -#include -#include -#include -#include - -#include "resource.h" -#include "newpluginapi.h" -#include "statusmodes.h" -#include "m_popup.h" -#include "m_skin.h" -#include "m_langpack.h" -#include "m_options.h" -#include "m_clist.h" -#include "m_LogService.h" -#include "m_system.h" -#include "m_fingerprint.h" -#include "..\CommonLibs\TMyArray.h" -#include "..\CommonLibs\Options.h" -#include "..\CommonLibs\CString.h" -#include "..\CommonLibs\pcre.h" - -#pragma comment(lib,"comctl32.lib") - -#ifndef lengthof -#define lengthof(s) (sizeof(s) / sizeof((s)[0])) -#endif - -// Actions on popup click -#define PCA_OPENMESSAGEWND 0 // open message window -#define PCA_CLOSEPOPUP 1 // close popup -#define PCA_OPENDETAILS 2 // open contact details window -#define PCA_OPENMENU 3 // open contact menu -#define PCA_OPENHISTORY 4 // open contact history -#define PCA_OPENLOG 5 // open log file -#define PCA_DONOTHING 6 // do nothing - -#define POPUP_DEF_LCLICKACTION PCA_OPENMESSAGEWND -#define POPUP_DEF_RCLICKACTION PCA_CLOSEPOPUP -#define POPUP_DEF_POPUP_BGCOLOUR 0xEAFFFB -#define POPUP_DEF_POPUP_TEXTCOLOUR 0 -#define POPUP_DEF_USEDEFBGCOLOUR 0 -#define POPUP_DEF_USEDEFTEXTCOLOUR 0 -#define POPUP_DEF_POPUPDELAY 0 - -#define IGNORESTRINGS_MAX_LEN 2048 -#define MAX_MSG_LEN 8192 - -#define NOTIFYTIMER_INTERVAL 3500 - -#define MOD_NAME "ClientChangeNotify" -#define LOG_ID MOD_NAME -#define LOG_PREFIX MOD_NAME ": " // for netlib.log - -#define MS_NETLIB_LOG "Netlib/Log" - -#define DB_MIRVER "MirVer" -#define DB_OLDMIRVER "OldMirVer" -#define DB_NO_FINGERPRINT_ERROR "NoFingerprintError" -#define DB_IGNORESUBSTRINGS "IgnoreSubstrings" -#define DB_SETTINGSVER "SettingsVer" - -#define DB_CCN_NOTIFY "Notify" // database key name used for per-contact settings; 0 = ignore, 1 = notify always, 2 = use global settings -#define NOTIFY_IGNORE 0 -#define NOTIFY_ALMOST_ALWAYS 1 // don't notify only when CCN popups are disabled globally in the plugin -#define NOTIFY_ALWAYS 2 -#define NOTIFY_USEGLOBAL 3 - -#define CLIENTCHANGED_SOUND "ClientChanged" - -extern HINSTANCE g_hInstance; - -extern COptPage g_PopupOptPage; -extern COptPage *g_PreviewOptPage; - -#define MS_VARS_FORMATSTRING "Vars/FormatString" -#define MS_CCN_TOGGLEPOPUPS "ClientChangeNotify/TogglePopups" - - -static __inline CString LogMessage(const char *Format, ...) -{ - va_list va; - char szText[8096]; - strcpy(szText, LOG_PREFIX); - va_start(va, Format); - mir_vsnprintf(szText + (lengthof(LOG_PREFIX) - 1), sizeof(szText) - (lengthof(LOG_PREFIX) - 1), Format, va); - va_end(va); - CallService(MS_NETLIB_LOG, NULL, (LPARAM)szText); - return CString(szText); -} - - -// ClientChangeNotify.cpp - -struct PLUGIN_DATA -{ - HICON hIcon; // needed here to destroy its handle on UM_FREEPLUGINDATA - int PopupLClickAction; - int PopupRClickAction; -}; - -struct SHOWPOPUP_DATA -{ - HANDLE hContact; - TCString OldMirVer; - TCString MirVer; - COptPage *PopupOptPage; -}; - - -int ContactSettingChanged(WPARAM wParam, LPARAM lParam); - -// OptDlg.cpp -int OptionsDlgInit(WPARAM wParam, LPARAM lParam); -void InitOptions(); diff --git a/plugins/ClientChangeNotify/Misc.h b/plugins/ClientChangeNotify/Misc.h deleted file mode 100644 index 262193dc26..0000000000 --- a/plugins/ClientChangeNotify/Misc.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - ClientChangeNotify - Plugin for Miranda IM - Copyright (c) 2006-2008 Chervov Dmitry - - 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 -*/ - -#include "Common.h" - - -__inline void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine = _T(""), bool IsErrorMsg = false, int Timeout = 0) -{ - if (ServiceExists(MS_POPUP_ADDPOPUPEX)) - { - POPUPDATAT ppd = {0}; - ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION); - lstrcpy(ppd.lptzContactName, FirstLine); - lstrcpy(ppd.lptzText, SecondLine); - ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD; - ppd.colorText = IsErrorMsg ? 0xE8F1FD : 0x000000; - ppd.iSeconds = Timeout; - CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, 0); - } else - { - MessageBox(NULL, SecondLine, FirstLine, MB_OK | (IsErrorMsg ? MB_ICONEXCLAMATION : MB_ICONINFORMATION)); - } -} - - -__inline TCString Path_ToRelative(TCString &Path) -{ - CString Str; - Str.GetBuffer(MAX_PATH); - CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)(const char*)TCHAR2ANSI(Path), (LPARAM)(char*)Str); - Str.ReleaseBuffer(); - return ANSI2TCHAR(Str); -} - - -__inline TCString Path_ToAbsolute(TCString &Path) -{ - CString Str; - Str.GetBuffer(MAX_PATH); - CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(const char*)TCHAR2ANSI(Path), (LPARAM)(char*)Str); - Str.ReleaseBuffer(); - return ANSI2TCHAR(Str); -} - - -__inline void ShowLog(TCString &LogFilePath) -{ - int Result = (int)ShellExecute(NULL, _T("open"), LogFilePath, NULL, NULL, SW_SHOW); - if (Result <= 32) // Error - { - TCHAR szError[64]; - mir_sntprintf(szError, lengthof(szError), TranslateT("Error #%d"), Result); - ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true); - } -} - - -__inline void RecompileRegexps(TCString IgnoreSubstrings) -{ - FreePcreCompileData(); - TCHAR *p = _tcstok(IgnoreSubstrings, _T(";")); - while (p) - { - CompileRegexp(p, p[0] != '/'); - p = _tcstok(NULL, _T(";")); - } -} diff --git a/plugins/ClientChangeNotify/OptDlg.cpp b/plugins/ClientChangeNotify/OptDlg.cpp deleted file mode 100644 index 164e51e795..0000000000 --- a/plugins/ClientChangeNotify/OptDlg.cpp +++ /dev/null @@ -1,215 +0,0 @@ -/* - ClientChangeNotify - Plugin for Miranda IM - Copyright (c) 2006-2008 Chervov Dmitry - - 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 -*/ - -#include "Common.h" -#include "Misc.h" - - -// ================================================ Popup options ================================================ - -COptPage g_PopupOptPage(MOD_NAME, NULL); - - -void EnablePopupOptDlgControls() -{ - int I; - g_PopupOptPage.PageToMem(); - int UsePopups = g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_POPUPNOTIFY); - for (I = 0; I < g_PopupOptPage.Items.GetSize(); I++) - { - switch (g_PopupOptPage.Items[I]->GetParam()) - { - case IDC_POPUPOPTDLG_POPUPNOTIFY: - { - g_PopupOptPage.Items[I]->Enable(UsePopups); - } break; - case IDC_POPUPOPTDLG_DEFBGCOLOUR: - { - g_PopupOptPage.Items[I]->Enable(UsePopups && !g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_DEFBGCOLOUR)); - } break; - case IDC_POPUPOPTDLG_DEFTEXTCOLOUR: - { - g_PopupOptPage.Items[I]->Enable(UsePopups && !g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_DEFTEXTCOLOUR)); - } break; - } - } - if (g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY)) - { - COptItem *ShowVer = g_PopupOptPage.Find(IDC_POPUPOPTDLG_SHOWVER); - ShowVer->SetValue(1); - ShowVer->Enable(false); - ShowVer->MemToWnd(g_PopupOptPage.hWnd); - } - if (!ServiceExists(MS_FP_SAMECLIENTS)) - { // disable these checkboxes if Fingerprint wasn't found - g_PopupOptPage.Find(IDC_POPUPOPTDLG_VERCHGNOTIFY)->Enable(false); - g_PopupOptPage.Find(IDC_POPUPOPTDLG_SHOWVER)->Enable(false); - } - if (PcreEnabled()) - { - SetDlgItemText(g_PopupOptPage.GetWnd(), IDC_POPUPOPTDLG_STATIC_REGEXP, TranslateT("(you can use regular expressions here)")); - } - g_PopupOptPage.MemToPage(true); - InvalidateRect(GetDlgItem(g_PopupOptPage.GetWnd(), IDC_POPUPOPTDLG_POPUPDELAY_SPIN), NULL, false); // update spin control -} - -static struct { - TCHAR *Text; - int Action; -} -PopupActions[] = -{ - LPGENT("Open message window"), PCA_OPENMESSAGEWND, - LPGENT("Close popup"), PCA_CLOSEPOPUP, - LPGENT("Open contact details window"), PCA_OPENDETAILS, - LPGENT("Open contact menu"), PCA_OPENMENU, - LPGENT("Open contact history"), PCA_OPENHISTORY, - LPGENT("Open log file"), PCA_OPENLOG, - LPGENT("Do nothing"), PCA_DONOTHING -}; - -INT_PTR CALLBACK PopupOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - static int ChangeLock = 0; - switch (msg) { - case WM_INITDIALOG: - { - TranslateDialogDefault(hwndDlg); - ChangeLock++; - g_PopupOptPage.SetWnd(hwndDlg); - SendDlgItemMessage(hwndDlg, IDC_POPUPOPTDLG_POPUPDELAY, EM_LIMITTEXT, 4, 0); - SendDlgItemMessage(hwndDlg, IDC_POPUPOPTDLG_IGNORESTRINGS, EM_LIMITTEXT, IGNORESTRINGS_MAX_LEN, 0); - SendDlgItemMessage(hwndDlg, IDC_POPUPOPTDLG_POPUPDELAY_SPIN, UDM_SETRANGE32, -1, 9999); - - HWND hLCombo = GetDlgItem(hwndDlg, IDC_POPUPOPTDLG_LCLICK_ACTION); - HWND hRCombo = GetDlgItem(hwndDlg, IDC_POPUPOPTDLG_RCLICK_ACTION); - int I; - for (I = 0; I < lengthof(PopupActions); I++) { - SendMessage(hLCombo, CB_SETITEMDATA, SendMessage(hLCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[I].Text)), PopupActions[I].Action); - SendMessage(hRCombo, CB_SETITEMDATA, SendMessage(hRCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[I].Text)), PopupActions[I].Action); - } - g_PopupOptPage.DBToMemToPage(); - EnablePopupOptDlgControls(); - ChangeLock--; - } - return true; - - case WM_NOTIFY: - switch (((NMHDR*)lParam)->code) { - case PSN_APPLY: - g_PopupOptPage.PageToMemToDB(); - RecompileRegexps(*(TCString*)g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_IGNORESTRINGS)); - return true; - } - break; - - case WM_COMMAND: - switch (HIWORD(wParam)) { - case BN_CLICKED: - switch (LOWORD(wParam)) { - case IDC_POPUPOPTDLG_POPUPNOTIFY: - case IDC_POPUPOPTDLG_DEFBGCOLOUR: - case IDC_POPUPOPTDLG_DEFTEXTCOLOUR: - case IDC_POPUPOPTDLG_VERCHGNOTIFY: - EnablePopupOptDlgControls(); - // go through - - case IDC_POPUPOPTDLG_SHOWPREVCLIENT: - case IDC_POPUPOPTDLG_SHOWVER: - case IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG: - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - return 0; - - case IDC_POPUPOPTDLG_POPUPPREVIEW: - g_PreviewOptPage = new COptPage(g_PopupOptPage); - g_PreviewOptPage->PageToMem(); - DBCONTACTWRITESETTING cws = {0}; - cws.szModule = "ICQ"; - cws.szSetting = DB_MIRVER; - DBWriteContactSettingString(NULL, MOD_NAME, DB_OLDMIRVER, "ICQ Lite v5"); - ContactSettingChanged(NULL, (LPARAM)&cws); // simulate a version change - delete g_PreviewOptPage; - g_PreviewOptPage = NULL; - break; - } - break; - - case EN_CHANGE: - if (LOWORD(wParam) == IDC_POPUPOPTDLG_POPUPDELAY || LOWORD(wParam) == IDC_POPUPOPTDLG_IGNORESTRINGS) - if (!ChangeLock && g_PopupOptPage.GetWnd()) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - - break; - - case CBN_SELCHANGE: - if ((LOWORD(wParam) == IDC_POPUPOPTDLG_LCLICK_ACTION) || (LOWORD(wParam) == IDC_POPUPOPTDLG_RCLICK_ACTION) || (LOWORD(wParam) == IDC_POPUPOPTDLG_BGCOLOUR) || (LOWORD(wParam) == IDC_POPUPOPTDLG_TEXTCOLOUR)) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); - - break; - } - break; - - case WM_DESTROY: - g_PopupOptPage.SetWnd(NULL); - return 0; - } - return 0; -} - -int OptionsDlgInit(WPARAM wParam, LPARAM lParam) -{ - OPTIONSDIALOGPAGE optDi = {0}; - optDi.cbSize = sizeof(optDi); - optDi.position = 920000000; - optDi.ptszTitle = LPGENT("ClientChangeNotify"); - optDi.pfnDlgProc = PopupOptDlg; - optDi.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPOPTDLG); - optDi.hInstance = g_hInstance; - optDi.ptszGroup = LPGENT("PopUps"); - optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; - Options_AddPage(wParam, &optDi); - return 0; -} - -void InitOptions() -{ - g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_POPUPNOTIFY, "PopupNotify", DBVT_BYTE, 1)); - g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_SHOWPREVCLIENT, "ShowPrevClient", DBVT_BYTE, 0, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_VERCHGNOTIFY, "VerChgNotify", DBVT_BYTE, 0, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_SHOWVER, "ShowVer", DBVT_BYTE, 1, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG, "UseStatusNotifyFlag", DBVT_BYTE, 1, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_POPUPPREVIEW, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Combobox(IDC_POPUPOPTDLG_LCLICK_ACTION, "PopupLClickAction", DBVT_BYTE, POPUP_DEF_LCLICKACTION, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Combobox(IDC_POPUPOPTDLG_RCLICK_ACTION, "PopupRClickAction", DBVT_BYTE, POPUP_DEF_RCLICKACTION, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_LCLICK, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_RCLICK, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Colourpicker(IDC_POPUPOPTDLG_BGCOLOUR, "PopupBGColour", POPUP_DEF_POPUP_BGCOLOUR, IDC_POPUPOPTDLG_DEFBGCOLOUR)); - g_PopupOptPage.Items.AddElem(new COptItem_Colourpicker(IDC_POPUPOPTDLG_TEXTCOLOUR, "PopupTextColour", POPUP_DEF_POPUP_TEXTCOLOUR, IDC_POPUPOPTDLG_DEFTEXTCOLOUR)); - g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_DEFBGCOLOUR, "UseDefBGColour", DBVT_BYTE, POPUP_DEF_USEDEFBGCOLOUR, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_DEFTEXTCOLOUR, "UseDefTextColour", DBVT_BYTE, POPUP_DEF_USEDEFTEXTCOLOUR, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_BGCOLOUR, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_TEXTCOLOUR, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_IntEdit(IDC_POPUPOPTDLG_POPUPDELAY, "PopupDelay", DBVT_WORD, true, POPUP_DEF_POPUPDELAY, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_SEC, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_DEFAULT, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_INFINITE, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_IGNORESTRINGS, IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Edit(IDC_POPUPOPTDLG_IGNORESTRINGS, DB_IGNORESUBSTRINGS, IGNORESTRINGS_MAX_LEN, _T("gmail;skype;/Miranda[0-9A-F]{8}/"), IDC_POPUPOPTDLG_POPUPNOTIFY)); - g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_REGEXP, IDC_POPUPOPTDLG_POPUPNOTIFY)); -} diff --git a/plugins/ClientChangeNotify/Resources.rc b/plugins/ClientChangeNotify/Resources.rc deleted file mode 100644 index f1f5ebd0a1..0000000000 --- a/plugins/ClientChangeNotify/Resources.rc +++ /dev/null @@ -1,202 +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 - -///////////////////////////////////////////////////////////////////////////// -// Russian resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) -#ifdef _WIN32 -LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT -#pragma code_page(1251) -#endif //_WIN32 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_CCN_ERROR DIALOGEX 0, 0, 187, 87 -STYLE DS_ABSALIGN | DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | - WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -CAPTION "ClientChangeNotify error" -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - DEFPUSHBUTTON "OK",IDOK,66,66,50,14 - CTEXT "Fingerprint plugin not found.",IDC_STATIC,0,12,186,8 - CTEXT "ClientChangeNotify requires it to work properly.", - IDC_STATIC,0,24,186,8 - CONTROL "Don't remind me anymore",IDC_DONTREMIND,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,12,48,174,10 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_CCN_ERROR, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 180 - TOPMARGIN, 7 - BOTTOMMARGIN, 80 - END -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 - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "LANGUAGE 9, 1\r\n" - "#pragma code_page(1252)\r\n" - "#include ""Resources.rc2"" // non-Microsoft Visual C++ edited resources\r\n" - "#endif\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_POPUPOPTDLG DIALOGEX 0, 0, 303, 207 -STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CONTROL | DS_CENTER | - WS_CHILD -FONT 8, "MS Shell Dlg", 400, 0, 0x1 -BEGIN - CONTROL "Enable notification",IDC_POPUPOPTDLG_POPUPNOTIFY,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,6,6,294,10 - CONTROL "Show previous client name", - IDC_POPUPOPTDLG_SHOWPREVCLIENT,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,6,18,294,10 - CONTROL "Notify also when just client version changes", - IDC_POPUPOPTDLG_VERCHGNOTIFY,"Button",BS_AUTOCHECKBOX | - WS_TABSTOP,6,30,170,10 - CONTROL "Show client version",IDC_POPUPOPTDLG_SHOWVER,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,180,30,120,10 - CONTROL "Don't notify for contacts with disabled status notification", - IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,6,42,294,10 - GROUPBOX "Click action",-1,6,56,216,54 - RTEXT "On left click",IDC_POPUPOPTDLG_STATIC_LCLICK,11,71,55,8 - COMBOBOX IDC_POPUPOPTDLG_LCLICK_ACTION,73,68,144,30, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - RTEXT "On right click",IDC_POPUPOPTDLG_STATIC_RCLICK,11,89,55, - 8 - COMBOBOX IDC_POPUPOPTDLG_RCLICK_ACTION,73,86,144,30, - CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - GROUPBOX "Delay",-1,229,56,66,54 - EDITTEXT IDC_POPUPOPTDLG_POPUPDELAY,234,68,32,12,ES_AUTOHSCROLL - CONTROL "",IDC_POPUPOPTDLG_POPUPDELAY_SPIN,"msctls_updown32", - UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | - UDS_ARROWKEYS | UDS_NOTHOUSANDS,254,68,10,12 - LTEXT "Sec",IDC_POPUPOPTDLG_STATIC_SEC,269,70,21,8 - CTEXT "0 = Default",IDC_POPUPOPTDLG_STATIC_DEFAULT,234,84,54,8 - CTEXT "-1 = Infinite",IDC_POPUPOPTDLG_STATIC_INFINITE,234,96, - 54,8 - GROUPBOX "Colours",-1,6,116,156,48 - CONTROL "",IDC_POPUPOPTDLG_BGCOLOUR,"ColourPicker",WS_TABSTOP,13, - 128,19,12 - LTEXT "Background",IDC_POPUPOPTDLG_STATIC_BGCOLOUR,37,131,53,8 - CONTROL "Use default",IDC_POPUPOPTDLG_DEFBGCOLOUR,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,96,131,60,10 - CONTROL "",IDC_POPUPOPTDLG_TEXTCOLOUR,"ColourPicker",WS_TABSTOP, - 13,146,19,12 - LTEXT "Text",IDC_POPUPOPTDLG_STATIC_TEXTCOLOUR,37,149,53,8 - CONTROL "Use default",IDC_POPUPOPTDLG_DEFTEXTCOLOUR,"Button", - BS_AUTOCHECKBOX | WS_TABSTOP,96,149,60,10 - PUSHBUTTON "Preview",IDC_POPUPOPTDLG_POPUPPREVIEW,210,134,48,14 - LTEXT "Ignore these clients (separated by semicolons):", - IDC_POPUPOPTDLG_STATIC_IGNORESTRINGS,6,168,294,8 - EDITTEXT IDC_POPUPOPTDLG_IGNORESTRINGS,6,180,288,14, - ES_AUTOHSCROLL - CTEXT "(you have to install pcre.dll or pcre3.dll to use regular expressions here)", - IDC_POPUPOPTDLG_STATIC_REGEXP,0,195,294,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_POPUPOPTDLG, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 296 - TOPMARGIN, 7 - BOTTOMMARGIN, 200 - END -END -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE 9, 1 -#pragma code_page(1252) -#include "Resources.rc2" // non-Microsoft Visual C++ edited resources -#endif - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/ClientChangeNotify/Resources.rc2 b/plugins/ClientChangeNotify/Resources.rc2 deleted file mode 100644 index 7a6a4c4a18..0000000000 --- a/plugins/ClientChangeNotify/Resources.rc2 +++ /dev/null @@ -1,50 +0,0 @@ -// -// RESOURCES.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 - - -///////////////////////////////////////////////////////////////////////////// -// Add manually edited resources here... - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// -#include "VersionNo.h" -VS_VERSION_INFO VERSIONINFO - FILEVERSION __FILEVERSION_STRING - PRODUCTVERSION __FILEVERSION_STRING - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x21L -#else - FILEFLAGS 0x20L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "Deathdemon" - VALUE "FileDescription", "ClientChangeNotify plugin for Miranda IM." - VALUE "LegalCopyright", "© 2006-2008 Chervov Dmitry" - VALUE "InternalName", "ClientChangeNotify" - VALUE "OriginalFilename", "ClientChangeNotifyW.dll" - VALUE "ProductName", "ClientChangeNotify (Unicode)" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -///////////////////////////////////////////////////////////////////////////// diff --git a/plugins/ClientChangeNotify/VersionNo.h b/plugins/ClientChangeNotify/VersionNo.h deleted file mode 100644 index 13ba7afb9f..0000000000 --- a/plugins/ClientChangeNotify/VersionNo.h +++ /dev/null @@ -1,11 +0,0 @@ -#define __MAJOR_VERSION 0 -#define __MINOR_VERSION 1 -#define __RELEASE_NUM 1 -#define __BUILD_NUM 3 - -#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) diff --git a/plugins/ClientChangeNotify/ccn_readme.txt b/plugins/ClientChangeNotify/ccn_readme.txt deleted file mode 100644 index a365ce067c..0000000000 --- a/plugins/ClientChangeNotify/ccn_readme.txt +++ /dev/null @@ -1,81 +0,0 @@ -ClientChangeNotify plugin for Miranda IM. -(c) Chervov Dmitry aka Deathdemon. - -This plugin shows a notification when someone in your contact list changes his client. -It requires Popup or YAPP plugin. - -"Ignore these clients" setting is a list of substrings separated by semicolons; if ClientChangeNotify finds one of these substrings in a new client name, it doesn't show the notification. -Also it's possible to use regular expressions, but it requires pcre.dll or pcre3.dll in your miranda directory. -PCRE is available from http://www.pcre.org/ (Binaries for Windows are here: http://gnuwin32.sourceforge.net/downlinks/pcre-bin-zip.php ) -When PCRE library is installed successfully, ClientChangeNotify will show "you can use regular expressions here" under the "Ignore these clients" field in the options. - -Regular expressions are detected by '/' symbol at the start of the substring. The same symbol must be at the end of the substring, possibly followed by pattern modifier characters. I.e. "gmail;/[0-9A-F]{8}(\W|$)/i;skype" has two usual substrings and one regexp substring with an "i" modifier (caseless). - -There are several solutions to filter jgmail client changes: -1) Disable notification about client version changes -(Miranda options -> Popups -> ClientChangeNotify -> "Notify also when just client version changes" checkbox, turn it off). -This solution is somewhat easier, but ClientChangeNotify won't notify you of any client version changes. -2) Disable client change notifications for separate contacts -3) Install PCRE library (see the download link above), and make sure that substring "/[0-9A-F]{8}(\W|$)/" is present in the "Ignore these clients" field of the ClientChangeNotify options. If the substring is not there, add it. -This solution is the most correct. - -ClientChangeNotify supports per-contact notification setting. There are two ways to use it: either by using ContactSettings plugin that adds a GUI to easily modify this setting, or by modifying the database directly: -Contact/ClientChangeNotify/Notify (BYTE) = - 0 - completely disable notifications for this contact - 1 - show notifications always, except when ClientChangeNotify popups are turned off - 2 - show notifications always, even when ClientChangeNotify popups are turned off - 3 (default) - use global settings (the plugin will examine the following two checkboxes before deciding whether to show the notification: "Notify also when just client version changes" and "Don't notify for contacts with disabled status notification") - -Changelog -========= - -v0.1.1.2 (build 61; Jan 12, 2008) --------- - - workaround for contact lists bug with multiple submenu items when using a localization file - -v0.1.1.1 (build 60; Jan 2, 2008) --------- - - added an item to the Popups submenu of the main menu to toggle client change notifications - - fixed regexp to ignore jgmail clients - - improved pcre library detection - - changed notification text formatting - - changes in ContactSettings API - -v0.1.1.0 (build 54; Sep 17, 2007) --------- - - added support for Miranda 0.8. CCN interface is {E9D1F0D4-D65D-4840-87BD-59D7B4702C47} - - moved logging features to a separate plugin - LogService - - added possibility to ignore certain clients, also using regular expressions - - added per-contact setting to turn notifications on/off, and support for ContactSettings plugin - - some other minor improvements - -v0.1.0.9 (build 29; Jul 3, 2006) --------- - - fixed non-working preview on some profiles - - fix to log unique ID of every protocol, not only ICQ UIN - -v0.1.0.8 (build 27; Jul 2, 2006) --------- - - disabled notification for new contacts - - implemented unicode logging correctly - -v0.1.0.7 (build 24; May 2, 2006) --------- - - unicode support - - some minor fixes - -v0.1.0.6 (build 22; Apr 15, 2006) --------- - - fixed disappearing client icons in popups - -v0.1.0.5 (build 18; Apr 15, 2006) --------- - - fixed a crash with some "unusual" clients - -v0.1.0.4 (build 17; Apr 14, 2006) --------- - - Added a check whether Fingerprint plugin is installed or not. Now ClientChangeNotify can work without it, but with a limited functionality. It's still highly recommended to install Fingerprint. - -v0.1.0.2 (build 15; Apr 14, 2006) --------- - - First public release. \ No newline at end of file diff --git a/plugins/ClientChangeNotify/ccn_translation.txt b/plugins/ClientChangeNotify/ccn_translation.txt deleted file mode 100644 index b58634963d..0000000000 --- a/plugins/ClientChangeNotify/ccn_translation.txt +++ /dev/null @@ -1,69 +0,0 @@ -Miranda Language Pack Version 1 -Locale: 0809 -Authors: Deathdemon -Author-email: dchervov@yahoo.com -Last-Modified-Using: Miranda IM 0.7svn -Plugins-included: ClientChangeNotify -; Generated by lpgen on Sat Jan 12 20:13:17 2008 -; Translations: 51 - -; Common strings that belong to many files -;[ClientChangeNotify] -;[PopUps] - -; C:/VSProjects/Miranda/plugins/ClientChangeNotify/ClientChangeNotify.cpp -;[%s (was %s)] -;[) changed client to ] -;[Always except when client change notifications are disabled globally] -;[Always, even when client change notifications are disabled globally] -;[Client change notifications:] -;[ClientChangeNotify (Unicode)] -;[ClientChangeNotify: Client changed] -;[Disable c&lient change notification] -;[Enable c&lient change notification] -;[Never, ignore client changes for this contact] -;[The unicode version of ClientChangeNotify plugin requires db3x plugin version 0.5.1.0 or later] -;[Use global settings (default)] -;[`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%] -;[changed client to %s] -;[changed client to %s (was %s)] - -; C:/VSProjects/Miranda/plugins/ClientChangeNotify/Misc.h -;[Can't open log file ] -;[Error #%d] - -; C:/VSProjects/Miranda/plugins/ClientChangeNotify/OptDlg.cpp -;[(you can use regular expressions here)] -;[Close popup] -;[Do nothing] -;[Open contact details window] -;[Open contact history] -;[Open contact menu] -;[Open log file] -;[Open message window] - -; C:/VSProjects/Miranda/plugins/ClientChangeNotify/Resources.rc -;[(you have to install pcre.dll or pcre3.dll to use regular expressions here)] -;[-1 = Infinite] -;[0 = Default] -;[Background] -;[Click action] -;[ClientChangeNotify error] -;[ClientChangeNotify requires it to work properly.] -;[Colours] -;[Delay] -;[Don't notify for contacts with disabled status notification] -;[Don't remind me anymore] -;[Enable notification] -;[Fingerprint plugin not found.] -;[Ignore these clients (separated by semicolons):] -;[Notify also when just client version changes] -;[OK] -;[On left click] -;[On right click] -;[Preview] -;[Sec] -;[Show client version] -;[Show previous client name] -;[Text] -;[Use default] diff --git a/plugins/ClientChangeNotify/clientchangenotify-translation.txt b/plugins/ClientChangeNotify/clientchangenotify-translation.txt deleted file mode 100644 index 10d2bee431..0000000000 --- a/plugins/ClientChangeNotify/clientchangenotify-translation.txt +++ /dev/null @@ -1,58 +0,0 @@ -; Common strings that belong to many files -;[ClientChangeNotify] -;[PopUps] - -; ../../plugins/ClientChangeNotify/ClientChangeNotify.cpp -;[%s (was %s)] -;[) changed client to ] -;[Always except when client change notifications are disabled globally] -;[Always, even when client change notifications are disabled globally] -;[Client change notifications:] -;[ClientChangeNotify: Client changed] -;[Disable c&lient change notification] -;[Enable c&lient change notification] -;[Never, ignore client changes for this contact] -;[Use global settings (default)] -;[`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%] -;[changed client to %s] -;[changed client to %s (was %s)] - -; ../../plugins/ClientChangeNotify/Misc.h -;[Can't open log file ] -;[Error #%d] - -; ../../plugins/ClientChangeNotify/OptDlg.cpp -;[(you can use regular expressions here)] -;[Close popup] -;[Do nothing] -;[Open contact details window] -;[Open contact history] -;[Open contact menu] -;[Open log file] -;[Open message window] - -; ../../plugins/ClientChangeNotify/Resources.rc -;[(you have to install pcre.dll or pcre3.dll to use regular expressions here)] -;[-1 = Infinite] -;[0 = Default] -;[Background] -;[Click action] -;[ClientChangeNotify error] -;[ClientChangeNotify requires it to work properly.] -;[Colours] -;[Delay] -;[Don't notify for contacts with disabled status notification] -;[Don't remind me anymore] -;[Enable notification] -;[Fingerprint plugin not found.] -;[Ignore these clients (separated by semicolons):] -;[Notify also when just client version changes] -;[OK] -;[On left click] -;[On right click] -;[Preview] -;[Sec] -;[Show client version] -;[Show previous client name] -;[Text] -;[Use default] diff --git a/plugins/ClientChangeNotify/copying.txt b/plugins/ClientChangeNotify/copying.txt deleted file mode 100644 index 45645b4b53..0000000000 --- a/plugins/ClientChangeNotify/copying.txt +++ /dev/null @@ -1,340 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 2, June 1991 - - Copyright (C) 1989, 1991 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -License is intended to guarantee your freedom to share and change free -software--to make sure the software is free for all its users. This -General Public License applies to most of the Free Software -Foundation's software and to any other program whose authors commit to -using it. (Some other Free Software Foundation software is covered by -the GNU Library General Public License instead.) You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -this service if you wish), that you receive source code or can get it -if you want it, that you can change the software or use pieces of it -in new free programs; and that you know you can do these things. - - To protect your rights, we need to make restrictions that forbid -anyone to deny you these rights or to ask you to surrender the rights. -These restrictions translate to certain responsibilities for you if you -distribute copies of the software, or if you modify it. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must give the recipients all the rights that -you have. You must make sure that they, too, receive or can get the -source code. And you must show them these terms so they know their -rights. - - We protect your rights with two steps: (1) copyright the software, and -(2) offer you this license which gives you legal permission to copy, -distribute and/or modify the software. - - Also, for each author's protection and ours, we want to make certain -that everyone understands that there is no warranty for this free -software. If the software is modified by someone else and passed on, we -want its recipients to know that what they have is not the original, so -that any problems introduced by others will not reflect on the original -authors' reputations. - - Finally, any free program is threatened constantly by software -patents. We wish to avoid the danger that redistributors of a free -program will individually obtain patent licenses, in effect making the -program proprietary. To prevent this, we have made it clear that any -patent must be licensed for everyone's free use or not licensed at all. - - The precise terms and conditions for copying, distribution and -modification follow. - - GNU GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License applies to any program or other work which contains -a notice placed by the copyright holder saying it may be distributed -under the terms of this General Public License. The "Program", below, -refers to any such program or work, and a "work based on the Program" -means either the Program or any derivative work under copyright law: -that is to say, a work containing the Program or a portion of it, -either verbatim or with modifications and/or translated into another -language. (Hereinafter, translation is included without limitation in -the term "modification".) Each licensee is addressed as "you". - -Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running the Program is not restricted, and the output from the Program -is covered only if its contents constitute a work based on the -Program (independent of having been made by running the Program). -Whether that is true depends on what the Program does. - - 1. You may copy and distribute verbatim copies of the Program's -source code as you receive it, in any medium, provided that you -conspicuously and appropriately publish on each copy an appropriate -copyright notice and disclaimer of warranty; keep intact all the -notices that refer to this License and to the absence of any warranty; -and give any other recipients of the Program a copy of this License -along with the Program. - -You may charge a fee for the physical act of transferring a copy, and -you may at your option offer warranty protection in exchange for a fee. - - 2. You may modify your copy or copies of the Program or any portion -of it, thus forming a work based on the Program, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) You must cause the modified files to carry prominent notices - stating that you changed the files and the date of any change. - - b) You must cause any work that you distribute or publish, that in - whole or in part contains or is derived from the Program or any - part thereof, to be licensed as a whole at no charge to all third - parties under the terms of this License. - - c) If the modified program normally reads commands interactively - when run, you must cause it, when started running for such - interactive use in the most ordinary way, to print or display an - announcement including an appropriate copyright notice and a - notice that there is no warranty (or else, saying that you provide - a warranty) and that users may redistribute the program under - these conditions, and telling the user how to view a copy of this - License. (Exception: if the Program itself is interactive but - does not normally print such an announcement, your work based on - the Program is not required to print an announcement.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Program, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Program, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Program. - -In addition, mere aggregation of another work not based on the Program -with the Program (or with a work based on the Program) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may copy and distribute the Program (or a work based on it, -under Section 2) in object code or executable form under the terms of -Sections 1 and 2 above provided that you also do one of the following: - - a) Accompany it with the complete corresponding machine-readable - source code, which must be distributed under the terms of Sections - 1 and 2 above on a medium customarily used for software interchange; or, - - b) Accompany it with a written offer, valid for at least three - years, to give any third party, for a charge no more than your - cost of physically performing source distribution, a complete - machine-readable copy of the corresponding source code, to be - distributed under the terms of Sections 1 and 2 above on a medium - customarily used for software interchange; or, - - c) Accompany it with the information you received as to the offer - to distribute corresponding source code. (This alternative is - allowed only for noncommercial distribution and only if you - received the program in object code or executable form with such - an offer, in accord with Subsection b above.) - -The source code for a work means the preferred form of the work for -making modifications to it. For an executable work, complete source -code means all the source code for all modules it contains, plus any -associated interface definition files, plus the scripts used to -control compilation and installation of the executable. However, as a -special exception, the source code distributed need not include -anything that is normally distributed (in either source or binary -form) with the major components (compiler, kernel, and so on) of the -operating system on which the executable runs, unless that component -itself accompanies the executable. - -If distribution of executable or object code is made by offering -access to copy from a designated place, then offering equivalent -access to copy the source code from the same place counts as -distribution of the source code, even though third parties are not -compelled to copy the source along with the object code. - - 4. You may not copy, modify, sublicense, or distribute the Program -except as expressly provided under this License. Any attempt -otherwise to copy, modify, sublicense or distribute the Program is -void, and will automatically terminate your rights under this License. -However, parties who have received copies, or rights, from you under -this License will not have their licenses terminated so long as such -parties remain in full compliance. - - 5. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Program or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Program (or any work based on the -Program), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Program or works based on it. - - 6. Each time you redistribute the Program (or any work based on the -Program), the recipient automatically receives a license from the -original licensor to copy, distribute or modify the Program subject to -these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties to -this License. - - 7. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Program at all. For example, if a patent -license would not permit royalty-free redistribution of the Program by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Program. - -If any portion of this section is held invalid or unenforceable under -any particular circumstance, the balance of the section is intended to -apply and the section as a whole is intended to apply in other -circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system, which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 8. If the distribution and/or use of the Program is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Program under this License -may add an explicit geographical distribution limitation excluding -those countries, so that distribution is permitted only in or among -countries not thus excluded. In such case, this License incorporates -the limitation as if written in the body of this License. - - 9. The Free Software Foundation may publish revised and/or new versions -of the General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - -Each version is given a distinguishing version number. If the Program -specifies a version number of this License which applies to it and "any -later version", you have the option of following the terms and conditions -either of that version or of any later version published by the Free -Software Foundation. If the Program does not specify a version number of -this License, you may choose any version ever published by the Free Software -Foundation. - - 10. If you wish to incorporate parts of the Program into other free -programs whose distribution conditions are different, write to the author -to ask for permission. For software which is copyrighted by the Free -Software Foundation, write to the Free Software Foundation; we sometimes -make exceptions for this. Our decision will be guided by the two goals -of preserving the free status of all derivatives of our free software and -of promoting the sharing and reuse of software generally. - - NO WARRANTY - - 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -REPAIR OR CORRECTION. - - 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -POSSIBILITY OF SUCH DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - 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 - - -Also add information on how to contact you by electronic and paper mail. - -If the program is interactive, make it output a short notice like this -when it starts in an interactive mode: - - Gnomovision version 69, Copyright (C) year name of author - Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, the commands you use may -be called something other than `show w' and `show c'; they could even be -mouse-clicks or menu items--whatever suits your program. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the program, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the program - `Gnomovision' (which makes passes at compilers) written by James Hacker. - - , 1 April 1989 - Ty Coon, President of Vice - -This General Public License does not permit incorporating your program into -proprietary programs. If your program is a subroutine library, you may -consider it more useful to permit linking proprietary applications with the -library. If this is what you want to do, use the GNU Library General -Public License instead of this License. diff --git a/plugins/ClientChangeNotify/docs/ccn_readme.txt b/plugins/ClientChangeNotify/docs/ccn_readme.txt new file mode 100644 index 0000000000..a365ce067c --- /dev/null +++ b/plugins/ClientChangeNotify/docs/ccn_readme.txt @@ -0,0 +1,81 @@ +ClientChangeNotify plugin for Miranda IM. +(c) Chervov Dmitry aka Deathdemon. + +This plugin shows a notification when someone in your contact list changes his client. +It requires Popup or YAPP plugin. + +"Ignore these clients" setting is a list of substrings separated by semicolons; if ClientChangeNotify finds one of these substrings in a new client name, it doesn't show the notification. +Also it's possible to use regular expressions, but it requires pcre.dll or pcre3.dll in your miranda directory. +PCRE is available from http://www.pcre.org/ (Binaries for Windows are here: http://gnuwin32.sourceforge.net/downlinks/pcre-bin-zip.php ) +When PCRE library is installed successfully, ClientChangeNotify will show "you can use regular expressions here" under the "Ignore these clients" field in the options. + +Regular expressions are detected by '/' symbol at the start of the substring. The same symbol must be at the end of the substring, possibly followed by pattern modifier characters. I.e. "gmail;/[0-9A-F]{8}(\W|$)/i;skype" has two usual substrings and one regexp substring with an "i" modifier (caseless). + +There are several solutions to filter jgmail client changes: +1) Disable notification about client version changes +(Miranda options -> Popups -> ClientChangeNotify -> "Notify also when just client version changes" checkbox, turn it off). +This solution is somewhat easier, but ClientChangeNotify won't notify you of any client version changes. +2) Disable client change notifications for separate contacts +3) Install PCRE library (see the download link above), and make sure that substring "/[0-9A-F]{8}(\W|$)/" is present in the "Ignore these clients" field of the ClientChangeNotify options. If the substring is not there, add it. +This solution is the most correct. + +ClientChangeNotify supports per-contact notification setting. There are two ways to use it: either by using ContactSettings plugin that adds a GUI to easily modify this setting, or by modifying the database directly: +Contact/ClientChangeNotify/Notify (BYTE) = + 0 - completely disable notifications for this contact + 1 - show notifications always, except when ClientChangeNotify popups are turned off + 2 - show notifications always, even when ClientChangeNotify popups are turned off + 3 (default) - use global settings (the plugin will examine the following two checkboxes before deciding whether to show the notification: "Notify also when just client version changes" and "Don't notify for contacts with disabled status notification") + +Changelog +========= + +v0.1.1.2 (build 61; Jan 12, 2008) +-------- + - workaround for contact lists bug with multiple submenu items when using a localization file + +v0.1.1.1 (build 60; Jan 2, 2008) +-------- + - added an item to the Popups submenu of the main menu to toggle client change notifications + - fixed regexp to ignore jgmail clients + - improved pcre library detection + - changed notification text formatting + - changes in ContactSettings API + +v0.1.1.0 (build 54; Sep 17, 2007) +-------- + - added support for Miranda 0.8. CCN interface is {E9D1F0D4-D65D-4840-87BD-59D7B4702C47} + - moved logging features to a separate plugin - LogService + - added possibility to ignore certain clients, also using regular expressions + - added per-contact setting to turn notifications on/off, and support for ContactSettings plugin + - some other minor improvements + +v0.1.0.9 (build 29; Jul 3, 2006) +-------- + - fixed non-working preview on some profiles + - fix to log unique ID of every protocol, not only ICQ UIN + +v0.1.0.8 (build 27; Jul 2, 2006) +-------- + - disabled notification for new contacts + - implemented unicode logging correctly + +v0.1.0.7 (build 24; May 2, 2006) +-------- + - unicode support + - some minor fixes + +v0.1.0.6 (build 22; Apr 15, 2006) +-------- + - fixed disappearing client icons in popups + +v0.1.0.5 (build 18; Apr 15, 2006) +-------- + - fixed a crash with some "unusual" clients + +v0.1.0.4 (build 17; Apr 14, 2006) +-------- + - Added a check whether Fingerprint plugin is installed or not. Now ClientChangeNotify can work without it, but with a limited functionality. It's still highly recommended to install Fingerprint. + +v0.1.0.2 (build 15; Apr 14, 2006) +-------- + - First public release. \ No newline at end of file diff --git a/plugins/ClientChangeNotify/docs/ccn_translation.txt b/plugins/ClientChangeNotify/docs/ccn_translation.txt new file mode 100644 index 0000000000..b58634963d --- /dev/null +++ b/plugins/ClientChangeNotify/docs/ccn_translation.txt @@ -0,0 +1,69 @@ +Miranda Language Pack Version 1 +Locale: 0809 +Authors: Deathdemon +Author-email: dchervov@yahoo.com +Last-Modified-Using: Miranda IM 0.7svn +Plugins-included: ClientChangeNotify +; Generated by lpgen on Sat Jan 12 20:13:17 2008 +; Translations: 51 + +; Common strings that belong to many files +;[ClientChangeNotify] +;[PopUps] + +; C:/VSProjects/Miranda/plugins/ClientChangeNotify/ClientChangeNotify.cpp +;[%s (was %s)] +;[) changed client to ] +;[Always except when client change notifications are disabled globally] +;[Always, even when client change notifications are disabled globally] +;[Client change notifications:] +;[ClientChangeNotify (Unicode)] +;[ClientChangeNotify: Client changed] +;[Disable c&lient change notification] +;[Enable c&lient change notification] +;[Never, ignore client changes for this contact] +;[The unicode version of ClientChangeNotify plugin requires db3x plugin version 0.5.1.0 or later] +;[Use global settings (default)] +;[`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%] +;[changed client to %s] +;[changed client to %s (was %s)] + +; C:/VSProjects/Miranda/plugins/ClientChangeNotify/Misc.h +;[Can't open log file ] +;[Error #%d] + +; C:/VSProjects/Miranda/plugins/ClientChangeNotify/OptDlg.cpp +;[(you can use regular expressions here)] +;[Close popup] +;[Do nothing] +;[Open contact details window] +;[Open contact history] +;[Open contact menu] +;[Open log file] +;[Open message window] + +; C:/VSProjects/Miranda/plugins/ClientChangeNotify/Resources.rc +;[(you have to install pcre.dll or pcre3.dll to use regular expressions here)] +;[-1 = Infinite] +;[0 = Default] +;[Background] +;[Click action] +;[ClientChangeNotify error] +;[ClientChangeNotify requires it to work properly.] +;[Colours] +;[Delay] +;[Don't notify for contacts with disabled status notification] +;[Don't remind me anymore] +;[Enable notification] +;[Fingerprint plugin not found.] +;[Ignore these clients (separated by semicolons):] +;[Notify also when just client version changes] +;[OK] +;[On left click] +;[On right click] +;[Preview] +;[Sec] +;[Show client version] +;[Show previous client name] +;[Text] +;[Use default] diff --git a/plugins/ClientChangeNotify/docs/clientchangenotify-translation.txt b/plugins/ClientChangeNotify/docs/clientchangenotify-translation.txt new file mode 100644 index 0000000000..10d2bee431 --- /dev/null +++ b/plugins/ClientChangeNotify/docs/clientchangenotify-translation.txt @@ -0,0 +1,58 @@ +; Common strings that belong to many files +;[ClientChangeNotify] +;[PopUps] + +; ../../plugins/ClientChangeNotify/ClientChangeNotify.cpp +;[%s (was %s)] +;[) changed client to ] +;[Always except when client change notifications are disabled globally] +;[Always, even when client change notifications are disabled globally] +;[Client change notifications:] +;[ClientChangeNotify: Client changed] +;[Disable c&lient change notification] +;[Enable c&lient change notification] +;[Never, ignore client changes for this contact] +;[Use global settings (default)] +;[`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%] +;[changed client to %s] +;[changed client to %s (was %s)] + +; ../../plugins/ClientChangeNotify/Misc.h +;[Can't open log file ] +;[Error #%d] + +; ../../plugins/ClientChangeNotify/OptDlg.cpp +;[(you can use regular expressions here)] +;[Close popup] +;[Do nothing] +;[Open contact details window] +;[Open contact history] +;[Open contact menu] +;[Open log file] +;[Open message window] + +; ../../plugins/ClientChangeNotify/Resources.rc +;[(you have to install pcre.dll or pcre3.dll to use regular expressions here)] +;[-1 = Infinite] +;[0 = Default] +;[Background] +;[Click action] +;[ClientChangeNotify error] +;[ClientChangeNotify requires it to work properly.] +;[Colours] +;[Delay] +;[Don't notify for contacts with disabled status notification] +;[Don't remind me anymore] +;[Enable notification] +;[Fingerprint plugin not found.] +;[Ignore these clients (separated by semicolons):] +;[Notify also when just client version changes] +;[OK] +;[On left click] +;[On right click] +;[Preview] +;[Sec] +;[Show client version] +;[Show previous client name] +;[Text] +;[Use default] diff --git a/plugins/ClientChangeNotify/docs/copying.txt b/plugins/ClientChangeNotify/docs/copying.txt new file mode 100644 index 0000000000..45645b4b53 --- /dev/null +++ b/plugins/ClientChangeNotify/docs/copying.txt @@ -0,0 +1,340 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + 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 + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/plugins/ClientChangeNotify/res/Resources.rc b/plugins/ClientChangeNotify/res/Resources.rc new file mode 100644 index 0000000000..2f76a307d9 --- /dev/null +++ b/plugins/ClientChangeNotify/res/Resources.rc @@ -0,0 +1,202 @@ +// 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 + +///////////////////////////////////////////////////////////////////////////// +// Russian resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS) +#ifdef _WIN32 +LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT +#pragma code_page(1251) +#endif //_WIN32 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_CCN_ERROR DIALOGEX 0, 0, 187, 87 +STYLE DS_ABSALIGN | DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | DS_CENTER | + WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +CAPTION "ClientChangeNotify error" +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + DEFPUSHBUTTON "OK",IDOK,66,66,50,14 + CTEXT "Fingerprint plugin not found.",IDC_STATIC,0,12,186,8 + CTEXT "ClientChangeNotify requires it to work properly.", + IDC_STATIC,0,24,186,8 + CONTROL "Don't remind me anymore",IDC_DONTREMIND,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,12,48,174,10 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_CCN_ERROR, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 180 + TOPMARGIN, 7 + BOTTOMMARGIN, 80 + END +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 + +#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 + "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" + "LANGUAGE 9, 1\r\n" + "#pragma code_page(1252)\r\n" + "#include ""Resources.rc2"" // non-Microsoft Visual C++ edited resources\r\n" + "#endif\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_POPUPOPTDLG DIALOGEX 0, 0, 303, 207 +STYLE DS_SETFONT | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CONTROL | DS_CENTER | + WS_CHILD +FONT 8, "MS Shell Dlg", 400, 0, 0x1 +BEGIN + CONTROL "Enable notification",IDC_POPUPOPTDLG_POPUPNOTIFY,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,6,6,294,10 + CONTROL "Show previous client name", + IDC_POPUPOPTDLG_SHOWPREVCLIENT,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,6,18,294,10 + CONTROL "Notify also when just client version changes", + IDC_POPUPOPTDLG_VERCHGNOTIFY,"Button",BS_AUTOCHECKBOX | + WS_TABSTOP,6,30,170,10 + CONTROL "Show client version",IDC_POPUPOPTDLG_SHOWVER,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,180,30,120,10 + CONTROL "Don't notify for contacts with disabled status notification", + IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,6,42,294,10 + GROUPBOX "Click action",-1,6,56,216,54 + RTEXT "On left click",IDC_POPUPOPTDLG_STATIC_LCLICK,11,71,55,8 + COMBOBOX IDC_POPUPOPTDLG_LCLICK_ACTION,73,68,144,30, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + RTEXT "On right click",IDC_POPUPOPTDLG_STATIC_RCLICK,11,89,55, + 8 + COMBOBOX IDC_POPUPOPTDLG_RCLICK_ACTION,73,86,144,30, + CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + GROUPBOX "Delay",-1,229,56,66,54 + EDITTEXT IDC_POPUPOPTDLG_POPUPDELAY,234,68,32,12,ES_AUTOHSCROLL + CONTROL "",IDC_POPUPOPTDLG_POPUPDELAY_SPIN,"msctls_updown32", + UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | + UDS_ARROWKEYS | UDS_NOTHOUSANDS,254,68,10,12 + LTEXT "Sec",IDC_POPUPOPTDLG_STATIC_SEC,269,70,21,8 + CTEXT "0 = Default",IDC_POPUPOPTDLG_STATIC_DEFAULT,234,84,54,8 + CTEXT "-1 = Infinite",IDC_POPUPOPTDLG_STATIC_INFINITE,234,96, + 54,8 + GROUPBOX "Colours",-1,6,116,156,48 + CONTROL "",IDC_POPUPOPTDLG_BGCOLOUR,"ColourPicker",WS_TABSTOP,13, + 128,19,12 + LTEXT "Background",IDC_POPUPOPTDLG_STATIC_BGCOLOUR,37,131,53,8 + CONTROL "Use default",IDC_POPUPOPTDLG_DEFBGCOLOUR,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,96,131,60,10 + CONTROL "",IDC_POPUPOPTDLG_TEXTCOLOUR,"ColourPicker",WS_TABSTOP, + 13,146,19,12 + LTEXT "Text",IDC_POPUPOPTDLG_STATIC_TEXTCOLOUR,37,149,53,8 + CONTROL "Use default",IDC_POPUPOPTDLG_DEFTEXTCOLOUR,"Button", + BS_AUTOCHECKBOX | WS_TABSTOP,96,149,60,10 + PUSHBUTTON "Preview",IDC_POPUPOPTDLG_POPUPPREVIEW,210,134,48,14 + LTEXT "Ignore these clients (separated by semicolons):", + IDC_POPUPOPTDLG_STATIC_IGNORESTRINGS,6,168,294,8 + EDITTEXT IDC_POPUPOPTDLG_IGNORESTRINGS,6,180,288,14, + ES_AUTOHSCROLL + CTEXT "(you have to install pcre.dll or pcre3.dll to use regular expressions here)", + IDC_POPUPOPTDLG_STATIC_REGEXP,0,195,294,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_POPUPOPTDLG, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 296 + TOPMARGIN, 7 + BOTTOMMARGIN, 200 + END +END +#endif // APSTUDIO_INVOKED + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) +LANGUAGE 9, 1 +#pragma code_page(1252) +#include "Resources.rc2" // non-Microsoft Visual C++ edited resources +#endif + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/plugins/ClientChangeNotify/res/Resources.rc2 b/plugins/ClientChangeNotify/res/Resources.rc2 new file mode 100644 index 0000000000..ecb7a2de3a --- /dev/null +++ b/plugins/ClientChangeNotify/res/Resources.rc2 @@ -0,0 +1,50 @@ +// +// RESOURCES.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 + + +///////////////////////////////////////////////////////////////////////////// +// Add manually edited resources here... + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// +#include "..\src\VersionNo.h" +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x21L +#else + FILEFLAGS 0x20L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "CompanyName", "Deathdemon" + VALUE "FileDescription", "ClientChangeNotify plugin for Miranda IM." + VALUE "LegalCopyright", "© 2006-2008 Chervov Dmitry" + VALUE "InternalName", "ClientChangeNotify" + VALUE "OriginalFilename", "ClientChangeNotifyW.dll" + VALUE "ProductName", "ClientChangeNotify (Unicode)" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +///////////////////////////////////////////////////////////////////////////// diff --git a/plugins/ClientChangeNotify/resource.h b/plugins/ClientChangeNotify/resource.h deleted file mode 100644 index e9a86ee449..0000000000 --- a/plugins/ClientChangeNotify/resource.h +++ /dev/null @@ -1,42 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Resources.rc -// -#define IDD_POPUPOPTDLG 101 -#define IDD_CCN_ERROR 103 -#define IDC_POPUPOPTDLG_POPUPNOTIFY 1002 -#define IDC_POPUPOPTDLG_BGCOLOUR 1003 -#define IDC_POPUPOPTDLG_TEXTCOLOUR 1004 -#define IDC_POPUPOPTDLG_LCLICK_ACTION 1005 -#define IDC_POPUPOPTDLG_RCLICK_ACTION 1006 -#define IDC_POPUPOPTDLG_POPUPPREVIEW 1007 -#define IDC_POPUPOPTDLG_DEFBGCOLOUR 1013 -#define IDC_POPUPOPTDLG_DEFTEXTCOLOUR 1014 -#define IDC_POPUPOPTDLG_STATIC_LCLICK 1016 -#define IDC_POPUPOPTDLG_STATIC_RCLICK 1017 -#define IDC_POPUPOPTDLG_STATIC_BGCOLOUR 1018 -#define IDC_POPUPOPTDLG_STATIC_TEXTCOLOUR 1019 -#define IDC_POPUPOPTDLG_POPUPDELAY 1020 -#define IDC_POPUPOPTDLG_STATIC_SEC 1021 -#define IDC_POPUPOPTDLG_STATIC_DEFAULT 1022 -#define IDC_POPUPOPTDLG_STATIC_INFINITE 1023 -#define IDC_POPUPOPTDLG_POPUPDELAY_SPIN 1024 -#define IDC_POPUPOPTDLG_VERCHGNOTIFY 1025 -#define IDC_POPUPOPTDLG_SHOWPREVCLIENT 1026 -#define IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG 1032 -#define IDC_POPUPOPTDLG_SHOWVER 1033 -#define IDC_DONTREMIND 1034 -#define IDC_POPUPOPTDLG_IGNORESTRINGS 1035 -#define IDC_POPUPOPTDLG_STATIC_IGNORESTRINGS 1036 -#define IDC_POPUPOPTDLG_STATIC_REGEXP 1037 - -// 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 1038 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp new file mode 100644 index 0000000000..3318c3ec92 --- /dev/null +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -0,0 +1,481 @@ +/* + ClientChangeNotify - Plugin for Miranda IM + Copyright (c) 2006-2008 Chervov Dmitry + + 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 +*/ + +#include "Common.h" +#include "Misc.h" +#include "VersionNo.h" +#include "m_message.h" +#include "m_userinfo.h" +#include "m_history.h" +#include "m_protocols.h" +#include "m_updater.h" +#include "m_protosvc.h" +#include "m_metacontacts.h" +#include "m_icolib.h" +#include "m_genmenu.h" +#include "m_ContactSettings.h" + +HINSTANCE g_hInstance; +HANDLE g_hMainThread; +HANDLE g_hTogglePopupsMenuItem; +int hLangpack; +TMyArray hHooks, hServices; +COptPage *g_PreviewOptPage; // we need to show popup even for the NULL contact if g_PreviewOptPage is not NULL (used for popup preview) + +PLUGININFOEX pluginInfo = { + sizeof(PLUGININFOEX), + "ClientChangeNotify", + PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), + "ClientChangeNotify plugin for Miranda IM.", + "Deathdemon", + "dchervov@yahoo.com", + "© 2006-2008 Chervov Dmitry", + "http://deathdemon.int.ru/", + UNICODE_AWARE, + // {B68A8906-748B-435d-930E-21CC6E8F3B3F} + {0xb68a8906, 0x748b, 0x435d, {0x93, 0xe, 0x21, 0xcc, 0x6e, 0x8f, 0x3b, 0x3f}} +}; + +BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) +{ + g_hInstance = hinstDLL; + return TRUE; +} + +#define MIID_CLIENTCHANGENOTIFY {0xe9d1f0d4, 0xd65d, 0x4840, {0x87, 0xbd, 0x59, 0xd7, 0xb4, 0x70, 0x2c, 0x47}} +// {E9D1F0D4-D65D-4840-87BD-59D7B4702C47} + +static const MUUID interfaces[] = {MIID_CLIENTCHANGENOTIFY, MIID_LAST}; +extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces(void) +{ + return interfaces; +} + +extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfo; +} + +static int CALLBACK MenuWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) + { + case WM_MEASUREITEM: + { + return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam); + } + case WM_DRAWITEM: + { + return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam); + } + } + return DefWindowProc(hWnd, uMsg, wParam, lParam); +} + + +static VOID NTAPI ShowContactMenu(ULONG_PTR wParam) +// wParam = hContact +{ + POINT pt; + HWND hMenuWnd = CreateWindowEx(WS_EX_TOOLWINDOW, _T("static"), _T(MOD_NAME)_T("_MenuWindow"), 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, HWND_DESKTOP, NULL, g_hInstance, NULL); + SetWindowLongPtr(hMenuWnd, GWLP_WNDPROC, (LONG)(WNDPROC)MenuWndProc); + HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)wParam, 0); + GetCursorPos(&pt); + SetForegroundWindow(hMenuWnd); + CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(TrackPopupMenu(hMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, pt.x, pt.y, 0, hMenuWnd, NULL), MPCF_CONTACTMENU), (LPARAM)wParam); + PostMessage(hMenuWnd, WM_NULL, 0, 0); + DestroyMenu(hMenu); + DestroyWindow(hMenuWnd); +} + + +void Popup_DoAction(HWND hWnd, BYTE Action, PLUGIN_DATA *pdata) +{ + HANDLE hContact = (HANDLE)CallService(MS_POPUP_GETCONTACT, (WPARAM)hWnd, 0); + switch (Action) { + case PCA_OPENMESSAGEWND: // open message window + if (hContact && hContact != INVALID_HANDLE_VALUE) + CallServiceSync(ServiceExists("SRMsg/LaunchMessageWindow") ? "SRMsg/LaunchMessageWindow" : MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0); + break; + + case PCA_OPENMENU: // open contact menu + if (hContact && hContact != INVALID_HANDLE_VALUE) + QueueUserAPC(ShowContactMenu, g_hMainThread, (ULONG_PTR)hContact); + break; + + case PCA_OPENDETAILS: // open contact details window + if (hContact != INVALID_HANDLE_VALUE) + CallServiceSync(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0); + break; + + case PCA_OPENHISTORY: // open contact history + if (hContact != INVALID_HANDLE_VALUE) + CallServiceSync(MS_HISTORY_SHOWCONTACTHISTORY, (WPARAM)hContact, 0); + break; + + case PCA_OPENLOG: // open log file + { + TCString LogFilePath; + LS_LOGINFO li = {0}; + li.cbSize = sizeof(li); + li.szID = LOG_ID; + li.hContact = hContact; + li.Flags = LSLI_TCHAR; + li.tszLogPath = LogFilePath.GetBuffer(MAX_PATH); + if (!CallService(MS_LOGSERVICE_GETLOGINFO, (WPARAM)&li, 0)) { + LogFilePath.ReleaseBuffer(); + ShowLog(LogFilePath); + } + else LogFilePath.ReleaseBuffer(); + break; + } + case PCA_CLOSEPOPUP: // close popup + PUDeletePopUp(hWnd); + break; + + case PCA_DONOTHING: // do nothing + break; + } +} + + +static LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) +{ + PLUGIN_DATA *pdata = (PLUGIN_DATA*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, 0); + if (pdata) { + switch (message) { + case WM_COMMAND: + if (HIWORD(wParam) == STN_CLICKED) { // left mouse button + Popup_DoAction(hWnd, pdata->PopupLClickAction, pdata); + return true; + } + break; + + case WM_CONTEXTMENU: // right mouse button + Popup_DoAction(hWnd, pdata->PopupRClickAction, pdata); + return true; + + case UM_FREEPLUGINDATA: + if (pdata->hIcon) + DestroyIcon(pdata->hIcon); + + free(pdata); + return false; + break; + } + } + return DefWindowProc(hWnd, message, wParam, lParam); +} + + +void ShowPopup(SHOWPOPUP_DATA *sd) +{ + TCString PopupText; + if (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT)) { + mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s (was %s)"), (const TCHAR*)sd->MirVer, (const TCHAR*)sd->OldMirVer); + PopupText.ReleaseBuffer(); + } + else { + mir_sntprintf(PopupText.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("changed client to %s"), (const TCHAR*)sd->MirVer); + PopupText.ReleaseBuffer(); + } + + PLUGIN_DATA *pdata = (PLUGIN_DATA*)calloc(1, sizeof(PLUGIN_DATA)); + POPUPDATAT ppd = {0}; + ppd.lchContact = sd->hContact; + char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)sd->hContact, 0); + pdata->hIcon = ppd.lchIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)(const char*)TCHAR2ANSI(sd->MirVer), false); + _ASSERT(ppd.lchIcon); + if (!ppd.lchIcon || (DWORD)ppd.lchIcon == CALLSERVICE_NOTFOUND) { + // if we didn't succeed retrieving client icon, show the usual status icon instead + ppd.lchIcon = LoadSkinnedProtoIcon(szProto, DBGetContactSettingWord(sd->hContact, szProto, "Status", ID_STATUS_OFFLINE)); + pdata->hIcon = NULL; + } + _tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)sd->hContact, GCDNF_TCHAR), lengthof(ppd.lptzContactName) - 1); + _tcsncpy(ppd.lptzText, PopupText, lengthof(ppd.lptzText) - 1); + ppd.colorBack = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFBGCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_BGCOLOUR)); + ppd.colorText = (sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_DEFTEXTCOLOUR) ? 0 : sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_TEXTCOLOUR)); + ppd.PluginWindowProc = PopupWndProc; + pdata->PopupLClickAction = sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_LCLICK_ACTION); + pdata->PopupRClickAction = sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_RCLICK_ACTION); + ppd.iSeconds = sd->PopupOptPage->GetValue(IDC_POPUPOPTDLG_POPUPDELAY); + ppd.PluginData = pdata; + PUAddPopUpT(&ppd); +} + +int ContactSettingChanged(WPARAM wParam, LPARAM lParam) +{ + DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam; + if (!lstrcmpA(cws->szSetting, DB_MIRVER)) { + HANDLE hContact = (HANDLE)wParam; + SHOWPOPUP_DATA sd = {0}; + char *szProto = NULL; + if (g_PreviewOptPage) + sd.MirVer = _T("Miranda IM 0.6.0.1 (ICQ v0.3.7 alpha)"); + else { + if (!hContact) // exit if hContact == NULL and it's not a popup preview + return 0; + + szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0); + _ASSERT(szProto); + if (ServiceExists(MS_MC_GETPROTOCOLNAME) && !strcmp(szProto, (char*)CallService(MS_MC_GETPROTOCOLNAME, 0, 0))) // workaround for metacontacts + return 0; + + sd.MirVer = DBGetContactSettingString(hContact, szProto, DB_MIRVER, _T("")); + if (sd.MirVer.IsEmpty()) + return 0; + } + sd.OldMirVer = DBGetContactSettingString(hContact, MOD_NAME, DB_OLDMIRVER, _T("")); + DBWriteContactSettingTString(hContact, MOD_NAME, DB_OLDMIRVER, sd.MirVer); // we have to write it here, because we modify sd.OldMirVer and sd.MirVer to conform our settings later + if (sd.OldMirVer.IsEmpty()) // looks like it's the right way to do + return 0; + + COptPage PopupOptPage; + if (g_PreviewOptPage) + PopupOptPage = *g_PreviewOptPage; + else { + PopupOptPage = g_PopupOptPage; + PopupOptPage.DBToMem(); + } + + HANDLE hContactOrMeta = (hContact && ServiceExists(MS_MC_GETMETACONTACT)) ? (HANDLE)CallService(MS_MC_GETMETACONTACT, (WPARAM)hContact, 0) : hContact; + if (!hContactOrMeta) + hContactOrMeta = hContact; + + if (hContact && DBGetContactSettingByte(hContactOrMeta, "CList", "Hidden", 0)) + return 0; + + int PerContactSetting = hContact ? DBGetContactSettingByte(hContact, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL) : NOTIFY_ALWAYS; // NOTIFY_ALWAYS for preview + if (PerContactSetting == NOTIFY_USEGLOBAL && hContactOrMeta != hContact) // subcontact setting has a priority over a metacontact setting + PerContactSetting = DBGetContactSettingByte(hContactOrMeta, MOD_NAME, DB_CCN_NOTIFY, NOTIFY_USEGLOBAL); + + if (PerContactSetting && (PerContactSetting == NOTIFY_ALMOST_ALWAYS || PerContactSetting == NOTIFY_ALWAYS || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG) || !(DBGetContactSettingDword(hContactOrMeta, "Ignore", "Mask1", 0) & 0x8))) { // check if we need to notify at all + sd.hContact = hContact; + sd.PopupOptPage = &PopupOptPage; + if (!PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWVER)) { + CString OldMirVerA = TCHAR2ANSI(sd.OldMirVer); + CString MirVerA = TCHAR2ANSI(sd.MirVer); + if (ServiceExists(MS_FP_SAMECLIENTS)) { + char *szOldClient = (char*)CallService(MS_FP_SAMECLIENTS, (WPARAM)(const char*)OldMirVerA, (LPARAM)(const char*)OldMirVerA); // remove version from MirVer strings. I know, the way in which MS_FP_SAMECLIENTS is used here is pretty ugly, but at least it gives necessary results + char *szClient = (char*)CallService(MS_FP_SAMECLIENTS, (WPARAM)(const char*)MirVerA, (LPARAM)(const char*)MirVerA); + if (szOldClient && szClient) { + if (PerContactSetting != NOTIFY_ALMOST_ALWAYS && PerContactSetting != NOTIFY_ALWAYS && !PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) && !strcmp(szClient, szOldClient)) + return 0; + + if (!PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWVER)) { + sd.MirVer = ANSI2TCHAR(szClient); + sd.OldMirVer = ANSI2TCHAR(szOldClient); + } + } + } + } + if (sd.MirVer == (const TCHAR*)sd.OldMirVer) { + _ASSERT(hContact); + return 0; + } + if (PerContactSetting == NOTIFY_ALWAYS || (PopupOptPage.GetValue(IDC_POPUPOPTDLG_POPUPNOTIFY) && (g_PreviewOptPage || PerContactSetting == NOTIFY_ALMOST_ALWAYS || !PcreCheck(sd.MirVer)))) { + ShowPopup(&sd); + SkinPlaySound(CLIENTCHANGED_SOUND); + } + } + if (hContact) { + TCString ClientName; + if (PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWPREVCLIENT) && sd.OldMirVer.GetLen()) { + mir_sntprintf(ClientName.GetBuffer(MAX_MSG_LEN), MAX_MSG_LEN, TranslateT("%s (was %s)"), (const TCHAR*)sd.MirVer, (const TCHAR*)sd.OldMirVer); + ClientName.ReleaseBuffer(); + } + else ClientName = sd.MirVer; + + if (ServiceExists(MS_VARS_FORMATSTRING)) + logservice_log(LOG_ID, hContact, ClientName); + else { + _ASSERT(szProto); + TCString szUID(_T("")); + char *uid = (char*)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); + if (uid && (int)uid != CALLSERVICE_NOTFOUND) + szUID = DBGetContactSettingAsString(hContact, szProto, uid, _T("")); + + logservice_log(LOG_ID, hContact, TCString((TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR)) + _T(" (") + szUID + TranslateT(") changed client to ") + ClientName); + } + } + _ASSERT(sd.MirVer.GetLen()); // save the last known MirVer value even if the new one is empty + } + return 0; +} + +static int ContactSettingsInit(WPARAM wParam, LPARAM lParam) +{ + CONTACTSETTINGSINIT *csi = (CONTACTSETTINGSINIT*)wParam; + char *szProto = (csi->Type == CSIT_CONTACT) ? (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)csi->hContact, 0) : NULL; + if ((csi->Type == CSIT_GROUP) || (szProto && csi->Type == CSIT_CONTACT)) { + int Flag1 = (csi->Type == CSIT_CONTACT) ? CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) : PF1_IM; // if it's a group settings dialog, we assume that there are possibly some contacts in the group with PF1_IM capability + if (Flag1 & (PF1_IMRECV | PF1_URLRECV | PF1_FILERECV)) { // I hope, these flags are sufficient to describe which protocols can theoretically have a client + CONTACTSETTINGSCONTROL csc = {0}; + csc.cbSize = sizeof(csc); + csc.cbStateSize = sizeof(CSCONTROLSTATE); + csc.Position = CSPOS_SORTBYALPHABET; + csc.Flags = CSCF_TCHAR; + csc.ControlType = CSCT_COMBOBOX; + csc.ptszTitle = LPGENT("Client change notifications:"); + csc.ptszGroup = CSGROUP_NOTIFICATIONS; + csc.szModule = MOD_NAME; + csc.szSetting = DB_CCN_NOTIFY; + csc.StateNum = 4; + csc.DefState = 3; + CSCONTROLSTATE States[] = {CSCONTROLSTATE(LPGENT("Never, ignore client changes for this contact"), (BYTE)NOTIFY_IGNORE), CSCONTROLSTATE(LPGENT("Always except when client change notifications are disabled globally"), (BYTE)NOTIFY_ALMOST_ALWAYS), CSCONTROLSTATE(LPGENT("Always, even when client change notifications are disabled globally"), (BYTE)NOTIFY_ALWAYS), CSCONTROLSTATE(LPGENT("Use global settings (default)"), (BYTE)NOTIFY_USEGLOBAL)}; + csc.pStates = States; + CallService(MS_CONTACTSETTINGS_ADDCONTROL, wParam, (LPARAM)&csc); + } + } + return 0; +} + + +static INT_PTR srvTogglePopups(WPARAM wParam, LPARAM lParam) +{ + g_PopupOptPage.SetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY, !g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY)); + return 0; +} + + +static int PrebuildMainMenu(WPARAM wParam, LPARAM lParam) +{ + // we have to use ME_CLIST_PREBUILDMAINMENU instead of updating menu items only on settings change, because "popup_enabled" and "popup_disabled" icons are not always available yet in ModulesLoaded + if (ServiceExists(MS_POPUP_ADDPOPUPT)) { + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(mi); + mi.flags = CMIF_TCHAR | CMIM_NAME | CMIM_ICON; + if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY)) { + mi.ptszName = LPGENT("Disable c&lient change notification"); + mi.hIcon = ServiceExists(MS_SKIN2_GETICON) ? (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"popup_enabled") : NULL; + } + else { + mi.ptszName = LPGENT("Enable c&lient change notification"); + mi.hIcon = ServiceExists(MS_SKIN2_GETICON) ? (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"popup_disabled") : NULL; + } + mi.ptszPopupName = LPGENT("PopUps"); + CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)g_hTogglePopupsMenuItem, (LPARAM)&mi); + } + return 0; +} + +INT_PTR CALLBACK CCNErrorDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam) +{ + switch (uMsg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + return true; + + case WM_COMMAND: + if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) + DestroyWindow(hwndDlg); + break; + + case WM_DESTROY: + if (IsDlgButtonChecked(hwndDlg, IDC_DONTREMIND)) + DBWriteContactSettingByte(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 1); + break; + } + return 0; +} + +int MirandaLoaded(WPARAM wParam, LPARAM lParam) +{ + InitPcre(); + COptPage PopupOptPage(g_PopupOptPage); + PopupOptPage.DBToMem(); + RecompileRegexps(*(TCString*)PopupOptPage.GetValue(IDC_POPUPOPTDLG_IGNORESTRINGS)); + hHooks.AddElem(HookEvent(ME_OPT_INITIALISE, OptionsDlgInit)); + hHooks.AddElem(HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged)); + hHooks.AddElem(HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit)); + SkinAddNewSoundEx(CLIENTCHANGED_SOUND, NULL, LPGEN("ClientChangeNotify: Client changed")); +// updater plugin support + Update update = {0}; + char szVersion[16]; + update.cbSize = sizeof(Update); + update.szComponentName = pluginInfo.shortName; + update.pbVersion = (BYTE*)CreateVersionString(PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM), szVersion); + update.cpbVersion = (int)strlen((char*)update.pbVersion); + update.szUpdateURL = "http://deathdemon.int.ru/projects/ClientChangeNotifyW.zip"; + update.szVersionURL = "http://deathdemon.int.ru/updaterinfo.php"; + update.pbVersionPrefix = (BYTE*)"ClientChangeNotify Unicode version "; + update.cpbVersionPrefix = (int)strlen((char*)update.pbVersionPrefix); + CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update); + + if (ServiceExists(MS_POPUP_ADDPOPUPT)) { + hServices.AddElem(CreateServiceFunction(MS_CCN_TOGGLEPOPUPS, srvTogglePopups)); + hHooks.AddElem(HookEvent(ME_CLIST_PREBUILDMAINMENU, PrebuildMainMenu)); + CLISTMENUITEM mi = {0}; + mi.cbSize = sizeof(mi); + mi.flags = CMIF_TCHAR; + if (g_PopupOptPage.GetDBValueCopy(IDC_POPUPOPTDLG_POPUPNOTIFY)) + mi.ptszName = LPGENT("Disable c&lient change notification"); + else + mi.ptszName = LPGENT("Enable c&lient change notification"); + + mi.pszService = MS_CCN_TOGGLEPOPUPS; + mi.ptszPopupName = LPGENT("PopUps"); + g_hTogglePopupsMenuItem = Menu_AddMainMenuItem(&mi); + } + + // seems that Fingerprint is not installed + if ((!ServiceExists(MS_FP_SAMECLIENTS) || !ServiceExists(MS_FP_GETCLIENTICON)) && !DBGetContactSettingByte(NULL, MOD_NAME, DB_NO_FINGERPRINT_ERROR, 0)) + CreateDialog(g_hInstance, MAKEINTRESOURCE(IDD_CCN_ERROR), NULL, CCNErrorDlgProc); + + logservice_register(LOG_ID, LPGENT("ClientChangeNotify"), _T("ClientChangeNotify?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), TranslateT("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) changed client to %extratext%")); + return 0; +} + + +extern "C" int __declspec(dllexport) Load(void) +{ + mir_getLP( &pluginInfo ); + + hHooks.AddElem(HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded)); + DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &g_hMainThread, THREAD_SET_CONTEXT, false, 0); + InitOptions(); + if (DBGetContactSettingString(NULL, "KnownModules", MOD_NAME, (char*)NULL) == NULL) + DBWriteContactSettingString(NULL, "KnownModules", MOD_NAME, MOD_NAME); + + if (DBGetContactSettingByte(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1) { + TCString Str; + Str = DBGetContactSettingString(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, _T("")); + if (Str.GetLen()) // fix incorrect regexp from v0.1.1.0 + DBWriteContactSettingTString(NULL, MOD_NAME, DB_IGNORESUBSTRINGS, Str.Replace(_T("/Miranda[0-9A-F]{8}/"), _T("/[0-9A-F]{8}(\\W|$)/"))); + + DBWriteContactSettingByte(NULL, MOD_NAME, DB_SETTINGSVER, 1); + } + return 0; +} + +extern "C" int __declspec(dllexport) Unload() +{ + CloseHandle(g_hMainThread); + int I; + for (I = 0; I < hHooks.GetSize(); I++) + if (hHooks[I]) + UnhookEvent(hHooks[I]); + + for (I = 0; I < hServices.GetSize(); I++) + if (hServices[I]) + DestroyServiceFunction(hServices[I]); + + UninitPcre(); + return 0; +} diff --git a/plugins/ClientChangeNotify/src/Common.h b/plugins/ClientChangeNotify/src/Common.h new file mode 100644 index 0000000000..62d41732a7 --- /dev/null +++ b/plugins/ClientChangeNotify/src/Common.h @@ -0,0 +1,142 @@ +/* + ClientChangeNotify - Plugin for Miranda IM + Copyright (c) 2006-2008 Chervov Dmitry + + 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 +*/ + +#pragma once + +#define _CRT_SECURE_NO_WARNINGS +#define WIN32_LEAN_AND_MEAN + +#define CHARARRAY_CONVERT + +#include +#include +#include +#include +#include +#include + +#include "resource.h" +#include "newpluginapi.h" +#include "statusmodes.h" +#include "m_popup.h" +#include "m_skin.h" +#include "m_langpack.h" +#include "m_options.h" +#include "m_clist.h" +#include "m_LogService.h" +#include "m_system.h" +#include "m_fingerprint.h" +#include "..\CommonLibs\TMyArray.h" +#include "..\CommonLibs\Options.h" +#include "..\CommonLibs\CString.h" +#include "..\CommonLibs\pcre.h" + +#pragma comment(lib,"comctl32.lib") + +#ifndef lengthof +#define lengthof(s) (sizeof(s) / sizeof((s)[0])) +#endif + +// Actions on popup click +#define PCA_OPENMESSAGEWND 0 // open message window +#define PCA_CLOSEPOPUP 1 // close popup +#define PCA_OPENDETAILS 2 // open contact details window +#define PCA_OPENMENU 3 // open contact menu +#define PCA_OPENHISTORY 4 // open contact history +#define PCA_OPENLOG 5 // open log file +#define PCA_DONOTHING 6 // do nothing + +#define POPUP_DEF_LCLICKACTION PCA_OPENMESSAGEWND +#define POPUP_DEF_RCLICKACTION PCA_CLOSEPOPUP +#define POPUP_DEF_POPUP_BGCOLOUR 0xEAFFFB +#define POPUP_DEF_POPUP_TEXTCOLOUR 0 +#define POPUP_DEF_USEDEFBGCOLOUR 0 +#define POPUP_DEF_USEDEFTEXTCOLOUR 0 +#define POPUP_DEF_POPUPDELAY 0 + +#define IGNORESTRINGS_MAX_LEN 2048 +#define MAX_MSG_LEN 8192 + +#define NOTIFYTIMER_INTERVAL 3500 + +#define MOD_NAME "ClientChangeNotify" +#define LOG_ID MOD_NAME +#define LOG_PREFIX MOD_NAME ": " // for netlib.log + +#define MS_NETLIB_LOG "Netlib/Log" + +#define DB_MIRVER "MirVer" +#define DB_OLDMIRVER "OldMirVer" +#define DB_NO_FINGERPRINT_ERROR "NoFingerprintError" +#define DB_IGNORESUBSTRINGS "IgnoreSubstrings" +#define DB_SETTINGSVER "SettingsVer" + +#define DB_CCN_NOTIFY "Notify" // database key name used for per-contact settings; 0 = ignore, 1 = notify always, 2 = use global settings +#define NOTIFY_IGNORE 0 +#define NOTIFY_ALMOST_ALWAYS 1 // don't notify only when CCN popups are disabled globally in the plugin +#define NOTIFY_ALWAYS 2 +#define NOTIFY_USEGLOBAL 3 + +#define CLIENTCHANGED_SOUND "ClientChanged" + +extern HINSTANCE g_hInstance; + +extern COptPage g_PopupOptPage; +extern COptPage *g_PreviewOptPage; + +#define MS_VARS_FORMATSTRING "Vars/FormatString" +#define MS_CCN_TOGGLEPOPUPS "ClientChangeNotify/TogglePopups" + + +static __inline CString LogMessage(const char *Format, ...) +{ + va_list va; + char szText[8096]; + strcpy(szText, LOG_PREFIX); + va_start(va, Format); + mir_vsnprintf(szText + (lengthof(LOG_PREFIX) - 1), sizeof(szText) - (lengthof(LOG_PREFIX) - 1), Format, va); + va_end(va); + CallService(MS_NETLIB_LOG, NULL, (LPARAM)szText); + return CString(szText); +} + + +// ClientChangeNotify.cpp + +struct PLUGIN_DATA +{ + HICON hIcon; // needed here to destroy its handle on UM_FREEPLUGINDATA + int PopupLClickAction; + int PopupRClickAction; +}; + +struct SHOWPOPUP_DATA +{ + HANDLE hContact; + TCString OldMirVer; + TCString MirVer; + COptPage *PopupOptPage; +}; + + +int ContactSettingChanged(WPARAM wParam, LPARAM lParam); + +// OptDlg.cpp +int OptionsDlgInit(WPARAM wParam, LPARAM lParam); +void InitOptions(); diff --git a/plugins/ClientChangeNotify/src/Misc.h b/plugins/ClientChangeNotify/src/Misc.h new file mode 100644 index 0000000000..262193dc26 --- /dev/null +++ b/plugins/ClientChangeNotify/src/Misc.h @@ -0,0 +1,83 @@ +/* + ClientChangeNotify - Plugin for Miranda IM + Copyright (c) 2006-2008 Chervov Dmitry + + 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 +*/ + +#include "Common.h" + + +__inline void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine = _T(""), bool IsErrorMsg = false, int Timeout = 0) +{ + if (ServiceExists(MS_POPUP_ADDPOPUPEX)) + { + POPUPDATAT ppd = {0}; + ppd.lchIcon = LoadIcon(NULL, IsErrorMsg ? IDI_EXCLAMATION : IDI_INFORMATION); + lstrcpy(ppd.lptzContactName, FirstLine); + lstrcpy(ppd.lptzText, SecondLine); + ppd.colorBack = IsErrorMsg ? 0x0202E3 : 0xE8F1FD; + ppd.colorText = IsErrorMsg ? 0xE8F1FD : 0x000000; + ppd.iSeconds = Timeout; + CallService(MS_POPUP_ADDPOPUPT, (WPARAM)&ppd, 0); + } else + { + MessageBox(NULL, SecondLine, FirstLine, MB_OK | (IsErrorMsg ? MB_ICONEXCLAMATION : MB_ICONINFORMATION)); + } +} + + +__inline TCString Path_ToRelative(TCString &Path) +{ + CString Str; + Str.GetBuffer(MAX_PATH); + CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)(const char*)TCHAR2ANSI(Path), (LPARAM)(char*)Str); + Str.ReleaseBuffer(); + return ANSI2TCHAR(Str); +} + + +__inline TCString Path_ToAbsolute(TCString &Path) +{ + CString Str; + Str.GetBuffer(MAX_PATH); + CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(const char*)TCHAR2ANSI(Path), (LPARAM)(char*)Str); + Str.ReleaseBuffer(); + return ANSI2TCHAR(Str); +} + + +__inline void ShowLog(TCString &LogFilePath) +{ + int Result = (int)ShellExecute(NULL, _T("open"), LogFilePath, NULL, NULL, SW_SHOW); + if (Result <= 32) // Error + { + TCHAR szError[64]; + mir_sntprintf(szError, lengthof(szError), TranslateT("Error #%d"), Result); + ShowMsg(szError, TranslateT("Can't open log file ") + LogFilePath, true); + } +} + + +__inline void RecompileRegexps(TCString IgnoreSubstrings) +{ + FreePcreCompileData(); + TCHAR *p = _tcstok(IgnoreSubstrings, _T(";")); + while (p) + { + CompileRegexp(p, p[0] != '/'); + p = _tcstok(NULL, _T(";")); + } +} diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp new file mode 100644 index 0000000000..164e51e795 --- /dev/null +++ b/plugins/ClientChangeNotify/src/OptDlg.cpp @@ -0,0 +1,215 @@ +/* + ClientChangeNotify - Plugin for Miranda IM + Copyright (c) 2006-2008 Chervov Dmitry + + 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 +*/ + +#include "Common.h" +#include "Misc.h" + + +// ================================================ Popup options ================================================ + +COptPage g_PopupOptPage(MOD_NAME, NULL); + + +void EnablePopupOptDlgControls() +{ + int I; + g_PopupOptPage.PageToMem(); + int UsePopups = g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_POPUPNOTIFY); + for (I = 0; I < g_PopupOptPage.Items.GetSize(); I++) + { + switch (g_PopupOptPage.Items[I]->GetParam()) + { + case IDC_POPUPOPTDLG_POPUPNOTIFY: + { + g_PopupOptPage.Items[I]->Enable(UsePopups); + } break; + case IDC_POPUPOPTDLG_DEFBGCOLOUR: + { + g_PopupOptPage.Items[I]->Enable(UsePopups && !g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_DEFBGCOLOUR)); + } break; + case IDC_POPUPOPTDLG_DEFTEXTCOLOUR: + { + g_PopupOptPage.Items[I]->Enable(UsePopups && !g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_DEFTEXTCOLOUR)); + } break; + } + } + if (g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY)) + { + COptItem *ShowVer = g_PopupOptPage.Find(IDC_POPUPOPTDLG_SHOWVER); + ShowVer->SetValue(1); + ShowVer->Enable(false); + ShowVer->MemToWnd(g_PopupOptPage.hWnd); + } + if (!ServiceExists(MS_FP_SAMECLIENTS)) + { // disable these checkboxes if Fingerprint wasn't found + g_PopupOptPage.Find(IDC_POPUPOPTDLG_VERCHGNOTIFY)->Enable(false); + g_PopupOptPage.Find(IDC_POPUPOPTDLG_SHOWVER)->Enable(false); + } + if (PcreEnabled()) + { + SetDlgItemText(g_PopupOptPage.GetWnd(), IDC_POPUPOPTDLG_STATIC_REGEXP, TranslateT("(you can use regular expressions here)")); + } + g_PopupOptPage.MemToPage(true); + InvalidateRect(GetDlgItem(g_PopupOptPage.GetWnd(), IDC_POPUPOPTDLG_POPUPDELAY_SPIN), NULL, false); // update spin control +} + +static struct { + TCHAR *Text; + int Action; +} +PopupActions[] = +{ + LPGENT("Open message window"), PCA_OPENMESSAGEWND, + LPGENT("Close popup"), PCA_CLOSEPOPUP, + LPGENT("Open contact details window"), PCA_OPENDETAILS, + LPGENT("Open contact menu"), PCA_OPENMENU, + LPGENT("Open contact history"), PCA_OPENHISTORY, + LPGENT("Open log file"), PCA_OPENLOG, + LPGENT("Do nothing"), PCA_DONOTHING +}; + +INT_PTR CALLBACK PopupOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + static int ChangeLock = 0; + switch (msg) { + case WM_INITDIALOG: + { + TranslateDialogDefault(hwndDlg); + ChangeLock++; + g_PopupOptPage.SetWnd(hwndDlg); + SendDlgItemMessage(hwndDlg, IDC_POPUPOPTDLG_POPUPDELAY, EM_LIMITTEXT, 4, 0); + SendDlgItemMessage(hwndDlg, IDC_POPUPOPTDLG_IGNORESTRINGS, EM_LIMITTEXT, IGNORESTRINGS_MAX_LEN, 0); + SendDlgItemMessage(hwndDlg, IDC_POPUPOPTDLG_POPUPDELAY_SPIN, UDM_SETRANGE32, -1, 9999); + + HWND hLCombo = GetDlgItem(hwndDlg, IDC_POPUPOPTDLG_LCLICK_ACTION); + HWND hRCombo = GetDlgItem(hwndDlg, IDC_POPUPOPTDLG_RCLICK_ACTION); + int I; + for (I = 0; I < lengthof(PopupActions); I++) { + SendMessage(hLCombo, CB_SETITEMDATA, SendMessage(hLCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[I].Text)), PopupActions[I].Action); + SendMessage(hRCombo, CB_SETITEMDATA, SendMessage(hRCombo, CB_ADDSTRING, 0, (LPARAM)TranslateTS(PopupActions[I].Text)), PopupActions[I].Action); + } + g_PopupOptPage.DBToMemToPage(); + EnablePopupOptDlgControls(); + ChangeLock--; + } + return true; + + case WM_NOTIFY: + switch (((NMHDR*)lParam)->code) { + case PSN_APPLY: + g_PopupOptPage.PageToMemToDB(); + RecompileRegexps(*(TCString*)g_PopupOptPage.GetValue(IDC_POPUPOPTDLG_IGNORESTRINGS)); + return true; + } + break; + + case WM_COMMAND: + switch (HIWORD(wParam)) { + case BN_CLICKED: + switch (LOWORD(wParam)) { + case IDC_POPUPOPTDLG_POPUPNOTIFY: + case IDC_POPUPOPTDLG_DEFBGCOLOUR: + case IDC_POPUPOPTDLG_DEFTEXTCOLOUR: + case IDC_POPUPOPTDLG_VERCHGNOTIFY: + EnablePopupOptDlgControls(); + // go through + + case IDC_POPUPOPTDLG_SHOWPREVCLIENT: + case IDC_POPUPOPTDLG_SHOWVER: + case IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG: + SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); + return 0; + + case IDC_POPUPOPTDLG_POPUPPREVIEW: + g_PreviewOptPage = new COptPage(g_PopupOptPage); + g_PreviewOptPage->PageToMem(); + DBCONTACTWRITESETTING cws = {0}; + cws.szModule = "ICQ"; + cws.szSetting = DB_MIRVER; + DBWriteContactSettingString(NULL, MOD_NAME, DB_OLDMIRVER, "ICQ Lite v5"); + ContactSettingChanged(NULL, (LPARAM)&cws); // simulate a version change + delete g_PreviewOptPage; + g_PreviewOptPage = NULL; + break; + } + break; + + case EN_CHANGE: + if (LOWORD(wParam) == IDC_POPUPOPTDLG_POPUPDELAY || LOWORD(wParam) == IDC_POPUPOPTDLG_IGNORESTRINGS) + if (!ChangeLock && g_PopupOptPage.GetWnd()) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); + + break; + + case CBN_SELCHANGE: + if ((LOWORD(wParam) == IDC_POPUPOPTDLG_LCLICK_ACTION) || (LOWORD(wParam) == IDC_POPUPOPTDLG_RCLICK_ACTION) || (LOWORD(wParam) == IDC_POPUPOPTDLG_BGCOLOUR) || (LOWORD(wParam) == IDC_POPUPOPTDLG_TEXTCOLOUR)) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0); + + break; + } + break; + + case WM_DESTROY: + g_PopupOptPage.SetWnd(NULL); + return 0; + } + return 0; +} + +int OptionsDlgInit(WPARAM wParam, LPARAM lParam) +{ + OPTIONSDIALOGPAGE optDi = {0}; + optDi.cbSize = sizeof(optDi); + optDi.position = 920000000; + optDi.ptszTitle = LPGENT("ClientChangeNotify"); + optDi.pfnDlgProc = PopupOptDlg; + optDi.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPOPTDLG); + optDi.hInstance = g_hInstance; + optDi.ptszGroup = LPGENT("PopUps"); + optDi.flags = ODPF_BOLDGROUPS | ODPF_TCHAR; + Options_AddPage(wParam, &optDi); + return 0; +} + +void InitOptions() +{ + g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_POPUPNOTIFY, "PopupNotify", DBVT_BYTE, 1)); + g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_SHOWPREVCLIENT, "ShowPrevClient", DBVT_BYTE, 0, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_VERCHGNOTIFY, "VerChgNotify", DBVT_BYTE, 0, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_SHOWVER, "ShowVer", DBVT_BYTE, 1, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG, "UseStatusNotifyFlag", DBVT_BYTE, 1, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_POPUPPREVIEW, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Combobox(IDC_POPUPOPTDLG_LCLICK_ACTION, "PopupLClickAction", DBVT_BYTE, POPUP_DEF_LCLICKACTION, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Combobox(IDC_POPUPOPTDLG_RCLICK_ACTION, "PopupRClickAction", DBVT_BYTE, POPUP_DEF_RCLICKACTION, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_LCLICK, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_RCLICK, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Colourpicker(IDC_POPUPOPTDLG_BGCOLOUR, "PopupBGColour", POPUP_DEF_POPUP_BGCOLOUR, IDC_POPUPOPTDLG_DEFBGCOLOUR)); + g_PopupOptPage.Items.AddElem(new COptItem_Colourpicker(IDC_POPUPOPTDLG_TEXTCOLOUR, "PopupTextColour", POPUP_DEF_POPUP_TEXTCOLOUR, IDC_POPUPOPTDLG_DEFTEXTCOLOUR)); + g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_DEFBGCOLOUR, "UseDefBGColour", DBVT_BYTE, POPUP_DEF_USEDEFBGCOLOUR, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Checkbox(IDC_POPUPOPTDLG_DEFTEXTCOLOUR, "UseDefTextColour", DBVT_BYTE, POPUP_DEF_USEDEFTEXTCOLOUR, 0, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_BGCOLOUR, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_TEXTCOLOUR, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_IntEdit(IDC_POPUPOPTDLG_POPUPDELAY, "PopupDelay", DBVT_WORD, true, POPUP_DEF_POPUPDELAY, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_SEC, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_DEFAULT, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_INFINITE, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_IGNORESTRINGS, IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Edit(IDC_POPUPOPTDLG_IGNORESTRINGS, DB_IGNORESUBSTRINGS, IGNORESTRINGS_MAX_LEN, _T("gmail;skype;/Miranda[0-9A-F]{8}/"), IDC_POPUPOPTDLG_POPUPNOTIFY)); + g_PopupOptPage.Items.AddElem(new COptItem_Generic(IDC_POPUPOPTDLG_STATIC_REGEXP, IDC_POPUPOPTDLG_POPUPNOTIFY)); +} diff --git a/plugins/ClientChangeNotify/src/VersionNo.h b/plugins/ClientChangeNotify/src/VersionNo.h new file mode 100644 index 0000000000..13ba7afb9f --- /dev/null +++ b/plugins/ClientChangeNotify/src/VersionNo.h @@ -0,0 +1,11 @@ +#define __MAJOR_VERSION 0 +#define __MINOR_VERSION 1 +#define __RELEASE_NUM 1 +#define __BUILD_NUM 3 + +#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) diff --git a/plugins/ClientChangeNotify/src/resource.h b/plugins/ClientChangeNotify/src/resource.h new file mode 100644 index 0000000000..e9a86ee449 --- /dev/null +++ b/plugins/ClientChangeNotify/src/resource.h @@ -0,0 +1,42 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by Resources.rc +// +#define IDD_POPUPOPTDLG 101 +#define IDD_CCN_ERROR 103 +#define IDC_POPUPOPTDLG_POPUPNOTIFY 1002 +#define IDC_POPUPOPTDLG_BGCOLOUR 1003 +#define IDC_POPUPOPTDLG_TEXTCOLOUR 1004 +#define IDC_POPUPOPTDLG_LCLICK_ACTION 1005 +#define IDC_POPUPOPTDLG_RCLICK_ACTION 1006 +#define IDC_POPUPOPTDLG_POPUPPREVIEW 1007 +#define IDC_POPUPOPTDLG_DEFBGCOLOUR 1013 +#define IDC_POPUPOPTDLG_DEFTEXTCOLOUR 1014 +#define IDC_POPUPOPTDLG_STATIC_LCLICK 1016 +#define IDC_POPUPOPTDLG_STATIC_RCLICK 1017 +#define IDC_POPUPOPTDLG_STATIC_BGCOLOUR 1018 +#define IDC_POPUPOPTDLG_STATIC_TEXTCOLOUR 1019 +#define IDC_POPUPOPTDLG_POPUPDELAY 1020 +#define IDC_POPUPOPTDLG_STATIC_SEC 1021 +#define IDC_POPUPOPTDLG_STATIC_DEFAULT 1022 +#define IDC_POPUPOPTDLG_STATIC_INFINITE 1023 +#define IDC_POPUPOPTDLG_POPUPDELAY_SPIN 1024 +#define IDC_POPUPOPTDLG_VERCHGNOTIFY 1025 +#define IDC_POPUPOPTDLG_SHOWPREVCLIENT 1026 +#define IDC_POPUPOPTDLG_USESTATUSNOTIFYFLAG 1032 +#define IDC_POPUPOPTDLG_SHOWVER 1033 +#define IDC_DONTREMIND 1034 +#define IDC_POPUPOPTDLG_IGNORESTRINGS 1035 +#define IDC_POPUPOPTDLG_STATIC_IGNORESTRINGS 1036 +#define IDC_POPUPOPTDLG_STATIC_REGEXP 1037 + +// 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 1038 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/plugins/Clist_classic/clc.h b/plugins/Clist_classic/clc.h deleted file mode 100644 index 472dc12eab..0000000000 --- a/plugins/Clist_classic/clc.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ - -#define FONTID_LAST 7 - -struct ClcContact { - BYTE type; - BYTE flags; - union { - struct { - WORD iImage; - HANDLE hContact; - }; - struct { - WORD groupId; - struct ClcGroup *group; - }; - }; - BYTE iExtraImage[MAXEXTRACOLUMNS]; - TCHAR szText[120-MAXEXTRACOLUMNS]; - char * proto; // MS_PROTO_GETBASEPROTO -}; - -struct ClcData { - struct ClcGroup list; - int rowHeight; - int yScroll; - int selection; - struct ClcFontInfo fontInfo[FONTID_MAX+1]; - int scrollTime; - HIMAGELIST himlHighlight; - int groupIndent; - TCHAR szQuickSearch[128]; - int iconXSpace; - HWND hwndRenameEdit; - COLORREF bkColour,selBkColour,selTextColour,hotTextColour,quickSearchColour; - int iDragItem,iInsertionMark; - int dragStage; - POINT ptDragStart; - int dragAutoScrolling; - int dragAutoScrollHeight; - int leftMargin; - int insertionMarkHitHeight; - HBITMAP hBmpBackground; - int backgroundBmpUse,bkChanged; - int iHotTrack; - int gammaCorrection; - DWORD greyoutFlags; //see m_clc.h - DWORD offlineModes; - DWORD exStyle; - POINT ptInfoTip; - int infoTipTimeout; - HANDLE hInfoTipItem; - HIMAGELIST himlExtraColumns; - int extraColumnsCount; - int extraColumnSpacing; - int checkboxSize; - int showSelAlways; - int showIdle; - int noVScrollbar; - int useWindowsColours; - int needsResort; -}; diff --git a/plugins/Clist_classic/clcfonts.cpp b/plugins/Clist_classic/clcfonts.cpp deleted file mode 100644 index 6a2f3062dc..0000000000 --- a/plugins/Clist_classic/clcfonts.cpp +++ /dev/null @@ -1,137 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ - -#include "commonheaders.h" - -#include "m_fontservice.h" - -#define CLIST_FONTID_CONTACTS 0 -#define CLIST_FONTID_INVIS 1 -#define CLIST_FONTID_OFFLINE 2 -#define CLIST_FONTID_NOTONLIST 3 -#define CLIST_FONTID_GROUPS 4 -#define CLIST_FONTID_GROUPCOUNTS 5 -#define CLIST_FONTID_DIVIDERS 6 -#define CLIST_FONTID_OFFINVIS 7 -#define CLIST_FONTID_MAX 7 - -static const TCHAR* szClistFontIdDescr[CLIST_FONTID_MAX + 1] = -{ - LPGENT( "Standard contacts"), - LPGENT( "Online contacts to whom you have a different visibility"), - LPGENT( "Offline contacts"), - LPGENT( "Contacts which are 'not on list'"), - LPGENT( "Groups"), - LPGENT( "Group member counts"), - LPGENT( "Dividers"), - LPGENT( "Offline contacts to whom you have a different visibility" ) -}; - -static int fontListOrder[CLIST_FONTID_MAX + 1] = -{ - CLIST_FONTID_CONTACTS, - CLIST_FONTID_INVIS, - CLIST_FONTID_OFFLINE, - CLIST_FONTID_OFFINVIS, - CLIST_FONTID_NOTONLIST, - CLIST_FONTID_GROUPS, - CLIST_FONTID_GROUPCOUNTS, - CLIST_FONTID_DIVIDERS -}; - -static int FS_FontsChanged(WPARAM wParam, LPARAM lParam) -{ - pcli->pfnClcOptionsChanged(); - return 0; -} - -void RegisterCListFonts() -{ - FontIDT fontid = {0}; - ColourIDT colourid = {0}; - char idstr[10]; - int i; - - fontid.cbSize = sizeof(FontIDT); - fontid.flags = FIDF_ALLOWREREGISTER | FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS; - - for (i = 0; i <= CLIST_FONTID_MAX; i++) { - - switch (fontListOrder[i]) - { - case FONTID_GROUPS: - case FONTID_GROUPCOUNTS: - fontid.flags &= ~FIDF_CLASSMASK; - fontid.flags |= FIDF_CLASSHEADER; - break; - case FONTID_DIVIDERS: - fontid.flags &= ~FIDF_CLASSMASK; - fontid.flags |= FIDF_CLASSSMALL; - break; - default: - fontid.flags &= ~FIDF_CLASSMASK; - fontid.flags |= FIDF_CLASSGENERAL; - break; - } - - strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup)); - _tcsncpy(fontid.group, _T("Contact List"), SIZEOF(fontid.group)); - _tcsncpy(fontid.name, szClistFontIdDescr[fontListOrder[i]], SIZEOF(fontid.name)); - sprintf(idstr, "Font%d", fontListOrder[i]); - strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix)); - fontid.order = fontListOrder[i]; - - FontRegisterT(&fontid); - } - - // and colours - colourid.cbSize = sizeof(ColourIDT); - colourid.order = 0; - strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup)); - - strncpy(colourid.setting, "BkColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); - _tcsncpy(colourid.group, LPGENT("Contact List"), SIZEOF(colourid.group)); - colourid.defcolour = CLCDEFAULT_BKCOLOUR; - ColourRegisterT(&colourid); - - strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Selected Text"), SIZEOF(colourid.name)); - colourid.order = 1; - colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; - ColourRegisterT(&colourid); - - strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Hottrack Text"), SIZEOF(colourid.name)); - colourid.order = 1; - colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; - ColourRegisterT(&colourid); - - strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); - _tcsncpy(colourid.name, LPGENT("Quicksearch Text"), SIZEOF(colourid.name)); - colourid.order = 1; - colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; - ColourRegisterT(&colourid); - - HookEvent(ME_FONT_RELOAD, FS_FontsChanged); -} diff --git a/plugins/Clist_classic/clcopts.cpp b/plugins/Clist_classic/clcopts.cpp deleted file mode 100644 index 51f9c8a08b..0000000000 --- a/plugins/Clist_classic/clcopts.cpp +++ /dev/null @@ -1,479 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ - -#include "commonheaders.h" - -#define DBFONTF_BOLD 1 -#define DBFONTF_ITALIC 2 -#define DBFONTF_UNDERLINE 4 - -struct CheckBoxToStyleEx_t -{ - int id; - DWORD flag; - int not; -} - -static const checkBoxToStyleEx[] = { - {IDC_DISABLEDRAGDROP, CLS_EX_DISABLEDRAGDROP, 0}, - {IDC_NOTEDITLABELS, CLS_EX_EDITLABELS, 1}, - {IDC_SHOWSELALWAYS, CLS_EX_SHOWSELALWAYS, 0}, - {IDC_TRACKSELECT, CLS_EX_TRACKSELECT, 0}, - {IDC_SHOWGROUPCOUNTS, CLS_EX_SHOWGROUPCOUNTS, 0}, - {IDC_HIDECOUNTSWHENEMPTY, CLS_EX_HIDECOUNTSWHENEMPTY, 0}, - {IDC_DIVIDERONOFF, CLS_EX_DIVIDERONOFF, 0}, - {IDC_NOTNOTRANSLUCENTSEL, CLS_EX_NOTRANSLUCENTSEL, 1}, - {IDC_LINEWITHGROUPS, CLS_EX_LINEWITHGROUPS, 0}, - {IDC_QUICKSEARCHVISONLY, CLS_EX_QUICKSEARCHVISONLY, 0}, - {IDC_SORTGROUPSALPHA, CLS_EX_SORTGROUPSALPHA, 0}, - {IDC_NOTNOSMOOTHSCROLLING, CLS_EX_NOSMOOTHSCROLLING, 1} -}; - -struct CheckBoxValues_t -{ - DWORD style; - TCHAR* szDescr; -}; - -static const struct CheckBoxValues_t greyoutValues[] = { - { GREYF_UNFOCUS, LPGENT("Not focused") }, - { MODEF_OFFLINE, LPGENT("Offline") }, - { PF2_ONLINE, LPGENT("Online") }, - { PF2_SHORTAWAY, LPGENT("Away") }, - { PF2_LONGAWAY, LPGENT("NA") }, - { PF2_LIGHTDND, LPGENT("Occupied") }, - { PF2_HEAVYDND, LPGENT("DND") }, - { PF2_FREECHAT, LPGENT("Free for chat") }, - { PF2_INVISIBLE, LPGENT("Invisible") }, - { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, - { PF2_ONTHEPHONE, LPGENT("On the phone") } -}; - -static const struct CheckBoxValues_t offlineValues[] = { - { MODEF_OFFLINE, LPGENT("Offline") }, - { PF2_ONLINE, LPGENT("Online") }, - { PF2_SHORTAWAY, LPGENT("Away") }, - { PF2_LONGAWAY, LPGENT("NA") }, - { PF2_LIGHTDND, LPGENT("Occupied") }, - { PF2_HEAVYDND, LPGENT("DND") }, - { PF2_FREECHAT, LPGENT("Free for chat") }, - { PF2_INVISIBLE, LPGENT("Invisible") }, - { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, - { PF2_ONTHEPHONE, LPGENT("On the phone") } -}; - -static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style) -{ - TVINSERTSTRUCT tvis; - int i; - - tvis.hParent = NULL; - tvis.hInsertAfter = TVI_LAST; - tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE; - for (i = 0; i < nValues; i++) { - tvis.item.lParam = values[i].style; - tvis.item.pszText = TranslateTS( values[i].szDescr ); - tvis.item.stateMask = TVIS_STATEIMAGEMASK; - tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1); - TreeView_InsertItem( hwndTree, &tvis); -} } - -static DWORD MakeCheckBoxTreeFlags(HWND hwndTree) -{ - DWORD flags = 0; - TVITEM tvi; - - tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE; - tvi.hItem = TreeView_GetRoot(hwndTree); - while (tvi.hItem) { - TreeView_GetItem(hwndTree, &tvi); - if (((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 2)) - flags |= tvi.lParam; - tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem); - } - return flags; -} - -static LONG CalcMinRowHeight() -{ - int i; - LONG minHeight = 16; - HDC hdc = GetDC(NULL); - for (i = 0; i < FONTID_LAST; i++) { - HFONT hFont; - LOGFONT lf; - COLORREF color; - SIZE fontSize; - pcli->pfnGetFontSetting(i, &lf, &color); - lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72); - hFont = CreateFontIndirect(&lf); - hFont = ( HFONT )SelectObject(hdc, hFont); - GetTextExtentPoint32(hdc, _T("x"), 1, &fontSize); - if (fontSize.cy > minHeight) - minHeight = fontSize.cy; - hFont = ( HFONT )SelectObject(hdc,hFont); - DeleteObject(hFont); - } - ReleaseDC(NULL, hdc); - return minHeight; -} - -static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE, - GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); - SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE, - GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); - { - int i; - DWORD exStyle = DBGetContactSettingDword(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle()); - for (i = 0; i < SIZEOF(checkBoxToStyleEx); i++) - CheckDlgButton(hwndDlg, checkBoxToStyleEx[i].id, - (exStyle & checkBoxToStyleEx[i].flag) ^ (checkBoxToStyleEx[i].flag * - checkBoxToStyleEx[i].not) ? BST_CHECKED : BST_UNCHECKED); - } - { - UDACCEL accel[2] = { {0, 10} , {2, 50} }; - SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETRANGE, 0, MAKELONG(999, 0)); - SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETACCEL, SIZEOF(accel), (LPARAM) & accel); - SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETPOS, 0, - MAKELONG(DBGetContactSettingWord(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME), 0)); - } - CheckDlgButton(hwndDlg, IDC_IDLE, DBGetContactSettingByte(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED); - SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETRANGE, 0, MAKELONG(64, 0)); - SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, - MAKELONG(DBGetContactSettingByte(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN), 0)); - SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0)); - SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETPOS, 0, - MAKELONG(DBGetContactSettingByte(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT), 0)); - CheckDlgButton(hwndDlg, IDC_GREYOUT, - DBGetContactSettingDword(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING)); - EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT)); - FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, SIZEOF(greyoutValues), - DBGetContactSettingDword(NULL, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS)); - FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, SIZEOF(offlineValues), - DBGetContactSettingDword(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES)); - CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, DBGetContactSettingByte(NULL, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_GAMMACORRECT, DBGetContactSettingByte(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT) ? BST_CHECKED : BST_UNCHECKED); - { - LONG minHeight = CalcMinRowHeight(); - LONG rowHeight = DBGetContactSettingByte(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT); - if (rowHeight < minHeight) { - rowHeight = minHeight; - } - SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETRANGE, 0, MAKELONG(255, minHeight)); - SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETPOS, 0, MAKELONG(rowHeight, 0)); - } - return TRUE; - case WM_SETFOCUS: - { - LONG minHeight = CalcMinRowHeight(); - LONG rowHeight = SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0); - if (rowHeight < minHeight) { - rowHeight = minHeight; - SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETPOS, 0, MAKELONG(rowHeight, 0)); - } - SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETRANGE, 0, MAKELONG(255, minHeight)); - } - break; - case WM_VSCROLL: - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - case WM_COMMAND: - if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING) - EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING)); - if (LOWORD(wParam) == IDC_GREYOUT) - EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT)); - if ((LOWORD(wParam) == IDC_LEFTMARGIN || LOWORD(wParam) == IDC_SMOOTHTIME || LOWORD(wParam) == IDC_GROUPINDENT - || LOWORD(wParam) == IDC_ROWHEIGHT) - && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())) - return 0; - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - case WM_NOTIFY: - switch (((LPNMHDR) lParam)->idFrom) { - case IDC_GREYOUTOPTS: - case IDC_HIDEOFFLINEOPTS: - if (((LPNMHDR) lParam)->code == NM_CLICK) { - TVHITTESTINFO hti; - hti.pt.x = (short) LOWORD(GetMessagePos()); - hti.pt.y = (short) HIWORD(GetMessagePos()); - ScreenToClient(((LPNMHDR) lParam)->hwndFrom, &hti.pt); - if (TreeView_HitTest(((LPNMHDR) lParam)->hwndFrom, &hti)) - if (hti.flags & TVHT_ONITEMSTATEICON) { - TVITEM tvi; - tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE; - tvi.hItem = hti.hItem; - TreeView_GetItem(((LPNMHDR) lParam)->hwndFrom, &tvi); - tvi.iImage = tvi.iSelectedImage = tvi.iImage == 1 ? 2 : 1; - TreeView_SetItem(((LPNMHDR) lParam)->hwndFrom, &tvi); - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - } - } - break; - case 0: - if (((LPNMHDR) lParam)->code == PSN_APPLY ) { - int i; - DWORD exStyle = 0; - for (i = 0; i < SIZEOF(checkBoxToStyleEx); i++) - if ((IsDlgButtonChecked(hwndDlg, checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not) - exStyle |= checkBoxToStyleEx[i].flag; - - DBWriteContactSettingDword(NULL, "CLC", "ExStyle", exStyle); - { - DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS)); - DBWriteContactSettingDword(NULL, "CLC", "FullGreyoutFlags", fullGreyoutFlags); - if (IsDlgButtonChecked(hwndDlg, IDC_GREYOUT)) - DBWriteContactSettingDword(NULL, "CLC", "GreyoutFlags", fullGreyoutFlags); - else - DBWriteContactSettingDword(NULL, "CLC", "GreyoutFlags", 0); - } - DBWriteContactSettingByte(NULL, "CLC", "ShowIdle", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0)); - DBWriteContactSettingDword(NULL, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS))); - DBWriteContactSettingByte(NULL, "CLC", "LeftMargin", - (BYTE) SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0)); - DBWriteContactSettingWord(NULL, "CLC", "ScrollTime", - (WORD) SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0)); - DBWriteContactSettingByte(NULL, "CLC", "GroupIndent", - (BYTE) SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0)); - DBWriteContactSettingByte(NULL, "CLC", "NoVScrollBar", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0)); - DBWriteContactSettingByte(NULL, "CLC", "RowHeight", (BYTE) SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0)); - DBWriteContactSettingByte(NULL, "CLC", "GammaCorrect", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT)); - pcli->pfnClcOptionsChanged(); - return TRUE; - } - break; - } - break; - case WM_DESTROY: - ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), TVSIL_NORMAL)); - break; - } - return FALSE; -} - -static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - CheckDlgButton(hwndDlg, IDC_BITMAP, - DBGetContactSettingByte(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP) ? BST_CHECKED : BST_UNCHECKED); - SendMessage(hwndDlg, WM_USER + 10, 0, 0); - SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_BKCOLOUR); - SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR)); - SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELBKCOLOUR); - SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, - DBGetContactSettingDword(NULL, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR)); - CheckDlgButton(hwndDlg, IDC_WINCOLOUR, DBGetContactSettingByte(NULL, "CLC", "UseWinColours", 0)); - SendMessage(hwndDlg, WM_USER + 11, 0, 0); - { - DBVARIANT dbv; - if (!DBGetContactSettingString(NULL, "CLC", "BkBitmap", &dbv)) { - SetDlgItemTextA(hwndDlg, IDC_FILENAME, dbv.pszVal); - if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) { - char szPath[MAX_PATH]; - - if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) dbv.pszVal, (LPARAM) szPath)) - SetDlgItemTextA(hwndDlg, IDC_FILENAME, szPath); - } - DBFreeVariant(&dbv); - } - } - { - WORD bmpUse = DBGetContactSettingWord(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE); - CheckDlgButton(hwndDlg, IDC_STRETCHH, bmpUse & CLB_STRETCHH ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_STRETCHV, bmpUse & CLB_STRETCHV ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_TILEH, bmpUse & CLBF_TILEH ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_TILEV, bmpUse & CLBF_TILEV ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SCROLL, bmpUse & CLBF_SCROLL ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_PROPORTIONAL, bmpUse & CLBF_PROPORTIONAL ? BST_CHECKED : BST_UNCHECKED); - } - { - HRESULT(STDAPICALLTYPE * MySHAutoComplete) (HWND, DWORD); - MySHAutoComplete = (HRESULT(STDAPICALLTYPE *) (HWND, DWORD)) GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete"); - if (MySHAutoComplete) - MySHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1); - } - return TRUE; - case WM_USER + 10: - EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAME), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - EnableWindow(GetDlgItem(hwndDlg, IDC_STRETCHH), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - EnableWindow(GetDlgItem(hwndDlg, IDC_STRETCHV), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - EnableWindow(GetDlgItem(hwndDlg, IDC_TILEH), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - EnableWindow(GetDlgItem(hwndDlg, IDC_TILEV), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SCROLL), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - EnableWindow(GetDlgItem(hwndDlg, IDC_PROPORTIONAL), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - break; - case WM_USER + 11: - { - BOOL b = IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR); - EnableWindow(GetDlgItem(hwndDlg, IDC_BKGCOLOUR), !b); - EnableWindow(GetDlgItem(hwndDlg, IDC_SELCOLOUR), !b); - break; - } - case WM_COMMAND: - if (LOWORD(wParam) == IDC_BROWSE) { - char str[MAX_PATH]; - OPENFILENAMEA ofn = { 0 }; - char filter[512]; - - GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, SIZEOF(str)); - ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; - ofn.hwndOwner = hwndDlg; - ofn.hInstance = NULL; - CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, SIZEOF(filter), (LPARAM) filter); - ofn.lpstrFilter = filter; - ofn.lpstrFile = str; - ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; - ofn.nMaxFile = SIZEOF(str); - ofn.nMaxFileTitle = MAX_PATH; - ofn.lpstrDefExt = "bmp"; - if (!GetOpenFileNameA(&ofn)) - break; - SetDlgItemTextA(hwndDlg, IDC_FILENAME, str); - } - else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) - break; - if (LOWORD(wParam) == IDC_BITMAP) - SendMessage(hwndDlg, WM_USER + 10, 0, 0); - if (LOWORD(wParam) == IDC_WINCOLOUR) - SendMessage(hwndDlg, WM_USER + 11, 0, 0); - if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())) - return 0; - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - case WM_NOTIFY: - switch (((LPNMHDR) lParam)->idFrom) { - case 0: - switch (((LPNMHDR) lParam)->code) { - case PSN_APPLY: - DBWriteContactSettingByte(NULL, "CLC", "UseBitmap", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); - { - COLORREF col; - col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0); - if (col == CLCDEFAULT_BKCOLOUR) - DBDeleteContactSetting(NULL, "CLC", "BkColour"); - else - DBWriteContactSettingDword(NULL, "CLC", "BkColour", col); - col = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0); - if (col == CLCDEFAULT_SELBKCOLOUR) - DBDeleteContactSetting(NULL, "CLC", "SelBkColour"); - else - DBWriteContactSettingDword(NULL, "CLC", "SelBkColour", col); - DBWriteContactSettingByte(NULL, "CLC", "UseWinColours", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR))); - } - { - char str[MAX_PATH], strrel[MAX_PATH]; - GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, SIZEOF(str)); - if (ServiceExists(MS_UTILS_PATHTORELATIVE)) { - if (CallService(MS_UTILS_PATHTORELATIVE, (WPARAM) str, (LPARAM) strrel)) - DBWriteContactSettingString(NULL, "CLC", "BkBitmap", strrel); - else - DBWriteContactSettingString(NULL, "CLC", "BkBitmap", str); - } - else - DBWriteContactSettingString(NULL, "CLC", "BkBitmap", str); - } - { - WORD flags = 0; - if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH)) - flags |= CLB_STRETCHH; - if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHV)) - flags |= CLB_STRETCHV; - if (IsDlgButtonChecked(hwndDlg, IDC_TILEH)) - flags |= CLBF_TILEH; - if (IsDlgButtonChecked(hwndDlg, IDC_TILEV)) - flags |= CLBF_TILEV; - if (IsDlgButtonChecked(hwndDlg, IDC_SCROLL)) - flags |= CLBF_SCROLL; - if (IsDlgButtonChecked(hwndDlg, IDC_PROPORTIONAL)) - flags |= CLBF_PROPORTIONAL; - DBWriteContactSettingWord(NULL, "CLC", "BkBmpUse", flags); - } - pcli->pfnClcOptionsChanged(); - return TRUE; - } - break; - } - break; - } - return FALSE; -} - -/****************************************************************************************/ - -int ClcOptInit(WPARAM wParam, LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp; - - ZeroMemory(&odp, sizeof(odp)); - odp.cbSize = sizeof(odp); - odp.position = 0; - odp.hInstance = g_hInst; - odp.pszGroup = LPGEN("Contact List"); - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC); - odp.pszTitle = LPGEN("List"); - odp.pfnDlgProc = DlgProcClcMainOpts; - odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY; - Options_AddPage(wParam, &odp); - - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLCBKG); - odp.pszTitle = LPGEN("List Background"); - odp.pfnDlgProc = DlgProcClcBkgOpts; - odp.flags = ODPF_BOLDGROUPS; - Options_AddPage(wParam, &odp); - - return 0; -} - -int ClcModernOptInit(WPARAM wParam, LPARAM lParam) -{ - static int iBoldControls[] = - { - IDC_TXT_TITLE1, IDC_TXT_TITLE2, - MODERNOPT_CTRL_LAST - }; - - MODERNOPTOBJECT obj = {0}; - - obj.cbSize = sizeof(obj); - obj.dwFlags = MODEROPT_FLG_TCHAR; - obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - obj.hInstance = g_hInst; - obj.iSection = MODERNOPT_PAGE_SKINS; - obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE; - obj.lptzSubsection = LPGENT("Contact List"); - obj.iBoldControls = iBoldControls; - obj.lpzHelpUrl = "http://wiki.miranda-im.org/"; - - obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_CLCBKG); - obj.pfnDlgProc = DlgProcClcBkgOpts; - CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); - return 0; -} diff --git a/plugins/Clist_classic/clcpaint.cpp b/plugins/Clist_classic/clcpaint.cpp deleted file mode 100644 index dfa4147244..0000000000 --- a/plugins/Clist_classic/clcpaint.cpp +++ /dev/null @@ -1,596 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ -#include "commonheaders.h" - -extern HIMAGELIST himlCListClc; -static BYTE divide3[765] = { 255 }; - -static void ChangeToFont(HDC hdc, struct ClcData *dat, int id, int *fontHeight) -{ - SelectObject(hdc, dat->fontInfo[id].hFont); - SetTextColor(hdc, dat->fontInfo[id].colour); - if (fontHeight) - *fontHeight = dat->fontInfo[id].fontHeight; -} - -static void __inline SetHotTrackColour(HDC hdc, struct ClcData *dat) -{ - if (dat->gammaCorrection) { - COLORREF oldCol, newCol; - int oldLum, newLum; - - oldCol = GetTextColor(hdc); - oldLum = (GetRValue(oldCol) * 30 + GetGValue(oldCol) * 59 + GetBValue(oldCol) * 11) / 100; - newLum = (GetRValue(dat->hotTextColour) * 30 + GetGValue(dat->hotTextColour) * 59 + GetBValue(dat->hotTextColour) * 11) / 100; - if (newLum == 0) { - SetTextColor(hdc, dat->hotTextColour); - return; - } - if (newLum >= oldLum + 20) { - oldLum += 20; - newCol = - RGB(GetRValue(dat->hotTextColour) * oldLum / newLum, GetGValue(dat->hotTextColour) * oldLum / newLum, - GetBValue(dat->hotTextColour) * oldLum / newLum); - } - else if (newLum <= oldLum) { - int r, g, b; - r = GetRValue(dat->hotTextColour) * oldLum / newLum; - g = GetGValue(dat->hotTextColour) * oldLum / newLum; - b = GetBValue(dat->hotTextColour) * oldLum / newLum; - if (r > 255) { - g += (r - 255) * 3 / 7; - b += (r - 255) * 3 / 7; - r = 255; - } - if (g > 255) { - r += (g - 255) * 59 / 41; - if (r > 255) - r = 255; - b += (g - 255) * 59 / 41; - g = 255; - } - if (b > 255) { - r += (b - 255) * 11 / 89; - if (r > 255) - r = 255; - g += (b - 255) * 11 / 89; - if (g > 255) - g = 255; - b = 255; - } - newCol = RGB(r, g, b); - } - else - newCol = dat->hotTextColour; - SetTextColor(hdc, newCol); - } - else - SetTextColor(hdc, dat->hotTextColour); -} - -static int GetStatusOnlineness(int status) -{ - switch (status) { - case ID_STATUS_FREECHAT: return 110; - case ID_STATUS_ONLINE: return 100; - case ID_STATUS_OCCUPIED: return 60; - case ID_STATUS_ONTHEPHONE: return 50; - case ID_STATUS_DND: return 40; - case ID_STATUS_AWAY: return 30; - case ID_STATUS_OUTTOLUNCH: return 20; - case ID_STATUS_NA: return 10; - case ID_STATUS_INVISIBLE: return 5; - } - return 0; -} - -static int GetGeneralisedStatus(void) -{ - int i, status, thisStatus, statusOnlineness, thisOnlineness; - - status = ID_STATUS_OFFLINE; - statusOnlineness = 0; - - for (i = 0; i < pcli->hClcProtoCount; i++) { - thisStatus = pcli->clcProto[i].dwStatus; - if (thisStatus == ID_STATUS_INVISIBLE) - return ID_STATUS_INVISIBLE; - thisOnlineness = GetStatusOnlineness(thisStatus); - if (thisOnlineness > statusOnlineness) { - status = thisStatus; - statusOnlineness = thisOnlineness; - } - } - return status; -} - -static int GetRealStatus(struct ClcContact *contact, int status) -{ - int i; - char *szProto = contact->proto; - if (!szProto) - return status; - for (i = 0; i < pcli->hClcProtoCount; i++) { - if (!lstrcmpA(pcli->clcProto[i].szProto, szProto)) { - return pcli->clcProto[i].dwStatus; - } - } - return status; -} - -static HMODULE themeAPIHandle = NULL; // handle to uxtheme.dll -static HANDLE(WINAPI * MyOpenThemeData) (HWND, LPCWSTR); -static HRESULT(WINAPI * MyCloseThemeData) (HANDLE); -static HRESULT(WINAPI * MyDrawThemeBackground) (HANDLE, HDC, int, int, const RECT *, const RECT *); - -#define MGPROC(x) GetProcAddress(themeAPIHandle,x) -void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) -{ - HDC hdcMem; - RECT clRect; - int i, y, indent, index, fontHeight; - struct ClcGroup *group; - HBITMAP hBmpOsb, hOldBitmap; - HFONT hOldFont; - DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE); - int status = GetGeneralisedStatus(); - int grey = 0, groupCountsFontTopShift; - HBRUSH hBrushAlternateGrey = NULL; - // yes I know about GetSysColorBrush() - COLORREF tmpbkcolour = style & CLS_CONTACTLIST ? (dat->useWindowsColours ? GetSysColor(COLOR_3DFACE) : dat->bkColour) : dat->bkColour; - int minHeight = 16; - for (i = 0; i < FONTID_LAST; i++) { - if (minHeight < dat->fontInfo[i].fontHeight) { - minHeight = dat->fontInfo[i].fontHeight; - } - } - if (dat->rowHeight < minHeight) { - dat->rowHeight = minHeight; - } - - if (dat->greyoutFlags & pcli->pfnClcStatusToPf2(status) || style & WS_DISABLED) - grey = 1; - else if (GetFocus() != hwnd && dat->greyoutFlags & GREYF_UNFOCUS) - grey = 1; - GetClientRect(hwnd, &clRect); - if (rcPaint == NULL) - rcPaint = &clRect; - if (IsRectEmpty(rcPaint)) - return; - y = -dat->yScroll; - hdcMem = CreateCompatibleDC(hdc); - hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), NULL); - hOldBitmap = (HBITMAP)SelectObject(hdcMem, hBmpOsb); - { - TEXTMETRIC tm; - hOldFont = (HFONT)SelectObject(hdcMem, dat->fontInfo[FONTID_GROUPS].hFont); - GetTextMetrics(hdcMem, &tm); - groupCountsFontTopShift = tm.tmAscent; - SelectObject(hdcMem, dat->fontInfo[FONTID_GROUPCOUNTS].hFont); - GetTextMetrics(hdcMem, &tm); - groupCountsFontTopShift -= tm.tmAscent; - } - if (style & CLS_GREYALTERNATE) - hBrushAlternateGrey = - CreateSolidBrush(GetNearestColor(hdcMem, RGB(GetRValue(tmpbkcolour) - 10, GetGValue(tmpbkcolour) - 10, GetBValue(tmpbkcolour) - 10))); - - ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); - SetBkMode(hdcMem, TRANSPARENT); - { - HBRUSH hBrush; - - hBrush = CreateSolidBrush(tmpbkcolour); - FillRect(hdcMem, rcPaint, hBrush); - DeleteObject(hBrush); - if (dat->hBmpBackground) { - BITMAP bmp; - HDC hdcBmp; - int x, y; - int maxx, maxy; - int destw, desth; - - // XXX: Halftone isnt supported on 9x, however the scretch problems dont happen on 98. - SetStretchBltMode(hdcMem, HALFTONE); - - GetObject(dat->hBmpBackground, sizeof(bmp), &bmp); - hdcBmp = CreateCompatibleDC(hdcMem); - SelectObject(hdcBmp, dat->hBmpBackground); - y = dat->backgroundBmpUse & CLBF_SCROLL ? -dat->yScroll : 0; - maxx = dat->backgroundBmpUse & CLBF_TILEH ? clRect.right : 1; - maxy = dat->backgroundBmpUse & CLBF_TILEV ? maxy = rcPaint->bottom : y + 1; - switch (dat->backgroundBmpUse & CLBM_TYPE) { - case CLB_STRETCH: - if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) { - if (clRect.right * bmp.bmHeight < clRect.bottom * bmp.bmWidth) { - desth = clRect.bottom; - destw = desth * bmp.bmWidth / bmp.bmHeight; - } - else { - destw = clRect.right; - desth = destw * bmp.bmHeight / bmp.bmWidth; - } - } - else { - destw = clRect.right; - desth = clRect.bottom; - } - break; - case CLB_STRETCHH: - if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) { - destw = clRect.right; - desth = destw * bmp.bmHeight / bmp.bmWidth; - } - else { - destw = clRect.right; - desth = bmp.bmHeight; - } - break; - case CLB_STRETCHV: - if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) { - desth = clRect.bottom; - destw = desth * bmp.bmWidth / bmp.bmHeight; - } - else { - destw = bmp.bmWidth; - desth = clRect.bottom; - } - break; - default: //clb_topleft - destw = bmp.bmWidth; - desth = bmp.bmHeight; - break; - } - for (; y < maxy; y += desth) { - if (y < rcPaint->top - desth) - continue; - for (x = 0; x < maxx; x += destw) - StretchBlt(hdcMem, x, y, destw, desth, hdcBmp, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY); - } - DeleteDC(hdcBmp); - } - } - group = &dat->list; - group->scanIndex = 0; - indent = 0; - for (index = 0; y < rcPaint->bottom;) { - if (group->scanIndex == group->cl.count) { - group = group->parent; - indent--; - if (group == NULL) - break; - group->scanIndex++; - continue; - } - if (y > rcPaint->top - dat->rowHeight) { - int iImage = -1; - int selected = index == dat->selection && (dat->showSelAlways || dat->exStyle & CLS_EX_SHOWSELALWAYS || GetFocus() == hwnd) - && group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER; - int hottrack = dat->exStyle & CLS_EX_TRACKSELECT && group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER && dat->iHotTrack == index; - SIZE textSize, countsSize, spaceSize; - int width, checkboxWidth; - char *szCounts; - - //alternating grey - if (style & CLS_GREYALTERNATE && index & 1) { - RECT rc; - rc.top = y; - rc.bottom = rc.top + dat->rowHeight; - rc.left = 0; - rc.right = clRect.right; - FillRect(hdcMem, &rc, hBrushAlternateGrey); - } - - //setup - if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) - ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight); - else if (group->cl.items[group->scanIndex]->type == CLCIT_INFO) { - if (group->cl.items[group->scanIndex]->flags & CLCIIF_GROUPFONT) - ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight); - else - ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); - } - else if (group->cl.items[group->scanIndex]->type == CLCIT_DIVIDER) - ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight); - else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST) - ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight); - else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && - ((group->cl.items[group->scanIndex]->flags & CONTACTF_INVISTO - && GetRealStatus(group->cl.items[group->scanIndex], status) != ID_STATUS_INVISIBLE) - || (group->cl.items[group->scanIndex]->flags & CONTACTF_VISTO - && GetRealStatus(group->cl.items[group->scanIndex], status) == ID_STATUS_INVISIBLE) - ) - ) { - // the contact is in the always visible list and the proto is invisible - // the contact is in the always invisible and the proto is in any other mode - ChangeToFont(hdcMem, dat, group->cl.items[group->scanIndex]->flags & CONTACTF_ONLINE ? FONTID_INVIS : FONTID_OFFINVIS, &fontHeight); - } - else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && !(group->cl.items[group->scanIndex]->flags & CONTACTF_ONLINE)) - ChangeToFont(hdcMem, dat, FONTID_OFFLINE, &fontHeight); - else - ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); - GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, lstrlen(group->cl.items[group->scanIndex]->szText), &textSize); - width = textSize.cx; - if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { - szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]); - if (szCounts[0]) { - GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize); - ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight); - GetTextExtentPoint32A(hdcMem, szCounts, lstrlenA(szCounts), &countsSize); - width += spaceSize.cx + countsSize.cx; - } - } - - if ((style & CLS_CHECKBOXES && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) || - (style & CLS_GROUPCHECKBOXES && group->cl.items[group->scanIndex]->type == CLCIT_GROUP) || - (group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->flags & CLCIIF_CHECKBOX)) - checkboxWidth = dat->checkboxSize + 2; - else - checkboxWidth = 0; - - //background - if (selected) { - int x = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace - 2; - ImageList_DrawEx(dat->himlHighlight, 0, hdcMem, x, y, min(width + 5, clRect.right - x), dat->rowHeight, CLR_NONE, CLR_NONE, - dat->exStyle & CLS_EX_NOTRANSLUCENTSEL ? ILD_NORMAL : ILD_BLEND25); - SetTextColor(hdcMem, dat->selTextColour); - } - else if (hottrack) - SetHotTrackColour(hdcMem, dat); - - //checkboxes - if (checkboxWidth) { - RECT rc; - HANDLE hTheme = NULL; - - // THEME - if (IsWinVerXPPlus()) { - if (!themeAPIHandle) { - themeAPIHandle = GetModuleHandleA("uxtheme"); - if (themeAPIHandle) { - MyOpenThemeData = (HANDLE(WINAPI *) (HWND, LPCWSTR)) MGPROC("OpenThemeData"); - MyCloseThemeData = (HRESULT(WINAPI *) (HANDLE)) MGPROC("CloseThemeData"); - MyDrawThemeBackground = - (HRESULT(WINAPI *) (HANDLE, HDC, int, int, const RECT *, const RECT *)) MGPROC("DrawThemeBackground"); - } - } - // Make sure all of these methods are valid (i would hope either all or none work) - if (MyOpenThemeData && MyCloseThemeData && MyDrawThemeBackground) { - hTheme = MyOpenThemeData(hwnd, L"BUTTON"); - } - } - rc.left = dat->leftMargin + indent * dat->groupIndent; - rc.right = rc.left + dat->checkboxSize; - rc.top = y + ((dat->rowHeight - dat->checkboxSize) >> 1); - rc.bottom = rc.top + dat->checkboxSize; - if (hTheme) { - MyDrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? (hottrack ? CBS_CHECKEDHOT : CBS_CHECKEDNORMAL) : (hottrack ? CBS_UNCHECKEDHOT : CBS_UNCHECKEDNORMAL), &rc, &rc); - } - else - DrawFrameControl(hdcMem, &rc, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_FLAT | (group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? DFCS_CHECKED : 0) | (hottrack ? DFCS_HOT : 0)); - if (hTheme && MyCloseThemeData) { - MyCloseThemeData(hTheme); - hTheme = NULL; - } - } - - //icon - if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) - iImage = group->cl.items[group->scanIndex]->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT; - else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) - iImage = group->cl.items[group->scanIndex]->iImage; - if (iImage != -1) { - /*COLORREF colourFg=dat->selBkColour; - int mode=ILD_NORMAL; - if(selected) mode=ILD_SELECTED; - else if(hottrack) {mode=ILD_FOCUS; colourFg=dat->hotTextColour;} - else if(group->cl.items[group->scanIndex]->type==CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags&CONTACTF_NOTONLIST) {colourFg=dat->fontInfo[FONTID_NOTONLIST].colour; mode=ILD_BLEND50;} - ImageList_DrawEx(himlCListClc,iImage,hdcMem,dat->leftMargin+indent*dat->groupIndent+checkboxWidth,y+((dat->rowHeight-16)>>1),0,0,CLR_NONE,colourFg,mode); - */ - // this doesnt use CLS_CONTACTLIST since the colour prolly wont match anyway - COLORREF colourFg = dat->selBkColour; - int mode = ILD_NORMAL; - if (hottrack) { - colourFg = dat->hotTextColour; - } - else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST) { - colourFg = dat->fontInfo[FONTID_NOTONLIST].colour; - mode = ILD_BLEND50; - } - if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && dat->showIdle - && (group->cl.items[group->scanIndex]->flags & CONTACTF_IDLE) - && GetRealStatus(group->cl.items[group->scanIndex], ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) - mode = ILD_SELECTED; - ImageList_DrawEx(himlCListClc, iImage, hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth, - y + ((dat->rowHeight - 16) >> 1), 0, 0, CLR_NONE, colourFg, mode); - } - - //text - if (group->cl.items[group->scanIndex]->type == CLCIT_DIVIDER) { - RECT rc; - rc.top = y + (dat->rowHeight >> 1); - rc.bottom = rc.top + 2; - rc.left = dat->leftMargin + indent * dat->groupIndent; - rc.right = rc.left + ((clRect.right - rc.left - textSize.cx) >> 1) - 3; - DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); - TextOut(hdcMem, rc.right + 3, y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText, - lstrlen(group->cl.items[group->scanIndex]->szText)); - rc.left = rc.right + 6 + textSize.cx; - rc.right = clRect.right; - DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); - } - else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { - RECT rc; - if (szCounts[0]) { - fontHeight = dat->fontInfo[FONTID_GROUPS].fontHeight; - rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace; - rc.right = min(clRect.right - countsSize.cx, rc.left + textSize.cx + spaceSize.cx); - rc.top = y + ((dat->rowHeight - fontHeight) >> 1); - rc.bottom = rc.top + textSize.cy; - if (rc.right < rc.left + 4) - rc.right = clRect.right + 1; - else - TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, lstrlenA(szCounts)); - ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight); - if (selected) - SetTextColor(hdcMem, dat->selTextColour); - else if (hottrack) - SetHotTrackColour(hdcMem, dat); - rc.right--; - ExtTextOut(hdcMem, rc.left, rc.top, ETO_CLIPPED, &rc, group->cl.items[group->scanIndex]->szText, - lstrlen(group->cl.items[group->scanIndex]->szText), NULL); - } - else - TextOut(hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace, - y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText, - lstrlen(group->cl.items[group->scanIndex]->szText)); - if (dat->exStyle & CLS_EX_LINEWITHGROUPS) { - rc.top = y + (dat->rowHeight >> 1); - rc.bottom = rc.top + 2; - rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace + width + 3; - rc.right = clRect.right - 1 - dat->extraColumnSpacing * dat->extraColumnsCount; - if (rc.right - rc.left > 1) - DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); - } - } - else { - TCHAR *szText = group->cl.items[group->scanIndex]->szText; - RECT rc; - rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace; - rc.top = y + ((dat->rowHeight - fontHeight) >> 1); - rc.right = (clRect.right - clRect.left); - rc.bottom = rc.top; - DrawText(hdcMem, szText, lstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE); - } - if (selected) { - if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER) { - TCHAR *szText = group->cl.items[group->scanIndex]->szText; - RECT rc; - int qlen = lstrlen(dat->szQuickSearch); - SetTextColor(hdcMem, dat->quickSearchColour); - rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace; - rc.top = y + ((dat->rowHeight - fontHeight) >> 1); - rc.right = (clRect.right - clRect.left); - rc.bottom = rc.top; - if (qlen) - DrawText(hdcMem, szText, qlen, &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE); - } - } - - //extra icons - for (iImage = 0; iImage < dat->extraColumnsCount; iImage++) { - COLORREF colourFg = dat->selBkColour; - int mode = ILD_NORMAL; - if (group->cl.items[group->scanIndex]->iExtraImage[iImage] == 0xFF) - continue; - if (selected) - mode = ILD_SELECTED; - else if (hottrack) { - mode = ILD_FOCUS; - colourFg = dat->hotTextColour; - } - else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST) { - colourFg = dat->fontInfo[FONTID_NOTONLIST].colour; - mode = ILD_BLEND50; - } - ImageList_DrawEx(dat->himlExtraColumns, group->cl.items[group->scanIndex]->iExtraImage[iImage], hdcMem, - clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - iImage), y + ((dat->rowHeight - 16) >> 1), 0, 0, - CLR_NONE, colourFg, mode); - } - } - index++; - y += dat->rowHeight; - if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) { - group = group->cl.items[group->scanIndex]->group; - indent++; - group->scanIndex = 0; - continue; - } - group->scanIndex++; - } - if (dat->iInsertionMark != -1) { //insertion mark - HBRUSH hBrush; - POINT pts[8]; - HRGN hRgn; - - pts[0].x = dat->leftMargin; - pts[0].y = dat->iInsertionMark * dat->rowHeight - dat->yScroll - 4; - pts[1].x = pts[0].x + 2; - pts[1].y = pts[0].y + 3; - pts[2].x = clRect.right - 4; - pts[2].y = pts[1].y; - pts[3].x = clRect.right - 1; - pts[3].y = pts[0].y - 1; - pts[4].x = pts[3].x; - pts[4].y = pts[0].y + 7; - pts[5].x = pts[2].x + 1; - pts[5].y = pts[1].y + 2; - pts[6].x = pts[1].x; - pts[6].y = pts[5].y; - pts[7].x = pts[0].x; - pts[7].y = pts[4].y; - hRgn = CreatePolygonRgn(pts, SIZEOF(pts), ALTERNATE); - hBrush = CreateSolidBrush(dat->fontInfo[FONTID_CONTACTS].colour); - FillRgn(hdcMem, hRgn, hBrush); - DeleteObject(hBrush); - DeleteObject(hRgn); - } - if (!grey) - BitBlt(hdc, rcPaint->left, rcPaint->top, rcPaint->right - rcPaint->left, rcPaint->bottom - rcPaint->top, hdcMem, rcPaint->left, rcPaint->top, - SRCCOPY); - SelectObject(hdcMem,hOldBitmap); - SelectObject(hdcMem,hOldFont); - DeleteDC(hdcMem); - if (hBrushAlternateGrey) - DeleteObject(hBrushAlternateGrey); - if (grey) { - PBYTE bits; - BITMAPINFOHEADER bmih = { 0 }; - int i; - int greyRed, greyGreen, greyBlue; - COLORREF greyColour; - bmih.biBitCount = 32; - bmih.biSize = sizeof(bmih); - bmih.biCompression = BI_RGB; - bmih.biHeight = -clRect.bottom; - bmih.biPlanes = 1; - bmih.biWidth = clRect.right; - bits = (PBYTE) malloc(4 * bmih.biWidth * -bmih.biHeight); - GetDIBits(hdc, hBmpOsb, 0, clRect.bottom, bits, (BITMAPINFO *) & bmih, DIB_RGB_COLORS); - greyColour = GetSysColor(COLOR_3DFACE); - greyRed = GetRValue(greyColour) * 2; - greyGreen = GetGValue(greyColour) * 2; - greyBlue = GetBValue(greyColour) * 2; - if (divide3[0] == 255) { - for (i = 0; i < SIZEOF(divide3); i++) - divide3[i] = (i + 1) / 3; - } - for (i = 4 * clRect.right * clRect.bottom - 4; i >= 0; i -= 4) { - bits[i] = divide3[bits[i] + greyBlue]; - bits[i + 1] = divide3[bits[i + 1] + greyGreen]; - bits[i + 2] = divide3[bits[i + 2] + greyRed]; - } - SetDIBitsToDevice(hdc, 0, 0, clRect.right, clRect.bottom, 0, 0, 0, clRect.bottom, bits, (BITMAPINFO *) & bmih, DIB_RGB_COLORS); - free(bits); - } - DeleteObject(hBmpOsb); -} diff --git a/plugins/Clist_classic/clist-translation.txt b/plugins/Clist_classic/clist-translation.txt deleted file mode 100644 index f213719525..0000000000 --- a/plugins/Clist_classic/clist-translation.txt +++ /dev/null @@ -1,166 +0,0 @@ -; Common strings that belong to many files -;[Contact List] -;[Groups] -;[Status Bar] -;[Window] - -; ../../plugins/Clist/clcfonts.c -;[Background] -;[Contacts which are 'not on list'] -;[Dividers] -;[Group member counts] -;[Hottrack Text] -;[Offline contacts] -;[Offline contacts to whom you have a different visibility] -;[Online contacts to whom you have a different visibility] -;[Quicksearch Text] -;[Selected Text] -;[Standard contacts] - -; ../../plugins/Clist/clcopts.c -;[Away] -;[DND] -;[Free for chat] -;[Invisible] -;[List] -;[List Background] -;[NA] -;[Not focused] -;[Occupied] -;[Offline] -;[On the phone] -;[Online] -;[Out to lunch] - -; ../../plugins/Clist/clistopts.c -;[Global] - -; ../../plugins/Clist/resource.rc -;[% of screen] -;[&Away\tCtrl+2] -;[&DND\tCtrl+5] -;[&Delete Group] -;[&Free for chat\tCtrl+6] -;[&Hide Offline Users] -;[&Hide Offline Users in here] -;[&Hide/Show] -;[&Invisible\tCtrl+7] -;[&NA\tCtrl+3] -;[&New Group] -;[&New Subgroup] -;[&Offline\tCtrl+0] -;[&Rename Group] -;[&Status] -;['Hide Offline' means to hide:] -;[Active opacity:] -;[Always on top] -;[Always show status in tooltip] -;[Are you sure you want to delete %s?] -;[Ask before deleting contacts] -;[Automatically resize window to height of list] -;[Background colour] -;[Contact List Background] -;[Contact List Sorting] -;[Contact list background:] -;[Contact list:] -;[Cycle icons every] -;[Delete Contact] -;[Dim idle contacts] -;[Disable &Groups] -;[Disable drag and drop of items] -;[Disable groups] -;[Disable icon blinking] -;[Disable rename of items by clicking twice] -;[Draw a line alongside group names] -;[E&xit] -;[Easy move] -;[Enable docking] -;[Fade contact list in/out] -;[Gamma correction] -;[Grey out entire list when:] -;[Group] -;[Hide &Empty Groups] -;[Hide &Offline Users out here] -;[Hide Miranda] -;[Hide contact list after it has been idle for] -;[Hide empty groups] -;[Hide from list only, in order to keep their history and ignore/visibility settings] -;[Hide group counts when there are none online] -;[Hide offline users] -;[Hide vertical scroll bar] -;[Hot track items as mouse passes over] -;[If window is partially covered, bring iy to front] -;[If window is partially covered, bring to front instead of hiding] -;[Inactive opacity:] -;[Indent groups by:] -;[Items] -;[Left margin:] -;[Make sections equal width] -;[Make selection highlight translucent] -;[Minimize to tray] -;[No] -;[Nowhere] -;[Occ&upied\tCtrl+4] -;[On the &Phone\tCtrl+8] -;[On&line\tCtrl+1] -;[Only when statuses differ] -;[Ordering:] -;[Out to &Lunch\tCtrl+9] -;[Pin to desktop] -;[Quicksearch in open groups only] -;[Right click opens Miranda IM menu] -;[Right click opens status menu] -;[Row height:] -;[Scroll list smoothly] -;[Scroll with text] -;[Selection colour] -;[Show] -;[Show bevels on panels] -;[Show counts of number of contacts in a group] -;[Show divider between online and offline contacts] -;[Show drop shadow (restart required)] -;[Show icons] -;[Show menu bar] -;[Show multiple icons] -;[Show protocol names] -;[Show resize grip indicator] -;[Show selection even when list is not focused] -;[Show status bar] -;[Show status text] -;[Show title bar] -;[Single click interface] -;[Size upwards] -;[Slider2] -;[Sort contacts by name] -;[Sort contacts by protocol] -;[Sort contacts by status] -;[Sort groups alphabetically] -;[Spin1] -;[Spin5] -;[Stretch proportionally] -;[Stretch to height] -;[Stretch to width] -;[System tray icon] -;[System tray icon when using multiple protocols] -;[This will erase all history and settings for this contact!] -;[Tile horizontally] -;[Tile vertically] -;[Time:] -;[Title bar text:] -;[Tool style main window] -;[Translucency options (Windows 2000/XP only)] -;[Transparent contact list] -;[Tray] -;[Use Options->Ignore (expert mode) to unhide contacts.] -;[Use Windows colours] -;[Use background image] -;[Visual] -;[Window:] -;[Yes] -;[icon when statuses differ] -;[maximum] -;[milliseconds] -;[ms delay] -;[pixels] -;[seconds] -;[seconds, when statuses differ] diff --git a/plugins/Clist_classic/clist_10.vcxproj b/plugins/Clist_classic/clist_10.vcxproj index 10bb364568..c11911c4da 100644 --- a/plugins/Clist_classic/clist_10.vcxproj +++ b/plugins/Clist_classic/clist_10.vcxproj @@ -80,10 +80,9 @@ true Fast Use - commonheaders.h + src\commonheaders.h Level3 EditAndContinue - 4996;%(DisableSpecificWarnings) _DEBUG;%(PreprocessorDefinitions) @@ -114,9 +113,8 @@ true Fast Use - commonheaders.h + src\commonheaders.h Level3 - 4996;%(DisableSpecificWarnings) _DEBUG;%(PreprocessorDefinitions) @@ -148,9 +146,8 @@ true Fast Use - commonheaders.h + src\commonheaders.h Level3 - 4996;4100;%(DisableSpecificWarnings) NDEBUG;%(PreprocessorDefinitions) @@ -184,9 +181,8 @@ true Fast Use - commonheaders.h + src\commonheaders.h Level3 - 4996;4100;%(DisableSpecificWarnings) NDEBUG;%(PreprocessorDefinitions) @@ -209,20 +205,20 @@ - - - - - - - + + + + + + + Create - - - + + + @@ -231,8 +227,8 @@ - - + + diff --git a/plugins/Clist_classic/clist_10.vcxproj.filters b/plugins/Clist_classic/clist_10.vcxproj.filters index e69d846fc1..fa8001046e 100644 --- a/plugins/Clist_classic/clist_10.vcxproj.filters +++ b/plugins/Clist_classic/clist_10.vcxproj.filters @@ -15,36 +15,36 @@ - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Source Files - + Header Files - + Header Files - + Header Files @@ -63,10 +63,10 @@ - + Resource Files - + Resource Files diff --git a/plugins/Clist_classic/clist_classic-translation.txt b/plugins/Clist_classic/clist_classic-translation.txt deleted file mode 100644 index 2ccfedb7e5..0000000000 --- a/plugins/Clist_classic/clist_classic-translation.txt +++ /dev/null @@ -1,166 +0,0 @@ -; Common strings that belong to many files -;[Contact List] -;[Groups] -;[Status Bar] -;[Window] - -; ../../plugins/Clist_classic/clcfonts.cpp -;[Background] -;[Contacts which are 'not on list'] -;[Dividers] -;[Group member counts] -;[Hottrack Text] -;[Offline contacts] -;[Offline contacts to whom you have a different visibility] -;[Online contacts to whom you have a different visibility] -;[Quicksearch Text] -;[Selected Text] -;[Standard contacts] - -; ../../plugins/Clist_classic/clcopts.cpp -;[Away] -;[DND] -;[Free for chat] -;[Invisible] -;[List] -;[List Background] -;[NA] -;[Not focused] -;[Occupied] -;[Offline] -;[On the phone] -;[Online] -;[Out to lunch] - -; ../../plugins/Clist_classic/clistopts.cpp -;[Global] - -; ../../plugins/Clist_classic/resource.rc -;[% of screen] -;[&Away\tCtrl+2] -;[&DND\tCtrl+5] -;[&Delete Group] -;[&Free for chat\tCtrl+6] -;[&Hide Offline Users] -;[&Hide Offline Users in here] -;[&Hide/Show] -;[&Invisible\tCtrl+7] -;[&NA\tCtrl+3] -;[&New Group] -;[&New Subgroup] -;[&Offline\tCtrl+0] -;[&Rename Group] -;[&Status] -;['Hide Offline' means to hide:] -;[Active opacity:] -;[Always on top] -;[Always show status in tooltip] -;[Are you sure you want to delete %s?] -;[Ask before deleting contacts] -;[Automatically resize window to height of list] -;[Background colour] -;[Contact List Background] -;[Contact List Sorting] -;[Contact list background:] -;[Contact list:] -;[Cycle icons every] -;[Delete Contact] -;[Dim idle contacts] -;[Disable &Groups] -;[Disable drag and drop of items] -;[Disable groups] -;[Disable icon blinking] -;[Disable rename of items by clicking twice] -;[Draw a line alongside group names] -;[E&xit] -;[Easy move] -;[Enable docking] -;[Fade contact list in/out] -;[Gamma correction] -;[Grey out entire list when:] -;[Group] -;[Hide &Empty Groups] -;[Hide &Offline Users out here] -;[Hide Miranda] -;[Hide contact list after it has been idle for] -;[Hide empty groups] -;[Hide from list only, in order to keep their history and ignore/visibility settings] -;[Hide group counts when there are none online] -;[Hide offline users] -;[Hide vertical scroll bar] -;[Hot track items as mouse passes over] -;[If window is partially covered, bring iy to front] -;[If window is partially covered, bring to front instead of hiding] -;[Inactive opacity:] -;[Indent groups by:] -;[Items] -;[Left margin:] -;[Make sections equal width] -;[Make selection highlight translucent] -;[Minimize to tray] -;[No] -;[Nowhere] -;[Occ&upied\tCtrl+4] -;[On the &Phone\tCtrl+8] -;[On&line\tCtrl+1] -;[Only when statuses differ] -;[Ordering:] -;[Out to &Lunch\tCtrl+9] -;[Pin to desktop] -;[Quicksearch in open groups only] -;[Right click opens Miranda IM menu] -;[Right click opens status menu] -;[Row height:] -;[Scroll list smoothly] -;[Scroll with text] -;[Selection colour] -;[Show] -;[Show bevels on panels] -;[Show counts of number of contacts in a group] -;[Show divider between online and offline contacts] -;[Show drop shadow (restart required)] -;[Show icons] -;[Show menu bar] -;[Show multiple icons] -;[Show protocol names] -;[Show resize grip indicator] -;[Show selection even when list is not focused] -;[Show status bar] -;[Show status text] -;[Show title bar] -;[Single click interface] -;[Size upwards] -;[Slider2] -;[Sort contacts by name] -;[Sort contacts by protocol] -;[Sort contacts by status] -;[Sort groups alphabetically] -;[Spin1] -;[Spin5] -;[Stretch proportionally] -;[Stretch to height] -;[Stretch to width] -;[System tray icon] -;[System tray icon when using multiple protocols] -;[This will erase all history and settings for this contact!] -;[Tile horizontally] -;[Tile vertically] -;[Time:] -;[Title bar text:] -;[Tool style main window] -;[Translucency options (Windows 2000/XP only)] -;[Transparent contact list] -;[Tray] -;[Use Options->Ignore (expert mode) to unhide contacts.] -;[Use Windows colours] -;[Use background image] -;[Visual] -;[Window:] -;[Yes] -;[icon when statuses differ] -;[maximum] -;[milliseconds] -;[ms delay] -;[pixels] -;[seconds] -;[seconds, when statuses differ] diff --git a/plugins/Clist_classic/clistmenus.cpp b/plugins/Clist_classic/clistmenus.cpp deleted file mode 100644 index 76be7e93e4..0000000000 --- a/plugins/Clist_classic/clistmenus.cpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ -#include "commonheaders.h" - -INT_PTR CloseAction(WPARAM wParam,LPARAM lParam) -{ - if (CallService(MS_SYSTEM_OKTOEXIT,(WPARAM)0,(LPARAM)0)) - DestroyWindow(pcli->hwndContactList); - - return(0); -} - -void InitCustomMenus() -{ - CreateServiceFunction( "CloseAction", CloseAction ); -} diff --git a/plugins/Clist_classic/clistopts.cpp b/plugins/Clist_classic/clistopts.cpp deleted file mode 100644 index 83079d6d75..0000000000 --- a/plugins/Clist_classic/clistopts.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ -#include "commonheaders.h" - -static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_USER + 1: - { - HANDLE hContact = (HANDLE) wParam; - DBCONTACTWRITESETTING *ws = (DBCONTACTWRITESETTING *) lParam; - if (hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL - && lstrcmpiA(ws->szModule, "CList") == 0 && lstrcmpiA(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg)) { - CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, ws->value.bVal == 0); - } - break; - } - case WM_DESTROY: - { - UnhookEvent((HANDLE) GetWindowLongPtr(hwndDlg, GWLP_USERDATA)); - break; - } - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1)); - CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, - DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, - DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, - DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED); - CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) - && !DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS, - DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SORTBYPROTO, - DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, - DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_AUTOHIDE, - DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - { - DWORD caps = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS1, 0); - if (!(caps & CLUIF_HIDEEMPTYGROUPS)) - ShowWindow(GetDlgItem(hwndDlg, IDC_HIDEEMPTYGROUPS), SW_HIDE); - if (!(caps & CLUIF_DISABLEGROUPS)) - ShowWindow(GetDlgItem(hwndDlg, IDC_DISABLEGROUPS), SW_HIDE); - if (caps & CLUIF_HASONTOPOPTION) - ShowWindow(GetDlgItem(hwndDlg, IDC_ONTOP), SW_HIDE); - if (caps & CLUIF_HASAUTOHIDEOPTION) { - ShowWindow(GetDlgItem(hwndDlg, IDC_AUTOHIDE), SW_HIDE); - ShowWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), SW_HIDE); - ShowWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), SW_HIDE); - ShowWindow(GetDlgItem(hwndDlg, IDC_STAUTOHIDESECS), SW_HIDE); - } - } - SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1)); - SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, - MAKELONG(DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0)); - CheckDlgButton(hwndDlg, IDC_ONECLK, - DBGetContactSettingByte(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, - DBGetContactSettingByte(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, - !DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_DONTCYCLE, - DBGetContactSettingByte(NULL, "CList", "TrayIcon", - SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CYCLE, - DBGetContactSettingByte(NULL, "CList", "TrayIcon", - SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_MULTITRAY, - DBGetContactSettingByte(NULL, "CList", "TrayIcon", - SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, - DBGetContactSettingByte(NULL, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKTIME), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKSPIN), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); - EnableWindow(GetDlgItem(hwndDlg, IDC_STMSDELAY), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); - CheckDlgButton(hwndDlg, IDC_ICONBLINK, DBGetContactSettingByte(NULL, "CList", "NoIconBlink", 0) == 1 ? BST_CHECKED : BST_UNCHECKED); - if (IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE)) { - EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), FALSE); - } - if (IsDlgButtonChecked(hwndDlg, IDC_CYCLE)) { - EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), FALSE); - } - if (IsDlgButtonChecked(hwndDlg, IDC_MULTITRAY)) { - EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), FALSE); - } - SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETRANGE, 0, MAKELONG(120, 1)); - SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0, - MAKELONG(DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0)); - { - int i, count, item; - PROTOACCOUNT **accs; - DBVARIANT dbv = { DBVT_DELETED }; - DBGetContactSetting(NULL, "CList", "PrimaryStatus", &dbv); - CallService( MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accs); - item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Global")); - SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) 0); - for (i = 0; i < count; i++) { - if (!IsAccountEnabled(accs[i]) || CallProtoService( accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0) - continue; - item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) accs[i]->tszAccountName); - SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) accs[i]); - if (dbv.type == DBVT_ASCIIZ && !lstrcmpA(dbv.pszVal, accs[i]->szModuleName)) - SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, item, 0); - } - DBFreeVariant(&dbv); - } - if (-1 == (int) SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0)) - SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, 0, 0); - SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETBUDDY, (WPARAM) GetDlgItem(hwndDlg, IDC_BLINKTIME), 0); // set buddy - SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETRANGE, 0, MAKELONG(0x3FFF, 250)); - SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550), 0)); - return TRUE; - case WM_COMMAND: - if (LOWORD(wParam) == IDC_AUTOHIDE) { - EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - } - if (LOWORD(wParam) == IDC_DONTCYCLE || LOWORD(wParam) == IDC_CYCLE || LOWORD(wParam) == IDC_MULTITRAY) { - EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), IsDlgButtonChecked(hwndDlg, IDC_CYCLE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_CYCLE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), IsDlgButtonChecked(hwndDlg, IDC_MULTITRAY)); - } - if (LOWORD(wParam) == IDC_DISABLEBLINK) { - EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKTIME), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); - EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKSPIN), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); - EnableWindow(GetDlgItem(hwndDlg, IDC_STMSDELAY), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); - } - if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_CYCLETIME) && HIWORD(wParam) != EN_CHANGE) - break; - if (LOWORD(wParam) == IDC_PRIMARYSTATUS && HIWORD(wParam) != CBN_SELCHANGE) - break; - if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_CYCLETIME) && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())) - return 0; - if (LOWORD(wParam) == IDC_BLINKTIME && HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()) - return 0; // dont make apply enabled during buddy set crap - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - case WM_NOTIFY: - switch (((LPNMHDR) lParam)->idFrom) { - case 0: - switch (((LPNMHDR) lParam)->code) { - case PSN_APPLY: - DBWriteContactSettingByte(NULL, "CList", "HideOffline", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE)); - { - DWORD caps = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS1, 0); - if (caps & CLUIF_HIDEEMPTYGROUPS) - DBWriteContactSettingByte(NULL, "CList", "HideEmptyGroups", - (BYTE) IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS)); - if (caps & CLUIF_DISABLEGROUPS) - DBWriteContactSettingByte(NULL, "CList", "UseGroups", (BYTE) ! IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS)); - if (!(caps & CLUIF_HASONTOPOPTION)) { - DBWriteContactSettingByte(NULL, "CList", "OnTop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONTOP)); - SetWindowPos( pcli->hwndContactList, - IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, - SWP_NOMOVE | SWP_NOSIZE); - } - if (!(caps & CLUIF_HASAUTOHIDEOPTION)) { - DBWriteContactSettingByte(NULL, "CList", "AutoHide", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - DBWriteContactSettingWord(NULL, "CList", "HideTime", - (WORD) SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0)); - } - } - DBWriteContactSettingByte(NULL, "CList", "SortByStatus", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SORTBYSTATUS)); - DBWriteContactSettingByte(NULL, "CList", "SortByProto", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SORTBYPROTO)); - DBWriteContactSettingByte(NULL, "CList", "ConfirmDelete", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE)); - DBWriteContactSettingByte(NULL, "CList", "Tray1Click", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONECLK)); - DBWriteContactSettingByte(NULL, "CList", "AlwaysStatus", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS)); - DBWriteContactSettingByte(NULL, "CList", "AlwaysMulti", (BYTE) ! IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI)); - DBWriteContactSettingByte(NULL, "CList", "TrayIcon", - (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE - : (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE : - SETTING_TRAYICON_MULTI))); - DBWriteContactSettingWord(NULL, "CList", "CycleTime", - (WORD) SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0)); - DBWriteContactSettingWord(NULL, "CList", "IconFlashTime", - (WORD) SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0)); - DBWriteContactSettingByte(NULL, "CList", "DisableTrayFlash", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); - DBWriteContactSettingByte(NULL, "CList", "NoIconBlink", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK)); - { - int cur = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0); - PROTOACCOUNT* pa = ( PROTOACCOUNT* )SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cur, 0 ); - if ( pa == NULL ) - DBDeleteContactSetting(NULL, "CList", "PrimaryStatus"); - else - DBWriteContactSettingString(NULL, "CList", "PrimaryStatus", pa->szModuleName ); - } - - pcli->pfnTrayIconIconsChanged(); - pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */ - pcli->pfnInvalidateDisplayNameCacheEntry( INVALID_HANDLE_VALUE ); /* force reshuffle */ - return TRUE; - } - break; - } - break; - } - return FALSE; -} - -/****************************************************************************************/ - -static UINT expertOnlyControls[] = { IDC_ALWAYSSTATUS }; - -int CListOptInit(WPARAM wParam, LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp = { 0 }; - odp.cbSize = sizeof(odp); - odp.position = -1000000000; - odp.hInstance = g_hInst; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST); - odp.pszTitle = LPGEN("Contact List"); - odp.pfnDlgProc = DlgProcGenOpts; - odp.flags = ODPF_BOLDGROUPS; - odp.nIDBottomSimpleControl = IDC_STCLISTGROUP; - odp.expertOnlyControls = expertOnlyControls; - odp.nExpertOnlyControls = SIZEOF(expertOnlyControls); - Options_AddPage(wParam, &odp); - return 0; -} - -int CListModernOptInit(WPARAM wParam, LPARAM lParam) -{ - static int iBoldControls[] = - { - IDC_TXT_TITLE1, IDC_TXT_TITLE2, - MODERNOPT_CTRL_LAST - }; - - MODERNOPTOBJECT obj = {0}; - - obj.cbSize = sizeof(obj); - obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE; - obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - obj.hInstance = g_hInst; - obj.iSection = MODERNOPT_PAGE_CLIST; - obj.iType = MODERNOPT_TYPE_SECTIONPAGE; - obj.iBoldControls = iBoldControls; - obj.lpzClassicGroup = "Contact List"; - obj.lpzClassicPage = "List"; - obj.lpzHelpUrl = "http://wiki.miranda-im.org/"; - - obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_CLIST); - obj.pfnDlgProc = DlgProcGenOpts; - CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); - return 0; -} diff --git a/plugins/Clist_classic/cluiopts.cpp b/plugins/Clist_classic/cluiopts.cpp deleted file mode 100644 index e0b7bdbdee..0000000000 --- a/plugins/Clist_classic/cluiopts.cpp +++ /dev/null @@ -1,394 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2010 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ -#include "commonheaders.h" - -extern BOOL(WINAPI * MySetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD); - -static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, - DBGetContactSettingByte(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_TOOLWND, - DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_MIN2TRAY, - DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) - EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE); - CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, - DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, - DBGetContactSettingByte(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, - DBGetContactSettingByte(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) { - EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), FALSE); - } - CheckDlgButton(hwndDlg, IDC_FADEINOUT, DBGetContactSettingByte(NULL, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_AUTOSIZE, DBGetContactSettingByte(NULL, "CLUI", "AutoSize", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_DROPSHADOW, DBGetContactSettingByte(NULL, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_ONDESKTOP, DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_DISABLEDOCKING, DBGetContactSettingByte(NULL, "CLUI", "DockToSides", 1) ? BST_CHECKED : BST_UNCHECKED); - SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0)); - SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, DBGetContactSettingByte(NULL, "CLUI", "MaxSizeHeight", 75)); - CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, DBGetContactSettingByte(NULL, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_AUTOHIDE, - DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1)); - SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, - MAKELONG(DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0)); - EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - if (!IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)) { - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC21), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC22), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZEHEIGHT), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZESPIN), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOSIZEUPWARD), FALSE); - } - - { DBVARIANT dbv; - if ( !DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv)) { - SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal); - DBFreeVariant( &dbv ); - } - else SetDlgItemTextA(hwndDlg, IDC_TITLETEXT, MIRANDANAME); - } - if (!IsWinVer2000Plus()) { - EnableWindow(GetDlgItem(hwndDlg, IDC_FADEINOUT), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENT), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_DROPSHADOW), FALSE); - } - else - CheckDlgButton(hwndDlg, IDC_TRANSPARENT, - DBGetContactSettingByte(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); - - if (!IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) { - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), FALSE); - } - SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255)); - SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255)); - SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, DBGetContactSettingByte(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT)); - SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE, - DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT)); - SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0); - return TRUE; - - case WM_COMMAND: - if (LOWORD(wParam) == IDC_AUTOHIDE) { - EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - } - else if (LOWORD(wParam) == IDC_TRANSPARENT) { - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); - EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); - EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); - EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); - } - else if (LOWORD(wParam) == IDC_AUTOSIZE) { - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC21), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC22), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZEHEIGHT), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); - EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOSIZEUPWARD), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); - } - else if (LOWORD(wParam) == IDC_TOOLWND) { - EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)); - } - else if (LOWORD(wParam) == IDC_SHOWCAPTION) { - EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND) - && IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)); - EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)); - } - - if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_TITLETEXT || LOWORD(wParam) == IDC_MAXSIZEHEIGHT) && - (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())) - return 0; - - // Enable apply button - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - - case WM_HSCROLL: - { - char str[10]; - wsprintfA(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); - SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str); - wsprintfA(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); - SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str); - } - if (wParam != 0x12345678) - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - case WM_NOTIFY: - if (((LPNMHDR) lParam)->code == PSN_APPLY) - { - DBWriteContactSettingByte(NULL, "CList", "OnTop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONTOP)); - DBWriteContactSettingByte(NULL, "CList", "ToolWindow", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)); - DBWriteContactSettingByte(NULL, "CList", "BringToFront", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT)); - DBWriteContactSettingByte(NULL, "CLUI", "FadeInOut", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT)); - DBWriteContactSettingByte(NULL, "CLUI", "AutoSize", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); - DBWriteContactSettingByte(NULL, "CLUI", "MaxSizeHeight", (BYTE) GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, NULL, FALSE)); - DBWriteContactSettingByte(NULL, "CLUI", "AutoSizeUpward", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD)); - DBWriteContactSettingByte(NULL, "CList", "AutoHide", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); - DBWriteContactSettingWord(NULL, "CList", "HideTime", (WORD) SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0)); - DBWriteContactSettingByte(NULL, "CList", "Transparent", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); - DBWriteContactSettingByte(NULL, "CList", "Alpha", (BYTE) SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0)); - DBWriteContactSettingByte(NULL, "CList", "AutoAlpha", (BYTE) SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0)); - DBWriteContactSettingByte(NULL, "CList", "WindowShadow", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW)); - DBWriteContactSettingByte(NULL, "CList", "OnDesktop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)); - DBWriteContactSettingByte(NULL, "CLUI", "DockToSides", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DISABLEDOCKING)); - DBWriteContactSettingByte(NULL, "CLUI", "ShowCaption", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)); - DBWriteContactSettingByte(NULL, "CLUI", "ShowMainMenu", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU)); - DBWriteContactSettingByte(NULL, "CLUI", "ClientAreaDrag", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG)); - DBWriteContactSettingByte(NULL, "CList", "Min2Tray", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY)); - { - TCHAR title[256]; - GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, SIZEOF(title)); - DBWriteContactSettingTString(NULL, "CList", "TitleText", title); - SetWindowText(pcli->hwndContactList, title); - } - - pcli->pfnLoadCluiGlobalOpts(); - SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, - 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); - - if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) - { - // Window must be hidden to dynamically remove the taskbar button. - // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp - WINDOWPLACEMENT p; - p.length = sizeof(p); - GetWindowPlacement(pcli->hwndContactList, &p); - ShowWindow(pcli->hwndContactList, SW_HIDE); - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, - GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_APPWINDOW | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE); - SetWindowPlacement(pcli->hwndContactList, &p); - } - else - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW); - - if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) - { - HWND hProgMan = FindWindow(_T("Progman"), NULL); - if (hProgMan) - SetParent(pcli->hwndContactList, hProgMan); - } - else - SetParent(pcli->hwndContactList, NULL); - - if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) - { - int style = GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; - SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, style); - } - else - { - SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, - GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)); - } - - if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU)) - SetMenu(pcli->hwndContactList, NULL); - else - SetMenu(pcli->hwndContactList, pcli->hMenuMain); - - SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_FRAME | RDW_INVALIDATE); - - if (IsIconic(pcli->hwndContactList) && !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) - ShowWindow(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW); - if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) - { - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); - if (MySetLayeredWindowAttributes) - MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), - (BYTE) DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), - LWA_ALPHA); - } - else - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED); - - SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged - - return TRUE; - } - break; - } - return FALSE; -} - -static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) -{ - switch (msg) { - case WM_INITDIALOG: - TranslateDialogDefault(hwndDlg); - CheckDlgButton(hwndDlg, IDC_SHOWSBAR, DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED); - { - BYTE showOpts = DBGetContactSettingByte(NULL, "CLUI", "SBarShow", 1); - CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED); - } - CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, DBGetContactSettingByte(NULL, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED); - CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, !IsDlgButtonChecked(hwndDlg, IDC_RIGHTSTATUS) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, DBGetContactSettingByte(NULL, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwndDlg, IDC_SHOWGRIP, DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED); - if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) { - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_SBPANELBEVEL), FALSE); - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWGRIP), FALSE); - } - return TRUE; - case WM_COMMAND: - if (LOWORD(wParam) == IDC_SHOWSBAR) { - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SBPANELBEVEL), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWGRIP), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - } - SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); - break; - case WM_NOTIFY: - if (((LPNMHDR) lParam)->code == PSN_APPLY ) { - DBWriteContactSettingByte(NULL, "CLUI", "ShowSBar", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); - DBWriteContactSettingByte(NULL, "CLUI", "SBarShow", - (BYTE) ((IsDlgButtonChecked(hwndDlg, IDC_SHOWICON) ? 1 : 0) | - (IsDlgButtonChecked(hwndDlg, IDC_SHOWPROTO) ? 2 : 0) | - (IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUS) ? 4 : 0))); - DBWriteContactSettingByte(NULL, "CLUI", "SBarRightClk", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA)); - DBWriteContactSettingByte(NULL, "CLUI", "EqualSections", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS)); - DBWriteContactSettingByte(NULL, "CLUI", "SBarBevel", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL)); - pcli->pfnLoadCluiGlobalOpts(); - if (DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) != (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) { - HWND parent = GetParent(pcli->hwndStatus); - int flags = WS_CHILD | CCS_BOTTOM; - DBWriteContactSettingByte(NULL, "CLUI", "ShowGrip", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)); - ShowWindow(pcli->hwndStatus, SW_HIDE); - DestroyWindow(pcli->hwndStatus); - flags |= DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0; - flags |= DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0; - pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, parent, NULL, g_hInst, NULL); - } - if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) - ShowWindow(pcli->hwndStatus, SW_SHOW); - else - ShowWindow(pcli->hwndStatus, SW_HIDE); - SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); - return TRUE; - } - break; - } - return FALSE; -} - -/****************************************************************************************/ - -static UINT expertOnlyControls[] = -{ - IDC_BRINGTOFRONT, IDC_AUTOSIZE, IDC_STATIC21, IDC_MAXSIZEHEIGHT, IDC_MAXSIZESPIN, - IDC_STATIC22, IDC_AUTOSIZEUPWARD, IDC_SHOWMAINMENU, IDC_SHOWCAPTION, IDC_CLIENTDRAG -}; - -int CluiOptInit(WPARAM wParam, LPARAM lParam) -{ - OPTIONSDIALOGPAGE odp = { 0 }; - odp.cbSize = sizeof(odp); - odp.position = 0; - odp.hInstance = g_hInst; - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI); - odp.pszTitle = LPGEN("Window"); - odp.pszGroup = LPGEN("Contact List"); - odp.pfnDlgProc = DlgProcCluiOpts; - odp.flags = ODPF_BOLDGROUPS; - odp.nIDBottomSimpleControl = IDC_STWINDOWGROUP; - odp.expertOnlyControls = expertOnlyControls; - odp.nExpertOnlyControls = SIZEOF(expertOnlyControls); - Options_AddPage(wParam, &odp); - - odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SBAR); - odp.pszTitle = LPGEN("Status Bar"); - odp.pfnDlgProc = DlgProcSBarOpts; - odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY; - odp.nIDBottomSimpleControl = 0; - odp.nExpertOnlyControls = 0; - odp.expertOnlyControls = NULL; - Options_AddPage(wParam, &odp); - return 0; -} - -int CluiModernOptInit(WPARAM wParam, LPARAM lParam) -{ - static int iBoldControls[] = - { - IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_SHOWSBAR, - MODERNOPT_CTRL_LAST - }; - - MODERNOPTOBJECT obj = {0}; - - obj.cbSize = sizeof(obj); - obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE; - obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); - obj.hInstance = g_hInst; - obj.iSection = MODERNOPT_PAGE_CLIST; - obj.iType = MODERNOPT_TYPE_SECTIONPAGE; - obj.iBoldControls = iBoldControls; - obj.lpzClassicGroup = "Contact List"; - obj.lpzClassicPage = "List"; - obj.lpzHelpUrl = "http://wiki.miranda-im.org/"; - - obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_CLUI); - obj.pfnDlgProc = DlgProcCluiOpts; - CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); - - obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_SBAR); - obj.pfnDlgProc = DlgProcSBarOpts; - CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); - return 0; -} diff --git a/plugins/Clist_classic/commonheaders.h b/plugins/Clist_classic/commonheaders.h deleted file mode 100644 index 7382317420..0000000000 --- a/plugins/Clist_classic/commonheaders.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2005 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ - -#define MIRANDA_VER 0x0A00 - -#define _WIN32_WINNT 0x0600 -#define _WIN32_IE 0x0501 - -#include "m_stdhdr.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "clc.h" -#include "version.h" -#include "resource.h" - -// shared vars -extern HINSTANCE g_hInst; - -/* most free()'s are invalid when the code is executed from a dll, so this changes - all the bad free()'s to good ones, however it's still incorrect code. The reasons for not - changing them include: - - * DBFreeVariant has a CallService() lookup - * free() is executed in some large loops to do with clist creation of group data - * easy search and replace - -*/ diff --git a/plugins/Clist_classic/docs/clist-translation.txt b/plugins/Clist_classic/docs/clist-translation.txt new file mode 100644 index 0000000000..f213719525 --- /dev/null +++ b/plugins/Clist_classic/docs/clist-translation.txt @@ -0,0 +1,166 @@ +; Common strings that belong to many files +;[Contact List] +;[Groups] +;[Status Bar] +;[Window] + +; ../../plugins/Clist/clcfonts.c +;[Background] +;[Contacts which are 'not on list'] +;[Dividers] +;[Group member counts] +;[Hottrack Text] +;[Offline contacts] +;[Offline contacts to whom you have a different visibility] +;[Online contacts to whom you have a different visibility] +;[Quicksearch Text] +;[Selected Text] +;[Standard contacts] + +; ../../plugins/Clist/clcopts.c +;[Away] +;[DND] +;[Free for chat] +;[Invisible] +;[List] +;[List Background] +;[NA] +;[Not focused] +;[Occupied] +;[Offline] +;[On the phone] +;[Online] +;[Out to lunch] + +; ../../plugins/Clist/clistopts.c +;[Global] + +; ../../plugins/Clist/resource.rc +;[% of screen] +;[&Away\tCtrl+2] +;[&DND\tCtrl+5] +;[&Delete Group] +;[&Free for chat\tCtrl+6] +;[&Hide Offline Users] +;[&Hide Offline Users in here] +;[&Hide/Show] +;[&Invisible\tCtrl+7] +;[&NA\tCtrl+3] +;[&New Group] +;[&New Subgroup] +;[&Offline\tCtrl+0] +;[&Rename Group] +;[&Status] +;['Hide Offline' means to hide:] +;[Active opacity:] +;[Always on top] +;[Always show status in tooltip] +;[Are you sure you want to delete %s?] +;[Ask before deleting contacts] +;[Automatically resize window to height of list] +;[Background colour] +;[Contact List Background] +;[Contact List Sorting] +;[Contact list background:] +;[Contact list:] +;[Cycle icons every] +;[Delete Contact] +;[Dim idle contacts] +;[Disable &Groups] +;[Disable drag and drop of items] +;[Disable groups] +;[Disable icon blinking] +;[Disable rename of items by clicking twice] +;[Draw a line alongside group names] +;[E&xit] +;[Easy move] +;[Enable docking] +;[Fade contact list in/out] +;[Gamma correction] +;[Grey out entire list when:] +;[Group] +;[Hide &Empty Groups] +;[Hide &Offline Users out here] +;[Hide Miranda] +;[Hide contact list after it has been idle for] +;[Hide empty groups] +;[Hide from list only, in order to keep their history and ignore/visibility settings] +;[Hide group counts when there are none online] +;[Hide offline users] +;[Hide vertical scroll bar] +;[Hot track items as mouse passes over] +;[If window is partially covered, bring iy to front] +;[If window is partially covered, bring to front instead of hiding] +;[Inactive opacity:] +;[Indent groups by:] +;[Items] +;[Left margin:] +;[Make sections equal width] +;[Make selection highlight translucent] +;[Minimize to tray] +;[No] +;[Nowhere] +;[Occ&upied\tCtrl+4] +;[On the &Phone\tCtrl+8] +;[On&line\tCtrl+1] +;[Only when statuses differ] +;[Ordering:] +;[Out to &Lunch\tCtrl+9] +;[Pin to desktop] +;[Quicksearch in open groups only] +;[Right click opens Miranda IM menu] +;[Right click opens status menu] +;[Row height:] +;[Scroll list smoothly] +;[Scroll with text] +;[Selection colour] +;[Show] +;[Show bevels on panels] +;[Show counts of number of contacts in a group] +;[Show divider between online and offline contacts] +;[Show drop shadow (restart required)] +;[Show icons] +;[Show menu bar] +;[Show multiple icons] +;[Show protocol names] +;[Show resize grip indicator] +;[Show selection even when list is not focused] +;[Show status bar] +;[Show status text] +;[Show title bar] +;[Single click interface] +;[Size upwards] +;[Slider2] +;[Sort contacts by name] +;[Sort contacts by protocol] +;[Sort contacts by status] +;[Sort groups alphabetically] +;[Spin1] +;[Spin5] +;[Stretch proportionally] +;[Stretch to height] +;[Stretch to width] +;[System tray icon] +;[System tray icon when using multiple protocols] +;[This will erase all history and settings for this contact!] +;[Tile horizontally] +;[Tile vertically] +;[Time:] +;[Title bar text:] +;[Tool style main window] +;[Translucency options (Windows 2000/XP only)] +;[Transparent contact list] +;[Tray] +;[Use Options->Ignore (expert mode) to unhide contacts.] +;[Use Windows colours] +;[Use background image] +;[Visual] +;[Window:] +;[Yes] +;[icon when statuses differ] +;[maximum] +;[milliseconds] +;[ms delay] +;[pixels] +;[seconds] +;[seconds, when statuses differ] diff --git a/plugins/Clist_classic/docs/clist_classic-translation.txt b/plugins/Clist_classic/docs/clist_classic-translation.txt new file mode 100644 index 0000000000..2ccfedb7e5 --- /dev/null +++ b/plugins/Clist_classic/docs/clist_classic-translation.txt @@ -0,0 +1,166 @@ +; Common strings that belong to many files +;[Contact List] +;[Groups] +;[Status Bar] +;[Window] + +; ../../plugins/Clist_classic/clcfonts.cpp +;[Background] +;[Contacts which are 'not on list'] +;[Dividers] +;[Group member counts] +;[Hottrack Text] +;[Offline contacts] +;[Offline contacts to whom you have a different visibility] +;[Online contacts to whom you have a different visibility] +;[Quicksearch Text] +;[Selected Text] +;[Standard contacts] + +; ../../plugins/Clist_classic/clcopts.cpp +;[Away] +;[DND] +;[Free for chat] +;[Invisible] +;[List] +;[List Background] +;[NA] +;[Not focused] +;[Occupied] +;[Offline] +;[On the phone] +;[Online] +;[Out to lunch] + +; ../../plugins/Clist_classic/clistopts.cpp +;[Global] + +; ../../plugins/Clist_classic/resource.rc +;[% of screen] +;[&Away\tCtrl+2] +;[&DND\tCtrl+5] +;[&Delete Group] +;[&Free for chat\tCtrl+6] +;[&Hide Offline Users] +;[&Hide Offline Users in here] +;[&Hide/Show] +;[&Invisible\tCtrl+7] +;[&NA\tCtrl+3] +;[&New Group] +;[&New Subgroup] +;[&Offline\tCtrl+0] +;[&Rename Group] +;[&Status] +;['Hide Offline' means to hide:] +;[Active opacity:] +;[Always on top] +;[Always show status in tooltip] +;[Are you sure you want to delete %s?] +;[Ask before deleting contacts] +;[Automatically resize window to height of list] +;[Background colour] +;[Contact List Background] +;[Contact List Sorting] +;[Contact list background:] +;[Contact list:] +;[Cycle icons every] +;[Delete Contact] +;[Dim idle contacts] +;[Disable &Groups] +;[Disable drag and drop of items] +;[Disable groups] +;[Disable icon blinking] +;[Disable rename of items by clicking twice] +;[Draw a line alongside group names] +;[E&xit] +;[Easy move] +;[Enable docking] +;[Fade contact list in/out] +;[Gamma correction] +;[Grey out entire list when:] +;[Group] +;[Hide &Empty Groups] +;[Hide &Offline Users out here] +;[Hide Miranda] +;[Hide contact list after it has been idle for] +;[Hide empty groups] +;[Hide from list only, in order to keep their history and ignore/visibility settings] +;[Hide group counts when there are none online] +;[Hide offline users] +;[Hide vertical scroll bar] +;[Hot track items as mouse passes over] +;[If window is partially covered, bring iy to front] +;[If window is partially covered, bring to front instead of hiding] +;[Inactive opacity:] +;[Indent groups by:] +;[Items] +;[Left margin:] +;[Make sections equal width] +;[Make selection highlight translucent] +;[Minimize to tray] +;[No] +;[Nowhere] +;[Occ&upied\tCtrl+4] +;[On the &Phone\tCtrl+8] +;[On&line\tCtrl+1] +;[Only when statuses differ] +;[Ordering:] +;[Out to &Lunch\tCtrl+9] +;[Pin to desktop] +;[Quicksearch in open groups only] +;[Right click opens Miranda IM menu] +;[Right click opens status menu] +;[Row height:] +;[Scroll list smoothly] +;[Scroll with text] +;[Selection colour] +;[Show] +;[Show bevels on panels] +;[Show counts of number of contacts in a group] +;[Show divider between online and offline contacts] +;[Show drop shadow (restart required)] +;[Show icons] +;[Show menu bar] +;[Show multiple icons] +;[Show protocol names] +;[Show resize grip indicator] +;[Show selection even when list is not focused] +;[Show status bar] +;[Show status text] +;[Show title bar] +;[Single click interface] +;[Size upwards] +;[Slider2] +;[Sort contacts by name] +;[Sort contacts by protocol] +;[Sort contacts by status] +;[Sort groups alphabetically] +;[Spin1] +;[Spin5] +;[Stretch proportionally] +;[Stretch to height] +;[Stretch to width] +;[System tray icon] +;[System tray icon when using multiple protocols] +;[This will erase all history and settings for this contact!] +;[Tile horizontally] +;[Tile vertically] +;[Time:] +;[Title bar text:] +;[Tool style main window] +;[Translucency options (Windows 2000/XP only)] +;[Transparent contact list] +;[Tray] +;[Use Options->Ignore (expert mode) to unhide contacts.] +;[Use Windows colours] +;[Use background image] +;[Visual] +;[Window:] +;[Yes] +;[icon when statuses differ] +;[maximum] +;[milliseconds] +;[ms delay] +;[pixels] +;[seconds] +;[seconds, when statuses differ] diff --git a/plugins/Clist_classic/init.cpp b/plugins/Clist_classic/init.cpp deleted file mode 100644 index 3e497d1739..0000000000 --- a/plugins/Clist_classic/init.cpp +++ /dev/null @@ -1,180 +0,0 @@ -/* - -Miranda IM: the free IM client for Microsoft* Windows* - -Copyright 2000-2005 Miranda ICQ/IM project, -all portions of this codebase are copyrighted to the people -listed in contributors.txt. - -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. -*/ - -#include "commonheaders.h" - -HINSTANCE g_hInst = 0; -CLIST_INTERFACE* pcli = NULL; -HIMAGELIST himlCListClc = NULL; -int hLangpack; - -BOOL(WINAPI * MySetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD) = NULL; - -///////////////////////////////////////////////////////////////////////////////////////// -// external functions - -void RegisterCListFonts( void ); -void InitCustomMenus( void ); -void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint); - -int ClcOptInit(WPARAM wParam, LPARAM lParam); -int ClcModernOptInit(WPARAM wParam, LPARAM lParam); -int CluiOptInit(WPARAM wParam, LPARAM lParam); -int CluiModernOptInit(WPARAM wParam, LPARAM lParam); -int CListOptInit(WPARAM wParam, LPARAM lParam); -int CListModernOptInit(WPARAM wParam, LPARAM lParam); - -///////////////////////////////////////////////////////////////////////////////////////// -// dll stub - -BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved) -{ - g_hInst = hInstDLL; - return TRUE; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// returns the plugin information - -PLUGININFOEX pluginInfo = { - sizeof(PLUGININFOEX), - "Classic contact list", - __VERSION_DWORD, - "Display contacts, event notifications, protocol status.", - "Miranda IM project", - "ghazan@miranda-im.org", - "Copyright 2000-2008 Miranda IM project", - "http://www.miranda-im.org", - UNICODE_AWARE, - //{240A91DC-9464-457a-9787-FF1EA88E77E3} - {0x240a91dc, 0x9464, 0x457a, { 0x97, 0x87, 0xff, 0x1e, 0xa8, 0x8e, 0x77, 0xe3 }} -}; - -extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) -{ - return &pluginInfo; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// returns plugin's interfaces information - -static const MUUID interfaces[] = {MIID_CLIST, MIID_LAST}; -extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void) -{ - return interfaces; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// called when number of accounts has been changed - -static int OnAccountsChanged( WPARAM wParam, LPARAM lParam ) -{ - himlCListClc = (HIMAGELIST) CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// called when all modules got loaded - -static int OnModernOptsInit(WPARAM wParam, LPARAM lParam); -static int OnModulesLoaded( WPARAM wParam, LPARAM lParam ) -{ - HookEvent(ME_MODERNOPT_INITIALIZE, OnModernOptsInit); - RegisterCListFonts(); - himlCListClc = (HIMAGELIST) CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// options iniatialization - -static int OnOptsInit(WPARAM wParam, LPARAM lParam) -{ - ClcOptInit(wParam, lParam); - CluiOptInit(wParam, lParam); - CListOptInit(wParam, lParam); - return 0; -} - -static int OnModernOptsInit(WPARAM wParam, LPARAM lParam) -{ - ClcModernOptInit(wParam, lParam); - CListModernOptInit(wParam, lParam); - CluiModernOptInit(wParam, lParam); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// menu status services - -static INT_PTR GetStatusMode(WPARAM wParam, LPARAM lParam) -{ - return pcli->currentDesiredStatusMode; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// main clist initialization routine - -extern "C" __declspec(dllexport) int CListInitialise() -{ - mir_getLP( &pluginInfo ); - - pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst); - if ( (INT_PTR)pcli == CALLSERVICE_NOTFOUND ) { -LBL_Error: - MessageBoxA( NULL, "This version of plugin requires Miranda IM 0.8.0.9 or later", "Fatal error", MB_OK ); - return 1; - } - if ( pcli->version < 6 ) - goto LBL_Error; - - pcli->pfnPaintClc = PaintClc; - - MySetLayeredWindowAttributes = (BOOL(WINAPI *) (HWND, COLORREF, BYTE, DWORD)) GetProcAddress( - LoadLibraryA("user32.dll"), "SetLayeredWindowAttributes"); - - CreateServiceFunction(MS_CLIST_GETSTATUSMODE, GetStatusMode); - - HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); - HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccountsChanged); - HookEvent(ME_OPT_INITIALISE, OnOptsInit); - - InitCustomMenus(); - return 0; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// a plugin loader aware of CList exports will never call this. - -extern "C" __declspec(dllexport) int Load(void) -{ - return 1; -} - -///////////////////////////////////////////////////////////////////////////////////////// -// a plugin unloader - -extern "C" __declspec(dllexport) int Unload(void) -{ - return 0; -} \ No newline at end of file diff --git a/plugins/Clist_classic/res/resource.rc b/plugins/Clist_classic/res/resource.rc new file mode 100644 index 0000000000..8fff7ed3bb --- /dev/null +++ b/plugins/Clist_classic/res/resource.rc @@ -0,0 +1,532 @@ +// Microsoft Visual C++ generated resource script. +// +#include "..\src\resource.h" + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +#include +#include +#include + +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// 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 + +///////////////////////////////////////////////////////////////////////////// +// +// Dialog +// + +IDD_DELETECONTACT DIALOGEX 0, 0, 284, 90 +STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU +EXSTYLE WS_EX_CONTROLPARENT +CAPTION "Delete Contact" +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + DEFPUSHBUTTON "No",IDNO,162,38,65,14 + PUSHBUTTON "Yes",IDYES,54,38,65,14 + CONTROL "Hide from list only, in order to keep their history and ignore/visibility settings",IDC_HIDE, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,65,270,9 + LTEXT "Use Options->Ignore (expert mode) to unhide contacts.",IDC_STATIC,20,78,257,8 + CONTROL "Are you sure you want to delete %s?",IDC_TOPLINE,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,7,7,270,8 + LTEXT "This will erase all history and settings for this contact!",IDC_STATIC,7,18,239,14 +END + +IDD_OPT_CLIST DIALOGEX 0, 0, 314, 204 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,17,124,10 + CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,33,124,10 + CONTROL "Disable groups",IDC_DISABLEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,50,124,10 + CONTROL "Ask before deleting contacts",IDC_CONFIRMDELETE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,67,124,10 + CONTROL "Sort contacts by name",IDC_SORTBYNAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,153,14,144,10 + CONTROL "Sort contacts by status",IDC_SORTBYSTATUS,"Button",BS_AUTORADIOBUTTON,153,26,149,10 + CONTROL "Sort contacts by protocol",IDC_SORTBYPROTO,"Button",BS_AUTORADIOBUTTON,153,38,151,10 + CONTROL "Single click interface",IDC_ONECLK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,152,68,150,10 + CONTROL "Always show status in tooltip",IDC_ALWAYSSTATUS,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,152,81,151,11 + CONTROL "Disable icon blinking",IDC_DISABLEBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,152,95,86,9 + EDITTEXT IDC_BLINKTIME,153,109,35,12,ES_NUMBER + LTEXT "ms delay",IDC_STMSDELAY,192,110,113,8 + CONTROL "Show",IDC_DONTCYCLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,143,97,10 + COMBOBOX IDC_PRIMARYSTATUS,107,142,78,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP + LTEXT "icon when statuses differ",IDC_STATIC,189,144,116,8,NOT WS_GROUP + CONTROL "Cycle icons every",IDC_CYCLE,"Button",BS_AUTORADIOBUTTON,10,160,97,10 + EDITTEXT IDC_CYCLETIME,107,159,30,12,ES_RIGHT | ES_NUMBER + CONTROL "Spin1",IDC_CYCLETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,127,158,10,14 + LTEXT "seconds, when statuses differ",IDC_STATIC,140,161,165,8,NOT WS_GROUP + CONTROL "Show multiple icons",IDC_MULTITRAY,"Button",BS_AUTORADIOBUTTON,10,177,98,10 + CONTROL "Only when statuses differ",IDC_ALWAYSMULTI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,108,177,198,10 + GROUPBOX "Contact List",IDC_STCLISTGROUP,2,2,135,126 + GROUPBOX "System tray icon",IDC_STATIC,143,57,169,70 + GROUPBOX "System tray icon when using multiple protocols",IDC_STATIC,2,131,310,66 + GROUPBOX "Contact List Sorting",IDC_STATIC,143,2,169,54,WS_GROUP + CONTROL "Spin5",IDC_BLINKSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,173,97,11,21 + CONTROL "Disable icon blinking",IDC_ICONBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,84,97,10 +END + +IDD_OPT_CLUI DIALOGEX 0, 0, 313, 245 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Window",IDC_STWINDOWGROUP,4,4,305,154 + CONTROL "Always on top",IDC_ONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,18,128,10 + CONTROL "Tool style main window",IDC_TOOLWND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,32,128,10 + CONTROL "Minimize to tray",IDC_MIN2TRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,46,128,10 + CONTROL "Show menu bar",IDC_SHOWMAINMENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,60,128,10 + CONTROL "Easy move",IDC_CLIENTDRAG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,74,128,10 + CONTROL "Show title bar",IDC_SHOWCAPTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,88,128,10 + LTEXT "Title bar text:",IDC_STATIC,12,106,51,8 + EDITTEXT IDC_TITLETEXT,63,104,72,12,ES_AUTOHSCROLL + CONTROL "Show drop shadow (restart required)",IDC_DROPSHADOW, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,122,138,10 + CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,137,128,10 + CONTROL "Hide contact list after it has been idle for",IDC_AUTOHIDE, + "Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,141,18,162,10 + EDITTEXT IDC_HIDETIME,151,33,30,12,ES_RIGHT | ES_NUMBER + CONTROL "Spin1",IDC_HIDETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,172,32,10,14 + LTEXT "seconds",IDC_STATIC01,186,35,56,8 + CONTROL "Automatically resize window to height of list",IDC_AUTOSIZE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,55,162,10 + LTEXT "maximum",IDC_STATIC21,151,71,45,8 + EDITTEXT IDC_MAXSIZEHEIGHT,197,69,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER + CONTROL "Spin1",IDC_MAXSIZESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,218,68,10,14 + LTEXT "% of screen",IDC_STATIC22,230,71,69,8 + CONTROL "Size upwards",IDC_AUTOSIZEUPWARD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,86,147,10 + CONTROL "If window is partially covered, bring to front instead of hiding",IDC_BRINGTOFRONT, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,141,102,162,16 + CONTROL "Enable docking",IDC_DISABLEDOCKING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,135,136,10 + GROUPBOX "Translucency options (Windows 2000/XP only)",IDC_STATIC,4,161,305,80 + CONTROL "Fade contact list in/out",IDC_FADEINOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,174,163,10 + CONTROL "Transparent contact list",IDC_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,191,151,9 + LTEXT "Inactive opacity:",IDC_STATIC11,23,206,89,8 + CONTROL "Slider2",IDC_TRANSINACTIVE,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS | WS_TABSTOP,112,205,130,11 + LTEXT "000%",IDC_INACTIVEPERC,246,206,29,8,SS_NOPREFIX + LTEXT "Active opacity:",IDC_STATIC12,23,221,89,8 + CONTROL "Slider2",IDC_TRANSACTIVE,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS | WS_TABSTOP,112,221,130,11 + LTEXT "000%",IDC_ACTIVEPERC,246,222,29,8,SS_NOPREFIX +END + +IDD_OPT_CLC DIALOGEX 0, 0, 314, 251 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Items",IDC_STATIC,2,2,310,108 + CONTROL "Show divider between online and offline contacts",IDC_DIVIDERONOFF, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,13,179,10 + CONTROL "Hot track items as mouse passes over",IDC_TRACKSELECT, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,27,179,10 + CONTROL "Disable drag and drop of items",IDC_DISABLEDRAGDROP, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,41,179,10 + CONTROL "Disable rename of items by clicking twice",IDC_NOTEDITLABELS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,55,179,10 + CONTROL "Show selection even when list is not focused",IDC_SHOWSELALWAYS, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,69,179,10 + CONTROL "Make selection highlight translucent",IDC_NOTNOTRANSLUCENTSEL, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,83,179,10 + CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,96,153,10 + LTEXT "'Hide Offline' means to hide:",IDC_STATIC,191,10,112,8 + CONTROL "Tree1",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,191,20,112,84 + GROUPBOX "Groups",IDC_STATIC,2,112,148,136 + CONTROL "Draw a line alongside group names",IDC_LINEWITHGROUPS, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,129,131,16 + CONTROL "Show counts of number of contacts in a group",IDC_SHOWGROUPCOUNTS, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,147,131,16 + CONTROL "Hide group counts when there are none online",IDC_HIDECOUNTSWHENEMPTY, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,165,131,16 + CONTROL "Sort groups alphabetically",IDC_SORTGROUPSALPHA,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,183,131,16 + CONTROL "Quicksearch in open groups only",IDC_QUICKSEARCHVISONLY, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,201,131,16 + LTEXT "Indent groups by:",IDC_STATIC,11,221,67,8 + EDITTEXT IDC_GROUPINDENT,78,219,31,12,ES_RIGHT | ES_NUMBER + CONTROL "Spin1",IDC_GROUPINDENTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,95,215,10,14 + LTEXT "pixels",IDC_STATIC,112,221,36,8 + GROUPBOX "Visual",IDC_STATIC,156,112,156,136 + CONTROL "Scroll list smoothly",IDC_NOTNOSMOOTHSCROLLING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,123,139,10 + LTEXT "Time:",IDC_STATIC11,174,137,42,8 + EDITTEXT IDC_SMOOTHTIME,216,135,31,12,ES_RIGHT | ES_NUMBER + CONTROL "Spin1",IDC_SMOOTHTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,239,134,10,14 + LTEXT "milliseconds",IDC_STATIC12,250,137,56,8,SS_CENTERIMAGE + LTEXT "Left margin:",IDC_STATIC,164,163,51,8 + EDITTEXT IDC_LEFTMARGIN,215,161,31,12,ES_RIGHT | ES_NUMBER + CONTROL "Spin1",IDC_LEFTMARGINSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,161,10,14 + LTEXT "pixels",IDC_STATIC,250,163,54,8 + CONTROL "Hide vertical scroll bar",IDC_NOSCROLLBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,150,140,10 + LTEXT "Row height:",IDC_STATIC,164,178,51,8 + EDITTEXT IDC_ROWHEIGHT,215,176,31,12,ES_RIGHT | ES_NUMBER + CONTROL "Spin1",IDC_ROWHEIGHTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,176,10,14 + LTEXT "pixels",IDC_STATIC,250,178,54,8 + CONTROL "Gamma correction",IDC_GAMMACORRECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,190,140,10 + CONTROL "Grey out entire list when:",IDC_GREYOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,202,139,10 + CONTROL "Tree1",IDC_GREYOUTOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,164,212,141,32 +END + +IDD_OPT_CLCBKG DIALOGEX 0, 0, 235, 154 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Contact List Background",IDC_STATIC,4,4,227,146 + LTEXT "Background colour",IDC_STATIC,59,35,72,8,NOT WS_GROUP + CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,22,35,32,10 + LTEXT "Selection colour",IDC_STATIC,59,51,72,8 + CONTROL "",IDC_SELCOLOUR,"ColourPicker",WS_TABSTOP,22,51,32,10 + CONTROL "Use background image",IDC_BITMAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,70,161,10 + EDITTEXT IDC_FILENAME,22,88,184,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BROWSE,208,88,15,11 + CONTROL "Stretch to width",IDC_STRETCHH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,105,100,10 + CONTROL "Stretch to height",IDC_STRETCHV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,105,101,10 + CONTROL "Tile horizontally",IDC_TILEH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,118,100,10 + CONTROL "Tile vertically",IDC_TILEV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,118,101,10 + CONTROL "Scroll with text",IDC_SCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,131,100,10 + CONTROL "Stretch proportionally",IDC_PROPORTIONAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,131,101,10 + CONTROL "Use Windows colours",IDC_WINCOLOUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,20,156,10 +END + +IDD_OPT_SBAR DIALOGEX 0, 0, 203, 212 +STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x1 +BEGIN + GROUPBOX "Status Bar",IDC_STATIC,4,4,195,204 + CONTROL "Show status bar",IDC_SHOWSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,17,176,10 + CONTROL "Show icons",IDC_SHOWICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,33,166,10 + CONTROL "Show protocol names",IDC_SHOWPROTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,48,166,10 + CONTROL "Show status text",IDC_SHOWSTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,63,166,10 + CONTROL "Right click opens status menu",IDC_RIGHTSTATUS,"Button",BS_AUTORADIOBUTTON,22,160,166,10 + CONTROL "Right click opens Miranda IM menu",IDC_RIGHTMIRANDA, + "Button",BS_AUTORADIOBUTTON,22,147,166,10 + CONTROL "Make sections equal width",IDC_EQUALSECTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,78,166,10 + CONTROL "Show bevels on panels",IDC_SBPANELBEVEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,94,166,10 + CONTROL "Show resize grip indicator",IDC_SHOWGRIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,110,166,10 +END + +IDD_MODERNOPT_CLIST DIALOGEX 0, 0, 369, 51 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,124,10 + CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,124,10 + CONTROL "Disable groups",IDC_DISABLEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,37,124,10 + CONTROL "Sort contacts by name",IDC_SORTBYNAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,194,13,144,10 + CONTROL "Sort contacts by status",IDC_SORTBYSTATUS,"Button",BS_AUTORADIOBUTTON,194,25,149,10 + CONTROL "Sort contacts by protocol",IDC_SORTBYPROTO,"Button",BS_AUTORADIOBUTTON,194,37,151,10 + LTEXT "Ordering:",IDC_TXT_TITLE2,184,0,185,8 + LTEXT "Contact list:",IDC_TXT_TITLE1,1,0,182,8 + CONTROL "Ask before deleting contacts",IDC_CONFIRMDELETE,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,21,75,124,10 + CONTROL "Single click interface",IDC_ONECLK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,163,76,150,10 + CONTROL "Always show status in tooltip",IDC_ALWAYSSTATUS,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | NOT WS_VISIBLE | WS_TABSTOP,163,89,151,11 + CONTROL "Disable icon blinking",IDC_DISABLEBLINK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,163,103,86,9 + EDITTEXT IDC_BLINKTIME,165,117,35,12,ES_NUMBER | NOT WS_VISIBLE + LTEXT "ms delay",IDC_STMSDELAY,203,118,113,8,NOT WS_VISIBLE + CONTROL "Show",IDC_DONTCYCLE,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_GROUP,21,151,97,10 + COMBOBOX IDC_PRIMARYSTATUS,119,150,78,70,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP + LTEXT "icon when statuses differ",IDC_STATIC,201,152,116,8,NOT WS_VISIBLE | NOT WS_GROUP + CONTROL "Cycle icons every",IDC_CYCLE,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,21,168,97,10 + EDITTEXT IDC_CYCLETIME,119,167,30,12,ES_RIGHT | ES_NUMBER | NOT WS_VISIBLE + CONTROL "",IDC_CYCLETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | NOT WS_VISIBLE,139,166,11,14 + LTEXT "seconds, when statuses differ",IDC_STATIC,151,169,165,8,NOT WS_VISIBLE | NOT WS_GROUP + CONTROL "Show multiple icons",IDC_MULTITRAY,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,21,185,98,10 + CONTROL "Only when statuses differ",IDC_ALWAYSMULTI,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,119,185,198,10 + CONTROL "",IDC_BLINKSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | NOT WS_VISIBLE,185,105,11,21 + CONTROL "Disable icon blinking",IDC_ICONBLINK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,21,92,97,10 +END + +IDD_MODERNOPT_CLUI DIALOGEX 0, 0, 369, 100 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "Always on top",IDC_ONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,128,10 + CONTROL "Tool style main window",IDC_TOOLWND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,128,10 + CONTROL "Minimize to tray",IDC_MIN2TRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,37,128,10 + CONTROL "Hide contact list after it has been idle for",IDC_AUTOHIDE, + "Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,194,13,162,10 + EDITTEXT IDC_HIDETIME,204,25,30,12,ES_RIGHT | ES_NUMBER + CONTROL "",IDC_HIDETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,224,22,11,14 + LTEXT "seconds",IDC_STATIC01,238,27,56,8 + CONTROL "Automatically resize window to height of list",IDC_AUTOSIZE, + "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,42,162,10 + LTEXT "maximum",IDC_STATIC21,204,57,45,8 + EDITTEXT IDC_MAXSIZEHEIGHT,250,54,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER + CONTROL "",IDC_MAXSIZESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,270,54,11,14 + LTEXT "% of screen",IDC_STATIC22,282,57,69,8 + CONTROL "Size upwards",IDC_AUTOSIZEUPWARD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,70,147,10 + LTEXT "Title bar text:",IDC_STATIC,37,158,51,8,NOT WS_VISIBLE + CONTROL "Show menu bar",IDC_SHOWMAINMENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,49,128,10 + CONTROL "Easy move",IDC_CLIENTDRAG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,61,128,10 + CONTROL "Show title bar",IDC_SHOWCAPTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,73,128,10 + CONTROL "If window is partially covered, bring iy to front",IDC_BRINGTOFRONT, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,194,85,175,10 + EDITTEXT IDC_TITLETEXT,91,156,72,12,ES_AUTOHSCROLL | NOT WS_VISIBLE + CONTROL "Show drop shadow (restart required)",IDC_DROPSHADOW, + "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,41,174,138,10 + CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,85,128,10 + LTEXT "Window:",IDC_TXT_TITLE1,1,0,368,8 + CONTROL "Fade contact list in/out",IDC_FADEINOUT,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,13,174,163,10 + CONTROL "Transparent contact list",IDC_TRANSPARENT,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,13,191,151,9 + LTEXT "Inactive opacity:",IDC_STATIC11,23,206,89,8,NOT WS_VISIBLE + CONTROL "",IDC_TRANSINACTIVE,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,112,205,130,11 + LTEXT "Active opacity:",IDC_STATIC12,23,221,89,8,NOT WS_VISIBLE + CONTROL "",IDC_TRANSACTIVE,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,112,221,130,11 + LTEXT "000%",IDC_INACTIVEPERC,246,206,29,8,SS_NOPREFIX | NOT WS_VISIBLE + LTEXT "000%",IDC_ACTIVEPERC,246,222,29,8,SS_NOPREFIX | NOT WS_VISIBLE +END + +IDD_MODERNOPT_SBAR DIALOGEX 0, 0, 369, 53 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + CONTROL "Show status bar",IDC_SHOWSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,0,0,369,10 + CONTROL "Show icons",IDC_SHOWICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,15,142,10 + CONTROL "Show protocol names",IDC_SHOWPROTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,27,142,10 + CONTROL "Show status text",IDC_SHOWSTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,39,142,10 + CONTROL "Make sections equal width",IDC_EQUALSECTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,15,142,10 + CONTROL "Show bevels on panels",IDC_SBPANELBEVEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,27,107,10 + CONTROL "Show resize grip indicator",IDC_SHOWGRIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,39,96,10 + CONTROL "Right click opens status menu",IDC_RIGHTSTATUS,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,22,160,142,10 + CONTROL "Right click opens Miranda IM menu",IDC_RIGHTMIRANDA, + "Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,22,147,142,10 +END + +IDD_MODERNOPT_CLCBKG DIALOGEX 0, 0, 232, 143 +STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD +EXSTYLE WS_EX_CONTROLPARENT +FONT 8, "MS Shell Dlg", 0, 0, 0x0 +BEGIN + LTEXT "Background colour",IDC_STATIC,57,28,72,8,NOT WS_GROUP + CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,20,28,32,10 + LTEXT "Selection colour",IDC_STATIC,57,44,72,8 + CONTROL "",IDC_SELCOLOUR,"ColourPicker",WS_TABSTOP,20,44,32,10 + CONTROL "Use background image",IDC_BITMAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,63,161,10 + EDITTEXT IDC_FILENAME,20,79,184,12,ES_AUTOHSCROLL + PUSHBUTTON "...",IDC_BROWSE,206,79,15,12 + CONTROL "Stretch to width",IDC_STRETCHH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,96,100,10 + CONTROL "Stretch to height",IDC_STRETCHV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,96,101,10 + CONTROL "Tile horizontally",IDC_TILEH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,109,100,10 + CONTROL "Tile vertically",IDC_TILEV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,109,101,10 + CONTROL "Scroll with text",IDC_SCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,122,100,10 + CONTROL "Stretch proportionally",IDC_PROPORTIONAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,122,101,10 + CONTROL "Use Windows colours",IDC_WINCOLOUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,156,10 + LTEXT "Contact list background:",IDC_TXT_TITLE1,1,0,230,8 +END + + +///////////////////////////////////////////////////////////////////////////// +// +// DESIGNINFO +// + +#ifdef APSTUDIO_INVOKED +GUIDELINES DESIGNINFO +BEGIN + IDD_DELETECONTACT, DIALOG + BEGIN + LEFTMARGIN, 7 + RIGHTMARGIN, 277 + TOPMARGIN, 7 + BOTTOMMARGIN, 85 + END + + IDD_OPT_CLIST, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 312 + VERTGUIDE, 10 + VERTGUIDE, 107 + TOPMARGIN, 2 + BOTTOMMARGIN, 202 + HORZGUIDE, 179 + HORZGUIDE, 196 + END + + IDD_OPT_CLUI, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 309 + VERTGUIDE, 13 + VERTGUIDE, 23 + VERTGUIDE, 112 + VERTGUIDE, 141 + VERTGUIDE, 151 + VERTGUIDE, 175 + VERTGUIDE, 242 + VERTGUIDE, 246 + TOPMARGIN, 4 + BOTTOMMARGIN, 241 + HORZGUIDE, 18 + HORZGUIDE, 39 + HORZGUIDE, 75 + HORZGUIDE, 180 + HORZGUIDE, 196 + END + + IDD_OPT_CLC, DIALOG + BEGIN + LEFTMARGIN, 2 + RIGHTMARGIN, 312 + VERTGUIDE, 11 + VERTGUIDE, 164 + VERTGUIDE, 216 + TOPMARGIN, 2 + BOTTOMMARGIN, 249 + HORZGUIDE, 145 + HORZGUIDE, 163 + HORZGUIDE, 222 + END + + IDD_OPT_CLCBKG, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 231 + VERTGUIDE, 12 + VERTGUIDE, 22 + VERTGUIDE, 122 + TOPMARGIN, 4 + BOTTOMMARGIN, 150 + HORZGUIDE, 24 + HORZGUIDE, 35 + HORZGUIDE, 73 + HORZGUIDE, 89 + HORZGUIDE, 102 + HORZGUIDE, 115 + END + + IDD_OPT_SBAR, DIALOG + BEGIN + LEFTMARGIN, 4 + RIGHTMARGIN, 199 + VERTGUIDE, 12 + VERTGUIDE, 22 + VERTGUIDE, 188 + TOPMARGIN, 4 + BOTTOMMARGIN, 208 + END +END +#endif // APSTUDIO_INVOKED + + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "..\src\resource.h\0" +END + +2 TEXTINCLUDE +BEGIN + "#include \r\n" + "#include \r\n" + "#include \r\n" + "\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Cursor +// + +IDC_HYPERLINKHAND CURSOR "hyperlin.cur" +IDC_DROP CURSOR "dragcopy.cur" +IDC_DROPUSER CURSOR "dropuser.cur" + +///////////////////////////////////////////////////////////////////////////// +// +// Menu +// + +IDR_CLISTMENU MENU +BEGIN + POPUP "&¤" + BEGIN + MENUITEM SEPARATOR + MENUITEM "E&xit", ID_ICQ_EXIT + END + POPUP "&Status" + BEGIN + MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED + MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE + MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY + MENUITEM "&NA\tCtrl+3", ID_STATUS_NA + MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED + MENUITEM "&DND\tCtrl+5", ID_STATUS_DND + MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT + MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE + MENUITEM "On the &Phone\tCtrl+8", ID_STATUS_ONTHEPHONE + MENUITEM "Out to &Lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH + END +END + +IDR_CONTEXT MENU +BEGIN + POPUP "Tray" + BEGIN + MENUITEM "&Hide/Show", ID_TRAY_HIDE + MENUITEM SEPARATOR + MENUITEM "E&xit", ID_TRAY_EXIT + END + POPUP "Nowhere" + BEGIN + MENUITEM "&New Group", POPUP_NEWGROUP + MENUITEM SEPARATOR + MENUITEM "&Hide Offline Users", POPUP_HIDEOFFLINE + MENUITEM "Hide &Offline Users out here", POPUP_HIDEOFFLINEROOT + MENUITEM "Hide &Empty Groups", POPUP_HIDEEMPTYGROUPS + MENUITEM "Disable &Groups", POPUP_DISABLEGROUPS + MENUITEM SEPARATOR + MENUITEM "Hide Miranda", POPUP_HIDEMIRANDA + END + POPUP "Group" + BEGIN + MENUITEM "&New Subgroup", POPUP_NEWSUBGROUP + MENUITEM "&Hide Offline Users in here", POPUP_GROUPHIDEOFFLINE + MENUITEM SEPARATOR + MENUITEM "&Rename Group", POPUP_RENAMEGROUP + MENUITEM "&Delete Group", POPUP_DELETEGROUP + END +END + +#endif // English (U.S.) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/plugins/Clist_classic/res/version.rc b/plugins/Clist_classic/res/version.rc new file mode 100644 index 0000000000..73ab32afe8 --- /dev/null +++ b/plugins/Clist_classic/res/version.rc @@ -0,0 +1,56 @@ +#ifdef APSTUDIO_INVOKED +#error this file is not editable by Microsoft Visual C++ +#endif //APSTUDIO_INVOKED + +#include "..\src\version.h" +#include "winres.h" + +#ifdef _WIN32 +LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US +#pragma code_page( 1252) +#endif //_WIN32 + +#ifndef _MAC +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION __FILEVERSION_STRING + PRODUCTVERSION __FILEVERSION_STRING + FILEFLAGSMASK 0x3fL +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x40004L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040904b0" + BEGIN + VALUE "Comments", "\0" + VALUE "CompanyName", "Miranda\0" + VALUE "FileDescription", "Contact list classic\0" + VALUE "FileVersion", __VERSION_STRING "\0" + VALUE "InternalName", "clist_classic\0" + VALUE "LegalCopyright", "Copyright ( c) 2002-12 Miranda team\0" + VALUE "LegalTrademarks", "\0" + VALUE "OriginalFilename", "clist_classic.dll\0" + VALUE "PrivateBuild", "\0" + VALUE "ProductName", "Contact list plugin\0" + VALUE "ProductVersion", __VERSION_STRING "\0" + VALUE "SpecialBuild", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x409, 1200 + END +END + +#endif // !_MAC diff --git a/plugins/Clist_classic/resource.h b/plugins/Clist_classic/resource.h deleted file mode 100644 index 541c69b212..0000000000 --- a/plugins/Clist_classic/resource.h +++ /dev/null @@ -1,163 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by resource.rc -// -#define IDD_OPT_CLIST 126 -#define IDR_CONTEXT 180 -#define IDC_DROP 183 -#define IDD_OPT_HOTKEY 184 -#define IDR_CLISTMENU 199 -#define IDC_HYPERLINKHAND 214 -#define IDC_DROPUSER 215 -#define IDD_OPT_CLUI 218 -#define IDD_OPT_CLC 228 -#define IDD_OPT_CLCBKG 230 -#define IDD_OPT_SBAR 234 -#define IDD_OPT_CLCTEXTSIMPLE 239 -#define IDD_DELETECONTACT 254 -#define IDD_MODERNOPT_CLIST 288 -#define IDD_MODERNOPT_CLUI 289 -#define IDD_MODERNOPT_SBAR 290 -#define IDD_MODERNOPT_CLCBKG 291 -#define IDC_MIN2TRAY 1073 -#define IDC_ONTOP 1074 -#define IDC_SHOWMAINMENU 1075 -#define IDC_CLIENTDRAG 1076 -#define IDC_TOOLWND 1097 -#define IDC_ONECLK 1098 -#define IDC_SHOWCAPTION 1098 -#define IDC_HIDEOFFLINE 1099 -#define IDC_SHOWHIDE 1100 -#define IDC_HIDEEMPTYGROUPS 1100 -#define IDC_SORTBYSTATUS 1101 -#define IDC_FADEINOUT 1101 -#define IDC_READMSG 1102 -#define IDC_AUTOSIZE 1102 -#define IDC_DISABLEGROUPS 1102 -#define IDC_AUTOSIZEUPWARD 1103 -#define IDC_ALWAYSSTATUS 1103 -#define IDC_NETSEARCH 1104 -#define IDC_CONFIRMDELETE 1104 -#define IDC_SORTBYPROTO 1105 -#define IDC_SHOWOPTIONS 1105 -#define IDC_SEARCHURL 1106 -#define IDC_TRANSPARENT 1124 -#define IDC_TRANSINACTIVE 1126 -#define IDC_TRANSACTIVE 1128 -#define IDC_STATIC11 1154 -#define IDC_STATIC12 1155 -#define IDC_STATIC21 1156 -#define IDC_STATIC22 1157 -#define IDC_HKSHOWHIDE 1162 -#define IDC_HKREADMSG 1163 -#define IDC_HKSEARCH 1164 -#define IDC_HKSHOWOPTIONS 1165 -#define IDC_BROWSE 1184 -#define IDC_INACTIVEPERC 1187 -#define IDC_ACTIVEPERC 1188 -#define IDC_SEARCHNEWWND 1188 -#define IDC_TITLETEXT 1196 -#define IDC_AUTOHIDE 1235 -#define IDC_HIDETIME 1236 -#define IDC_MAXSIZEHEIGHT 1254 -#define IDC_MAXSIZESPIN 1255 -#define IDC_BKGCOLOUR 1269 -#define IDC_FILENAME 1271 -#define IDC_SCROLL 1277 -#define IDC_PROPORTIONAL 1278 -#define IDC_SELCOLOUR 1281 -#define IDC_SMOOTHTIME 1283 -#define IDC_SMOOTHTIMESPIN 1284 -#define IDC_GREYOUT 1285 -#define IDC_ROWHEIGHT 1286 -#define IDC_ROWHEIGHTSPIN 1287 -#define IDC_GREYOUTOPTS 1288 -#define IDC_GROUPINDENT 1289 -#define IDC_GROUPINDENTSPIN 1290 -#define IDC_LEFTMARGIN 1291 -#define IDC_SAMPLE 1292 -#define IDC_LEFTMARGINSPIN 1292 -#define IDC_FONTSIZE 1293 -#define IDC_STRETCHH 1298 -#define IDC_STRETCHV 1299 -#define IDC_TILEH 1300 -#define IDC_SCRIPT 1300 -#define IDC_TILEV 1301 -#define IDC_GAMMACORRECT 1302 -#define IDC_HIDEOFFLINEOPTS 1308 -#define IDC_DONTCYCLE 1315 -#define IDC_PRIMARYSTATUS 1316 -#define IDC_CYCLE 1317 -#define IDC_CYCLETIME 1318 -#define IDC_CYCLETIMESPIN 1319 -#define IDC_HIDETIMESPIN 1320 -#define IDC_MULTITRAY 1321 -#define IDC_ALWAYSMULTI 1322 -#define IDC_SHOWICON 1323 -#define IDC_SHOWPROTO 1324 -#define IDC_SHOWSTATUS 1325 -#define IDC_EQUALSECTIONS 1326 -#define IDC_SHOWSBAR 1329 -#define IDC_RIGHTMIRANDA 1330 -#define IDC_RIGHTSTATUS 1331 -#define IDC_SORTBYNAME 1347 -#define IDC_STAUTOHIDESECS 1349 -#define IDC_STCLISTGROUP 1350 -#define IDC_DISABLEDRAGDROP 1351 -#define IDC_NOTEDITLABELS 1352 -#define IDC_SHOWSELALWAYS 1353 -#define IDC_TRACKSELECT 1354 -#define IDC_SHOWGROUPCOUNTS 1355 -#define IDC_HIDECOUNTSWHENEMPTY 1356 -#define IDC_DIVIDERONOFF 1357 -#define IDC_NOTNOTRANSLUCENTSEL 1358 -#define IDC_LINEWITHGROUPS 1359 -#define IDC_QUICKSEARCHVISONLY 1360 -#define IDC_SORTGROUPSALPHA 1361 -#define IDC_NOTNOSMOOTHSCROLLING 1362 -#define IDC_BITMAP 1363 -#define IDC_STWINDOWGROUP 1364 -#define IDC_STATIC01 1365 -#define IDC_HIDE 1534 -#define IDC_TOPLINE 1535 -#define IDC_HOTKEYURLSTR 1567 -#define IDC_BRINGTOFRONT 1579 -#define IDC_BLINKTIME 1607 -#define IDC_BLINKSPIN 1608 -#define IDC_DISABLEBLINK 1609 -#define IDC_IDLE 1610 -#define IDC_SBPANELBEVEL 1611 -#define IDC_DROPSHADOW 1612 -#define IDC_SHOWGRIP 1612 -#define IDC_NOSCROLLBAR 1613 -#define IDC_TXT_TITLE1 1617 -#define IDC_TXT_TITLE2 1618 -#define IDC_ONDESKTOP 1657 -#define IDC_DISABLEDOCKING 1658 -#define IDC_WINCOLOUR 1659 -#define IDC_ICONBLINK 1660 -#define IDC_STMSDELAY 1661 -#define ID_ICQ_EXIT 40001 -#define POPUP_HIDEEMPTYGROUPS 40003 -#define POPUP_NEWSUBGROUP 40004 -#define POPUP_HIDEOFFLINE 40005 -#define POPUP_GROUPHIDEOFFLINE 40006 -#define POPUP_HIDEOFFLINEROOT 40007 -#define POPUP_DISABLEGROUPS 40008 -#define POPUP_HIDEMIRANDA 40017 -#define ID_TRAY_HIDE 40038 -#define ID_TRAY_EXIT 40040 -#define POPUP_NEWGROUP 40050 -#define POPUP_RENAMEGROUP 40052 -#define POPUP_DELETEGROUP 40053 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 292 -#define _APS_NEXT_COMMAND_VALUE 40018 -#define _APS_NEXT_CONTROL_VALUE 1662 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/plugins/Clist_classic/resource.rc b/plugins/Clist_classic/resource.rc deleted file mode 100644 index 264e77e616..0000000000 --- a/plugins/Clist_classic/resource.rc +++ /dev/null @@ -1,532 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include -#include -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// 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 - -///////////////////////////////////////////////////////////////////////////// -// -// Dialog -// - -IDD_DELETECONTACT DIALOGEX 0, 0, 284, 90 -STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU -EXSTYLE WS_EX_CONTROLPARENT -CAPTION "Delete Contact" -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - DEFPUSHBUTTON "No",IDNO,162,38,65,14 - PUSHBUTTON "Yes",IDYES,54,38,65,14 - CONTROL "Hide from list only, in order to keep their history and ignore/visibility settings",IDC_HIDE, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,7,65,270,9 - LTEXT "Use Options->Ignore (expert mode) to unhide contacts.",IDC_STATIC,20,78,257,8 - CONTROL "Are you sure you want to delete %s?",IDC_TOPLINE,"Static",SS_SIMPLE | SS_NOPREFIX | WS_GROUP,7,7,270,8 - LTEXT "This will erase all history and settings for this contact!",IDC_STATIC,7,18,239,14 -END - -IDD_OPT_CLIST DIALOGEX 0, 0, 314, 204 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,17,124,10 - CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,33,124,10 - CONTROL "Disable groups",IDC_DISABLEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,50,124,10 - CONTROL "Ask before deleting contacts",IDC_CONFIRMDELETE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,67,124,10 - CONTROL "Sort contacts by name",IDC_SORTBYNAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,153,14,144,10 - CONTROL "Sort contacts by status",IDC_SORTBYSTATUS,"Button",BS_AUTORADIOBUTTON,153,26,149,10 - CONTROL "Sort contacts by protocol",IDC_SORTBYPROTO,"Button",BS_AUTORADIOBUTTON,153,38,151,10 - CONTROL "Single click interface",IDC_ONECLK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,152,68,150,10 - CONTROL "Always show status in tooltip",IDC_ALWAYSSTATUS,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,152,81,151,11 - CONTROL "Disable icon blinking",IDC_DISABLEBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,152,95,86,9 - EDITTEXT IDC_BLINKTIME,153,109,35,12,ES_NUMBER - LTEXT "ms delay",IDC_STMSDELAY,192,110,113,8 - CONTROL "Show",IDC_DONTCYCLE,"Button",BS_AUTORADIOBUTTON | WS_GROUP,10,143,97,10 - COMBOBOX IDC_PRIMARYSTATUS,107,142,78,70,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP - LTEXT "icon when statuses differ",IDC_STATIC,189,144,116,8,NOT WS_GROUP - CONTROL "Cycle icons every",IDC_CYCLE,"Button",BS_AUTORADIOBUTTON,10,160,97,10 - EDITTEXT IDC_CYCLETIME,107,159,30,12,ES_RIGHT | ES_NUMBER - CONTROL "Spin1",IDC_CYCLETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,127,158,10,14 - LTEXT "seconds, when statuses differ",IDC_STATIC,140,161,165,8,NOT WS_GROUP - CONTROL "Show multiple icons",IDC_MULTITRAY,"Button",BS_AUTORADIOBUTTON,10,177,98,10 - CONTROL "Only when statuses differ",IDC_ALWAYSMULTI,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,108,177,198,10 - GROUPBOX "Contact List",IDC_STCLISTGROUP,2,2,135,126 - GROUPBOX "System tray icon",IDC_STATIC,143,57,169,70 - GROUPBOX "System tray icon when using multiple protocols",IDC_STATIC,2,131,310,66 - GROUPBOX "Contact List Sorting",IDC_STATIC,143,2,169,54,WS_GROUP - CONTROL "Spin5",IDC_BLINKSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,173,97,11,21 - CONTROL "Disable icon blinking",IDC_ICONBLINK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,84,97,10 -END - -IDD_OPT_CLUI DIALOGEX 0, 0, 313, 245 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "Window",IDC_STWINDOWGROUP,4,4,305,154 - CONTROL "Always on top",IDC_ONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,18,128,10 - CONTROL "Tool style main window",IDC_TOOLWND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,32,128,10 - CONTROL "Minimize to tray",IDC_MIN2TRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,46,128,10 - CONTROL "Show menu bar",IDC_SHOWMAINMENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,60,128,10 - CONTROL "Easy move",IDC_CLIENTDRAG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,74,128,10 - CONTROL "Show title bar",IDC_SHOWCAPTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,88,128,10 - LTEXT "Title bar text:",IDC_STATIC,12,106,51,8 - EDITTEXT IDC_TITLETEXT,63,104,72,12,ES_AUTOHSCROLL - CONTROL "Show drop shadow (restart required)",IDC_DROPSHADOW, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,122,138,10 - CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,137,128,10 - CONTROL "Hide contact list after it has been idle for",IDC_AUTOHIDE, - "Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,141,18,162,10 - EDITTEXT IDC_HIDETIME,151,33,30,12,ES_RIGHT | ES_NUMBER - CONTROL "Spin1",IDC_HIDETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,172,32,10,14 - LTEXT "seconds",IDC_STATIC01,186,35,56,8 - CONTROL "Automatically resize window to height of list",IDC_AUTOSIZE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,55,162,10 - LTEXT "maximum",IDC_STATIC21,151,71,45,8 - EDITTEXT IDC_MAXSIZEHEIGHT,197,69,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - CONTROL "Spin1",IDC_MAXSIZESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,218,68,10,14 - LTEXT "% of screen",IDC_STATIC22,230,71,69,8 - CONTROL "Size upwards",IDC_AUTOSIZEUPWARD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,151,86,147,10 - CONTROL "If window is partially covered, bring to front instead of hiding",IDC_BRINGTOFRONT, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,141,102,162,16 - CONTROL "Enable docking",IDC_DISABLEDOCKING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,135,136,10 - GROUPBOX "Translucency options (Windows 2000/XP only)",IDC_STATIC,4,161,305,80 - CONTROL "Fade contact list in/out",IDC_FADEINOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,174,163,10 - CONTROL "Transparent contact list",IDC_TRANSPARENT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,191,151,9 - LTEXT "Inactive opacity:",IDC_STATIC11,23,206,89,8 - CONTROL "Slider2",IDC_TRANSINACTIVE,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS | WS_TABSTOP,112,205,130,11 - LTEXT "000%",IDC_INACTIVEPERC,246,206,29,8,SS_NOPREFIX - LTEXT "Active opacity:",IDC_STATIC12,23,221,89,8 - CONTROL "Slider2",IDC_TRANSACTIVE,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS | WS_TABSTOP,112,221,130,11 - LTEXT "000%",IDC_ACTIVEPERC,246,222,29,8,SS_NOPREFIX -END - -IDD_OPT_CLC DIALOGEX 0, 0, 314, 251 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "Items",IDC_STATIC,2,2,310,108 - CONTROL "Show divider between online and offline contacts",IDC_DIVIDERONOFF, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,13,179,10 - CONTROL "Hot track items as mouse passes over",IDC_TRACKSELECT, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,27,179,10 - CONTROL "Disable drag and drop of items",IDC_DISABLEDRAGDROP, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,41,179,10 - CONTROL "Disable rename of items by clicking twice",IDC_NOTEDITLABELS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,55,179,10 - CONTROL "Show selection even when list is not focused",IDC_SHOWSELALWAYS, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,69,179,10 - CONTROL "Make selection highlight translucent",IDC_NOTNOTRANSLUCENTSEL, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,83,179,10 - CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,96,153,10 - LTEXT "'Hide Offline' means to hide:",IDC_STATIC,191,10,112,8 - CONTROL "Tree1",IDC_HIDEOFFLINEOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,191,20,112,84 - GROUPBOX "Groups",IDC_STATIC,2,112,148,136 - CONTROL "Draw a line alongside group names",IDC_LINEWITHGROUPS, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,129,131,16 - CONTROL "Show counts of number of contacts in a group",IDC_SHOWGROUPCOUNTS, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,147,131,16 - CONTROL "Hide group counts when there are none online",IDC_HIDECOUNTSWHENEMPTY, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,165,131,16 - CONTROL "Sort groups alphabetically",IDC_SORTGROUPSALPHA,"Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,183,131,16 - CONTROL "Quicksearch in open groups only",IDC_QUICKSEARCHVISONLY, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,201,131,16 - LTEXT "Indent groups by:",IDC_STATIC,11,221,67,8 - EDITTEXT IDC_GROUPINDENT,78,219,31,12,ES_RIGHT | ES_NUMBER - CONTROL "Spin1",IDC_GROUPINDENTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,95,215,10,14 - LTEXT "pixels",IDC_STATIC,112,221,36,8 - GROUPBOX "Visual",IDC_STATIC,156,112,156,136 - CONTROL "Scroll list smoothly",IDC_NOTNOSMOOTHSCROLLING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,123,139,10 - LTEXT "Time:",IDC_STATIC11,174,137,42,8 - EDITTEXT IDC_SMOOTHTIME,216,135,31,12,ES_RIGHT | ES_NUMBER - CONTROL "Spin1",IDC_SMOOTHTIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,239,134,10,14 - LTEXT "milliseconds",IDC_STATIC12,250,137,56,8,SS_CENTERIMAGE - LTEXT "Left margin:",IDC_STATIC,164,163,51,8 - EDITTEXT IDC_LEFTMARGIN,215,161,31,12,ES_RIGHT | ES_NUMBER - CONTROL "Spin1",IDC_LEFTMARGINSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,161,10,14 - LTEXT "pixels",IDC_STATIC,250,163,54,8 - CONTROL "Hide vertical scroll bar",IDC_NOSCROLLBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,150,140,10 - LTEXT "Row height:",IDC_STATIC,164,178,51,8 - EDITTEXT IDC_ROWHEIGHT,215,176,31,12,ES_RIGHT | ES_NUMBER - CONTROL "Spin1",IDC_ROWHEIGHTSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,176,10,14 - LTEXT "pixels",IDC_STATIC,250,178,54,8 - CONTROL "Gamma correction",IDC_GAMMACORRECT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,190,140,10 - CONTROL "Grey out entire list when:",IDC_GREYOUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,164,202,139,10 - CONTROL "Tree1",IDC_GREYOUTOPTS,"SysTreeView32",TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,164,212,141,32 -END - -IDD_OPT_CLCBKG DIALOGEX 0, 0, 235, 154 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "Contact List Background",IDC_STATIC,4,4,227,146 - LTEXT "Background colour",IDC_STATIC,59,35,72,8,NOT WS_GROUP - CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,22,35,32,10 - LTEXT "Selection colour",IDC_STATIC,59,51,72,8 - CONTROL "",IDC_SELCOLOUR,"ColourPicker",WS_TABSTOP,22,51,32,10 - CONTROL "Use background image",IDC_BITMAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,70,161,10 - EDITTEXT IDC_FILENAME,22,88,184,12,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_BROWSE,208,88,15,11 - CONTROL "Stretch to width",IDC_STRETCHH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,105,100,10 - CONTROL "Stretch to height",IDC_STRETCHV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,105,101,10 - CONTROL "Tile horizontally",IDC_TILEH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,118,100,10 - CONTROL "Tile vertically",IDC_TILEV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,118,101,10 - CONTROL "Scroll with text",IDC_SCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,131,100,10 - CONTROL "Stretch proportionally",IDC_PROPORTIONAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,122,131,101,10 - CONTROL "Use Windows colours",IDC_WINCOLOUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,20,156,10 -END - -IDD_OPT_SBAR DIALOGEX 0, 0, 203, 212 -STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x1 -BEGIN - GROUPBOX "Status Bar",IDC_STATIC,4,4,195,204 - CONTROL "Show status bar",IDC_SHOWSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,17,176,10 - CONTROL "Show icons",IDC_SHOWICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,33,166,10 - CONTROL "Show protocol names",IDC_SHOWPROTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,48,166,10 - CONTROL "Show status text",IDC_SHOWSTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,63,166,10 - CONTROL "Right click opens status menu",IDC_RIGHTSTATUS,"Button",BS_AUTORADIOBUTTON,22,160,166,10 - CONTROL "Right click opens Miranda IM menu",IDC_RIGHTMIRANDA, - "Button",BS_AUTORADIOBUTTON,22,147,166,10 - CONTROL "Make sections equal width",IDC_EQUALSECTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,78,166,10 - CONTROL "Show bevels on panels",IDC_SBPANELBEVEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,94,166,10 - CONTROL "Show resize grip indicator",IDC_SHOWGRIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,22,110,166,10 -END - -IDD_MODERNOPT_CLIST DIALOGEX 0, 0, 369, 51 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,124,10 - CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,124,10 - CONTROL "Disable groups",IDC_DISABLEGROUPS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,37,124,10 - CONTROL "Sort contacts by name",IDC_SORTBYNAME,"Button",BS_AUTORADIOBUTTON | WS_GROUP,194,13,144,10 - CONTROL "Sort contacts by status",IDC_SORTBYSTATUS,"Button",BS_AUTORADIOBUTTON,194,25,149,10 - CONTROL "Sort contacts by protocol",IDC_SORTBYPROTO,"Button",BS_AUTORADIOBUTTON,194,37,151,10 - LTEXT "Ordering:",IDC_TXT_TITLE2,184,0,185,8 - LTEXT "Contact list:",IDC_TXT_TITLE1,1,0,182,8 - CONTROL "Ask before deleting contacts",IDC_CONFIRMDELETE,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,21,75,124,10 - CONTROL "Single click interface",IDC_ONECLK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,163,76,150,10 - CONTROL "Always show status in tooltip",IDC_ALWAYSSTATUS,"Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | NOT WS_VISIBLE | WS_TABSTOP,163,89,151,11 - CONTROL "Disable icon blinking",IDC_DISABLEBLINK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,163,103,86,9 - EDITTEXT IDC_BLINKTIME,165,117,35,12,ES_NUMBER | NOT WS_VISIBLE - LTEXT "ms delay",IDC_STMSDELAY,203,118,113,8,NOT WS_VISIBLE - CONTROL "Show",IDC_DONTCYCLE,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE | WS_GROUP,21,151,97,10 - COMBOBOX IDC_PRIMARYSTATUS,119,150,78,70,CBS_DROPDOWNLIST | NOT WS_VISIBLE | WS_VSCROLL | WS_TABSTOP - LTEXT "icon when statuses differ",IDC_STATIC,201,152,116,8,NOT WS_VISIBLE | NOT WS_GROUP - CONTROL "Cycle icons every",IDC_CYCLE,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,21,168,97,10 - EDITTEXT IDC_CYCLETIME,119,167,30,12,ES_RIGHT | ES_NUMBER | NOT WS_VISIBLE - CONTROL "",IDC_CYCLETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | NOT WS_VISIBLE,139,166,11,14 - LTEXT "seconds, when statuses differ",IDC_STATIC,151,169,165,8,NOT WS_VISIBLE | NOT WS_GROUP - CONTROL "Show multiple icons",IDC_MULTITRAY,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,21,185,98,10 - CONTROL "Only when statuses differ",IDC_ALWAYSMULTI,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,119,185,198,10 - CONTROL "",IDC_BLINKSPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK | NOT WS_VISIBLE,185,105,11,21 - CONTROL "Disable icon blinking",IDC_ICONBLINK,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,21,92,97,10 -END - -IDD_MODERNOPT_CLUI DIALOGEX 0, 0, 369, 100 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - CONTROL "Always on top",IDC_ONTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,128,10 - CONTROL "Tool style main window",IDC_TOOLWND,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,25,128,10 - CONTROL "Minimize to tray",IDC_MIN2TRAY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,37,128,10 - CONTROL "Hide contact list after it has been idle for",IDC_AUTOHIDE, - "Button",BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,194,13,162,10 - EDITTEXT IDC_HIDETIME,204,25,30,12,ES_RIGHT | ES_NUMBER - CONTROL "",IDC_HIDETIMESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,224,22,11,14 - LTEXT "seconds",IDC_STATIC01,238,27,56,8 - CONTROL "Automatically resize window to height of list",IDC_AUTOSIZE, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,42,162,10 - LTEXT "maximum",IDC_STATIC21,204,57,45,8 - EDITTEXT IDC_MAXSIZEHEIGHT,250,54,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER - CONTROL "",IDC_MAXSIZESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,270,54,11,14 - LTEXT "% of screen",IDC_STATIC22,282,57,69,8 - CONTROL "Size upwards",IDC_AUTOSIZEUPWARD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,204,70,147,10 - LTEXT "Title bar text:",IDC_STATIC,37,158,51,8,NOT WS_VISIBLE - CONTROL "Show menu bar",IDC_SHOWMAINMENU,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,49,128,10 - CONTROL "Easy move",IDC_CLIENTDRAG,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,61,128,10 - CONTROL "Show title bar",IDC_SHOWCAPTION,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,73,128,10 - CONTROL "If window is partially covered, bring iy to front",IDC_BRINGTOFRONT, - "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,194,85,175,10 - EDITTEXT IDC_TITLETEXT,91,156,72,12,ES_AUTOHSCROLL | NOT WS_VISIBLE - CONTROL "Show drop shadow (restart required)",IDC_DROPSHADOW, - "Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,41,174,138,10 - CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,85,128,10 - LTEXT "Window:",IDC_TXT_TITLE1,1,0,368,8 - CONTROL "Fade contact list in/out",IDC_FADEINOUT,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,13,174,163,10 - CONTROL "Transparent contact list",IDC_TRANSPARENT,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_TABSTOP,13,191,151,9 - LTEXT "Inactive opacity:",IDC_STATIC11,23,206,89,8,NOT WS_VISIBLE - CONTROL "",IDC_TRANSINACTIVE,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,112,205,130,11 - LTEXT "Active opacity:",IDC_STATIC12,23,221,89,8,NOT WS_VISIBLE - CONTROL "",IDC_TRANSACTIVE,"msctls_trackbar32",TBS_TOP | TBS_NOTICKS | NOT WS_VISIBLE | WS_TABSTOP,112,221,130,11 - LTEXT "000%",IDC_INACTIVEPERC,246,206,29,8,SS_NOPREFIX | NOT WS_VISIBLE - LTEXT "000%",IDC_ACTIVEPERC,246,222,29,8,SS_NOPREFIX | NOT WS_VISIBLE -END - -IDD_MODERNOPT_SBAR DIALOGEX 0, 0, 369, 53 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - CONTROL "Show status bar",IDC_SHOWSBAR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,0,0,369,10 - CONTROL "Show icons",IDC_SHOWICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,15,142,10 - CONTROL "Show protocol names",IDC_SHOWPROTO,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,27,142,10 - CONTROL "Show status text",IDC_SHOWSTATUS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,39,142,10 - CONTROL "Make sections equal width",IDC_EQUALSECTIONS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,15,142,10 - CONTROL "Show bevels on panels",IDC_SBPANELBEVEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,27,107,10 - CONTROL "Show resize grip indicator",IDC_SHOWGRIP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,194,39,96,10 - CONTROL "Right click opens status menu",IDC_RIGHTSTATUS,"Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,22,160,142,10 - CONTROL "Right click opens Miranda IM menu",IDC_RIGHTMIRANDA, - "Button",BS_AUTORADIOBUTTON | NOT WS_VISIBLE,22,147,142,10 -END - -IDD_MODERNOPT_CLCBKG DIALOGEX 0, 0, 232, 143 -STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD -EXSTYLE WS_EX_CONTROLPARENT -FONT 8, "MS Shell Dlg", 0, 0, 0x0 -BEGIN - LTEXT "Background colour",IDC_STATIC,57,28,72,8,NOT WS_GROUP - CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,20,28,32,10 - LTEXT "Selection colour",IDC_STATIC,57,44,72,8 - CONTROL "",IDC_SELCOLOUR,"ColourPicker",WS_TABSTOP,20,44,32,10 - CONTROL "Use background image",IDC_BITMAP,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,63,161,10 - EDITTEXT IDC_FILENAME,20,79,184,12,ES_AUTOHSCROLL - PUSHBUTTON "...",IDC_BROWSE,206,79,15,12 - CONTROL "Stretch to width",IDC_STRETCHH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,96,100,10 - CONTROL "Stretch to height",IDC_STRETCHV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,96,101,10 - CONTROL "Tile horizontally",IDC_TILEH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,109,100,10 - CONTROL "Tile vertically",IDC_TILEV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,109,101,10 - CONTROL "Scroll with text",IDC_SCROLL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,20,122,100,10 - CONTROL "Stretch proportionally",IDC_PROPORTIONAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,120,122,101,10 - CONTROL "Use Windows colours",IDC_WINCOLOUR,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,10,13,156,10 - LTEXT "Contact list background:",IDC_TXT_TITLE1,1,0,230,8 -END - - -///////////////////////////////////////////////////////////////////////////// -// -// DESIGNINFO -// - -#ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO -BEGIN - IDD_DELETECONTACT, DIALOG - BEGIN - LEFTMARGIN, 7 - RIGHTMARGIN, 277 - TOPMARGIN, 7 - BOTTOMMARGIN, 85 - END - - IDD_OPT_CLIST, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 312 - VERTGUIDE, 10 - VERTGUIDE, 107 - TOPMARGIN, 2 - BOTTOMMARGIN, 202 - HORZGUIDE, 179 - HORZGUIDE, 196 - END - - IDD_OPT_CLUI, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 309 - VERTGUIDE, 13 - VERTGUIDE, 23 - VERTGUIDE, 112 - VERTGUIDE, 141 - VERTGUIDE, 151 - VERTGUIDE, 175 - VERTGUIDE, 242 - VERTGUIDE, 246 - TOPMARGIN, 4 - BOTTOMMARGIN, 241 - HORZGUIDE, 18 - HORZGUIDE, 39 - HORZGUIDE, 75 - HORZGUIDE, 180 - HORZGUIDE, 196 - END - - IDD_OPT_CLC, DIALOG - BEGIN - LEFTMARGIN, 2 - RIGHTMARGIN, 312 - VERTGUIDE, 11 - VERTGUIDE, 164 - VERTGUIDE, 216 - TOPMARGIN, 2 - BOTTOMMARGIN, 249 - HORZGUIDE, 145 - HORZGUIDE, 163 - HORZGUIDE, 222 - END - - IDD_OPT_CLCBKG, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 231 - VERTGUIDE, 12 - VERTGUIDE, 22 - VERTGUIDE, 122 - TOPMARGIN, 4 - BOTTOMMARGIN, 150 - HORZGUIDE, 24 - HORZGUIDE, 35 - HORZGUIDE, 73 - HORZGUIDE, 89 - HORZGUIDE, 102 - HORZGUIDE, 115 - END - - IDD_OPT_SBAR, DIALOG - BEGIN - LEFTMARGIN, 4 - RIGHTMARGIN, 199 - VERTGUIDE, 12 - VERTGUIDE, 22 - VERTGUIDE, 188 - TOPMARGIN, 4 - BOTTOMMARGIN, 208 - END -END -#endif // APSTUDIO_INVOKED - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include \r\n" - "#include \r\n" - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Cursor -// - -IDC_HYPERLINKHAND CURSOR "res/hyperlin.cur" -IDC_DROP CURSOR "res/dragcopy.cur" -IDC_DROPUSER CURSOR "res/dropuser.cur" - -///////////////////////////////////////////////////////////////////////////// -// -// Menu -// - -IDR_CLISTMENU MENU -BEGIN - POPUP "&¤" - BEGIN - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_ICQ_EXIT - END - POPUP "&Status" - BEGIN - MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED - MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE - MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY - MENUITEM "&NA\tCtrl+3", ID_STATUS_NA - MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED - MENUITEM "&DND\tCtrl+5", ID_STATUS_DND - MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT - MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE - MENUITEM "On the &Phone\tCtrl+8", ID_STATUS_ONTHEPHONE - MENUITEM "Out to &Lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH - END -END - -IDR_CONTEXT MENU -BEGIN - POPUP "Tray" - BEGIN - MENUITEM "&Hide/Show", ID_TRAY_HIDE - MENUITEM SEPARATOR - MENUITEM "E&xit", ID_TRAY_EXIT - END - POPUP "Nowhere" - BEGIN - MENUITEM "&New Group", POPUP_NEWGROUP - MENUITEM SEPARATOR - MENUITEM "&Hide Offline Users", POPUP_HIDEOFFLINE - MENUITEM "Hide &Offline Users out here", POPUP_HIDEOFFLINEROOT - MENUITEM "Hide &Empty Groups", POPUP_HIDEEMPTYGROUPS - MENUITEM "Disable &Groups", POPUP_DISABLEGROUPS - MENUITEM SEPARATOR - MENUITEM "Hide Miranda", POPUP_HIDEMIRANDA - END - POPUP "Group" - BEGIN - MENUITEM "&New Subgroup", POPUP_NEWSUBGROUP - MENUITEM "&Hide Offline Users in here", POPUP_GROUPHIDEOFFLINE - MENUITEM SEPARATOR - MENUITEM "&Rename Group", POPUP_RENAMEGROUP - MENUITEM "&Delete Group", POPUP_DELETEGROUP - END -END - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/plugins/Clist_classic/src/clc.h b/plugins/Clist_classic/src/clc.h new file mode 100644 index 0000000000..472dc12eab --- /dev/null +++ b/plugins/Clist_classic/src/clc.h @@ -0,0 +1,83 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2010 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ + +#define FONTID_LAST 7 + +struct ClcContact { + BYTE type; + BYTE flags; + union { + struct { + WORD iImage; + HANDLE hContact; + }; + struct { + WORD groupId; + struct ClcGroup *group; + }; + }; + BYTE iExtraImage[MAXEXTRACOLUMNS]; + TCHAR szText[120-MAXEXTRACOLUMNS]; + char * proto; // MS_PROTO_GETBASEPROTO +}; + +struct ClcData { + struct ClcGroup list; + int rowHeight; + int yScroll; + int selection; + struct ClcFontInfo fontInfo[FONTID_MAX+1]; + int scrollTime; + HIMAGELIST himlHighlight; + int groupIndent; + TCHAR szQuickSearch[128]; + int iconXSpace; + HWND hwndRenameEdit; + COLORREF bkColour,selBkColour,selTextColour,hotTextColour,quickSearchColour; + int iDragItem,iInsertionMark; + int dragStage; + POINT ptDragStart; + int dragAutoScrolling; + int dragAutoScrollHeight; + int leftMargin; + int insertionMarkHitHeight; + HBITMAP hBmpBackground; + int backgroundBmpUse,bkChanged; + int iHotTrack; + int gammaCorrection; + DWORD greyoutFlags; //see m_clc.h + DWORD offlineModes; + DWORD exStyle; + POINT ptInfoTip; + int infoTipTimeout; + HANDLE hInfoTipItem; + HIMAGELIST himlExtraColumns; + int extraColumnsCount; + int extraColumnSpacing; + int checkboxSize; + int showSelAlways; + int showIdle; + int noVScrollbar; + int useWindowsColours; + int needsResort; +}; diff --git a/plugins/Clist_classic/src/clcfonts.cpp b/plugins/Clist_classic/src/clcfonts.cpp new file mode 100644 index 0000000000..6a2f3062dc --- /dev/null +++ b/plugins/Clist_classic/src/clcfonts.cpp @@ -0,0 +1,137 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2010 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ + +#include "commonheaders.h" + +#include "m_fontservice.h" + +#define CLIST_FONTID_CONTACTS 0 +#define CLIST_FONTID_INVIS 1 +#define CLIST_FONTID_OFFLINE 2 +#define CLIST_FONTID_NOTONLIST 3 +#define CLIST_FONTID_GROUPS 4 +#define CLIST_FONTID_GROUPCOUNTS 5 +#define CLIST_FONTID_DIVIDERS 6 +#define CLIST_FONTID_OFFINVIS 7 +#define CLIST_FONTID_MAX 7 + +static const TCHAR* szClistFontIdDescr[CLIST_FONTID_MAX + 1] = +{ + LPGENT( "Standard contacts"), + LPGENT( "Online contacts to whom you have a different visibility"), + LPGENT( "Offline contacts"), + LPGENT( "Contacts which are 'not on list'"), + LPGENT( "Groups"), + LPGENT( "Group member counts"), + LPGENT( "Dividers"), + LPGENT( "Offline contacts to whom you have a different visibility" ) +}; + +static int fontListOrder[CLIST_FONTID_MAX + 1] = +{ + CLIST_FONTID_CONTACTS, + CLIST_FONTID_INVIS, + CLIST_FONTID_OFFLINE, + CLIST_FONTID_OFFINVIS, + CLIST_FONTID_NOTONLIST, + CLIST_FONTID_GROUPS, + CLIST_FONTID_GROUPCOUNTS, + CLIST_FONTID_DIVIDERS +}; + +static int FS_FontsChanged(WPARAM wParam, LPARAM lParam) +{ + pcli->pfnClcOptionsChanged(); + return 0; +} + +void RegisterCListFonts() +{ + FontIDT fontid = {0}; + ColourIDT colourid = {0}; + char idstr[10]; + int i; + + fontid.cbSize = sizeof(FontIDT); + fontid.flags = FIDF_ALLOWREREGISTER | FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS; + + for (i = 0; i <= CLIST_FONTID_MAX; i++) { + + switch (fontListOrder[i]) + { + case FONTID_GROUPS: + case FONTID_GROUPCOUNTS: + fontid.flags &= ~FIDF_CLASSMASK; + fontid.flags |= FIDF_CLASSHEADER; + break; + case FONTID_DIVIDERS: + fontid.flags &= ~FIDF_CLASSMASK; + fontid.flags |= FIDF_CLASSSMALL; + break; + default: + fontid.flags &= ~FIDF_CLASSMASK; + fontid.flags |= FIDF_CLASSGENERAL; + break; + } + + strncpy(fontid.dbSettingsGroup, "CLC", sizeof(fontid.dbSettingsGroup)); + _tcsncpy(fontid.group, _T("Contact List"), SIZEOF(fontid.group)); + _tcsncpy(fontid.name, szClistFontIdDescr[fontListOrder[i]], SIZEOF(fontid.name)); + sprintf(idstr, "Font%d", fontListOrder[i]); + strncpy(fontid.prefix, idstr, SIZEOF(fontid.prefix)); + fontid.order = fontListOrder[i]; + + FontRegisterT(&fontid); + } + + // and colours + colourid.cbSize = sizeof(ColourIDT); + colourid.order = 0; + strncpy(colourid.dbSettingsGroup, "CLC", sizeof(colourid.dbSettingsGroup)); + + strncpy(colourid.setting, "BkColour", sizeof(colourid.setting)); + _tcsncpy(colourid.name, LPGENT("Background"), SIZEOF(colourid.name)); + _tcsncpy(colourid.group, LPGENT("Contact List"), SIZEOF(colourid.group)); + colourid.defcolour = CLCDEFAULT_BKCOLOUR; + ColourRegisterT(&colourid); + + strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); + _tcsncpy(colourid.name, LPGENT("Selected Text"), SIZEOF(colourid.name)); + colourid.order = 1; + colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; + ColourRegisterT(&colourid); + + strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); + _tcsncpy(colourid.name, LPGENT("Hottrack Text"), SIZEOF(colourid.name)); + colourid.order = 1; + colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; + ColourRegisterT(&colourid); + + strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); + _tcsncpy(colourid.name, LPGENT("Quicksearch Text"), SIZEOF(colourid.name)); + colourid.order = 1; + colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; + ColourRegisterT(&colourid); + + HookEvent(ME_FONT_RELOAD, FS_FontsChanged); +} diff --git a/plugins/Clist_classic/src/clcopts.cpp b/plugins/Clist_classic/src/clcopts.cpp new file mode 100644 index 0000000000..51f9c8a08b --- /dev/null +++ b/plugins/Clist_classic/src/clcopts.cpp @@ -0,0 +1,479 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2010 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ + +#include "commonheaders.h" + +#define DBFONTF_BOLD 1 +#define DBFONTF_ITALIC 2 +#define DBFONTF_UNDERLINE 4 + +struct CheckBoxToStyleEx_t +{ + int id; + DWORD flag; + int not; +} + +static const checkBoxToStyleEx[] = { + {IDC_DISABLEDRAGDROP, CLS_EX_DISABLEDRAGDROP, 0}, + {IDC_NOTEDITLABELS, CLS_EX_EDITLABELS, 1}, + {IDC_SHOWSELALWAYS, CLS_EX_SHOWSELALWAYS, 0}, + {IDC_TRACKSELECT, CLS_EX_TRACKSELECT, 0}, + {IDC_SHOWGROUPCOUNTS, CLS_EX_SHOWGROUPCOUNTS, 0}, + {IDC_HIDECOUNTSWHENEMPTY, CLS_EX_HIDECOUNTSWHENEMPTY, 0}, + {IDC_DIVIDERONOFF, CLS_EX_DIVIDERONOFF, 0}, + {IDC_NOTNOTRANSLUCENTSEL, CLS_EX_NOTRANSLUCENTSEL, 1}, + {IDC_LINEWITHGROUPS, CLS_EX_LINEWITHGROUPS, 0}, + {IDC_QUICKSEARCHVISONLY, CLS_EX_QUICKSEARCHVISONLY, 0}, + {IDC_SORTGROUPSALPHA, CLS_EX_SORTGROUPSALPHA, 0}, + {IDC_NOTNOSMOOTHSCROLLING, CLS_EX_NOSMOOTHSCROLLING, 1} +}; + +struct CheckBoxValues_t +{ + DWORD style; + TCHAR* szDescr; +}; + +static const struct CheckBoxValues_t greyoutValues[] = { + { GREYF_UNFOCUS, LPGENT("Not focused") }, + { MODEF_OFFLINE, LPGENT("Offline") }, + { PF2_ONLINE, LPGENT("Online") }, + { PF2_SHORTAWAY, LPGENT("Away") }, + { PF2_LONGAWAY, LPGENT("NA") }, + { PF2_LIGHTDND, LPGENT("Occupied") }, + { PF2_HEAVYDND, LPGENT("DND") }, + { PF2_FREECHAT, LPGENT("Free for chat") }, + { PF2_INVISIBLE, LPGENT("Invisible") }, + { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, + { PF2_ONTHEPHONE, LPGENT("On the phone") } +}; + +static const struct CheckBoxValues_t offlineValues[] = { + { MODEF_OFFLINE, LPGENT("Offline") }, + { PF2_ONLINE, LPGENT("Online") }, + { PF2_SHORTAWAY, LPGENT("Away") }, + { PF2_LONGAWAY, LPGENT("NA") }, + { PF2_LIGHTDND, LPGENT("Occupied") }, + { PF2_HEAVYDND, LPGENT("DND") }, + { PF2_FREECHAT, LPGENT("Free for chat") }, + { PF2_INVISIBLE, LPGENT("Invisible") }, + { PF2_OUTTOLUNCH, LPGENT("Out to lunch") }, + { PF2_ONTHEPHONE, LPGENT("On the phone") } +}; + +static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style) +{ + TVINSERTSTRUCT tvis; + int i; + + tvis.hParent = NULL; + tvis.hInsertAfter = TVI_LAST; + tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE; + for (i = 0; i < nValues; i++) { + tvis.item.lParam = values[i].style; + tvis.item.pszText = TranslateTS( values[i].szDescr ); + tvis.item.stateMask = TVIS_STATEIMAGEMASK; + tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1); + TreeView_InsertItem( hwndTree, &tvis); +} } + +static DWORD MakeCheckBoxTreeFlags(HWND hwndTree) +{ + DWORD flags = 0; + TVITEM tvi; + + tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE; + tvi.hItem = TreeView_GetRoot(hwndTree); + while (tvi.hItem) { + TreeView_GetItem(hwndTree, &tvi); + if (((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 2)) + flags |= tvi.lParam; + tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem); + } + return flags; +} + +static LONG CalcMinRowHeight() +{ + int i; + LONG minHeight = 16; + HDC hdc = GetDC(NULL); + for (i = 0; i < FONTID_LAST; i++) { + HFONT hFont; + LOGFONT lf; + COLORREF color; + SIZE fontSize; + pcli->pfnGetFontSetting(i, &lf, &color); + lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72); + hFont = CreateFontIndirect(&lf); + hFont = ( HFONT )SelectObject(hdc, hFont); + GetTextExtentPoint32(hdc, _T("x"), 1, &fontSize); + if (fontSize.cy > minHeight) + minHeight = fontSize.cy; + hFont = ( HFONT )SelectObject(hdc,hFont); + DeleteObject(hFont); + } + ReleaseDC(NULL, hdc); + return minHeight; +} + +static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE, + GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); + SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE, + GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES); + { + int i; + DWORD exStyle = DBGetContactSettingDword(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle()); + for (i = 0; i < SIZEOF(checkBoxToStyleEx); i++) + CheckDlgButton(hwndDlg, checkBoxToStyleEx[i].id, + (exStyle & checkBoxToStyleEx[i].flag) ^ (checkBoxToStyleEx[i].flag * + checkBoxToStyleEx[i].not) ? BST_CHECKED : BST_UNCHECKED); + } + { + UDACCEL accel[2] = { {0, 10} , {2, 50} }; + SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETRANGE, 0, MAKELONG(999, 0)); + SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETACCEL, SIZEOF(accel), (LPARAM) & accel); + SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETPOS, 0, + MAKELONG(DBGetContactSettingWord(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME), 0)); + } + CheckDlgButton(hwndDlg, IDC_IDLE, DBGetContactSettingByte(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED); + SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETRANGE, 0, MAKELONG(64, 0)); + SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, + MAKELONG(DBGetContactSettingByte(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN), 0)); + SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0)); + SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETPOS, 0, + MAKELONG(DBGetContactSettingByte(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT), 0)); + CheckDlgButton(hwndDlg, IDC_GREYOUT, + DBGetContactSettingDword(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING)); + EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT)); + FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, SIZEOF(greyoutValues), + DBGetContactSettingDword(NULL, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS)); + FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, SIZEOF(offlineValues), + DBGetContactSettingDword(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES)); + CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, DBGetContactSettingByte(NULL, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_GAMMACORRECT, DBGetContactSettingByte(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT) ? BST_CHECKED : BST_UNCHECKED); + { + LONG minHeight = CalcMinRowHeight(); + LONG rowHeight = DBGetContactSettingByte(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT); + if (rowHeight < minHeight) { + rowHeight = minHeight; + } + SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETRANGE, 0, MAKELONG(255, minHeight)); + SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETPOS, 0, MAKELONG(rowHeight, 0)); + } + return TRUE; + case WM_SETFOCUS: + { + LONG minHeight = CalcMinRowHeight(); + LONG rowHeight = SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0); + if (rowHeight < minHeight) { + rowHeight = minHeight; + SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETPOS, 0, MAKELONG(rowHeight, 0)); + } + SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETRANGE, 0, MAKELONG(255, minHeight)); + } + break; + case WM_VSCROLL: + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + case WM_COMMAND: + if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING) + EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING)); + if (LOWORD(wParam) == IDC_GREYOUT) + EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT)); + if ((LOWORD(wParam) == IDC_LEFTMARGIN || LOWORD(wParam) == IDC_SMOOTHTIME || LOWORD(wParam) == IDC_GROUPINDENT + || LOWORD(wParam) == IDC_ROWHEIGHT) + && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())) + return 0; + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + case WM_NOTIFY: + switch (((LPNMHDR) lParam)->idFrom) { + case IDC_GREYOUTOPTS: + case IDC_HIDEOFFLINEOPTS: + if (((LPNMHDR) lParam)->code == NM_CLICK) { + TVHITTESTINFO hti; + hti.pt.x = (short) LOWORD(GetMessagePos()); + hti.pt.y = (short) HIWORD(GetMessagePos()); + ScreenToClient(((LPNMHDR) lParam)->hwndFrom, &hti.pt); + if (TreeView_HitTest(((LPNMHDR) lParam)->hwndFrom, &hti)) + if (hti.flags & TVHT_ONITEMSTATEICON) { + TVITEM tvi; + tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE; + tvi.hItem = hti.hItem; + TreeView_GetItem(((LPNMHDR) lParam)->hwndFrom, &tvi); + tvi.iImage = tvi.iSelectedImage = tvi.iImage == 1 ? 2 : 1; + TreeView_SetItem(((LPNMHDR) lParam)->hwndFrom, &tvi); + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + } + } + break; + case 0: + if (((LPNMHDR) lParam)->code == PSN_APPLY ) { + int i; + DWORD exStyle = 0; + for (i = 0; i < SIZEOF(checkBoxToStyleEx); i++) + if ((IsDlgButtonChecked(hwndDlg, checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not) + exStyle |= checkBoxToStyleEx[i].flag; + + DBWriteContactSettingDword(NULL, "CLC", "ExStyle", exStyle); + { + DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS)); + DBWriteContactSettingDword(NULL, "CLC", "FullGreyoutFlags", fullGreyoutFlags); + if (IsDlgButtonChecked(hwndDlg, IDC_GREYOUT)) + DBWriteContactSettingDword(NULL, "CLC", "GreyoutFlags", fullGreyoutFlags); + else + DBWriteContactSettingDword(NULL, "CLC", "GreyoutFlags", 0); + } + DBWriteContactSettingByte(NULL, "CLC", "ShowIdle", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0)); + DBWriteContactSettingDword(NULL, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS))); + DBWriteContactSettingByte(NULL, "CLC", "LeftMargin", + (BYTE) SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0)); + DBWriteContactSettingWord(NULL, "CLC", "ScrollTime", + (WORD) SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0)); + DBWriteContactSettingByte(NULL, "CLC", "GroupIndent", + (BYTE) SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0)); + DBWriteContactSettingByte(NULL, "CLC", "NoVScrollBar", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0)); + DBWriteContactSettingByte(NULL, "CLC", "RowHeight", (BYTE) SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0)); + DBWriteContactSettingByte(NULL, "CLC", "GammaCorrect", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT)); + pcli->pfnClcOptionsChanged(); + return TRUE; + } + break; + } + break; + case WM_DESTROY: + ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), TVSIL_NORMAL)); + break; + } + return FALSE; +} + +static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + CheckDlgButton(hwndDlg, IDC_BITMAP, + DBGetContactSettingByte(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP) ? BST_CHECKED : BST_UNCHECKED); + SendMessage(hwndDlg, WM_USER + 10, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_BKCOLOUR); + SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR)); + SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELBKCOLOUR); + SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, + DBGetContactSettingDword(NULL, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR)); + CheckDlgButton(hwndDlg, IDC_WINCOLOUR, DBGetContactSettingByte(NULL, "CLC", "UseWinColours", 0)); + SendMessage(hwndDlg, WM_USER + 11, 0, 0); + { + DBVARIANT dbv; + if (!DBGetContactSettingString(NULL, "CLC", "BkBitmap", &dbv)) { + SetDlgItemTextA(hwndDlg, IDC_FILENAME, dbv.pszVal); + if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) { + char szPath[MAX_PATH]; + + if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) dbv.pszVal, (LPARAM) szPath)) + SetDlgItemTextA(hwndDlg, IDC_FILENAME, szPath); + } + DBFreeVariant(&dbv); + } + } + { + WORD bmpUse = DBGetContactSettingWord(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE); + CheckDlgButton(hwndDlg, IDC_STRETCHH, bmpUse & CLB_STRETCHH ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_STRETCHV, bmpUse & CLB_STRETCHV ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_TILEH, bmpUse & CLBF_TILEH ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_TILEV, bmpUse & CLBF_TILEV ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SCROLL, bmpUse & CLBF_SCROLL ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_PROPORTIONAL, bmpUse & CLBF_PROPORTIONAL ? BST_CHECKED : BST_UNCHECKED); + } + { + HRESULT(STDAPICALLTYPE * MySHAutoComplete) (HWND, DWORD); + MySHAutoComplete = (HRESULT(STDAPICALLTYPE *) (HWND, DWORD)) GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete"); + if (MySHAutoComplete) + MySHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1); + } + return TRUE; + case WM_USER + 10: + EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAME), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STRETCHH), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STRETCHV), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + EnableWindow(GetDlgItem(hwndDlg, IDC_TILEH), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + EnableWindow(GetDlgItem(hwndDlg, IDC_TILEV), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SCROLL), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + EnableWindow(GetDlgItem(hwndDlg, IDC_PROPORTIONAL), IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + break; + case WM_USER + 11: + { + BOOL b = IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR); + EnableWindow(GetDlgItem(hwndDlg, IDC_BKGCOLOUR), !b); + EnableWindow(GetDlgItem(hwndDlg, IDC_SELCOLOUR), !b); + break; + } + case WM_COMMAND: + if (LOWORD(wParam) == IDC_BROWSE) { + char str[MAX_PATH]; + OPENFILENAMEA ofn = { 0 }; + char filter[512]; + + GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, SIZEOF(str)); + ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; + ofn.hwndOwner = hwndDlg; + ofn.hInstance = NULL; + CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, SIZEOF(filter), (LPARAM) filter); + ofn.lpstrFilter = filter; + ofn.lpstrFile = str; + ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY; + ofn.nMaxFile = SIZEOF(str); + ofn.nMaxFileTitle = MAX_PATH; + ofn.lpstrDefExt = "bmp"; + if (!GetOpenFileNameA(&ofn)) + break; + SetDlgItemTextA(hwndDlg, IDC_FILENAME, str); + } + else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) + break; + if (LOWORD(wParam) == IDC_BITMAP) + SendMessage(hwndDlg, WM_USER + 10, 0, 0); + if (LOWORD(wParam) == IDC_WINCOLOUR) + SendMessage(hwndDlg, WM_USER + 11, 0, 0); + if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())) + return 0; + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + case WM_NOTIFY: + switch (((LPNMHDR) lParam)->idFrom) { + case 0: + switch (((LPNMHDR) lParam)->code) { + case PSN_APPLY: + DBWriteContactSettingByte(NULL, "CLC", "UseBitmap", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BITMAP)); + { + COLORREF col; + col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0); + if (col == CLCDEFAULT_BKCOLOUR) + DBDeleteContactSetting(NULL, "CLC", "BkColour"); + else + DBWriteContactSettingDword(NULL, "CLC", "BkColour", col); + col = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0); + if (col == CLCDEFAULT_SELBKCOLOUR) + DBDeleteContactSetting(NULL, "CLC", "SelBkColour"); + else + DBWriteContactSettingDword(NULL, "CLC", "SelBkColour", col); + DBWriteContactSettingByte(NULL, "CLC", "UseWinColours", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR))); + } + { + char str[MAX_PATH], strrel[MAX_PATH]; + GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, SIZEOF(str)); + if (ServiceExists(MS_UTILS_PATHTORELATIVE)) { + if (CallService(MS_UTILS_PATHTORELATIVE, (WPARAM) str, (LPARAM) strrel)) + DBWriteContactSettingString(NULL, "CLC", "BkBitmap", strrel); + else + DBWriteContactSettingString(NULL, "CLC", "BkBitmap", str); + } + else + DBWriteContactSettingString(NULL, "CLC", "BkBitmap", str); + } + { + WORD flags = 0; + if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH)) + flags |= CLB_STRETCHH; + if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHV)) + flags |= CLB_STRETCHV; + if (IsDlgButtonChecked(hwndDlg, IDC_TILEH)) + flags |= CLBF_TILEH; + if (IsDlgButtonChecked(hwndDlg, IDC_TILEV)) + flags |= CLBF_TILEV; + if (IsDlgButtonChecked(hwndDlg, IDC_SCROLL)) + flags |= CLBF_SCROLL; + if (IsDlgButtonChecked(hwndDlg, IDC_PROPORTIONAL)) + flags |= CLBF_PROPORTIONAL; + DBWriteContactSettingWord(NULL, "CLC", "BkBmpUse", flags); + } + pcli->pfnClcOptionsChanged(); + return TRUE; + } + break; + } + break; + } + return FALSE; +} + +/****************************************************************************************/ + +int ClcOptInit(WPARAM wParam, LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp; + + ZeroMemory(&odp, sizeof(odp)); + odp.cbSize = sizeof(odp); + odp.position = 0; + odp.hInstance = g_hInst; + odp.pszGroup = LPGEN("Contact List"); + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC); + odp.pszTitle = LPGEN("List"); + odp.pfnDlgProc = DlgProcClcMainOpts; + odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY; + Options_AddPage(wParam, &odp); + + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLCBKG); + odp.pszTitle = LPGEN("List Background"); + odp.pfnDlgProc = DlgProcClcBkgOpts; + odp.flags = ODPF_BOLDGROUPS; + Options_AddPage(wParam, &odp); + + return 0; +} + +int ClcModernOptInit(WPARAM wParam, LPARAM lParam) +{ + static int iBoldControls[] = + { + IDC_TXT_TITLE1, IDC_TXT_TITLE2, + MODERNOPT_CTRL_LAST + }; + + MODERNOPTOBJECT obj = {0}; + + obj.cbSize = sizeof(obj); + obj.dwFlags = MODEROPT_FLG_TCHAR; + obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + obj.hInstance = g_hInst; + obj.iSection = MODERNOPT_PAGE_SKINS; + obj.iType = MODERNOPT_TYPE_SUBSECTIONPAGE; + obj.lptzSubsection = LPGENT("Contact List"); + obj.iBoldControls = iBoldControls; + obj.lpzHelpUrl = "http://wiki.miranda-im.org/"; + + obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_CLCBKG); + obj.pfnDlgProc = DlgProcClcBkgOpts; + CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); + return 0; +} diff --git a/plugins/Clist_classic/src/clcpaint.cpp b/plugins/Clist_classic/src/clcpaint.cpp new file mode 100644 index 0000000000..dfa4147244 --- /dev/null +++ b/plugins/Clist_classic/src/clcpaint.cpp @@ -0,0 +1,596 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2010 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ +#include "commonheaders.h" + +extern HIMAGELIST himlCListClc; +static BYTE divide3[765] = { 255 }; + +static void ChangeToFont(HDC hdc, struct ClcData *dat, int id, int *fontHeight) +{ + SelectObject(hdc, dat->fontInfo[id].hFont); + SetTextColor(hdc, dat->fontInfo[id].colour); + if (fontHeight) + *fontHeight = dat->fontInfo[id].fontHeight; +} + +static void __inline SetHotTrackColour(HDC hdc, struct ClcData *dat) +{ + if (dat->gammaCorrection) { + COLORREF oldCol, newCol; + int oldLum, newLum; + + oldCol = GetTextColor(hdc); + oldLum = (GetRValue(oldCol) * 30 + GetGValue(oldCol) * 59 + GetBValue(oldCol) * 11) / 100; + newLum = (GetRValue(dat->hotTextColour) * 30 + GetGValue(dat->hotTextColour) * 59 + GetBValue(dat->hotTextColour) * 11) / 100; + if (newLum == 0) { + SetTextColor(hdc, dat->hotTextColour); + return; + } + if (newLum >= oldLum + 20) { + oldLum += 20; + newCol = + RGB(GetRValue(dat->hotTextColour) * oldLum / newLum, GetGValue(dat->hotTextColour) * oldLum / newLum, + GetBValue(dat->hotTextColour) * oldLum / newLum); + } + else if (newLum <= oldLum) { + int r, g, b; + r = GetRValue(dat->hotTextColour) * oldLum / newLum; + g = GetGValue(dat->hotTextColour) * oldLum / newLum; + b = GetBValue(dat->hotTextColour) * oldLum / newLum; + if (r > 255) { + g += (r - 255) * 3 / 7; + b += (r - 255) * 3 / 7; + r = 255; + } + if (g > 255) { + r += (g - 255) * 59 / 41; + if (r > 255) + r = 255; + b += (g - 255) * 59 / 41; + g = 255; + } + if (b > 255) { + r += (b - 255) * 11 / 89; + if (r > 255) + r = 255; + g += (b - 255) * 11 / 89; + if (g > 255) + g = 255; + b = 255; + } + newCol = RGB(r, g, b); + } + else + newCol = dat->hotTextColour; + SetTextColor(hdc, newCol); + } + else + SetTextColor(hdc, dat->hotTextColour); +} + +static int GetStatusOnlineness(int status) +{ + switch (status) { + case ID_STATUS_FREECHAT: return 110; + case ID_STATUS_ONLINE: return 100; + case ID_STATUS_OCCUPIED: return 60; + case ID_STATUS_ONTHEPHONE: return 50; + case ID_STATUS_DND: return 40; + case ID_STATUS_AWAY: return 30; + case ID_STATUS_OUTTOLUNCH: return 20; + case ID_STATUS_NA: return 10; + case ID_STATUS_INVISIBLE: return 5; + } + return 0; +} + +static int GetGeneralisedStatus(void) +{ + int i, status, thisStatus, statusOnlineness, thisOnlineness; + + status = ID_STATUS_OFFLINE; + statusOnlineness = 0; + + for (i = 0; i < pcli->hClcProtoCount; i++) { + thisStatus = pcli->clcProto[i].dwStatus; + if (thisStatus == ID_STATUS_INVISIBLE) + return ID_STATUS_INVISIBLE; + thisOnlineness = GetStatusOnlineness(thisStatus); + if (thisOnlineness > statusOnlineness) { + status = thisStatus; + statusOnlineness = thisOnlineness; + } + } + return status; +} + +static int GetRealStatus(struct ClcContact *contact, int status) +{ + int i; + char *szProto = contact->proto; + if (!szProto) + return status; + for (i = 0; i < pcli->hClcProtoCount; i++) { + if (!lstrcmpA(pcli->clcProto[i].szProto, szProto)) { + return pcli->clcProto[i].dwStatus; + } + } + return status; +} + +static HMODULE themeAPIHandle = NULL; // handle to uxtheme.dll +static HANDLE(WINAPI * MyOpenThemeData) (HWND, LPCWSTR); +static HRESULT(WINAPI * MyCloseThemeData) (HANDLE); +static HRESULT(WINAPI * MyDrawThemeBackground) (HANDLE, HDC, int, int, const RECT *, const RECT *); + +#define MGPROC(x) GetProcAddress(themeAPIHandle,x) +void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint) +{ + HDC hdcMem; + RECT clRect; + int i, y, indent, index, fontHeight; + struct ClcGroup *group; + HBITMAP hBmpOsb, hOldBitmap; + HFONT hOldFont; + DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE); + int status = GetGeneralisedStatus(); + int grey = 0, groupCountsFontTopShift; + HBRUSH hBrushAlternateGrey = NULL; + // yes I know about GetSysColorBrush() + COLORREF tmpbkcolour = style & CLS_CONTACTLIST ? (dat->useWindowsColours ? GetSysColor(COLOR_3DFACE) : dat->bkColour) : dat->bkColour; + int minHeight = 16; + for (i = 0; i < FONTID_LAST; i++) { + if (minHeight < dat->fontInfo[i].fontHeight) { + minHeight = dat->fontInfo[i].fontHeight; + } + } + if (dat->rowHeight < minHeight) { + dat->rowHeight = minHeight; + } + + if (dat->greyoutFlags & pcli->pfnClcStatusToPf2(status) || style & WS_DISABLED) + grey = 1; + else if (GetFocus() != hwnd && dat->greyoutFlags & GREYF_UNFOCUS) + grey = 1; + GetClientRect(hwnd, &clRect); + if (rcPaint == NULL) + rcPaint = &clRect; + if (IsRectEmpty(rcPaint)) + return; + y = -dat->yScroll; + hdcMem = CreateCompatibleDC(hdc); + hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), NULL); + hOldBitmap = (HBITMAP)SelectObject(hdcMem, hBmpOsb); + { + TEXTMETRIC tm; + hOldFont = (HFONT)SelectObject(hdcMem, dat->fontInfo[FONTID_GROUPS].hFont); + GetTextMetrics(hdcMem, &tm); + groupCountsFontTopShift = tm.tmAscent; + SelectObject(hdcMem, dat->fontInfo[FONTID_GROUPCOUNTS].hFont); + GetTextMetrics(hdcMem, &tm); + groupCountsFontTopShift -= tm.tmAscent; + } + if (style & CLS_GREYALTERNATE) + hBrushAlternateGrey = + CreateSolidBrush(GetNearestColor(hdcMem, RGB(GetRValue(tmpbkcolour) - 10, GetGValue(tmpbkcolour) - 10, GetBValue(tmpbkcolour) - 10))); + + ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); + SetBkMode(hdcMem, TRANSPARENT); + { + HBRUSH hBrush; + + hBrush = CreateSolidBrush(tmpbkcolour); + FillRect(hdcMem, rcPaint, hBrush); + DeleteObject(hBrush); + if (dat->hBmpBackground) { + BITMAP bmp; + HDC hdcBmp; + int x, y; + int maxx, maxy; + int destw, desth; + + // XXX: Halftone isnt supported on 9x, however the scretch problems dont happen on 98. + SetStretchBltMode(hdcMem, HALFTONE); + + GetObject(dat->hBmpBackground, sizeof(bmp), &bmp); + hdcBmp = CreateCompatibleDC(hdcMem); + SelectObject(hdcBmp, dat->hBmpBackground); + y = dat->backgroundBmpUse & CLBF_SCROLL ? -dat->yScroll : 0; + maxx = dat->backgroundBmpUse & CLBF_TILEH ? clRect.right : 1; + maxy = dat->backgroundBmpUse & CLBF_TILEV ? maxy = rcPaint->bottom : y + 1; + switch (dat->backgroundBmpUse & CLBM_TYPE) { + case CLB_STRETCH: + if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) { + if (clRect.right * bmp.bmHeight < clRect.bottom * bmp.bmWidth) { + desth = clRect.bottom; + destw = desth * bmp.bmWidth / bmp.bmHeight; + } + else { + destw = clRect.right; + desth = destw * bmp.bmHeight / bmp.bmWidth; + } + } + else { + destw = clRect.right; + desth = clRect.bottom; + } + break; + case CLB_STRETCHH: + if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) { + destw = clRect.right; + desth = destw * bmp.bmHeight / bmp.bmWidth; + } + else { + destw = clRect.right; + desth = bmp.bmHeight; + } + break; + case CLB_STRETCHV: + if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) { + desth = clRect.bottom; + destw = desth * bmp.bmWidth / bmp.bmHeight; + } + else { + destw = bmp.bmWidth; + desth = clRect.bottom; + } + break; + default: //clb_topleft + destw = bmp.bmWidth; + desth = bmp.bmHeight; + break; + } + for (; y < maxy; y += desth) { + if (y < rcPaint->top - desth) + continue; + for (x = 0; x < maxx; x += destw) + StretchBlt(hdcMem, x, y, destw, desth, hdcBmp, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY); + } + DeleteDC(hdcBmp); + } + } + group = &dat->list; + group->scanIndex = 0; + indent = 0; + for (index = 0; y < rcPaint->bottom;) { + if (group->scanIndex == group->cl.count) { + group = group->parent; + indent--; + if (group == NULL) + break; + group->scanIndex++; + continue; + } + if (y > rcPaint->top - dat->rowHeight) { + int iImage = -1; + int selected = index == dat->selection && (dat->showSelAlways || dat->exStyle & CLS_EX_SHOWSELALWAYS || GetFocus() == hwnd) + && group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER; + int hottrack = dat->exStyle & CLS_EX_TRACKSELECT && group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER && dat->iHotTrack == index; + SIZE textSize, countsSize, spaceSize; + int width, checkboxWidth; + char *szCounts; + + //alternating grey + if (style & CLS_GREYALTERNATE && index & 1) { + RECT rc; + rc.top = y; + rc.bottom = rc.top + dat->rowHeight; + rc.left = 0; + rc.right = clRect.right; + FillRect(hdcMem, &rc, hBrushAlternateGrey); + } + + //setup + if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) + ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight); + else if (group->cl.items[group->scanIndex]->type == CLCIT_INFO) { + if (group->cl.items[group->scanIndex]->flags & CLCIIF_GROUPFONT) + ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight); + else + ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); + } + else if (group->cl.items[group->scanIndex]->type == CLCIT_DIVIDER) + ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight); + else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST) + ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight); + else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && + ((group->cl.items[group->scanIndex]->flags & CONTACTF_INVISTO + && GetRealStatus(group->cl.items[group->scanIndex], status) != ID_STATUS_INVISIBLE) + || (group->cl.items[group->scanIndex]->flags & CONTACTF_VISTO + && GetRealStatus(group->cl.items[group->scanIndex], status) == ID_STATUS_INVISIBLE) + ) + ) { + // the contact is in the always visible list and the proto is invisible + // the contact is in the always invisible and the proto is in any other mode + ChangeToFont(hdcMem, dat, group->cl.items[group->scanIndex]->flags & CONTACTF_ONLINE ? FONTID_INVIS : FONTID_OFFINVIS, &fontHeight); + } + else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && !(group->cl.items[group->scanIndex]->flags & CONTACTF_ONLINE)) + ChangeToFont(hdcMem, dat, FONTID_OFFLINE, &fontHeight); + else + ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight); + GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, lstrlen(group->cl.items[group->scanIndex]->szText), &textSize); + width = textSize.cx; + if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { + szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]); + if (szCounts[0]) { + GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize); + ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight); + GetTextExtentPoint32A(hdcMem, szCounts, lstrlenA(szCounts), &countsSize); + width += spaceSize.cx + countsSize.cx; + } + } + + if ((style & CLS_CHECKBOXES && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) || + (style & CLS_GROUPCHECKBOXES && group->cl.items[group->scanIndex]->type == CLCIT_GROUP) || + (group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->flags & CLCIIF_CHECKBOX)) + checkboxWidth = dat->checkboxSize + 2; + else + checkboxWidth = 0; + + //background + if (selected) { + int x = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace - 2; + ImageList_DrawEx(dat->himlHighlight, 0, hdcMem, x, y, min(width + 5, clRect.right - x), dat->rowHeight, CLR_NONE, CLR_NONE, + dat->exStyle & CLS_EX_NOTRANSLUCENTSEL ? ILD_NORMAL : ILD_BLEND25); + SetTextColor(hdcMem, dat->selTextColour); + } + else if (hottrack) + SetHotTrackColour(hdcMem, dat); + + //checkboxes + if (checkboxWidth) { + RECT rc; + HANDLE hTheme = NULL; + + // THEME + if (IsWinVerXPPlus()) { + if (!themeAPIHandle) { + themeAPIHandle = GetModuleHandleA("uxtheme"); + if (themeAPIHandle) { + MyOpenThemeData = (HANDLE(WINAPI *) (HWND, LPCWSTR)) MGPROC("OpenThemeData"); + MyCloseThemeData = (HRESULT(WINAPI *) (HANDLE)) MGPROC("CloseThemeData"); + MyDrawThemeBackground = + (HRESULT(WINAPI *) (HANDLE, HDC, int, int, const RECT *, const RECT *)) MGPROC("DrawThemeBackground"); + } + } + // Make sure all of these methods are valid (i would hope either all or none work) + if (MyOpenThemeData && MyCloseThemeData && MyDrawThemeBackground) { + hTheme = MyOpenThemeData(hwnd, L"BUTTON"); + } + } + rc.left = dat->leftMargin + indent * dat->groupIndent; + rc.right = rc.left + dat->checkboxSize; + rc.top = y + ((dat->rowHeight - dat->checkboxSize) >> 1); + rc.bottom = rc.top + dat->checkboxSize; + if (hTheme) { + MyDrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? (hottrack ? CBS_CHECKEDHOT : CBS_CHECKEDNORMAL) : (hottrack ? CBS_UNCHECKEDHOT : CBS_UNCHECKEDNORMAL), &rc, &rc); + } + else + DrawFrameControl(hdcMem, &rc, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_FLAT | (group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? DFCS_CHECKED : 0) | (hottrack ? DFCS_HOT : 0)); + if (hTheme && MyCloseThemeData) { + MyCloseThemeData(hTheme); + hTheme = NULL; + } + } + + //icon + if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) + iImage = group->cl.items[group->scanIndex]->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT; + else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) + iImage = group->cl.items[group->scanIndex]->iImage; + if (iImage != -1) { + /*COLORREF colourFg=dat->selBkColour; + int mode=ILD_NORMAL; + if(selected) mode=ILD_SELECTED; + else if(hottrack) {mode=ILD_FOCUS; colourFg=dat->hotTextColour;} + else if(group->cl.items[group->scanIndex]->type==CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags&CONTACTF_NOTONLIST) {colourFg=dat->fontInfo[FONTID_NOTONLIST].colour; mode=ILD_BLEND50;} + ImageList_DrawEx(himlCListClc,iImage,hdcMem,dat->leftMargin+indent*dat->groupIndent+checkboxWidth,y+((dat->rowHeight-16)>>1),0,0,CLR_NONE,colourFg,mode); + */ + // this doesnt use CLS_CONTACTLIST since the colour prolly wont match anyway + COLORREF colourFg = dat->selBkColour; + int mode = ILD_NORMAL; + if (hottrack) { + colourFg = dat->hotTextColour; + } + else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST) { + colourFg = dat->fontInfo[FONTID_NOTONLIST].colour; + mode = ILD_BLEND50; + } + if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && dat->showIdle + && (group->cl.items[group->scanIndex]->flags & CONTACTF_IDLE) + && GetRealStatus(group->cl.items[group->scanIndex], ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE) + mode = ILD_SELECTED; + ImageList_DrawEx(himlCListClc, iImage, hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth, + y + ((dat->rowHeight - 16) >> 1), 0, 0, CLR_NONE, colourFg, mode); + } + + //text + if (group->cl.items[group->scanIndex]->type == CLCIT_DIVIDER) { + RECT rc; + rc.top = y + (dat->rowHeight >> 1); + rc.bottom = rc.top + 2; + rc.left = dat->leftMargin + indent * dat->groupIndent; + rc.right = rc.left + ((clRect.right - rc.left - textSize.cx) >> 1) - 3; + DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); + TextOut(hdcMem, rc.right + 3, y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText, + lstrlen(group->cl.items[group->scanIndex]->szText)); + rc.left = rc.right + 6 + textSize.cx; + rc.right = clRect.right; + DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); + } + else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) { + RECT rc; + if (szCounts[0]) { + fontHeight = dat->fontInfo[FONTID_GROUPS].fontHeight; + rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace; + rc.right = min(clRect.right - countsSize.cx, rc.left + textSize.cx + spaceSize.cx); + rc.top = y + ((dat->rowHeight - fontHeight) >> 1); + rc.bottom = rc.top + textSize.cy; + if (rc.right < rc.left + 4) + rc.right = clRect.right + 1; + else + TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, lstrlenA(szCounts)); + ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight); + if (selected) + SetTextColor(hdcMem, dat->selTextColour); + else if (hottrack) + SetHotTrackColour(hdcMem, dat); + rc.right--; + ExtTextOut(hdcMem, rc.left, rc.top, ETO_CLIPPED, &rc, group->cl.items[group->scanIndex]->szText, + lstrlen(group->cl.items[group->scanIndex]->szText), NULL); + } + else + TextOut(hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace, + y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText, + lstrlen(group->cl.items[group->scanIndex]->szText)); + if (dat->exStyle & CLS_EX_LINEWITHGROUPS) { + rc.top = y + (dat->rowHeight >> 1); + rc.bottom = rc.top + 2; + rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace + width + 3; + rc.right = clRect.right - 1 - dat->extraColumnSpacing * dat->extraColumnsCount; + if (rc.right - rc.left > 1) + DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT); + } + } + else { + TCHAR *szText = group->cl.items[group->scanIndex]->szText; + RECT rc; + rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace; + rc.top = y + ((dat->rowHeight - fontHeight) >> 1); + rc.right = (clRect.right - clRect.left); + rc.bottom = rc.top; + DrawText(hdcMem, szText, lstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE); + } + if (selected) { + if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER) { + TCHAR *szText = group->cl.items[group->scanIndex]->szText; + RECT rc; + int qlen = lstrlen(dat->szQuickSearch); + SetTextColor(hdcMem, dat->quickSearchColour); + rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace; + rc.top = y + ((dat->rowHeight - fontHeight) >> 1); + rc.right = (clRect.right - clRect.left); + rc.bottom = rc.top; + if (qlen) + DrawText(hdcMem, szText, qlen, &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE); + } + } + + //extra icons + for (iImage = 0; iImage < dat->extraColumnsCount; iImage++) { + COLORREF colourFg = dat->selBkColour; + int mode = ILD_NORMAL; + if (group->cl.items[group->scanIndex]->iExtraImage[iImage] == 0xFF) + continue; + if (selected) + mode = ILD_SELECTED; + else if (hottrack) { + mode = ILD_FOCUS; + colourFg = dat->hotTextColour; + } + else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST) { + colourFg = dat->fontInfo[FONTID_NOTONLIST].colour; + mode = ILD_BLEND50; + } + ImageList_DrawEx(dat->himlExtraColumns, group->cl.items[group->scanIndex]->iExtraImage[iImage], hdcMem, + clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - iImage), y + ((dat->rowHeight - 16) >> 1), 0, 0, + CLR_NONE, colourFg, mode); + } + } + index++; + y += dat->rowHeight; + if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) { + group = group->cl.items[group->scanIndex]->group; + indent++; + group->scanIndex = 0; + continue; + } + group->scanIndex++; + } + if (dat->iInsertionMark != -1) { //insertion mark + HBRUSH hBrush; + POINT pts[8]; + HRGN hRgn; + + pts[0].x = dat->leftMargin; + pts[0].y = dat->iInsertionMark * dat->rowHeight - dat->yScroll - 4; + pts[1].x = pts[0].x + 2; + pts[1].y = pts[0].y + 3; + pts[2].x = clRect.right - 4; + pts[2].y = pts[1].y; + pts[3].x = clRect.right - 1; + pts[3].y = pts[0].y - 1; + pts[4].x = pts[3].x; + pts[4].y = pts[0].y + 7; + pts[5].x = pts[2].x + 1; + pts[5].y = pts[1].y + 2; + pts[6].x = pts[1].x; + pts[6].y = pts[5].y; + pts[7].x = pts[0].x; + pts[7].y = pts[4].y; + hRgn = CreatePolygonRgn(pts, SIZEOF(pts), ALTERNATE); + hBrush = CreateSolidBrush(dat->fontInfo[FONTID_CONTACTS].colour); + FillRgn(hdcMem, hRgn, hBrush); + DeleteObject(hBrush); + DeleteObject(hRgn); + } + if (!grey) + BitBlt(hdc, rcPaint->left, rcPaint->top, rcPaint->right - rcPaint->left, rcPaint->bottom - rcPaint->top, hdcMem, rcPaint->left, rcPaint->top, + SRCCOPY); + SelectObject(hdcMem,hOldBitmap); + SelectObject(hdcMem,hOldFont); + DeleteDC(hdcMem); + if (hBrushAlternateGrey) + DeleteObject(hBrushAlternateGrey); + if (grey) { + PBYTE bits; + BITMAPINFOHEADER bmih = { 0 }; + int i; + int greyRed, greyGreen, greyBlue; + COLORREF greyColour; + bmih.biBitCount = 32; + bmih.biSize = sizeof(bmih); + bmih.biCompression = BI_RGB; + bmih.biHeight = -clRect.bottom; + bmih.biPlanes = 1; + bmih.biWidth = clRect.right; + bits = (PBYTE) malloc(4 * bmih.biWidth * -bmih.biHeight); + GetDIBits(hdc, hBmpOsb, 0, clRect.bottom, bits, (BITMAPINFO *) & bmih, DIB_RGB_COLORS); + greyColour = GetSysColor(COLOR_3DFACE); + greyRed = GetRValue(greyColour) * 2; + greyGreen = GetGValue(greyColour) * 2; + greyBlue = GetBValue(greyColour) * 2; + if (divide3[0] == 255) { + for (i = 0; i < SIZEOF(divide3); i++) + divide3[i] = (i + 1) / 3; + } + for (i = 4 * clRect.right * clRect.bottom - 4; i >= 0; i -= 4) { + bits[i] = divide3[bits[i] + greyBlue]; + bits[i + 1] = divide3[bits[i + 1] + greyGreen]; + bits[i + 2] = divide3[bits[i + 2] + greyRed]; + } + SetDIBitsToDevice(hdc, 0, 0, clRect.right, clRect.bottom, 0, 0, 0, clRect.bottom, bits, (BITMAPINFO *) & bmih, DIB_RGB_COLORS); + free(bits); + } + DeleteObject(hBmpOsb); +} diff --git a/plugins/Clist_classic/src/clistmenus.cpp b/plugins/Clist_classic/src/clistmenus.cpp new file mode 100644 index 0000000000..76be7e93e4 --- /dev/null +++ b/plugins/Clist_classic/src/clistmenus.cpp @@ -0,0 +1,36 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2010 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ +#include "commonheaders.h" + +INT_PTR CloseAction(WPARAM wParam,LPARAM lParam) +{ + if (CallService(MS_SYSTEM_OKTOEXIT,(WPARAM)0,(LPARAM)0)) + DestroyWindow(pcli->hwndContactList); + + return(0); +} + +void InitCustomMenus() +{ + CreateServiceFunction( "CloseAction", CloseAction ); +} diff --git a/plugins/Clist_classic/src/clistopts.cpp b/plugins/Clist_classic/src/clistopts.cpp new file mode 100644 index 0000000000..83079d6d75 --- /dev/null +++ b/plugins/Clist_classic/src/clistopts.cpp @@ -0,0 +1,279 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2010 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ +#include "commonheaders.h" + +static INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_USER + 1: + { + HANDLE hContact = (HANDLE) wParam; + DBCONTACTWRITESETTING *ws = (DBCONTACTWRITESETTING *) lParam; + if (hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL + && lstrcmpiA(ws->szModule, "CList") == 0 && lstrcmpiA(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg)) { + CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, ws->value.bVal == 0); + } + break; + } + case WM_DESTROY: + { + UnhookEvent((HANDLE) GetWindowLongPtr(hwndDlg, GWLP_USERDATA)); + break; + } + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1)); + CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, + DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, + DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, + DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) + && !DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS, + DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SORTBYPROTO, + DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, + DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_AUTOHIDE, + DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + { + DWORD caps = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS1, 0); + if (!(caps & CLUIF_HIDEEMPTYGROUPS)) + ShowWindow(GetDlgItem(hwndDlg, IDC_HIDEEMPTYGROUPS), SW_HIDE); + if (!(caps & CLUIF_DISABLEGROUPS)) + ShowWindow(GetDlgItem(hwndDlg, IDC_DISABLEGROUPS), SW_HIDE); + if (caps & CLUIF_HASONTOPOPTION) + ShowWindow(GetDlgItem(hwndDlg, IDC_ONTOP), SW_HIDE); + if (caps & CLUIF_HASAUTOHIDEOPTION) { + ShowWindow(GetDlgItem(hwndDlg, IDC_AUTOHIDE), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), SW_HIDE); + ShowWindow(GetDlgItem(hwndDlg, IDC_STAUTOHIDESECS), SW_HIDE); + } + } + SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1)); + SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, + MAKELONG(DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0)); + CheckDlgButton(hwndDlg, IDC_ONECLK, + DBGetContactSettingByte(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, + DBGetContactSettingByte(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, + !DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_DONTCYCLE, + DBGetContactSettingByte(NULL, "CList", "TrayIcon", + SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CYCLE, + DBGetContactSettingByte(NULL, "CList", "TrayIcon", + SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MULTITRAY, + DBGetContactSettingByte(NULL, "CList", "TrayIcon", + SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, + DBGetContactSettingByte(NULL, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKTIME), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKSPIN), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STMSDELAY), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); + CheckDlgButton(hwndDlg, IDC_ICONBLINK, DBGetContactSettingByte(NULL, "CList", "NoIconBlink", 0) == 1 ? BST_CHECKED : BST_UNCHECKED); + if (IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE)) { + EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), FALSE); + } + if (IsDlgButtonChecked(hwndDlg, IDC_CYCLE)) { + EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), FALSE); + } + if (IsDlgButtonChecked(hwndDlg, IDC_MULTITRAY)) { + EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), FALSE); + } + SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETRANGE, 0, MAKELONG(120, 1)); + SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0, + MAKELONG(DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0)); + { + int i, count, item; + PROTOACCOUNT **accs; + DBVARIANT dbv = { DBVT_DELETED }; + DBGetContactSetting(NULL, "CList", "PrimaryStatus", &dbv); + CallService( MS_PROTO_ENUMACCOUNTS, (WPARAM)&count, (LPARAM)&accs); + item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Global")); + SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) 0); + for (i = 0; i < count; i++) { + if (!IsAccountEnabled(accs[i]) || CallProtoService( accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0) == 0) + continue; + item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) accs[i]->tszAccountName); + SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) accs[i]); + if (dbv.type == DBVT_ASCIIZ && !lstrcmpA(dbv.pszVal, accs[i]->szModuleName)) + SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, item, 0); + } + DBFreeVariant(&dbv); + } + if (-1 == (int) SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0)) + SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, 0, 0); + SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETBUDDY, (WPARAM) GetDlgItem(hwndDlg, IDC_BLINKTIME), 0); // set buddy + SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETRANGE, 0, MAKELONG(0x3FFF, 250)); + SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550), 0)); + return TRUE; + case WM_COMMAND: + if (LOWORD(wParam) == IDC_AUTOHIDE) { + EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + } + if (LOWORD(wParam) == IDC_DONTCYCLE || LOWORD(wParam) == IDC_CYCLE || LOWORD(wParam) == IDC_MULTITRAY) { + EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), IsDlgButtonChecked(hwndDlg, IDC_CYCLE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_CYCLE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), IsDlgButtonChecked(hwndDlg, IDC_MULTITRAY)); + } + if (LOWORD(wParam) == IDC_DISABLEBLINK) { + EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKTIME), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); + EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKSPIN), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STMSDELAY), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); + } + if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_CYCLETIME) && HIWORD(wParam) != EN_CHANGE) + break; + if (LOWORD(wParam) == IDC_PRIMARYSTATUS && HIWORD(wParam) != CBN_SELCHANGE) + break; + if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_CYCLETIME) && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())) + return 0; + if (LOWORD(wParam) == IDC_BLINKTIME && HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()) + return 0; // dont make apply enabled during buddy set crap + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + case WM_NOTIFY: + switch (((LPNMHDR) lParam)->idFrom) { + case 0: + switch (((LPNMHDR) lParam)->code) { + case PSN_APPLY: + DBWriteContactSettingByte(NULL, "CList", "HideOffline", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE)); + { + DWORD caps = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS1, 0); + if (caps & CLUIF_HIDEEMPTYGROUPS) + DBWriteContactSettingByte(NULL, "CList", "HideEmptyGroups", + (BYTE) IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS)); + if (caps & CLUIF_DISABLEGROUPS) + DBWriteContactSettingByte(NULL, "CList", "UseGroups", (BYTE) ! IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS)); + if (!(caps & CLUIF_HASONTOPOPTION)) { + DBWriteContactSettingByte(NULL, "CList", "OnTop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONTOP)); + SetWindowPos( pcli->hwndContactList, + IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, + SWP_NOMOVE | SWP_NOSIZE); + } + if (!(caps & CLUIF_HASAUTOHIDEOPTION)) { + DBWriteContactSettingByte(NULL, "CList", "AutoHide", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + DBWriteContactSettingWord(NULL, "CList", "HideTime", + (WORD) SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0)); + } + } + DBWriteContactSettingByte(NULL, "CList", "SortByStatus", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SORTBYSTATUS)); + DBWriteContactSettingByte(NULL, "CList", "SortByProto", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SORTBYPROTO)); + DBWriteContactSettingByte(NULL, "CList", "ConfirmDelete", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE)); + DBWriteContactSettingByte(NULL, "CList", "Tray1Click", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONECLK)); + DBWriteContactSettingByte(NULL, "CList", "AlwaysStatus", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS)); + DBWriteContactSettingByte(NULL, "CList", "AlwaysMulti", (BYTE) ! IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI)); + DBWriteContactSettingByte(NULL, "CList", "TrayIcon", + (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE + : (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE : + SETTING_TRAYICON_MULTI))); + DBWriteContactSettingWord(NULL, "CList", "CycleTime", + (WORD) SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0)); + DBWriteContactSettingWord(NULL, "CList", "IconFlashTime", + (WORD) SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0)); + DBWriteContactSettingByte(NULL, "CList", "DisableTrayFlash", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK)); + DBWriteContactSettingByte(NULL, "CList", "NoIconBlink", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK)); + { + int cur = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0); + PROTOACCOUNT* pa = ( PROTOACCOUNT* )SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, cur, 0 ); + if ( pa == NULL ) + DBDeleteContactSetting(NULL, "CList", "PrimaryStatus"); + else + DBWriteContactSettingString(NULL, "CList", "PrimaryStatus", pa->szModuleName ); + } + + pcli->pfnTrayIconIconsChanged(); + pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */ + pcli->pfnInvalidateDisplayNameCacheEntry( INVALID_HANDLE_VALUE ); /* force reshuffle */ + return TRUE; + } + break; + } + break; + } + return FALSE; +} + +/****************************************************************************************/ + +static UINT expertOnlyControls[] = { IDC_ALWAYSSTATUS }; + +int CListOptInit(WPARAM wParam, LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.cbSize = sizeof(odp); + odp.position = -1000000000; + odp.hInstance = g_hInst; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST); + odp.pszTitle = LPGEN("Contact List"); + odp.pfnDlgProc = DlgProcGenOpts; + odp.flags = ODPF_BOLDGROUPS; + odp.nIDBottomSimpleControl = IDC_STCLISTGROUP; + odp.expertOnlyControls = expertOnlyControls; + odp.nExpertOnlyControls = SIZEOF(expertOnlyControls); + Options_AddPage(wParam, &odp); + return 0; +} + +int CListModernOptInit(WPARAM wParam, LPARAM lParam) +{ + static int iBoldControls[] = + { + IDC_TXT_TITLE1, IDC_TXT_TITLE2, + MODERNOPT_CTRL_LAST + }; + + MODERNOPTOBJECT obj = {0}; + + obj.cbSize = sizeof(obj); + obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE; + obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + obj.hInstance = g_hInst; + obj.iSection = MODERNOPT_PAGE_CLIST; + obj.iType = MODERNOPT_TYPE_SECTIONPAGE; + obj.iBoldControls = iBoldControls; + obj.lpzClassicGroup = "Contact List"; + obj.lpzClassicPage = "List"; + obj.lpzHelpUrl = "http://wiki.miranda-im.org/"; + + obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_CLIST); + obj.pfnDlgProc = DlgProcGenOpts; + CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); + return 0; +} diff --git a/plugins/Clist_classic/src/cluiopts.cpp b/plugins/Clist_classic/src/cluiopts.cpp new file mode 100644 index 0000000000..e0b7bdbdee --- /dev/null +++ b/plugins/Clist_classic/src/cluiopts.cpp @@ -0,0 +1,394 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2010 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ +#include "commonheaders.h" + +extern BOOL(WINAPI * MySetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD); + +static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, + DBGetContactSettingByte(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_TOOLWND, + DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_MIN2TRAY, + DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) + EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE); + CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, + DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, + DBGetContactSettingByte(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, + DBGetContactSettingByte(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) { + EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), FALSE); + } + CheckDlgButton(hwndDlg, IDC_FADEINOUT, DBGetContactSettingByte(NULL, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_AUTOSIZE, DBGetContactSettingByte(NULL, "CLUI", "AutoSize", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_DROPSHADOW, DBGetContactSettingByte(NULL, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_ONDESKTOP, DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_DISABLEDOCKING, DBGetContactSettingByte(NULL, "CLUI", "DockToSides", 1) ? BST_CHECKED : BST_UNCHECKED); + SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0)); + SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, DBGetContactSettingByte(NULL, "CLUI", "MaxSizeHeight", 75)); + CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, DBGetContactSettingByte(NULL, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_AUTOHIDE, + DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1)); + SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0, + MAKELONG(DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0)); + EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + if (!IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)) { + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC21), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC22), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZEHEIGHT), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZESPIN), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOSIZEUPWARD), FALSE); + } + + { DBVARIANT dbv; + if ( !DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv)) { + SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal); + DBFreeVariant( &dbv ); + } + else SetDlgItemTextA(hwndDlg, IDC_TITLETEXT, MIRANDANAME); + } + if (!IsWinVer2000Plus()) { + EnableWindow(GetDlgItem(hwndDlg, IDC_FADEINOUT), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENT), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_DROPSHADOW), FALSE); + } + else + CheckDlgButton(hwndDlg, IDC_TRANSPARENT, + DBGetContactSettingByte(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); + + if (!IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) { + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), FALSE); + } + SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255)); + SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255)); + SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, DBGetContactSettingByte(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT)); + SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE, + DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT)); + SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0); + return TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDC_AUTOHIDE) { + EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + } + else if (LOWORD(wParam) == IDC_TRANSPARENT) { + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); + EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); + EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); + EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); + EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); + } + else if (LOWORD(wParam) == IDC_AUTOSIZE) { + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC21), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC22), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZEHEIGHT), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); + EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOSIZEUPWARD), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); + } + else if (LOWORD(wParam) == IDC_TOOLWND) { + EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)); + } + else if (LOWORD(wParam) == IDC_SHOWCAPTION) { + EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND) + && IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)); + EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)); + } + + if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_TITLETEXT || LOWORD(wParam) == IDC_MAXSIZEHEIGHT) && + (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())) + return 0; + + // Enable apply button + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + + case WM_HSCROLL: + { + char str[10]; + wsprintfA(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255); + SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str); + wsprintfA(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255); + SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str); + } + if (wParam != 0x12345678) + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + case WM_NOTIFY: + if (((LPNMHDR) lParam)->code == PSN_APPLY) + { + DBWriteContactSettingByte(NULL, "CList", "OnTop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONTOP)); + DBWriteContactSettingByte(NULL, "CList", "ToolWindow", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)); + DBWriteContactSettingByte(NULL, "CList", "BringToFront", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT)); + DBWriteContactSettingByte(NULL, "CLUI", "FadeInOut", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT)); + DBWriteContactSettingByte(NULL, "CLUI", "AutoSize", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)); + DBWriteContactSettingByte(NULL, "CLUI", "MaxSizeHeight", (BYTE) GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, NULL, FALSE)); + DBWriteContactSettingByte(NULL, "CLUI", "AutoSizeUpward", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD)); + DBWriteContactSettingByte(NULL, "CList", "AutoHide", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE)); + DBWriteContactSettingWord(NULL, "CList", "HideTime", (WORD) SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0)); + DBWriteContactSettingByte(NULL, "CList", "Transparent", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)); + DBWriteContactSettingByte(NULL, "CList", "Alpha", (BYTE) SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0)); + DBWriteContactSettingByte(NULL, "CList", "AutoAlpha", (BYTE) SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0)); + DBWriteContactSettingByte(NULL, "CList", "WindowShadow", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW)); + DBWriteContactSettingByte(NULL, "CList", "OnDesktop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)); + DBWriteContactSettingByte(NULL, "CLUI", "DockToSides", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DISABLEDOCKING)); + DBWriteContactSettingByte(NULL, "CLUI", "ShowCaption", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)); + DBWriteContactSettingByte(NULL, "CLUI", "ShowMainMenu", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU)); + DBWriteContactSettingByte(NULL, "CLUI", "ClientAreaDrag", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG)); + DBWriteContactSettingByte(NULL, "CList", "Min2Tray", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY)); + { + TCHAR title[256]; + GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, SIZEOF(title)); + DBWriteContactSettingTString(NULL, "CList", "TitleText", title); + SetWindowText(pcli->hwndContactList, title); + } + + pcli->pfnLoadCluiGlobalOpts(); + SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, + 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); + + if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) + { + // Window must be hidden to dynamically remove the taskbar button. + // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp + WINDOWPLACEMENT p; + p.length = sizeof(p); + GetWindowPlacement(pcli->hwndContactList, &p); + ShowWindow(pcli->hwndContactList, SW_HIDE); + SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, + GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_APPWINDOW | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE); + SetWindowPlacement(pcli->hwndContactList, &p); + } + else + SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW | WS_EX_APPWINDOW); + + if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) + { + HWND hProgMan = FindWindow(_T("Progman"), NULL); + if (hProgMan) + SetParent(pcli->hwndContactList, hProgMan); + } + else + SetParent(pcli->hwndContactList, NULL); + + if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) + { + int style = GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX; + SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, style); + } + else + { + SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, + GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)); + } + + if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU)) + SetMenu(pcli->hwndContactList, NULL); + else + SetMenu(pcli->hwndContactList, pcli->hMenuMain); + + SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); + RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_FRAME | RDW_INVALIDATE); + + if (IsIconic(pcli->hwndContactList) && !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) + ShowWindow(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW); + if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) + { + SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); + if (MySetLayeredWindowAttributes) + MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), + (BYTE) DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT), + LWA_ALPHA); + } + else + SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED); + + SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged + + return TRUE; + } + break; + } + return FALSE; +} + +static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) +{ + switch (msg) { + case WM_INITDIALOG: + TranslateDialogDefault(hwndDlg); + CheckDlgButton(hwndDlg, IDC_SHOWSBAR, DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED); + { + BYTE showOpts = DBGetContactSettingByte(NULL, "CLUI", "SBarShow", 1); + CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED); + } + CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, DBGetContactSettingByte(NULL, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED); + CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, !IsDlgButtonChecked(hwndDlg, IDC_RIGHTSTATUS) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, DBGetContactSettingByte(NULL, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwndDlg, IDC_SHOWGRIP, DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED); + if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) { + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_SBPANELBEVEL), FALSE); + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWGRIP), FALSE); + } + return TRUE; + case WM_COMMAND: + if (LOWORD(wParam) == IDC_SHOWSBAR) { + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SBPANELBEVEL), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWGRIP), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + } + SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); + break; + case WM_NOTIFY: + if (((LPNMHDR) lParam)->code == PSN_APPLY ) { + DBWriteContactSettingByte(NULL, "CLUI", "ShowSBar", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)); + DBWriteContactSettingByte(NULL, "CLUI", "SBarShow", + (BYTE) ((IsDlgButtonChecked(hwndDlg, IDC_SHOWICON) ? 1 : 0) | + (IsDlgButtonChecked(hwndDlg, IDC_SHOWPROTO) ? 2 : 0) | + (IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUS) ? 4 : 0))); + DBWriteContactSettingByte(NULL, "CLUI", "SBarRightClk", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA)); + DBWriteContactSettingByte(NULL, "CLUI", "EqualSections", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS)); + DBWriteContactSettingByte(NULL, "CLUI", "SBarBevel", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL)); + pcli->pfnLoadCluiGlobalOpts(); + if (DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) != (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) { + HWND parent = GetParent(pcli->hwndStatus); + int flags = WS_CHILD | CCS_BOTTOM; + DBWriteContactSettingByte(NULL, "CLUI", "ShowGrip", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)); + ShowWindow(pcli->hwndStatus, SW_HIDE); + DestroyWindow(pcli->hwndStatus); + flags |= DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0; + flags |= DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0; + pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, parent, NULL, g_hInst, NULL); + } + if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) + ShowWindow(pcli->hwndStatus, SW_SHOW); + else + ShowWindow(pcli->hwndStatus, SW_HIDE); + SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); + return TRUE; + } + break; + } + return FALSE; +} + +/****************************************************************************************/ + +static UINT expertOnlyControls[] = +{ + IDC_BRINGTOFRONT, IDC_AUTOSIZE, IDC_STATIC21, IDC_MAXSIZEHEIGHT, IDC_MAXSIZESPIN, + IDC_STATIC22, IDC_AUTOSIZEUPWARD, IDC_SHOWMAINMENU, IDC_SHOWCAPTION, IDC_CLIENTDRAG +}; + +int CluiOptInit(WPARAM wParam, LPARAM lParam) +{ + OPTIONSDIALOGPAGE odp = { 0 }; + odp.cbSize = sizeof(odp); + odp.position = 0; + odp.hInstance = g_hInst; + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI); + odp.pszTitle = LPGEN("Window"); + odp.pszGroup = LPGEN("Contact List"); + odp.pfnDlgProc = DlgProcCluiOpts; + odp.flags = ODPF_BOLDGROUPS; + odp.nIDBottomSimpleControl = IDC_STWINDOWGROUP; + odp.expertOnlyControls = expertOnlyControls; + odp.nExpertOnlyControls = SIZEOF(expertOnlyControls); + Options_AddPage(wParam, &odp); + + odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SBAR); + odp.pszTitle = LPGEN("Status Bar"); + odp.pfnDlgProc = DlgProcSBarOpts; + odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY; + odp.nIDBottomSimpleControl = 0; + odp.nExpertOnlyControls = 0; + odp.expertOnlyControls = NULL; + Options_AddPage(wParam, &odp); + return 0; +} + +int CluiModernOptInit(WPARAM wParam, LPARAM lParam) +{ + static int iBoldControls[] = + { + IDC_TXT_TITLE1, IDC_TXT_TITLE2, IDC_SHOWSBAR, + MODERNOPT_CTRL_LAST + }; + + MODERNOPTOBJECT obj = {0}; + + obj.cbSize = sizeof(obj); + obj.dwFlags = MODEROPT_FLG_TCHAR|MODEROPT_FLG_NORESIZE; + obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA); + obj.hInstance = g_hInst; + obj.iSection = MODERNOPT_PAGE_CLIST; + obj.iType = MODERNOPT_TYPE_SECTIONPAGE; + obj.iBoldControls = iBoldControls; + obj.lpzClassicGroup = "Contact List"; + obj.lpzClassicPage = "List"; + obj.lpzHelpUrl = "http://wiki.miranda-im.org/"; + + obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_CLUI); + obj.pfnDlgProc = DlgProcCluiOpts; + CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); + + obj.lpzTemplate = MAKEINTRESOURCEA(IDD_MODERNOPT_SBAR); + obj.pfnDlgProc = DlgProcSBarOpts; + CallService(MS_MODERNOPT_ADDOBJECT, wParam, (LPARAM)&obj); + return 0; +} diff --git a/plugins/Clist_classic/src/commonheaders.h b/plugins/Clist_classic/src/commonheaders.h new file mode 100644 index 0000000000..7382317420 --- /dev/null +++ b/plugins/Clist_classic/src/commonheaders.h @@ -0,0 +1,78 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2005 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ + +#define MIRANDA_VER 0x0A00 + +#define _WIN32_WINNT 0x0600 +#define _WIN32_IE 0x0501 + +#include "m_stdhdr.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "clc.h" +#include "version.h" +#include "resource.h" + +// shared vars +extern HINSTANCE g_hInst; + +/* most free()'s are invalid when the code is executed from a dll, so this changes + all the bad free()'s to good ones, however it's still incorrect code. The reasons for not + changing them include: + + * DBFreeVariant has a CallService() lookup + * free() is executed in some large loops to do with clist creation of group data + * easy search and replace + +*/ diff --git a/plugins/Clist_classic/src/init.cpp b/plugins/Clist_classic/src/init.cpp new file mode 100644 index 0000000000..3e497d1739 --- /dev/null +++ b/plugins/Clist_classic/src/init.cpp @@ -0,0 +1,180 @@ +/* + +Miranda IM: the free IM client for Microsoft* Windows* + +Copyright 2000-2005 Miranda ICQ/IM project, +all portions of this codebase are copyrighted to the people +listed in contributors.txt. + +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. +*/ + +#include "commonheaders.h" + +HINSTANCE g_hInst = 0; +CLIST_INTERFACE* pcli = NULL; +HIMAGELIST himlCListClc = NULL; +int hLangpack; + +BOOL(WINAPI * MySetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD) = NULL; + +///////////////////////////////////////////////////////////////////////////////////////// +// external functions + +void RegisterCListFonts( void ); +void InitCustomMenus( void ); +void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint); + +int ClcOptInit(WPARAM wParam, LPARAM lParam); +int ClcModernOptInit(WPARAM wParam, LPARAM lParam); +int CluiOptInit(WPARAM wParam, LPARAM lParam); +int CluiModernOptInit(WPARAM wParam, LPARAM lParam); +int CListOptInit(WPARAM wParam, LPARAM lParam); +int CListModernOptInit(WPARAM wParam, LPARAM lParam); + +///////////////////////////////////////////////////////////////////////////////////////// +// dll stub + +BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved) +{ + g_hInst = hInstDLL; + return TRUE; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// returns the plugin information + +PLUGININFOEX pluginInfo = { + sizeof(PLUGININFOEX), + "Classic contact list", + __VERSION_DWORD, + "Display contacts, event notifications, protocol status.", + "Miranda IM project", + "ghazan@miranda-im.org", + "Copyright 2000-2008 Miranda IM project", + "http://www.miranda-im.org", + UNICODE_AWARE, + //{240A91DC-9464-457a-9787-FF1EA88E77E3} + {0x240a91dc, 0x9464, 0x457a, { 0x97, 0x87, 0xff, 0x1e, 0xa8, 0x8e, 0x77, 0xe3 }} +}; + +extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfo; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// returns plugin's interfaces information + +static const MUUID interfaces[] = {MIID_CLIST, MIID_LAST}; +extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void) +{ + return interfaces; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// called when number of accounts has been changed + +static int OnAccountsChanged( WPARAM wParam, LPARAM lParam ) +{ + himlCListClc = (HIMAGELIST) CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// called when all modules got loaded + +static int OnModernOptsInit(WPARAM wParam, LPARAM lParam); +static int OnModulesLoaded( WPARAM wParam, LPARAM lParam ) +{ + HookEvent(ME_MODERNOPT_INITIALIZE, OnModernOptsInit); + RegisterCListFonts(); + himlCListClc = (HIMAGELIST) CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// options iniatialization + +static int OnOptsInit(WPARAM wParam, LPARAM lParam) +{ + ClcOptInit(wParam, lParam); + CluiOptInit(wParam, lParam); + CListOptInit(wParam, lParam); + return 0; +} + +static int OnModernOptsInit(WPARAM wParam, LPARAM lParam) +{ + ClcModernOptInit(wParam, lParam); + CListModernOptInit(wParam, lParam); + CluiModernOptInit(wParam, lParam); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// menu status services + +static INT_PTR GetStatusMode(WPARAM wParam, LPARAM lParam) +{ + return pcli->currentDesiredStatusMode; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// main clist initialization routine + +extern "C" __declspec(dllexport) int CListInitialise() +{ + mir_getLP( &pluginInfo ); + + pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst); + if ( (INT_PTR)pcli == CALLSERVICE_NOTFOUND ) { +LBL_Error: + MessageBoxA( NULL, "This version of plugin requires Miranda IM 0.8.0.9 or later", "Fatal error", MB_OK ); + return 1; + } + if ( pcli->version < 6 ) + goto LBL_Error; + + pcli->pfnPaintClc = PaintClc; + + MySetLayeredWindowAttributes = (BOOL(WINAPI *) (HWND, COLORREF, BYTE, DWORD)) GetProcAddress( + LoadLibraryA("user32.dll"), "SetLayeredWindowAttributes"); + + CreateServiceFunction(MS_CLIST_GETSTATUSMODE, GetStatusMode); + + HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded); + HookEvent(ME_PROTO_ACCLISTCHANGED, OnAccountsChanged); + HookEvent(ME_OPT_INITIALISE, OnOptsInit); + + InitCustomMenus(); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// a plugin loader aware of CList exports will never call this. + +extern "C" __declspec(dllexport) int Load(void) +{ + return 1; +} + +///////////////////////////////////////////////////////////////////////////////////////// +// a plugin unloader + +extern "C" __declspec(dllexport) int Unload(void) +{ + return 0; +} \ No newline at end of file diff --git a/plugins/Clist_classic/src/resource.h b/plugins/Clist_classic/src/resource.h new file mode 100644 index 0000000000..541c69b212 --- /dev/null +++ b/plugins/Clist_classic/src/resource.h @@ -0,0 +1,163 @@ +//{{NO_DEPENDENCIES}} +// Microsoft Visual C++ generated include file. +// Used by resource.rc +// +#define IDD_OPT_CLIST 126 +#define IDR_CONTEXT 180 +#define IDC_DROP 183 +#define IDD_OPT_HOTKEY 184 +#define IDR_CLISTMENU 199 +#define IDC_HYPERLINKHAND 214 +#define IDC_DROPUSER 215 +#define IDD_OPT_CLUI 218 +#define IDD_OPT_CLC 228 +#define IDD_OPT_CLCBKG 230 +#define IDD_OPT_SBAR 234 +#define IDD_OPT_CLCTEXTSIMPLE 239 +#define IDD_DELETECONTACT 254 +#define IDD_MODERNOPT_CLIST 288 +#define IDD_MODERNOPT_CLUI 289 +#define IDD_MODERNOPT_SBAR 290 +#define IDD_MODERNOPT_CLCBKG 291 +#define IDC_MIN2TRAY 1073 +#define IDC_ONTOP 1074 +#define IDC_SHOWMAINMENU 1075 +#define IDC_CLIENTDRAG 1076 +#define IDC_TOOLWND 1097 +#define IDC_ONECLK 1098 +#define IDC_SHOWCAPTION 1098 +#define IDC_HIDEOFFLINE 1099 +#define IDC_SHOWHIDE 1100 +#define IDC_HIDEEMPTYGROUPS 1100 +#define IDC_SORTBYSTATUS 1101 +#define IDC_FADEINOUT 1101 +#define IDC_READMSG 1102 +#define IDC_AUTOSIZE 1102 +#define IDC_DISABLEGROUPS 1102 +#define IDC_AUTOSIZEUPWARD 1103 +#define IDC_ALWAYSSTATUS 1103 +#define IDC_NETSEARCH 1104 +#define IDC_CONFIRMDELETE 1104 +#define IDC_SORTBYPROTO 1105 +#define IDC_SHOWOPTIONS 1105 +#define IDC_SEARCHURL 1106 +#define IDC_TRANSPARENT 1124 +#define IDC_TRANSINACTIVE 1126 +#define IDC_TRANSACTIVE 1128 +#define IDC_STATIC11 1154 +#define IDC_STATIC12 1155 +#define IDC_STATIC21 1156 +#define IDC_STATIC22 1157 +#define IDC_HKSHOWHIDE 1162 +#define IDC_HKREADMSG 1163 +#define IDC_HKSEARCH 1164 +#define IDC_HKSHOWOPTIONS 1165 +#define IDC_BROWSE 1184 +#define IDC_INACTIVEPERC 1187 +#define IDC_ACTIVEPERC 1188 +#define IDC_SEARCHNEWWND 1188 +#define IDC_TITLETEXT 1196 +#define IDC_AUTOHIDE 1235 +#define IDC_HIDETIME 1236 +#define IDC_MAXSIZEHEIGHT 1254 +#define IDC_MAXSIZESPIN 1255 +#define IDC_BKGCOLOUR 1269 +#define IDC_FILENAME 1271 +#define IDC_SCROLL 1277 +#define IDC_PROPORTIONAL 1278 +#define IDC_SELCOLOUR 1281 +#define IDC_SMOOTHTIME 1283 +#define IDC_SMOOTHTIMESPIN 1284 +#define IDC_GREYOUT 1285 +#define IDC_ROWHEIGHT 1286 +#define IDC_ROWHEIGHTSPIN 1287 +#define IDC_GREYOUTOPTS 1288 +#define IDC_GROUPINDENT 1289 +#define IDC_GROUPINDENTSPIN 1290 +#define IDC_LEFTMARGIN 1291 +#define IDC_SAMPLE 1292 +#define IDC_LEFTMARGINSPIN 1292 +#define IDC_FONTSIZE 1293 +#define IDC_STRETCHH 1298 +#define IDC_STRETCHV 1299 +#define IDC_TILEH 1300 +#define IDC_SCRIPT 1300 +#define IDC_TILEV 1301 +#define IDC_GAMMACORRECT 1302 +#define IDC_HIDEOFFLINEOPTS 1308 +#define IDC_DONTCYCLE 1315 +#define IDC_PRIMARYSTATUS 1316 +#define IDC_CYCLE 1317 +#define IDC_CYCLETIME 1318 +#define IDC_CYCLETIMESPIN 1319 +#define IDC_HIDETIMESPIN 1320 +#define IDC_MULTITRAY 1321 +#define IDC_ALWAYSMULTI 1322 +#define IDC_SHOWICON 1323 +#define IDC_SHOWPROTO 1324 +#define IDC_SHOWSTATUS 1325 +#define IDC_EQUALSECTIONS 1326 +#define IDC_SHOWSBAR 1329 +#define IDC_RIGHTMIRANDA 1330 +#define IDC_RIGHTSTATUS 1331 +#define IDC_SORTBYNAME 1347 +#define IDC_STAUTOHIDESECS 1349 +#define IDC_STCLISTGROUP 1350 +#define IDC_DISABLEDRAGDROP 1351 +#define IDC_NOTEDITLABELS 1352 +#define IDC_SHOWSELALWAYS 1353 +#define IDC_TRACKSELECT 1354 +#define IDC_SHOWGROUPCOUNTS 1355 +#define IDC_HIDECOUNTSWHENEMPTY 1356 +#define IDC_DIVIDERONOFF 1357 +#define IDC_NOTNOTRANSLUCENTSEL 1358 +#define IDC_LINEWITHGROUPS 1359 +#define IDC_QUICKSEARCHVISONLY 1360 +#define IDC_SORTGROUPSALPHA 1361 +#define IDC_NOTNOSMOOTHSCROLLING 1362 +#define IDC_BITMAP 1363 +#define IDC_STWINDOWGROUP 1364 +#define IDC_STATIC01 1365 +#define IDC_HIDE 1534 +#define IDC_TOPLINE 1535 +#define IDC_HOTKEYURLSTR 1567 +#define IDC_BRINGTOFRONT 1579 +#define IDC_BLINKTIME 1607 +#define IDC_BLINKSPIN 1608 +#define IDC_DISABLEBLINK 1609 +#define IDC_IDLE 1610 +#define IDC_SBPANELBEVEL 1611 +#define IDC_DROPSHADOW 1612 +#define IDC_SHOWGRIP 1612 +#define IDC_NOSCROLLBAR 1613 +#define IDC_TXT_TITLE1 1617 +#define IDC_TXT_TITLE2 1618 +#define IDC_ONDESKTOP 1657 +#define IDC_DISABLEDOCKING 1658 +#define IDC_WINCOLOUR 1659 +#define IDC_ICONBLINK 1660 +#define IDC_STMSDELAY 1661 +#define ID_ICQ_EXIT 40001 +#define POPUP_HIDEEMPTYGROUPS 40003 +#define POPUP_NEWSUBGROUP 40004 +#define POPUP_HIDEOFFLINE 40005 +#define POPUP_GROUPHIDEOFFLINE 40006 +#define POPUP_HIDEOFFLINEROOT 40007 +#define POPUP_DISABLEGROUPS 40008 +#define POPUP_HIDEMIRANDA 40017 +#define ID_TRAY_HIDE 40038 +#define ID_TRAY_EXIT 40040 +#define POPUP_NEWGROUP 40050 +#define POPUP_RENAMEGROUP 40052 +#define POPUP_DELETEGROUP 40053 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 292 +#define _APS_NEXT_COMMAND_VALUE 40018 +#define _APS_NEXT_CONTROL_VALUE 1662 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif diff --git a/plugins/Clist_classic/src/version.h b/plugins/Clist_classic/src/version.h new file mode 100644 index 0000000000..58f9cf348c --- /dev/null +++ b/plugins/Clist_classic/src/version.h @@ -0,0 +1,5 @@ +#include + +#define __FILEVERSION_STRING MIRANDA_VERSION_FILEVERSION +#define __VERSION_STRING MIRANDA_VERSION_STRING +#define __VERSION_DWORD MIRANDA_VERSION_DWORD diff --git a/plugins/Clist_classic/version.h b/plugins/Clist_classic/version.h deleted file mode 100644 index 58f9cf348c..0000000000 --- a/plugins/Clist_classic/version.h +++ /dev/null @@ -1,5 +0,0 @@ -#include - -#define __FILEVERSION_STRING MIRANDA_VERSION_FILEVERSION -#define __VERSION_STRING MIRANDA_VERSION_STRING -#define __VERSION_DWORD MIRANDA_VERSION_DWORD diff --git a/plugins/Clist_classic/version.rc b/plugins/Clist_classic/version.rc deleted file mode 100644 index 32ae771c97..0000000000 --- a/plugins/Clist_classic/version.rc +++ /dev/null @@ -1,58 +0,0 @@ -#ifdef APSTUDIO_INVOKED -#error this file is not editable by Microsoft Visual C++ -#endif //APSTUDIO_INVOKED - -#include "version.h" -#include "resource.h" -#include "winres.h" -#include "richedit.h" - -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page( 1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION __FILEVERSION_STRING - PRODUCTVERSION __FILEVERSION_STRING - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "Comments", "\0" - VALUE "CompanyName", "Miranda\0" - VALUE "FileDescription", "Contact list classic\0" - VALUE "FileVersion", __VERSION_STRING "\0" - VALUE "InternalName", "clist_classic\0" - VALUE "LegalCopyright", "Copyright ( c) 2002-12 Miranda team\0" - VALUE "LegalTrademarks", "\0" - VALUE "OriginalFilename", "clist_classic.dll\0" - VALUE "PrivateBuild", "\0" - VALUE "ProductName", "Contact list plugin\0" - VALUE "ProductVersion", __VERSION_STRING "\0" - VALUE "SpecialBuild", "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC -- cgit v1.2.3