summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-04 18:51:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-04 18:51:53 +0000
commitecb177cadbcff850a16c4b9e306beb15f61ac6f9 (patch)
treeda36e3107747a5f37dbd078197d584054057609f /plugins
parent808f3b5e0fefeb560ce5393bf8311927d0927411 (diff)
kernel extraicons, part II
git-svn-id: http://svn.miranda-ng.org/main/trunk@2188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AuthState/src/commonheaders.h1
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp413
-rw-r--r--plugins/BuddyExpectator/src/common.h3
-rw-r--r--plugins/BuddyExpectator/src/options.cpp727
-rw-r--r--plugins/Clist_modern/clist_modern_10.vcxproj1
-rw-r--r--plugins/Clist_modern/clist_modern_10.vcxproj.filters3
-rw-r--r--plugins/Clist_modern/src/hdr/modern_clc.h4
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonheaders.h1
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonprototypes.h4
-rw-r--r--plugins/Clist_modern/src/hdr/modern_static_clui.h3
-rw-r--r--plugins/Clist_modern/src/init.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp38
-rw-r--r--plugins/Clist_modern/src/modern_extraimage.cpp141
-rw-r--r--plugins/Clist_mw/res/resource.rc16
-rw-r--r--plugins/Clist_mw/src/CLUIFrames/extraimage.cpp374
-rw-r--r--plugins/Clist_mw/src/clc.cpp3
-rw-r--r--plugins/Clist_mw/src/clui.cpp109
-rw-r--r--plugins/Clist_mw/src/cluiopts.cpp644
-rw-r--r--plugins/Clist_mw/src/resource.h7
-rw-r--r--plugins/Clist_nicer/res/resource.rc29
-rw-r--r--plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp9
-rw-r--r--plugins/Clist_nicer/src/Include/clc.h54
-rw-r--r--plugins/Clist_nicer/src/Include/commonheaders.h2
-rw-r--r--plugins/Clist_nicer/src/Include/config.h2
-rw-r--r--plugins/Clist_nicer/src/Include/resource.h13
-rw-r--r--plugins/Clist_nicer/src/clc.cpp34
-rw-r--r--plugins/Clist_nicer/src/clcidents.cpp4
-rw-r--r--plugins/Clist_nicer/src/clcitems.cpp329
-rw-r--r--plugins/Clist_nicer/src/clcmsgs.cpp66
-rw-r--r--plugins/Clist_nicer/src/clcopts.cpp222
-rw-r--r--plugins/Clist_nicer/src/clcpaint.cpp775
-rw-r--r--plugins/Clist_nicer/src/clcutils.cpp8
-rw-r--r--plugins/Clist_nicer/src/clistmenus.cpp58
-rw-r--r--plugins/Clist_nicer/src/clui.cpp4
-rw-r--r--plugins/Clist_nicer/src/config.cpp56
-rw-r--r--plugins/Clist_nicer/src/contact.cpp4
-rw-r--r--plugins/Clist_nicer/src/init.cpp6
-rw-r--r--plugins/Clist_nicer/src/rowheight_funcs.cpp2
-rw-r--r--plugins/Clist_nicer/src/statusfloater.cpp44
-rw-r--r--plugins/CountryFlags/src/extraimg.cpp9
-rw-r--r--plugins/ExternalAPI/m_flags.h3
-rw-r--r--plugins/FingerPrintModPlus/src/finger_groups.h46
-rw-r--r--plugins/FingerPrintModPlus/src/fingerprint.cpp21
-rw-r--r--plugins/FingerPrintModPlus/src/global.h2
-rw-r--r--plugins/FingerPrintModPlus/src/options.cpp10
-rw-r--r--plugins/FingerPrintModPlus/src/resource.h1
-rw-r--r--plugins/Gender/src/options.cpp1
-rw-r--r--plugins/ListeningTo/src/options.cpp4
-rw-r--r--plugins/MetaContacts/src/meta_utils.cpp13
-rwxr-xr-xplugins/New_GPG/src/init.cpp123
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.cpp18
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.h6
-rw-r--r--plugins/UserInfoEx/src/commonheaders.h3
-rw-r--r--plugins/UserInfoEx/src/init.cpp3
-rw-r--r--plugins/UserInfoEx/src/psp_options.cpp24
-rw-r--r--plugins/UserInfoEx/src/svc_email.cpp81
-rw-r--r--plugins/UserInfoEx/src/svc_gender.cpp73
-rw-r--r--plugins/UserInfoEx/src/svc_homepage.cpp70
-rw-r--r--plugins/UserInfoEx/src/svc_phone.cpp78
-rw-r--r--plugins/UserInfoEx/src/svc_reminder.cpp12
61 files changed, 1770 insertions, 3052 deletions
diff --git a/plugins/AuthState/src/commonheaders.h b/plugins/AuthState/src/commonheaders.h
index 7d199a835b..a234517f03 100644
--- a/plugins/AuthState/src/commonheaders.h
+++ b/plugins/AuthState/src/commonheaders.h
@@ -50,7 +50,6 @@
// Third party SDK headers
#include "m_extraicons.h"
-static const int DefaultSlot = EXTRA_ICON_ADV2;
#define MODULENAME "AuthState"
int onOptInitialise(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index a1fa12e3b7..03b793ad09 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -31,27 +31,25 @@ int hLangpack;
DWORD timer_id = 0;
-HANDLE hEventContactSetting = NULL;
-HANDLE hEventContactAdded = NULL;
-HANDLE hEventUserInfoInit = NULL;
-HANDLE hPrebuildContactMenu = NULL;
-HANDLE hContactMenu = NULL;
-HANDLE hIcoLibIconsChanged = NULL;
-HANDLE hContactReturnedAction = NULL;
-HANDLE hContactStillAbsentAction = NULL;
-HANDLE hMissYouAction = NULL;
-HANDLE hMenuMissYouClick = NULL;
-HANDLE hModulesLoaded = NULL;
-HANDLE hModulesLoaded2 = NULL;
-HANDLE hSystemOKToExit = NULL;
-HANDLE hHookExtraIconsRebuild = NULL;
-HANDLE hHookExtraIconsApply = NULL;
+HANDLE hEventContactSetting = NULL;
+HANDLE hEventContactAdded = NULL;
+HANDLE hEventUserInfoInit = NULL;
+HANDLE hPrebuildContactMenu = NULL;
+HANDLE hContactMenu = NULL;
+HANDLE hIcoLibIconsChanged = NULL;
+HANDLE hContactReturnedAction = NULL;
+HANDLE hContactStillAbsentAction = NULL;
+HANDLE hMissYouAction = NULL;
+HANDLE hMenuMissYouClick = NULL;
+HANDLE hModulesLoaded = NULL;
+HANDLE hModulesLoaded2 = NULL;
+HANDLE hSystemOKToExit = NULL;
+HANDLE hHookExtraIconsRebuild = NULL;
+HANDLE hHookExtraIconsApply = NULL;
HICON hIcon;
HANDLE hEnabledIcon = NULL, hDisabledIcon = NULL;
-
-IconExtraColumn g_IECMissYou = {0};
-IconExtraColumn g_IECClear = {0};
+HANDLE hExtraIcon;
// Popup Actions
POPUPACTION missyouactions[1];
@@ -81,14 +79,14 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
time_t getLastSeen(HANDLE hContact)
{
- return DBGetContactSettingDword(hContact, MODULE_NAME, "LastSeen", DBGetContactSettingDword(hContact, MODULE_NAME, "CreationTime", (DWORD)-1));
+ return db_get_dw(hContact, MODULE_NAME, "LastSeen", db_get_dw(hContact, MODULE_NAME, "CreationTime", (DWORD)-1));
}
void setLastSeen(HANDLE hContact)
{
- DBWriteContactSettingDword(hContact, MODULE_NAME, "LastSeen", (DWORD)time(NULL));
- if (DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0))
- DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0);
+ db_set_dw(hContact, MODULE_NAME, "LastSeen", (DWORD)time(NULL));
+ if (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0))
+ db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 0);
}
time_t getLastInputMsg(HANDLE hContact)
@@ -116,125 +114,113 @@ time_t getLastInputMsg(HANDLE hContact)
LRESULT CALLBACK HidePopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch (message)
- {
- case WM_COMMAND:
- if (HIWORD(wParam) == STN_CLICKED)
- {
- DBWriteContactSettingByte(PUGetContact(hWnd), "CList", "Hidden", 1);
- PUDeletePopUp(hWnd);
- }
- break;
- case WM_CONTEXTMENU:
- DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1);
- PUDeletePopUp(hWnd);
- break;
- case UM_POPUPACTION:
- if (wParam == 2)
- {
- DBWriteContactSettingByte(PUGetContact(hWnd), "CList", "Hidden", 1);
- PUDeletePopUp(hWnd);
- }
- if (wParam == 3)
- {
- DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1);
- PUDeletePopUp(hWnd);
- }
- break;
- case UM_FREEPLUGINDATA:
- return TRUE;
- default:
- break;
+ switch (message) {
+ case WM_COMMAND:
+ if (HIWORD(wParam) == STN_CLICKED) {
+ db_set_b(PUGetContact(hWnd), "CList", "Hidden", 1);
+ PUDeletePopUp(hWnd);
+ }
+ break;
+
+ case WM_CONTEXTMENU:
+ db_set_b(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1);
+ PUDeletePopUp(hWnd);
+ break;
+
+ case UM_POPUPACTION:
+ if (wParam == 2) {
+ db_set_b(PUGetContact(hWnd), "CList", "Hidden", 1);
+ PUDeletePopUp(hWnd);
+ }
+ if (wParam == 3) {
+ db_set_b(PUGetContact(hWnd), MODULE_NAME, "NeverHide", 1);
+ PUDeletePopUp(hWnd);
+ }
+ break;
+
+ case UM_FREEPLUGINDATA:
+ return TRUE;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
LRESULT CALLBACK MissYouPopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch (message)
- {
- case WM_COMMAND:
- if (HIWORD(wParam) == STN_CLICKED)
- {
- CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0);
- if (!DBGetContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYouNotifyAlways", 0))
- {
- DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
- if (options.MissYouIcon)
- CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) PUGetContact(hWnd), (LPARAM) &g_IECClear);
- }
- PUDeletePopUp(hWnd);
- }
- break;
- case WM_CONTEXTMENU:
- PUDeletePopUp(hWnd);
- break;
- case UM_POPUPACTION:
- if (wParam == 1)
- {
- DBWriteContactSettingByte(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
+ switch (message) {
+ case WM_COMMAND:
+ if (HIWORD(wParam) == STN_CLICKED) {
+ CallServiceSync("BuddyExpectator/actionMissYou", (WPARAM)PUGetContact(hWnd), 0);
+ if ( !db_get_b(PUGetContact(hWnd), MODULE_NAME, "MissYouNotifyAlways", 0)) {
+ db_set_b(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
if (options.MissYouIcon)
- CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) PUGetContact(hWnd), (LPARAM) &g_IECClear);
- PUDeletePopUp(hWnd);
+ ExtraIcon_SetIcon(hExtraIcon, PUGetContact(hWnd), "");
}
- break;
- case UM_FREEPLUGINDATA:
- return TRUE;
- default:
- break;
+ PUDeletePopUp(hWnd);
+ }
+ break;
+
+ case WM_CONTEXTMENU:
+ PUDeletePopUp(hWnd);
+ break;
+
+ case UM_POPUPACTION:
+ if (wParam == 1) {
+ db_set_b(PUGetContact(hWnd), MODULE_NAME, "MissYou", 0);
+ if (options.MissYouIcon)
+ ExtraIcon_SetIcon(hExtraIcon, PUGetContact(hWnd), "");
+ PUDeletePopUp(hWnd);
+ }
+ break;
+
+ case UM_FREEPLUGINDATA:
+ return TRUE;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch (message)
- {
- case WM_COMMAND:
- if (HIWORD(wParam) == STN_CLICKED)
- {
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
- CallServiceSync("BuddyExpectator/actionReturned", (WPARAM)PUGetContact(hWnd), 0);
- PUDeletePopUp(hWnd);
- }
- break;
- case WM_CONTEXTMENU:
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
- setLastSeen(PUGetContact(hWnd));
- PUDeletePopUp(hWnd);
- break;
- case UM_FREEPLUGINDATA:
- if (options.iShowEvent == 0)
- {
- setLastSeen(PUGetContact(hWnd));
- }
- return TRUE;
- default:
- break;
+ switch (message) {
+ case WM_COMMAND:
+ if (HIWORD(wParam) == STN_CLICKED) {
+ CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
+ CallServiceSync("BuddyExpectator/actionReturned", (WPARAM)PUGetContact(hWnd), 0);
+ PUDeletePopUp(hWnd);
+ }
+ break;
+
+ case WM_CONTEXTMENU:
+ CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
+ setLastSeen(PUGetContact(hWnd));
+ PUDeletePopUp(hWnd);
+ break;
+
+ case UM_FREEPLUGINDATA:
+ if (options.iShowEvent == 0)
+ setLastSeen(PUGetContact(hWnd));
+ return TRUE;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
LRESULT CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
- switch (message)
- {
- case WM_COMMAND:
- if (HIWORD(wParam) == STN_CLICKED)
- {
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
- CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0);
- PUDeletePopUp(hWnd);
- }
- break;
- case WM_CONTEXTMENU:
- CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
- PUDeletePopUp(hWnd);
- break;
- case UM_FREEPLUGINDATA:
- return TRUE;
- default:
- break;
+ switch (message) {
+ case WM_COMMAND:
+ if (HIWORD(wParam) == STN_CLICKED) {
+ CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
+ CallServiceSync("BuddyExpectator/actionStillAbsent", (WPARAM)PUGetContact(hWnd), 0);
+ PUDeletePopUp(hWnd);
+ }
+ break;
+
+ case WM_CONTEXTMENU:
+ CallServiceSync(MS_CLIST_REMOVEEVENT, (WPARAM)PUGetContact(hWnd), 0);
+ PUDeletePopUp(hWnd);
+ break;
+
+ case UM_FREEPLUGINDATA:
+ return TRUE;
}
return DefWindowProc(hWnd, message, wParam, lParam);
}
@@ -244,21 +230,19 @@ LRESULT CALLBACK PopupDlgProcNoSet(HWND hWnd, UINT message, WPARAM wParam, LPARA
*/
bool isContactGoneFor(HANDLE hContact, int days)
{
- time_t lastSeen = getLastSeen(hContact);
- time_t lastInputMsg = getLastInputMsg(hContact);
- time_t currentTime = time(NULL);
+ time_t lastSeen = getLastSeen(hContact);
+ time_t lastInputMsg = getLastInputMsg(hContact);
+ time_t currentTime = time(NULL);
- int daysSinceOnline = -1;
- if (lastSeen != -1) daysSinceOnline = (int)((currentTime - lastSeen)/(60*60*24));
+ int daysSinceOnline = -1;
+ if (lastSeen != -1) daysSinceOnline = (int)((currentTime - lastSeen)/(60*60*24));
- int daysSinceMessage = -1;
+ int daysSinceMessage = -1;
if (lastInputMsg != -1) daysSinceMessage = (int)((currentTime - lastInputMsg)/(60*60*24));
- if (options.hideInactive)
- {
+ if (options.hideInactive) {
if (daysSinceMessage >= options.iSilencePeriod)
- if (!DBGetContactSettingByte(hContact, "CList", "Hidden", 0) && !DBGetContactSettingByte(hContact, MODULE_NAME, "NeverHide", 0))
- {
+ if (!db_get_b(hContact, "CList", "Hidden", 0) && !db_get_b(hContact, MODULE_NAME, "NeverHide", 0)) {
TCHAR szInfo[200];
POPUPDATAT_V2 ppd = {0};
@@ -271,8 +255,7 @@ bool isContactGoneFor(HANDLE hContact, int days)
_tcsncpy(ppd.lptzContactName, szInfo, MAX_CONTACTNAME);
mir_sntprintf(szInfo, 200, TranslateT("%d days since last message"), daysSinceMessage);
_tcsncpy(ppd.lptzText, szInfo, MAX_SECONDLINE);
- if (!options.iUsePopupColors)
- {
+ if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopUpColorBack;
ppd.colorText = options.iPopUpColorFore;
}
@@ -295,23 +278,20 @@ bool isContactGoneFor(HANDLE hContact, int days)
void ReturnNotify(HANDLE hContact, TCHAR *message)
{
- if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1)
+ if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
SkinPlaySound("buddyExpectatorReturn");
- if (options.iShowPopUp > 0)
- {
+ if (options.iShowPopUp > 0) {
// Display PopUp
- POPUPDATAT_V2 ppd = {0};
- ppd.cbSize = sizeof(POPUPDATAT_V2);
-
+ POPUPDATAT_V2 ppd = { 0 };
+ ppd.cbSize = sizeof(ppd);
ppd.lchContact = hContact;
ppd.lchIcon = hIcon;
_tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
_tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
- if (!options.iUsePopupColors)
- {
+ if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopUpColorBack;
ppd.colorText = options.iPopUpColorFore;
}
@@ -322,11 +302,8 @@ void ReturnNotify(HANDLE hContact, TCHAR *message)
PUAddPopUpT(&ppd);
}
- if (options.iShowEvent > 0)
- {
- CLISTEVENT cle = {0};
-
- cle.cbSize = sizeof(cle);
+ if (options.iShowEvent > 0) {
+ CLISTEVENT cle = { sizeof(cle) };
cle.hContact = hContact;
cle.hIcon = hIcon;
cle.pszService = "BuddyExpectator/actionReturned";
@@ -343,11 +320,10 @@ void ReturnNotify(HANDLE hContact, TCHAR *message)
void GoneNotify(HANDLE hContact, TCHAR *message)
{
- if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1 || DBGetContactSettingByte(hContact, "CList", "Hidden", 0) == 1)
+ if (db_get_b(hContact, "CList", "NotOnList", 0) == 1 || db_get_b(hContact, "CList", "Hidden", 0) == 1)
return;
- if (options.iShowPopUp2 > 0)
- {
+ if (options.iShowPopUp2 > 0) {
// Display PopUp
POPUPDATAT_V2 ppd = {0};
ppd.cbSize = sizeof(POPUPDATAT_V2);
@@ -356,8 +332,7 @@ void GoneNotify(HANDLE hContact, TCHAR *message)
ppd.lchIcon = hIcon;
_tcsncpy(ppd.lptzContactName, (TCHAR*)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,GCDNF_TCHAR), MAX_CONTACTNAME);
_tcsncpy(ppd.lptzText, message, MAX_SECONDLINE);
- if (!options.iUsePopupColors)
- {
+ if (!options.iUsePopupColors) {
ppd.colorBack = options.iPopUpColorBack;
ppd.colorText = options.iPopUpColorFore;
}
@@ -368,11 +343,8 @@ void GoneNotify(HANDLE hContact, TCHAR *message)
PUAddPopUpT(&ppd);
}
- if (options.iShowEvent2 > 0)
- {
- CLISTEVENT cle = {0};
-
- cle.cbSize = sizeof(cle);
+ if (options.iShowEvent2 > 0) {
+ CLISTEVENT cle = { sizeof(cle) };
cle.hContact = hContact;
cle.hIcon = hIcon;
cle.pszService = "BuddyExpectator/actionStillAbsent";
@@ -395,16 +367,14 @@ void GoneNotify(HANDLE hContact, TCHAR *message)
INT_PTR MissYouAction(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact;
- if (lParam)
- {
- CLISTEVENT* cle = (CLISTEVENT*)lParam;
+ if (lParam) {
+ CLISTEVENT* cle = (CLISTEVENT*)lParam;
hContact = cle->hContact;
- } else
- hContact = (HANDLE)wParam;
-
- CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, 0);
+ }
+ else hContact = (HANDLE)wParam;
- return 0;
+ CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, 0);
+ return 0;
}
/**
@@ -415,26 +385,20 @@ INT_PTR MissYouAction(WPARAM wParam, LPARAM lParam)
INT_PTR ContactReturnedAction(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact;
- if (lParam)
- {
- CLISTEVENT* cle = (CLISTEVENT*)lParam;
+ if (lParam) {
+ CLISTEVENT* cle = (CLISTEVENT*)lParam;
hContact = cle->hContact;
- } else
- hContact = (HANDLE)wParam;
+ }
+ else hContact = (HANDLE)wParam;
- if (options.iShowMessageWindow>0)
- {
- CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, 0);
- }
+ if (options.iShowMessageWindow>0)
+ CallService(MS_MSG_SENDMESSAGET, (WPARAM)hContact, 0);
- if (options.iShowUDetails>0)
- {
- CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
- }
+ if (options.iShowUDetails>0)
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
setLastSeen(hContact);
-
- return 0;
+ return 0;
}
/**
@@ -445,25 +409,23 @@ INT_PTR ContactReturnedAction(WPARAM wParam, LPARAM lParam)
INT_PTR ContactStillAbsentAction(WPARAM wParam, LPARAM lParam)
{
HANDLE hContact;
- if (lParam)
- {
- CLISTEVENT* cle = (CLISTEVENT*)lParam;
+ if (lParam) {
+ CLISTEVENT* cle = (CLISTEVENT*)lParam;
hContact = cle->hContact;
- } else
- hContact = (HANDLE)wParam;
+ }
+ else hContact = (HANDLE)wParam;
- switch (options.action2)
- {
- case GCA_DELETE:
- CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ switch (options.action2) {
+ case GCA_DELETE:
+ CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
break;
- case GCA_UDETAILS:
- CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
+ case GCA_UDETAILS:
+ CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
break;
- case GCA_MESSAGE:
- CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
+ case GCA_MESSAGE:
+ CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
break;
- case GCA_NOACTION:
+ case GCA_NOACTION:
break;
}
@@ -484,15 +446,15 @@ int onIconsChanged(WPARAM wParam, LPARAM lParam)
*/
INT_PTR MenuMissYouClick(WPARAM wParam, LPARAM lParam)
{
- if (DBGetContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0))
- {
- DBWriteContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0);
- if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECClear);
+ if (db_get_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0)) {
+ db_set_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0);
+ if (options.MissYouIcon)
+ ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, "");
}
- else
- {
- DBWriteContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 1);
- if (options.MissYouIcon) CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECMissYou);
+ else {
+ db_set_b((HANDLE)wParam, MODULE_NAME, "MissYou", 1);
+ if (options.MissYouIcon)
+ ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, "enabled_icon");
}
return 0;
@@ -509,12 +471,12 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(CLISTMENUITEM);
- if (DBGetContactSettingByte((HANDLE)wParam, proto, "ChatRoom", 0) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
+ if (db_get_b((HANDLE)wParam, proto, "ChatRoom", 0) || !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
else
mi.flags = CMIM_FLAGS;
- if (DBGetContactSettingByte((HANDLE)wParam, MODULE_NAME, "MissYou", 0))
+ if (db_get_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0))
{
mi.flags |= CMIM_ICON | CMIM_NAME | CMIF_ICONFROMICOLIB | CMIF_TCHAR;
mi.ptszName = LPGENT("Disable Miss You");
@@ -534,23 +496,12 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
int onExtraImageApplying(WPARAM wParam, LPARAM lParam)
{
- if (DBGetContactSettingByte((HANDLE)wParam,MODULE_NAME,"MissYou",0))
- CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM) wParam, (LPARAM) &g_IECMissYou);
+ if ( db_get_b((HANDLE)wParam, MODULE_NAME, "MissYou", 0))
+ ExtraIcon_SetIcon(hExtraIcon, (HANDLE)wParam, "enabled_icon");
return 0;
}
-int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam)
-{
- g_IECMissYou.cbSize = sizeof(IconExtraColumn);
- g_IECMissYou.ColumnType = options.MissYouIcon;
-
- if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON))
- g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)Skin_GetIcon("enabled_icon"), 0);
-
- return 0;
-}
-
/**
* ContactSettingChanged callback
*/
@@ -562,11 +513,11 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
if (hContact == NULL || inf->value.type == DBVT_DELETED || strcmp(inf->szSetting, "Status") != 0)
return 0;
- if (DBGetContactSettingByte(hContact, "CList", "NotOnList", 0) == 1)
+ if (db_get_b(hContact, "CList", "NotOnList", 0) == 1)
return 0;
char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (proto == 0 || (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 1)
+ if (proto == 0 || (db_get_b(hContact, proto, "ChatRoom", 0) == 1)
|| !(CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND))
return 0;
@@ -577,11 +528,11 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
return 0;
// Last status
- DBWriteContactSettingDword(hContact, MODULE_NAME, "LastStatus", prevStatus);
+ db_set_dw(hContact, MODULE_NAME, "LastStatus", prevStatus);
if (prevStatus == ID_STATUS_OFFLINE)
{
- if (DBGetContactSettingByte(hContact, MODULE_NAME, "MissYou", 0))
+ if (db_get_b(hContact, MODULE_NAME, "MissYou", 0))
{
// Display PopUp
POPUPDATAT_V2 ppd = {0};
@@ -616,14 +567,14 @@ int SettingChanged(WPARAM wParam, LPARAM lParam)
return 0;
}
- if (DBGetContactSettingDword(hContact, MODULE_NAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline)
+ if (db_get_dw(hContact, MODULE_NAME, "LastSeen", (DWORD)-1) == (DWORD)-1 && options.notifyFirstOnline)
{
ReturnNotify(hContact, TranslateT("has gone online for the first time."));
setLastSeen(hContact);
}
- unsigned int AbsencePeriod = DBGetContactSettingDword(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
+ unsigned int AbsencePeriod = db_get_dw(hContact, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
if (isContactGoneFor(hContact, AbsencePeriod))
{
TCHAR* message = TranslateT("has returned after a long absence.");
@@ -662,9 +613,9 @@ void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD)
while (hContact != 0)
{
proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if (proto && (DBGetContactSettingByte(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0) == 0))
+ if (proto && (db_get_b(hContact, proto, "ChatRoom", 0) == 0) && (CallProtoService(proto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND) && isContactGoneFor(hContact, options.iAbsencePeriod2) && (db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0) == 0))
{
- DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 1);
+ db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 1);
SkinPlaySound("buddyExpectatorStillAbsent");
TCHAR* message = TranslateT("has not returned after a long absence.");
@@ -720,13 +671,9 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
hModulesLoaded2 = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded2);
if (options.MissYouIcon)
- {
- hHookExtraIconsRebuild = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, onExtraImageListRebuild);
- hHookExtraIconsApply = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, onExtraImageApplying);
- g_IECClear.cbSize = sizeof(IconExtraColumn);
- g_IECClear.ColumnType = options.MissYouIcon;
- g_IECClear.hImage = (HANDLE) -1;
- }
+ hExtraIcon = ExtraIcon_Register("buddy_exp", "Buddy Expectator", "enabled_icon");
+
+ ////////////////////////////////////////////////////////////////////////////
TCHAR szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, MAX_PATH);
@@ -805,7 +752,7 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
int ContactAdded(WPARAM wParam, LPARAM lParam)
{
- DBWriteContactSettingDword((HANDLE)wParam, MODULE_NAME, "CreationTime", (DWORD)time(0));
+ db_set_dw((HANDLE)wParam, MODULE_NAME, "CreationTime", (DWORD)time(0));
return 0;
}
@@ -864,7 +811,7 @@ extern "C" int __declspec(dllexport) Load(void)
if ( !DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv))
DBFreeVariant(&dbv);
else
- DBWriteContactSettingDword(hContact, MODULE_NAME, "CreationTime", current_time);
+ db_set_dw(hContact, MODULE_NAME, "CreationTime", current_time);
hContact = db_find_next(hContact);
}
diff --git a/plugins/BuddyExpectator/src/common.h b/plugins/BuddyExpectator/src/common.h
index c2d4d80303..4317679036 100644
--- a/plugins/BuddyExpectator/src/common.h
+++ b/plugins/BuddyExpectator/src/common.h
@@ -51,7 +51,7 @@
#include <m_userinfo.h>
#include <m_icolib.h>
#include <m_popup.h>
-#include <m_cluiframes.h>
+#include <m_extraicons.h>
#include "m_popup2.h"
@@ -62,6 +62,7 @@
#define MODULE_NAME "BuddyExpectator"
extern HINSTANCE hInst;
+extern HANDLE hExtraIcon;
void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD);
extern DWORD timer_id;
diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp
index 23c0acdea9..d20101ee49 100644
--- a/plugins/BuddyExpectator/src/options.cpp
+++ b/plugins/BuddyExpectator/src/options.cpp
@@ -38,54 +38,58 @@ Options options;
void LoadOptions()
{
- options.iAbsencePeriod = DBGetContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod", 14);
- options.iAbsencePeriod2 = DBGetContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod2", 30 * 3);
- options.iSilencePeriod = DBGetContactSettingDword(NULL, MODULE_NAME, "iSilencePeriod", 30);
- options.iShowPopUp = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowPopUp", 1);
- options.iShowEvent = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowEvent", 0);
- options.iShowUDetails = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowUDetails", 0);
- options.iShowMessageWindow = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowMessageWindow", 1);
- options.iPopUpColorBack = DBGetContactSettingDword(NULL, MODULE_NAME, "iPopUpColorBack", DEF_COLOR_BACK);
- options.iPopUpColorFore = DBGetContactSettingDword(NULL, MODULE_NAME, "iPopUpColorFore", DEF_COLOR_FORE);
- options.iUsePopupColors = DBGetContactSettingByte(NULL, MODULE_NAME, "iUsePopupColors", 0);
- options.iUseWinColors = DBGetContactSettingByte(NULL, MODULE_NAME, "iUseWinColors", 0);
- options.iPopUpDelay = DBGetContactSettingByte(NULL, MODULE_NAME, "iPopUpDelay", 0);
-
- options.iShowPopUp2 = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowPopUp2", 1);
- options.iShowEvent2 = DBGetContactSettingByte(NULL, MODULE_NAME, "iShowEvent2", 0);
- options.action2 = (GoneContactAction)DBGetContactSettingByte(NULL, MODULE_NAME, "Action2", (BYTE)GCA_NOACTION);
- options.notifyFirstOnline = DBGetContactSettingByte(NULL, MODULE_NAME, "bShowFirstSight", 0) ? true : false;
- options.hideInactive = DBGetContactSettingByte(NULL, MODULE_NAME, "bHideInactive", 0) ? true : false;
- options.enableMissYou = DBGetContactSettingByte(NULL, MODULE_NAME, "bMissYouEnabled", 1) ? true : false;
- options.MissYouIcon = DBGetContactSettingByte(NULL, MODULE_NAME, "bMissYouIcon", 0);
+ options.iAbsencePeriod = db_get_dw(NULL, MODULE_NAME, "iAbsencePeriod", 14);
+ options.iAbsencePeriod2 = db_get_dw(NULL, MODULE_NAME, "iAbsencePeriod2", 30 * 3);
+ options.iSilencePeriod = db_get_dw(NULL, MODULE_NAME, "iSilencePeriod", 30);
+
+ options.iShowPopUp = db_get_b(NULL, MODULE_NAME, "iShowPopUp", 1);
+ options.iShowEvent = db_get_b(NULL, MODULE_NAME, "iShowEvent", 0);
+ options.iShowUDetails = db_get_b(NULL, MODULE_NAME, "iShowUDetails", 0);
+ options.iShowMessageWindow = db_get_b(NULL, MODULE_NAME, "iShowMessageWindow", 1);
+
+ options.iPopUpColorBack = db_get_dw(NULL, MODULE_NAME, "iPopUpColorBack", DEF_COLOR_BACK);
+ options.iPopUpColorFore = db_get_dw(NULL, MODULE_NAME, "iPopUpColorFore", DEF_COLOR_FORE);
+
+ options.iUsePopupColors = db_get_b(NULL, MODULE_NAME, "iUsePopupColors", 0);
+ options.iUseWinColors = db_get_b(NULL, MODULE_NAME, "iUseWinColors", 0);
+ options.iPopUpDelay = db_get_b(NULL, MODULE_NAME, "iPopUpDelay", 0);
+
+ options.iShowPopUp2 = db_get_b(NULL, MODULE_NAME, "iShowPopUp2", 1);
+ options.iShowEvent2 = db_get_b(NULL, MODULE_NAME, "iShowEvent2", 0);
+ options.action2 = (GoneContactAction)db_get_b(NULL, MODULE_NAME, "Action2", (BYTE)GCA_NOACTION);
+ options.notifyFirstOnline = db_get_b(NULL, MODULE_NAME, "bShowFirstSight", 0) ? true : false;
+ options.hideInactive = db_get_b(NULL, MODULE_NAME, "bHideInactive", 0) ? true : false;
+ options.enableMissYou = db_get_b(NULL, MODULE_NAME, "bMissYouEnabled", 1) ? true : false;
+ options.MissYouIcon = db_get_b(NULL, MODULE_NAME, "bMissYouIcon", 0);
}
void SaveOptions()
{
- DBWriteContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "iAbsencePeriod2", options.iAbsencePeriod2);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "iSilencePeriod", options.iSilencePeriod);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowPopUp", options.iShowPopUp);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowEvent", options.iShowEvent);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowUDetails", options.iShowUDetails);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowMessageWindow", options.iShowMessageWindow);
-
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowPopUp2", options.iShowPopUp2);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iShowEvent2", options.iShowEvent2);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "Action2", (BYTE)options.action2);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "bShowFirstSight", options.notifyFirstOnline ? 1 : 0);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "bHideInactive", options.hideInactive ? 1 : 0);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "bMissYouEnabled", options.enableMissYou ? 1 : 0);
+ db_set_dw(NULL, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
+ db_set_dw(NULL, MODULE_NAME, "iAbsencePeriod2", options.iAbsencePeriod2);
+ db_set_dw(NULL, MODULE_NAME, "iSilencePeriod", options.iSilencePeriod);
+
+ db_set_b(NULL, MODULE_NAME, "iShowPopUp", options.iShowPopUp);
+ db_set_b(NULL, MODULE_NAME, "iShowEvent", options.iShowEvent);
+ db_set_b(NULL, MODULE_NAME, "iShowUDetails", options.iShowUDetails);
+ db_set_b(NULL, MODULE_NAME, "iShowMessageWindow", options.iShowMessageWindow);
+
+ db_set_b(NULL, MODULE_NAME, "iShowPopUp2", options.iShowPopUp2);
+ db_set_b(NULL, MODULE_NAME, "iShowEvent2", options.iShowEvent2);
+ db_set_b(NULL, MODULE_NAME, "Action2", (BYTE)options.action2);
+ db_set_b(NULL, MODULE_NAME, "bShowFirstSight", options.notifyFirstOnline ? 1 : 0);
+ db_set_b(NULL, MODULE_NAME, "bHideInactive", options.hideInactive ? 1 : 0);
+ db_set_b(NULL, MODULE_NAME, "bMissYouEnabled", options.enableMissYou ? 1 : 0);
}
-
void SavePopupOptions()
{
- DBWriteContactSettingDword(NULL, MODULE_NAME, "iPopUpColorBack", options.iPopUpColorBack);
- DBWriteContactSettingDword(NULL, MODULE_NAME, "iPopUpColorFore", options.iPopUpColorFore);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iUsePopupColors", options.iUsePopupColors);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iUseWinColors", options.iUseWinColors);
- DBWriteContactSettingByte(NULL, MODULE_NAME, "iPopUpDelay", options.iPopUpDelay);
+ db_set_dw(NULL, MODULE_NAME, "iPopUpColorBack", options.iPopUpColorBack);
+ db_set_dw(NULL, MODULE_NAME, "iPopUpColorFore", options.iPopUpColorFore);
+
+ db_set_b(NULL, MODULE_NAME, "iUsePopupColors", options.iUsePopupColors);
+ db_set_b(NULL, MODULE_NAME, "iUseWinColors", options.iUseWinColors);
+ db_set_b(NULL, MODULE_NAME, "iPopUpDelay", options.iPopUpDelay);
}
/**
@@ -93,194 +97,175 @@ void SavePopupOptions()
*/
static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch (uMsg)
- {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
+ switch (uMsg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+
+ if (!ServiceExists(MS_POPUP_ADDPOPUP))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), FALSE);
+
+ //iAbsencePeriod
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_RESETCONTENT, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
+ if (options.iAbsencePeriod % 365 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/365, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 3, 0);
+ }
+ else if (options.iAbsencePeriod % 30 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/30, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 2, 0);
+ }
+ else if (options.iAbsencePeriod % 7 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/7, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 1, 0);
+ }
+ else {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 0, 0);
+ }
- if (!ServiceExists(MS_POPUP_ADDPOPUP))
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), FALSE);
- }
-
- //iAbsencePeriod
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
- if (options.iAbsencePeriod % 365 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/365, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 3, 0);
- }
- else if (options.iAbsencePeriod % 30 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/30, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 2, 0);
- }
- else if (options.iAbsencePeriod % 7 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod/7, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 1, 0);
- }
- else
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, options.iAbsencePeriod, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_SETCURSEL, 0, 0);
- }
-
- //iAbsencePeriod2
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
- if (options.iAbsencePeriod2 % 365 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/365, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 3, 0);
- }
- else if (options.iAbsencePeriod2 % 30 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/30, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 2, 0);
- }
- else if (options.iAbsencePeriod2 % 7 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/7, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 1, 0);
- }
- else
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2,options.iAbsencePeriod2, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 0, 0);
- }
-
- //iSilencePeriod
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
- if (options.iSilencePeriod % 365 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/365, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 3, 0);
- }
- else if (options.iSilencePeriod % 30 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/30, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 2, 0);
- }
- else if (options.iSilencePeriod % 7 == 0)
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/7, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 1, 0);
- }
- else
- {
- SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR,options.iSilencePeriod, FALSE);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 0, 0);
- }
+ //iAbsencePeriod2
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_RESETCONTENT, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
+
+ if (options.iAbsencePeriod2 % 365 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/365, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 3, 0);
+ }
+ else if (options.iAbsencePeriod2 % 30 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/30, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 2, 0);
+ }
+ else if (options.iAbsencePeriod2 % 7 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, options.iAbsencePeriod2/7, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 1, 0);
+ }
+ else {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2,options.iAbsencePeriod2, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_SETCURSEL, 0, 0);
+ }
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_SETCHECK, options.iShowPopUp > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_SETCHECK, options.iShowEvent > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_SETCHECK, (options.iShowUDetails > 0 ? BST_CHECKED : BST_UNCHECKED), 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_SETCHECK, (options.iShowMessageWindow > 0 ? BST_CHECKED : BST_UNCHECKED), 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_SETCHECK, options.notifyFirstOnline ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_SETCHECK, options.hideInactive ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_SETCHECK, options.enableMissYou ? BST_CHECKED : BST_UNCHECKED, 0);
+ //iSilencePeriod
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_RESETCONTENT, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("days"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("weeks"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("months"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_ADDSTRING, 0, (LPARAM) TranslateT("years"));
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_SETCHECK, options.iShowPopUp2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_SETCHECK, options.iShowEvent2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
+ if (options.iSilencePeriod % 365 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/365, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 3, 0);
+ }
+ else if (options.iSilencePeriod % 30 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/30, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 2, 0);
+ }
+ else if (options.iSilencePeriod % 7 == 0) {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, options.iSilencePeriod/7, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 1, 0);
+ }
+ else {
+ SetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR,options.iSilencePeriod, FALSE);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_SETCURSEL, 0, 0);
+ }
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_SETCHECK, options.iShowPopUp > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_SETCHECK, options.iShowEvent > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_SETCHECK, (options.iShowUDetails > 0 ? BST_CHECKED : BST_UNCHECKED), 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_SETCHECK, (options.iShowMessageWindow > 0 ? BST_CHECKED : BST_UNCHECKED), 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_SETCHECK, options.notifyFirstOnline ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_SETCHECK, options.hideInactive ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_SETCHECK, options.enableMissYou ? BST_CHECKED : BST_UNCHECKED, 0);
+
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_SETCHECK, options.iShowPopUp2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_SETCHECK, options.iShowEvent2 > 0 ? BST_CHECKED : BST_UNCHECKED, 0);
+
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_RESETCONTENT, 0, 0);
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Do nothing"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Delete the contact"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open User Details"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open message window"));
+ SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_SETCURSEL, options.action2, 0);
+ return TRUE;
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_RESETCONTENT, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Do nothing"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Delete the contact"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open User Details"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_ADDSTRING, 0, (LPARAM) TranslateT("Open message window"));
- SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_SETCURSEL, options.action2, 0);
+ case WM_COMMAND:
+ if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE)
+ || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE), EM_GETMODIFY, 0, 0)))
+ || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE2), EM_GETMODIFY, 0, 0)))
+ || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_SILENTFOR), EM_GETMODIFY, 0, 0))))
+ {
+ SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
+ }
+ break;
- return TRUE;
- case WM_COMMAND:
- if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE)
- || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE), EM_GETMODIFY, 0, 0)))
- || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_ABSENCE2), EM_GETMODIFY, 0, 0)))
- || ((HIWORD(wParam) == EN_CHANGE) && (SendMessage(GetDlgItem(hwndDlg, IDC_EDIT_SILENTFOR), EM_GETMODIFY, 0, 0))))
- {
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
- }
- break;
- case WM_NOTIFY:
- {
+ case WM_NOTIFY:
+ {
NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code)
- {
- case PSN_APPLY:
+ switch (nmhdr->code) {
+ case PSN_APPLY:
+ //iAbsencePeriod
+ int num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, 0, FALSE);
+ switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_GETCURSEL, 0, 0)) {
+ case 1: options.iAbsencePeriod = 7 * num; break;
+ case 2: options.iAbsencePeriod = 30 * num; break;
+ case 3: options.iAbsencePeriod = 365 * num; break;
+ default: options.iAbsencePeriod = num; break;
+ }
- //iAbsencePeriod
- int num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE, 0, FALSE);
- switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD), CB_GETCURSEL, 0, 0))
- {
- case 1: options.iAbsencePeriod = 7 * num; break;
- case 2: options.iAbsencePeriod = 30 * num; break;
- case 3: options.iAbsencePeriod = 365 * num; break;
- default: options.iAbsencePeriod = num; break;
- }
-
- //iAbsencePeriod2
- num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, 0, FALSE);
- switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_GETCURSEL, 0, 0))
- {
- case 1: options.iAbsencePeriod2 = 7 * num; break;
- case 2: options.iAbsencePeriod2 = 30 * num; break;
- case 3: options.iAbsencePeriod2 = 365 * num; break;
- default: options.iAbsencePeriod2 = num; break;
- }
-
- //iSilencePeriod
- num = GetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, 0, FALSE);
- switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_GETCURSEL, 0, 0))
- {
- case 1: options.iSilencePeriod = 7 * num; break;
- case 2: options.iSilencePeriod = 30 * num; break;
- case 3: options.iSilencePeriod = 365 * num; break;
- default: options.iSilencePeriod = num; break;
- }
+ //iAbsencePeriod2
+ num = GetDlgItemInt(hwndDlg, IDC_EDIT_ABSENCE2, 0, FALSE);
+ switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD2), CB_GETCURSEL, 0, 0)) {
+ case 1: options.iAbsencePeriod2 = 7 * num; break;
+ case 2: options.iAbsencePeriod2 = 30 * num; break;
+ case 3: options.iAbsencePeriod2 = 365 * num; break;
+ default: options.iAbsencePeriod2 = num; break;
+ }
- options.iShowPopUp = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
- options.iShowEvent = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
- options.iShowUDetails = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
- options.iShowMessageWindow = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
- options.notifyFirstOnline = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false;
- options.hideInactive = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false;
- options.enableMissYou = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false;
+ //iSilencePeriod
+ num = GetDlgItemInt(hwndDlg, IDC_EDIT_SILENTFOR, 0, FALSE);
+ switch (SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_PERIOD3), CB_GETCURSEL, 0, 0)) {
+ case 1: options.iSilencePeriod = 7 * num; break;
+ case 2: options.iSilencePeriod = 30 * num; break;
+ case 3: options.iSilencePeriod = 365 * num; break;
+ default: options.iSilencePeriod = num; break;
+ }
- options.iShowPopUp2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
- options.iShowEvent2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
+ options.iShowPopUp = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
+ options.iShowEvent = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
+ options.iShowUDetails = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_UDETAILS), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
+ options.iShowMessageWindow = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MSGWINDOW), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
+ options.notifyFirstOnline = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FIRSTSIGHT), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false;
+ options.hideInactive = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_NOMSGS), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false;
+ options.enableMissYou = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED ? true : false;
- options.action2 = (GoneContactAction)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_GETCURSEL, 0, 0);
+ options.iShowPopUp2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_POPUP2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
+ options.iShowEvent2 = SendMessage(GetDlgItem(hwndDlg, IDC_CHECK_FLASHICON2), BM_GETCHECK, 0, 0) == BST_CHECKED ? 1:0;
- // save values to the DB
- SaveOptions();
+ options.action2 = (GoneContactAction)SendMessage(GetDlgItem(hwndDlg, IDC_COMBO_ACTIONS), CB_GETCURSEL, 0, 0);
- // clear all notified settings
- HANDLE hContact = db_find_first();
- while (hContact != 0)
- {
- if(DBGetContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0))
- DBWriteContactSettingByte(hContact, MODULE_NAME, "StillAbsentNotified", 0);
+ // save values to the DB
+ SaveOptions();
- hContact = db_find_next(hContact);
- }
+ // clear all notified settings
+ HANDLE hContact = db_find_first();
+ while (hContact != 0) {
+ if(db_get_b(hContact, MODULE_NAME, "StillAbsentNotified", 0))
+ db_set_b(hContact, MODULE_NAME, "StillAbsentNotified", 0);
- // restart timer & run check
- KillTimer(0, timer_id);
- timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
- TimerProc(0, 0, 0, 0);
- return TRUE;
+ hContact = db_find_next(hContact);
+ }
+
+ // restart timer & run check
+ KillTimer(0, timer_id);
+ timer_id = SetTimer(0, 0, 1000 * 60 * 60 * 4, TimerProc); // check every 4 hours
+ TimerProc(0, 0, 0, 0);
+ return TRUE;
}
break;
}
@@ -294,189 +279,157 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam,
static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
static int ChangeLock = 0;
- switch (uMsg)
- {
- case WM_INITDIALOG:
-
- ChangeLock++;
- TranslateDialogDefault(hwndDlg);
+ switch (uMsg) {
+ case WM_INITDIALOG:
+ ChangeLock++;
+ TranslateDialogDefault(hwndDlg);
- //iPopUpColorBack
- SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_SETCOLOUR, 0, options.iPopUpColorBack);
+ //iPopUpColorBack
+ SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_SETCOLOUR, 0, options.iPopUpColorBack);
- //iPopUpColorFore
- SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_SETCOLOUR, 0, options.iPopUpColorFore);
+ //iPopUpColorFore
+ SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_SETCOLOUR, 0, options.iPopUpColorFore);
- if (options.iUsePopupColors)
- {
- CheckDlgButton(hwndDlg, IDC_COLORS_POPUP, BST_CHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), false);
- }
+ if (options.iUsePopupColors) {
+ CheckDlgButton(hwndDlg, IDC_COLORS_POPUP, BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), false);
+ }
- if (options.iUseWinColors)
- {
- CheckDlgButton(hwndDlg, IDC_COLORS_WIN, BST_CHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), false);
- }
+ if (options.iUseWinColors) {
+ CheckDlgButton(hwndDlg, IDC_COLORS_WIN, BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), false);
+ }
- //iPopUpDelay
- SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 5, FALSE);
- if (options.iPopUpDelay < 0)
- {
- SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_SETCHECK, BST_CHECKED, 0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false);
- }
- else if(options.iPopUpDelay == 0)
- {
- SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_SETCHECK, BST_CHECKED, 0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false);
- }
- else
- {
- SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_CUST), BM_SETCHECK, BST_CHECKED, 0);
- SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, options.iPopUpDelay, FALSE);
- }
+ //iPopUpDelay
+ SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 5, FALSE);
+ if (options.iPopUpDelay < 0) {
+ SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_SETCHECK, BST_CHECKED, 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false);
+ }
+ else if(options.iPopUpDelay == 0) {
+ SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_SETCHECK, BST_CHECKED, 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false);
+ }
+ else {
+ SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_CUST), BM_SETCHECK, BST_CHECKED, 0);
+ SetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, options.iPopUpDelay, FALSE);
+ }
- ChangeLock--;
- return TRUE;
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_PREVIEW)
- {
- POPUPDATAT ppd;
- ZeroMemory(&ppd, sizeof(ppd));
+ ChangeLock--;
+ return TRUE;
- //iPopUpDelay
- options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE);
- if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED)
- {
- options.iPopUpDelay = -1;
- }
- else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED)
- {
- options.iPopUpDelay = 0;
- }
- ppd.lchContact = NULL;
- ppd.lchIcon = hIcon;
- _tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
- TCHAR szPreviewText[50];
- mir_sntprintf(szPreviewText,50,TranslateT("has returned after being absent since %d days"),rand() % 30);
- _tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
-
- // Get current popups colors options
- if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
- {
- ppd.colorBack = ppd.colorText = 0;
- }
- else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN))
- {
- ppd.colorBack = GetSysColor(COLOR_BTNFACE);
- ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
- }
- else
- {
- ppd.colorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0);
- ppd.colorText = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0);
- }
- ppd.PluginData = NULL;
- ppd.iSeconds = options.iPopUpDelay;
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_PREVIEW) {
+ POPUPDATAT ppd;
+ ZeroMemory(&ppd, sizeof(ppd));
+
+ //iPopUpDelay
+ options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE);
+ if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED)
+ options.iPopUpDelay = -1;
+ else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED)
+ options.iPopUpDelay = 0;
+
+ ppd.lchContact = NULL;
+ ppd.lchIcon = hIcon;
+ _tcsncpy(ppd.lptzContactName, TranslateT("Contact name"), MAX_CONTACTNAME);
+ TCHAR szPreviewText[50];
+ mir_sntprintf(szPreviewText,50,TranslateT("has returned after being absent since %d days"),rand() % 30);
+ _tcsncpy(ppd.lptzText, szPreviewText, MAX_SECONDLINE);
+
+ // Get current popups colors options
+ if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
+ ppd.colorBack = ppd.colorText = 0;
+ else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) {
+ ppd.colorBack = GetSysColor(COLOR_BTNFACE);
+ ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
+ }
+ else {
+ ppd.colorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0);
+ ppd.colorText = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0);
+ }
+ ppd.PluginData = NULL;
+ ppd.iSeconds = options.iPopUpDelay;
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
- _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
- ppd.lchIcon = Skin_GetIcon("enabled_icon");;
+ _tcsncpy(ppd.lptzText, TranslateT("You awaited this contact!"), MAX_SECONDLINE);
+ ppd.lchIcon = Skin_GetIcon("enabled_icon");;
- CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
- }
- else
- {
- if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) || ((HIWORD(wParam) == EN_CHANGE) && !ChangeLock)) {
- SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
- }
- if (LOWORD(wParam) == IDC_COLORS_POPUP)
- {
- if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), false);
- }
- else
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), true);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), true);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), true);
- }
+ CallService(MS_POPUP_ADDPOPUPT, (WPARAM) &ppd, APF_NO_HISTORY);
+ }
+ else {
+ if ((HIWORD(wParam) == BN_CLICKED) || (HIWORD(wParam) == CBN_SELCHANGE) || ((HIWORD(wParam) == EN_CHANGE) && !ChangeLock))
+ SendMessage(GetParent(hwndDlg),PSM_CHANGED,0,0);
+
+ if (LOWORD(wParam) == IDC_COLORS_POPUP) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), false);
}
- if (LOWORD(wParam) == IDC_COLORS_WIN)
- {
- if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN))
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), false);
- }
- else
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), true);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), true);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), true);
- }
+ else {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), true);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), true);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_WIN), true);
}
- if (LOWORD(wParam) == IDC_DELAY_DEF || LOWORD(wParam) == IDC_DELAY_PERM)
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false);
+ }
+ if (LOWORD(wParam) == IDC_COLORS_WIN) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), false);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), false);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), false);
}
- else if (LOWORD(wParam) == IDC_DELAY_CUST)
- {
- EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), true);
+ else {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BGR), true);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_FRG), true);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLORS_POPUP), true);
}
}
- break;
- case WM_NOTIFY:{
- NMHDR* nmhdr = (NMHDR*)lParam;
- switch (nmhdr->code)
- {
- case PSN_APPLY:
+ if (LOWORD(wParam) == IDC_DELAY_DEF || LOWORD(wParam) == IDC_DELAY_PERM)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), false);
+ else if (LOWORD(wParam) == IDC_DELAY_CUST)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EDIT_POPUPDELAY), true);
+ }
- if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP))
- {
- options.iUsePopupColors = 1;
- options.iUseWinColors = 0;
- }
- else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN))
- {
- options.iUseWinColors = 1;
- options.iUsePopupColors = 0;
- options.iPopUpColorBack = GetSysColor(COLOR_BTNFACE);
- options.iPopUpColorFore = GetSysColor(COLOR_WINDOWTEXT);
- }
- else
- {
- options.iUseWinColors = options.iUsePopupColors = 0;
- options.iPopUpColorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0);
- options.iPopUpColorFore = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0);
- }
+ break;
+ case WM_NOTIFY:
+ {
+ NMHDR* nmhdr = (NMHDR*)lParam;
+ switch (nmhdr->code) {
+ case PSN_APPLY:
+ if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_POPUP)) {
+ options.iUsePopupColors = 1;
+ options.iUseWinColors = 0;
+ }
+ else if (IsDlgButtonChecked(hwndDlg, IDC_COLORS_WIN)) {
+ options.iUseWinColors = 1;
+ options.iUsePopupColors = 0;
+ options.iPopUpColorBack = GetSysColor(COLOR_BTNFACE);
+ options.iPopUpColorFore = GetSysColor(COLOR_WINDOWTEXT);
+ }
+ else {
+ options.iUseWinColors = options.iUsePopupColors = 0;
+ options.iPopUpColorBack = SendDlgItemMessage(hwndDlg, IDC_COLOR_BGR, CPM_GETCOLOUR, 0, 0);
+ options.iPopUpColorFore = SendDlgItemMessage(hwndDlg, IDC_COLOR_FRG, CPM_GETCOLOUR, 0, 0);
+ }
- //iPopUpDelay
- options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE);
- if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED)
- {
- options.iPopUpDelay = -1;
- }
- else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED)
- {
- options.iPopUpDelay = 0;
- }
+ //iPopUpDelay
+ options.iPopUpDelay = GetDlgItemInt(hwndDlg, IDC_EDIT_POPUPDELAY, 0, FALSE);
+ if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_PERM), BM_GETCHECK, 0, 0) == BST_CHECKED)
+ options.iPopUpDelay = -1;
+ else if (SendMessage(GetDlgItem(hwndDlg, IDC_DELAY_DEF), BM_GETCHECK, 0, 0) == BST_CHECKED)
+ options.iPopUpDelay = 0;
- // save value to the DB
- SavePopupOptions();
+ // save value to the DB
+ SavePopupOptions();
- return TRUE;
+ return TRUE;
}
break;
}
@@ -489,15 +442,13 @@ static INT_PTR CALLBACK PopUpOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP
*/
static int OptionsInit(WPARAM wParam, LPARAM lParam)
{
- OPTIONSDIALOGPAGE odp;
- ZeroMemory(&odp, sizeof(odp));
- odp.cbSize = sizeof(odp);
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.hInstance = hInst;
odp.ptszGroup = LPGENT("Plugins");
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL);
odp.ptszTitle = LPGENT("Buddy Expectator");
odp.pfnDlgProc = OptionsFrameProc;
- odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
+ odp.flags = ODPF_BOLDGROUPS|ODPF_TCHAR;
Options_AddPage(wParam, &odp);
if (ServiceExists(MS_POPUP_ADDPOPUP)) {
@@ -540,7 +491,7 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
SetDlgItemText(hdlg, IDC_EDIT_LASTINPUT, tmpBuf);
}
- unsigned int AbsencePeriod = DBGetContactSettingDword((HANDLE)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
+ unsigned int AbsencePeriod = db_get_dw((HANDLE)lparam, MODULE_NAME, "iAbsencePeriod", options.iAbsencePeriod);
SendDlgItemMessage(hdlg, IDC_SPINABSENCE, UDM_SETRANGE, 0, MAKELONG(999, 1));
SetDlgItemInt(hdlg, IDC_EDITABSENCE, AbsencePeriod, FALSE);
@@ -554,9 +505,9 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
SetDlgItemText(hdlg, IDC_EDIT_WILLNOTICE, _T(""));
}
- SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
- SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_SETCHECK, DBGetContactSettingByte((HANDLE)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_SETCHECK, db_get_b((HANDLE)lparam, MODULE_NAME, "MissYou", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_SETCHECK, db_get_b((HANDLE)lparam, MODULE_NAME, "MissYouNotifyAlways", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
+ SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_SETCHECK, db_get_b((HANDLE)lparam, MODULE_NAME, "NeverHide", 0) ? BST_CHECKED : BST_UNCHECKED, 0);
TranslateDialogDefault(hdlg);
@@ -574,10 +525,10 @@ INT_PTR CALLBACK UserinfoDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lpar
HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lparam)->lParam;
if (hContact)
{
- DBWriteContactSettingDword(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, 0, FALSE));
- DBWriteContactSettingByte(hContact, MODULE_NAME, "MissYou", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0);
- DBWriteContactSettingByte(hContact, MODULE_NAME, "MissYouNotifyAlways", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0);
- DBWriteContactSettingByte(hContact, MODULE_NAME, "NeverHide", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0);
+ db_set_dw(hContact, MODULE_NAME, "iAbsencePeriod", GetDlgItemInt(hdlg, IDC_EDITABSENCE, 0, FALSE));
+ db_set_b(hContact, MODULE_NAME, "MissYou", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_MISSYOU), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0);
+ db_set_b(hContact, MODULE_NAME, "MissYouNotifyAlways", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NOTIFYALWAYS), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0);
+ db_set_b(hContact, MODULE_NAME, "NeverHide", (SendMessage(GetDlgItem(hdlg, IDC_CHECK_NEVERHIDE), BM_GETCHECK, 0, 0) == BST_CHECKED) ? 1 : 0);
}
break;
}
diff --git a/plugins/Clist_modern/clist_modern_10.vcxproj b/plugins/Clist_modern/clist_modern_10.vcxproj
index 4da3db6d7e..0dbdfcbbb0 100644
--- a/plugins/Clist_modern/clist_modern_10.vcxproj
+++ b/plugins/Clist_modern/clist_modern_10.vcxproj
@@ -220,7 +220,6 @@
</ClCompile>
<ClCompile Include="src\modern_contact.cpp" />
<ClCompile Include="src\modern_docking.cpp" />
- <ClCompile Include="src\modern_extraimage.cpp" />
<ClCompile Include="src\modern_framesmenu.cpp" />
<ClCompile Include="src\modern_gdiplus.cpp" />
<ClCompile Include="src\modern_gettextasync.cpp" />
diff --git a/plugins/Clist_modern/clist_modern_10.vcxproj.filters b/plugins/Clist_modern/clist_modern_10.vcxproj.filters
index 71d04496fb..3fcf4aaed4 100644
--- a/plugins/Clist_modern/clist_modern_10.vcxproj.filters
+++ b/plugins/Clist_modern/clist_modern_10.vcxproj.filters
@@ -84,9 +84,6 @@
<ClCompile Include="src\modern_docking.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\modern_extraimage.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\modern_framesmenu.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/Clist_modern/src/hdr/modern_clc.h b/plugins/Clist_modern/src/hdr/modern_clc.h
index 62d9473a60..10be28480c 100644
--- a/plugins/Clist_modern/src/hdr/modern_clc.h
+++ b/plugins/Clist_modern/src/hdr/modern_clc.h
@@ -74,8 +74,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define INTM_AVATARCHANGED (WM_USER+28)
#define INTM_TIMEZONECHANGED (WM_USER+29)
-#define CLM_SETEXTRACOLUMNSSPACE (CLM_FIRST+73) //wParam=extra space between icons
-
#define CLBF_TILEVTOROWHEIGHT 0x0100
#define TIMERID_RENAME 10
@@ -391,7 +389,7 @@ struct SHORTDATA
};
-typedef struct tagOVERLAYICONINFO
+typedef struct tagOVERLAYICONINFO
{
char *name;
char *description;
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
index d2ce7442a8..a7ae21e716 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
@@ -112,6 +112,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_file.h>
#include <m_timezones.h>
#include <m_toptoolbar.h>
+#include <m_extraicons.h>
#include "modern_clc.h"
#include "modern_clist.h"
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
index 120457fcab..2b63e85ecc 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
@@ -53,7 +53,6 @@ extern SKINOBJECTSLIST g_SkinObjectList;
extern CURRWNDIMAGEDATA * g_pCachedWindow;
extern char * g_szConnectingProto;
extern BOOL g_mutex_bLockUpdating;
-extern BOOL g_mutex_bSetAllExtraIconsCycle;
extern int g_mutex_nCalcRowHeightLock;
extern int g_mutex_bOnTrayRightClick;
extern BOOL g_flag_bPostWasCanceled;
@@ -127,9 +126,6 @@ HBITMAP GDIPlus_LoadGlyphImage(char *szFileName);
/* EventArea */
void EventArea_ConfigureEventArea();
-/* ExtraImage */
-void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact);
-
/* ModernSkinButton */
int ModernSkinButton_AddButton(HWND parent,char * ID,char * CommandService,char * StateDefService,char * HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo,TCHAR * Hint,char * DBkey,char * TypeDef,int MinWidth, int MinHeight);
int ModernSkinButtonLoadModule();
diff --git a/plugins/Clist_modern/src/hdr/modern_static_clui.h b/plugins/Clist_modern/src/hdr/modern_static_clui.h
index 497474e1ee..198706d21a 100644
--- a/plugins/Clist_modern/src/hdr/modern_static_clui.h
+++ b/plugins/Clist_modern/src/hdr/modern_static_clui.h
@@ -77,9 +77,6 @@ void Docking_GetMonitorRectFromWindow(HWND hWnd,RECT *rc);
int EventArea_Create(HWND hCluiWnd);
int ExtraImage_ExtraIDToColumnNum(int extra);
-void ExtraImage_LoadModule();
-void ExtraImage_ReloadExtraIcons();
-void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact);
void GroupMenus_Init();
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 6f2cef1528..646543297a 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -225,9 +225,9 @@ static HRESULT SubclassClistInterface()
static HRESULT CreateHookableEvents()
{
- g_CluiData.hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
- g_CluiData.hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
- g_CluiData.hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
+// g_CluiData.hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
+// g_CluiData.hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
+// g_CluiData.hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
g_CluiData.hEventBkgrChanged = CreateHookableEvent(ME_BACKGROUNDCONFIG_CHANGED);
g_CluiData.hEventPreBuildTrayMenu = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU);
g_CluiData.hEventPreBuildFrameMenu = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 74251d68eb..31f1f02a80 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -202,8 +202,6 @@ INT_PTR GetCapsService(WPARAM wParam,LPARAM lParam)
return 0x0107;
case CLUIF2_EXTRACOLUMNCOUNT:
return EXTRA_ICON_COUNT;
- case CLUIF2_USEREXTRASTART:
- return EXTRA_ICON_ADV3;
}
}
else {
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index de295b0214..79e947940b 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -260,7 +260,6 @@ m_hDwmapiDll( NULL )
nLastRequiredHeight = 0;
LoadCLUIFramesModule();
- ExtraImage_LoadModule();
g_CluiData.boldHideOffline = -1;
bOldHideOffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
@@ -411,7 +410,7 @@ HRESULT CLUI::CreateCLC()
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)CLCPaint::PaintCallbackProc);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_TBTIPNAME,hFrameContactTree),(LPARAM)Translate("My Contacts"));
- ExtraImage_ReloadExtraIcons();
+ pcli->pfnReloadExtraIcons();
nLastRequiredHeight = 0;
if ( g_CluiData.current_viewmode[0] == '\0' )
@@ -1455,8 +1454,8 @@ int CLUI_IconsChanged(WPARAM wParam,LPARAM lParam)
{
if (MirandaExiting()) return 0;
DrawMenuBar(pcli->hwndContactList);
- ExtraImage_ReloadExtraIcons();
- ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,0);
+ pcli->pfnReloadExtraIcons();
+ pcli->pfnSetAllExtraIcons(pcli->hwndContactTree,0);
// need to update tray cause it use combined icons
pcli->pfnTrayIconIconsChanged(); //TODO: remove as soon as core will include icolib
ske_RedrawCompleteWindow();
@@ -1778,21 +1777,15 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase )
{
- if (g_mutex_bSetAllExtraIconsCycle)
- return FALSE;
- if (CLUI_IsInMainWindow(hWnd) && g_CluiData.fLayered)// && IsWindowVisible(hWnd))
- {
- if (IsWindowVisible(hWnd))
+ if ( CLUI_IsInMainWindow(hWnd) && g_CluiData.fLayered) {
+ if ( IsWindowVisible(hWnd))
return SkinInvalidateFrame( hWnd, lpRect );
- else
- {
- g_flag_bFullRepaint = 1;
- return 0;
- }
+
+ g_flag_bFullRepaint = 1;
+ return 0;
}
- else
- return InvalidateRect(hWnd,lpRect,bErase);
- return 1;
+
+ return InvalidateRect(hWnd,lpRect,bErase);
}
static BOOL FileExists(TCHAR * tszFilename)
@@ -2684,7 +2677,7 @@ LRESULT CLUI::OnGetMinMaxInfo( UINT msg, WPARAM wParam, LPARAM lParam )
return FALSE;
}
-LRESULT CLUI::OnMoving( UINT msg, WPARAM wParam, LPARAM lParam )
+LRESULT CLUI::OnMoving(UINT msg, WPARAM wParam, LPARAM lParam)
{
CallWindowProc( DefWindowProc, m_hWnd, msg, wParam, lParam );
if ( FALSE ) //showcontents is turned on
@@ -2694,17 +2687,18 @@ LRESULT CLUI::OnMoving( UINT msg, WPARAM wParam, LPARAM lParam )
return TRUE;
}
-LRESULT CLUI::OnNewContactNotify( NMCLISTCONTROL * pnmc )
+LRESULT CLUI::OnNewContactNotify(NMCLISTCONTROL *pnmc)
{
- ExtraImage_SetAllExtraIcons( pcli->hwndContactTree, pnmc->hItem );
+ pcli->pfnSetAllExtraIcons(pcli->hwndContactTree, pnmc->hItem);
return FALSE;
}
-LRESULT CLUI::OnListRebuildNotify( NMCLISTCONTROL * pnmc )
+LRESULT CLUI::OnListRebuildNotify(NMCLISTCONTROL *pnmc)
{
- ExtraImage_SetAllExtraIcons( pcli->hwndContactTree, 0 );
+ pcli->pfnSetAllExtraIcons(pcli->hwndContactTree, 0);
return FALSE;
}
+
LRESULT CLUI::OnListSizeChangeNotify( NMCLISTCONTROL * pnmc )
{
diff --git a/plugins/Clist_modern/src/modern_extraimage.cpp b/plugins/Clist_modern/src/modern_extraimage.cpp
deleted file mode 100644
index aca86ad0ea..0000000000
--- a/plugins/Clist_modern/src/modern_extraimage.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-#include "hdr/modern_commonheaders.h"
-#include "hdr/modern_commonprototypes.h"
-
-#define ExtraImageIconsIndexCount 6
-
-BOOL g_mutex_bSetAllExtraIconsCycle = 0;
-
-static HIMAGELIST hExtraImageList = NULL;
-static HIMAGELIST hWideExtraImageList = NULL;
-
-void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact);
-
-bool ImageCreated = FALSE;
-
-int ExtraImage_ExtraIDToColumnNum(int extra)
-{
- if (extra < 1 || extra > EXTRACOLUMNCOUNT)
- return -1;
- else
- return extra-1;
-}
-
-//wparam = hIcon
-//return hImage on success,-1 on failure
-INT_PTR AddIconToExtraImageList(WPARAM wParam,LPARAM lParam)
-{
- if (hExtraImageList == 0 || wParam == 0)
- return -1;
-
- int res = ((int)ImageList_AddIcon(hExtraImageList,(HICON)wParam));
- return (res > 254) ? -1 : res;
-}
-
-void ExtraImage_ReloadExtraIcons()
-{
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNSSPACE,db_get_b(NULL,"CLUI","ExtraColumnSpace",18),0);
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,0,0);
- if (hExtraImageList)
- ImageList_Destroy(hExtraImageList);
- if (hWideExtraImageList)
- ImageList_Destroy(hWideExtraImageList);
-
- hExtraImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,1,256);
- hWideExtraImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,1,256);
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,(WPARAM)hWideExtraImageList,(LPARAM)hExtraImageList);
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
- NotifyEventHooks(g_CluiData.hEventExtraImageListRebuilding,0,0);
- ImageCreated = TRUE;
-}
-
-void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact)
-{
- if (pcli->hwndContactTree == 0)
- return;
-
- g_mutex_bSetAllExtraIconsCycle = 1;
- bool hcontgiven = (hContact != 0);
-
- if (ImageCreated == FALSE)
- ExtraImage_ReloadExtraIcons();
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
-
- if (hContact == NULL)
- hContact = db_find_first();
-
- do {
- char *szProto = NULL;
- HANDLE hItem = hContact;
- if (hItem == 0)
- continue;
-
- pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(hItem);
- if (pdnce == NULL)
- continue;
-
- szProto = pdnce->m_cache_cszProto;
- NotifyEventHooks(g_CluiData.hEventExtraImageApplying, (WPARAM)hContact, 0);
- if (hcontgiven) break;
- Sleep(0);
- }
- while(hContact = db_find_next(hContact));
-
- g_mutex_bSetAllExtraIconsCycle = 0;
- CLUI__cliInvalidateRect(hwndList,NULL,FALSE);
- Sleep(0);
-}
-
-INT_PTR WideSetIconForExtraColumn(WPARAM wParam,LPARAM lParam)
-{
- if (pcli->hwndContactTree == 0 || wParam == 0 || lParam == 0)
- return -1;
-
- pIconExtraColumn piec = (pIconExtraColumn)lParam;
- if (piec->cbSize != sizeof(IconExtraColumn))
- return -1;
-
- int icol = ExtraImage_ExtraIDToColumnNum(piec->ColumnType);
- if (icol == -1)
- return -1;
-
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
- if (hItem == 0)
- return -1;
-
- if (piec->hImage == (HANDLE)0xFF)
- piec->hImage = (HANDLE)0xFFFF;
-
- SendMessage(pcli->hwndContactTree,CLM_SETWIDEEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(icol,piec->hImage));
- return 0;
-};
-
-//wparam = hIcon
-//return hImage on success,-1 on failure
-
-INT_PTR WideAddIconToExtraImageList(WPARAM wParam,LPARAM lParam)
-{
- if (hWideExtraImageList == 0 || wParam == 0){return(-1);};
- int res = ((int)ImageList_AddIcon(hWideExtraImageList,(HICON)wParam));
- if (res == 0xFF) res = ((int)ImageList_AddIcon(hWideExtraImageList,(HICON)wParam));
- if (res>0xFFFE) return -1;
- return res;
-};
-
-static int ehhExtraImage_UnloadModule(WPARAM wParam,LPARAM lParam)
-{
- if (hExtraImageList)
- ImageList_Destroy(hExtraImageList);
- if (hWideExtraImageList)
- ImageList_Destroy(hWideExtraImageList);
- return 0;
-
-}
-void ExtraImage_LoadModule()
-{
- CreateServiceFunction(MS_CLIST_EXTRA_SET_ICON, WideSetIconForExtraColumn);
- CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, WideAddIconToExtraImageList);
-
- HookEvent(ME_SYSTEM_SHUTDOWN, ehhExtraImage_UnloadModule );
-};
diff --git a/plugins/Clist_mw/res/resource.rc b/plugins/Clist_mw/res/resource.rc
index 8b160f597c..4c2646ad27 100644
--- a/plugins/Clist_mw/res/resource.rc
+++ b/plugins/Clist_mw/res/resource.rc
@@ -317,22 +317,6 @@ BEGIN
EDITTEXT IDC_TITLETEXT,63,104,72,12,ES_AUTOHSCROLL
CONTROL "Enable drop shadow (restart required)",IDC_DROPSHADOW,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,194,138,10
- GROUPBOX "Contact List Extra Icons",IDC_EXTRA_FRAME,200,130,110,
- 91
- CONTROL "Protocol Type",IDC_EXTRA_PROTO,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,143,70,10
- CONTROL "E-mail",IDC_EXTRA_EMAIL,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,166,75,10
- CONTROL "Cellular",IDC_EXTRA_CELLULAR,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,178,92,10
- CONTROL "Advanced #2",IDC_EXTRA_ADV2,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,191,92,10
- CONTROL "Advanced #1",IDC_EXTRA_ADV1,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,204,92,10
- LTEXT "!!! Note: all client icons are made by Angeli-ka, and I have her permission to use them in clist_mw plugin.",
- IDC_STATIC,5,210,190,20
- CONTROL "Homepage",IDC_EXTRA_WEB,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,154,75,10
END
IDD_OPT_CLC DIALOGEX 0, 0, 314, 251
diff --git a/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp b/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp
index 70f4560856..c435e744f9 100644
--- a/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp
+++ b/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp
@@ -2,11 +2,6 @@
extern int DefaultImageListColorDepth;
-int EnabledColumnCount = 0;
-boolean visar[EXTRACOLUMNCOUNT];
-#define ExtraImageIconsIndexCount 3
-int ExtraImageIconsIndex[ExtraImageIconsIndexCount];
-
static HANDLE hExtraImageListRebuilding,hExtraImageApplying;
HANDLE hExtraImageClick;
@@ -16,374 +11,15 @@ extern HIMAGELIST hCListImages;
extern int ClcIconsChanged(WPARAM,LPARAM);
-void SetAllExtraIcons(HWND hwndList,HANDLE hContact);
-void LoadExtraImageFunc();
-HICON LoadIconFromExternalFile(char*, int, boolean, boolean, char*, char*, char*, int, HICON = NULL);
-boolean ImageCreated = FALSE;
-void ReloadExtraIcons();
-BYTE ExtraOrder[] =
-{
- 0, // EXTRA_ICON_EMAIL
- 1, // EXTRA_ICON_PROTO
- 2, // EXTRA_ICON_SMS
- 3, // EXTRA_ICON_ADV1
- 4, // EXTRA_ICON_ADV2
- 5, // EXTRA_ICON_WEB
- 6, // EXTRA_ICON_CLIENT
- 7, // EXTRA_ICON_ADV3
- 8, // EXTRA_ICON_ADV4
-};
-
-BOOL HasExtraIconsService()
-{
- return ServiceExists("ExtraIcon/Register");
-}
-
-boolean isColumnVisible(int extra)
+void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
{
- int i = 0;
-
- if (HasExtraIconsService())
- return TRUE;
-
- for (i = 0; i<sizeof(ExtraOrder)/sizeof(ExtraOrder[0]); i++)
- if (ExtraOrder[i] == extra)
- {
- switch(i+1)
- {
- case EXTRA_ICON_EMAIL: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",1));
- case EXTRA_ICON_PROTO: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",1));
- case EXTRA_ICON_SMS: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",1));
- case EXTRA_ICON_ADV1: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",1));
- case EXTRA_ICON_ADV2: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",1));
- case EXTRA_ICON_WEB: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",1));
- case EXTRA_ICON_CLIENT: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_CLIENT",1));
- case EXTRA_ICON_ADV3: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV3",0));
- case EXTRA_ICON_ADV4: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV4",0));
- }
- break;
- }
- return(FALSE);
+ /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
-void GetVisColumns()
-{
- visar[0] = isColumnVisible(0);
- visar[1] = isColumnVisible(1);
- visar[2] = isColumnVisible(2);
- visar[3] = isColumnVisible(3);
- visar[4] = isColumnVisible(4);
- visar[5] = isColumnVisible(5);
- visar[6] = isColumnVisible(6);
- visar[7] = isColumnVisible(7);
- visar[8] = isColumnVisible(8);
-};
-
-__inline int bti(boolean b)
-{
- return(b?1:0);
-};
-int colsum(int from,int to)
-{
- int i,sum;
- if (from<0||from>=EXTRACOLUMNCOUNT){return(-1);};
- if (to<0||to>=EXTRACOLUMNCOUNT){return(-1);};
- if (to<from){return(-1);};
-
- sum = 0;
- for (i = from;i<=to;i++)
- {
- sum += bti(visar[i]);
- };
- return(sum);
-};
-
-int ExtraToColumnNum(int extra)
-{
- if (HasExtraIconsService())
- {
- if (extra < 1 || extra > EXTRACOLUMNCOUNT)
- return -1;
- else
- return extra-1;
- }
- else
- {
- int cnt = EnabledColumnCount;
- int extracnt = EXTRACOLUMNCOUNT-1;
- int ord = ExtraOrder[extra-1];
- if (!visar[ord]) return -1;
- return (colsum(0,ord)-1);
- }
-};
+boolean ImageCreated = FALSE;
+void ReloadExtraIcons();
int ColumnNumToExtra(int column)
{
- int i;
-
- if (HasExtraIconsService())
- return column+1;
-
- for (i = 0; i<sizeof(ExtraOrder)/sizeof(ExtraOrder[0]); i++)
- if (ExtraOrder[i] == column)
- return i+1;
-
- return -1;
-}
-
-INT_PTR SetIconForExtraColumn(WPARAM wParam,LPARAM lParam)
-{
- pIconExtraColumn piec;
- int icol;
- HANDLE hItem;
-
- if (pcli->hwndContactTree == 0){return(-1);};
- if (wParam == 0||lParam == 0){return(-1);};
- piec = (pIconExtraColumn)lParam;
-
- if (piec->cbSize != sizeof(IconExtraColumn)){return(-1);};
- icol = ExtraToColumnNum(piec->ColumnType);
- if (icol == -1){return(-1);};
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
- if (hItem == 0){return(-1);};
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(icol,piec->hImage));
- return 0;
-};
-
-//wparam = hIcon
-//return hImage on success,-1 on failure
-INT_PTR AddIconToExtraImageList(WPARAM wParam,LPARAM lParam)
-{
- if (hExtraImageList == 0||wParam == 0){return(-1);};
- return((int)ImageList_AddIcon(hExtraImageList,(HICON)wParam));
-}
-
-int OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
-{
- HICON hicon;
- hicon = LoadIconFromExternalFile("clisticons.dll",0,TRUE,FALSE,"Email","Contact List","Email Icon",-IDI_EMAIL);
- ExtraImageIconsIndex[0] = ImageList_ReplaceIcon(hExtraImageList,ExtraImageIconsIndex[0],hicon );
-
- hicon = LoadIconFromExternalFile("clisticons.dll",1,TRUE,FALSE,"Sms","Contact List","Sms Icon",-IDI_SMS);
- ExtraImageIconsIndex[1] = ImageList_ReplaceIcon(hExtraImageList,ExtraImageIconsIndex[1],hicon );
-
- hicon = LoadIconFromExternalFile("clisticons.dll",4,TRUE,FALSE,"Web","Contact List","Web Icon",-IDI_GLOBUS);
- ExtraImageIconsIndex[2] = ImageList_ReplaceIcon(hExtraImageList,ExtraImageIconsIndex[2],hicon );
-
- pcli->pfnClcBroadcast( INTM_INVALIDATE,0,0);
- return 0;
-}
-
-void ReloadExtraIcons()
-{
- int count,i;
- PROTOACCOUNT **accs;
- HICON hicon;
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNSSPACE,DBGetContactSettingByte(NULL,"CLUI","ExtraColumnSpace",18),0);
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,0,0);
- if (hExtraImageList){ImageList_Destroy(hExtraImageList);};
- hExtraImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,1,256);
-
- if (!HasExtraIconsService())
- {
- //loading icons
- hicon = LoadIconFromExternalFile("clisticons.dll",0,TRUE,TRUE,"Email","Contact List","Email Icon",-IDI_EMAIL);
- if (!hicon) hicon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_EMAIL));
- ExtraImageIconsIndex[0] = ImageList_AddIcon(hExtraImageList,hicon );
-
-
- hicon = LoadIconFromExternalFile("clisticons.dll",1,TRUE,TRUE,"Sms","Contact List","Sms Icon",-IDI_SMS);
- if (!hicon) hicon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_SMS));
- ExtraImageIconsIndex[1] = ImageList_AddIcon(hExtraImageList,hicon );
-
- hicon = LoadIconFromExternalFile("clisticons.dll",4,TRUE,TRUE,"Web","Contact List","Web Icon",-IDI_GLOBUS);
- if (!hicon) hicon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_GLOBUS));
- ExtraImageIconsIndex[2] = ImageList_AddIcon(hExtraImageList,hicon );
-
- //calc only needed protocols
- ProtoEnumAccounts( &count, &accs );
- for ( i = 0; i < count; i++ )
- if ( IsAccountEnabled( accs[i] ) && CallProtoService( accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0 ))
- ImageList_AddIcon( hExtraImageList, LoadSkinnedProtoIcon( accs[i]->szModuleName, ID_STATUS_ONLINE ));
- }
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,0,(LPARAM)hExtraImageList);
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS,EnabledColumnCount,0);
- NotifyEventHooks(hExtraImageListRebuilding,0,0);
- ImageCreated = TRUE;
-}
-
-void ClearExtraIcons();
-
-void ReAssignExtraIcons()
-{
- ClearExtraIcons();
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
- SetAllExtraIcons(pcli->hwndContactTree,0);
- SendMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0);
-}
-
-void ClearExtraIcons()
-{
- int i;
- HANDLE hContact,hItem;
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
-
- hContact = db_find_first();
- do {
-
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
- if (hItem == 0){continue;};
- for (i = 0;i<EnabledColumnCount;i++)
- {
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0xFF));
- };
-
- } while(hContact = db_find_next(hContact));
-};
-
-void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
-{
- HANDLE hItem;
- boolean hcontgiven = FALSE;
- char *szProto;
- char *ImgIndex[64];
- int maxpr,count,i;
- PROTOACCOUNT **accs;
- pClcCacheEntry pdnce;
- int em,pr,sms,a1,a2,w1,c1;
- int tick = 0;
- BOOL hasExtraIconsService;
- hcontgiven = (hContact != 0);
-
- if (pcli->hwndContactTree == 0){return;};
- tick = GetTickCount();
- if (ImageCreated == FALSE) ReloadExtraIcons();
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
-
- hasExtraIconsService = HasExtraIconsService();
- if (!hasExtraIconsService) {
- em = ExtraToColumnNum(EXTRA_ICON_EMAIL);
- pr = ExtraToColumnNum(EXTRA_ICON_PROTO);
- sms = ExtraToColumnNum(EXTRA_ICON_SMS);
- a1 = ExtraToColumnNum(EXTRA_ICON_ADV1);
- a2 = ExtraToColumnNum(EXTRA_ICON_ADV2);
- w1 = ExtraToColumnNum(EXTRA_ICON_WEB);
- c1 = ExtraToColumnNum(EXTRA_ICON_CLIENT);
-
- memset(ImgIndex,0,sizeof(ImgIndex));
- ProtoEnumAccounts( &count, &accs );
-
- maxpr = 0;
- //calc only needed protocols
- for ( i = 0; i < count; i++ ) {
- if ( !IsAccountEnabled( accs[i] ) || CallProtoService( accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0 ) == 0 )
- continue;
- ImgIndex[maxpr] = accs[i]->szModuleName;
- maxpr++;
- }
- }
-
- if ( hContact == NULL )
- hContact = db_find_first();
-
- do {
- szProto = NULL;
- hItem = hContact;
- if (hItem == 0){continue;};
- pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(hItem);
- if (pdnce == NULL) {continue;};
-
- // szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- szProto = pdnce->szProto;
-
- if (!hasExtraIconsService)
- {
- if (ExtraToColumnNum(EXTRA_ICON_WEB) != -1)
- {
- boolean showweb = FALSE;
-
- if (szProto != NULL)
- {
- char *homepage;
- homepage = DBGetStringA(pdnce->hContact,"UserInfo", "Homepage");
- if (!homepage)
- homepage = DBGetStringA(pdnce->hContact,pdnce->szProto, "Homepage");
- if (homepage != NULL)
- {
- showweb = TRUE;
- mir_free(homepage);
- }
- }
-
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_WEB),(showweb)?2:0xFF));
- }
-
- if (ExtraToColumnNum(EXTRA_ICON_EMAIL) != -1)
- {
- DBVARIANT dbv = {0};
- boolean showemail = TRUE;
-
- if (szProto == NULL || DBGetContactSettingString(hContact, szProto, "e-mail",&dbv))
- {
- DBFreeVariant(&dbv);
- if (DBGetContactSettingString(hContact, "UserInfo", "Mye-mail0", &dbv))
- showemail = FALSE;
- }
- DBFreeVariant(&dbv);
-
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_EMAIL),(showemail)?0:0xFF));
- }
-
- if (ExtraToColumnNum(EXTRA_ICON_SMS) != -1)
- {
- DBVARIANT dbv = {0};
- boolean showsms = TRUE;
-
- if (szProto == NULL || DBGetContactSettingString(hContact, szProto, "Cellular",&dbv)) {
- DBFreeVariant(&dbv);
- if (DBGetContactSettingString(hContact, "UserInfo", "MyPhone0", &dbv))
- showsms = FALSE;
- }
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_SMS),(showsms)?1:0xFF));
- DBFreeVariant(&dbv);
- }
-
- if (ExtraToColumnNum(EXTRA_ICON_PROTO) != -1)
- {
- for (i = 0;i<maxpr;i++)
- {
- if (!MyStrCmp(ImgIndex[i],szProto))
- {
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_PROTO),i+3));
- break;
- }
- }
- }
- }
-
- NotifyEventHooks(hExtraImageApplying,(WPARAM)hContact,0);
- if (hcontgiven) break;
- Sleep(0);
- }
- while(hContact = db_find_next(hContact));
-
- tick = GetTickCount()-tick;
- InvalidateRect(hwndList,NULL,FALSE);
- Sleep(0);
-}
-
-void LoadExtraImageFunc()
-{
- CreateServiceFunction(MS_CLIST_EXTRA_SET_ICON,SetIconForExtraColumn);
- CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON,AddIconToExtraImageList);
-
- hExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
- hExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
- hExtraImageClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
- HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
+ return column+1;
}
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp
index 8852594d7e..b9ee5105a1 100644
--- a/plugins/Clist_mw/src/clc.cpp
+++ b/plugins/Clist_mw/src/clc.cpp
@@ -35,9 +35,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam);
void InitDisplayNameCache(SortedList *list);
void FreeDisplayNameCache(SortedList *list);
-void LoadExtraImageFunc( void );
-void LoadExtraImageFunc( void );
void UnloadCLUIModule( void );
extern int sortByStatus;
@@ -282,7 +280,6 @@ LBL_Exit:
int LoadCLCModule(void)
{
LoadCLUIFramesModule();
- LoadExtraImageFunc();
himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp
index 89a1d9dfd5..0f80d347a4 100644
--- a/plugins/Clist_mw/src/clui.cpp
+++ b/plugins/Clist_mw/src/clui.cpp
@@ -36,8 +36,6 @@ UINT hMsgGetProfile = 0;
extern boolean canloadstatusbar;
boolean OnModulesLoadedCalled = FALSE;
-HANDLE hSettingChangedHook = 0;
-
static int transparentFocus = 1;
static byte oldhideoffline;
static int lastreqh = 0,requr = 0,disableautoupd = 1;
@@ -68,12 +66,9 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto);
extern void SetAllExtraIcons(HWND hwndList,HANDLE hContact);
extern void ReloadExtraIcons();
-extern void LoadExtraImageFunc();
extern HWND CreateStatusBarhWnd(HWND parent);
extern HANDLE CreateStatusBarFrame();
extern int CLUIFramesUpdateFrame(WPARAM wParam,LPARAM lParam);
-extern int ExtraToColumnNum(int extra);
-extern int ColumnNumToExtra(int column);
extern void DrawDataForStatusBar(LPDRAWITEMSTRUCT dis);
extern void InitGroupMenus();
extern int UseOwnerDrawStatusBar;
@@ -371,39 +366,6 @@ int OnSettingChanging(WPARAM wParam,LPARAM lParam)
}
}
}
- else {
- if (dbcws == NULL)
- return 0;
-
- if ( !ServiceExists("ExtraIcon/Register")) {
- if (dbcws->value.type == DBVT_ASCIIZ&&!strcmp(dbcws->szSetting,"e-mail")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
- if (dbcws->value.type == DBVT_ASCIIZ&&!strcmp(dbcws->szSetting,"Cellular")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
-
- if (dbcws->value.type == DBVT_ASCIIZ&&strstr(dbcws->szModule,"ICQ")) {
- if ( !strcmp(dbcws->szSetting, "MirVer")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
- }
-
- if (dbcws->value.type == DBVT_ASCIIZ&&!strcmp(dbcws->szModule,"UserInfo")) {
- if ( !strcmp(dbcws->szSetting, "MyPhone0")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
- if (!strcmp(dbcws->szSetting, "Mye-mail0")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
- }
- }
- }
return 0;
}
@@ -443,23 +405,17 @@ int CreateCLC(HWND parent)
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_TBTIPNAME,hFrameContactTree),(LPARAM)TranslateT("My Contacts"));
}
- ReloadExtraIcons();
- {
- lastreqh = 0;
- {
- CallService(MS_CLIST_SETHIDEOFFLINE,(WPARAM)oldhideoffline,0);
- }
+ lastreqh = 0;
+ CallService(MS_CLIST_SETHIDEOFFLINE,(WPARAM)oldhideoffline,0);
- { int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
- if (state == SETTING_STATE_NORMAL) ShowWindow(pcli->hwndContactList, SW_SHOW);
- else if (state == SETTING_STATE_MINIMIZED) ShowWindow(pcli->hwndContactList, SW_SHOWMINIMIZED);
- }
+ int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
+ if (state == SETTING_STATE_NORMAL) ShowWindow(pcli->hwndContactList, SW_SHOW);
+ else if (state == SETTING_STATE_MINIMIZED) ShowWindow(pcli->hwndContactList, SW_SHOWMINIMIZED);
- lastreqh = 0;
- disableautoupd = 0;
+ lastreqh = 0;
+ disableautoupd = 0;
- }
- hSettingChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED,OnSettingChanging);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED,OnSettingChanging);
return 0;
}
@@ -650,7 +606,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case CLN_NEWCONTACT:
{
NMCLISTCONTROL *nm = (NMCLISTCONTROL *)lParam;
- if (nm != NULL) SetAllExtraIcons(pcli->hwndContactTree,nm->hItem );
+ if (nm != NULL)
+ SetAllExtraIcons(pcli->hwndContactTree,nm->hItem );
return TRUE;
}
case CLN_LISTREBUILT:
@@ -700,43 +657,12 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
DWORD hitFlags;
HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
- if (hitFlags&CLCHT_ONITEMEXTRA) {
- if (!IsHContactGroup(hItem)&&!IsHContactInfo(hItem))
- {
- int extra;
- pClcCacheEntry pdnce;
-
- pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(nm->hItem);
- if (pdnce == NULL) return 0;
-
- extra = ColumnNumToExtra(nm->iColumn);
- NotifyEventHooks(hExtraImageClick, (WPARAM)nm->hItem, extra);
-
- if (!ServiceExists("ExtraIcon/Register"))
- {
- int v,e,w;
- v = ExtraToColumnNum(EXTRA_ICON_PROTO);
- e = ExtraToColumnNum(EXTRA_ICON_EMAIL);
- w = ExtraToColumnNum(EXTRA_ICON_ADV1);
-
- if (nm->iColumn == v)
- CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)nm->hItem,0);
-
- if (nm->iColumn == e) {
- //CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)nm->hItem,0);
- char *email,buf[4096];
- email = DBGetStringA(nm->hItem,"UserInfo", "Mye-mail0");
- if (email) {
- sprintf(buf,"mailto:%s",email);
- ShellExecuteA(hwnd,"open",buf,NULL,NULL,SW_SHOW);
- }
- }
- if (nm->iColumn == w) {
- char *homepage;
- homepage = DBGetStringA(pdnce->hContact,pdnce->szProto, "Homepage");
- if (homepage != NULL)
- ShellExecuteA(hwnd,"open",homepage,NULL,NULL,SW_SHOW);
- } } } }
+ if (hitFlags & CLCHT_ONITEMEXTRA)
+ if (!IsHContactGroup(hItem) && !IsHContactInfo(hItem)) {
+ pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(nm->hItem);
+ if (pdnce)
+ NotifyEventHooks(hExtraImageClick, (WPARAM)nm->hItem, nm->iColumn+1);
+ }
if (hItem) break;
if ((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS)) == 0) break;
@@ -841,9 +767,6 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
FreeProtocolData();
- if ( hSettingChangedHook != 0 )
- UnhookEvent(hSettingChangedHook);
-
if ( state == SETTING_STATE_NORMAL )
ShowWindow(hwnd,SW_HIDE);
diff --git a/plugins/Clist_mw/src/cluiopts.cpp b/plugins/Clist_mw/src/cluiopts.cpp
index 37433ce481..07b12743f7 100644
--- a/plugins/Clist_mw/src/cluiopts.cpp
+++ b/plugins/Clist_mw/src/cluiopts.cpp
@@ -29,7 +29,6 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
extern HANDLE hFrameHelperStatusBar;
extern int UseOwnerDrawStatusBar;
-void ReAssignExtraIcons();
void CluiProtocolStatusChanged(int parStatus, const char* szProto);
int OnStatusBarBackgroundChange();
@@ -55,374 +54,325 @@ int CluiOptInit(WPARAM wParam,LPARAM lParam)
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);
- 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));
+ 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);
+ 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;
+ char *s;
+ char szUin[20];
+
+ if (DBGetContactSettingString(NULL,"CList","TitleText",&dbv) == 0&&(dbv.pszVal))
+ {
+ s = mir_strdup(dbv.pszVal);
+ mir_free(dbv.pszVal);
+ }
+ else
+ {
+ s = mir_strdup(MIRANDANAME);
+ }
+
+ if (s)
+ {
+ SetDlgItemTextA(hwndDlg,IDC_TITLETEXT,s);
+ mir_free(s);
+ }
+
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)MIRANDANAME);
+ wsprintfA(szUin,"%u",DBGetContactSettingDword(NULL,"ICQ","UIN",0));
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
+
+ if (!DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
+ mir_free(dbv.pszVal);
+ dbv.pszVal = NULL;
+ }
+ if (!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
+ mir_free(dbv.pszVal);
+ dbv.pszVal = NULL;
+ }
+ if (!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
+ mir_free(dbv.pszVal);
+ dbv.pszVal = NULL;
+ }
+ }
+ 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));
- 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);
+ }
+ 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:
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
+ 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);
+
+ DBWriteContactSettingByte(NULL,"CList","ToolWindow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
+ DBWriteContactSettingByte(NULL,"CList","BringToFront",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BRINGTOFRONT));
+ 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_TOOLWINDOW|WS_EX_WINDOWEDGE);
+ SetWindowPlacement(pcli->hwndContactList,&p);
}
+ else
+ SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE)&~WS_EX_TOOLWINDOW);
- { DBVARIANT dbv;
- char *s;
- char szUin[20];
-
- if (DBGetContactSettingString(NULL,"CList","TitleText",&dbv) == 0&&(dbv.pszVal))
- {
- s = mir_strdup(dbv.pszVal);
- mir_free(dbv.pszVal);
- }
- else
- {
- s = mir_strdup(MIRANDANAME);
- }
+ if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) {
+ HWND hProgMan = FindWindowA("Progman",NULL);
+ if (IsWindow(hProgMan)) SetParent(pcli->hwndContactList,hProgMan);
+ } else {
+ SetParent(pcli->hwndContactList,NULL);
+ }
- if (s)
- {
- SetDlgItemTextA(hwndDlg,IDC_TITLETEXT,s);
- mir_free(s);
- }
+ 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));
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)MIRANDANAME);
- wsprintfA(szUin,"%u",DBGetContactSettingDword(NULL,"ICQ","UIN",0));
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
-
- if (!DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
- mir_free(dbv.pszVal);
- dbv.pszVal = NULL;
- }
- if (!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
- mir_free(dbv.pszVal);
- dbv.pszVal = NULL;
- }
- if (!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
- mir_free(dbv.pszVal);
- dbv.pszVal = NULL;
- }
- }
- 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);
-
- // EXTRA Icons
- if (ServiceExists("ExtraIcon/Register"))
- {
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_FRAME), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_PROTO), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_WEB), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_EMAIL), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_CELLULAR), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_ADV1), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_ADV2), SW_HIDE);
- }
+ if (IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))
+ SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
else
- {
- CheckDlgButton(hwndDlg, IDC_EXTRA_PROTO, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_WEB, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_EMAIL, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_CELLULAR, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_ADV1, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_ADV2, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",1) ? BST_CHECKED : BST_UNCHECKED);
- }
+ SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)&~(WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX));
- 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 (!IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU)) SetMenu(pcli->hwndContactList,NULL);
+ else SetMenu(pcli->hwndContactList,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);
+
+ DBWriteContactSettingByte(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY));
+ if (IsIconic(pcli->hwndContactList) && !IsDlgButtonChecked(hwndDlg,IDC_TOOLWND))
+ ShowWindow(pcli->hwndContactList,IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY)?SW_HIDE:SW_SHOW);
- 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);
+ { TCHAR title[256];
+ GetDlgItemText(hwndDlg,IDC_TITLETEXT,title,SIZEOF(title));
+ DBWriteContactSettingTString(NULL,"CList","TitleText",title);
+ SetWindowText(pcli->hwndContactList,title);
}
- if (wParam != 0x12345678) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- 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);
-
- DBWriteContactSettingByte(NULL,"CList","ToolWindow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
- DBWriteContactSettingByte(NULL,"CList","BringToFront",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BRINGTOFRONT));
- 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_TOOLWINDOW|WS_EX_WINDOWEDGE);
- SetWindowPlacement(pcli->hwndContactList,&p);
- }
- else
- SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE)&~WS_EX_TOOLWINDOW);
-
- if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) {
- HWND hProgMan = FindWindowA("Progman",NULL);
- if (IsWindow(hProgMan)) SetParent(pcli->hwndContactList,hProgMan);
- } else {
- SetParent(pcli->hwndContactList,NULL);
- }
-
- 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));
-
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))
- SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
- 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,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);
-
- DBWriteContactSettingByte(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY));
- if (IsIconic(pcli->hwndContactList) && !IsDlgButtonChecked(hwndDlg,IDC_TOOLWND))
- ShowWindow(pcli->hwndContactList,IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY)?SW_HIDE:SW_SHOW);
-
- { TCHAR title[256];
- GetDlgItemText(hwndDlg,IDC_TITLETEXT,title,SIZEOF(title));
- DBWriteContactSettingTString(NULL,"CList","TitleText",title);
- SetWindowText(pcli->hwndContactList,title);
- }
- 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));
- 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
-
- if (!ServiceExists("ExtraIcon/Register"))
- {
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_PROTO));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_WEB));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_EMAIL));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_CELLULAR));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_ADV1));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_ADV2));
- //SetAllExtraIcons()
- ReAssignExtraIcons();
- }
-
- return TRUE;
+ 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));
+ 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);
}
- break;
+ 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);
- CheckDlgButton(hwndDlg, IDC_USECONNECTINGICON, DBGetContactSettingByte(NULL,"CLUI","UseConnectingIcon",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_SHOWSIZEGRIP, DBGetContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",1) ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_USEOWNERDRAW, DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",1) ? BST_CHECKED : BST_UNCHECKED);
-
- SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
-
- 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_SHOWSIZEGRIP),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_USEOWNERDRAW),FALSE);
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_SHOWSBAR, DBGetContactSettingByte(NULL,"CLUI","ShowSBar",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USECONNECTINGICON, DBGetContactSettingByte(NULL,"CLUI","UseConnectingIcon",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_SHOWSIZEGRIP, DBGetContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",1) ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_USEOWNERDRAW, DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",1) ? BST_CHECKED : BST_UNCHECKED);
+
+ SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
+
+ 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_SHOWSIZEGRIP),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_USEOWNERDRAW),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_SHOWSIZEGRIP),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_USEOWNERDRAW),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+
+ }
+ if (LOWORD(wParam) == IDC_DEFBKCOLOR)
+ {
+ SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,CLR_DEFAULT);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ {
+ COLORREF col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
+ DBWriteContactSettingDword(NULL,"CLUI","SBarBKColor",col);
+
+ 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));
+ DBWriteContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSIZEGRIP));
+
+ DBWriteContactSettingByte(NULL,"CLUI","UseConnectingIcon",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USECONNECTINGICON));
+ DBWriteContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEOWNERDRAW));
+ UseOwnerDrawStatusBar = DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0);
+
+ int frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
+ frameopt &= ~F_VISIBLE;
+
+ if (IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
+ ShowWindow(pcli->hwndStatus,SW_SHOW);
+ frameopt |= F_VISIBLE;
+ }
+ else ShowWindow(pcli->hwndStatus,SW_HIDE);
- }
- 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_SHOWSIZEGRIP),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_USEOWNERDRAW),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),frameopt);
- }
- if (LOWORD(wParam) == IDC_DEFBKCOLOR)
- {
- SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,CLR_DEFAULT);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ SendMessage(pcli->hwndContactList,WM_SIZE,0,0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- int frameopt;
-
- COLORREF col;
- col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
- DBWriteContactSettingDword(NULL,"CLUI","SBarBKColor",col);
-
-
-
- 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));
- DBWriteContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSIZEGRIP));
-
- DBWriteContactSettingByte(NULL,"CLUI","UseConnectingIcon",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USECONNECTINGICON));
- DBWriteContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEOWNERDRAW));
- UseOwnerDrawStatusBar = DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0);
-/*
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) ShowWindow(pcli->hwndStatus,SW_SHOW);
- else ShowWindow(pcli->hwndStatus,SW_HIDE);
-*/
-
- frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
-
- frameopt = frameopt & (~F_VISIBLE);
-
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
- ShowWindow(pcli->hwndStatus,SW_SHOW);
- frameopt |= F_VISIBLE;
- }
- else ShowWindow(pcli->hwndStatus,SW_HIDE);
-
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),frameopt);
-
- SendMessage(pcli->hwndContactList,WM_SIZE,0,0);
-
- OnStatusBarBackgroundChange();
- CluiProtocolStatusChanged(0,0);
- return TRUE;
- }
+ OnStatusBarBackgroundChange();
+ CluiProtocolStatusChanged(0,0);
+ return TRUE;
}
- break;
+ }
+ break;
}
return FALSE;
}
diff --git a/plugins/Clist_mw/src/resource.h b/plugins/Clist_mw/src/resource.h
index 06c9b4c9df..5f7d9332d3 100644
--- a/plugins/Clist_mw/src/resource.h
+++ b/plugins/Clist_mw/src/resource.h
@@ -240,16 +240,10 @@
#define IDC_ALWAYSSTATUS 1103
#define IDC_NETSEARCH 1104
#define IDC_CONFIRMDELETE 1104
-#define IDC_EXTRA_PROTO 1104
#define IDC_SORTBYPROTO 1105
#define IDC_SHOWOPTIONS 1105
-#define IDC_EXTRA_EMAIL 1105
#define IDC_SEARCHURL 1106
-#define IDC_EXTRA_CELLULAR 1106
-#define IDC_EXTRA_ADV2 1107
#define IDC_BUILDTIME 1108
-#define IDC_EXTRA_ADV1 1108
-#define IDC_EXTRA_WEB 1109
#define IDC_NUMBER 1113
#define IDC_UIN 1123
#define IDC_TRANSPARENT 1124
@@ -599,7 +593,6 @@
#define IDC_CHECK1 1761
#define IDC_USECONNECTINGICON 1761
#define IDC_BKGRLIST 1762
-#define IDC_EXTRA_FRAME 1762
#define IDC_BC_STATIC 1763
#define IDC_SC_STATIC 1764
#define IDD_OPT_GENMENU 11267
diff --git a/plugins/Clist_nicer/res/resource.rc b/plugins/Clist_nicer/res/resource.rc
index 35a1ae7c42..c8fa396ac2 100644
--- a/plugins/Clist_nicer/res/resource.rc
+++ b/plugins/Clist_nicer/res/resource.rc
@@ -283,18 +283,6 @@ BEGIN
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,19,164,201,10
END
-IDD_OPT_XICONS DIALOGEX 0, 0, 227, 205
-STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
-FONT 8, "MS Shell Dlg", 0, 0, 0x0
-BEGIN
- GROUPBOX "Extra icons (drag items to reorder them)",IDC_STATIC,1,0,224,164
- PUSHBUTTON "Reset order and visibility to default",IDC_RESETXICONS,5,169,216,15
- CONTROL "",IDC_EXTRAORDER,"SysTreeView32",TVS_NOTOOLTIPS | WS_BORDER | WS_HSCROLL | WS_TABSTOP,4,12,216,148
- LTEXT "Extra icon size",IDC_STATIC,51,193,87,11
- EDITTEXT IDC_EXICONSCALE,141,192,31,12,ES_RIGHT | ES_AUTOHSCROLL | ES_NUMBER
- CONTROL "",IDC_EXICONSCALESPIN,"msctls_updown32",UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY | UDS_ARROWKEYS | UDS_HOTTRACK,160,187,12,14
-END
-
IDD_OPT_ICONS DIALOGEX 0, 0, 227, 205
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CONTROL | WS_CHILD
FONT 8, "MS Shell Dlg", 0, 0, 0x0
@@ -577,18 +565,6 @@ BEGIN
PUSHBUTTON "Cancel",IDCANCEL,284,228,65,14
CONTROL "Draw overlay icon on avatar",IDC_OVERLAYICON,"Button",BS_AUTO3STATE | WS_TABSTOP,219,82,127,10
CONTROL "Show local time",IDC_SHOWLOCALTIME1,"Button",BS_AUTO3STATE | WS_TABSTOP,219,94,127,10
- GROUPBOX "Extra icons",IDC_STATIC,213,118,134,80
- CONTROL "Client",IDC_EXTRA_ICON_CLIENT,"Button",BS_AUTO3STATE | WS_TABSTOP,219,129,64,11
- CONTROL "E-Mail",IDC_EXTRA_ICON_EMAIL,"Button",BS_AUTO3STATE | WS_TABSTOP,219,140,64,11
- CONTROL "Homepage",IDC_EXTRA_ICON_WEB,"Button",BS_AUTO3STATE | WS_TABSTOP,219,151,64,11
- CONTROL "Telephone",IDC_EXTRA_ICON_SMS,"Button",BS_AUTO3STATE | WS_TABSTOP,219,162,64,11
- CONTROL "Reserved",IDC_EXTRA_ICON_RES0,"Button",BS_AUTO3STATE | WS_TABSTOP,219,173,64,11
- CONTROL "Advanced #1",IDC_EXTRA_ICON_ADV1,"Button",BS_AUTO3STATE | WS_TABSTOP,288,129,55,11
- CONTROL "Advanced #2",IDC_EXTRA_ICON_ADV2,"Button",BS_AUTO3STATE | WS_TABSTOP,288,140,55,11
- CONTROL "Advanced #3",IDC_EXTRA_ICON_ADV3,"Button",BS_AUTO3STATE | WS_TABSTOP,288,151,55,11
- CONTROL "Advanced #4",IDC_EXTRA_ICON_ADV4,"Button",BS_AUTO3STATE | WS_TABSTOP,288,162,55,11
- CONTROL "Reserved #1",IDC_EXTRA_ICON_RES1,"Button",BS_AUTO3STATE | WS_TABSTOP,288,173,55,11
- CONTROL "Reserved #2",IDC_EXTRA_ICON_RES2,"Button",BS_AUTO3STATE | WS_TABSTOP,288,184,55,11
CONTROL "Show visibility icon",IDC_SHOWVISIBILITY,"Button",BS_AUTO3STATE | WS_TABSTOP,219,107,127,10
CONTROL "",IDC_DSP_LOADDEFAULT,"MButtonClass",WS_TABSTOP,213,202,135,15,WS_EX_NOACTIVATE | 0x10000000L
END
@@ -750,11 +726,6 @@ END
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO
BEGIN
- IDD_OPT_XICONS, DIALOG
- BEGIN
- RIGHTMARGIN, 225
- END
-
IDD_OPT_CLUI, DIALOG
BEGIN
HORZGUIDE, 127
diff --git a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
index dd1a660c5c..e3f277004b 100644
--- a/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/src/CLUIFrames/cluiframes.cpp
@@ -3385,6 +3385,7 @@ static int CLUIFrameOnModulesUnload(WPARAM wParam, LPARAM lParam)
return 0;
}
+/*
static INT_PTR SetIconForExtraColumn(WPARAM wParam, LPARAM lParam)
{
pIconExtraColumn piec;
@@ -3406,7 +3407,7 @@ static INT_PTR SetIconForExtraColumn(WPARAM wParam, LPARAM lParam)
PostMessage(pcli->hwndContactTree, CLM_SETEXTRAIMAGEINT, wParam, MAKELONG((WORD)piec->ColumnType, (WORD)piec->hImage));
return 0;
}
-
+*/
/*
* wparam=hIcon
* return hImage on success,-1 on failure
@@ -3535,12 +3536,6 @@ int LoadCLUIFramesModule(void)
void LoadExtraIconModule()
{
- CreateServiceFunction(MS_CLIST_EXTRA_SET_ICON, SetIconForExtraColumn);
- CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, AddIconToExtraImageList);
-
- hExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
- hExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
-
hStatusBarShowToolTipEvent = CreateHookableEvent(ME_CLIST_FRAMES_SB_SHOW_TOOLTIP);
hStatusBarHideToolTipEvent = CreateHookableEvent(ME_CLIST_FRAMES_SB_HIDE_TOOLTIP);
}
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h
index 3329cfa76a..eb1ea2b004 100644
--- a/plugins/Clist_nicer/src/Include/clc.h
+++ b/plugins/Clist_nicer/src/Include/clc.h
@@ -98,14 +98,14 @@ ClcGroup;
#define ECF_SECONDLINE 2
struct ContactFloater {
- struct ContactFloater *pNextFloater;
+ ContactFloater *pNextFloater;
HWND hwnd;
HDC hdc;
HBITMAP hbm, hbmOld;
HANDLE hContact;
};
-typedef struct ContactFloater CONTACTFLOATER;
+typedef ContactFloater CONTACTFLOATER;
#define DSPF_CENTERSTATUSICON 1
#define DSPF_DIMIDLE 2
@@ -162,21 +162,21 @@ typedef struct DisplayProfileSet DISPLAYPROFILESET;
struct TExtraCache
{
- BYTE iExtraImage[MAXEXTRACOLUMNS];
+ WORD iExtraImage[MAXEXTRACOLUMNS];
HANDLE hContact;
HANDLE hTimeZone;
- DWORD iExtraValid;
- BYTE valid;
+ DWORD iExtraValid;
+ BYTE valid;
TCHAR *statusMsg;
- BYTE bStatusMsgValid;
- DWORD dwCFlags;
- DWORD dwDFlags; // display flags for caching only
- DWORD dwXMask; // local extra icon mask, calculated from CLN_xmask
+ BYTE bStatusMsgValid;
+ DWORD dwCFlags;
+ DWORD dwDFlags; // display flags for caching only
+ DWORD dwXMask; // local extra icon mask, calculated from CLN_xmask
StatusItems_t *status_item, *proto_status_item;
CONTACTFLOATER *floater;
- DWORD dwLastMsgTime;
- DWORD msgFrequency;
- BOOL isChatRoom;
+ DWORD dwLastMsgTime;
+ DWORD msgFrequency;
+ BOOL isChatRoom;
};
struct ClcContact : public ClcContactBase
@@ -421,8 +421,8 @@ typedef struct {
} protoMenu;
//clcidents.c
-int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible);
-HANDLE ContactToItemHandle(struct ClcContact *contact, DWORD *nmFlags);
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible);
+HANDLE ContactToItemHandle(ClcContact *contact, DWORD *nmFlags);
//clcitems.c
void RebuildEntireList(HWND hwnd, struct ClcData *dat);
@@ -437,7 +437,7 @@ void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newSta
void DoSelectionDefaultAction(HWND hwnd, struct ClcData *dat);
int FindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int prefixOk);
void BeginRenameSelection(HWND hwnd, struct ClcData *dat);
-int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact **contact, ClcGroup **group, DWORD *flags);
+int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD *flags);
void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth);
void RecalcScrollBar(HWND hwnd, struct ClcData *dat);
size_t MY_pathToRelative(const TCHAR *pSrc, TCHAR *pOut);
@@ -455,7 +455,7 @@ void RecalculateGroupCheckboxes(HWND hwnd, struct ClcData *dat);
void SetGroupChildCheckboxes(ClcGroup *group, int checked);
BYTE GetCachedStatusMsg(int iExtraCacheEntry, char *szProto);
int __fastcall GetStatusOnlineness(int status);
-void GetExtendedInfo(struct ClcContact *contact, struct ClcData *dat);
+void GetExtendedInfo(ClcContact *contact, struct ClcData *dat);
extern LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
void HideShowNotifyFrame();
DWORD GetCLUIWindowStyle(BYTE style);
@@ -466,24 +466,24 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO
void FreeProtocolData( void );
-void GetClientID(struct ClcContact *contact, char *client);
+void GetClientID(ClcContact *contact, char *client);
int LoadCLCButtonModule(void);
void SetButtonStates(HWND hwnd);
void ConfigureCLUIGeometry(int mode);
void IcoLibReloadIcons();
-int CompareContacts(const struct ClcContact* p1, const struct ClcContact* p2);
+int CompareContacts(const ClcContact* p1, const ClcContact* p2);
void PaintNotifyArea(HDC hDC, RECT *rc);
int AvatarChanged(WPARAM wParam, LPARAM lParam);
void ConfigureFrame();
void ConfigureEventArea(HWND hwnd);
void ClearIcons(int mode);
void SkinDrawBg(HWND hwnd, HDC hdc);
-int GetBasicFontID(struct ClcContact * contact);
+int GetBasicFontID(ClcContact * contact);
extern int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szStatus, struct ClcData *dat);
void CreateViewModeFrame();
int GetExtraCache(HANDLE hContact, char *szProto);
void ReloadExtraInfo(HANDLE hContact);
-void LoadAvatarForContact(struct ClcContact *p);
+void LoadAvatarForContact(ClcContact *p);
void ApplyViewMode(const char *name);
DWORD CalcXMask(HANDLE hContact);
@@ -492,12 +492,12 @@ HWND ClcGetButtonWindow(int ctrlid);
//clcpaint.c
void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint);
-void __inline PaintItem(HDC hdcMem, ClcGroup *group, struct ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight);
+void __inline PaintItem(HDC hdcMem, ClcGroup *group, ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight);
void Reload3dBevelColors();
void ReloadThemedOptions();
void SetButtonToSkinned();
-void RTL_DetectAndSet(struct ClcContact *contact, HANDLE hContact);
-void RTL_DetectGroupName(struct ClcContact *group);
+void RTL_DetectAndSet(ClcContact *contact, HANDLE hContact);
+void RTL_DetectGroupName(ClcContact *group);
void CLN_LoadAllIcons(BOOL mode);
void ReloadSkinItemsToCache();
void SFL_RegisterWindowClass(), SFL_UnregisterWindowClass();
@@ -508,7 +508,7 @@ void SFL_SetSize();
void SFL_PaintNotifyArea();
void SFL_Update(HICON hIcon, int iIcon, HIMAGELIST hIml, const TCHAR *szText, BOOL refresh);
-void FLT_Update(struct ClcData *dat, struct ClcContact *contact);
+void FLT_Update(struct ClcData *dat, ClcContact *contact);
int FLT_CheckAvail();
void FLT_Create(int iEntry);
void FLT_SetSize(struct TExtraCache *centry, LONG width, LONG height);
@@ -625,10 +625,8 @@ typedef struct _floatopts {
BYTE trans, act_trans;
BYTE radius;
BYTE enabled;
- BYTE def_hover_time;
- WORD hover_time;
+ BYTE def_hover_time;
+ WORD hover_time;
} FLOATINGOPTIONS;
extern FLOATINGOPTIONS g_floatoptions;
-
-
diff --git a/plugins/Clist_nicer/src/Include/commonheaders.h b/plugins/Clist_nicer/src/Include/commonheaders.h
index 9d2c14f304..27f0da733b 100644
--- a/plugins/Clist_nicer/src/Include/commonheaders.h
+++ b/plugins/Clist_nicer/src/Include/commonheaders.h
@@ -206,7 +206,7 @@ extern ImageItem *g_glyphItem;
#define MAX_REGS(_A_) (sizeof(_A_)/sizeof(_A_[0]))
-typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, struct ClcContact *contact, int y, struct ClcData *dat, int selected, WORD cstatus, int rowHeight);
+typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, ClcContact *contact, int y, struct ClcData *dat, int selected, WORD cstatus, int rowHeight);
#define safe_sizeof(a) (sizeof((a)) / sizeof((a)[0]))
diff --git a/plugins/Clist_nicer/src/Include/config.h b/plugins/Clist_nicer/src/Include/config.h
index 4ee9983798..f84b2b8238 100644
--- a/plugins/Clist_nicer/src/Include/config.h
+++ b/plugins/Clist_nicer/src/Include/config.h
@@ -40,7 +40,7 @@
#define IS_THEMED (API::sysState.isThemed)
#define IS_AERO (API::sysState.isAero)
-typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, struct ClcContact *contact, int y, struct ClcData *dat, int selected, WORD cstatus, int rowHeight);
+typedef int (__cdecl *pfnDrawAvatar)(HDC hdcOrig, HDC hdcMem, RECT *rc, ClcContact *contact, int y, struct ClcData *dat, int selected, WORD cstatus, int rowHeight);
typedef BOOL (WINAPI *pfnSetLayeredWindowAttributes_t)(HWND, COLORREF, BYTE, DWORD);
typedef BOOL (WINAPI *pfnUpdateLayeredWindow_t)(HWND, HDC, POINT *, SIZE *, HDC, POINT *, COLORREF, BLENDFUNCTION *, DWORD);
typedef HMONITOR (WINAPI *pfnMonitorFromPoint_t)(POINT,DWORD);
diff --git a/plugins/Clist_nicer/src/Include/resource.h b/plugins/Clist_nicer/src/Include/resource.h
index e7224dd57d..121ebe07f8 100644
--- a/plugins/Clist_nicer/src/Include/resource.h
+++ b/plugins/Clist_nicer/src/Include/resource.h
@@ -26,7 +26,6 @@
#define IDC_HYPERLINKHAND 214
#define IDC_DROPUSER 215
#define IDD_OPT_CLUI 218
-#define IDD_OPT_XICONS 219
#define IDD_OPT_ICONS 220
#define IDD_OPT_CLC 228
#define IDD_OPT_CLCBKG 230
@@ -74,17 +73,8 @@
#define IDC_SETALLBUTTONSKINNED 1043
#define IDC_EVENTSONTOP 1044
#define IDC_FASTGRADIENT 1044
-#define IDC_EXTRA_ICON_EMAIL 1045
#define IDC_DONTSEPARATE 1045
-#define IDC_EXTRA_ICON_SMS 1047
-#define IDC_EXTRA_ICON_RES0 1054
-#define IDC_EXTRA_ICON_WEB 1055
#define IDC_FADEINOUT 1056
-#define IDC_EXTRA_ICON_ADV2 1057
-#define IDC_EXTRA_ICON_RES1 1058
-#define IDC_EXTRA_ICON_RES2 1059
-#define IDC_EXTRA_ICON_ADV3 1060
-#define IDC_EXTRAORDER 1061
#define IDC_FRAMEGAP 1064
#define IDC_FRAMEGAPSPIN 1065
#define IDC_CLIPBORDER 1066
@@ -108,7 +98,6 @@
#define IDC_HIDEOFFLINE 1081
#define IDC_CRIGHTSPIN 1081
#define IDC_HIDEOFFLINEOPTS 1082
-#define IDC_EXTRA_ICON_ADV4 1085
#define IDC_LEFTMARGINSPIN 1092
#define IDC_NOGROUPICON 1102
#define IDC_ONECLK 1105
@@ -130,8 +119,6 @@
#define IDC_STATIC22 1157
#define IDC_STATIC14 1157
#define IDC_STATIC15 1158
-#define IDC_EXTRA_ICON_CLIENT 1164
-#define IDC_EXTRA_ICON_ADV1 1166
#define IDC_SHOWGRIP 1169
#define IDC_SKINBACKGROUND 1170
#define IDC_FILLWALLPAPER 1171
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp
index 190ffffba7..486a81e3f4 100644
--- a/plugins/Clist_nicer/src/clc.cpp
+++ b/plugins/Clist_nicer/src/clc.cpp
@@ -323,7 +323,7 @@ LBL_Def:
case WM_NCPAINT:
return FrameNCPaint(hwnd, DefWindowProc, wParam, lParam, frameHasTitlebar);
case INTM_GROUPCHANGED: {
- struct ClcContact *contact;
+ ClcContact *contact;
BYTE iExtraImage[MAXEXTRACOLUMNS];
BYTE flags = 0;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
@@ -354,14 +354,14 @@ LBL_Def:
}
case INTM_ICONCHANGED: {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
ClcGroup *group = NULL;
int recalcScrollBar = 0, shouldShow;
WORD status = ID_STATUS_OFFLINE;
char *szProto;
int contactRemoved = 0;
HANDLE hSelItem = NULL;
- struct ClcContact *selcontact = NULL;
+ ClcContact *selcontact = NULL;
szProto = (char*) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
if (szProto == NULL)
@@ -416,7 +416,7 @@ LBL_Def:
goto LBL_Def;
}
case INTM_METACHANGED: {
- struct ClcContact *contact;
+ ClcContact *contact;
if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
if (contact->bIsMeta && cfg::dat.bMetaAvail && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
@@ -437,7 +437,7 @@ LBL_Def:
goto LBL_Def;
}
case INTM_METACHANGEDEVENT: {
- struct ClcContact *contact;
+ ClcContact *contact;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
if (lParam == 0)
@@ -445,7 +445,7 @@ LBL_Def:
goto LBL_Def;
}
case INTM_NAMECHANGED: {
- struct ClcContact *contact;
+ ClcContact *contact;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam, 0), safe_sizeof(contact->szText));
@@ -458,7 +458,7 @@ LBL_Def:
}
case INTM_CODEPAGECHANGED: {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
contact->codePage = cfg::getDword((HANDLE) wParam, "Tab_SRMsg", "ANSIcodepage", cfg::getDword((HANDLE)wParam, "UserInfo", "ANSIcodepage", CP_ACP));
@@ -467,7 +467,7 @@ LBL_Def:
}
case INTM_AVATARCHANGED: {
struct avatarCacheEntry *cEntry = (struct avatarCacheEntry *)lParam;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (wParam == 0) {
//RemoveFromImgCache(0, cEntry);
@@ -498,7 +498,7 @@ LBL_Def:
goto LBL_Def;
}
case INTM_STATUSMSGCHANGED: {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int index = -1;
char *szProto = NULL;
@@ -513,7 +513,7 @@ LBL_Def:
goto LBL_Def;
}
case INTM_STATUSCHANGED: {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
WORD wStatus;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
@@ -530,7 +530,7 @@ LBL_Def:
}
case INTM_PROTOCHANGED: {
DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING *) lParam;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
@@ -553,7 +553,7 @@ LBL_Def:
}
if (lParam && !dat->bisEmbedded) {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (FindItem(hwnd, dat, (HANDLE)lParam, &contact, NULL, 0)) {
if (contact && contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry && cfg::eCache[contact->extraCacheEntry].floater)
@@ -563,7 +563,7 @@ LBL_Def:
goto LBL_Def;
case INTM_INVALIDATECONTACT: {
- struct ClcContact *contact = 0;
+ ClcContact *contact = 0;
ClcGroup *group = 0;
int iItem;
@@ -592,7 +592,7 @@ LBL_Def:
case INTM_IDLECHANGED: {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
char *szProto;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (!FindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
break;
@@ -609,7 +609,7 @@ LBL_Def:
case INTM_XSTATUSCHANGED: {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *) lParam;
char *szProto;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int index;
szProto = (char *)cws->szModule;
@@ -670,7 +670,7 @@ LBL_Def:
break;
case WM_LBUTTONDBLCLK: {
- struct ClcContact *contact;
+ ClcContact *contact;
DWORD hitFlags;
ReleaseCapture();
dat->iHotTrack = -1;
@@ -724,7 +724,7 @@ LBL_Def:
return TRUE;
}
case WM_CONTEXTMENU: {
- struct ClcContact *contact;
+ ClcContact *contact;
HMENU hMenu = NULL;
POINT pt;
DWORD hitFlags;
diff --git a/plugins/Clist_nicer/src/clcidents.cpp b/plugins/Clist_nicer/src/clcidents.cpp
index fdb7eac8df..e56157d9b5 100644
--- a/plugins/Clist_nicer/src/clcidents.cpp
+++ b/plugins/Clist_nicer/src/clcidents.cpp
@@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* the CLC uses 3 different ways to identify elements in its list, this file
contains routines to convert between them.
-1) struct ClcContact/ClcGroup pair. Only ever used within the duration
+1) ClcContact/ClcGroup pair. Only ever used within the duration
of a single operation, but used at some point in nearly everything
2) index integer. The 0-based number of the item from the top. Only visible
items are counted (ie not closed groups). Used for saving selection and drag
@@ -39,7 +39,7 @@ contains routines to convert between them.
2->1: GetRowByIndex()
*/
-int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, struct ClcContact **contact, ClcGroup **subgroup, int *isVisible)
+int FindItem(HWND hwnd, struct ClcData *dat, HANDLE hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible)
{
int index = 0;
int nowVisible = 1;
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp
index ebf7229ab9..97f438dbc5 100644
--- a/plugins/Clist_nicer/src/clcitems.cpp
+++ b/plugins/Clist_nicer/src/clcitems.cpp
@@ -37,18 +37,18 @@ extern HANDLE hExtraImageListRebuilding, hExtraImageApplying;
extern int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
extern int ( *saveAddInfoItemToGroup )(ClcGroup *group, int flags, const TCHAR *pszText);
-extern ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
+extern ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
extern ClcGroup* ( *saveAddGroup )(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
static void TZ_LoadTimeZone(HANDLE hContact, struct TExtraCache *c, const char *szProto);
//routines for managing adding/removal of items in the list, including sorting
-struct ClcContact* CreateClcContact( void )
+ClcContact* CreateClcContact( void )
{
- struct ClcContact* p = (struct ClcContact*)mir_alloc( sizeof( struct ClcContact ));
+ ClcContact* p = (ClcContact*)mir_alloc( sizeof( ClcContact ));
if ( p != NULL ) {
- ZeroMemory(p, sizeof(struct ClcContact));
+ ZeroMemory(p, sizeof(ClcContact));
//p->clientId = -1;
p->extraCacheEntry = -1;
p->avatarLeft = p->extraIconRightBegin = -1;
@@ -61,7 +61,7 @@ struct ClcContact* CreateClcContact( void )
int AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText)
{
int i = saveAddInfoItemToGroup(group, flags, pszText);
- struct ClcContact* p = group->cl.items[i];
+ ClcContact* p = group->cl.items[i];
p->codePage = 0;
//p->clientId = -1;
p->bIsMeta = 0;
@@ -83,7 +83,7 @@ ClcGroup *AddGroup(HWND hwnd, struct ClcData *dat, const TCHAR *szName, DWORD fl
return p;
}
-ClcGroup *RemoveItemFromGroup(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount)
+ClcGroup *RemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount)
{
if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry) {
if (cfg::eCache[contact->extraCacheEntry].floater && cfg::eCache[contact->extraCacheEntry].floater->hwnd)
@@ -92,7 +92,7 @@ ClcGroup *RemoveItemFromGroup(HWND hwnd, ClcGroup *group, struct ClcContact *con
return(saveRemoveItemFromGroup(hwnd, group, contact, updateTotalCount));
}
-void LoadAvatarForContact(struct ClcContact *p)
+void LoadAvatarForContact(ClcContact *p)
{
DWORD dwFlags;
@@ -121,7 +121,7 @@ void LoadAvatarForContact(struct ClcContact *p)
int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact)
{
int i = saveAddContactToGroup( dat, group, hContact );
- struct ClcContact* p = group->cl.items[i];
+ ClcContact* p = group->cl.items[i];
p->wStatus = cfg::getWord(hContact, p->proto, "Status", ID_STATUS_OFFLINE);
p->xStatus = cfg::getByte(hContact, p->proto, "XStatusId", 0);
@@ -395,7 +395,7 @@ void ReloadExtraInfo(HANDLE hContact)
*/
-void RTL_DetectAndSet(struct ClcContact *contact, HANDLE hContact)
+void RTL_DetectAndSet(ClcContact *contact, HANDLE hContact)
{
WORD infoTypeC2[12];
int i, index;
@@ -425,7 +425,7 @@ void RTL_DetectAndSet(struct ClcContact *contact, HANDLE hContact)
}
}
-void RTL_DetectGroupName(struct ClcContact *group)
+void RTL_DetectGroupName(ClcContact *group)
{
WORD infoTypeC2[12];
int i;
@@ -450,210 +450,163 @@ void RTL_DetectGroupName(struct ClcContact *group)
* set extra icons accordingly
*/
-void GetExtendedInfo(struct ClcContact *contact, struct ClcData *dat)
+void GetExtendedInfo(ClcContact *contact, struct ClcData *dat)
{
- CONTACTINFO ci;
- BOOL iCacheNew = FALSE;
- int index;
+ if (dat->bisEmbedded || contact == NULL)
+ return;
- if (dat->bisEmbedded || contact == NULL)
- return;
+ if (contact->proto == NULL || contact->hContact == 0)
+ return;
- if (contact->proto == NULL || contact->hContact == 0)
- return;
+ int index = contact->extraCacheEntry;
- index = contact->extraCacheEntry;
+ //firstTime = DBGetContactSettingDword(contact->hContact, "CList", "mf_firstEvent", 0);
+ //count = DBGetContactSettingDword(contact->hContact, "CList", "mf_count", 0);
+ //new_freq = count ? (g_CluiData.t_now - firstTime) / count : 0x7fffffff;
+ cfg::eCache[index].msgFrequency = cfg::getDword(contact->hContact, "CList", "mf_freq", 0x7fffffff);
+ //g_ExtraCache[index].msgFrequency = new_freq;
+ //DBWriteContactSettingDword(contact->hContact, "CList", "mf_freq", new_freq);
- //firstTime = DBGetContactSettingDword(contact->hContact, "CList", "mf_firstEvent", 0);
- //count = DBGetContactSettingDword(contact->hContact, "CList", "mf_count", 0);
- //new_freq = count ? (g_CluiData.t_now - firstTime) / count : 0x7fffffff;
- cfg::eCache[index].msgFrequency = cfg::getDword(contact->hContact, "CList", "mf_freq", 0x7fffffff);
- //g_ExtraCache[index].msgFrequency = new_freq;
- //DBWriteContactSettingDword(contact->hContact, "CList", "mf_freq", new_freq);
-
- if (index >= 0 && index < cfg::nextCacheEntry) {
- if (cfg::eCache[index].valid)
- return;
- cfg::eCache[index].valid = TRUE;
- }
- else
- return;
-
- cfg::eCache[index].isChatRoom = cfg::getByte(contact->hContact, contact->proto, "ChatRoom", 0);
-
- cfg::eCache[index].iExtraValid &= ~(EIMG_SHOW_EMAIL | EIMG_SHOW_SMS | EIMG_SHOW_WEB);
- cfg::eCache[index].iExtraImage[EXTRA_ICON_EMAIL] = cfg::eCache[index].iExtraImage[EXTRA_ICON_WEB] = cfg::eCache[index].iExtraImage[EXTRA_ICON_SMS] = 0xff;
-
- ZeroMemory(&ci,sizeof(CONTACTINFO));
- ci.cbSize = sizeof(CONTACTINFO);
- ci.hContact = contact->hContact;
- ci.szProto = contact->proto;
-
- ci.dwFlag = CNF_EMAIL;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- cfg::eCache[index].iExtraImage[EXTRA_ICON_EMAIL] = 0;
- mir_free(ci.pszVal);
- }
-
- ci.dwFlag = CNF_HOMEPAGE;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- cfg::eCache[index].iExtraImage[EXTRA_ICON_WEB] = 1;
- mir_free(ci.pszVal);
- }
-
- ci.dwFlag = CNF_CELLULAR;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- cfg::eCache[index].iExtraImage[EXTRA_ICON_SMS] = 2;
- mir_free(ci.pszVal);
+ if (index >= 0 && index < cfg::nextCacheEntry) {
+ if (cfg::eCache[index].valid)
+ return;
+ cfg::eCache[index].valid = TRUE;
}
- else {
- ci.dwFlag = CNF_PHONE;
- if (!CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) {
- cfg::eCache[index].iExtraImage[EXTRA_ICON_SMS] = 2;
- mir_free(ci.pszVal);
- }
- }
-
- // set the mask for valid extra images...
-
- cfg::eCache[index].iExtraValid |= ((cfg::eCache[index].iExtraImage[EXTRA_ICON_EMAIL] != 0xff ? EIMG_SHOW_EMAIL : 0) |
- (cfg::eCache[index].iExtraImage[EXTRA_ICON_WEB] != 0xff ? EIMG_SHOW_WEB : 0) |
- (cfg::eCache[index].iExtraImage[EXTRA_ICON_SMS] != 0xff ? EIMG_SHOW_SMS : 0));
+ else
+ return;
+ cfg::eCache[index].isChatRoom = cfg::getByte(contact->hContact, contact->proto, "ChatRoom", 0);
+ cfg::eCache[index].iExtraValid &= ~(EIMG_SHOW_EMAIL | EIMG_SHOW_SMS | EIMG_SHOW_WEB);
+ memset(cfg::eCache[index].iExtraImage, 0xFF, sizeof(cfg::eCache[index].iExtraImage));
}
void LoadSkinItemToCache(struct TExtraCache *cEntry, const char *szProto)
{
- HANDLE hContact = cEntry->hContact;
-
- if (cfg::getByte(hContact, "EXTBK", "VALID", 0)) {
- if (cEntry->status_item == NULL)
- cEntry->status_item = reinterpret_cast<StatusItems_t *>(malloc(sizeof(StatusItems_t)));
- ZeroMemory(cEntry->status_item, sizeof(StatusItems_t));
- strcpy(cEntry->status_item->szName, "{--CONTACT--}"); // mark as "per contact" item
- cEntry->status_item->IGNORED = 0;
-
- cEntry->status_item->TEXTCOLOR = cfg::getDword(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
- cEntry->status_item->COLOR = cfg::getDword(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
- cEntry->status_item->COLOR2 = cfg::getDword(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
- cEntry->status_item->ALPHA = (BYTE)cfg::getByte(hContact, "EXTBK", "ALPHA", 100);
-
- cEntry->status_item->MARGIN_LEFT = (DWORD)cfg::getByte(hContact, "EXTBK", "LEFT", 0);
- cEntry->status_item->MARGIN_RIGHT = (DWORD)cfg::getByte(hContact, "EXTBK", "RIGHT", 0);
- cEntry->status_item->MARGIN_TOP = (DWORD)cfg::getByte(hContact, "EXTBK", "TOP", 0);
- cEntry->status_item->MARGIN_BOTTOM = (DWORD)cfg::getByte(hContact, "EXTBK", "BOTTOM", 0);
-
- cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)cfg::getByte(hContact, "EXTBK", "TRANS", 1);
- cEntry->status_item->BORDERSTYLE = cfg::getDword(hContact, "EXTBK", "BDR", 0);
-
- cEntry->status_item->CORNER = cfg::getByte(hContact, "EXTBK", "CORNER", 0);
- cEntry->status_item->GRADIENT = cfg::getByte(hContact, "EXTBK", "GRAD", 0);
- }
- else if (cEntry->status_item) {
- free(cEntry->status_item);
- cEntry->status_item = NULL;
- }
+ HANDLE hContact = cEntry->hContact;
+
+ if (cfg::getByte(hContact, "EXTBK", "VALID", 0)) {
+ if (cEntry->status_item == NULL)
+ cEntry->status_item = reinterpret_cast<StatusItems_t *>(malloc(sizeof(StatusItems_t)));
+ ZeroMemory(cEntry->status_item, sizeof(StatusItems_t));
+ strcpy(cEntry->status_item->szName, "{--CONTACT--}"); // mark as "per contact" item
+ cEntry->status_item->IGNORED = 0;
+
+ cEntry->status_item->TEXTCOLOR = cfg::getDword(hContact, "EXTBK", "TEXT", RGB(20, 20, 20));
+ cEntry->status_item->COLOR = cfg::getDword(hContact, "EXTBK", "COLOR1", RGB(224, 224, 224));
+ cEntry->status_item->COLOR2 = cfg::getDword(hContact, "EXTBK", "COLOR2", RGB(224, 224, 224));
+ cEntry->status_item->ALPHA = (BYTE)cfg::getByte(hContact, "EXTBK", "ALPHA", 100);
+
+ cEntry->status_item->MARGIN_LEFT = (DWORD)cfg::getByte(hContact, "EXTBK", "LEFT", 0);
+ cEntry->status_item->MARGIN_RIGHT = (DWORD)cfg::getByte(hContact, "EXTBK", "RIGHT", 0);
+ cEntry->status_item->MARGIN_TOP = (DWORD)cfg::getByte(hContact, "EXTBK", "TOP", 0);
+ cEntry->status_item->MARGIN_BOTTOM = (DWORD)cfg::getByte(hContact, "EXTBK", "BOTTOM", 0);
+
+ cEntry->status_item->COLOR2_TRANSPARENT = (BYTE)cfg::getByte(hContact, "EXTBK", "TRANS", 1);
+ cEntry->status_item->BORDERSTYLE = cfg::getDword(hContact, "EXTBK", "BDR", 0);
+
+ cEntry->status_item->CORNER = cfg::getByte(hContact, "EXTBK", "CORNER", 0);
+ cEntry->status_item->GRADIENT = cfg::getByte(hContact, "EXTBK", "GRAD", 0);
+ }
+ else if (cEntry->status_item) {
+ free(cEntry->status_item);
+ cEntry->status_item = NULL;
+ }
}
void ReloadSkinItemsToCache()
{
- int i;
- char *szProto;
-
- for (i = 0; i < cfg::nextCacheEntry; i++) {
- szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cfg::eCache[i].hContact, 0);
- if (szProto)
- LoadSkinItemToCache(&cfg::eCache[i], szProto);
- }
+ for (int i = 0; i < cfg::nextCacheEntry; i++) {
+ char *szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cfg::eCache[i].hContact, 0);
+ if (szProto)
+ LoadSkinItemToCache(&cfg::eCache[i], szProto);
+ }
}
DWORD CalcXMask(HANDLE hContact)
{
- DWORD dwXMask = cfg::getDword(hContact, "CList", "CLN_xmask", 0);
- int i;
- DWORD dwResult = cfg::dat.dwExtraImageMask, bForced, bHidden;
-
- for (i = 0; i <= 10; i++) {
- bForced = (dwXMask & (1 << (2 * i)));
- bHidden = (dwXMask & (1 << (2 * i + 1)));
- if (bForced == 0 && bHidden == 0)
- continue;
- else if (bForced)
- dwResult |= (1 << i);
- else if (bHidden)
- dwResult &= ~(1 << i);
- }
- return(dwResult);
+ DWORD dwXMask = cfg::getDword(hContact, "CList", "CLN_xmask", 0);
+ DWORD dwResult = cfg::dat.dwExtraImageMask, bForced, bHidden;
+
+ for (int i = 0; i <= 10; i++) {
+ bForced = (dwXMask & (1 << (2 * i)));
+ bHidden = (dwXMask & (1 << (2 * i + 1)));
+ if (bForced == 0 && bHidden == 0)
+ continue;
+ else if (bForced)
+ dwResult |= (1 << i);
+ else if (bHidden)
+ dwResult &= ~(1 << i);
+ }
+ return(dwResult);
}
/*
- * checks the currently active view mode filter and returns true, if the contact should be hidden
- * if no view mode is active, it returns the CList/Hidden setting
- * also cares about sub contacts (if meta is active)
- */
+* checks the currently active view mode filter and returns true, if the contact should be hidden
+* if no view mode is active, it returns the CList/Hidden setting
+* also cares about sub contacts (if meta is active)
+*/
int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struct ClcData *dat)
{
- int dbHidden = cfg::getByte(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
- int filterResult = 1;
- DBVARIANT dbv = {0};
- char szTemp[64];
- TCHAR szGroupMask[256];
- DWORD dwLocalMask;
-
- // always hide subcontacts (but show them on embedded contact lists)
-
- if (cfg::dat.bMetaAvail && dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && cfg::getByte(hContact, cfg::dat.szMetaName, "IsSubcontact", 0))
- return 1;
-
- if (cfg::dat.bFilterEffective) {
- if (szProto == NULL)
- szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- // check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
- if (cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
- if ((dwLocalMask = cfg::getDword(hContact, "CLVM", cfg::dat.current_viewmode, 0)) != 0) {
- if (cfg::dat.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
- WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
- }
- return 0;
- }
- }
- // check the proto, use it as a base filter result for all further checks
- if (cfg::dat.bFilterEffective & CLVM_FILTER_PROTOS) {
- mir_snprintf(szTemp, sizeof(szTemp), "%s|", szProto);
- filterResult = strstr(cfg::dat.protoFilter, szTemp) ? 1 : 0;
- }
- if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
- if (!cfg::getTString(hContact, "CList", "Group", &dbv)) {
- _sntprintf(szGroupMask, safe_sizeof(szGroupMask), _T("%s|"), &dbv.ptszVal[1]);
- filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0));
- mir_free(dbv.ptszVal);
- }
- else if (cfg::dat.filterFlags & CLVM_INCLUDED_UNGROUPED)
- filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;
- else
- filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 0;
- }
- if (cfg::dat.bFilterEffective & CLVM_FILTER_STATUS) {
- WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
- filterResult = (cfg::dat.filterFlags & CLVM_GROUPSTATUS_OP) ? ((filterResult | ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0))) : (filterResult & ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0));
- }
- if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG) {
- DWORD now;
- int iEntry = cfg::getCache(hContact, szProto);
- if (iEntry >= 0 && iEntry <= cfg::nextCacheEntry) {
- now = cfg::dat.t_now;
- now -= cfg::dat.lastMsgFilter;
- if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG_OLDERTHAN)
- filterResult = filterResult & (cfg::eCache[iEntry].dwLastMsgTime < now);
- else if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG_NEWERTHAN)
- filterResult = filterResult & (cfg::eCache[iEntry].dwLastMsgTime > now);
+ int dbHidden = cfg::getByte(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
+ int filterResult = 1;
+ DBVARIANT dbv = {0};
+ char szTemp[64];
+ TCHAR szGroupMask[256];
+ DWORD dwLocalMask;
+
+ // always hide subcontacts (but show them on embedded contact lists)
+
+ if (cfg::dat.bMetaAvail && dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && cfg::getByte(hContact, cfg::dat.szMetaName, "IsSubcontact", 0))
+ return 1;
+
+ if (!cfg::dat.bFilterEffective)
+ return dbHidden;
+
+ if (szProto == NULL)
+ szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ // check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
+ if (cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
+ if ((dwLocalMask = cfg::getDword(hContact, "CLVM", cfg::dat.current_viewmode, 0)) != 0) {
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
+ WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
}
+ return 0;
}
- return (dbHidden | !filterResult);
- }
- else
- return dbHidden;
+ }
+ // check the proto, use it as a base filter result for all further checks
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_PROTOS) {
+ mir_snprintf(szTemp, sizeof(szTemp), "%s|", szProto);
+ filterResult = strstr(cfg::dat.protoFilter, szTemp) ? 1 : 0;
+ }
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_GROUPS) {
+ if (!cfg::getTString(hContact, "CList", "Group", &dbv)) {
+ _sntprintf(szGroupMask, safe_sizeof(szGroupMask), _T("%s|"), &dbv.ptszVal[1]);
+ filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(cfg::dat.groupFilter, szGroupMask) ? 1 : 0));
+ mir_free(dbv.ptszVal);
+ }
+ else if (cfg::dat.filterFlags & CLVM_INCLUDED_UNGROUPED)
+ filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;
+ else
+ filterResult = (cfg::dat.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 0;
+ }
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_STATUS) {
+ WORD wStatus = cfg::getWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ filterResult = (cfg::dat.filterFlags & CLVM_GROUPSTATUS_OP) ? ((filterResult | ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0))) : (filterResult & ((1 << (wStatus - ID_STATUS_OFFLINE)) & cfg::dat.statusMaskFilter ? 1 : 0));
+ }
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG) {
+ DWORD now;
+ int iEntry = cfg::getCache(hContact, szProto);
+ if (iEntry >= 0 && iEntry <= cfg::nextCacheEntry) {
+ now = cfg::dat.t_now;
+ now -= cfg::dat.lastMsgFilter;
+ if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG_OLDERTHAN)
+ filterResult = filterResult & (cfg::eCache[iEntry].dwLastMsgTime < now);
+ else if (cfg::dat.bFilterEffective & CLVM_FILTER_LASTMSG_NEWERTHAN)
+ filterResult = filterResult & (cfg::eCache[iEntry].dwLastMsgTime > now);
+ }
+ }
+ return (dbHidden | !filterResult);
}
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp
index 195a8565c8..c1900f2141 100644
--- a/plugins/Clist_nicer/src/clcmsgs.cpp
+++ b/plugins/Clist_nicer/src/clcmsgs.cpp
@@ -39,23 +39,23 @@ extern LRESULT ( *saveProcessExternalMessages )(HWND hwnd, struct ClcData *dat,
LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
- case CLM_SETSTICKY:
- {
- struct ClcContact *contact;
- ClcGroup *group;
-
- if (wParam == 0 || !FindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
- return 0;
- if (lParam)
- contact->flags |= CONTACTF_STICKY;
- else
- contact->flags &= ~CONTACTF_STICKY;
- break;
- }
+ case CLM_SETSTICKY:
+ {
+ ClcContact *contact;
+ ClcGroup *group;
+ if (wParam == 0 || !FindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
+ return 0;
+
+ if (lParam)
+ contact->flags |= CONTACTF_STICKY;
+ else
+ contact->flags &= ~CONTACTF_STICKY;
+ break;
+ }
case CLM_SETEXTRAIMAGEINT:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int index = -1;
if (LOWORD(lParam) >= MAXEXTRACOLUMNS || wParam == 0)
@@ -72,14 +72,14 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
//if (contact->bIsMeta && LOWORD(lParam) != EIMG_EXTRA && LOWORD(lParam) != EIMG_CLIENT)
// return 0;
- /*
- if (contact->hContact == 5846286) {
- _DebugTraceA("set extra image %d", LOWORD(lParam));
- }
- */
+ /*
+ if (contact->hContact == 5846286) {
+ _DebugTraceA("set extra image %d", LOWORD(lParam));
+ }
+ */
if (index >= 0 && index < cfg::nextCacheEntry) {
cfg::eCache[index].iExtraImage[LOWORD(lParam)] = (BYTE)HIWORD(lParam);
- cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != (BYTE)0xff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
+ cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != 0xffff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
PostMessage(hwnd, INTM_INVALIDATE, 0, (LPARAM)(contact ? contact->hContact : 0));
}
}
@@ -92,26 +92,26 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
if (LOWORD(lParam) >= MAXEXTRACOLUMNS)
return 0;
- index = cfg::getCache((HANDLE)wParam, NULL);
- if (index >= 0 && index < cfg::nextCacheEntry) {
- cfg::eCache[index].iExtraImage[LOWORD(lParam)] = (BYTE)HIWORD(lParam);
- cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != (BYTE)0xff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
- }
+ index = cfg::getCache((HANDLE)wParam, NULL);
+ if (index >= 0 && index < cfg::nextCacheEntry) {
+ cfg::eCache[index].iExtraImage[LOWORD(lParam)] = (BYTE)HIWORD(lParam);
+ cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != 0xffff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
+ }
hMasterContact = (HANDLE)cfg::getDword((HANDLE)wParam, cfg::dat.szMetaName, "Handle", 0);
index = cfg::getCache(hMasterContact, NULL);
if (index >= 0 && index < cfg::nextCacheEntry) {
cfg::eCache[index].iExtraImage[LOWORD(lParam)] = (BYTE)HIWORD(lParam);
- cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != (BYTE)0xff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
+ cfg::eCache[index].iExtraValid = cfg::eCache[index].iExtraImage[LOWORD(lParam)] != 0xffff ? (cfg::eCache[index].iExtraValid | (1 << LOWORD(lParam))) : (cfg::eCache[index].iExtraValid & ~(1 << LOWORD(lParam)));
PostMessage(hwnd, INTM_INVALIDATE, 0, 0);
- }
- }
+ }
+ }
return 0;
case CLM_GETSTATUSMSG:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (wParam == 0)
return 0;
@@ -123,7 +123,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry <= cfg::nextCacheEntry) {
if (cfg::eCache[contact->extraCacheEntry].bStatusMsgValid != STATUSMSG_NOTFOUND)
return((INT_PTR)cfg::eCache[contact->extraCacheEntry].statusMsg);
- } }
+ } }
return 0;
case CLM_SETHIDESUBCONTACTS:
@@ -132,7 +132,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
case CLM_TOGGLEPRIORITYCONTACT:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (wParam == 0)
return 0;
@@ -148,7 +148,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
}
case CLM_QUERYPRIORITYCONTACT:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (wParam == 0)
return 0;
@@ -161,7 +161,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM
}
case CLM_TOGGLEFLOATINGCONTACT:
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
BYTE state;
int iEntry;
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp
index 0ab595a853..7555aacb94 100644
--- a/plugins/Clist_nicer/src/clcopts.cpp
+++ b/plugins/Clist_nicer/src/clcopts.cpp
@@ -805,218 +805,6 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam
return FALSE;
}
-ORDERTREEDATA OrderTreeData[]=
-{
- {EXTRA_ICON_RES0, _T("Reserved, unused"), 9, TRUE, 0},
- {EXTRA_ICON_EMAIL, _T("E-mail"), 0, TRUE, 0},
- {EXTRA_ICON_RES1, _T("Reserved #1"), 7, TRUE, 0},
- {EXTRA_ICON_SMS, _T("Telephone"), 2, TRUE, 0},
- {EXTRA_ICON_ADV1, _T("Advanced #1 (ICQ X-Status)"), 3, TRUE, 0},
- {EXTRA_ICON_ADV2, _T("Advanced #2"), 4, TRUE, 0},
- {EXTRA_ICON_WEB, _T("Homepage"), 1, TRUE, 0},
- {EXTRA_ICON_CLIENT, _T("Client (fingerprint required)"), 10, TRUE, 0},
- {EXTRA_ICON_RES2, _T("Reserved #2"), 8, TRUE, 0},
- {EXTRA_ICON_ADV3, _T("Advanced #3"), 5, TRUE, 0},
- {EXTRA_ICON_ADV4, _T("Advanced #4"), 6, TRUE, 0},
-};
-
-static int dragging=0;
-static HTREEITEM hDragItem=NULL;
-
-static int FillOrderTree(HWND hwndDlg, HWND hwndTree, BYTE *exIconOrder, unsigned dwExtraImageMask)
-{
- TVINSERTSTRUCT tvis = {0};
- TreeView_DeleteAllItems(hwndTree);
- tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
-
- for (int i = 0; i < EXICON_COUNT; i++) {
- int iIndex = (int)(exIconOrder[i] - 1);
- tvis.item.lParam=(LPARAM)(&(OrderTreeData[iIndex]));
- tvis.item.pszText = TranslateTS(OrderTreeData[iIndex].Name);
- OrderTreeData[iIndex].Visible = (dwExtraImageMask & (1 << OrderTreeData[iIndex].ID)) != 0;
- tvis.item.iImage = tvis.item.iSelectedImage = OrderTreeData[iIndex].Visible;
- TreeView_InsertItem(hwndTree, &tvis);
- }
-
- return 0;
-}
-
-static int SaveOrderTree(HWND hwndDlg, HWND hwndTree, DISPLAYPROFILE *p)
-{
- TVITEM tvi = {0};
- tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_PARAM;
-
- p->dwExtraImageMask = 0;
-
- HTREEITEM ht = TreeView_GetRoot(hwndTree);
- for (int iIndex = 0; ht != NULL; iIndex++) {
- tvi.hItem = ht;
- TreeView_GetItem(hwndTree, &tvi);
-
- ORDERTREEDATA *it = (ORDERTREEDATA *)(tvi.lParam);
- p->exIconOrder[iIndex] = it->ID + 1;
- p->dwExtraImageMask |= (it->Visible ? (1 << it->ID) : 0);
- ht = TreeView_GetNextSibling(hwndTree, ht);
- }
-
- return 0;
-}
-
-static INT_PTR CALLBACK DlgProcXIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
-{
- DISPLAYPROFILE *p;
-
- switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_EXTRAORDER), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_EXTRAORDER),GWL_STYLE)|TVS_NOHSCROLL);
-
- if (himlCheckBoxes == 0)
- CreateStateImageList();
-
- TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_EXTRAORDER), himlCheckBoxes, TVSIL_NORMAL);
- return TRUE;
-
- case WM_COMMAND:
- if ((LOWORD(wParam) == IDC_EXICONSCALE) && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()))
- return 0;
-
- if (IDC_RESETXICONS == LOWORD(wParam)) {
- BYTE exIconOrder[EXICON_COUNT];
- for (int i = 0; i < EXICON_COUNT; i++) {
- OrderTreeData[i].Visible = TRUE;
- exIconOrder[i] = i + 1;
- }
- FillOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), exIconOrder, 0xffffffff);
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case WM_USER + 100:
- p = (DISPLAYPROFILE *)lParam;
- if (p) {
- SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_SETRANGE, 0, MAKELONG(20, 8));
- SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_SETPOS, 0, (LPARAM)p->exIconScale);
- FillOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), p->exIconOrder, p->dwExtraImageMask);
- }
- return 0;
-
- case WM_USER + 200:
- p = (DISPLAYPROFILE *)lParam;
- if (p) {
- SaveOrderTree(hwndDlg, GetDlgItem(hwndDlg, IDC_EXTRAORDER), p);
-
- p->exIconScale = SendDlgItemMessage(hwndDlg, IDC_EXICONSCALESPIN, UDM_GETPOS, 0, 0);
- p->exIconScale = (p->exIconScale < 8 || p->exIconScale > 20) ? 16 : p->exIconScale;
- }
- return 0;
-
- case WM_NOTIFY:
- if (((LPNMHDR) lParam)->idFrom == IDC_EXTRAORDER) {
- switch (((LPNMHDR)lParam)->code) {
- case TVN_BEGINDRAGA:
- case TVN_BEGINDRAGW:
- SetCapture(hwndDlg);
- dragging=1;
- hDragItem=((LPNMTREEVIEWA)lParam)->itemNew.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- break;
- case 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_ONITEMICON)
- {
- TVITEMA 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;
- ((ORDERTREEDATA *)tvi.lParam)->Visible=tvi.iImage;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- }
- break;
- }
- switch (((LPNMHDR) lParam)->code) {
- case PSN_APPLY:
- return TRUE;
- }
- break;
-
- case WM_MOUSEMOVE:
- if (dragging) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(lParam);
- hti.pt.y = (short)HIWORD(lParam);
- ClientToScreen(hwndDlg, &hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg, IDC_EXTRAORDER), &hti.pt);
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER), &hti);
- if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
- HTREEITEM it = hti.hItem;
- hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg, IDC_EXTRAORDER)) / 2;
- TreeView_HitTest(GetDlgItem(hwndDlg, IDC_EXTRAORDER), &hti);
- //TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hti.hItem,1);
- if (!(hti.flags & TVHT_ABOVE))
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), hti.hItem, 1);
- else
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), it, 0);
- }
- else {
- if (hti.flags & TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
- if (hti.flags & TVHT_BELOW) SendDlgItemMessage(hwndDlg, IDC_EXTRAORDER, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
- TreeView_SetInsertMark(GetDlgItem(hwndDlg, IDC_EXTRAORDER), NULL, 0);
- }
- }
- break;
-
- case WM_LBUTTONUP:
- if (dragging) {
- TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
- dragging=0;
- ReleaseCapture();
-
- TVHITTESTINFO hti;
- TVITEM tvi;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
- ClientToScreen(hwndDlg,&hti.pt);
- ScreenToClient(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti.pt);
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
- TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
- if (hDragItem==hti.hItem) break;
- if (hti.flags&TVHT_ABOVE) hti.hItem=TVI_FIRST;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=hDragItem;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvi);
- if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)||(hti.hItem==TVI_FIRST)) {
- TVINSERTSTRUCT tvis;
- TCHAR name[128];
- tvis.item.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvis.item.stateMask=0xFFFFFFFF;
- tvis.item.pszText=name;
- tvis.item.cchTextMax=sizeof(name);
- tvis.item.hItem=hDragItem;
- tvis.item.iImage=tvis.item.iSelectedImage=((ORDERTREEDATA *)tvi.lParam)->Visible;
- TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis.item);
- TreeView_DeleteItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- tvis.hParent=NULL;
- tvis.hInsertAfter=hti.hItem;
- TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),TreeView_InsertItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis));
- SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- break;
- }
- return FALSE;
-}
-
static INT_PTR CALLBACK DlgProcIcons(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
DISPLAYPROFILE *p;
@@ -1145,16 +933,6 @@ static INT_PTR CALLBACK DlgProcDspProfiles(HWND hwnd, UINT msg, WPARAM wParam, L
if (IS_THEMED)
API::pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- if ( !ServiceExists(MS_EXTRAICON_REGISTER)) {
- tci.lParam = (LPARAM)CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_OPT_XICONS), hwnd, DlgProcXIcons);
- tci.pszText = TranslateT("Extra Icons");
- TabCtrl_InsertItem(hwndTab, ++iOrder, &tci);
- MoveWindow((HWND)tci.lParam,64,25,rcClient.right-128,rcClient.bottom-67,1);
- ShowWindow((HWND)tci.lParam, oPage == iOrder ? SW_SHOW : SW_HIDE);
- if (IS_THEMED)
- API::pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- }
-
tci.lParam = (LPARAM)CreateDialog(g_hInst,MAKEINTRESOURCE(IDD_OPT_DSPADVANCED), hwnd, DlgProcDspAdvanced);
tci.pszText = TranslateT("Advanced");
TabCtrl_InsertItem(hwndTab, ++iOrder, &tci);
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp
index 99625c23f0..45a525e65d 100644
--- a/plugins/Clist_nicer/src/clcpaint.cpp
+++ b/plugins/Clist_nicer/src/clcpaint.cpp
@@ -1,34 +1,31 @@
/*
- * astyle --force-indent=tab=4 --brackets=linux --indent-switches
- * --pad=oper --one-line=keep-blocks --unpad=paren
- *
- * 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.
- *
- * part of clist_nicer plugin for Miranda.
- *
- * (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors
- *
- * $Id: clcpaint.cpp 12909 2010-10-06 14:53:00Z silvercircle $
- *
- */
+* 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.
+*
+* part of clist_nicer plugin for Miranda.
+*
+* (C) 2005-2010 by silvercircle _at_ gmail _dot_ com and contributors
+*
+* $Id: clcpaint.cpp 12909 2010-10-06 14:53:00Z silvercircle $
+*
+*/
#include "commonheaders.h"
@@ -38,7 +35,6 @@ extern int g_curAvatar;
extern ImageItem *g_glyphItem;
extern int hClcProtoCount;
-extern ORDERTREEDATA OrderTreeData[];
extern HIMAGELIST hCListImages;
static BYTE divide3[765] = {255};
@@ -62,19 +58,12 @@ int g_list_avatars = 0;
HFONT __fastcall ChangeToFont(HDC hdc, struct ClcData *dat, int id, int *fontHeight)
{
- HFONT hOldFont = 0;
- /*
- hOldFont = SelectObject(hdc, dat->fontInfo[id].hFont);
- SetTextColor(hdc, dat->fontInfo[id].colour);
+ HFONT hOldFont = reinterpret_cast<HFONT>(SelectObject(hdc, cfg::clcdat->fontInfo[id].hFont));
+ SetTextColor(hdc, cfg::clcdat->fontInfo[id].colour);
if (fontHeight)
- *fontHeight = dat->fontInfo[id].fontHeight;
- */
- hOldFont = reinterpret_cast<HFONT>(SelectObject(hdc, cfg::clcdat->fontInfo[id].hFont));
- SetTextColor(hdc, cfg::clcdat->fontInfo[id].colour);
- if (fontHeight)
- *fontHeight = cfg::clcdat->fontInfo[id].fontHeight;
-
- dat->currentFontID = id;
+ *fontHeight = cfg::clcdat->fontInfo[id].fontHeight;
+
+ dat->currentFontID = id;
return hOldFont;
}
@@ -134,24 +123,24 @@ int __fastcall GetStatusOnlineness(int status)
return 120;
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;
+ 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;
}
@@ -176,7 +165,7 @@ static int __fastcall GetGeneralisedStatus(void)
return status;
}
-static int __fastcall GetRealStatus(struct ClcContact *contact, int status)
+static int __fastcall GetRealStatus(ClcContact *contact, int status)
{
int i;
char *szProto = contact->proto;
@@ -190,7 +179,7 @@ static int __fastcall GetRealStatus(struct ClcContact *contact, int status)
return status;
}
-int GetBasicFontID(struct ClcContact * contact)
+int GetBasicFontID(ClcContact * contact)
{
switch (contact->type)
{
@@ -273,7 +262,7 @@ HDC hdcAV;
LONG g_maxAV_X = 200, g_maxAV_Y = 200;
-static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contact, int y, struct ClcData *dat, WORD cstatus, int rowHeight, DWORD dwFlags)
+static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int y, struct ClcData *dat, WORD cstatus, int rowHeight, DWORD dwFlags)
{
float dScale = 0.;
float newHeight, newWidth;
@@ -286,11 +275,11 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac
HRGN rgn = 0;
int avatar_size = cfg::dat.avatarSize;
DWORD av_saved_left;
- StatusItems_t *item = contact->wStatus == ID_STATUS_OFFLINE ? &StatusItems[ID_EXTBKAVATARFRAMEOFFLINE - ID_STATUS_OFFLINE] : &StatusItems[ID_EXTBKAVATARFRAME - ID_STATUS_OFFLINE];
- int skinMarginX, skinMarginY;
- BOOL fOverlay = (cfg::dat.dwFlags & CLUI_FRAME_OVERLAYICONS);
+ StatusItems_t *item = contact->wStatus == ID_STATUS_OFFLINE ? &StatusItems[ID_EXTBKAVATARFRAMEOFFLINE - ID_STATUS_OFFLINE] : &StatusItems[ID_EXTBKAVATARFRAME - ID_STATUS_OFFLINE];
+ int skinMarginX, skinMarginY;
+ BOOL fOverlay = (cfg::dat.dwFlags & CLUI_FRAME_OVERLAYICONS);
- contact->avatarLeft = -1;
+ contact->avatarLeft = -1;
if (!cfg::dat.bAvatarServiceAvail || dat->bisEmbedded)
return 0;
@@ -318,30 +307,30 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac
if (bmHeight == 0 || bmWidth == 0 || hbm == 0)
return 0;
- g_maxAV_X = max(bmWidth, g_maxAV_X);
- g_maxAV_Y = max(bmHeight, g_maxAV_Y);
+ g_maxAV_X = max(bmWidth, g_maxAV_X);
+ g_maxAV_Y = max(bmHeight, g_maxAV_Y);
if (dAspect >= 1.0) { // height > width
- skinMarginY = item->IGNORED ? 0 : (item->MARGIN_TOP + item->MARGIN_BOTTOM);
- skinMarginX = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
+ skinMarginY = item->IGNORED ? 0 : (item->MARGIN_TOP + item->MARGIN_BOTTOM);
+ skinMarginX = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
- dScale = (float)(avatar_size - 2) / (float)bmHeight;
+ dScale = (float)(avatar_size - 2) / (float)bmHeight;
newHeight = (float)(avatar_size - skinMarginY - 2);
newWidth = (float)(bmWidth * dScale) - skinMarginX;
}
else {
- skinMarginY = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
- skinMarginX = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
+ skinMarginY = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
+ skinMarginX = item->IGNORED ? 0 : (item->MARGIN_LEFT + item->MARGIN_RIGHT);
- newWidth = (float)(avatar_size - 2) - skinMarginX;
+ newWidth = (float)(avatar_size - 2) - skinMarginX;
dScale = (float)(avatar_size - 2) / (float)bmWidth;
newHeight = (float)(bmHeight * dScale) - skinMarginY;
}
topoffset = rowHeight > (int)newHeight ? (rowHeight - (int)newHeight) / 2 : 0;
- if (!item->IGNORED) {
- //topoffset += item->MARGIN_TOP;
- leftoffset = item->MARGIN_LEFT;
- }
+ if (!item->IGNORED) {
+ //topoffset += item->MARGIN_TOP;
+ leftoffset = item->MARGIN_LEFT;
+ }
// create the region for the avatar border - use the same region for clipping, if needed.
av_saved_left = rc->left;
@@ -353,30 +342,22 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac
else
rgn = CreateRectRgn(leftoffset + rc->left, y + topoffset, leftoffset + rc->left + (int)newWidth, y + topoffset + (int)newHeight);
- hbmOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcAV, hbm));
- bf.SourceConstantAlpha = 255; //(g_CluiData.dwFlags & CLUI_FRAME_TRANSPARENTAVATAR && (UCHAR)saved_alpha > 20) ? (UCHAR)saved_alpha : 255;
- bf.AlphaFormat = contact->ace->dwFlags & AVS_PREMULTIPLIED ? AC_SRC_ALPHA : 0;
-
- /*
- if (dat->showIdle && contact->flags & CONTACTF_IDLE)
- bf.SourceConstantAlpha -= (bf.SourceConstantAlpha > 100 ? 50 : 0);
- */
-
- SelectClipRgn(hdcMem, rgn);
- SetStretchBltMode(hdcMem, HALFTONE);
- if (bf.SourceConstantAlpha == 255 && bf.AlphaFormat == 0) {
- StretchBlt(hdcMem, leftoffset + rc->left - (g_RTL ? 1 : 0), y + topoffset, (int)newWidth, (int)newHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, SRCCOPY);
- }
- else {
- /*
- * get around SUCKY AlphaBlend() rescaling quality...
- */
- SetStretchBltMode(hdcTempAV, HALFTONE);
- StretchBlt(hdcTempAV, 0, 0, bmWidth, bmHeight, hdcMem, leftoffset + rc->left, y + topoffset, (int)newWidth, (int)newHeight, SRCCOPY);
- API::pfnAlphaBlend(hdcTempAV, 0, 0, bmWidth, bmHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, bf);
- StretchBlt(hdcMem, leftoffset + rc->left - (g_RTL ? 1 : 0), y + topoffset, (int)newWidth, (int)newHeight, hdcTempAV, 0, 0, bmWidth, bmHeight, SRCCOPY);
- }
- SelectObject(hdcAV, hbmOldAV);
+ hbmOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcAV, hbm));
+ bf.SourceConstantAlpha = 255; //(g_CluiData.dwFlags & CLUI_FRAME_TRANSPARENTAVATAR && (UCHAR)saved_alpha > 20) ? (UCHAR)saved_alpha : 255;
+ bf.AlphaFormat = contact->ace->dwFlags & AVS_PREMULTIPLIED ? AC_SRC_ALPHA : 0;
+
+ SelectClipRgn(hdcMem, rgn);
+ SetStretchBltMode(hdcMem, HALFTONE);
+ if (bf.SourceConstantAlpha == 255 && bf.AlphaFormat == 0) {
+ StretchBlt(hdcMem, leftoffset + rc->left - (g_RTL ? 1 : 0), y + topoffset, (int)newWidth, (int)newHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, SRCCOPY);
+ }
+ else {
+ SetStretchBltMode(hdcTempAV, HALFTONE);
+ StretchBlt(hdcTempAV, 0, 0, bmWidth, bmHeight, hdcMem, leftoffset + rc->left, y + topoffset, (int)newWidth, (int)newHeight, SRCCOPY);
+ API::pfnAlphaBlend(hdcTempAV, 0, 0, bmWidth, bmHeight, hdcAvatar, 0, 0, bmWidth, bmHeight, bf);
+ StretchBlt(hdcMem, leftoffset + rc->left - (g_RTL ? 1 : 0), y + topoffset, (int)newWidth, (int)newHeight, hdcTempAV, 0, 0, bmWidth, bmHeight, SRCCOPY);
+ }
+ SelectObject(hdcAV, hbmOldAV);
if (cfg::dat.dwFlags & CLUI_FRAME_AVATARBORDER) {
if (g_RTL)
@@ -384,54 +365,54 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, struct ClcContact *contac
FrameRgn(hdcMem, rgn, cfg::dat.hBrushAvatarBorder, 1, 1);
}
- if (fOverlay)
- fOverlay = (dwFlags & ECF_HIDEOVERLAY) ? 0 : 1;
- else
- fOverlay = (dwFlags & ECF_FORCEOVERLAY) ? 1 : 0;
+ if (fOverlay)
+ fOverlay = (dwFlags & ECF_HIDEOVERLAY) ? 0 : 1;
+ else
+ fOverlay = (dwFlags & ECF_FORCEOVERLAY) ? 1 : 0;
- if (fOverlay && cstatus && (int)newHeight >= g_cysmIcon)
+ if (fOverlay && cstatus && (int)newHeight >= g_cysmIcon)
DrawIconEx(hdcMem, rc->left + (int)newWidth - 15, y + topoffset + (int)newHeight - 15, overlayicons[cstatus - ID_STATUS_OFFLINE], g_cxsmIcon, g_cysmIcon, 0, 0, DI_NORMAL | DI_COMPAT);
SelectClipRgn(hdcMem, NULL);
DeleteObject(rgn);
- if (!item->IGNORED) {
- RECT rcFrame;
- BOOL inClCPaint_save = g_inCLCpaint;
- HDC hdcTemp = 0, hdcSaved = 0;
- HBITMAP hbmOld, hbmTemp;
-
- g_inCLCpaint = FALSE;
- rcFrame.left = rc->left;
- rcFrame.top = y + topoffset - item->MARGIN_TOP;
- rcFrame.right = rcFrame.left + (int)newWidth + item->MARGIN_RIGHT + item->MARGIN_LEFT;
- rcFrame.bottom = rcFrame.top + (int)newHeight + item->MARGIN_BOTTOM + item->MARGIN_TOP;
- if (g_RTL) {
- RECT rcTemp;
-
- OffsetRect(&rcFrame, 1, 0);
- rcTemp.left = rcTemp.top = 0;
- rcTemp.right = rcFrame.right - rcFrame.left;
- rcTemp.bottom = rcFrame.bottom - rcFrame.top;
- hdcTemp = CreateCompatibleDC(g_HDC);
- hbmTemp = CreateCompatibleBitmap(g_HDC, rcTemp.right, rcTemp.bottom);
- hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcTemp, hbmTemp));
- API::pfnSetLayout(hdcTemp, LAYOUT_RTL);
- BitBlt(hdcTemp, 0, 0, rcTemp.right, rcTemp.bottom,
- hdcMem, rcFrame.left, rcFrame.top, SRCCOPY);
- API::pfnSetLayout(hdcTemp, 0);
- DrawAlpha(hdcTemp, &rcTemp, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
- item->CORNER, item->BORDERSTYLE, item->imageItem);
- BitBlt(hdcMem, rcFrame.left, rcFrame.top, rcFrame.right - rcFrame.left, rcFrame.bottom - rcFrame.top,
- hdcTemp, 0, 0, SRCCOPY);
- SelectObject(hdcTemp, hbmOld);
- DeleteObject(hbmTemp);
- DeleteDC(hdcTemp);
- } else
- DrawAlpha(hdcMem, &rcFrame, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
- item->CORNER, item->BORDERSTYLE, item->imageItem);
- g_inCLCpaint = inClCPaint_save;
- }
+ if (!item->IGNORED) {
+ RECT rcFrame;
+ BOOL inClCPaint_save = g_inCLCpaint;
+ HDC hdcTemp = 0, hdcSaved = 0;
+ HBITMAP hbmOld, hbmTemp;
+
+ g_inCLCpaint = FALSE;
+ rcFrame.left = rc->left;
+ rcFrame.top = y + topoffset - item->MARGIN_TOP;
+ rcFrame.right = rcFrame.left + (int)newWidth + item->MARGIN_RIGHT + item->MARGIN_LEFT;
+ rcFrame.bottom = rcFrame.top + (int)newHeight + item->MARGIN_BOTTOM + item->MARGIN_TOP;
+ if (g_RTL) {
+ RECT rcTemp;
+
+ OffsetRect(&rcFrame, 1, 0);
+ rcTemp.left = rcTemp.top = 0;
+ rcTemp.right = rcFrame.right - rcFrame.left;
+ rcTemp.bottom = rcFrame.bottom - rcFrame.top;
+ hdcTemp = CreateCompatibleDC(g_HDC);
+ hbmTemp = CreateCompatibleBitmap(g_HDC, rcTemp.right, rcTemp.bottom);
+ hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcTemp, hbmTemp));
+ API::pfnSetLayout(hdcTemp, LAYOUT_RTL);
+ BitBlt(hdcTemp, 0, 0, rcTemp.right, rcTemp.bottom,
+ hdcMem, rcFrame.left, rcFrame.top, SRCCOPY);
+ API::pfnSetLayout(hdcTemp, 0);
+ DrawAlpha(hdcTemp, &rcTemp, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
+ item->CORNER, item->BORDERSTYLE, item->imageItem);
+ BitBlt(hdcMem, rcFrame.left, rcFrame.top, rcFrame.right - rcFrame.left, rcFrame.bottom - rcFrame.top,
+ hdcTemp, 0, 0, SRCCOPY);
+ SelectObject(hdcTemp, hbmOld);
+ DeleteObject(hbmTemp);
+ DeleteDC(hdcTemp);
+ } else
+ DrawAlpha(hdcMem, &rcFrame, item->COLOR, item->ALPHA, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT,
+ item->CORNER, item->BORDERSTYLE, item->imageItem);
+ g_inCLCpaint = inClCPaint_save;
+ }
contact->avatarLeft = rc->left;
avatar_done = TRUE;
rc->left = av_saved_left;
@@ -449,7 +430,7 @@ static BOOL mirror_rtl, mirror_always, mirror_rtltext;
BYTE savedCORNER = -1;
int g_padding_y = 0;
-void __inline PaintItem(HDC hdcMem, ClcGroup *group, struct ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight)
+void __inline PaintItem(HDC hdcMem, ClcGroup *group, ClcContact *contact, int indent, int y, struct ClcData *dat, int index, HWND hwnd, DWORD style, RECT *clRect, BOOL *bFirstNGdrawn, int groupCountsFontTopShift, int rowHeight)
{
RECT rc;
int iImage = -1;
@@ -486,7 +467,7 @@ void __inline PaintItem(HDC hdcMem, ClcGroup *group, struct ClcContact *contact,
g_RTL = FALSE;
scanIndex = group->scanIndex;
- av_local_wanted = (g_list_avatars > 0);
+ av_local_wanted = (g_list_avatars > 0);
type = contact->type;
flags = contact->flags;
@@ -498,10 +479,10 @@ void __inline PaintItem(HDC hdcMem, ClcGroup *group, struct ClcContact *contact,
cEntry = cfg::eCache;
- if (dat->bisEmbedded)
- goto set_bg_l;
+ if (dat->bisEmbedded)
+ goto set_bg_l;
- if (type == CLCIT_CONTACT && (cEntry->dwCFlags & ECF_RTLNICK || mirror_always)) {
+ if (type == CLCIT_CONTACT && (cEntry->dwCFlags & ECF_RTLNICK || mirror_always)) {
if (API::pfnSetLayout != NULL && (mirror_rtl || mirror_always)) {
g_RTL = TRUE;
bg_indent_r = cfg::dat.bApplyIndentToBg ? indent * dat->groupIndent : 0;
@@ -542,9 +523,9 @@ set_bg_l:
else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
} else if (type == CLCIT_DIVIDER) {
- ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight);
- GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
- }
+ ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight);
+ GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
+ }
else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST)
ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight);
else if (type == CLCIT_CONTACT && ((flags & CONTACTF_INVISTO && GetRealStatus(contact, my_status) != ID_STATUS_INVISIBLE) || (flags & CONTACTF_VISTO && GetRealStatus(contact, my_status) == ID_STATUS_INVISIBLE))) {
@@ -556,9 +537,9 @@ set_bg_l:
else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- if (type == CLCIT_GROUP) {
- GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
- width = textSize.cx;
+ if (type == CLCIT_GROUP) {
+ GetTextExtentPoint32(hdcMem, contact->szText, lstrlen(contact->szText), &textSize);
+ width = textSize.cx;
szCounts = pcli->pfnGetGroupCountsText(dat, contact);
if (szCounts[0]) {
GetTextExtentPoint32(hdcMem, _T(" "), 1, &spaceSize);
@@ -581,22 +562,22 @@ set_bg_l:
g_hottrack_done = 0;
check_selected = (!selected || selBlend);
- if (dat->bisEmbedded) {
- rc.left = bg_indent_l;
- rc.top = y;
- rc.right = clRect->right - bg_indent_r;
- rc.bottom = y + rowHeight;
- if (selected) {
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
- SetTextColor(hdcMem, dat->selTextColour);
- }
- else {
- FillRect(hdcMem, &rc, cfg::dat.hBrushCLCBk);
- if (g_hottrack)
- SetHotTrackColour(hdcMem,dat);
- }
- goto bgskipped;
- }
+ if (dat->bisEmbedded) {
+ rc.left = bg_indent_l;
+ rc.top = y;
+ rc.right = clRect->right - bg_indent_r;
+ rc.bottom = y + rowHeight;
+ if (selected) {
+ FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
+ SetTextColor(hdcMem, dat->selTextColour);
+ }
+ else {
+ FillRect(hdcMem, &rc, cfg::dat.hBrushCLCBk);
+ if (g_hottrack)
+ SetHotTrackColour(hdcMem,dat);
+ }
+ goto bgskipped;
+ }
if (type == CLCIT_CONTACT || type == CLCIT_DIVIDER) {
StatusItems_t *sitem, *sfirstitem, *ssingleitem, *slastitem, *slastitem_NG,
@@ -605,25 +586,25 @@ set_bg_l:
if (cstatus >= ID_STATUS_OFFLINE && cstatus <= ID_STATUS_OUTTOLUNCH) {
BYTE perstatus_ignored;
- if ((flags & CONTACTF_IDLE) && !StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE].IGNORED)
- sitem = &StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE];
- else
- sitem = &StatusItems[cstatus - ID_STATUS_OFFLINE];
+ if ((flags & CONTACTF_IDLE) && !StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE].IGNORED)
+ sitem = &StatusItems[ID_EXTBKIDLE - ID_STATUS_OFFLINE];
+ else
+ sitem = &StatusItems[cstatus - ID_STATUS_OFFLINE];
- if (!dat->bisEmbedded) {
- pp_item = cEntry->status_item ? cEntry->status_item : cEntry->proto_status_item;
+ if (!dat->bisEmbedded) {
+ pp_item = cEntry->status_item ? cEntry->status_item : cEntry->proto_status_item;
- if (!(perstatus_ignored = sitem->IGNORED) && !(flags & CONTACTF_NOTONLIST))
- SetTextColor(hdcMem, sitem->TEXTCOLOR);
+ if (!(perstatus_ignored = sitem->IGNORED) && !(flags & CONTACTF_NOTONLIST))
+ SetTextColor(hdcMem, sitem->TEXTCOLOR);
- if (cfg::dat.bUsePerProto && pp_item && !pp_item->IGNORED) {
- sitem = pp_item;
- if ((perstatus_ignored || cfg::dat.bOverridePerStatusColors) && sitem->TEXTCOLOR != -1)
- SetTextColor(hdcMem, sitem->TEXTCOLOR);
- }
- }
- else if (!sitem->IGNORED)
- SetTextColor(hdcMem, sitem->TEXTCOLOR);
+ if (cfg::dat.bUsePerProto && pp_item && !pp_item->IGNORED) {
+ sitem = pp_item;
+ if ((perstatus_ignored || cfg::dat.bOverridePerStatusColors) && sitem->TEXTCOLOR != -1)
+ SetTextColor(hdcMem, sitem->TEXTCOLOR);
+ }
+ }
+ else if (!sitem->IGNORED)
+ SetTextColor(hdcMem, sitem->TEXTCOLOR);
sevencontact_pos = &StatusItems[ID_EXTBKEVEN_CNTCTPOS - ID_STATUS_OFFLINE];
soddcontact_pos = &StatusItems[ID_EXTBKODD_CNTCTPOS - ID_STATUS_OFFLINE];
@@ -692,7 +673,7 @@ set_bg_l:
rc.top = y + slastitem->MARGIN_TOP;
rc.right = clRect->right - slastitem->MARGIN_RIGHT - bg_indent_r;
rc.bottom = y + rowHeight - slastitem->MARGIN_BOTTOM;
- rc.bottom = y + rowHeight - slastitem->MARGIN_BOTTOM;
+ rc.bottom = y + rowHeight - slastitem->MARGIN_BOTTOM;
// draw odd/even contact underlay
if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
@@ -738,71 +719,71 @@ set_bg_l:
}
if (check_selected)
DrawAlpha(hdcMem, &rc, sfirstitem_NG->COLOR, sfirstitem_NG->ALPHA, sfirstitem_NG->COLOR2, sfirstitem_NG->COLOR2_TRANSPARENT, sfirstitem_NG->GRADIENT, sfirstitem_NG->CORNER, sfirstitem->BORDERSTYLE, sfirstitem->imageItem);
- } else if (type != CLCIT_GROUP // not a group
- && group->parent == NULL && !slastitem_NG->IGNORED && scanIndex == group->cl.count - 1 && (*bFirstNGdrawn)) {
- // last item of list (NON-group)
- // last NON-grouped
- rc.left = slastitem_NG->MARGIN_LEFT + bg_indent_l;
- rc.top = y + slastitem_NG->MARGIN_TOP;
- rc.right = clRect->right - slastitem_NG->MARGIN_RIGHT - bg_indent_r;
- rc.bottom = y + rowHeight - slastitem_NG->MARGIN_BOTTOM;
-
- // draw odd/even contact underlay
- if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, slastitem_NG->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
- } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, slastitem_NG->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
- }
-
- if (!sitem->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, slastitem_NG->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
- savedCORNER = slastitem_NG->CORNER;
- }
+ } else if (type != CLCIT_GROUP // not a group
+ && group->parent == NULL && !slastitem_NG->IGNORED && scanIndex == group->cl.count - 1 && (*bFirstNGdrawn)) {
+ // last item of list (NON-group)
+ // last NON-grouped
+ rc.left = slastitem_NG->MARGIN_LEFT + bg_indent_l;
+ rc.top = y + slastitem_NG->MARGIN_TOP;
+ rc.right = clRect->right - slastitem_NG->MARGIN_RIGHT - bg_indent_r;
+ rc.bottom = y + rowHeight - slastitem_NG->MARGIN_BOTTOM;
+
+ // draw odd/even contact underlay
+ if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, slastitem_NG->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
+ } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, slastitem_NG->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
+ }
+
+ if (!sitem->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, slastitem_NG->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
+ savedCORNER = slastitem_NG->CORNER;
+ }
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, slastitem_NG->COLOR, slastitem_NG->ALPHA, slastitem_NG->COLOR2, slastitem_NG->COLOR2_TRANSPARENT, slastitem_NG->GRADIENT, slastitem_NG->CORNER, slastitem->BORDERSTYLE, slastitem->imageItem);
+ } else if (type != CLCIT_GROUP // not a group
+ && group->parent == NULL && !slastitem_NG->IGNORED && !(*bFirstNGdrawn)) {
+ // single item of NON-group
+ // single NON-grouped
+ rc.left = ssingleitem_NG->MARGIN_LEFT + bg_indent_l;
+ rc.top = y + ssingleitem_NG->MARGIN_TOP;
+ rc.right = clRect->right - ssingleitem_NG->MARGIN_RIGHT - bg_indent_r;
+ rc.bottom = y + rowHeight - ssingleitem_NG->MARGIN_BOTTOM;
+
+ // draw odd/even contact underlay
+ if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, ssingleitem_NG->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
+ } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, ssingleitem_NG->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
+ }
+
+ if (!sitem->IGNORED) {
if (check_selected)
- DrawAlpha(hdcMem, &rc, slastitem_NG->COLOR, slastitem_NG->ALPHA, slastitem_NG->COLOR2, slastitem_NG->COLOR2_TRANSPARENT, slastitem_NG->GRADIENT, slastitem_NG->CORNER, slastitem->BORDERSTYLE, slastitem->imageItem);
- } else if (type != CLCIT_GROUP // not a group
- && group->parent == NULL && !slastitem_NG->IGNORED && !(*bFirstNGdrawn)) {
- // single item of NON-group
- // single NON-grouped
- rc.left = ssingleitem_NG->MARGIN_LEFT + bg_indent_l;
- rc.top = y + ssingleitem_NG->MARGIN_TOP;
- rc.right = clRect->right - ssingleitem_NG->MARGIN_RIGHT - bg_indent_r;
- rc.bottom = y + rowHeight - ssingleitem_NG->MARGIN_BOTTOM;
-
- // draw odd/even contact underlay
- if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, ssingleitem_NG->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
- } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, ssingleitem_NG->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
- }
-
- if (!sitem->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, ssingleitem_NG->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
- savedCORNER = ssingleitem_NG->CORNER;
- }
- if (check_selected)
- DrawAlpha(hdcMem, &rc, ssingleitem_NG->COLOR, ssingleitem_NG->ALPHA, ssingleitem_NG->COLOR2, ssingleitem_NG->COLOR2_TRANSPARENT, ssingleitem_NG->GRADIENT, ssingleitem_NG->CORNER, ssingleitem->BORDERSTYLE, ssingleitem->imageItem);
- } else if (!sitem->IGNORED) {
- // draw default grouped
- // draw odd/even contact underlay
- if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, sitem->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
- } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
- if (check_selected)
- DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, sitem->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
- }
-
- if (check_selected)
- DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, sitem->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
- savedCORNER = sitem->CORNER;
- }
+ DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, ssingleitem_NG->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
+ savedCORNER = ssingleitem_NG->CORNER;
+ }
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, ssingleitem_NG->COLOR, ssingleitem_NG->ALPHA, ssingleitem_NG->COLOR2, ssingleitem_NG->COLOR2_TRANSPARENT, ssingleitem_NG->GRADIENT, ssingleitem_NG->CORNER, ssingleitem->BORDERSTYLE, ssingleitem->imageItem);
+ } else if (!sitem->IGNORED) {
+ // draw default grouped
+ // draw odd/even contact underlay
+ if ((scanIndex == 0 || scanIndex % 2 == 0) && !sevencontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sevencontact_pos->COLOR, sevencontact_pos->ALPHA, sevencontact_pos->COLOR2, sevencontact_pos->COLOR2_TRANSPARENT, sevencontact_pos->GRADIENT, sitem->CORNER, sevencontact_pos->BORDERSTYLE, sevencontact_pos->imageItem);
+ } else if (scanIndex % 2 != 0 && !soddcontact_pos->IGNORED) {
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, soddcontact_pos->COLOR, soddcontact_pos->ALPHA, soddcontact_pos->COLOR2, soddcontact_pos->COLOR2_TRANSPARENT, soddcontact_pos->GRADIENT, sitem->CORNER, soddcontact_pos->BORDERSTYLE, soddcontact_pos->imageItem);
+ }
+
+ if (check_selected)
+ DrawAlpha(hdcMem, &rc, sitem->COLOR, sitem->ALPHA, sitem->COLOR2, sitem->COLOR2_TRANSPARENT, sitem->GRADIENT, sitem->CORNER, sitem->BORDERSTYLE, sitem->imageItem);
+ savedCORNER = sitem->CORNER;
+ }
}
}
if (type == CLCIT_GROUP) {
@@ -849,38 +830,38 @@ set_bg_l:
if (!g_ignoreselforgroups || type != CLCIT_GROUP) {
if (!sselected->IGNORED) {
- rc.left = sselected->MARGIN_LEFT + bg_indent_l;
- rc.top = y + sselected->MARGIN_TOP;
- rc.right = clRect->right - sselected->MARGIN_RIGHT - bg_indent_r;
- rc.bottom = y + rowHeight - sselected->MARGIN_BOTTOM;
+ rc.left = sselected->MARGIN_LEFT + bg_indent_l;
+ rc.top = y + sselected->MARGIN_TOP;
+ rc.right = clRect->right - sselected->MARGIN_RIGHT - bg_indent_r;
+ rc.bottom = y + rowHeight - sselected->MARGIN_BOTTOM;
if (cfg::getByte("CLCExt", "EXBK_EqualSelection", 0) == 1 && savedCORNER != -1) {
DrawAlpha(hdcMem, &rc, sselected->COLOR, sselected->ALPHA, sselected->COLOR2, sselected->COLOR2_TRANSPARENT, sselected->GRADIENT, savedCORNER, sselected->BORDERSTYLE, sselected->imageItem);
} else {
DrawAlpha(hdcMem, &rc, sselected->COLOR, sselected->ALPHA, sselected->COLOR2, sselected->COLOR2_TRANSPARENT, sselected->GRADIENT, sselected->CORNER, sselected->BORDERSTYLE, sselected->imageItem);
}
- SetTextColor(hdcMem, sselected->TEXTCOLOR);
+ SetTextColor(hdcMem, sselected->TEXTCOLOR);
}
else {
- rc.left = bg_indent_l;
- rc.top = y;
- rc.right = clRect->right - bg_indent_r;
- rc.bottom = y + rowHeight;
- FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
- SetTextColor(hdcMem, dat->selTextColour);
- }
+ rc.left = bg_indent_l;
+ rc.top = y;
+ rc.right = clRect->right - bg_indent_r;
+ rc.bottom = y + rowHeight;
+ FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
+ SetTextColor(hdcMem, dat->selTextColour);
+ }
}
}
else if (g_hottrack) {
- StatusItems_t *ht = &StatusItems[ID_EXTBKHOTTRACK - ID_STATUS_OFFLINE];
+ StatusItems_t *ht = &StatusItems[ID_EXTBKHOTTRACK - ID_STATUS_OFFLINE];
- SetHotTrackColour(hdcMem,dat);
- if (ht->IGNORED == 0)
- SetTextColor(hdcMem, ht->TEXTCOLOR);
+ SetHotTrackColour(hdcMem,dat);
+ if (ht->IGNORED == 0)
+ SetTextColor(hdcMem, ht->TEXTCOLOR);
if (!g_hottrack_done) {
- if (ht->IGNORED == 0) {
- DrawAlpha(hdcMem, &rc, ht->COLOR, ht->ALPHA, ht->COLOR2, ht->COLOR2_TRANSPARENT, ht->GRADIENT,
- ht->CORNER, ht->BORDERSTYLE, ht->imageItem);
- }
+ if (ht->IGNORED == 0) {
+ DrawAlpha(hdcMem, &rc, ht->COLOR, ht->ALPHA, ht->COLOR2, ht->COLOR2_TRANSPARENT, ht->GRADIENT,
+ ht->CORNER, ht->BORDERSTYLE, ht->imageItem);
+ }
}
}
@@ -888,13 +869,13 @@ set_bg_l:
API::pfnSetLayout(hdcMem, LAYOUT_RTL | LAYOUT_BITMAPORIENTATIONPRESERVED);
bgskipped:
- rcContent.top = y + g_padding_y;
- rcContent.bottom = y + rowHeight - (2 * g_padding_y);
- rcContent.left = leftX;
- rcContent.right = clRect->right - dat->rightMargin;
+ rcContent.top = y + g_padding_y;
+ rcContent.bottom = y + rowHeight - (2 * g_padding_y);
+ rcContent.left = leftX;
+ rcContent.right = clRect->right - dat->rightMargin;
twoRows = ((dat->fontInfo[FONTID_STATUS].fontHeight + fontHeight <= rowHeight + 1) && (contact->bSecondLine != MULTIROW_NEVER)) && !dat->bisEmbedded;
- pi_avatar = !dat->bisEmbedded && type == CLCIT_CONTACT && (contact->cFlags & ECF_AVATAR) && contact->ace != 0 && !(contact->ace->dwFlags & AVS_HIDEONCLIST);
+ pi_avatar = !dat->bisEmbedded && type == CLCIT_CONTACT && (contact->cFlags & ECF_AVATAR) && contact->ace != 0 && !(contact->ace->dwFlags & AVS_HIDEONCLIST);
//checkboxes
if (checkboxWidth) {
@@ -966,20 +947,11 @@ bgskipped:
pi_selectiveIcon = g_selectiveIcon && (type == CLCIT_CONTACT);
if ((dwFlags & CLUI_FRAME_STATUSICONS && !pi_selectiveIcon) || type != CLCIT_CONTACT || (pi_selectiveIcon && !avatar_done)) {
- HIMAGELIST hImgList = 0;
- if (!dat->bisEmbedded && type == CLCIT_CONTACT && cEntry && (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS) && cEntry->iExtraImage[EXTRA_ICON_ADV1] != 0xff) {
- if (pcli->pfnIconFromStatusMode(contact->proto, contact->wStatus, contact->hContact) == iImage) {
- hImgList = dat->himlExtraColumns;
- iImage = cEntry->iExtraImage[EXTRA_ICON_ADV1];
- }
- else hImgList = hCListImages;
- }
- else
- hImgList = hCListImages;
-
- if (g_hottrack) {
+ HIMAGELIST hImgList = hCListImages;
+
+ if (g_hottrack)
colourFg = dat->hotTextColour;
- } else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST) {
+ else if (type == CLCIT_CONTACT && flags & CONTACTF_NOTONLIST) {
colourFg = dat->fontInfo[FONTID_NOTONLIST].colour;
mode = ILD_BLEND50;
}
@@ -1004,46 +976,45 @@ bgskipped:
if (type == CLCIT_CONTACT && !dat->bisEmbedded) {
BYTE bApparentModeDontCare = !((flags & CONTACTF_VISTO) ^ (flags & CONTACTF_INVISTO));
contact->extraIconRightBegin = 0;
- if (cEntry && (contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry && cEntry->iExtraValid)) {
- int i, iIndex, id;
- DWORD dwOldMask = cEntry->dwXMask;
- if (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS)
- cEntry->dwXMask &= ~EIMG_SHOW_ADV1;
+ if (cEntry && (contact->extraCacheEntry >= 0 && contact->extraCacheEntry < cfg::nextCacheEntry && cEntry->iExtraValid)) {
+ int i, iIndex;
+ DWORD dwOldMask = cEntry->dwXMask;
+ if (dwFlags & CLUI_FRAME_USEXSTATUSASSTATUS)
+ cEntry->dwXMask &= ~EIMG_SHOW_ADV1;
for (i = EXICON_COUNT - 1; i >= 0; i--) {
- iIndex = cfg::dat.exIconOrder[i] - 1;
- if (iIndex >= 0 && iIndex < EXICON_COUNT) {
- id = OrderTreeData[iIndex].ID;
- if (cEntry->iExtraImage[id] != 0xff && ((1 << id) & cEntry->dwXMask)) {
- if (contact->extraIconRightBegin == 0 && i != (EXICON_COUNT - 1))
- contact->extraIconRightBegin = rcContent.right;
- ImageList_DrawEx(dat->himlExtraColumns, cEntry->iExtraImage[id], hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
- 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
- rcContent.right -= g_exIconSpacing;
- rightIcons++;
- }
- }
+ iIndex = cfg::dat.exIconOrder[i] - 1;
+ if (iIndex >= 0 && iIndex < EXICON_COUNT) {
+ if (cEntry->iExtraImage[i] != 0xffff && ((1 << i) & cEntry->dwXMask)) {
+ if (contact->extraIconRightBegin == 0 && i != (EXICON_COUNT - 1))
+ contact->extraIconRightBegin = rcContent.right;
+ ImageList_DrawEx(dat->himlExtraColumns, cEntry->iExtraImage[i], hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
+ 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
+ rcContent.right -= g_exIconSpacing;
+ rightIcons++;
+ }
+ }
}
- cEntry->dwXMask = dwOldMask;
+ cEntry->dwXMask = dwOldMask;
}
if (!bApparentModeDontCare && (dwFlags & CLUI_SHOWVISI) && contact->proto) {
- BOOL fVisi;
-
- if (dwFlags & CLUI_SHOWVISI)
- fVisi = cEntry->dwDFlags & ECF_HIDEVISIBILITY ? 0 : 1;
- else
- fVisi = cEntry->dwDFlags & ECF_FORCEVISIBILITY ? 1 : 0;
-
- if (fVisi) {
- if (cEntry->isChatRoom)
- DrawIconEx(hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
- cfg::dat.hIconChatactive, cfg::dat.exIconScale, cfg::dat.exIconScale, 0, 0, DI_NORMAL | DI_COMPAT);
- else
- DrawIconEx(hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
- flags & CONTACTF_VISTO ? cfg::dat.hIconVisible : cfg::dat.hIconInvisible, cfg::dat.exIconScale, cfg::dat.exIconScale, 0, 0, DI_NORMAL | DI_COMPAT);
- rcContent.right -= g_exIconSpacing;
- rightIcons++;
- }
+ BOOL fVisi;
+
+ if (dwFlags & CLUI_SHOWVISI)
+ fVisi = cEntry->dwDFlags & ECF_HIDEVISIBILITY ? 0 : 1;
+ else
+ fVisi = cEntry->dwDFlags & ECF_FORCEVISIBILITY ? 1 : 0;
+
+ if (fVisi) {
+ if (cEntry->isChatRoom)
+ DrawIconEx(hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
+ cfg::dat.hIconChatactive, cfg::dat.exIconScale, cfg::dat.exIconScale, 0, 0, DI_NORMAL | DI_COMPAT);
+ else
+ DrawIconEx(hdcMem, rcContent.right - cfg::dat.exIconScale, twoRows ? rcContent.bottom - g_exIconSpacing : y + ((rowHeight - cfg::dat.exIconScale) >> 1),
+ flags & CONTACTF_VISTO ? cfg::dat.hIconVisible : cfg::dat.hIconInvisible, cfg::dat.exIconScale, cfg::dat.exIconScale, 0, 0, DI_NORMAL | DI_COMPAT);
+ rcContent.right -= g_exIconSpacing;
+ rightIcons++;
+ }
}
}
}
@@ -1173,9 +1144,9 @@ text:
// nickname
if (!twoRows) {
if (dt_nickflags)
- DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE | dt_nickflags);
+ DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE | dt_nickflags);
else
- DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
+ DrawText(hdcMem, szText, -1, &rcContent, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
}
else {
int statusFontHeight;
@@ -1185,10 +1156,10 @@ text:
rcContent.top = y + cfg::dat.avatarPadding / 2;
- if (cfg::dat.bShowLocalTime)
- fLocalTime = cEntry->dwDFlags & ECF_HIDELOCALTIME ? 0 : 1;
- else
- fLocalTime = cEntry->dwDFlags & ECF_FORCELOCALTIME ? 1 : 0;
+ if (cfg::dat.bShowLocalTime)
+ fLocalTime = cEntry->dwDFlags & ECF_HIDELOCALTIME ? 0 : 1;
+ else
+ fLocalTime = cEntry->dwDFlags & ECF_FORCELOCALTIME ? 1 : 0;
if (cEntry->hTimeZone && fLocalTime) {
int idOldFont;
@@ -1479,43 +1450,43 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint)
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) {
+ 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 = bmp.bmWidth;
- desth = clRect.bottom;
+ destw = clRect.right;
+ desth = destw * bmp.bmHeight / bmp.bmWidth;
}
- break;
- default:
- //clb_topleft
- destw = 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;
+ }
+ 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;
}
bitx = 0;
@@ -1539,37 +1510,37 @@ bgdone:
if ( dat->row_heights == NULL )
RowHeight::calcRowHeights(dat, hwnd);
- group = &dat->list;
- group->scanIndex = 0;
-
- g_list_avatars = 0;
- while(TRUE)
- {
- if (group->scanIndex==group->cl.count)
- {
- group=group->parent;
- if (group==NULL) break; // Finished list
- group->scanIndex++;
- continue;
- }
-
- if (group->cl.items[group->scanIndex]->cFlags & ECF_AVATAR)
- g_list_avatars++;
-
- if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
- group=group->cl.items[group->scanIndex]->group;
- group->scanIndex=0;
- continue;
- }
- group->scanIndex++;
- }
- g_selectiveIcon = (g_list_avatars > 0) && (cfg::dat.dwFlags & CLUI_FRAME_SELECTIVEICONS) && !dat->bisEmbedded;
-
- group = &dat->list;
- group->scanIndex = 0;
- indent = 0;
-
- for (index = 0; y< rcPaint->bottom;) {
+ group = &dat->list;
+ group->scanIndex = 0;
+
+ g_list_avatars = 0;
+ while(TRUE)
+ {
+ if (group->scanIndex==group->cl.count)
+ {
+ group=group->parent;
+ if (group==NULL) break; // Finished list
+ group->scanIndex++;
+ continue;
+ }
+
+ if (group->cl.items[group->scanIndex]->cFlags & ECF_AVATAR)
+ g_list_avatars++;
+
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
+ group=group->cl.items[group->scanIndex]->group;
+ group->scanIndex=0;
+ continue;
+ }
+ group->scanIndex++;
+ }
+ g_selectiveIcon = (g_list_avatars > 0) && (cfg::dat.dwFlags & CLUI_FRAME_SELECTIVEICONS) && !dat->bisEmbedded;
+
+ group = &dat->list;
+ group->scanIndex = 0;
+ indent = 0;
+
+ for (index = 0; y< rcPaint->bottom;) {
if (group->scanIndex == group->cl.count) {
group = group->parent;
indent--;
@@ -1585,8 +1556,8 @@ bgdone:
group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry*)-1;
if (y > rcPaint->top - dat->row_heights[line_num] && y <= rcPaint->bottom) {
- if (group->cl.items[group->scanIndex]->ace == (struct avatarCacheEntry*)-1 )
- group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)group->cl.items[group->scanIndex]->hContact, 0);
+ if (group->cl.items[group->scanIndex]->ace == (struct avatarCacheEntry*)-1 )
+ group->cl.items[group->scanIndex]->ace = (struct avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)group->cl.items[group->scanIndex]->hContact, 0);
RowHeight::getRowHeight(dat, hwnd, group->cl.items[group->scanIndex], line_num, style);
PaintItem(hdcMem, group, group->cl.items[group->scanIndex], indent, y, dat, index, hwnd, style, &clRect, &bFirstNGdrawn, groupCountsFontTopShift, dat->row_heights[line_num]);
}
@@ -1601,11 +1572,11 @@ bgdone:
group->scanIndex++;
}
- SelectObject(hdcTempAV, hbmTempOldAV);
- DeleteObject(hbmTempAV);
- DeleteDC(hdcTempAV);
+ SelectObject(hdcTempAV, hbmTempOldAV);
+ DeleteObject(hbmTempAV);
+ DeleteDC(hdcTempAV);
- DeleteDC(hdcAV);
+ DeleteDC(hdcAV);
if (dat->iInsertionMark != -1) {
//insertion mark
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp
index 45e9cdb9db..bc0c144f87 100644
--- a/plugins/Clist_nicer/src/clcutils.cpp
+++ b/plugins/Clist_nicer/src/clcutils.cpp
@@ -84,7 +84,7 @@ size_t MY_pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut)
* shares all the init stuff with HitTest()
*/
-int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact *hitcontact, DWORD *flags, int indent, int hit)
+int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact *hitcontact, DWORD *flags, int indent, int hit)
{
RECT clRect;
int right, checkboxWidth, cxSmIcon, i, width;
@@ -188,9 +188,9 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct Clc
return -1;
}
-int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, struct ClcContact **contact, ClcGroup **group, DWORD *flags)
+int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD *flags)
{
- struct ClcContact *hitcontact;
+ ClcContact *hitcontact;
ClcGroup *hitgroup;
int hit, indent, width, i, cxSmIcon;
int checkboxWidth;
@@ -515,7 +515,7 @@ static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
void BeginRenameSelection(HWND hwnd, struct ClcData *dat)
{
- struct ClcContact *contact;
+ ClcContact *contact;
ClcGroup *group;
int indent, x, y, h;
RECT clRect;
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp
index b4abce1084..2078fcc6ed 100644
--- a/plugins/Clist_nicer/src/clistmenus.cpp
+++ b/plugins/Clist_nicer/src/clistmenus.cpp
@@ -65,35 +65,6 @@ static HANDLE hWindowListIGN = 0;
* menu
*/
-static const UINT xImgCtrlIds[] = {
- IDC_EXTRA_ICON_RES0,
- IDC_EXTRA_ICON_EMAIL,
- IDC_EXTRA_ICON_RES1,
- IDC_EXTRA_ICON_SMS,
- IDC_EXTRA_ICON_ADV1,
- IDC_EXTRA_ICON_ADV2,
- IDC_EXTRA_ICON_WEB,
- IDC_EXTRA_ICON_CLIENT,
- IDC_EXTRA_ICON_RES2,
- IDC_EXTRA_ICON_ADV3,
- IDC_EXTRA_ICON_ADV4
-};
-
-// static UINT xImgCtrlBits[] = {6, 4, 0, 1, 2, 3, 5, 7, 8, 9, 10};
-static const UINT xImgCtrlBits[] = {
- EXTRA_ICON_RES0,
- EXTRA_ICON_EMAIL,
- EXTRA_ICON_RES1,
- EXTRA_ICON_SMS,
- EXTRA_ICON_ADV1,
- EXTRA_ICON_ADV2,
- EXTRA_ICON_WEB,
- EXTRA_ICON_CLIENT,
- EXTRA_ICON_RES2,
- EXTRA_ICON_ADV3,
- EXTRA_ICON_ADV4
-};
-
static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HANDLE hContact = (HANDLE)GetWindowLongPtr(hWnd, GWLP_USERDATA);
@@ -102,7 +73,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
case WM_INITDIALOG:
{
DWORD dwMask;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
int pCaps;
HWND hwndAdd;
@@ -188,16 +159,6 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
else
SendDlgItemMessage(hWnd, IDC_SHOWVISIBILITY, BM_SETCHECK, BST_INDETERMINATE, 0);
- while(xImgCtrlIds[i] != 0) {
- if (dwXMask & (1 << (2 * xImgCtrlBits[i])))
- SendDlgItemMessage(hWnd, xImgCtrlIds[i], BM_SETCHECK, BST_CHECKED, 0);
- else if (dwXMask & (1 << (2 * xImgCtrlBits[i] + 1)))
- SendDlgItemMessage(hWnd, xImgCtrlIds[i], BM_SETCHECK, BST_UNCHECKED, 0);
- else
- SendDlgItemMessage(hWnd, xImgCtrlIds[i], BM_SETCHECK, BST_INDETERMINATE, 0);
- i++;
- }
-
if (bSecondLine == 0xff)
SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_SETCURSEL, 0, 0);
else
@@ -248,9 +209,6 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
SendDlgItemMessage(hWnd, IDC_AVATARDISPMODE, CB_SETCURSEL, 0, 0);
SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_SETCURSEL, 0, 0);
- while(xImgCtrlIds[i] != 0)
- SendDlgItemMessage(hWnd, xImgCtrlIds[i++], BM_SETCHECK, BST_INDETERMINATE, 0);
-
SendDlgItemMessage(hWnd, IDC_OVERLAYICON, BM_SETCHECK, BST_INDETERMINATE, 0);
SendDlgItemMessage(hWnd, IDC_LOCALTIME, BM_SETCHECK, BST_INDETERMINATE, 0);
SendDlgItemMessage(hWnd, IDC_SHOWVISIBILITY, BM_SETCHECK, BST_INDETERMINATE, 0);
@@ -259,7 +217,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
case IDOK:
{
DWORD newMask = 0;
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
SendMessage(hWnd, WM_USER + 110, 0, (LPARAM)&newMask);
cfg::writeDword(hContact, "Ignore", "Mask1", newMask);
@@ -318,14 +276,6 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
contact->bSecondLine = (BYTE)(iSel - 1);
}
}
- while(xImgCtrlIds[i] != 0) {
- checked = SendDlgItemMessage(hWnd, xImgCtrlIds[i], BM_GETCHECK, 0, 0);
- if (checked == BST_CHECKED)
- dwXMask |= (1 << (2 * xImgCtrlBits[i]));
- else if (checked == BST_UNCHECKED)
- dwXMask |= (1 << (2 * xImgCtrlBits[i] + 1));
- i++;
- }
cfg::writeDword(hContact, "CList", "CLN_xmask", dwXMask);
if (contact) {
if (contact->extraCacheEntry >= 0 && contact->extraCacheEntry <= cfg::nextCacheEntry) {
@@ -376,7 +326,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
}
case WM_USER + 120: // set visibility status
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
if (contact) {
@@ -390,7 +340,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA
}
case WM_USER + 130: // update apparent mode
{
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
if (FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
if (contact) {
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 1a238e5f9d..98f34ad1a4 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -493,7 +493,7 @@ void SetDBButtonStates(HANDLE hPassedContact)
HANDLE hContact = 0, hFinalContact = 0;
char *szModule, *szSetting;
int sel = cfg::clcdat ? cfg::clcdat->selection : -1;
- struct ClcContact *contact = 0;
+ ClcContact *contact = 0;
if (sel != -1 && hPassedContact == 0) {
sel = pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, NULL);
@@ -1456,7 +1456,7 @@ skipbg:
WPARAM wwParam = 0;
LPARAM llParam = 0;
HANDLE hContact = 0;
- struct ClcContact *contact = 0;
+ ClcContact *contact = 0;
int sel = cfg::clcdat ? cfg::clcdat->selection : -1;
int serviceFailure = FALSE;
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp
index 1cbfeb8190..8ed431ad40 100644
--- a/plugins/Clist_nicer/src/config.cpp
+++ b/plugins/Clist_nicer/src/config.cpp
@@ -204,38 +204,38 @@ INT_PTR cfg::writeString(const HANDLE hContact, const char *szModule = 0, const
int cfg::getCache(const HANDLE hContact, const char *szProto)
{
- int i, iFound = -1;
-
- for (i = 0; i < nextCacheEntry; i++) {
- if (eCache[i].hContact == hContact) {
- iFound = i;
- break;
- }
- }
- if (iFound == -1) {
+ int i, iFound = -1;
+
+ for (i = 0; i < nextCacheEntry; i++) {
+ if (eCache[i].hContact == hContact) {
+ iFound = i;
+ break;
+ }
+ }
+ if (iFound == -1) {
EnterCriticalSection(&cachecs);
- if (nextCacheEntry == maxCacheEntry) {
- maxCacheEntry += 100;
- cfg::eCache = (TExtraCache *)realloc(cfg::eCache, maxCacheEntry * sizeof(TExtraCache));
- }
- memset(&cfg::eCache[nextCacheEntry], 0, sizeof(TExtraCache));
+ if (nextCacheEntry == maxCacheEntry) {
+ maxCacheEntry += 100;
+ cfg::eCache = (TExtraCache *)realloc(cfg::eCache, maxCacheEntry * sizeof(TExtraCache));
+ }
+ memset(&cfg::eCache[nextCacheEntry], 0, sizeof(TExtraCache));
cfg::eCache[nextCacheEntry].hContact = hContact;
- memset(cfg::eCache[nextCacheEntry].iExtraImage, 0xff, MAXEXTRACOLUMNS);
- cfg::eCache[nextCacheEntry].iExtraValid = 0;
- cfg::eCache[nextCacheEntry].valid = FALSE;
- cfg::eCache[nextCacheEntry].bStatusMsgValid = 0;
- cfg::eCache[nextCacheEntry].statusMsg = NULL;
- cfg::eCache[nextCacheEntry].status_item = NULL;
- LoadSkinItemToCache(&cfg::eCache[nextCacheEntry], szProto);
- cfg::eCache[nextCacheEntry].dwCFlags = 0;
- cfg::eCache[nextCacheEntry].dwDFlags = DBGetContactSettingDword(hContact, "CList", "CLN_Flags", 0);
- cfg::eCache[nextCacheEntry].dwXMask = CalcXMask(hContact);
- GetCachedStatusMsg(nextCacheEntry, const_cast<char *>(szProto));
+ memset(cfg::eCache[nextCacheEntry].iExtraImage, 0xffff, MAXEXTRACOLUMNS);
+ cfg::eCache[nextCacheEntry].iExtraValid = 0;
+ cfg::eCache[nextCacheEntry].valid = FALSE;
+ cfg::eCache[nextCacheEntry].bStatusMsgValid = 0;
+ cfg::eCache[nextCacheEntry].statusMsg = NULL;
+ cfg::eCache[nextCacheEntry].status_item = NULL;
+ LoadSkinItemToCache(&cfg::eCache[nextCacheEntry], szProto);
+ cfg::eCache[nextCacheEntry].dwCFlags = 0;
+ cfg::eCache[nextCacheEntry].dwDFlags = DBGetContactSettingDword(hContact, "CList", "CLN_Flags", 0);
+ cfg::eCache[nextCacheEntry].dwXMask = CalcXMask(hContact);
+ GetCachedStatusMsg(nextCacheEntry, const_cast<char *>(szProto));
cfg::eCache[nextCacheEntry].dwLastMsgTime = INTSORT_GetLastMsgTime(hContact);
- iFound = nextCacheEntry++;
+ iFound = nextCacheEntry++;
LeaveCriticalSection(&cachecs);
- }
- return iFound;
+ }
+ return iFound;
}
void API::onInit()
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp
index ef614af287..99be0ebcf8 100644
--- a/plugins/Clist_nicer/src/contact.cpp
+++ b/plugins/Clist_nicer/src/contact.cpp
@@ -211,7 +211,7 @@ int __forceinline GetProtoIndex(char * szName)
}
}
-int __forceinline INTSORT_CompareContacts(const struct ClcContact* c1, const struct ClcContact* c2, UINT bywhat)
+int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact* c2, UINT bywhat)
{
TCHAR *namea, *nameb;
int statusa, statusb;
@@ -290,7 +290,7 @@ int __forceinline INTSORT_CompareContacts(const struct ClcContact* c1, const str
return 0;
}
-int CompareContacts(const struct ClcContact* c1, const struct ClcContact* c2)
+int CompareContacts(const ClcContact* c1, const ClcContact* c2)
{
int i, result;
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp
index d6eee3bc0b..2016cceccc 100644
--- a/plugins/Clist_nicer/src/init.cpp
+++ b/plugins/Clist_nicer/src/init.cpp
@@ -51,7 +51,7 @@ extern HIMAGELIST himlExtraImages;
TIME_API tmi;
HMENU BuildGroupPopupMenu( ClcGroup* group );
-struct ClcContact* CreateClcContact( void );
+ClcContact* CreateClcContact( void );
struct CListEvent* fnCreateEvent( void );
void ReloadThemedOptions();
void TrayIconUpdateBase(const char *szChangedProto);
@@ -69,8 +69,8 @@ void LoadClcOptions(HWND hwnd,struct ClcData *dat);
int ( *saveAddContactToGroup )(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
int AddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact);
-ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
-ClcGroup* RemoveItemFromGroup(HWND hwnd, ClcGroup *group, struct ClcContact *contact, int updateTotalCount);
+ClcGroup* ( *saveRemoveItemFromGroup )(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
+ClcGroup* RemoveItemFromGroup(HWND hwnd, ClcGroup *group, ClcContact *contact, int updateTotalCount);
struct CListEvent* ( *saveAddEvent )(CLISTEVENT *cle);
struct CListEvent* AddEvent(CLISTEVENT *cle);
diff --git a/plugins/Clist_nicer/src/rowheight_funcs.cpp b/plugins/Clist_nicer/src/rowheight_funcs.cpp
index 1f0bbdd6e7..f89a1a90c8 100644
--- a/plugins/Clist_nicer/src/rowheight_funcs.cpp
+++ b/plugins/Clist_nicer/src/rowheight_funcs.cpp
@@ -142,7 +142,7 @@ int RowHeight::getMaxRowHeight(ClcData *dat, const HWND hwnd)
void RowHeight::calcRowHeights(ClcData *dat, HWND hwnd)
{
int indent, subindex, line_num;
- struct ClcContact *Drawing;
+ ClcContact *Drawing;
ClcGroup *group;
DWORD dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE);
diff --git a/plugins/Clist_nicer/src/statusfloater.cpp b/plugins/Clist_nicer/src/statusfloater.cpp
index 3421c7b016..8ffa0fd9ec 100644
--- a/plugins/Clist_nicer/src/statusfloater.cpp
+++ b/plugins/Clist_nicer/src/statusfloater.cpp
@@ -44,7 +44,7 @@ BYTE __forceinline percent_to_byte(UINT32 percent)
return(BYTE) ((FLOAT) (((FLOAT) percent) / 100) * 255);
}
-void FLT_Update(struct ClcData *dat, struct ClcContact *contact);
+void FLT_Update(struct ClcData *dat, ClcContact *contact);
void FLT_ShowHideAll(int showCmd);
void FLT_SnapToEdges(HWND hwnd);
void FLT_SnapToFloater(HWND hwnd);
@@ -52,7 +52,7 @@ void FLT_SnapToFloater(HWND hwnd);
HWND g_hwndSFL = 0;
HDC g_SFLCachedDC = 0;
HBITMAP g_SFLhbmOld = 0, g_SFLhbm = 0;
-struct ContactFloater *pFirstFloater = 0;
+ContactFloater *pFirstFloater = 0;
BOOL hover = FALSE;
BOOL tooltip = FALSE;
UINT_PTR hTooltipTimer = 0;
@@ -78,8 +78,8 @@ static UINT padctrlIDs[] = { IDC_FLT_PADLEFTSPIN, IDC_FLT_PADRIGHTSPIN, IDC_FLT_
* simple linked list of allocated ContactFloater* structs
*/
-static struct ContactFloater *FLT_AddToList(struct ContactFloater *pFloater) {
- struct ContactFloater *pCurrent = pFirstFloater;
+static ContactFloater *FLT_AddToList(ContactFloater *pFloater) {
+ ContactFloater *pCurrent = pFirstFloater;
if (!pFirstFloater) {
pFirstFloater = pFloater;
@@ -94,8 +94,8 @@ static struct ContactFloater *FLT_AddToList(struct ContactFloater *pFloater) {
}
}
-static struct ContactFloater *FLT_RemoveFromList(struct ContactFloater *pFloater) {
- struct ContactFloater *pCurrent = pFirstFloater;
+static ContactFloater *FLT_RemoveFromList(ContactFloater *pFloater) {
+ ContactFloater *pCurrent = pFirstFloater;
if (pFloater == pFirstFloater) {
if (pFloater->pNextFloater != NULL)
@@ -152,7 +152,7 @@ void FLT_SnapToEdges(HWND hwnd)
void FLT_SnapToFloater(HWND hwnd)
{
- struct ContactFloater *pCurrent = pFirstFloater;
+ ContactFloater *pCurrent = pFirstFloater;
RECT rcWindow, rcBase;
int minTop = 0xFFFFFF, minBottom = 0xFFFFFF, minRight = 0xFFFFFF, minLeft = 0xFFFFFF;
int posTop = 0, posBottom = 0, posRight = 0, posLeft = 0;
@@ -554,7 +554,7 @@ LRESULT CALLBACK StatusFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
}
void CALLBACK ShowTooltip(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime){
- struct ContactFloater *pCurrent = pFirstFloater;
+ ContactFloater *pCurrent = pFirstFloater;
POINT pt;
CLCINFOTIP ti = {0};
@@ -657,8 +657,8 @@ LRESULT CALLBACK ContactFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
case WM_MOUSEHOVER:
{
- struct ClcContact *contact = NULL;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact = NULL;
+ ContactFloater *pCurrent = pFirstFloater;
int oldTrans = g_floatoptions.trans;
while(pCurrent->hwnd != hwnd)
@@ -674,8 +674,8 @@ LRESULT CALLBACK ContactFloaterClassProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
}
case WM_MOUSELEAVE:
{
- struct ClcContact *contact = NULL;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact = NULL;
+ ContactFloater *pCurrent = pFirstFloater;
while(pCurrent->hwnd != hwnd)
pCurrent = pCurrent->pNextFloater;
@@ -971,13 +971,13 @@ void FLT_Create(int iEntry)
struct TExtraCache *centry = NULL;
if (iEntry >= 0 && iEntry < cfg::nextCacheEntry) {
- struct ClcContact *contact = NULL;
+ ClcContact *contact = NULL;
ClcGroup *group = NULL;
centry = &cfg::eCache[iEntry];
if (centry->floater == 0 && API::pfnUpdateLayeredWindow != NULL) {
- centry->floater = (struct ContactFloater *)malloc(sizeof(struct ContactFloater));
+ centry->floater = (ContactFloater *)malloc(sizeof(ContactFloater));
if (centry->floater == NULL)
return;
FLT_AddToList(centry->floater);
@@ -1009,7 +1009,7 @@ extern HDC hdcTempAV;
extern HBITMAP hbmTempAV, hbmTempOldAV;
extern LONG g_maxAV_X, g_maxAV_Y;
-void FLT_Update(struct ClcData *dat, struct ClcContact *contact)
+void FLT_Update(struct ClcData *dat, ClcContact *contact)
{
RECT rcClient, rcWindow;
POINT ptDest, ptSrc = {0};
@@ -1019,7 +1019,7 @@ void FLT_Update(struct ClcData *dat, struct ClcContact *contact)
HDC hdc;
BOOL firstDrawn = TRUE;
ClcGroup *group = NULL;
- struct ClcContact *newContact = NULL;
+ ClcContact *newContact = NULL;
HRGN rgn;
HBRUSH hbrBorder;
COLORREF clrKey;
@@ -1170,8 +1170,8 @@ void FLT_Update(struct ClcData *dat, struct ClcContact *contact)
void FLT_SyncWithClist()
{
- struct ClcContact *contact;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact;
+ ContactFloater *pCurrent = pFirstFloater;
HWND hwnd;
int iVis = pcli->pfnGetWindowVisibleState(pcli->hwndContactList, 0, 0);
@@ -1201,8 +1201,8 @@ void FLT_SyncWithClist()
void FLT_ShowHideAll(int showCmd)
{
- struct ClcContact *contact;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact;
+ ContactFloater *pCurrent = pFirstFloater;
HWND hwnd;
if (g_floatoptions.dwFlags & FLT_AUTOHIDE){
@@ -1225,8 +1225,8 @@ void FLT_ShowHideAll(int showCmd)
void FLT_RefreshAll()
{
- struct ClcContact *contact = NULL;
- struct ContactFloater *pCurrent = pFirstFloater;
+ ClcContact *contact = NULL;
+ ContactFloater *pCurrent = pFirstFloater;
while(pCurrent) {
if (FindItem(pcli->hwndContactTree, cfg::clcdat, pCurrent->hContact, &contact, NULL, 0)) {
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp
index c3397349fa..3182a41b79 100644
--- a/plugins/CountryFlags/src/extraimg.cpp
+++ b/plugins/CountryFlags/src/extraimg.cpp
@@ -289,11 +289,10 @@ static int ExtraImgSettingChanged(WPARAM wParam,LPARAM lParam)
if (!lstrcmpA(dbcws->szModule,"Flags")) {
/* Extra Image */
if (!lstrcmpA(dbcws->szSetting,"ShowExtraImgFlag") ||
- !lstrcmpA(dbcws->szSetting,"ExtraImgFlagColumn") ||
- !lstrcmpA(dbcws->szSetting,"UseUnknownFlag") ||
- !lstrcmpA(dbcws->szSetting,"UseIpToCountry"))
- if (ServiceExists(MS_CLIST_EXTRA_SET_ICON))
- CallFunctionBuffered(UpdateExtraImages,0,FALSE,EXTRAIMAGE_REFRESHDELAY);
+ !lstrcmpA(dbcws->szSetting,"ExtraImgFlagColumn") ||
+ !lstrcmpA(dbcws->szSetting,"UseUnknownFlag") ||
+ !lstrcmpA(dbcws->szSetting,"UseIpToCountry"))
+ CallFunctionBuffered(UpdateExtraImages,0,FALSE,EXTRAIMAGE_REFRESHDELAY);
/* Status Icon */
if (!lstrcmpA(dbcws->szSetting,"ShowStatusIconFlag") ||
!lstrcmpA(dbcws->szSetting,"UseUnknownFlag") ||
diff --git a/plugins/ExternalAPI/m_flags.h b/plugins/ExternalAPI/m_flags.h
index 9760c1b419..9d6bad8816 100644
--- a/plugins/ExternalAPI/m_flags.h
+++ b/plugins/ExternalAPI/m_flags.h
@@ -91,10 +91,9 @@ or 0xFFFF on failure (MS_UTILS_GETCOUNTRYBYNUMBER returns "Unknown" for this).
#define MS_FLAGS_DETECTCONTACTORIGINCOUNTRY "Flags/DetectContactOriginCountry"
#define MS_FLAGS_GETCONTACTORIGINCOUNTRY "Flags/GetContactOriginCountry" //for beta version 0.1.1.0
-#if !defined(FLAGS_NOSETTINGS) && defined(EXTRA_ICON_ADV2)
+#if !defined(FLAGS_NOSETTINGS)
#define SETTING_SHOWSTATUSICONFLAG_DEFAULT 1
#define SETTING_SHOWEXTRAIMGFLAG_DEFAULT 1
-#define SETTING_EXTRAIMGFLAGCOLUMN_DEFAULT EXTRA_ICON_ADV2
#define SETTING_USEUNKNOWNFLAG_DEFAULT 1
#define SETTING_USEIPTOCOUNTRY_DEFAULT 1
#endif
diff --git a/plugins/FingerPrintModPlus/src/finger_groups.h b/plugins/FingerPrintModPlus/src/finger_groups.h
index e125051cd2..75c595a491 100644
--- a/plugins/FingerPrintModPlus/src/finger_groups.h
+++ b/plugins/FingerPrintModPlus/src/finger_groups.h
@@ -1,93 +1,93 @@
case MIRANDA_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupMiranda", 1))
+ if ( db_get_b(NULL, "Finger", "GroupMiranda", 1))
return _T("Client Icons/Miranda");
break;
case MULTIPROTOCOL_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupMulti", 1))
+ if ( db_get_b(NULL, "Finger", "GroupMulti", 1))
return _T("Client Icons/Multi-Protocol");
break;
case ICQ_OFF_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupIcq", 1))
+ if ( db_get_b(NULL, "Finger", "GroupIcq", 1))
return _T("Client Icons/ICQ/Official");
break;
case ICQ_UNOFF_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupIcq", 1))
+ if ( db_get_b(NULL, "Finger", "GroupIcq", 1))
return _T("Client Icons/ICQ/Unofficial");
break;
case JABBER_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupJabber", 1))
+ if ( db_get_b(NULL, "Finger", "GroupJabber", 1))
return _T("Client Icons/Jabber");
break;
case MSN_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupMsn", 1))
+ if ( db_get_b(NULL, "Finger", "GroupMsn", 1))
return _T("Client Icons/MSN");
break;
case AIM_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupAim", 1))
+ if ( db_get_b(NULL, "Finger", "GroupAim", 1))
return _T("Client Icons/AIM");
break;
case YAHOO_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupYahoo", 1))
+ if ( db_get_b(NULL, "Finger", "GroupYahoo", 1))
return _T("Client Icons/Yahoo");
break;
case IRC_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupIrc", 1))
+ if ( db_get_b(NULL, "Finger", "GroupIrc", 1))
return _T("Client Icons/IRC");
break;
case VOIP_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupVoIP", 1))
+ if ( db_get_b(NULL, "Finger", "GroupVoIP", 1))
return _T("Client Icons/VoIP");
break;
case SKYPE_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupSkype", 1))
+ if ( db_get_b(NULL, "Finger", "GroupSkype", 1))
return _T("Client Icons/Skype");
break;
case GADU_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupGadu", 1))
+ if ( db_get_b(NULL, "Finger", "GroupGadu", 1))
return _T("Client Icons/Gadu-Gadu");
break;
case PACKS_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupPacks", 1))
+ if ( db_get_b(NULL, "Finger", "GroupPacks", 1))
return _T("Client Icons/Miranda/Pack overlays");
break;
case MRA_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupMail", 1))
+ if ( db_get_b(NULL, "Finger", "GroupMail", 1))
return _T("Client Icons/Mail.Ru Agent");
break;
case OVER1_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupMiranda", 1))
+ if ( db_get_b(NULL, "Finger", "GroupMiranda", 1))
return _T("Client Icons/Miranda/Overlays#1");
break;
case SECURITY_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupOtherProtos", 1))
+ if ( db_get_b(NULL, "Finger", "GroupOtherProtos", 1))
return _T("Client Icons/Overlays/Security");
break;
case OTHER_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupOtherProtos", 1))
+ if ( db_get_b(NULL, "Finger", "GroupOtherProtos", 1))
return _T("Client Icons/Other");
break;
case OVER2_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupMiranda", 1))
+ if ( db_get_b(NULL, "Finger", "GroupMiranda", 1))
return _T("Client Icons/Miranda/Overlays#2");
break;
case PLATFORM_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupOtherProtos", 1))
+ if ( db_get_b(NULL, "Finger", "GroupOtherProtos", 1))
return _T("Client Icons/Overlays/Platform");
break;
case WEATHER_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupWeather", 1))
+ if ( db_get_b(NULL, "Finger", "GroupWeather", 1))
return _T("Client Icons/Weather");
break;
case RSS_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupRSS", 1))
+ if ( db_get_b(NULL, "Finger", "GroupRSS", 1))
return _T("Client Icons/RSS");
break;
case QQ_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupQQ", 1))
+ if ( db_get_b(NULL, "Finger", "GroupQQ", 1))
return _T("Client Icons/QQ");
break;
case TLEN_CASE:
- if (DBGetContactSettingByte(NULL, "Finger", "GroupTlen", 1))
+ if ( db_get_b(NULL, "Finger", "GroupTlen", 1))
return _T("Client Icons/Tlen");
break;
default:
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp
index f89b51374a..7267610ee2 100644
--- a/plugins/FingerPrintModPlus/src/fingerprint.cpp
+++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp
@@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//Start of header
#include "global.h"
-static BYTE bColumn = EXTRA_ICON_CLIENT;
static UINT g_LPCodePage;
static TCHAR g_szSkinLib[MAX_PATH];
static HANDLE hExtraIcon = NULL;
@@ -104,12 +103,12 @@ void RegisterIcons()
for (i=0; i < DEFAULT_KN_FP_MASK_COUNT; i++)
Prepare(&def_kn_fp_mask[i], true);
- bool bEnable = DBGetContactSettingByte(NULL, "Finger", "Overlay1", 1) != 0;
+ bool bEnable = db_get_b(NULL, "Finger", "Overlay1", 1) != 0;
for (i=0; i < DEFAULT_KN_FP_OVERLAYS_COUNT; i++)
Prepare(&def_kn_fp_overlays_mask[i], bEnable);
- bEnable = DBGetContactSettingByte(NULL, "Finger", "Overlay2", 1) != 0;
- if (DBGetContactSettingByte(NULL, "Finger", "ShowVersion", 0)) {
+ bEnable = db_get_b(NULL, "Finger", "Overlay2", 1) != 0;
+ if ( db_get_b(NULL, "Finger", "ShowVersion", 0)) {
for (i = 0; i < DEFAULT_KN_FP_OVERLAYS2_COUNT; i++)
Prepare(&def_kn_fp_overlays2_mask[i], bEnable);
}
@@ -120,7 +119,7 @@ void RegisterIcons()
Prepare(&def_kn_fp_overlays2_mask[i], false);
}
- bEnable = DBGetContactSettingByte(NULL, "Finger", "Overlay3", 1) != 0;
+ bEnable = db_get_b(NULL, "Finger", "Overlay3", 1) != 0;
for (i=0; i < DEFAULT_KN_FP_OVERLAYS3_COUNT; i++)
Prepare(&def_kn_fp_overlays3_mask[i], bEnable);
}
@@ -166,13 +165,11 @@ int FASTCALL ApplyFingerprintImage(HANDLE hContact, LPTSTR szMirVer)
if (szMirVer)
hImage = GetIconIndexFromFI(szMirVer);
- if (hExtraIcon != INVALID_HANDLE_VALUE && hExtraIcon != NULL)
- ExtraIcon_SetIcon(hExtraIcon,hContact,hImage);
-
+ ExtraIcon_SetIcon(hExtraIcon,hContact,hImage);
return 0;
}
-int OnExtraIconClick(WPARAM wParam, LPARAM lParam,LPARAM)
+int OnExtraIconClick(WPARAM wParam, LPARAM lParam)
{
CallService(MS_USERINFO_SHOWDIALOG, wParam, NULL);
return 0;
@@ -1020,8 +1017,7 @@ HICON FASTCALL CreateJoinedIcon(HICON hBottom, HICON hTop)
DeleteObject(iciTop.hbmMask);
}
- if (!drawn)
- {
+ if (!drawn) {
DrawIconEx(tempDC, 0, 0, hBottom, 16, 16, 0, NULL, DI_NORMAL);
DrawIconEx(tempDC, 0, 0, hTop, 16, 16, 0, NULL, DI_NORMAL);
}
@@ -1098,11 +1094,10 @@ HANDLE FASTCALL GetIconIndexFromFI(LPTSTR szMirVer)
return hFoundImage;
}
-VOID FASTCALL ClearFI()
+VOID ClearFI()
{
if (fiList != NULL)
mir_free(fiList);
fiList = NULL;
nFICount = 0;
- return;
}
diff --git a/plugins/FingerPrintModPlus/src/global.h b/plugins/FingerPrintModPlus/src/global.h
index f4971c1cee..408b36e07e 100644
--- a/plugins/FingerPrintModPlus/src/global.h
+++ b/plugins/FingerPrintModPlus/src/global.h
@@ -131,7 +131,7 @@ typedef struct _foundInfo
#define DEFAULT_SKIN_FOLDER _T("Icons\\Fp_ClientIcons")
-void FASTCALL ClearFI();
+void ClearFI();
int OnIconsChanged(WPARAM wParam, LPARAM lParam);
int OnExtraIconClick(WPARAM wParam, LPARAM lParam,LPARAM);
diff --git a/plugins/FingerPrintModPlus/src/options.cpp b/plugins/FingerPrintModPlus/src/options.cpp
index 8d6378053b..2e710faaff 100644
--- a/plugins/FingerPrintModPlus/src/options.cpp
+++ b/plugins/FingerPrintModPlus/src/options.cpp
@@ -63,12 +63,12 @@ static void OptDlgChanged(HWND hwndDlg, BOOL show)
static void LoadDBCheckState(HWND hwndDlg, int idCtrl, LPCSTR szSetting, BYTE bDef)
{
- CheckDlgButton(hwndDlg, idCtrl, DBGetContactSettingByte(NULL, "Finger", szSetting, bDef));
+ CheckDlgButton(hwndDlg, idCtrl, db_get_b(NULL, "Finger", szSetting, bDef));
}
static void StoreDBCheckState(HWND hwndDlg, int idCtrl, LPCSTR szSetting)
{
- DBWriteContactSettingByte(NULL, "Finger", szSetting, (BYTE)IsDlgButtonChecked(hwndDlg, idCtrl));
+ db_set_b(NULL, "Finger", szSetting, (BYTE)IsDlgButtonChecked(hwndDlg, idCtrl));
}
static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -90,11 +90,6 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_COMMAND:
switch(LOWORD(wParam)) {
- case IDC_ADVICON:
- if (HIWORD(wParam) == CBN_SELCHANGE)
- OptDlgChanged(hwndDlg, true);
- break;
-
case IDC_OVERLAY1:
case IDC_OVERLAY2:
case IDC_OVERLAY3:
@@ -122,6 +117,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case IDC_GROUPYAHOO:
OptDlgChanged(hwndDlg, false);
break;
+
default:
return 0;
}
diff --git a/plugins/FingerPrintModPlus/src/resource.h b/plugins/FingerPrintModPlus/src/resource.h
index ec5876b447..aeed13978d 100644
--- a/plugins/FingerPrintModPlus/src/resource.h
+++ b/plugins/FingerPrintModPlus/src/resource.h
@@ -604,7 +604,6 @@
//##############################################################################################################
//resources
#define IDD_DIALOG 10000
-#define IDC_ADVICON 10001
#define IDC_OVERLAY1 10002
#define IDC_OVERLAY2 10003
#define IDC_OVERLAY3 10004
diff --git a/plugins/Gender/src/options.cpp b/plugins/Gender/src/options.cpp
index a7c5c244bd..0a3808b73a 100644
--- a/plugins/Gender/src/options.cpp
+++ b/plugins/Gender/src/options.cpp
@@ -28,7 +28,6 @@
int applyExtraImage(HANDLE hContact);
extern HINSTANCE g_hInst;
-extern IconExtraColumn g_IECClear;
extern int clistIcon;
extern HANDLE g_hExtraIcon;
extern byte bContactMenuItems, bEnableClistIcon, bDrawNoGenderIcon;
diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp
index 50687caead..411305a279 100644
--- a/plugins/ListeningTo/src/options.cpp
+++ b/plugins/ListeningTo/src/options.cpp
@@ -196,10 +196,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else {
// Init combo
int total = 0, first = 0;
- if (ServiceExists(MS_CLUI_GETCAPS)) {
+ if (ServiceExists(MS_CLUI_GETCAPS))
total = CallService(MS_CLUI_GETCAPS, 0, CLUIF2_EXTRACOLUMNCOUNT);
- first = CallService(MS_CLUI_GETCAPS, 0, CLUIF2_USEREXTRASTART);
- }
SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM) _T("1"));
SendDlgItemMessage(hwndDlg, IDC_ADV_ICON, CB_ADDSTRING, 0, (LPARAM) _T("2"));
diff --git a/plugins/MetaContacts/src/meta_utils.cpp b/plugins/MetaContacts/src/meta_utils.cpp
index 0b9c6a24e1..3931044812 100644
--- a/plugins/MetaContacts/src/meta_utils.cpp
+++ b/plugins/MetaContacts/src/meta_utils.cpp
@@ -1691,17 +1691,10 @@ void Meta_FixStatus(HANDLE hMeta) {
if (proto) {
WORD status = (WORD)DBGetContactSettingWord(most_online, proto, "Status", (WORD)ID_STATUS_OFFLINE);
DBWriteContactSettingWord(hMeta, META_PROTO, "Status", status);
- } else
- DBWriteContactSettingWord(hMeta, META_PROTO, "Status", (WORD)ID_STATUS_OFFLINE);
- } else
- DBWriteContactSettingWord(hMeta, META_PROTO, "Status", (WORD)ID_STATUS_OFFLINE);
-
- // trigger setting changed in mw_clist to reset extra icons
- if (ServiceExists(MS_CLIST_EXTRA_SET_ICON)) {
- DBWriteContactSettingString(hMeta, "DummyModule", "e-mail", "blah");
- //DBDeleteContactSetting(hMeta, "DummyModule", "e-mail"); // causes 'empty settings group' error in dbtool
+ }
+ else DBWriteContactSettingWord(hMeta, META_PROTO, "Status", (WORD)ID_STATUS_OFFLINE);
}
-
+ else DBWriteContactSettingWord(hMeta, META_PROTO, "Status", (WORD)ID_STATUS_OFFLINE);
}
INT_PTR Meta_IsEnabled() {
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index 8413f9734d..809613d024 100755
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -24,8 +24,6 @@ list <JabberAccount*> Accounts;
HINSTANCE hInst;
HANDLE hLoadPubKey = NULL, hToggleEncryption = NULL, hOnPreBuildContactMenu = NULL, hSendKey = NULL, g_hCLIcon = NULL, hExportGpgKeys = NULL, hImportGpgKeys = NULL;
-IconExtraColumn g_IEC = {0};
-static int OnModulesLoaded(WPARAM wParam,LPARAM lParam);
RECT key_from_keyserver_rect = {0}, firstrun_rect = {0}, new_key_rect = {0}, key_gen_rect = {0}, load_key_rect = {0}, import_key_rect = {0}, key_password_rect = {0}, load_existing_key_rect = {0};
XML_API xi = {0};
int hLangpack = 0;
@@ -105,69 +103,8 @@ void init_vars()
tabsrmm_used = isTabsrmmUsed();
}
-extern "C" int __declspec(dllexport) Load()
-{
- HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- mir_getXI(&xi); //TODO: check if we have access to api
- mir_getLP(&pluginInfo);
- init_vars();
- CreateServiceFunction("/LoadPubKey",LoadKey);
- CreateServiceFunction("/ToggleEncryption",ToggleEncryption);
- CreateServiceFunction("/SendKey",SendKey);
- CreateServiceFunction("/ExportGPGKeys",ExportGpGKeys);
- CreateServiceFunction("/ImportGPGKeys",ImportGpGKeys);
-
- CLISTMENUITEM mi = {0};
- mi.cbSize=sizeof(mi);
- mi.position=-0x7FFFFFFF;
- mi.flags=CMIF_TCHAR;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- mi.ptszName=LPGENT("Load GPG public key");
- mi.pszService="/LoadPubKey";
- hLoadPubKey = Menu_AddContactMenuItem(&mi);
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=-0x7FFFFFFe;
- mi.flags=CMIF_TCHAR;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- mi.ptszName=LPGENT("Toggle GPG encryption");
- mi.pszService="/ToggleEncryption";
- hToggleEncryption = Menu_AddContactMenuItem(&mi);
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=-0x7FFFFFFe;
- mi.flags=CMIF_TCHAR;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- mi.ptszName=LPGENT("Send public key");
- mi.pszService="/SendKey";
- hSendKey = Menu_AddContactMenuItem(&mi);
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=-0x7FFFFFFF;
- mi.flags=CMIF_TCHAR;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- mi.ptszName=LPGENT("Export GPG Public keys from all users");
- mi.pszService="/ExportGPGKeys";
- hExportGpgKeys = Menu_AddMainMenuItem(&mi);
-
- ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=-0x7FFFFFFF;
- mi.flags=CMIF_TCHAR;
- mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- mi.ptszName=LPGENT("Import GPG Public keys from all users");
- mi.pszService="/ImportGPGKeys";
- hImportGpgKeys = Menu_AddMainMenuItem(&mi);
-
- return 0;
-}
-
static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
{
-
int GpgOptInit(WPARAM wParam,LPARAM lParam);
int OnPreBuildContactMenu(WPARAM w, LPARAM l);
int RecvMsgSvc(WPARAM w, LPARAM l);
@@ -246,6 +183,66 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
return 0;
}
+extern "C" int __declspec(dllexport) Load()
+{
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ mir_getXI(&xi); //TODO: check if we have access to api
+ mir_getLP(&pluginInfo);
+ init_vars();
+ CreateServiceFunction("/LoadPubKey",LoadKey);
+ CreateServiceFunction("/ToggleEncryption",ToggleEncryption);
+ CreateServiceFunction("/SendKey",SendKey);
+ CreateServiceFunction("/ExportGPGKeys",ExportGpGKeys);
+ CreateServiceFunction("/ImportGPGKeys",ImportGpGKeys);
+
+ CLISTMENUITEM mi = {0};
+ mi.cbSize=sizeof(mi);
+ mi.position=-0x7FFFFFFF;
+ mi.flags=CMIF_TCHAR;
+ mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.ptszName=LPGENT("Load GPG public key");
+ mi.pszService="/LoadPubKey";
+ hLoadPubKey = Menu_AddContactMenuItem(&mi);
+
+ ZeroMemory(&mi,sizeof(mi));
+ mi.cbSize=sizeof(mi);
+ mi.position=-0x7FFFFFFe;
+ mi.flags=CMIF_TCHAR;
+ mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.ptszName=LPGENT("Toggle GPG encryption");
+ mi.pszService="/ToggleEncryption";
+ hToggleEncryption = Menu_AddContactMenuItem(&mi);
+
+ ZeroMemory(&mi,sizeof(mi));
+ mi.cbSize=sizeof(mi);
+ mi.position=-0x7FFFFFFe;
+ mi.flags=CMIF_TCHAR;
+ mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.ptszName=LPGENT("Send public key");
+ mi.pszService="/SendKey";
+ hSendKey = Menu_AddContactMenuItem(&mi);
+
+ ZeroMemory(&mi,sizeof(mi));
+ mi.cbSize=sizeof(mi);
+ mi.position=-0x7FFFFFFF;
+ mi.flags=CMIF_TCHAR;
+ mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.ptszName=LPGENT("Export GPG Public keys from all users");
+ mi.pszService="/ExportGPGKeys";
+ hExportGpgKeys = Menu_AddMainMenuItem(&mi);
+
+ ZeroMemory(&mi,sizeof(mi));
+ mi.cbSize=sizeof(mi);
+ mi.position=-0x7FFFFFFF;
+ mi.flags=CMIF_TCHAR;
+ mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ mi.ptszName=LPGENT("Import GPG Public keys from all users");
+ mi.pszService="/ImportGPGKeys";
+ hImportGpgKeys = Menu_AddMainMenuItem(&mi);
+
+ return 0;
+}
+
extern list<wstring> transfers;
extern "C" int __declspec(dllexport) Unload(void)
{
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
index ed43e04161..cd682e9b1f 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
@@ -2,10 +2,10 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
part of this code based on:
-Miranda IM Country Flags Plugin Copyright ©2006-2007 H. Herkenrath
+Miranda IM Country Flags Plugin Copyright �2006-2007 H. Herkenrath
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -319,10 +319,8 @@ static int OnExtraIconSvcChanged(WPARAM wParam,LPARAM lParam)
VOID SvcFlagsEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB)
{
gFlagsOpts.bShowExtraImgFlag = (bColumn!=((BYTE)-1));
- if (bUpdateDB) {
- if(gFlagsOpts.bShowExtraImgFlag) DB::Setting::WriteByte(MODNAMEFLAGS,"ExtraImgFlagColumn", bColumn);
+ if (bUpdateDB)
DB::Setting::WriteByte(MODNAMEFLAGS,"ShowExtraImgFlag", bColumn!=(BYTE)-1);
- }
// Flags is on
if (gFlagsOpts.bShowExtraImgFlag) {
@@ -545,8 +543,7 @@ static int OnContactSettingChanged(WPARAM wParam,LPARAM lParam) {
!lstrcmpA(dbcws->szSetting,SET_CONTACT_COMPANY_COUNTRY))
{
/* Extra Image */
- if(myGlobals.HaveCListExtraIcons)
- CallFunctionBuffered(SetExtraImage,(LPARAM)wParam,TRUE,EXTRAIMAGE_REFRESHDELAY);
+ CallFunctionBuffered(SetExtraImage,(LPARAM)wParam,TRUE,EXTRAIMAGE_REFRESHDELAY);
/* Status Icon */
if(hMsgWndEventHook) {
int i = gMsgWndList.getIndex((MsgWndData*)&wParam);
@@ -581,10 +578,9 @@ void SvcFlagsLoadModule()
//InitIpToCountry(); /* not implementet */
CreateServiceFunction(MS_FLAGS_DETECTCONTACTORIGINCOUNTRY,ServiceDetectContactOriginCountry);
//init settings
- gFlagsOpts.bShowExtraImgFlag = DB::Setting::GetByte(MODNAMEFLAGS,"ShowExtraImgFlag", SETTING_SHOWEXTRAIMGFLAG_DEFAULT);
- gFlagsOpts.bUseUnknownFlag = DB::Setting::GetByte(MODNAMEFLAGS,"UseUnknownFlag", SETTING_USEUNKNOWNFLAG_DEFAULT);
- gFlagsOpts.idExtraColumn = DB::Setting::GetByte(MODNAMEFLAGS,"ExtraImgFlagColumn", SETTING_EXTRAIMGFLAGCOLUMN_DEFAULT);
- gFlagsOpts.bShowStatusIconFlag = DB::Setting::GetByte(MODNAMEFLAGS,"ShowStatusIconFlag", SETTING_SHOWSTATUSICONFLAG_DEFAULT);
+ gFlagsOpts.bShowExtraImgFlag = DB::Setting::GetByte(MODNAMEFLAGS,"ShowExtraImgFlag", SETTING_SHOWEXTRAIMGFLAG_DEFAULT);
+ gFlagsOpts.bUseUnknownFlag = DB::Setting::GetByte(MODNAMEFLAGS,"UseUnknownFlag", SETTING_USEUNKNOWNFLAG_DEFAULT);
+ gFlagsOpts.bShowStatusIconFlag = DB::Setting::GetByte(MODNAMEFLAGS,"ShowStatusIconFlag", SETTING_SHOWSTATUSICONFLAG_DEFAULT);
hOptInitHook = HookEvent(ME_OPT_INITIALISE,ExtraImgOptInit);
hIconsChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED,OnStatusIconsChanged);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.h b/plugins/UserInfoEx/src/Flags/svc_flags.h
index a597f67e8a..3aaa7f884f 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.h
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.h
@@ -2,10 +2,10 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
part of this code based on:
-Miranda IM Country Flags Plugin Copyright ©2006-2007 H. Herkenrath
+Miranda IM Country Flags Plugin Copyright �2006-2007 H. Herkenrath
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -40,8 +40,6 @@ typedef struct _FLAGSOPTIONS
{
BYTE bShowExtraImgFlag;
BYTE bUseUnknownFlag;
- BYTE idExtraColumn;
-// BYTE bUseIpToCountry;
BYTE bShowStatusIconFlag;
} FLAGSOPTIONS, *LPFLAGSOPTIONS;
diff --git a/plugins/UserInfoEx/src/commonheaders.h b/plugins/UserInfoEx/src/commonheaders.h
index 30597a9f48..6755bc352d 100644
--- a/plugins/UserInfoEx/src/commonheaders.h
+++ b/plugins/UserInfoEx/src/commonheaders.h
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -159,7 +159,6 @@ typedef struct _MGLOBAL
{
DWORD mirandaVersion; // mirandaVersion
BOOLEAN CanChangeDetails : 1; // is service to upload own contact information for icq present?
- BOOLEAN HaveCListExtraIcons : 1; // are extra icons supported by current clist
BOOLEAN MsgAddIconExist : 1; // Messsage Window support status Icon
BOOLEAN TzIndexExist : 1; // Win Reg has Timzone Index Info
BOOLEAN PopUpActionsExist : 1; // Popup++ or MS_POPUP_REGISTERACTIONS exist
diff --git a/plugins/UserInfoEx/src/init.cpp b/plugins/UserInfoEx/src/init.cpp
index 2762e67a32..9e27902f10 100644
--- a/plugins/UserInfoEx/src/init.cpp
+++ b/plugins/UserInfoEx/src/init.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -103,7 +103,6 @@ static INT OnTopToolBarLoaded(WPARAM wParam, LPARAM lParam)
**/
static INT OnModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- myGlobals.HaveCListExtraIcons = ServiceExists(MS_CLIST_EXTRA_SET_ICON);
myGlobals.PopUpActionsExist = ServiceExists(MS_POPUP_REGISTERACTIONS);
myGlobals.MsgAddIconExist = ServiceExists(MS_MSG_ADDICON);
diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp
index c8c9ada146..12f3616d69 100644
--- a/plugins/UserInfoEx/src/psp_options.cpp
+++ b/plugins/UserInfoEx/src/psp_options.cpp
@@ -67,29 +67,6 @@ static FORCEINLINE VOID NotifyParentOfChange(HWND hDlg)
}
/**
- * This function clears all CList extra icons from the given column.
- *
- * @param ExtraIconColumnType - the clist column to clear
- *
- * @return nothing
- **/
-static VOID ClearAllExtraIcons(INT ExtraIconColumnType)
-{
- IconExtraColumn iec;
- HANDLE hContact;
-
- iec.cbSize = sizeof(IconExtraColumn);
- iec.hImage = INVALID_HANDLE_VALUE;
- iec.ColumnType = ExtraIconColumnType;
-
- //walk through all the contacts stored in the DB
- for (hContact = DB::Contact::FindFirst(); hContact != NULL; hContact = DB::Contact::FindNext(hContact))
- {
- CallService(MS_CLIST_EXTRA_SET_ICON, (WPARAM)hContact, (LPARAM)&iec);
- }
-}
-
-/**
* Sends a PSN_INFOCHANGED notify to the handle.
*
* @param hWnd - the dialog's window handle
@@ -897,7 +874,6 @@ static INT_PTR CALLBACK DlgProc_ReminderOpts(HWND hDlg, UINT uMsg, WPARAM wParam
};
EnableControls(hDlg, idCtrl, SIZEOF(idCtrl), bEnabled);
- bEnabled &= myGlobals.HaveCListExtraIcons;
}
}
diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp
index 27b7532551..5b886b72a3 100644
--- a/plugins/UserInfoEx/src/svc_email.cpp
+++ b/plugins/UserInfoEx/src/svc_email.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -277,55 +277,42 @@ VOID SvcEMailApplyCListIcons()
**/
VOID SvcEMailEnableExtraIcons(BOOLEAN bEnable, BOOLEAN bUpdateDB)
{
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- {
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_EMAIL, bEnable);
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_EMAIL, bEnable);
+
+ if (bEnable) { // E-mail checkt
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
+
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "email"; //must be the same as the group name in extraicon
+ ico.description= "E-mail (uinfoex)";
+ ico.descIcon = ICO_BTN_EMAIL;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
+ ZeroMemory(&ico,sizeof(ico));
}
-
- if (bEnable) // E-mail checkt
- {
- // hook events
- if (hChangedHook == NULL)
- {
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
- }
- if (hApplyIconHook == NULL)
- {
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons);
- }
-
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "email"; //must be the same as the group name in extraicon
- ico.description= "E-mail (uinfoex)";
- ico.descIcon = ICO_BTN_EMAIL;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- ZeroMemory(&ico,sizeof(ico));
- }
- }
- else // E-mail uncheckt
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+ }
+ else { // E-mail uncheckt
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcEMailApplyCListIcons();
}
+ SvcEMailApplyCListIcons();
}
/**
diff --git a/plugins/UserInfoEx/src/svc_gender.cpp b/plugins/UserInfoEx/src/svc_gender.cpp
index d8f542b374..6ac632e6af 100644
--- a/plugins/UserInfoEx/src/svc_gender.cpp
+++ b/plugins/UserInfoEx/src/svc_gender.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -144,49 +144,42 @@ VOID SvcGenderApplyCListIcons()
VOID SvcGenderEnableExtraIcons(BYTE bColumn, BOOLEAN bUpdateDB)
{
bool bEnable = (bColumn!=((BYTE)-1));
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_GENDER2, bColumn);
- if (bEnable) // Gender checkt or dropdown select
- {
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "gender"; //must be the same as the group name in extraicon
- ico.description="Gender (uinfoex)";
- ico.descIcon = ICO_COMMON_MALE;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- }
-
- // hook events
- if (hChangedHook == NULL)
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
-
- if (hApplyIconHook == NULL)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_GENDER2, bColumn);
+
+ if (bEnable) { // Gender checkt or dropdown select
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "gender"; //must be the same as the group name in extraicon
+ ico.description="Gender (uinfoex)";
+ ico.descIcon = ICO_COMMON_MALE;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
}
- else
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+ }
+ else {
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcGenderApplyCListIcons();
}
+ SvcGenderApplyCListIcons();
}
/**
diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp
index cb9533ada2..b6a6f9ee46 100644
--- a/plugins/UserInfoEx/src/svc_homepage.cpp
+++ b/plugins/UserInfoEx/src/svc_homepage.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -223,51 +223,41 @@ VOID SvcHomepageApplyCListIcons()
**/
VOID SvcHomepageEnableExtraIcons(BOOLEAN bEnable, BOOLEAN bUpdateDB)
{
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- {
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_HOMEPAGE, bEnable);
- }
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_HOMEPAGE, bEnable);
- if (bEnable)
- {
- // hook events
- if (hChangedHook == NULL)
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+ if (bEnable) {
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
- if (hApplyIconHook == NULL)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "homepage"; //must be the same as the group name in extraicon
- ico.description = "Homepage (uinfoex)";
- ico.descIcon = ICO_BTN_GOTO;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- }
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "homepage"; //must be the same as the group name in extraicon
+ ico.description = "Homepage (uinfoex)";
+ ico.descIcon = ICO_BTN_GOTO;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
}
- else
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+ }
+ else {
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcHomepageApplyCListIcons();
}
+ SvcHomepageApplyCListIcons();
}
/**
diff --git a/plugins/UserInfoEx/src/svc_phone.cpp b/plugins/UserInfoEx/src/svc_phone.cpp
index 7ccdc576b4..5d4e2f13d1 100644
--- a/plugins/UserInfoEx/src/svc_phone.cpp
+++ b/plugins/UserInfoEx/src/svc_phone.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -169,52 +169,42 @@ VOID SvcPhoneApplyCListIcons()
**/
VOID SvcPhoneEnableExtraIcons(BOOLEAN bEnable, BOOLEAN bUpdateDB)
{
- if (myGlobals.HaveCListExtraIcons)
- {
- if (bUpdateDB)
- {
- DB::Setting::WriteByte(SET_CLIST_EXTRAICON_PHONE, bEnable);
- }
-
- // force module enabled, if extraicon plugin was found
- if (bEnable)
- {
- // hook events
- if (hChangedHook == NULL)
- hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
-
- if (hApplyIconHook == NULL)
- hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
-
- if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
- EXTRAICON_INFO ico = { sizeof(ico) };
- ico.type = EXTRAICON_TYPE_ICOLIB;
- ico.name = "sms"; //must be the same as the group name in extraicon
- ico.description = "(uinfoex)";
- ico.descIcon = ICO_BTN_CELLULAR;
- ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
- }
+ if (bUpdateDB)
+ DB::Setting::WriteByte(SET_CLIST_EXTRAICON_PHONE, bEnable);
+
+ // force module enabled, if extraicon plugin was found
+ if (bEnable) {
+ // hook events
+ if (hChangedHook == NULL)
+ hChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
+
+ if (hApplyIconHook == NULL)
+ hApplyIconHook = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcons);
+
+ if (ghExtraIconSvc == INVALID_HANDLE_VALUE) {
+ EXTRAICON_INFO ico = { sizeof(ico) };
+ ico.type = EXTRAICON_TYPE_ICOLIB;
+ ico.name = "sms"; //must be the same as the group name in extraicon
+ ico.description = "(uinfoex)";
+ ico.descIcon = ICO_BTN_CELLULAR;
+ ghExtraIconSvc = (HANDLE)CallService(MS_EXTRAICON_REGISTER, (WPARAM)&ico, 0);
}
- else
- {
- if (hChangedHook)
- {
- UnhookEvent(hChangedHook);
- hChangedHook = NULL;
- }
- if (hApplyIconHook)
- {
- UnhookEvent(hApplyIconHook);
- hApplyIconHook = NULL;
- }
- if (hRebuildIconsHook)
- {
- UnhookEvent(hRebuildIconsHook);
- hRebuildIconsHook = NULL;
- }
+ }
+ else {
+ if (hChangedHook) {
+ UnhookEvent(hChangedHook);
+ hChangedHook = NULL;
+ }
+ if (hApplyIconHook) {
+ UnhookEvent(hApplyIconHook);
+ hApplyIconHook = NULL;
+ }
+ if (hRebuildIconsHook) {
+ UnhookEvent(hRebuildIconsHook);
+ hRebuildIconsHook = NULL;
}
- SvcPhoneApplyCListIcons();
}
+ SvcPhoneApplyCListIcons();
}
/**
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp
index ae7de9fb81..3781145d11 100644
--- a/plugins/UserInfoEx/src/svc_reminder.cpp
+++ b/plugins/UserInfoEx/src/svc_reminder.cpp
@@ -2,7 +2,7 @@
UserinfoEx plugin for Miranda IM
Copyright:
-© 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
+� 2006-2010 DeathAxe, Yasnovidyashii, Merlin, K. Romanov, Kreol
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@@ -983,19 +983,11 @@ VOID SvcReminderEnable(BOOLEAN bEnable)
ZeroMemory(&ico,sizeof(ico));
}
// init hooks
- if (!ghCListIR)
- {
- ghCListIR = HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, (MIRANDAHOOK)OnCListRebuildIcons);
- }
-
if (!ghCListIA)
- {
ghCListIA = HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, (MIRANDAHOOK)OnCListApplyIcon);
- }
+
if (!ghSettingsChanged && !myGlobals.UseDbxTree)
- {
ghSettingsChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, (MIRANDAHOOK)OnContactSettingChanged);
- }
// reinit reminder options
gRemindOpts.RemindState = DB::Setting::GetByte(SET_REMIND_ENABLED, DEFVAL_REMIND_ENABLED);