diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-07 10:31:56 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-07 10:31:56 +0000 |
commit | 767d070330f3fb669495b2e3481f0c8abfcd1300 (patch) | |
tree | 7f602995f26ad699be203d535a469a895268e49c /plugins | |
parent | 5ad48842d4520b3f34283c6c48be98ddbe9f23d5 (diff) |
- one more crash fix;
- cache functionality fixed;
- strange type 'boolean' removed
- all header files included into project
git-svn-id: http://svn.miranda-ng.org/main/trunk@811 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
51 files changed, 1880 insertions, 2190 deletions
diff --git a/plugins/Clist_modern/clist_modern_10.vcxproj b/plugins/Clist_modern/clist_modern_10.vcxproj index 0d551cafe7..06921757ee 100644 --- a/plugins/Clist_modern/clist_modern_10.vcxproj +++ b/plugins/Clist_modern/clist_modern_10.vcxproj @@ -250,7 +250,32 @@ <ClCompile Include="modern_xptheme.cpp" />
</ItemGroup>
<ItemGroup>
+ <ClInclude Include="hdr\modern_cache_funcs.h" />
+ <ClInclude Include="hdr\modern_callproc.h" />
+ <ClInclude Include="hdr\modern_clc.h" />
+ <ClInclude Include="hdr\modern_clcpaint.h" />
+ <ClInclude Include="hdr\modern_clist.h" />
+ <ClInclude Include="hdr\modern_clui.h" />
+ <ClInclude Include="hdr\modern_cluiframes.h" />
<ClInclude Include="hdr\modern_commonheaders.h" />
+ <ClInclude Include="hdr\modern_commonprototypes.h" />
+ <ClInclude Include="hdr\modern_defsettings.h" />
+ <ClInclude Include="hdr\modern_effectenum.h" />
+ <ClInclude Include="hdr\modern_image_array.h" />
+ <ClInclude Include="hdr\modern_layered_window_engine.h" />
+ <ClInclude Include="hdr\modern_log.h" />
+ <ClInclude Include="hdr\modern_popup.h" />
+ <ClInclude Include="hdr\modern_row.h" />
+ <ClInclude Include="hdr\modern_rowheight_funcs.h" />
+ <ClInclude Include="hdr\modern_skinengine.h" />
+ <ClInclude Include="hdr\modern_skinned_profile.h" />
+ <ClInclude Include="hdr\modern_static_clui.h" />
+ <ClInclude Include="hdr\modern_static_cluiframes_service.h" />
+ <ClInclude Include="hdr\modern_statusbar.h" />
+ <ClInclude Include="hdr\modern_statusmodes.h" />
+ <ClInclude Include="hdr\modern_sync.h" />
+ <ClInclude Include="hdr\modern_tstring.h" />
+ <ClInclude Include="hdr\MString.h" />
<ClInclude Include="version.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="hdr\modern_awaymsg.h" />
diff --git a/plugins/Clist_modern/clist_modern_10.vcxproj.filters b/plugins/Clist_modern/clist_modern_10.vcxproj.filters index 4cd0989330..2cc9a482c0 100644 --- a/plugins/Clist_modern/clist_modern_10.vcxproj.filters +++ b/plugins/Clist_modern/clist_modern_10.vcxproj.filters @@ -188,6 +188,81 @@ <ClInclude Include="hdr\modern_global_structure.h">
<Filter>Header Files</Filter>
</ClInclude>
+ <ClInclude Include="hdr\modern_cache_funcs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_callproc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_clc.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_clcpaint.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_clist.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_clui.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_cluiframes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_commonprototypes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_defsettings.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_effectenum.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_image_array.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_layered_window_engine.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_log.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_popup.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_row.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_rowheight_funcs.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_skinengine.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_skinned_profile.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_static_clui.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_static_cluiframes_service.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_statusbar.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_statusmodes.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_sync.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\modern_tstring.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="hdr\MString.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="resource.rc">
diff --git a/plugins/Clist_modern/hdr/modern_clist.h b/plugins/Clist_modern/hdr/modern_clist.h index 1c1d34ee02..f82e4c75bd 100644 --- a/plugins/Clist_modern/hdr/modern_clist.h +++ b/plugins/Clist_modern/hdr/modern_clist.h @@ -76,41 +76,42 @@ public: };
-struct tag_DNCE{
- HANDLE m_cache_hContact;
- TCHAR* m_cache_tcsName;
-#if defined( _UNICODE )
- char* m_cache_szName;
-#endif
- TCHAR* m_cache_tcsGroup;
- int m_cache_nHidden;
- int m_cache_nNoHiddenOffline;
-
- char* m_cache_cszProto;
- boolean m_cache_bProtoNotExists;
- int m_cache_nStatus;
- int m_cache_nHiddenSubcontact;
-
- int i;
- int ApparentMode;
- int NotOnList;
- int IdleTS;
- void* ClcContact;
- BYTE IsExpanded;
- boolean isUnknown;
-
- TCHAR * szSecondLineText;
+struct tag_DNCE
+{
+ HANDLE m_cache_hContact;
+ TCHAR* m_cache_tcsName;
+
+ TCHAR* m_cache_tcsGroup;
+ int m_cache_nHidden;
+ int m_cache_nNoHiddenOffline;
+
+ char* m_cache_cszProto;
+ bool m_cache_bProtoNotExists;
+ int m_cache_nStatus;
+ int m_cache_nHiddenSubcontact;
+
+ int i;
+ int ApparentMode;
+ int NotOnList;
+ int IdleTS;
+ void* ClcContact;
+ BYTE IsExpanded;
+ bool isUnknown;
+
+ TCHAR* szSecondLineText;
CSmileyString ssSecondLine;
- TCHAR * szThirdLineText;
+ TCHAR* szThirdLineText;
CSmileyString ssThirdLine;
- HANDLE hTimeZone;
- DWORD dwLastMsgTime;
-};
-typedef tag_DNCE displayNameCacheEntry,*pdisplayNameCacheEntry, *PDNCE;
+ HANDLE hTimeZone;
+ DWORD dwLastMsgTime;
+ void getName(void);
+ void freeName(void);
+};
+typedef tag_DNCE displayNameCacheEntry,*pdisplayNameCacheEntry, *PDNCE;
typedef struct tagEXTRASLOTINFO
{
diff --git a/plugins/Clist_modern/hdr/modern_commonheaders.h b/plugins/Clist_modern/hdr/modern_commonheaders.h index 86f649df78..6b32f8e74b 100644 --- a/plugins/Clist_modern/hdr/modern_commonheaders.h +++ b/plugins/Clist_modern/hdr/modern_commonheaders.h @@ -173,20 +173,14 @@ extern char *g_szMetaModuleName; #define SCF_TOP 3
#define SCF_BOTTOM 6
-
-extern char* __cdecl strstri( char *a, const char *b);
-extern BOOL __cdecl mir_bool_strcmpi(const char *a, const char *b);
-extern int __cdecl mir_strcmp (const char *a, const char *b);
-extern int __cdecl mir_strlen (const char *a);
-extern int __cdecl mir_strcmpi(const char *a, const char *b);
-extern int __cdecl mir_tstrcmpi(const TCHAR *a, const TCHAR *b);
-extern BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b);
-extern DWORD exceptFunction(LPEXCEPTION_POINTERS EP);
-
-extern HANDLE ModernHookEvent( char *EventID, MIRANDAHOOK HookProc );
-
-extern int ModernUnhookEvent(HANDLE hHook);
-extern int UnhookAll();
+char* __cdecl strstri( char *a, const char *b);
+BOOL __cdecl mir_bool_strcmpi(const char *a, const char *b);
+int __cdecl mir_strcmp (const char *a, const char *b);
+int __cdecl mir_strlen (const char *a);
+int __cdecl mir_strcmpi(const char *a, const char *b);
+int __cdecl mir_tstrcmpi(const TCHAR *a, const TCHAR *b);
+BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b);
+DWORD exceptFunction(LPEXCEPTION_POINTERS EP);
#ifndef MYCMP
#define MYCMP 1
diff --git a/plugins/Clist_modern/hdr/modern_commonprototypes.h b/plugins/Clist_modern/hdr/modern_commonprototypes.h index 91ca540fd9..58cd28c7a9 100644 --- a/plugins/Clist_modern/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/hdr/modern_commonprototypes.h @@ -104,7 +104,7 @@ INT_PTR CLUI_GetConnectingIconService(WPARAM wParam,LPARAM lParam); int CLUI_HideBehindEdge();
int CLUI_IconsChanged(WPARAM,LPARAM);
int CLUI_IsInMainWindow(HWND hwnd);
-HICON CLUI_LoadIconFromExternalFile (char *filename,int i,boolean UseLibrary,boolean registerit,char *IconName,char *SectName,char *Description,int internalidx, BOOL * needFree);
+HICON CLUI_LoadIconFromExternalFile (char *filename,int i,BOOL UseLibrary,bool registerit,char *IconName,char *SectName,char *Description,int internalidx, BOOL * needFree);
int CLUI_OnSkinLoad(WPARAM wParam, LPARAM lParam);
int CLUI_ReloadCLUIOptions();
int CLUI_ShowFromBehindEdge();
diff --git a/plugins/Clist_modern/hdr/modern_static_clui.h b/plugins/Clist_modern/hdr/modern_static_clui.h index e03008951b..f54fae26c4 100644 --- a/plugins/Clist_modern/hdr/modern_static_clui.h +++ b/plugins/Clist_modern/hdr/modern_static_clui.h @@ -185,9 +185,6 @@ static HANDLE hRenameMenuItem, hShowAvatarMenuItem, hHideAvatarMenuItem; - -static HANDLE hSettingChangedHook=NULL; - static UINT uMsgGetProfile=0; static int nLastRequiredHeight=0, diff --git a/plugins/Clist_modern/init.cpp b/plugins/Clist_modern/init.cpp index 6a42b4188d..50674dffa4 100644 --- a/plugins/Clist_modern/init.cpp +++ b/plugins/Clist_modern/init.cpp @@ -136,8 +136,6 @@ PLUGININTERFACE int Unload(void) if (IsWindow(pcli->hwndContactList)) DestroyWindow(pcli->hwndContactList);
pcli->hwndContactList = NULL;
- UnhookAll();
-
BackgroundsUnloadModule();
SkinEngineUnloadModule();
XPThemesUnloadModule();
diff --git a/plugins/Clist_modern/modern_aniavatars.cpp b/plugins/Clist_modern/modern_aniavatars.cpp index 7c4b166eca..6e9acf04d5 100644 --- a/plugins/Clist_modern/modern_aniavatars.cpp +++ b/plugins/Clist_modern/modern_aniavatars.cpp @@ -41,7 +41,7 @@ BOOL GDIPlus_IsAnimatedGif (TCHAR * szName); /* Next is module */
#define ANIAVAWINDOWCLASS _T("MirandaModernAniAvatar")
-#define aacheck if (!AniAva.bModuleStarted) return
+#define aacheck if ( !AniAva.bModuleStarted) return
#define aalock EnterCriticalSection(&AniAva.CS)
#define aaunlock LeaveCriticalSection(&AniAva.CS)
@@ -194,7 +194,7 @@ int AniAva_InitModule() {
memset(&AniAva,0,sizeof(AniAva));
if (g_CluiData.fGDIPlusFail) return 0;
- if (!( db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail))
+ if ( !( db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail))
&& db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)) ) return 0;
{
WNDCLASSEX wc;
@@ -215,7 +215,7 @@ int AniAva_InitModule() AniAva.bModuleStarted = TRUE;
AniAva.hExitEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
AniAva.AnimationThreadID = (DWORD)mir_forkthread(_AniAva_AnimationTreadProc, (void*)AniAva.hExitEvent);
- ModernHookEvent(ME_SYSTEM_PRESHUTDOWN, _AniAva_OnModulesUnload);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, _AniAva_OnModulesUnload);
_AniAva_LoadOptions();
@@ -269,7 +269,7 @@ int AniAva_UpdateOptions() AniAva_InitModule();
bReloadAvatars = TRUE;
}
- else if (!bBeEnabled && AniAva.bModuleStarted)
+ else if ( !bBeEnabled && AniAva.bModuleStarted)
{
AniAva_UnloadModule();
bReloadAvatars = TRUE;
@@ -290,7 +290,7 @@ int AniAva_AddAvatar(HANDLE hContact, TCHAR * szFilename, int width, int heigth) {
int res = 0;
aacheck 0;
- if (!GDIPlus_IsAnimatedGif (szFilename))
+ if ( !GDIPlus_IsAnimatedGif (szFilename))
return 0;
aalock;
{
@@ -398,7 +398,7 @@ int AniAva_SetAvatarPos(HANDLE hContact, RECT * rc, int overlayIdx, BYTE bAlpha) if ( pai )
{
ANIAVA_POSINFO * api = (ANIAVA_POSINFO *)malloc(sizeof(ANIAVA_POSINFO));
- if (!pai->hWindow)
+ if ( !pai->hWindow)
{
HWND hwnd;
HWND parent;
@@ -495,7 +495,7 @@ int AniAva_RemoveInvalidatedAvatars() {
if (pai->hWindow) _AniAva_DestroyAvatarWindow(pai->hWindow);
pai->hWindow = NULL;
- if (!keepAvatar) _AniAva_RealRemoveAvatar(pai->dwAvatarUniqId);
+ if ( !keepAvatar) _AniAva_RealRemoveAvatar(pai->dwAvatarUniqId);
mir_free(pai);
List_Remove(AniAva.Objects,i);
i--;
@@ -543,7 +543,7 @@ static HWND _AniAva_CreateAvatarWindowSync(TCHAR *szFileName) {
ANIAVA_SYNCCALLITEM item = {0};
int res = 0;
- if (!AniAva.AnimationThreadHandle) return NULL;
+ if ( !AniAva.AnimationThreadHandle) return NULL;
if (AniAva.AnimationThreadID == 0) return NULL;
item.wParam = (WPARAM) szFileName;
item.lParam = 0;
@@ -657,7 +657,7 @@ static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height aai.FrameSize.cx = width;
aai.FrameSize.cy = height;
- if (!List_GetIndex(AniAva.AniAvatarList,(void*)&aai,&idx)) idx = -1;
+ if ( !List_GetIndex(AniAva.AniAvatarList,(void*)&aai,&idx)) idx = -1;
if (idx == -1) //item not present in list
{
HBITMAP hBitmap = NULL;
@@ -827,7 +827,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL hOldBmp = (HBITMAP)SelectObject(tempDC,hBmp);
if ( AniAva.bFlags & AAO_ROUND_CORNERS )
{
- if (!cornerRadius) //auto radius
+ if ( !cornerRadius) //auto radius
cornerRadius = min(szWnd.cx, szWnd.cy )/5;
}
if ( AniAva.bFlags & AAO_HAS_BORDER )
@@ -922,7 +922,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL ske_AlphaBlend( hdcParent, rcInParent->left, rcInParent->top, szWnd.cx, szWnd.cy, copyFromDC, pt_from.x, pt_from.y, szWnd.cx, szWnd.cy, abf);
}
}
- else if (!g_proc_UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0,0,0), &bf, ULW_ALPHA ))
+ else if ( !g_proc_UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0,0,0), &bf, ULW_ALPHA ))
{
LONG exStyle;
exStyle = GetWindowLongPtr(dat->hWindow,GWL_EXSTYLE);
@@ -948,7 +948,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL DeleteDC(tempDC);
}
}
- if (!dat->bPlaying)
+ if ( !dat->bPlaying)
{
ShowWindow(dat->hWindow, SW_HIDE);
KillTimer(dat->hWindow,2); //stop animation till set pos will be called
@@ -1154,13 +1154,13 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case AAM_SETPOSITION:
{
ANIAVA_POSINFO * papi = (ANIAVA_POSINFO *)lParam;
- if (!dat->delaysInterval) return 0;
- if (!papi) return 0;
+ if ( !dat->delaysInterval) return 0;
+ if ( !papi) return 0;
dat->rcPos = papi->rcPos;
dat->overlayIconIdx = papi->idxOverlay;
dat->bAlpha = papi->bAlpha;
free(papi);
- if (!dat->bPlaying)
+ if ( !dat->bPlaying)
{
dat->bPlaying = TRUE;
ShowWindow(hwnd,SW_SHOWNA);
@@ -1185,7 +1185,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR LONG exStyle;
exStyle = GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE);
SetWindowPos(pcli->hwndContactList,hwnd,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
- if (!(exStyle&WS_EX_TOPMOST))
+ if ( !(exStyle&WS_EX_TOPMOST))
SetWindowPos(pcli->hwndContactList,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
}
return 0;
@@ -1204,7 +1204,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR LONG exStyle;
exStyle = GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE);
SetWindowPos(pcli->hwndContactList,hwnd,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
- if (!(exStyle&WS_EX_TOPMOST))
+ if ( !(exStyle&WS_EX_TOPMOST))
SetWindowPos(pcli->hwndContactList,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
}
}
@@ -1243,7 +1243,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR }
case WM_TIMER:
{
- if (!IsWindowVisible(hwnd))
+ if ( !IsWindowVisible(hwnd))
{
DestroyWindow(hwnd);
return 0;
diff --git a/plugins/Clist_modern/modern_awaymsg.cpp b/plugins/Clist_modern/modern_awaymsg.cpp index 387662caac..52d59881d3 100644 --- a/plugins/Clist_modern/modern_awaymsg.cpp +++ b/plugins/Clist_modern/modern_awaymsg.cpp @@ -75,7 +75,7 @@ static int amAddHandleToChain(HANDLE hContact) }
} while(wChain = (AMCHAINITEM *)wChain->Next);
}
- if (!amFirstChainItem)
+ if ( !amFirstChainItem)
{
amFirstChainItem = (AMCHAINITEM*)malloc(sizeof(AMCHAINITEM));
workChain = amFirstChainItem;
@@ -144,7 +144,7 @@ static int amThreadProc(HWND hwnd) Sync(CLUI_SyncGetPDNCE, (WPARAM) 0,(LPARAM)&dnce);
if (dnce.ApparentMode != ID_STATUS_OFFLINE) //don't ask if contact is always invisible (should be done with protocol)
ACK = (HANDLE)CallContactService(hContact,PSS_GETAWAYMSG,0,0);
- if (!ACK)
+ if ( !ACK)
{
ACKDATA ack;
ack.hContact = hContact;
@@ -205,7 +205,7 @@ BOOL amWakeThread() void amRequestAwayMsg(HANDLE hContact)
{
char *szProto;
- if (!g_CluiData.bInternalAwayMsgDiscovery || !hContact)
+ if ( !g_CluiData.bInternalAwayMsgDiscovery || !hContact)
return;
//Do not re-ask for chat rooms
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
diff --git a/plugins/Clist_modern/modern_cachefuncs.cpp b/plugins/Clist_modern/modern_cachefuncs.cpp index 011290186c..68ec4ba42c 100644 --- a/plugins/Clist_modern/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/modern_cachefuncs.cpp @@ -75,7 +75,7 @@ void Cache_GetTimezone(struct ClcData *dat, HANDLE hContact) void Cache_GetText(struct ClcData *dat, struct ClcContact *contact, BOOL forceRenew)
{
Cache_GetFirstLineText(dat, contact);
- if (!dat->force_in_dialog) {
+ if ( !dat->force_in_dialog) {
PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry(contact->hContact);
if ((dat->second_line_show && (forceRenew || pdnce->szSecondLineText == NULL)) || (dat->third_line_show && (forceRenew || pdnce->szThirdLineText == NULL)))
@@ -198,7 +198,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, PDNCE pdnce, TCHAR * s DestroySmileyList();
- if (!dat->text_replace_smileys || !replace_smileys || szText == NULL)
+ if ( !dat->text_replace_smileys || !replace_smileys || szText == NULL)
return;
int text_size = (int)_tcslen( szText );
@@ -300,9 +300,9 @@ int GetStatusName(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_prio if (nStatus == ID_STATUS_OFFLINE || nStatus == 0) noXstatus = TRUE;
text[0] = '\0';
// Get XStatusName
- if (!noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto) {
+ if ( !noAwayMsg && !noXstatus && xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -322,9 +322,9 @@ int GetStatusName(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_prio }
// Get XStatusName
- if (!noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto) {
+ if ( !noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -350,7 +350,7 @@ void GetListeningTo(TCHAR *text, int text_size, PDNCE pdnce) if (wStatus == ID_STATUS_OFFLINE || wStatus == 0)
return;
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv)) {
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
}
@@ -371,9 +371,9 @@ int GetStatusMessage(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_ if (wStatus == ID_STATUS_OFFLINE || wStatus == 0) noAwayMsg = TRUE;
// Get XStatusMsg
- if (!noAwayMsg && xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto) {
+ if ( !noAwayMsg && xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto) {
// Try to get XStatusMsg
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -385,7 +385,7 @@ int GetStatusMessage(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_ // Get StatusMsg
if (pdnce->m_cache_hContact && text[0] == '\0') {
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, "CList", "StatusMsg", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, "CList", "StatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -396,9 +396,9 @@ int GetStatusMessage(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_ }
// Get XStatusMsg
- if (!noAwayMsg && !xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto && text[0] == '\0') {
+ if ( !noAwayMsg && !xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto && text[0] == '\0') {
// Try to get XStatusMsg
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
//lstrcpyn(text, dbv.pszVal, text_size);
CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
@@ -441,7 +441,7 @@ int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR * case TEXT_NICKNAME:
if (pdnce->m_cache_hContact && pdnce->m_cache_cszProto) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
lstrcpyn(text, dbv.ptszVal, text_size);
db_free(&dbv);
CopySkipUnprintableChars(text, text, text_size-1);
@@ -455,7 +455,7 @@ int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR * DBVARIANT dbv = {0};
// Try to get XStatusName
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
if (dbv.pszVal != NULL && dbv.pszVal[0] != 0) {
TCHAR *tmp = NEWTSTR_ALLOCA(text);
mir_sntprintf(text, text_size, _T("%s: %s"), dbv.pszVal, tmp);
@@ -467,7 +467,7 @@ int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR * else if (use_name_and_message_for_xstatus && xstatus_has_priority) {
DBVARIANT dbv = {0};
// Try to get XStatusName
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
if (dbv.pszVal != NULL && dbv.pszVal[0] != 0)
mir_sntprintf(text, text_size, _T("%s"), dbv.pszVal);
CopySkipUnprintableChars(text, text, text_size-1);
@@ -527,7 +527,7 @@ void Cache_GetFirstLineText(struct ClcData *dat, struct ClcContact *contact) TCHAR *name = pcli->pfnGetContactDisplayName(contact->hContact,0);
if (dat->first_line_append_nick && (!dat->force_in_dialog)) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
TCHAR nick[SIZEOF(contact->szText)];
lstrcpyn(nick, dbv.ptszVal, SIZEOF(contact->szText));
db_free(&dbv);
@@ -543,7 +543,7 @@ void Cache_GetFirstLineText(struct ClcData *dat, struct ClcContact *contact) }
else lstrcpyn(contact->szText, name, SIZEOF(contact->szText));
- if (!dat->force_in_dialog) {
+ if ( !dat->force_in_dialog) {
struct SHORTDATA data = {0};
Sync(CLUI_SyncGetShortData,(WPARAM)pcli->hwndContactTree,(LPARAM)&data);
contact->ssText.ReplaceSmileys(&data, pdnce, contact->szText, dat->first_line_draw_smileys);
@@ -563,8 +563,7 @@ void Cache_GetSecondLineText(struct SHORTDATA *dat, PDNCE pdnce) type = Cache_GetLineText(pdnce, dat->second_line_type, (TCHAR*)Text, SIZEOF(Text), dat->second_line_text,
dat->second_line_xstatus_has_priority,dat->second_line_show_status_if_no_away,dat->second_line_show_listening_if_no_away,
dat->second_line_use_name_and_message_for_xstatus, dat->contact_time_show_only_if_different);
- Text[SIZEOF(Text)-1] = _T('\0'); //to be sure that it is null terminated string
- //LockCacheItem(hContact, __FILE__,__LINE__);
+ Text[SIZEOF(Text)-1] = 0; //to be sure that it is null terminated string
mir_free(pdnce->szSecondLineText);
@@ -573,18 +572,12 @@ void Cache_GetSecondLineText(struct SHORTDATA *dat, PDNCE pdnce) else
pdnce->szSecondLineText = NULL;
- if (pdnce->szSecondLineText)
- {
+ if (pdnce->szSecondLineText) {
if (type == TEXT_LISTENING_TO && pdnce->szSecondLineText[0] != _T('\0'))
- {
pdnce->ssSecondLine.AddListeningToIcon(dat, pdnce, pdnce->szSecondLineText, dat->second_line_draw_smileys);
- }
else
- {
pdnce->ssSecondLine.ReplaceSmileys(dat, pdnce, pdnce->szSecondLineText, dat->second_line_draw_smileys);
- }
}
- //UnlockCacheItem(hContact);
}
/*
@@ -599,8 +592,7 @@ void Cache_GetThirdLineText(struct SHORTDATA *dat, PDNCE pdnce) dat->third_line_xstatus_has_priority,dat->third_line_show_status_if_no_away,dat->third_line_show_listening_if_no_away,
dat->third_line_use_name_and_message_for_xstatus, dat->contact_time_show_only_if_different);
- // LockCacheItem(hContact, __FILE__,__LINE__);
- Text[SIZEOF(Text)-1] = _T('\0'); //to be sure that it is null terminated string
+ Text[SIZEOF(Text)-1] = 0; //to be sure that it is null terminated string
mir_free(pdnce->szThirdLineText);
@@ -609,28 +601,20 @@ void Cache_GetThirdLineText(struct SHORTDATA *dat, PDNCE pdnce) else
pdnce->szThirdLineText = NULL;
- if (pdnce->szThirdLineText)
- {
+ if (pdnce->szThirdLineText) {
if (type == TEXT_LISTENING_TO && pdnce->szThirdLineText[0] != _T('\0'))
- {
pdnce->ssThirdLine.AddListeningToIcon(dat, pdnce, pdnce->szThirdLineText, dat->third_line_draw_smileys);
- }
else
- {
pdnce->ssThirdLine.ReplaceSmileys(dat, pdnce, pdnce->szThirdLineText, dat->third_line_draw_smileys);
- }
}
- // UnlockCacheItem(hContact);
}
-
void RemoveTag(TCHAR *to, TCHAR *tag)
{
TCHAR * st = to;
int len = (int)_tcslen(tag);
int lastsize = (int)_tcslen(to)+1;
- while (st = _tcsstr(st,tag))
- {
+ while (st = _tcsstr(st,tag)) {
lastsize -= len;
memmove((void*)st,(void*)(st+len),(lastsize)*sizeof(TCHAR));
}
@@ -645,47 +629,43 @@ static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size) DWORD i;
BOOL keep = 0;
TCHAR * cp = to;
- if (!to) return 0;
- if (!buf)
- {
+ if ( !to) return 0;
+ if ( !buf) {
to[0] = '\0';
return 0;
}
- for (i=0; i < size; i++)
- {
+
+ for (i=0; i < size; i++) {
if (buf[i] == 0) break;
- if (buf[i]>0 && buf[i] < ' ')
- {
+ if (buf[i] > 0 && buf[i] < ' ') {
*cp = ' ';
- if (!keep) cp++;
+ if ( !keep) cp++;
keep = 1;
}
- else
- {
+ else {
keep = 0;
*cp = buf[i];
cp++;
}
}
*cp = 0;
- {
- //remove bbcodes: [b] [i] [u] <b> <i> <u>
- RemoveTag(to,_T("[b]")); RemoveTag(to,_T("[/b]"));
- RemoveTag(to,_T("[u]")); RemoveTag(to,_T("[/u]"));
- RemoveTag(to,_T("[i]")); RemoveTag(to,_T("[/i]"));
-
- RemoveTag(to,_T("<b>")); RemoveTag(to,_T("</b>"));
- RemoveTag(to,_T("<u>")); RemoveTag(to,_T("</u>"));
- RemoveTag(to,_T("<i>")); RemoveTag(to,_T("</i>"));
-
- RemoveTag(to,_T("[B]")); RemoveTag(to,_T("[/b]"));
- RemoveTag(to,_T("[U]")); RemoveTag(to,_T("[/u]"));
- RemoveTag(to,_T("[I]")); RemoveTag(to,_T("[/i]"));
-
- RemoveTag(to,_T("<B>")); RemoveTag(to,_T("</B>"));
- RemoveTag(to,_T("<U>")); RemoveTag(to,_T("</U>"));
- RemoveTag(to,_T("<I>")); RemoveTag(to,_T("</I>"));
- }
+
+ //remove bbcodes: [b] [i] [u] <b> <i> <u>
+ RemoveTag(to,_T("[b]")); RemoveTag(to,_T("[/b]"));
+ RemoveTag(to,_T("[u]")); RemoveTag(to,_T("[/u]"));
+ RemoveTag(to,_T("[i]")); RemoveTag(to,_T("[/i]"));
+
+ RemoveTag(to,_T("<b>")); RemoveTag(to,_T("</b>"));
+ RemoveTag(to,_T("<u>")); RemoveTag(to,_T("</u>"));
+ RemoveTag(to,_T("<i>")); RemoveTag(to,_T("</i>"));
+
+ RemoveTag(to,_T("[B]")); RemoveTag(to,_T("[/b]"));
+ RemoveTag(to,_T("[U]")); RemoveTag(to,_T("[/u]"));
+ RemoveTag(to,_T("[I]")); RemoveTag(to,_T("[/i]"));
+
+ RemoveTag(to,_T("<B>")); RemoveTag(to,_T("</B>"));
+ RemoveTag(to,_T("<U>")); RemoveTag(to,_T("</U>"));
+ RemoveTag(to,_T("<I>")); RemoveTag(to,_T("</I>"));
return i;
}
@@ -700,22 +680,22 @@ static BOOL ExecuteOnAllContacts(struct ClcData *dat, ExecuteOnAllContactsFuncPt static BOOL ExecuteOnAllContactsOfGroup(struct ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param)
{
- if (!group)
+ if ( !group)
return TRUE;
for (int scanIndex = 0 ; scanIndex < group->cl.count ; scanIndex++) {
if (group->cl.items[scanIndex]->type == CLCIT_CONTACT) {
- if (!func(group->cl.items[scanIndex], FALSE, param))
+ if ( !func(group->cl.items[scanIndex], FALSE, param))
return FALSE;
if (group->cl.items[scanIndex]->SubAllocated > 0) {
for (int i=0 ; i < group->cl.items[scanIndex]->SubAllocated ; i++)
- if (!func(&group->cl.items[scanIndex]->subcontacts[i], TRUE, param))
+ if ( !func(&group->cl.items[scanIndex]->subcontacts[i], TRUE, param))
return FALSE;
}
}
else if (group->cl.items[scanIndex]->type == CLCIT_GROUP)
- if (!ExecuteOnAllContactsOfGroup(group->cl.items[scanIndex]->group, func, param))
+ if ( !ExecuteOnAllContactsOfGroup(group->cl.items[scanIndex]->group, func, param))
return FALSE;
}
@@ -745,7 +725,6 @@ BOOL ReduceAvatarPosition(struct ClcContact *contact, BOOL subcontact, void *par return TRUE;
}
-
void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact)
{
struct avatarCacheEntry * ace = contact->avatar_data;
@@ -801,7 +780,7 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) int w = width_clip;
int h = height_clip;
- if (!g_CluiData.fGDIPlusFail) //Use gdi+ engine
+ if ( !g_CluiData.fGDIPlusFail) //Use gdi+ engine
DrawAvatarImageWithGDIp(hdc, 0, 0, w, h,ace->hbmPic,0,0,ace->bmWidth,ace->bmHeight,ace->dwFlags,255);
else {
if ( !(ace->dwFlags & AVS_PREMULTIPLIED)) {
@@ -890,7 +869,7 @@ void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact) if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0))
{
DBVARIANT dbv;
- if (!DBGetContactSettingTString(contact->hContact, "ContactPhoto", "File", &dbv))
+ if ( !DBGetContactSettingTString(contact->hContact, "ContactPhoto", "File", &dbv))
{
HBITMAP hBmp = (HBITMAP) CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
if (hBmp != NULL)
@@ -987,6 +966,3 @@ void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact) }
}
}
-
-
-
diff --git a/plugins/Clist_modern/modern_clc.cpp b/plugins/Clist_modern/modern_clc.cpp index 0e2d875b4b..0fde86687d 100644 --- a/plugins/Clist_modern/modern_clc.cpp +++ b/plugins/Clist_modern/modern_clc.cpp @@ -44,7 +44,6 @@ int ModernSkinOptInit(WPARAM wParam,LPARAM lParam); * Private module variables
*/
static HANDLE hShowInfoTipEvent;
-static HANDLE hSettingChanged;
static POINT HitPoint;
static BOOL fMouseUpped;
static BYTE IsDragToScrollMode = 0;
@@ -70,8 +69,8 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) if (MirandaExiting())
return 0;
- ModernHookEvent(ME_MODERNOPT_INITIALIZE,ModernOptInit);
- ModernHookEvent(ME_MODERNOPT_INITIALIZE,ModernSkinOptInit);
+ HookEvent(ME_MODERNOPT_INITIALIZE,ModernOptInit);
+ HookEvent(ME_MODERNOPT_INITIALIZE,ModernSkinOptInit);
if (ServiceExists(MS_MC_DISABLEHIDDENGROUP))
CallService(MS_MC_DISABLEHIDDENGROUP, (WPARAM)TRUE, (LPARAM)0);
@@ -115,7 +114,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) clcHookIconsChanged(0,0);
- hIconChangedHook = ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
+ hIconChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
// Register smiley category
if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY)) {
@@ -127,7 +126,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) CallService(MS_SMILEYADD_REGISTERCATEGORY, 0, (LPARAM)&rc);
- hSmileyAddOptionsChangedHook = ModernHookEvent(ME_SMILEYADD_OPTIONSCHANGED,clcHookSmileyAddOptionsChanged);
+ hSmileyAddOptionsChangedHook = HookEvent(ME_SMILEYADD_OPTIONSCHANGED,clcHookSmileyAddOptionsChanged);
}
CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"List Background/CLC",0);
@@ -136,10 +135,10 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"Frames TitleBar BackGround/FrameTitleBar",0);
- ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,clcHookBkgndConfigChanged);
- ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,BgStatusBarChange);
- ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,OnFrameTitleBarBackgroundChange);
- ModernHookEvent(ME_COLOUR_RELOAD, OnFrameTitleBarBackgroundChange);
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED,clcHookBkgndConfigChanged);
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED,BgStatusBarChange);
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED,OnFrameTitleBarBackgroundChange);
+ HookEvent(ME_COLOUR_RELOAD, OnFrameTitleBarBackgroundChange);
AniAva_UpdateOptions();
return 0;
@@ -194,98 +193,64 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam) {
if (g_szMetaModuleName && !mir_strcmp(cws->szModule, g_szMetaModuleName))
{
- if (!mir_strcmp(cws->szSetting, "Enabled"))
+ if ( !mir_strcmp(cws->szSetting, "Enabled"))
pcli->pfnClcBroadcast( INTM_RELOADOPTIONS, wParam, lParam);
}
- else if (!mir_strcmp(cws->szModule, "CListGroups"))
+ else if ( !mir_strcmp(cws->szModule, "CListGroups"))
{
pcli->pfnClcBroadcast( INTM_GROUPSCHANGED,wParam,lParam);
}
- else if (!strcmp(cws->szSetting,"XStatusId") || !strcmp(cws->szSetting,"XStatusName"))
+ else if ( !strcmp(cws->szSetting,"XStatusId") || !strcmp(cws->szSetting,"XStatusName"))
{
CLUIServices_ProtocolStatusChanged(0,(LPARAM)cws->szModule);
}
}
else // (HANDLE)wParam != NULL
{
- if (!strcmp(cws->szSetting,"TickTS"))
+ if ( !strcmp(cws->szSetting,"TickTS"))
{
pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0);
}
else if (g_szMetaModuleName && !strcmp(cws->szModule,g_szMetaModuleName))
{
- if (!strcmp(cws->szSetting,"Handle"))
+ if ( !strcmp(cws->szSetting,"Handle"))
{
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED,0,0);
}
- else if (!strcmp(cws->szSetting,"Default"))
+ else if ( !strcmp(cws->szSetting,"Default"))
{
pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED,0,0);
}
}
- else if (!strcmp(cws->szModule,"UserInfo"))
+ else if ( !strcmp(cws->szModule,"UserInfo"))
{
- if (!strcmp(cws->szSetting,"Timezone"))
+ if ( !strcmp(cws->szSetting,"Timezone"))
pcli->pfnClcBroadcast( INTM_TIMEZONECHANGED,wParam,0);
}
- else if (!strcmp(cws->szModule,"CList"))
+ else if ( !strcmp(cws->szModule,"CList"))
{
- /*
- if (!strcmp(cws->szSetting,"MyHandle"))
- pcli->pfnClcBroadcast( INTM_NAMECHANGED,wParam,lParam);
- else if (!strcmp(cws->szSetting,"Group"))
- pcli->pfnClcBroadcast( INTM_GROUPCHANGED,wParam,lParam);
- else if (!strcmp(cws->szSetting,"Hidden"))
- pcli->pfnClcBroadcast( INTM_HIDDENCHANGED,wParam,lParam);
- else if (!strcmp(cws->szSetting,"noOffline"))
- pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED,wParam,lParam);
- else if (!strcmp(cws->szSetting,"NotOnList"))
- pcli->pfnClcBroadcast( INTM_NOTONLISTCHANGED,wParam,lParam);
-
- else if (!strcmp(cws->szSetting,"NameOrder"))
- pcli->pfnClcBroadcast( INTM_NAMEORDERCHANGED,0,0);
- else
-
- else if (!strcmp(cws->szSetting,"Status"))
- pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0);
- else
- */
- if (!strcmp(cws->szSetting,"StatusMsg"))
+ if ( !strcmp(cws->szSetting,"StatusMsg"))
pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0);
}
- else if (!strcmp(cws->szModule,"ContactPhoto"))
+ else if ( !strcmp(cws->szModule,"ContactPhoto"))
{
- if (!strcmp(cws->szSetting,"File"))
+ if ( !strcmp(cws->szSetting,"File"))
pcli->pfnClcBroadcast( INTM_AVATARCHANGED,wParam,0);
}
- else //if (0) //turn off
+ else
{
- {
- // if (!strcmp(cws->szSetting,"UIN"))
- // pcli->pfnClcBroadcast( INTM_NAMECHANGED,wParam,lParam);
- // else if (!strcmp(cws->szSetting,"Nick") || !strcmp(cws->szSetting,"FirstName")
- // || !strcmp(cws->szSetting,"e-mail") || !strcmp(cws->szSetting,"LastName")
- // || !strcmp(cws->szSetting,"JID"))
- // pcli->pfnClcBroadcast( INTM_NAMECHANGED,wParam,lParam);
- // else if (!strcmp(cws->szSetting,"ApparentMode"))
- // pcli->pfnClcBroadcast( INTM_APPARENTMODECHANGED,wParam,lParam);
- // else if (!strcmp(cws->szSetting,"IdleTS"))
- // pcli->pfnClcBroadcast( INTM_IDLECHANGED,wParam,lParam);
- //else
- if ((!strcmp(cws->szSetting,"XStatusName") || !strcmp(cws->szSetting,"XStatusMsg")))
- pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0);
- else if (!strcmp(cws->szSetting,"XStatusId"))
- pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0);
- else if (!strcmp(cws->szSetting,"Timezone"))
- pcli->pfnClcBroadcast( INTM_TIMEZONECHANGED,wParam,0);
- else if (!strcmp(cws->szSetting,"ListeningTo"))
- pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0);
- else if (!strcmp(cws->szSetting,"Transport") || !strcmp(cws->szSetting,"IsTransported"))
- {
- pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
- pcli->pfnClcBroadcast( CLM_AUTOREBUILD,wParam,0);
- }
+ if ((!strcmp(cws->szSetting,"XStatusName") || !strcmp(cws->szSetting,"XStatusMsg")))
+ pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0);
+ else if ( !strcmp(cws->szSetting,"XStatusId"))
+ pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0);
+ else if ( !strcmp(cws->szSetting,"Timezone"))
+ pcli->pfnClcBroadcast( INTM_TIMEZONECHANGED,wParam,0);
+ else if ( !strcmp(cws->szSetting,"ListeningTo"))
+ pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,wParam,0);
+ else if ( !strcmp(cws->szSetting,"Transport") || !strcmp(cws->szSetting,"IsTransported")) {
+ pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
+ pcli->pfnClcBroadcast( CLM_AUTOREBUILD,wParam,0);
}
}
}
@@ -319,13 +284,6 @@ static int clcHookBkgndConfigChanged(WPARAM wParam,LPARAM lParam) return 0;
}
-
-static int clcHookSystemShutdown(WPARAM wParam,LPARAM lParam)
-{
- ModernUnhookEvent(hAckHook);
- ModernUnhookEvent(hSettingChanged);
- return 0;
-}
static int clcHookAvatarChanged(WPARAM wParam, LPARAM lParam)
{
if (MirandaExiting()) return 0;
@@ -335,7 +293,7 @@ static int clcHookAvatarChanged(WPARAM wParam, LPARAM lParam) static int clcExitDragToScroll()
{
- if (!IsDragToScrollMode) return 0;
+ if ( !IsDragToScrollMode) return 0;
IsDragToScrollMode = 0;
ReleaseCapture();
return 1;
@@ -345,7 +303,7 @@ static int clcExitDragToScroll() static int clcProceedDragToScroll(HWND hwnd, int Y)
{
int pos,dy;
- if (!IsDragToScrollMode) return 0;
+ if ( !IsDragToScrollMode) return 0;
if (GetCapture() != hwnd) clcExitDragToScroll();
dy = StartDragPos-Y;
pos = StartScrollPos+dy;
@@ -390,7 +348,7 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const return foundindex;
else if (nLastFound != -1 && fSearchUp && foundindex == index)
return nLastFound;
- else if (!fSearchUp && foundindex == index)
+ else if ( !fSearchUp && foundindex == index)
fReturnAsFound = TRUE;
else
nLastFound = foundindex;
@@ -399,7 +357,7 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const }
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP)
{
- if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded)
+ if ( !(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded)
{
group = group->cl.items[group->scanIndex]->group;
group->scanIndex = 0;
@@ -416,15 +374,15 @@ static BOOL clcItemNotHiddenOffline(struct ClcData * dat, struct ClcGroup* group {
PDNCE pdnce;
- if (!group) return FALSE;
- if (!contact) return FALSE;
+ if ( !group) return FALSE;
+ if ( !contact) return FALSE;
if (group->hideOffline) return FALSE;
if (g_CluiData.bFilterEffective) return FALSE;
if (CLCItems_IsShowOfflineGroup(group)) return TRUE;
pdnce = (PDNCE)pcli->pfnGetCacheEntry( contact->hContact);
- if (!pdnce) return FALSE;
+ if ( !pdnce) return FALSE;
if (pdnce->m_cache_nNoHiddenOffline) return TRUE;
return FALSE;
@@ -440,8 +398,8 @@ static LRESULT clcOnCreate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPar dat->use_avatar_service = ServiceExists(MS_AV_GETAVATARBITMAP);
if (dat->use_avatar_service)
{
- if (!hAvatarChanged)
- hAvatarChanged = ModernHookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged);
+ if ( !hAvatarChanged)
+ hAvatarChanged = HookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged);
}
//else
//{
@@ -599,7 +557,7 @@ static LRESULT clcOnPaint(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara PAINTSTRUCT ps;
if (IsWindowVisible(hwnd))
{
- if (!g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList)
+ if ( !g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList)
{
hdc = BeginPaint(hwnd,&ps);
g_clcPainter.cliPaintClc(hwnd,dat,hdc,&ps.rcPaint);
@@ -719,7 +677,7 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa dat->selection -= contact->isSubcontact;
selMoved = 1;
}
- else if (!contact->isSubcontact && contact->SubAllocated>0)
+ else if ( !contact->isSubcontact && contact->SubAllocated>0)
{
if (changeGroupExpand == 1 && !contact->SubExpanded)
{
@@ -782,7 +740,7 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa {
if (changeGroupExpand == 1)
{
- if (!contact->group->expanded)
+ if ( !contact->group->expanded)
{
dat->selection--;
selMoved = 1;
@@ -930,7 +888,7 @@ static LRESULT clcOnSetCursor(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w {
int lResult;
- if (!CLUI_IsInMainWindow(hwnd))
+ if ( !CLUI_IsInMainWindow(hwnd))
return DefWindowProc(hwnd,msg,wParam,lParam);
if (g_CluiData.nBehindEdgeState>0)
@@ -1060,7 +1018,7 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM nm.hItem = ContactToItemHandle(contact,&nm.flags);
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
}
- if (!(hitFlags&(CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK)))
+ if ( !(hitFlags&(CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK)))
{
NMCLISTCONTROL nm;
nm.hdr.code = NM_CLICK;
@@ -1259,7 +1217,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
- if (!contSour->isSubcontact)
+ if ( !contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA));
@@ -1276,7 +1234,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
- if (!contSour->isSubcontact)
+ if ( !contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
if (contSour->subcontacts == contDest)
@@ -1294,7 +1252,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
- if (!contSour->isSubcontact)
+ if ( !contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
if (contDest->subcontacts == contSour->subcontacts)
@@ -1320,7 +1278,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (pt.x >= 0 && pt.x < clRect.right && ((pt.y < 0 && pt.y>-dat->dragAutoScrollHeight) || (pt.y >= clRect.bottom && pt.y < clRect.bottom+dat->dragAutoScrollHeight)))
{
- if (!dat->dragAutoScrolling)
+ if ( !dat->dragAutoScrolling)
{
if (pt.y < 0) dat->dragAutoScrolling = -1;
else dat->dragAutoScrolling = 1;
@@ -1349,7 +1307,7 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w {
struct ClcContact *contSour;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (!contSour->isSubcontact)
+ if ( !contSour->isSubcontact)
hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
}
break;
@@ -1414,7 +1372,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
- if (!contSour->isSubcontact)
+ if ( !contSour->isSubcontact)
{
HANDLE hDest = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be converted to MetaContact and '%s' be added to it?"),contDest->szText, contSour->szText);
@@ -1422,7 +1380,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (res == 1)
{
handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hDest,0);
- if (!handle) return 0;
+ if ( !handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
@@ -1438,7 +1396,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w {
handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0);
- if (!handle) return 0;
+ if ( !handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,(WPARAM)0,(LPARAM)hcontact);
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
@@ -1460,7 +1418,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName))
{
- if (!contSour->isSubcontact)
+ if ( !contSour->isSubcontact)
{
HANDLE handle,hcontact;
hcontact = contSour->hContact;
@@ -1470,7 +1428,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (res == 1)
{
- if (!handle) return 0;
+ if ( !handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
@@ -1499,7 +1457,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (res == 1)
{
- if (!handle) return 0;
+ if ( !handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,(WPARAM)0,(LPARAM)hcontact);
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
@@ -1520,7 +1478,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w {
if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName))
{
- if (!contSour->isSubcontact)
+ if ( !contSour->isSubcontact)
{
HANDLE handle,hcontact;
hcontact = contSour->hContact;
@@ -1530,7 +1488,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (res == 1)
{
- if (!handle) return 0;
+ if ( !handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
}
@@ -1547,7 +1505,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (res == 1)
{
- if (!handle) return 0;
+ if ( !handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,(WPARAM)0,(LPARAM)hcontact);
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
@@ -1632,7 +1590,7 @@ static LRESULT clcOnDestroy(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa DeleteObject(dat->hMenuBackground);
dat->hMenuBackground = NULL;
}
- if (!dat->bkChanged && dat->hBmpBackground)
+ if ( !dat->bkChanged && dat->hBmpBackground)
{
DeleteObject(dat->hBmpBackground);
dat->hBmpBackground = NULL;
@@ -1655,7 +1613,7 @@ static LRESULT clcOnIntmGroupChanged(struct ClcData *dat, HWND hwnd, UINT msg, W BYTE iExtraImage[MAXEXTRACOLUMNS];
WORD iWideExtraImage[MAXEXTRACOLUMNS];
BYTE flags = 0;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
{
memset(iExtraImage, 0xFF, SIZEOF(iExtraImage));
memset((void*)iWideExtraImage, 0xFF, sizeof(iWideExtraImage));
@@ -1748,7 +1706,7 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP {
shouldShow = TRUE;
}
- if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) // CLVM changed
+ if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) // CLVM changed
{
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
hSelItem = pcli->pfnContactToHItem(selcontact);
@@ -1760,12 +1718,12 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP else if (contact)
{
contact->iImage = lParam;
- if (!pcli->pfnIsHiddenMode(dat, status))
+ if ( !pcli->pfnIsHiddenMode(dat, status))
contact->flags |= CONTACTF_ONLINE;
else
contact->flags &= ~CONTACTF_ONLINE;
contact->image_is_special = image_is_special;
- if (!image_is_special) //Only if it is status changing
+ if ( !image_is_special) //Only if it is status changing
{
dat->NeedResort = 1;
needRepaint = TRUE;
@@ -1821,7 +1779,7 @@ static LRESULT clcOnIntmAvatarChanged(struct ClcData *dat, HWND hwnd, UINT msg, static LRESULT clcOnIntmTimeZoneChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct ClcContact *contact;
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if ( !FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
return corecli.pfnContactListControlWndProc(hwnd,msg,wParam,lParam);
if (contact) //!IsBadWritePtr(contact, sizeof(struct ClcContact)))
@@ -1838,7 +1796,7 @@ static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
+ if ( !FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
return ret;
lstrcpyn(contact->szText, pcli->pfnGetContactDisplayName((HANDLE)wParam,0),SIZEOF(contact->szText));
@@ -1856,7 +1814,7 @@ static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP static LRESULT clcOnIntmApparentModeChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int lResult = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if (!ServiceExists("ExtraIcon/Register"))
+ if ( !ServiceExists("ExtraIcon/Register"))
ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
return lResult;
}
@@ -1867,7 +1825,7 @@ static LRESULT clcOnIntmStatusMsgChanged(struct ClcData *dat, HWND hwnd, UINT ms HANDLE hContact = (HANDLE)wParam;
if (hContact == NULL || IsHContactInfo(hContact) || IsHContactGroup(hContact))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if (!FindItem(hwnd,dat,hContact,&contact,NULL,NULL,FALSE))
+ if ( !FindItem(hwnd,dat,hContact,&contact,NULL,NULL,FALSE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (contact)//!IsBadWritePtr(contact, sizeof(struct ClcContact)))
{
@@ -1883,7 +1841,7 @@ static LRESULT clcOnIntmNotOnListChanged(struct ClcData *dat, HWND hwnd, UINT ms DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
struct ClcContact *contact;
- if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
+ if ( !FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (contact->type != CLCIT_CONTACT)
@@ -1918,7 +1876,7 @@ static LRESULT clcOnIntmStatusChanged(struct ClcData *dat, HWND hwnd, UINT msg, {
struct ClcContact *contact = NULL;
pdnce___SetStatus( pdnce, GetStatusForContact(pdnce->m_cache_hContact,pdnce->m_cache_cszProto));
- if (!dat->force_in_dialog && (
+ if ( !dat->force_in_dialog && (
(dat->second_line_show)// && dat->second_line_type == TEXT_STATUS)
|| (dat->third_line_show)// && dat->third_line_type == TEXT_STATUS)
))
@@ -1928,7 +1886,7 @@ static LRESULT clcOnIntmStatusChanged(struct ClcData *dat, HWND hwnd, UINT msg, {
if (contact && contact->type == CLCIT_CONTACT)
{
- if (!contact->image_is_special && pdnce___GetStatus( pdnce )>ID_STATUS_OFFLINE)
+ if ( !contact->image_is_special && pdnce___GetStatus( pdnce )>ID_STATUS_OFFLINE)
contact->iImage = CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
if (contact->isSubcontact
&& contact->subcontacts
@@ -1976,25 +1934,17 @@ static LRESULT clcOnIntmReloadOptions(struct ClcData *dat, HWND hwnd, UINT msg, HRESULT ClcLoadModule()
{
g_himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
- hSettingChanged = ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED,clcHookSettingChanged);
- ModernHookEvent(ME_OPT_INITIALISE,ClcOptInit);
- hAckHook = (HANDLE)ModernHookEvent(ME_PROTO_ACK,clcHookProtoAck);
- ModernHookEvent(ME_SYSTEM_MODULESLOADED, clcHookModulesLoaded);
- ModernHookEvent(ME_DB_EVENT_ADDED, clcHookDbEventAdded);
- ModernHookEvent(ME_SYSTEM_SHUTDOWN,clcHookSystemShutdown);
+
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, clcHookSettingChanged);
+ HookEvent(ME_OPT_INITIALISE, ClcOptInit);
+ hAckHook = (HANDLE)HookEvent(ME_PROTO_ACK, clcHookProtoAck);
+ HookEvent(ME_SYSTEM_MODULESLOADED, clcHookModulesLoaded);
+ HookEvent(ME_DB_EVENT_ADDED, clcHookDbEventAdded);
return S_OK;
}
-
int ClcUnloadModule()
{
- if (hAvatarChanged != 0)
- ModernUnhookEvent(hAvatarChanged);
- if (hSmileyAddOptionsChangedHook != 0)
- ModernUnhookEvent(hSmileyAddOptionsChangedHook);
- if (hIconChangedHook != 0)
- ModernUnhookEvent(hIconChangedHook);
-
if ( g_CluiData.bOldUseGroups != (BYTE)-1 )
db_set_b(NULL,"CList","UseGroups",(BYTE)g_CluiData.bOldUseGroups );
if ( g_CluiData.boldHideOffline != (BYTE)-1 )
@@ -2002,6 +1952,7 @@ int ClcUnloadModule() return 0;
}
+
int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack)
{
if (MirandaExiting()) return 0;
@@ -2012,12 +1963,12 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) {
for (i=0; i < pcli->hClcProtoCount; i++)
{
- if (!lstrcmpA(pcli->clcProto[i].szProto, ack->szModule))
+ if ( !lstrcmpA(pcli->clcProto[i].szProto, ack->szModule))
{
pcli->clcProto[i].dwStatus = (WORD) ack->lParam;
if (pcli->clcProto[i].dwStatus >= ID_STATUS_OFFLINE)
pcli->pfnTrayIconUpdateBase(pcli->clcProto[i].szProto);
- if (!ServiceExists("ExtraIcon/Register"))
+ if ( !ServiceExists("ExtraIcon/Register"))
if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE) != -1)
ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)NULL);
return 0;
@@ -2048,7 +1999,7 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) {
char * val = db_get_sa(ack->hContact,"CList","StatusMsg");
if (val) {
- if (!mir_bool_strcmpi(val,""))
+ if ( !mir_bool_strcmpi(val,""))
db_set_s(ack->hContact,"CList","StatusMsg","");
else
gtaRenewText(ack->hContact);
@@ -2076,7 +2027,7 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) int ClcGetShortData(struct ClcData* pData, struct SHORTDATA *pShortData)
{
- if (!pData || !pShortData) return -1;
+ if ( !pData || !pShortData) return -1;
pShortData->hWnd = pData->hWnd;
pShortData->text_replace_smileys = pData->text_replace_smileys;
pShortData->text_smiley_height = pData->text_smiley_height;
@@ -2115,7 +2066,7 @@ int ClcEnterDragToScroll(HWND hwnd, int Y) struct ClcData * dat;
if (IsDragToScrollMode) return 0;
dat = (struct ClcData*)GetWindowLongPtr(hwnd,0);
- if (!dat) return 0;
+ if ( !dat) return 0;
StartDragPos = Y;
StartScrollPos = dat->yScroll;
IsDragToScrollMode = 1;
diff --git a/plugins/Clist_modern/modern_clcidents.cpp b/plugins/Clist_modern/modern_clcidents.cpp index 67374a01a5..903844eb9c 100644 --- a/plugins/Clist_modern/modern_clcidents.cpp +++ b/plugins/Clist_modern/modern_clcidents.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CacheArrSize 255
struct ClcGroup *CacheIndex[CacheArrSize] = {NULL};
-boolean CacheIndexClear = TRUE;
+bool CacheIndexClear = TRUE;
/* the CLC uses 3 different ways to identify elements in its list, this file
contains routines to convert between them.
@@ -127,7 +127,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont nowVisible = 1;
for (tgroup = group;tgroup;tgroup = tgroup->parent)
{
- if (!tgroup->expanded)
+ if ( !tgroup->expanded)
{
nowVisible = 0;
break;
@@ -142,7 +142,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (HANDLE)((UINT_PTR)hItem&~HCONTACT_ISINFO)))
{
if (isVisible) {
- if (!nowVisible) *isVisible = 0;
+ if ( !nowVisible) *isVisible = 0;
else {
int posy = cliGetRowTopY(dat,index+1);
if (posy < dat->yScroll)
@@ -160,7 +160,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont return 1;
}
- if (!isIgnoreSubcontacts &&
+ if ( !isIgnoreSubcontacts &&
IsHContactContact(hItem) &&
group->cl.items[group->scanIndex]->type == CLCIT_CONTACT &&
group->cl.items[group->scanIndex]->SubAllocated > 0)
@@ -200,7 +200,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont void ClearRowByIndexCache()
{
- if (!CacheIndexClear)
+ if ( !CacheIndexClear)
{
memset(CacheIndex,0,sizeof(CacheIndex));
CacheIndexClear = TRUE;
diff --git a/plugins/Clist_modern/modern_clcitems.cpp b/plugins/Clist_modern/modern_clcitems.cpp index 41da3057fe..1bdb89655f 100644 --- a/plugins/Clist_modern/modern_clcitems.cpp +++ b/plugins/Clist_modern/modern_clcitems.cpp @@ -100,7 +100,7 @@ void AddSubcontacts(struct ClcData *dat, struct ClcContact * cont, BOOL showOffl } }
cont->SubAllocated = i;
- if (!i && cont->subcontacts != NULL)
+ if ( !i && cont->subcontacts != NULL)
mir_free_and_nil(cont->subcontacts);
}
@@ -117,8 +117,8 @@ struct ClcGroup *cli_AddGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName, {
struct ClcGroup* result;
ClearRowByIndexCache();
- if (!dat->force_in_dialog && !(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN))
- if (!lstrcmp(_T("-@-HIDDEN-GROUP-@-"),szName)) //group is hidden
+ if ( !dat->force_in_dialog && !(GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN))
+ if ( !lstrcmp(_T("-@-HIDDEN-GROUP-@-"),szName)) //group is hidden
{
ClearRowByIndexCache();
return NULL;
@@ -175,7 +175,7 @@ static void _LoadDataToContact(struct ClcContact * cont, struct ClcGroup *group, DWORD idleMode;
char * szProto;
- if (!cont) return;
+ if ( !cont) return;
cont->type = CLCIT_CONTACT;
cont->SubAllocated = 0;
cont->isSubcontact = 0;
@@ -264,9 +264,9 @@ void * AddTempGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flag for (i = 1;;i++) {
szGroupName = pcli->pfnGetGroupName(i,&groupFlags);
if (szGroupName == NULL) break;
- if (!mir_tstrcmpi(szGroupName,szName)) f = 1;
+ if ( !mir_tstrcmpi(szGroupName,szName)) f = 1;
}
- if (!f)
+ if ( !f)
{
char buf[20];
TCHAR b2[255];
@@ -288,7 +288,7 @@ void cli_AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int upda struct ClcContact * cont;
pdisplayNameCacheEntry cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
if (dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact) return; //contact should not be added
- if (!dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName)) return;
+ if ( !dat->IsMetaContactsEnabled && cacheEntry && g_szMetaModuleName && !mir_strcmp(cacheEntry->m_cache_cszProto,g_szMetaModuleName)) return;
corecli.pfnAddContactToTree(hwnd,dat,hContact,updateTotalCount,checkHideOffline);
if (FindItem(hwnd,dat,hContact,&cont,&group,NULL,FALSE))
_LoadDataToContact(cont, group, dat, hContact);
@@ -312,7 +312,7 @@ void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem) __inline BOOL CLCItems_IsShowOfflineGroup(struct ClcGroup* group)
{
DWORD groupFlags = 0;
- if (!group) return FALSE;
+ if ( !group) return FALSE;
if (group->hideOffline) return FALSE;
pcli->pfnGetGroupName(group->groupId,&groupFlags);
return (groupFlags&GROUPF_SHOWOFFLINE) != 0;
@@ -417,14 +417,14 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat) group = &dat->list;
group->totalMembers++;
- if (!(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline))
+ if ( !(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline))
{
if (cacheEntry->m_cache_cszProto == NULL) {
- if (!pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE) || cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
+ if ( !pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE) || cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
cont = AddContactToGroup(dat,group,cacheEntry);
}
else
- if (!pcli->pfnIsHiddenMode(dat,wStatus) || cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
+ if ( !pcli->pfnIsHiddenMode(dat,wStatus) || cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
cont = AddContactToGroup(dat,group,cacheEntry);
}
else cont = AddContactToGroup(dat,group,cacheEntry);
@@ -493,7 +493,7 @@ int GetNewSelection(struct ClcGroup *group, int selection, int direction) if (count >= selection) return count;
lastcount = count;
count++;
- if (!direction) {
+ if ( !direction) {
if (count>selection) return lastcount;
}
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
@@ -629,7 +629,7 @@ void cli_SaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) if (savedInfo[i].parentId == -1)
group = &dat->list;
else {
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) (savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
+ if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) (savedInfo[i].parentId | HCONTACT_ISGROUP), &contact, NULL, NULL))
continue;
group = contact->group;
}
@@ -651,15 +651,15 @@ void cli_SaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) WORD pdnce___GetStatus(pdisplayNameCacheEntry pdnce)
{
- if (!pdnce)
+ if ( !pdnce)
return ID_STATUS_OFFLINE;
else
return pdnce->m_cache_nStatus;
/*
// this stub will replace direct usage of m_cache_nStatus and will be substituted by getting info from DB directrly
- if (!pdnce) return ID_STATUS_OFFLINE;
- if (!pdnce->m_cache_cszProto) return ID_STATUS_OFFLINE;
- if (!pdnce->m_cache_hContact) return ID_STATUS_OFFLINE;
+ if ( !pdnce) return ID_STATUS_OFFLINE;
+ if ( !pdnce->m_cache_cszProto) return ID_STATUS_OFFLINE;
+ if ( !pdnce->m_cache_hContact) return ID_STATUS_OFFLINE;
return DBGetContactSettingWord( pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "Status" , ID_STATUS_OFFLINE );
*/
}
@@ -784,7 +784,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0;
}
if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
- if (!DBGetContactSettingTString(hContact, "CList", "Group", &dbv)) {
+ if ( !DBGetContactSettingTString(hContact, "CList", "Group", &dbv)) {
mir_sntprintf(szGroupMask, SIZEOF(szGroupMask), _T("%s|"), &dbv.ptszVal[0]);
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? (filterResult | (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0)) : (filterResult & (_tcsstr(g_CluiData.groupFilter, szGroupMask) ? 1 : 0));
mir_free(dbv.ptszVal);
diff --git a/plugins/Clist_modern/modern_clcmsgs.cpp b/plugins/Clist_modern/modern_clcmsgs.cpp index 251a540d26..cef111c793 100644 --- a/plugins/Clist_modern/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/modern_clcmsgs.cpp @@ -112,7 +112,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA {
int i;
if (wParam != CLGN_ROOT) {
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL))
+ if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) lParam, &contact, &group, NULL))
return (LRESULT) (HANDLE) NULL;
i = List_IndexOf((SortedList*)&group->cl,contact);
if (i < 0) return 0;
@@ -187,12 +187,12 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA struct ClcGroup *tgroup;
int index = -1;
int mainindex = -1;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
+ if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- if (!contact->isSubcontact)
+ if ( !contact->isSubcontact)
{
index = List_IndexOf((SortedList*)&group->cl,contact);
mainindex = index;
@@ -223,7 +223,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
return 0;
contact->iExtraImage[LOWORD(lParam)] = (BYTE) HIWORD(lParam); //set oldstyle icon
@@ -235,7 +235,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
return 0;
contact->iExtraImage[LOWORD(lParam)] = (BYTE) 0xFF; //reset oldstyle icon
@@ -253,7 +253,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0xFFFF;
- if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
+ if ( !pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
return 0xFFFF;
return contact->iWideExtraImage[LOWORD(lParam)];
diff --git a/plugins/Clist_modern/modern_clcopts.cpp b/plugins/Clist_modern/modern_clcopts.cpp index 76e5f368d7..a7f4312d3c 100644 --- a/plugins/Clist_modern/modern_clcopts.cpp +++ b/plugins/Clist_modern/modern_clcopts.cpp @@ -65,39 +65,36 @@ struct FontOptionsList #define DEFAULT_FAMILY _T("Arial")
#define DEFAULT_EFFECT { 0, 0x00000000, 0x00000000 }
-
-
#define DEFAULT_SIZE -11
#define DEFAULT_SMALLSIZE -8
static struct FontOptionsList fontOptionsList[] = {
-
- { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT( "Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENT( "Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENT( "DND contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENT( "NA contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENT( "Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENT( "Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENT( "Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT( "On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT( "Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT( "Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT( "Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT( "Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT( "Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT( "Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENT( "Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT( "Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT( "Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT( "Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT( "Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT( "Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT( "Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT( "Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT( "Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT( "Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT( "Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENT( "Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENT( "DND contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENT( "NA contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENT( "Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENT( "Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENT( "Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT( "On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT( "Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT( "Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT( "Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT( "Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT( "Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT( "Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENT( "Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT( "Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT( "Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT( "Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT( "Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT( "Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT( "Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT( "Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT( "Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT( "Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
};
struct ColourOptionsList
@@ -130,8 +127,8 @@ static struct ColourOptionsList colourOptionsList[] = { void RegisterCLUIFonts( void )
{
static bool registered = false;
-
- if ( registered ) return;
+ if ( registered )
+ return;
FontIDT fontid = {0};
EffectIDT effectid = {0};
@@ -144,8 +141,7 @@ void RegisterCLUIFonts( void ) effectid.cbSize = sizeof(effectid);
strncpy(effectid.dbSettingsGroup, "CLC", SIZEOF(effectid.dbSettingsGroup));
- for ( i=0; i < SIZEOF(fontOptionsList); i++, index++ )
- {
+ for ( i=0; i < SIZEOF(fontOptionsList); i++, index++ ) {
fontid.flags = FIDF_DEFAULTVALID | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_ALLOWREREGISTER | FIDF_NOAS;
fontid.flags |= fontOptionsList[i].dwFlags;
@@ -179,8 +175,7 @@ void RegisterCLUIFonts( void ) ColourIDT colourid = {0};
colourid.cbSize = sizeof(colourid);
- for ( i=0; i < SIZEOF( colourOptionsList); i++ )
- {
+ for ( i=0; i < SIZEOF( colourOptionsList); i++ ) {
_tcsncpy(colourid.group, colourOptionsList[i].szGroup, SIZEOF(colourid.group));
_tcsncpy(colourid.name, colourOptionsList[i].szDescr, SIZEOF(colourid.group));
strncpy(colourid.setting, colourOptionsList[i].chName, SIZEOF(colourid.setting));
@@ -197,7 +192,6 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-
DWORD GetDefaultExStyle(void)
{
BOOL param;
@@ -216,10 +210,9 @@ void GetFontSetting(int i,LOGFONT *lf,COLORREF *colour,BYTE *effect, COLORREF *e int index = 0;
for ( index = 0; index < SIZEOF(fontOptionsList); index++ )
- {
if ( fontOptionsList[index].fontID == i )
break;
- }
+
if ( index == SIZEOF(fontOptionsList))
return;
@@ -230,10 +223,10 @@ void GetFontSetting(int i,LOGFONT *lf,COLORREF *colour,BYTE *effect, COLORREF *e COLORREF col = CallService( MS_FONT_GETT, (WPARAM)&fontid, (LPARAM)lf );
- if ( colour ) *colour = col;
+ if ( colour )
+ *colour = col;
- if (effect)
- {
+ if (effect) {
mir_snprintf(idstr,SIZEOF(idstr),"Font%dEffect",i);
*effect = db_get_b(NULL,"CLC",idstr,0);
mir_snprintf(idstr,SIZEOF(idstr),"Font%dEffectCol1",i);
@@ -397,10 +390,8 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA {
LPNMHDR t;
t = ((LPNMHDR)lParam);
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
-
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_META, db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
CheckDlgButton(hwndDlg, IDC_METADBLCLK, db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED); /// by FYR
@@ -416,16 +407,13 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA SendDlgItemMessage(hwndDlg,IDC_SUBINDENTSPIN,UDM_SETPOS,0,MAKELONG(db_get_b(NULL,"CLC","SubIndent",CLCDEFAULT_GROUPINDENT),0));
{
- BYTE t;
- t = IsDlgButtonChecked(hwndDlg,IDC_METAEXPAND);
+ BYTE t = IsDlgButtonChecked(hwndDlg,IDC_METAEXPAND);
EnableWindow(GetDlgItem(hwndDlg,IDC_METADBLCLK),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_METASUBEXTRA),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_METASUB_HIDEOFFLINE),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_SUBINDENTSPIN),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_SUBINDENT),t);
- }
- {
- BYTE t;
+
t = ServiceExists(MS_MC_GETMOSTONLINECONTACT);
CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_META),t);
CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_METADBLCLK),t);
@@ -439,11 +427,10 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_SUBIDENTCAPT),t);
}
return TRUE;
+
case WM_COMMAND:
- if (LOWORD(wParam) == IDC_METAEXPAND)
- {
- BYTE t;
- t = IsDlgButtonChecked(hwndDlg,IDC_METAEXPAND);
+ if (LOWORD(wParam) == IDC_METAEXPAND) {
+ BYTE t = IsDlgButtonChecked(hwndDlg,IDC_METAEXPAND);
EnableWindow(GetDlgItem(hwndDlg,IDC_METADBLCLK),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_METASUBEXTRA),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_METASUB_HIDEOFFLINE),t);
@@ -453,13 +440,11 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA if ((LOWORD(wParam) == IDC_SUBINDENT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return TRUE;
- case WM_NOTIFY:
- switch(t->idFrom)
- {
+ case WM_NOTIFY:
+ switch(t->idFrom) {
case 0:
- switch (t->code)
- {
+ switch (t->code) {
case PSN_APPLY:
db_set_b(NULL,"CLC","Meta",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_META)); // by FYR
db_set_b(NULL,"CLC","MetaDoubleClick",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METADBLCLK)); // by FYR
@@ -474,7 +459,6 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA ClcOptionsChanged();
CLUI_ReloadCLUIOptions();
PostMessage(pcli->hwndContactList,WM_SIZE,0,0);
-
return TRUE;
}
break;
@@ -482,16 +466,11 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA break;
}
return FALSE;
-
-
-
-
}
static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),GWL_STYLE)|TVS_NOHSCROLL);
@@ -503,13 +482,11 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_TICK)));
TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),himlCheckBoxes,TVSIL_NORMAL);
TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),himlCheckBoxes,TVSIL_NORMAL);
- }
- {
+
DWORD exStyle = db_get_dw(NULL,"CLC","ExStyle",GetDefaultExStyle());
for (int i=0;i < SIZEOF(checkBoxToStyleEx);i++)
CheckDlgButton(hwndDlg,checkBoxToStyleEx[i].id,(exStyle&checkBoxToStyleEx[i].flag)^(checkBoxToStyleEx[i].flag*checkBoxToStyleEx[i].neg)?BST_CHECKED:BST_UNCHECKED);
- }
- {
+
UDACCEL accel[2] = {{0,10},{2,50}};
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETRANGE,0,MAKELONG(999,0));
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETACCEL,SIZEOF(accel),(LPARAM)&accel);
@@ -527,9 +504,11 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar FillCheckBoxTree(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),offlineValues,SIZEOF(offlineValues),db_get_dw(NULL,"CLC","OfflineModes",CLCDEFAULT_OFFLINEMODES));
CheckDlgButton(hwndDlg,IDC_NOSCROLLBAR,db_get_b(NULL,"CLC","NoVScrollBar",CLCDEFAULT_NOVSCROLL)?BST_CHECKED:BST_UNCHECKED);
return TRUE;
+
case WM_VSCROLL:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
+
case WM_COMMAND:
if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING)
EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
@@ -538,65 +517,61 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar if ((/*LOWORD(wParam) == IDC_LEFTMARGIN || */ LOWORD(wParam) == IDC_SMOOTHTIME || LOWORD(wParam) == IDC_GROUPINDENT) && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
+
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->idFrom) {
- case IDC_GREYOUTOPTS:
- case IDC_HIDEOFFLINEOPTS:
- if (((LPNMHDR)lParam)->code == NM_CLICK) {
- TVHITTESTINFO hti;
- hti.pt.x = (short)LOWORD(GetMessagePos());
- hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if (hti.flags&TVHT_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 = !tvi.iImage;
- //tvi.state = tvi.iImage?2:1;
- TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- }
- break;
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- DWORD exStyle = 0;
- for (int i=0;i < SIZEOF(checkBoxToStyleEx);i++)
- if ((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].neg)
- exStyle |= checkBoxToStyleEx[i].flag;
- db_set_dw(NULL,"CLC","ExStyle",exStyle);
- }
- { DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS));
- db_set_dw(NULL,"CLC","FullGreyoutFlags",fullGreyoutFlags);
- if (IsDlgButtonChecked(hwndDlg,IDC_GREYOUT))
- db_set_dw(NULL,"CLC","GreyoutFlags",fullGreyoutFlags);
- else
- db_set_dw(NULL,"CLC","GreyoutFlags",0);
+ case IDC_GREYOUTOPTS:
+ case IDC_HIDEOFFLINEOPTS:
+ if (((LPNMHDR)lParam)->code == NM_CLICK) {
+ TVHITTESTINFO hti;
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
+ if (hti.flags&TVHT_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 = !tvi.iImage;
+ //tvi.state = tvi.iImage?2:1;
+ TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ }
}
- /* DBWriteContactSettingByte(NULL,"CLC","Meta",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_META)); // by FYR
- DBWriteContactSettingByte(NULL,"CLC","MetaDoubleClick",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METADBLCLK)); // by FYR
- DBWriteContactSettingByte(NULL,"CLC","MetaHideExtra",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_METASUBEXTRA)); // by FYR
-
- */
- db_set_b(NULL,"CLC","ShowIdle",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_IDLE)?1:0));
- db_set_dw(NULL,"CLC","OfflineModes",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS)));
- // DBWriteContactSettingByte(NULL,"CLC","LeftMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_GETPOS,0,0));
- db_set_w(NULL,"CLC","ScrollTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_GETPOS,0,0));
- db_set_b(NULL,"CLC","GroupIndent",(BYTE)SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_GETPOS,0,0));
- db_set_b(NULL,"CLC","NoVScrollBar",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_NOSCROLLBAR)?1:0));
+ break;
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ {
+ DWORD exStyle = 0;
+ for (int i=0;i < SIZEOF(checkBoxToStyleEx);i++)
+ if ((IsDlgButtonChecked(hwndDlg,checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].neg)
+ exStyle |= checkBoxToStyleEx[i].flag;
+ db_set_dw(NULL,"CLC","ExStyle",exStyle);
+ }
+ {
+ DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS));
+ db_set_dw(NULL,"CLC","FullGreyoutFlags",fullGreyoutFlags);
+ if (IsDlgButtonChecked(hwndDlg,IDC_GREYOUT))
+ db_set_dw(NULL,"CLC","GreyoutFlags",fullGreyoutFlags);
+ else
+ db_set_dw(NULL,"CLC","GreyoutFlags",0);
+ }
+ db_set_b(NULL,"CLC","ShowIdle",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_IDLE)?1:0));
+ db_set_dw(NULL,"CLC","OfflineModes",MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS)));
+ db_set_w(NULL,"CLC","ScrollTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_GETPOS,0,0));
+ db_set_b(NULL,"CLC","GroupIndent",(BYTE)SendDlgItemMessage(hwndDlg,IDC_GROUPINDENTSPIN,UDM_GETPOS,0,0));
+ db_set_b(NULL,"CLC","NoVScrollBar",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_NOSCROLLBAR)?1:0));
- ClcOptionsChanged();
- return TRUE;
- }
- break;
+ ClcOptionsChanged();
+ return TRUE;
+ }
+ break;
}
break;
+
case WM_DESTROY:
ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),TVSIL_NORMAL));
break;
@@ -606,8 +581,7 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg,IDC_BITMAP,db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)?BST_CHECKED:BST_UNCHECKED);
@@ -616,41 +590,41 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w // SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"StatusBar","BkColour",CLCDEFAULT_BKCOLOUR));
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETDEFAULTCOLOUR,0,CLCDEFAULT_SELBKCOLOUR);
SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_SETCOLOUR,0,db_get_dw(NULL,"StatusBar","SelBkColour",CLCDEFAULT_SELBKCOLOUR));
- { DBVARIANT dbv = {0};
- if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
- SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
- if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
- char szPath[MAX_PATH];
-
- if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)szPath))
- SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath);
+ {
+ DBVARIANT dbv = {0};
+ if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
+ if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
+ char szPath[MAX_PATH];
+
+ if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)szPath))
+ SetDlgItemTextA(hwndDlg,IDC_FILENAME,szPath);
+ }
+ db_free(&dbv);
}
- db_free(&dbv);
- }
}
CheckDlgButton(hwndDlg,IDC_HILIGHTMODE,db_get_b(NULL,"StatusBar","HiLightMode",SETTING_SBHILIGHTMODE_DEFAULT) == 0?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg,IDC_HILIGHTMODE1,db_get_b(NULL,"StatusBar","HiLightMode",SETTING_SBHILIGHTMODE_DEFAULT) == 1?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg,IDC_HILIGHTMODE2,db_get_b(NULL,"StatusBar","HiLightMode",SETTING_SBHILIGHTMODE_DEFAULT) == 2?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg,IDC_HILIGHTMODE3,db_get_b(NULL,"StatusBar","HiLightMode",SETTING_SBHILIGHTMODE_DEFAULT) == 3?BST_CHECKED:BST_UNCHECKED);
-
-
-
- { WORD bmpUse = db_get_w(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
- CheckDlgButton(hwndDlg,IDC_STRETCHH,bmpUse&CLB_STRETCHH?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_STRETCHV,bmpUse&CLB_STRETCHV?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TILEH,bmpUse&CLBF_TILEH?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TILEV,bmpUse&CLBF_TILEV?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_SCROLL,bmpUse&CLBF_SCROLL?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_PROPORTIONAL,bmpUse&CLBF_PROPORTIONAL?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TILEVROWH,bmpUse&CLBF_TILEVTOROWHEIGHT?BST_CHECKED:BST_UNCHECKED);
-
- }
- { HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
- MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandle(_T("shlwapi")),"SHAutoComplete");
- if (MySHAutoComplete) MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
+ {
+ WORD bmpUse = db_get_w(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ CheckDlgButton(hwndDlg,IDC_STRETCHH,bmpUse&CLB_STRETCHH?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_STRETCHV,bmpUse&CLB_STRETCHV?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_TILEH,bmpUse&CLBF_TILEH?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_TILEV,bmpUse&CLBF_TILEV?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_SCROLL,bmpUse&CLBF_SCROLL?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_PROPORTIONAL,bmpUse&CLBF_PROPORTIONAL?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_TILEVROWH,bmpUse&CLBF_TILEVTOROWHEIGHT?BST_CHECKED:BST_UNCHECKED);
+
+ HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
+ MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandle(_T("shlwapi")),"SHAutoComplete");
+ if (MySHAutoComplete)
+ MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
}
return TRUE;
+
case WM_USER+10:
EnableWindow(GetDlgItem(hwndDlg,IDC_FILENAME),IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
EnableWindow(GetDlgItem(hwndDlg,IDC_BROWSE),IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
@@ -662,6 +636,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w EnableWindow(GetDlgItem(hwndDlg,IDC_PROPORTIONAL),IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
EnableWindow(GetDlgItem(hwndDlg,IDC_TILEVROWH),IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
break;
+
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
char str[MAX_PATH];
@@ -679,7 +654,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w ofn.nMaxFile = SIZEOF(str);
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "bmp";
- if (!GetOpenFileNameA(&ofn)) break;
+ if ( !GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg,IDC_FILENAME,str);
}
else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) break;
@@ -687,61 +662,59 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
+
case WM_NOTIFY:
switch(((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
-
-
-
- db_set_b(NULL,"StatusBar","UseBitmap",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
- { COLORREF col;
- col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
- if (col == CLCDEFAULT_BKCOLOUR) db_unset(NULL,"StatusBar","BkColour");
- else db_set_dw(NULL,"StatusBar","BkColour",col);
- col = SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_GETCOLOUR,0,0);
- if (col == CLCDEFAULT_SELBKCOLOUR) db_unset(NULL,"StatusBar","SelBkColour");
- else db_set_dw(NULL,"StatusBar","SelBkColour",col);
- }
- {
- char str[MAX_PATH],strrel[MAX_PATH];
- GetDlgItemTextA(hwndDlg,IDC_FILENAME,str,SIZEOF(str));
- if (ServiceExists(MS_UTILS_PATHTORELATIVE)) {
- if (CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)str, (LPARAM)strrel))
- db_set_s(NULL,"StatusBar","BkBitmap",strrel);
- else db_set_s(NULL,"StatusBar","BkBitmap",str);
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ db_set_b(NULL,"StatusBar","UseBitmap",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
+ {
+ COLORREF col;
+ col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
+ if (col == CLCDEFAULT_BKCOLOUR) db_unset(NULL,"StatusBar","BkColour");
+ else db_set_dw(NULL,"StatusBar","BkColour",col);
+ col = SendDlgItemMessage(hwndDlg,IDC_SELCOLOUR,CPM_GETCOLOUR,0,0);
+ if (col == CLCDEFAULT_SELBKCOLOUR) db_unset(NULL,"StatusBar","SelBkColour");
+ else db_set_dw(NULL,"StatusBar","SelBkColour",col);
}
- else db_set_s(NULL,"StatusBar","BkBitmap",str);
-
- }
- { WORD flags = 0;
- if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags |= CLB_STRETCHH;
- if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHV)) flags |= CLB_STRETCHV;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEH)) flags |= CLBF_TILEH;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEV)) flags |= CLBF_TILEV;
- if (IsDlgButtonChecked(hwndDlg,IDC_SCROLL)) flags |= CLBF_SCROLL;
- if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
+ {
+ char str[MAX_PATH],strrel[MAX_PATH];
+ GetDlgItemTextA(hwndDlg,IDC_FILENAME,str,SIZEOF(str));
+ if (ServiceExists(MS_UTILS_PATHTORELATIVE)) {
+ if (CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)str, (LPARAM)strrel))
+ db_set_s(NULL,"StatusBar","BkBitmap",strrel);
+ else db_set_s(NULL,"StatusBar","BkBitmap",str);
+ }
+ else db_set_s(NULL,"StatusBar","BkBitmap",str);
- db_set_w(NULL,"StatusBar","BkBmpUse",flags);
- }
- {
- int hil = 0;
- if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE1)) hil = 1;
- if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE2)) hil = 2;
- if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE3)) hil = 3;
+ }
+ {
+ WORD flags = 0;
+ if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags |= CLB_STRETCHH;
+ if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHV)) flags |= CLB_STRETCHV;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEH)) flags |= CLBF_TILEH;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEV)) flags |= CLBF_TILEV;
+ if (IsDlgButtonChecked(hwndDlg,IDC_SCROLL)) flags |= CLBF_SCROLL;
+ if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
+
+ db_set_w(NULL,"StatusBar","BkBmpUse",flags);
+ }
+ {
+ int hil = 0;
+ if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE1)) hil = 1;
+ if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE2)) hil = 2;
+ if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE3)) hil = 3;
- db_set_b(NULL,"StatusBar","HiLightMode",(BYTE)hil);
+ db_set_b(NULL,"StatusBar","HiLightMode",(BYTE)hil);
+ }
+ ClcOptionsChanged();
+ //OnStatusBarBackgroundChange();
+ return TRUE;
}
-
- ClcOptionsChanged();
- //OnStatusBarBackgroundChange();
- return TRUE;
- }
- break;
+ break;
}
break;
}
@@ -755,281 +728,262 @@ static int _GetNetVisibleProtoCount() ProtoEnumAccounts( &count, &accs );
for (i=0,netProtoCount = 0;i < count;i++)
{
- if ( pcli->pfnGetProtocolVisibility(accs[i]->szModuleName) == 0 ) continue;
+ if ( pcli->pfnGetProtocolVisibility(accs[i]->szModuleName) == 0 )
+ continue;
netProtoCount++;
}
return netProtoCount;
}
+
TCHAR *sortby[] = {_T("Name"), _T("Name (use locale settings)") , _T("Status"), _T("Last message time"), _T("Account Name"), _T("Rate"), _T("-Nothing-")};
int sortbyValue[] = { SORTBY_NAME, SORTBY_NAME_LOCALE, SORTBY_STATUS, SORTBY_LASTMSG, SORTBY_PROTO ,SORTBY_RATE , SORTBY_NOTHING };
static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED,hwndDlg,WM_USER+1));
-
- CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, db_get_b(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, db_get_b(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, db_get_b(NULL,"CList","ConfirmDelete",SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg,IDC_GAMMACORRECT,db_get_b(NULL,"CLC","GammaCorrect",CLCDEFAULT_GAMMACORRECT)?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_HILIGHTMODE,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 0?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_HILIGHTMODE1,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 1?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_HILIGHTMODE2,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 2?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_HILIGHTMODE3,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 3?BST_CHECKED:BST_UNCHECKED);
-
- int i, item;
- int s1, s2, s3;
- for (i=0; i < SIZEOF(sortby); i++)
- {
- item = SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_ADDSTRING,0,(LPARAM)TranslateTS(sortby[i]));
- SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_SETITEMDATA,item,(LPARAM)0);
- item = SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_ADDSTRING,0,(LPARAM)TranslateTS(sortby[i]));
- SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_SETITEMDATA,item,(LPARAM)0);
- item = SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_ADDSTRING,0,(LPARAM)TranslateTS(sortby[i]));
- SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_SETITEMDATA,item,(LPARAM)0);
-
- }
- s1 = db_get_b(NULL,"CList","SortBy1",SETTING_SORTBY1_DEFAULT);
- s2 = db_get_b(NULL,"CList","SortBy2",SETTING_SORTBY2_DEFAULT);
- s3 = db_get_b(NULL,"CList","SortBy3",SETTING_SORTBY3_DEFAULT);
-
- for (i=0; i < SIZEOF(sortby); i++)
- {
- if (s1 == sortbyValue[i])
- SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_SETCURSEL,i,0);
- if (s2 == sortbyValue[i])
- SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_SETCURSEL,i,0);
- if (s3 == sortbyValue[i])
- SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_SETCURSEL,i,0);
- }
-
- CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, db_get_b(NULL,"CList","PlaceOfflineToRoot",SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- }
+ {
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED,hwndDlg,WM_USER+1));
+
+ CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE, db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS, db_get_b(NULL,"CList","HideEmptyGroups",SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, db_get_b(NULL,"CList","UseGroups",SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE, db_get_b(NULL,"CList","ConfirmDelete",SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg,IDC_GAMMACORRECT,db_get_b(NULL,"CLC","GammaCorrect",CLCDEFAULT_GAMMACORRECT)?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_HILIGHTMODE,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 0?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_HILIGHTMODE1,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 1?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_HILIGHTMODE2,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 2?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_HILIGHTMODE3,db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT) == 3?BST_CHECKED:BST_UNCHECKED);
+
+ int i, item;
+ int s1, s2, s3;
+ for (i=0; i < SIZEOF(sortby); i++)
+ {
+ item = SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_ADDSTRING,0,(LPARAM)TranslateTS(sortby[i]));
+ SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_SETITEMDATA,item,(LPARAM)0);
+ item = SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_ADDSTRING,0,(LPARAM)TranslateTS(sortby[i]));
+ SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_SETITEMDATA,item,(LPARAM)0);
+ item = SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_ADDSTRING,0,(LPARAM)TranslateTS(sortby[i]));
+ SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_SETITEMDATA,item,(LPARAM)0);
+
+ }
+ s1 = db_get_b(NULL,"CList","SortBy1",SETTING_SORTBY1_DEFAULT);
+ s2 = db_get_b(NULL,"CList","SortBy2",SETTING_SORTBY2_DEFAULT);
+ s3 = db_get_b(NULL,"CList","SortBy3",SETTING_SORTBY3_DEFAULT);
+
+ for (i=0; i < SIZEOF(sortby); i++)
+ {
+ if (s1 == sortbyValue[i])
+ SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_SETCURSEL,i,0);
+ if (s2 == sortbyValue[i])
+ SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_SETCURSEL,i,0);
+ if (s3 == sortbyValue[i])
+ SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_SETCURSEL,i,0);
+ }
+
+ CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, db_get_b(NULL,"CList","PlaceOfflineToRoot",SETTING_PLACEOFFLINETOROOT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ }
return TRUE;
case WM_COMMAND:
- {
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
+
case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- db_set_b(NULL,"CList","HideOffline",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEOFFLINE));
- db_set_b(NULL,"CList","HideEmptyGroups",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEEMPTYGROUPS));
- db_set_b(NULL,"CList","UseGroups",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_DISABLEGROUPS));
- db_set_b(NULL,"CList","ConfirmDelete",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CONFIRMDELETE));
-
- db_set_b(NULL,"CLC","GammaCorrect",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_GAMMACORRECT));
- int hil = 0;
- if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE1)) hil = 1;
- if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE2)) hil = 2;
- if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE3)) hil = 3;
- db_set_b(NULL,"CLC","HiLightMode",(BYTE)hil);
-
- int s1 = SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_GETCURSEL,0,0);
- int s2 = SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_GETCURSEL,0,0);
- int s3 = SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_GETCURSEL,0,0);
- if (s1 >= 0) s1 = sortbyValue[s1];
- if (s2 >= 0) s2 = sortbyValue[s2];
- if (s3 >= 0) s3 = sortbyValue[s3];
- db_set_b(NULL,"CList","SortBy1",(BYTE)s1);
- db_set_b(NULL,"CList","SortBy2",(BYTE)s2);
- db_set_b(NULL,"CList","SortBy3",(BYTE)s3);
-
- db_set_b(NULL,"CList","NoOfflineBottom",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_NOOFFLINEMOVE));
- db_set_b(NULL,"CList","PlaceOfflineToRoot",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_OFFLINETOROOT));
-
- pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */
- SendMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0); /* force reshuffle */
- ClcOptionsChanged(); // Used to force loading avatar an list height related options
- return TRUE;
- }
- break;
- }
- break;
- }
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ db_set_b(NULL,"CList","HideOffline",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEOFFLINE));
+ db_set_b(NULL,"CList","HideEmptyGroups",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_HIDEEMPTYGROUPS));
+ db_set_b(NULL,"CList","UseGroups",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_DISABLEGROUPS));
+ db_set_b(NULL,"CList","ConfirmDelete",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CONFIRMDELETE));
+
+ db_set_b(NULL,"CLC","GammaCorrect",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_GAMMACORRECT));
+ int hil = 0;
+ if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE1)) hil = 1;
+ if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE2)) hil = 2;
+ if (IsDlgButtonChecked(hwndDlg,IDC_HILIGHTMODE3)) hil = 3;
+ db_set_b(NULL,"CLC","HiLightMode",(BYTE)hil);
+
+ int s1 = SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_GETCURSEL,0,0);
+ int s2 = SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_GETCURSEL,0,0);
+ int s3 = SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_GETCURSEL,0,0);
+ if (s1 >= 0) s1 = sortbyValue[s1];
+ if (s2 >= 0) s2 = sortbyValue[s2];
+ if (s3 >= 0) s3 = sortbyValue[s3];
+ db_set_b(NULL,"CList","SortBy1",(BYTE)s1);
+ db_set_b(NULL,"CList","SortBy2",(BYTE)s2);
+ db_set_b(NULL,"CList","SortBy3",(BYTE)s3);
+
+ db_set_b(NULL,"CList","NoOfflineBottom",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_NOOFFLINEMOVE));
+ db_set_b(NULL,"CList","PlaceOfflineToRoot",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_OFFLINETOROOT));
+
+ pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */
+ SendMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0); /* force reshuffle */
+ ClcOptionsChanged(); // Used to force loading avatar an list height related options
+ return TRUE;
+ }
+ break;
+ }
+ break;
}
return FALSE;
}
-
-
static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, db_get_b( NULL,"CList", "NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT ) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, db_get_b( NULL,"CList", "PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT ) ? BST_CHECKED : BST_UNCHECKED);
+ switch (msg) {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_NOOFFLINEMOVE, db_get_b( NULL,"CList", "NoOfflineBottom", SETTING_NOOFFLINEBOTTOM_DEFAULT ) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_OFFLINETOROOT, db_get_b( NULL,"CList", "PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT ) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ONECLK, db_get_b( NULL,"CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT ) ? BST_CHECKED : BST_UNCHECKED);
- {
- BYTE trayOption = db_get_b(NULL,"CLUI","XStatusTray",SETTING_TRAYOPTION_DEFAULT);
- CheckDlgButton(hwndDlg, IDC_SHOWXSTATUS, (trayOption&3) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWNORMAL, (trayOption&2) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TRANSPARENTOVERLAY, (trayOption&4) ? BST_CHECKED : BST_UNCHECKED);
-
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWNORMAL),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS));
- EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENTOVERLAY),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL));
-
- }
- CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, db_get_b(NULL,"CList","AlwaysStatus",SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_ALWAYSPRIMARY, !db_get_b(NULL,"CList","AlwaysPrimary",SETTING_ALWAYSPRIMARY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DONTCYCLE, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CYCLE, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MULTITRAY, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, db_get_b(NULL,"CList","DisableTrayFlash",SETTING_DISABLETRAYFLASH_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOW_AVATARS, db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) == 1 ? BST_CHECKED : BST_UNCHECKED );
-
- if (IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSMULTI),FALSE);
- }
- if (IsDlgButtonChecked(hwndDlg,IDC_CYCLE)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSMULTI),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
- }
- if (IsDlgButtonChecked(hwndDlg,IDC_MULTITRAY)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
- }
- SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_SETRANGE,0,MAKELONG(120,1));
- SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CList","CycleTime",SETTING_CYCLETIME_DEFAULT),0));
- {
- int i,count,item;
- PROTOACCOUNT **accs;
- DBVARIANT dbv = {DBVT_DELETED};
- db_get(NULL,"CList","PrimaryStatus",&dbv);
- ProtoEnumAccounts( &count, &accs );
- item = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_ADDSTRING,0,(LPARAM)TranslateT("Global"));
- SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETITEMDATA,item,(LPARAM)0);
- for (i=0;i < count;i++) {
- if ( !IsAccountEnabled( accs[i] ) || CallProtoService(accs[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0) == 0)
- continue;
-
- item = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_ADDSTRING,0,(LPARAM)accs[i]->tszAccountName);
- SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETITEMDATA,item,(LPARAM)accs[i]);
- if ((dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8) && !strcmp(dbv.pszVal,accs[i]->szModuleName))
- SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,item,0);
- }
- db_free(&dbv);
- }
- if (-1 == (int)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0))
- SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,0,0);
- SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_BLINKTIME),0); // set buddy
- SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETRANGE,0,MAKELONG(0x3FFF,250));
- SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CList","IconFlashTime",SETTING_ICONFLASHTIME_DEFAULT),0));
- {
- int i = _GetNetVisibleProtoCount();
- if (i < 2)
- {
- EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),TRUE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLE),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MULTITRAY),FALSE);
- CheckDlgButton(hwndDlg,IDC_DONTCYCLE,TRUE);
- }
- }
- }
- return TRUE;
-
- case WM_COMMAND:
- {
- if (LOWORD(wParam) == IDC_SHOWXSTATUS || LOWORD(wParam) == IDC_SHOWNORMAL)
- {
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWNORMAL),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS));
- EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENTOVERLAY),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL));
- }
- if (LOWORD(wParam) == IDC_DONTCYCLE || LOWORD(wParam) == IDC_CYCLE || LOWORD(wParam) == IDC_MULTITRAY)
- {
- EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),IsDlgButtonChecked(hwndDlg,IDC_CYCLE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_CYCLE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSMULTI),IsDlgButtonChecked(hwndDlg,IDC_MULTITRAY));
- EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE));
- }
- if (LOWORD(wParam) == IDC_PRIMARYSTATUS && HIWORD(wParam) != CBN_SELCHANGE) break;
- if (LOWORD(wParam) == IDC_BLINKTIME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0; // dont make apply enabled during buddy set crap
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
- break;
- case WM_NOTIFY:
- {
- switch (((LPNMHDR)lParam)->idFrom)
- {
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- db_set_b(NULL,"CList","Tray1Click",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONECLK));
- db_set_b(NULL,"CList","AlwaysStatus",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ALWAYSSTATUS));
-
- db_set_b(NULL,"CList","AlwaysMulti",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_ALWAYSMULTI));
- db_set_b(NULL,"CList","AlwaysPrimary",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_ALWAYSPRIMARY));
-
- db_set_w(NULL,"CList","CycleTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_GETPOS,0,0));
- db_set_w(NULL,"CList","IconFlashTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_GETPOS,0,0));
- db_set_b(NULL,"CList","DisableTrayFlash",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DISABLEBLINK));
-
-
- if (_GetNetVisibleProtoCount()>1)
- db_set_b(NULL,"CList","TrayIcon",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)?SETTING_TRAYICON_SINGLE:(IsDlgButtonChecked(hwndDlg,IDC_CYCLE)?SETTING_TRAYICON_CYCLE:SETTING_TRAYICON_MULTI)));
-
- {
- BYTE xOptions = 0;
- xOptions = IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS)?1:0;
- xOptions |= (xOptions && IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL))?2:0;
- xOptions |= (xOptions && IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENTOVERLAY))?4:0;
- db_set_b(NULL,"CLUI","XStatusTray",xOptions);
- }
-
- {
- int cursel = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0);
- PROTOACCOUNT* pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETITEMDATA,cursel,0);
- if ( !pa )
- db_unset(NULL, "CList","PrimaryStatus");
- else
- db_set_s(NULL,"CList","PrimaryStatus", pa->szModuleName);
- }
- pcli->pfnTrayIconIconsChanged();
- pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */
- SendMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0); /* force reshuffle */
- ClcOptionsChanged(); // Used to force loading avatar an list height related options
- return TRUE;
- }
- break;
- }
- break;
- }
- }
- return FALSE;
-}
+ {
+ BYTE trayOption = db_get_b(NULL,"CLUI","XStatusTray",SETTING_TRAYOPTION_DEFAULT);
+ CheckDlgButton(hwndDlg, IDC_SHOWXSTATUS, (trayOption&3) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWNORMAL, (trayOption&2) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRANSPARENTOVERLAY, (trayOption&4) ? BST_CHECKED : BST_UNCHECKED);
+
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWNORMAL),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENTOVERLAY),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL));
+ }
+ CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS, db_get_b(NULL,"CList","AlwaysStatus",SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_ALWAYSPRIMARY, !db_get_b(NULL,"CList","AlwaysPrimary",SETTING_ALWAYSPRIMARY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI, !db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DONTCYCLE, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CYCLE, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MULTITRAY, db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEBLINK, db_get_b(NULL,"CList","DisableTrayFlash",SETTING_DISABLETRAYFLASH_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOW_AVATARS, db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ CheckDlgButton(hwndDlg, IDC_SHOW_ANIAVATARS, db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP) && !g_CluiData.fGDIPlusFail)) == 1 ? BST_CHECKED : BST_UNCHECKED );
+
+ if (IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSMULTI),FALSE);
+ }
+ if (IsDlgButtonChecked(hwndDlg,IDC_CYCLE)) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSMULTI),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
+ }
+ if (IsDlgButtonChecked(hwndDlg,IDC_MULTITRAY)) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
+ }
+ SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_SETRANGE,0,MAKELONG(120,1));
+ SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CList","CycleTime",SETTING_CYCLETIME_DEFAULT),0));
+ {
+ int i,count,item;
+ PROTOACCOUNT **accs;
+ DBVARIANT dbv = {DBVT_DELETED};
+ db_get(NULL,"CList","PrimaryStatus",&dbv);
+ ProtoEnumAccounts( &count, &accs );
+ item = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_ADDSTRING,0,(LPARAM)TranslateT("Global"));
+ SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETITEMDATA,item,(LPARAM)0);
+ for (i=0;i < count;i++) {
+ if ( !IsAccountEnabled( accs[i] ) || CallProtoService(accs[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0) == 0)
+ continue;
+
+ item = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_ADDSTRING,0,(LPARAM)accs[i]->tszAccountName);
+ SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETITEMDATA,item,(LPARAM)accs[i]);
+ if ((dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8) && !strcmp(dbv.pszVal,accs[i]->szModuleName))
+ SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,item,0);
+ }
+ db_free(&dbv);
+ }
+ if (-1 == (int)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0))
+ SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_SETCURSEL,0,0);
+ SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETBUDDY,(WPARAM)GetDlgItem(hwndDlg,IDC_BLINKTIME),0); // set buddy
+ SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETRANGE,0,MAKELONG(0x3FFF,250));
+ SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CList","IconFlashTime",SETTING_ICONFLASHTIME_DEFAULT),0));
+ {
+ int i = _GetNetVisibleProtoCount();
+ if (i < 2)
+ {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),TRUE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLE),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_MULTITRAY),FALSE);
+ CheckDlgButton(hwndDlg,IDC_DONTCYCLE,TRUE);
+ }
+ }
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_SHOWXSTATUS || LOWORD(wParam) == IDC_SHOWNORMAL)
+ {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWNORMAL),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENTOVERLAY),IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL));
+ }
+ if (LOWORD(wParam) == IDC_DONTCYCLE || LOWORD(wParam) == IDC_CYCLE || LOWORD(wParam) == IDC_MULTITRAY)
+ {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),IsDlgButtonChecked(hwndDlg,IDC_CYCLE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_CYCLE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSMULTI),IsDlgButtonChecked(hwndDlg,IDC_MULTITRAY));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ALWAYSPRIMARY),IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE));
+ }
+ if (LOWORD(wParam) == IDC_PRIMARYSTATUS && HIWORD(wParam) != CBN_SELCHANGE) break;
+ if (LOWORD(wParam) == IDC_BLINKTIME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0; // dont make apply enabled during buddy set crap
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ break;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ db_set_b(NULL,"CList","Tray1Click",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONECLK));
+ db_set_b(NULL,"CList","AlwaysStatus",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ALWAYSSTATUS));
+ db_set_b(NULL,"CList","AlwaysMulti",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_ALWAYSMULTI));
+ db_set_b(NULL,"CList","AlwaysPrimary",(BYTE)!IsDlgButtonChecked(hwndDlg,IDC_ALWAYSPRIMARY));
+ db_set_w(NULL,"CList","CycleTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_CYCLETIMESPIN,UDM_GETPOS,0,0));
+ db_set_w(NULL,"CList","IconFlashTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_BLINKSPIN,UDM_GETPOS,0,0));
+ db_set_b(NULL,"CList","DisableTrayFlash",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DISABLEBLINK));
+ if (_GetNetVisibleProtoCount()>1)
+ db_set_b(NULL,"CList","TrayIcon",(BYTE)(IsDlgButtonChecked(hwndDlg,IDC_DONTCYCLE)?SETTING_TRAYICON_SINGLE:(IsDlgButtonChecked(hwndDlg,IDC_CYCLE)?SETTING_TRAYICON_CYCLE:SETTING_TRAYICON_MULTI)));
+
+ {
+ BYTE xOptions = 0;
+ xOptions = IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS)?1:0;
+ xOptions |= (xOptions && IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL))?2:0;
+ xOptions |= (xOptions && IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENTOVERLAY))?4:0;
+ db_set_b(NULL,"CLUI","XStatusTray",xOptions);
+
+ int cursel = SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETCURSEL,0,0);
+ PROTOACCOUNT* pa = (PROTOACCOUNT*)SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_GETITEMDATA,cursel,0);
+ if ( !pa )
+ db_unset(NULL, "CList","PrimaryStatus");
+ else
+ db_set_s(NULL,"CList","PrimaryStatus", pa->szModuleName);
+ }
+ pcli->pfnTrayIconIconsChanged();
+ pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */
+ SendMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0); /* force reshuffle */
+ ClcOptionsChanged(); // Used to force loading avatar an list height related options
+ return TRUE;
+ }
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
void ClcOptionsChanged(void)
{
@@ -1039,14 +993,10 @@ void ClcOptionsChanged(void) HWND g_hCLUIOptionsWnd = NULL;
-
-
static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
-
TranslateDialogDefault(hwndDlg);
CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DRAGTOSCROLL, (db_get_b(NULL,"CLUI","DragToScroll",SETTING_DRAGTOSCROLL_DEFAULT) && !db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)) ? BST_CHECKED : BST_UNCHECKED);
@@ -1054,7 +1004,6 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_LOCKSIZING, db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, db_get_b(NULL,"CList","BringToFront",SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
-
SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETRANGE,0,MAKELONG(100,0));
SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETPOS,0,db_get_b(NULL,"CLUI","MaxSizeHeight",SETTING_MAXSIZEHEIGHT_DEFAULT));
SendDlgItemMessage(hwndDlg,IDC_MINSIZESPIN,UDM_SETRANGE,0,MAKELONG(100,0));
@@ -1104,7 +1053,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC13),mode != 0);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),FALSE);
@@ -1114,6 +1063,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_AUTOSIZEUPWARD),FALSE);
}
return TRUE;
+
case WM_COMMAND:
if (LOWORD(wParam) == IDC_AUTOHIDE) {
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
@@ -1154,22 +1104,14 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_HIDEDELAY2 || LOWORD(wParam) == IDC_HIDEDELAY || LOWORD(wParam) == IDC_SHOWDELAY || LOWORD(wParam) == IDC_MAXSIZEHEIGHT || LOWORD(wParam) == IDC_MINSIZEHEIGHT) &&
(HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
return 0;
+
// Enable apply button
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
+
case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- //
- //DBWriteContactSettingByte(NULL,"CLUI","LeftClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_GETPOS,0,0));
- //DBWriteContactSettingByte(NULL,"CLUI","RightClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_RIGHTMARGINSPIN,UDM_GETPOS,0,0));
- //DBWriteContactSettingByte(NULL,"CLUI","TopClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TOPMARGINSPIN,UDM_GETPOS,0,0));
- //DBWriteContactSettingByte(NULL,"CLUI","BottomClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_BOTTOMMARGINSPIN,UDM_GETPOS,0,0));
- //if (g_proc_UpdateLayeredWindow != NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE))
- // DBWriteContactSettingByte(NULL,"ModernData","EnableLayering",0);
- //else
- // DBDeleteContactSetting(NULL,"ModernData","EnableLayering");
db_set_b(NULL,"ModernData","HideBehind",(BYTE)SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_GETCURSEL,0,0));
db_set_w(NULL,"ModernData","ShowDelay",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN2,UDM_GETPOS,0,0));
db_set_w(NULL,"ModernData","HideDelay",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN3,UDM_GETPOS,0,0));
@@ -1209,14 +1151,13 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
BOOL fEnabled = FALSE;
- switch (msg)
- {
+ switch (msg) {
case WM_INITDIALOG:
-
TranslateDialogDefault(hwndDlg);
g_hCLUIOptionsWnd = hwndDlg;
CheckDlgButton(hwndDlg, IDC_ONTOP, db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- { // == == == Activate/Deactivate Non-Layered items == == == =
+ {
+ //====== Activate/Deactivate Non-Layered items =======
fEnabled = !g_CluiData.fLayered || g_CluiData.fDisableSkinEngine;
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),fEnabled);
@@ -1230,7 +1171,8 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg,IDC_TITLEBAR_STATIC),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_ROUNDCORNERS),fEnabled);
}
- { // == == == Non-Layered Mode == == =
+ {
+ //====== Non-Layered Mode =====
CheckDlgButton(hwndDlg, IDC_TOOLWND, db_get_b(NULL,"CList","ToolWindow",SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_MIN2TRAY, db_get_b(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_BORDER, db_get_b(NULL,"CList","ThinBorder",SETTING_THINBORDER_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
@@ -1239,15 +1181,12 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, db_get_b(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, db_get_b(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- //EnableWindow(GetDlgItem(hwndDlg,IDC_CLIENTDRAG),!IsDlgButtonChecked(hwndDlg,IDC_DRAGTOSCROLL));
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))
- {
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),FALSE);
}
- if (IsDlgButtonChecked(hwndDlg,IDC_BORDER) || IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND))
- {
+ if (IsDlgButtonChecked(hwndDlg,IDC_BORDER) || IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),FALSE);
@@ -1255,7 +1194,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP }
CheckDlgButton(hwndDlg, IDC_DROPSHADOW, db_get_b(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ROUNDCORNERS, db_get_b(NULL,"CLC","RoundCorners",SETTING_ROUNDCORNERS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- } // == == == End of Non-Layered Mode == == =
+ } //====== End of Non-Layered Mode =====
CheckDlgButton(hwndDlg, IDC_FADEINOUT, db_get_b(NULL,"CLUI","FadeInOut",SETTING_FADEIN_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_ONDESKTOP, db_get_b(NULL,"CList","OnDesktop", SETTING_ONDESKTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
@@ -1281,7 +1220,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP {
DBVARIANT dbv = {0};
TCHAR *s;
- if (!DBGetContactSettingTString(NULL,"CList","TitleText",&dbv))
+ if ( !DBGetContactSettingTString(NULL,"CList","TitleText",&dbv))
s = dbv.ptszVal;
else
s = _T(MIRANDANAME);
@@ -1294,29 +1233,29 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP sprintf(szUin,"%u",db_get_dw(NULL,"ICQ","UIN",0));
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
- if (!DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
}
- if (!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
}
- if (!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
dbv.pszVal = NULL;
}
}
- if (!IsWinVer2000Plus()) {
+ 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,db_get_b(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
- if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),FALSE);
@@ -1341,7 +1280,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg,IDC_INACTIVEPERC),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
}
else if (LOWORD(wParam) == IDC_LAYERENGINE || LOWORD(wParam) == IDC_DISABLEENGINE)
- { // == == == Activate/Deactivate Non-Layered items == == == =
+ { //====== Activate/Deactivate Non-Layered items =======
fEnabled = !(IsWindowEnabled(GetDlgItem(hwndDlg,IDC_LAYERENGINE)) && !IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE) && !IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE));
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),fEnabled && (IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) && !(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND) || IsDlgButtonChecked(hwndDlg,IDC_BORDER)));
@@ -1389,7 +1328,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP }
if ((LOWORD(wParam) == IDC_TITLETEXT || LOWORD(wParam) == IDC_MAXSIZEHEIGHT || LOWORD(wParam) == IDC_MINSIZEHEIGHT || LOWORD(wParam) == IDC_FRAMESGAP || LOWORD(wParam) == IDC_CAPTIONSGAP ||
LOWORD(wParam) == IDC_LEFTMARGIN || LOWORD(wParam) == IDC_RIGHTMARGIN || LOWORD(wParam) == IDC_TOPMARGIN || LOWORD(wParam) == IDC_BOTTOMMARGIN)
- && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
return 0;
// Enable apply button
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
@@ -1404,95 +1343,89 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP }
if (wParam != 0x12345678) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
+
case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
+ switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
+ db_set_b(NULL,"CLUI","LeftClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_GETPOS,0,0));
+ db_set_b(NULL,"CLUI","RightClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_RIGHTMARGINSPIN,UDM_GETPOS,0,0));
+ db_set_b(NULL,"CLUI","TopClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TOPMARGINSPIN,UDM_GETPOS,0,0));
+ db_set_b(NULL,"CLUI","BottomClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_BOTTOMMARGINSPIN,UDM_GETPOS,0,0));
+ db_set_b(NULL,"ModernData","DisableEngine",IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE));
+ db_set_b(NULL,"ModernData","AeroGlass",IsDlgButtonChecked(hwndDlg,IDC_AEROGLASS));
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE))
{
- db_set_b(NULL,"CLUI","LeftClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_LEFTMARGINSPIN,UDM_GETPOS,0,0));
- db_set_b(NULL,"CLUI","RightClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_RIGHTMARGINSPIN,UDM_GETPOS,0,0));
- db_set_b(NULL,"CLUI","TopClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TOPMARGINSPIN,UDM_GETPOS,0,0));
- db_set_b(NULL,"CLUI","BottomClientMargin",(BYTE)SendDlgItemMessage(hwndDlg,IDC_BOTTOMMARGINSPIN,UDM_GETPOS,0,0));
- db_set_b(NULL,"ModernData","DisableEngine",IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE));
- db_set_b(NULL,"ModernData","AeroGlass",IsDlgButtonChecked(hwndDlg,IDC_AEROGLASS));
- if (!IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE))
- {
- if (g_proc_UpdateLayeredWindow != NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE))
- db_set_b(NULL,"ModernData","EnableLayering",0);
- else
- db_unset(NULL,"ModernData","EnableLayering");
- }
- g_CluiData.dwKeyColor = db_get_dw(NULL,"ModernSettings","KeyColor",(DWORD)SETTING_KEYCOLOR_DEFAULT);
- db_set_b(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP));
- db_set_b(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 |SWP_NOACTIVATE);
- db_set_b(NULL,"CLUI","DragToScroll",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DRAGTOSCROLL));
-
- { // == == == Non-Layered Mode == == ==
- db_set_b(NULL,"CList","ToolWindow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
- db_set_b(NULL,"CLUI","ShowCaption",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
- db_set_b(NULL,"CLUI","ShowMainMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU));
- db_set_b(NULL,"CList","ThinBorder",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BORDER));
- db_set_b(NULL,"CList","NoBorder",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND));
- {
- TCHAR title[256];
- GetDlgItemText(hwndDlg,IDC_TITLETEXT,title,SIZEOF(title));
- db_set_ws(NULL,"CList","TitleText",title);
- // SetWindowText(pcli->hwndContactList,title);
- }
- db_set_b(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY));
- db_set_b(NULL,"CList","WindowShadow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DROPSHADOW));
- db_set_b(NULL,"CLC","RoundCorners",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ROUNDCORNERS));
- } // == == == End of Non-Layered Mode == == ==
- g_mutex_bChangingMode = TRUE;
+ if (g_proc_UpdateLayeredWindow != NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE))
+ db_set_b(NULL,"ModernData","EnableLayering",0);
+ else
+ db_unset(NULL,"ModernData","EnableLayering");
+ }
+ g_CluiData.dwKeyColor = db_get_dw(NULL,"ModernSettings","KeyColor",(DWORD)SETTING_KEYCOLOR_DEFAULT);
+ db_set_b(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP));
+ db_set_b(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 |SWP_NOACTIVATE);
+ db_set_b(NULL,"CLUI","DragToScroll",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DRAGTOSCROLL));
- if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP))
+ { //====== Non-Layered Mode ======
+ db_set_b(NULL,"CList","ToolWindow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
+ db_set_b(NULL,"CLUI","ShowCaption",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
+ db_set_b(NULL,"CLUI","ShowMainMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU));
+ db_set_b(NULL,"CList","ThinBorder",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BORDER));
+ db_set_b(NULL,"CList","NoBorder",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND));
{
- HWND hProgMan = FindWindow(_T("Progman"),NULL);
- if (IsWindow(hProgMan))
- {
- SetParent(pcli->hwndContactList,hProgMan);
- Sync( CLUIFrames_SetParentForContainers, (HWND)hProgMan );
- g_CluiData.fOnDesktop = 1;
- }
+ TCHAR title[256];
+ GetDlgItemText(hwndDlg,IDC_TITLETEXT,title,SIZEOF(title));
+ db_set_ws(NULL,"CList","TitleText",title);
}
- else
+ db_set_b(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY));
+ db_set_b(NULL,"CList","WindowShadow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DROPSHADOW));
+ db_set_b(NULL,"CLC","RoundCorners",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ROUNDCORNERS));
+ } //====== End of Non-Layered Mode ======
+ g_mutex_bChangingMode = TRUE;
+
+ if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP))
+ {
+ HWND hProgMan = FindWindow(_T("Progman"),NULL);
+ if (IsWindow(hProgMan))
{
- if (GetParent(pcli->hwndContactList))
- {
- SetParent(pcli->hwndContactList,NULL);
- Sync( CLUIFrames_SetParentForContainers, (HWND)NULL );
- }
- g_CluiData.fOnDesktop = 0;
+ SetParent(pcli->hwndContactList,hProgMan);
+ Sync( CLUIFrames_SetParentForContainers, (HWND)hProgMan );
+ g_CluiData.fOnDesktop = 1;
}
- AniAva_UpdateParent();
- db_set_b(NULL,"CLUI","FadeInOut",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT));
- g_CluiData.fSmoothAnimation = IsWinVer2000Plus() && (BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT);
+ }
+ else
+ {
+ if (GetParent(pcli->hwndContactList))
{
- int i1;
- int i2;
- i1 = SendDlgItemMessage(hwndDlg,IDC_FRAMESSPIN,UDM_GETPOS,0,0);
- i2 = SendDlgItemMessage(hwndDlg,IDC_CAPTIONSSPIN,UDM_GETPOS,0,0);
-
- db_set_dw(NULL,"CLUIFrames","GapBetweenFrames",(DWORD)i1);
- db_set_dw(NULL,"CLUIFrames","GapBetweenTitleBar",(DWORD)i2);
- Sync(CLUIFramesOnClistResize, (WPARAM)pcli->hwndContactList,(LPARAM)0);
+ SetParent(pcli->hwndContactList,NULL);
+ Sync( CLUIFrames_SetParentForContainers, (HWND)NULL );
}
- db_set_b(NULL,"CList","Transparent",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- db_set_b(NULL,"CList","Alpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0));
- db_set_b(NULL,"CList","AutoAlpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0));
- db_set_b(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP));
-
- ske_LoadSkinFromDB();
- CLUI_UpdateLayeredMode();
- CLUI_ChangeWindowMode();
- SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged
- CLUI_ReloadCLUIOptions();
- cliShowHide(0,1);
- g_mutex_bChangingMode = FALSE;
- return TRUE;
+ g_CluiData.fOnDesktop = 0;
}
- break;
+ AniAva_UpdateParent();
+ db_set_b(NULL,"CLUI","FadeInOut",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT));
+ g_CluiData.fSmoothAnimation = IsWinVer2000Plus() && (BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT);
+ {
+ int i1 = SendDlgItemMessage(hwndDlg,IDC_FRAMESSPIN,UDM_GETPOS,0,0);
+ int i2 = SendDlgItemMessage(hwndDlg,IDC_CAPTIONSSPIN,UDM_GETPOS,0,0);
+
+ db_set_dw(NULL,"CLUIFrames","GapBetweenFrames",(DWORD)i1);
+ db_set_dw(NULL,"CLUIFrames","GapBetweenTitleBar",(DWORD)i2);
+ Sync(CLUIFramesOnClistResize, (WPARAM)pcli->hwndContactList,(LPARAM)0);
+ }
+ db_set_b(NULL,"CList","Transparent",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
+ db_set_b(NULL,"CList","Alpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0));
+ db_set_b(NULL,"CList","AutoAlpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0));
+ db_set_b(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP));
+
+ ske_LoadSkinFromDB();
+ CLUI_UpdateLayeredMode();
+ CLUI_ChangeWindowMode();
+ SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged
+ CLUI_ReloadCLUIOptions();
+ cliShowHide(0,1);
+ g_mutex_bChangingMode = FALSE;
+ return TRUE;
}
}
return FALSE;
@@ -1508,8 +1441,6 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP #define DEFAULT_BKBMPUSE CLB_STRETCH
#define DEFAULT_SELBKCOLOUR GetSysColor(COLOR_HIGHLIGHT)
-
-
extern HINSTANCE g_hInst;
char **bkgrList = NULL;
@@ -1544,273 +1475,227 @@ struct BkgrData int indx;
int count;
};
+
static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct BkgrData *dat = (struct BkgrData *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- switch (msg)
+ switch (msg) {
+ case WM_INITDIALOG:
{
- case WM_INITDIALOG:
- {
- int indx;
- HWND hList = GetDlgItem(hwndDlg, IDC_BKGRLIST);
- TranslateDialogDefault(hwndDlg);
+ int indx;
+ HWND hList = GetDlgItem(hwndDlg, IDC_BKGRLIST);
+ TranslateDialogDefault(hwndDlg);
- dat = (struct BkgrData*)mir_alloc(sizeof(struct BkgrData));
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->count = bkgrCount;
- dat->item = (struct BkgrItem*)mir_alloc(sizeof(struct BkgrItem)*dat->count);
- dat->indx = CB_ERR;
- for (indx = 0; indx < dat->count; indx++)
+ dat = (struct BkgrData*)mir_alloc(sizeof(struct BkgrData));
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
+ dat->count = bkgrCount;
+ dat->item = (struct BkgrItem*)mir_alloc(sizeof(struct BkgrItem)*dat->count);
+ dat->indx = CB_ERR;
+ for (indx = 0; indx < dat->count; indx++)
+ {
+ char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
+ int jndx;
+
+ dat->item[indx].changed = FALSE;
+ dat->item[indx].useBitmap = db_get_b(NULL,module, "UseBitmap", DEFAULT_USEBITMAP);
+ dat->item[indx].bkColor = db_get_dw(NULL,module, "BkColour", DEFAULT_BKCOLOUR);
+ dat->item[indx].selColor = db_get_dw(NULL,module, "SelBkColour", DEFAULT_SELBKCOLOUR);
+ dat->item[indx].useWinColours = db_get_b(NULL,module, "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
{
- char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
- int jndx;
-
- dat->item[indx].changed = FALSE;
- dat->item[indx].useBitmap = db_get_b(NULL,module, "UseBitmap", DEFAULT_USEBITMAP);
- dat->item[indx].bkColor = db_get_dw(NULL,module, "BkColour", DEFAULT_BKCOLOUR);
- dat->item[indx].selColor = db_get_dw(NULL,module, "SelBkColour", DEFAULT_SELBKCOLOUR);
- dat->item[indx].useWinColours = db_get_b(NULL,module, "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
+ DBVARIANT dbv;
+ if ( !DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
{
- DBVARIANT dbv;
- if (!DBGetContactSettingString(NULL,module,"BkBitmap",&dbv))
- {
- int retval = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)dat->item[indx].filename);
- if (!retval || retval == CALLSERVICE_NOTFOUND)
- lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
- mir_free(dbv.pszVal);
- }
- else
- *dat->item[indx].filename = 0;
+ int retval = CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)dbv.pszVal, (LPARAM)dat->item[indx].filename);
+ if ( !retval || retval == CALLSERVICE_NOTFOUND)
+ lstrcpynA(dat->item[indx].filename, dbv.pszVal, MAX_PATH);
+ mir_free(dbv.pszVal);
}
- dat->item[indx].flags = db_get_w(NULL,module,"BkBmpUse", DEFAULT_BKBMPUSE);
- jndx = SendMessageA(hList, CB_ADDSTRING, 0, (LPARAM)Translate(bkgrList[indx]));
- SendMessage(hList, CB_SETITEMDATA, jndx, indx);
- }
- SendMessage(hList, CB_SETCURSEL, 0, 0);
- PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_BKGRLIST, CBN_SELCHANGE), 0);
- {
- HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
- MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandleA("shlwapi"),"SHAutoComplete");
- if (MySHAutoComplete) MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
+ else
+ *dat->item[indx].filename = 0;
}
- return TRUE;
+ dat->item[indx].flags = db_get_w(NULL,module,"BkBmpUse", DEFAULT_BKBMPUSE);
+ jndx = SendMessageA(hList, CB_ADDSTRING, 0, (LPARAM)Translate(bkgrList[indx]));
+ SendMessage(hList, CB_SETITEMDATA, jndx, indx);
+ }
+ SendMessage(hList, CB_SETCURSEL, 0, 0);
+ PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_BKGRLIST, CBN_SELCHANGE), 0);
+ {
+ HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
+ MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandleA("shlwapi"),"SHAutoComplete");
+ if (MySHAutoComplete) MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
+ }
+ return TRUE;
+ }
+ case WM_DESTROY:
+ if (dat) {
+ mir_free(dat->item);
+ mir_free(dat);
}
- case WM_DESTROY:
- if (dat) {
- mir_free(dat->item);
- mir_free(dat);
- }
- return TRUE;
+ return TRUE;
- case M_BKGR_GETSTATE:
- {
- int indx = wParam;
- if (indx == CB_ERR || indx >= dat->count) break;
- indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
+ case M_BKGR_GETSTATE:
+ {
+ int indx = wParam;
+ if (indx == CB_ERR || indx >= dat->count) break;
+ indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
- dat->item[indx].useBitmap = IsDlgButtonChecked(hwndDlg,IDC_BITMAP);
- dat->item[indx].useWinColours = IsDlgButtonChecked(hwndDlg,IDC_USEWINCOL);
- dat->item[indx].bkColor = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR,0,0);
- dat->item[indx].selColor = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR,0,0);
+ dat->item[indx].useBitmap = IsDlgButtonChecked(hwndDlg,IDC_BITMAP);
+ dat->item[indx].useWinColours = IsDlgButtonChecked(hwndDlg,IDC_USEWINCOL);
+ dat->item[indx].bkColor = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR,0,0);
+ dat->item[indx].selColor = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR,0,0);
- GetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename, SIZEOF(dat->item[indx].filename));
- {
- WORD flags = 0;
- if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags |= CLB_STRETCHH;
- if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHV)) flags |= CLB_STRETCHV;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEH)) flags |= CLBF_TILEH;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEV)) flags |= CLBF_TILEV;
- if (IsDlgButtonChecked(hwndDlg,IDC_SCROLL)) flags |= CLBF_SCROLL;
- if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
- if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
- dat->item[indx].flags = flags;
- }
- break;
+ GetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename, SIZEOF(dat->item[indx].filename));
+ {
+ WORD flags = 0;
+ if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHH)) flags |= CLB_STRETCHH;
+ if (IsDlgButtonChecked(hwndDlg,IDC_STRETCHV)) flags |= CLB_STRETCHV;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEH)) flags |= CLBF_TILEH;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEV)) flags |= CLBF_TILEV;
+ if (IsDlgButtonChecked(hwndDlg,IDC_SCROLL)) flags |= CLBF_SCROLL;
+ if (IsDlgButtonChecked(hwndDlg,IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
+ if (IsDlgButtonChecked(hwndDlg,IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
+ dat->item[indx].flags = flags;
}
- case M_BKGR_SETSTATE:
+ break;
+ }
+ case M_BKGR_SETSTATE:
+ {
+ int flags;
+ int indx = wParam;
+ if (indx == -1) break;
+ flags = dat->item[indx].flags;
+ if (indx == CB_ERR || indx >= dat->count) break;
+ indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
+
+ CheckDlgButton(hwndDlg, IDC_BITMAP, dat->item[indx].useBitmap?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USEWINCOL, dat->item[indx].useWinColours?BST_CHECKED:BST_UNCHECKED);
+
+ EnableWindow(GetDlgItem(hwndDlg,IDC_BKGCOLOUR), !dat->item[indx].useWinColours);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SELCOLOUR), !dat->item[indx].useWinColours);
+
+ SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_BKCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].bkColor);
+ SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_SELBKCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].selColor);
+ SetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename);
+
+ CheckDlgButton(hwndDlg,IDC_STRETCHH, flags&CLB_STRETCHH?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_STRETCHV,flags&CLB_STRETCHV?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_TILEH,flags&CLBF_TILEH?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_TILEV,flags&CLBF_TILEV?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_SCROLL,flags&CLBF_SCROLL?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_PROPORTIONAL,flags&CLBF_PROPORTIONAL?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg,IDC_TILEVROWH,flags&CLBF_TILEVTOROWHEIGHT?BST_CHECKED:BST_UNCHECKED);
+
+ SendMessage(hwndDlg, M_BKGR_UPDATE, 0,0);
+ break;
+ }
+ case M_BKGR_UPDATE:
+ {
+ int isChecked = IsDlgButtonChecked(hwndDlg,IDC_BITMAP);
+ int indx;
+ for (indx = 0; indx < SIZEOF(bitmapRelatedControls); indx++)
+ EnableWindow(GetDlgItem(hwndDlg, bitmapRelatedControls[indx]),isChecked);
+ break;
+ }
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_BROWSE)
{
- int flags;
- int indx = wParam;
- if (indx == -1) break;
- flags = dat->item[indx].flags;
- if (indx == CB_ERR || indx >= dat->count) break;
- indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
-
- CheckDlgButton(hwndDlg, IDC_BITMAP, dat->item[indx].useBitmap?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_USEWINCOL, dat->item[indx].useWinColours?BST_CHECKED:BST_UNCHECKED);
-
- EnableWindow(GetDlgItem(hwndDlg,IDC_BKGCOLOUR), !dat->item[indx].useWinColours);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SELCOLOUR), !dat->item[indx].useWinColours);
-
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_BKCOLOUR);
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].bkColor);
- SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_SELBKCOLOUR);
- SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].selColor);
- SetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename);
-
- CheckDlgButton(hwndDlg,IDC_STRETCHH, flags&CLB_STRETCHH?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_STRETCHV,flags&CLB_STRETCHV?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TILEH,flags&CLBF_TILEH?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TILEV,flags&CLBF_TILEV?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_SCROLL,flags&CLBF_SCROLL?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_PROPORTIONAL,flags&CLBF_PROPORTIONAL?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg,IDC_TILEVROWH,flags&CLBF_TILEVTOROWHEIGHT?BST_CHECKED:BST_UNCHECKED);
-/*
- {
- WORD visibility;
- int cy = 55;
- char *sz = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
- sz += strlen(sz) + 1;
- visibility = (WORD)~(*(DWORD*)(sz));
-//M_BKGR_BACKCOLOR,M_BKGR_SELECTCOLOR,M_BKGR_ALLOWBITMAPS,M_BKGR_STRETCH,M_BKGR_TILE}
- if (visibility & M_BKGR_BACKCOLOR)
- {
- SetWindowPos(GetDlgItem(hwndDlg, IDC_BC_STATIC), 0,
- 20, cy,
- 0, 0,
- SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE);
- SetWindowPos(GetDlgItem(hwndDlg, IDC_BKGCOLOUR), 0,
- 130, cy,
- 0, 0,
- SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE);
- cy += 25;
- }
- if (visibility & M_BKGR_SELECTCOLOR)
- {
- SetWindowPos(GetDlgItem(hwndDlg, IDC_SC_STATIC), 0,
- 20, cy,
- 0, 0,
- SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE);
- SetWindowPos(GetDlgItem(hwndDlg, IDC_SELCOLOUR), 0,
- 130, cy,
- 0, 0,
- SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE);
- cy += 25;
- }
- ShowWindow(GetDlgItem(hwndDlg,IDC_STRETCHH), visibility&CLB_STRETCHH?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_STRETCHV), visibility&CLB_STRETCHV?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_TILEH), visibility&CLBF_TILEH?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_TILEV), visibility&CLBF_TILEV?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_SCROLL), visibility&CLBF_SCROLL?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_PROPORTIONAL), visibility&CLBF_PROPORTIONAL?SW_SHOW:SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_TILEVROWH), visibility&CLBF_TILEVTOROWHEIGHT?SW_SHOW:SW_HIDE);
- }
-*/
+ char str[MAX_PATH];
+ OPENFILENAMEA ofn = {0};
+ char filter[512];
- SendMessage(hwndDlg, M_BKGR_UPDATE, 0,0);
- break;
+ GetDlgItemTextA(hwndDlg,IDC_FILENAME, str, SIZEOF(str));
+ ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
+ ofn.hwndOwner = hwndDlg;
+ ofn.hInstance = NULL;
+ CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, SIZEOF(filter), (LPARAM)filter);
+ ofn.lpstrFilter = filter;
+ ofn.lpstrFile = str;
+ ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
+ ofn.nMaxFile = SIZEOF(str);
+ ofn.nMaxFileTitle = MAX_PATH;
+ ofn.lpstrDefExt = "bmp";
+ if ( !GetOpenFileNameA(&ofn)) break;
+ SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
}
- case M_BKGR_UPDATE:
+ else
+ if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) break;
+ if (LOWORD(wParam) == IDC_BITMAP)
+ SendMessage(hwndDlg, M_BKGR_UPDATE, 0,0);
+ if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ return 0;
+ if (LOWORD(wParam) == IDC_BKGRLIST)
{
- int isChecked = IsDlgButtonChecked(hwndDlg,IDC_BITMAP);
- int indx;
- for (indx = 0; indx < SIZEOF(bitmapRelatedControls); indx++)
- EnableWindow(GetDlgItem(hwndDlg, bitmapRelatedControls[indx]),isChecked);
- break;
- }
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_BROWSE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
{
- char str[MAX_PATH];
- OPENFILENAMEA ofn = {0};
- char filter[512];
-
- GetDlgItemTextA(hwndDlg,IDC_FILENAME, str, SIZEOF(str));
- ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = hwndDlg;
- ofn.hInstance = NULL;
- CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, SIZEOF(filter), (LPARAM)filter);
- ofn.lpstrFilter = filter;
- ofn.lpstrFile = str;
- ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
- ofn.nMaxFile = SIZEOF(str);
- ofn.nMaxFileTitle = MAX_PATH;
- ofn.lpstrDefExt = "bmp";
- if (!GetOpenFileNameA(&ofn)) break;
- SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
- }
- else
- if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) break;
- if (LOWORD(wParam) == IDC_BITMAP)
- SendMessage(hwndDlg, M_BKGR_UPDATE, 0,0);
- if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
- return 0;
- if (LOWORD(wParam) == IDC_BKGRLIST)
- {
- if (HIWORD(wParam) == CBN_SELCHANGE)
- {
- SendMessage(hwndDlg, M_BKGR_GETSTATE, dat->indx, 0);
- SendMessage(hwndDlg, M_BKGR_SETSTATE, dat->indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0), 0);
- }
- return 0;
+ SendMessage(hwndDlg, M_BKGR_GETSTATE, dat->indx, 0);
+ SendMessage(hwndDlg, M_BKGR_SETSTATE, dat->indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0), 0);
}
+ return 0;
+ }
+ {
+ int indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0);
+ if (indx != CB_ERR && indx < dat->count)
{
- int indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0);
- if (indx != CB_ERR && indx < dat->count)
- {
- indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
- dat->item[indx].changed = TRUE;
+ indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
+ dat->item[indx].changed = TRUE;
- }
- {
- BOOL EnableColours = !IsDlgButtonChecked(hwndDlg,IDC_USEWINCOL);
- EnableWindow(GetDlgItem(hwndDlg,IDC_BKGCOLOUR), EnableColours);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SELCOLOUR), EnableColours);
- }
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0,0);
}
- break;
- case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom)
{
- case 0:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
+ BOOL EnableColours = !IsDlgButtonChecked(hwndDlg,IDC_USEWINCOL);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_BKGCOLOUR), EnableColours);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SELCOLOUR), EnableColours);
+ }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0,0);
+ }
+ break;
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ SendMessage(hwndDlg, M_BKGR_GETSTATE, SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0), 0);
+ {
+ for (int indx = 0; indx < dat->count; indx++)
+ if (dat->item[indx].changed)
{
- int indx;
- SendMessage(hwndDlg, M_BKGR_GETSTATE, SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0), 0);
- for (indx = 0; indx < dat->count; indx++)
- if (dat->item[indx].changed)
- {
- char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
- db_set_b(NULL, module, "UseBitmap", (BYTE)dat->item[indx].useBitmap);
- {
- COLORREF col;
-
- if ((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR)
- db_unset(NULL, module, "BkColour");
- else
- db_set_dw(NULL, module, "BkColour", col);
-
- if ((col = dat->item[indx].selColor) == DEFAULT_SELBKCOLOUR)
- db_unset(NULL, module, "SelBkColour");
- else
- db_set_dw(NULL, module, "SelBkColour", col);
- }
- db_set_b(NULL, module, "UseWinColours", (BYTE)dat->item[indx].useWinColours);
-
- {
- char str[MAX_PATH];
- int retval = CallService(MS_UTILS_PATHTOABSOLUTE,
- (WPARAM)dat->item[indx].filename,
- (LPARAM)str);
- if (!retval || retval == CALLSERVICE_NOTFOUND)
- db_set_s(NULL, module, "BkBitmap", dat->item[indx].filename);
- else
- db_set_s(NULL, module, "BkBitmap", str);
- }
- db_set_w(NULL, module, "BkBmpUse", dat->item[indx].flags);
- dat->item[indx].changed = FALSE;
- NotifyEventHooks(g_CluiData.hEventBkgrChanged, (WPARAM)module, 0);
- }
- return TRUE;
+ char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
+ db_set_b(NULL, module, "UseBitmap", (BYTE)dat->item[indx].useBitmap);
+
+ COLORREF col;
+ if ((col = dat->item[indx].bkColor) == DEFAULT_BKCOLOUR)
+ db_unset(NULL, module, "BkColour");
+ else
+ db_set_dw(NULL, module, "BkColour", col);
+
+ if ((col = dat->item[indx].selColor) == DEFAULT_SELBKCOLOUR)
+ db_unset(NULL, module, "SelBkColour");
+ else
+ db_set_dw(NULL, module, "SelBkColour", col);
+
+ db_set_b(NULL, module, "UseWinColours", (BYTE)dat->item[indx].useWinColours);
+
+ char str[MAX_PATH];
+ int retval = CallService(MS_UTILS_PATHTOABSOLUTE,
+ (WPARAM)dat->item[indx].filename,
+ (LPARAM)str);
+ if ( !retval || retval == CALLSERVICE_NOTFOUND)
+ db_set_s(NULL, module, "BkBitmap", dat->item[indx].filename);
+ else
+ db_set_s(NULL, module, "BkBitmap", str);
+
+ db_set_w(NULL, module, "BkBmpUse", dat->item[indx].flags);
+ dat->item[indx].changed = FALSE;
+ NotifyEventHooks(g_CluiData.hEventBkgrChanged, (WPARAM)module, 0);
}
- }
- break;
+ return TRUE;
+ }
}
break;
+ }
+ break;
}
return FALSE;
}
@@ -1834,11 +1719,9 @@ static INT_PTR BkgrCfg_Register(WPARAM wParam,LPARAM lParam) bkgrList = (char **)mir_realloc(bkgrList, sizeof(char*)*(bkgrCount+1));
bkgrList[bkgrCount] = value;
bkgrCount++;
-
return 0;
}
-
HRESULT BackgroundsLoadModule()
{
CreateServiceFunction(MS_BACKGROUNDCONFIG_REGISTER, BkgrCfg_Register);
@@ -1985,8 +1868,6 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar //{IDC_, def, bit, dbtype, dbmodule, dbsetting, valtype, pval},
{IDC_ONTOP, SETTING_ONTOP_DEFAULT, 0, DBVT_BYTE, "CList", "OnTop"},
{IDC_AUTOHIDE, SETTING_AUTOHIDE_DEFAULT, 0, DBVT_BYTE, "CList", "AutoHide"},
-// {IDC_SHOWPROTO, TRUE,
-// {IDC_SHOWSTATUS, FALSE,
{IDC_FADEINOUT, SETTING_FADEIN_DEFAULT, 0, DBVT_BYTE, "CLUI", "FadeInOut"},
{IDC_TRANSPARENT, SETTING_TRANSPARENT_DEFAULT, 0, DBVT_BYTE, "CList", "Transparent"},
{IDC_SHOWGROUPCOUNTS, GetDefaultExStyle(), CLS_EX_SHOWGROUPCOUNTS, DBVT_DWORD, "CLC", "ExStyle"},
@@ -2001,7 +1882,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar switch (msg)
{
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
bInit = true;
@@ -2018,14 +1899,14 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETRANGE,0,MAKELONG(900,1));
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
- if (!IsWinVer2000Plus())
+ if ( !IsWinVer2000Plus())
{
EnableWindow(GetDlgItem(hwndDlg,IDC_FADEINOUT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
@@ -2069,86 +1950,86 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar return TRUE;
}
- case WM_DESTROY:
- bInit = true;
- break;
+ case WM_DESTROY:
+ bInit = true;
+ break;
- case WM_HSCROLL:
+ case WM_HSCROLL:
{ char str[10];
- sprintf(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0)/255);
- SetDlgItemTextA(hwndDlg,IDC_INACTIVEPERC,str);
- sprintf(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0)/255);
- SetDlgItemTextA(hwndDlg,IDC_ACTIVEPERC,str);
- if (wParam != 0x12345678)
- if (!bInit) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- break;
+ sprintf(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0)/255);
+ SetDlgItemTextA(hwndDlg,IDC_INACTIVEPERC,str);
+ sprintf(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0)/255);
+ SetDlgItemTextA(hwndDlg,IDC_ACTIVEPERC,str);
+ if (wParam != 0x12345678)
+ if ( !bInit) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ break;
}
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDC_AUTOHIDE:
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- break;
- case 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));
- break;
- }
- if (!bInit) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDC_AUTOHIDE:
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
+ break;
+ case 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));
break;
+ }
+ if ( !bInit) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
- case WM_NOTIFY:
+ case WM_NOTIFY:
{
switch (((LPNMHDR) lParam)->idFrom)
{
- case 0:
- switch (((LPNMHDR) lParam)->code)
+ case 0:
+ switch (((LPNMHDR) lParam)->code)
+ {
+ case PSN_APPLY:
{
- case PSN_APPLY:
+ int i;
+
+ g_mutex_bChangingMode = TRUE;
+
+ for (i=0; i < SIZEOF(opts); ++i)
+ OptCheckBox_Save(hwndDlg, opts+i);
+
+ SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg,IDC_ONTOP)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ db_set_w(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
+
+ db_set_b(NULL,"CList","Alpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0));
+ db_set_b(NULL,"CList","AutoAlpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0));
+
{
- int i;
-
- g_mutex_bChangingMode = TRUE;
-
- for (i=0; i < SIZEOF(opts); ++i)
- OptCheckBox_Save(hwndDlg, opts+i);
-
- SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg,IDC_ONTOP)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- db_set_w(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
-
- db_set_b(NULL,"CList","Alpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0));
- db_set_b(NULL,"CList","AutoAlpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0));
-
- {
- int s1 = SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_GETCURSEL,0,0);
- int s2 = SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_GETCURSEL,0,0);
- int s3 = SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_GETCURSEL,0,0);
- if (s1 >= 0) s1 = sortbyValue[s1];
- if (s2 >= 0) s2 = sortbyValue[s2];
- if (s3 >= 0) s3 = sortbyValue[s3];
- db_set_b(NULL,"CList","SortBy1",(BYTE)s1);
- db_set_b(NULL,"CList","SortBy2",(BYTE)s2);
- db_set_b(NULL,"CList","SortBy3",(BYTE)s3);
- }
-
- ClcOptionsChanged();
- AniAva_UpdateOptions();
- ske_LoadSkinFromDB();
- CLUI_UpdateLayeredMode();
- CLUI_ChangeWindowMode();
- SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged
- CLUI_ReloadCLUIOptions();
- cliShowHide(0,1);
- g_mutex_bChangingMode = FALSE;
- return TRUE;
+ int s1 = SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_GETCURSEL,0,0);
+ int s2 = SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_GETCURSEL,0,0);
+ int s3 = SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_GETCURSEL,0,0);
+ if (s1 >= 0) s1 = sortbyValue[s1];
+ if (s2 >= 0) s2 = sortbyValue[s2];
+ if (s3 >= 0) s3 = sortbyValue[s3];
+ db_set_b(NULL,"CList","SortBy1",(BYTE)s1);
+ db_set_b(NULL,"CList","SortBy2",(BYTE)s2);
+ db_set_b(NULL,"CList","SortBy3",(BYTE)s3);
}
+
+ ClcOptionsChanged();
+ AniAva_UpdateOptions();
+ ske_LoadSkinFromDB();
+ CLUI_UpdateLayeredMode();
+ CLUI_ChangeWindowMode();
+ SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged
+ CLUI_ReloadCLUIOptions();
+ cliShowHide(0,1);
+ g_mutex_bChangingMode = FALSE;
+ return TRUE;
}
- break;
+ }
+ break;
}
break;
}
diff --git a/plugins/Clist_modern/modern_clcpaint.cpp b/plugins/Clist_modern/modern_clcpaint.cpp index c1dee212ee..7093992d54 100644 --- a/plugins/Clist_modern/modern_clcpaint.cpp +++ b/plugins/Clist_modern/modern_clcpaint.cpp @@ -1653,7 +1653,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str {
TCHAR szResult[80];
- if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
+ if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
{
// Select font
ChangeToFont( hdcMem, dat, FONTID_CONTACT_TIME, NULL );
@@ -2490,7 +2490,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct {
TCHAR szResult[80];
- if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
+ if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
{
SIZE text_size;
RECT rc;
@@ -3212,7 +3212,7 @@ void CLCPaint::_DrawContactTime( HDC hdcMem, struct ClcData *dat, struct ClcCont if ( !pdnce ) return;
- if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
+ if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
{
// Select font
ChangeToFont( hdcMem, dat, FONTID_CONTACT_TIME, NULL );
diff --git a/plugins/Clist_modern/modern_clcutils.cpp b/plugins/Clist_modern/modern_clcutils.cpp index c38788fd23..aa386d0e17 100644 --- a/plugins/Clist_modern/modern_clcutils.cpp +++ b/plugins/Clist_modern/modern_clcutils.cpp @@ -149,7 +149,7 @@ void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth) if (desty>maxy) desty = maxy;
if (desty < 0) desty = 0;
if (abs(desty-dat->yScroll) < 4) noSmooth = 1;
- if (!noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth = 1;
+ if ( !noSmooth && dat->exStyle&CLS_EX_NOSMOOTHSCROLLING) noSmooth = 1;
previousy = dat->yScroll;
BOOL keyDown = ( ( GetKeyState( VK_UP )
@@ -161,7 +161,7 @@ void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth) | GetKeyState( VK_HOME )
| GetKeyState( VK_END )) & 0x8000 );
- if (!noSmooth && !keyDown)
+ if ( !noSmooth && !keyDown)
{
startTick = GetTickCount();
for (;;) {
@@ -367,7 +367,7 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt) dat->selection = dat->iDragItem;
dat->iInsertionMark = -1;
dat->nInsertionLevel = 0;
- if (!PtInRect(&clRect,pt)) return DROPTARGET_OUTSIDE;
+ if ( !PtInRect(&clRect,pt)) return DROPTARGET_OUTSIDE;
hit = cliHitTest(hwnd,dat,pt.x,pt.y,&contact,&group,&hitFlags);
cliGetRowByIndex(dat,dat->iDragItem,&movecontact,&movegroup);
@@ -633,7 +633,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv))
+ if ( !DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv))
{
lstrcpyn(dat->second_line_text, dbv.ptszVal, SIZEOF(dat->second_line_text)-1);
dat->second_line_text[SIZEOF(dat->second_line_text)-1] = _T('\0');
@@ -671,7 +671,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv))
+ if ( !DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv))
{
lstrcpyn(dat->third_line_text, dbv.ptszVal, SIZEOF(dat->third_line_text)-1);
dat->third_line_text[SIZEOF(dat->third_line_text)-1] = _T('\0');
@@ -718,13 +718,13 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) if (g_CluiData.fDisableSkinEngine)
{
DBVARIANT dbv;
- if (!dat->bkChanged)
+ if ( !dat->bkChanged)
{
dat->bkColour = sttGetColor("CLC","BkColour",GetSysColor(COLOR_3DFACE));
{
if (db_get_b(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP))
{
- if (!DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv))
+ if ( !DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv))
{
dat->hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
@@ -740,7 +740,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) dat->MenuTextHiColor = sttGetColor("Menu","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
if (db_get_b(NULL,"Menu","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!DBGetContactSettingString(NULL,"Menu","BkBitmap",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"Menu","BkBitmap",&dbv)) {
dat->hMenuBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -754,7 +754,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) dat->selTextColour = db_get_dw(NULL,"CLC","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
dat->hotTextColour = db_get_dw(NULL,"CLC","HotTextColour",CLCDEFAULT_MODERN_HOTTEXTCOLOUR);
dat->quickSearchColour = db_get_dw(NULL,"CLC","QuickSearchColour",CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR);
- if (!g_szMetaModuleName && ServiceExists(MS_MC_GETPROTOCOLNAME)) g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
+ if ( !g_szMetaModuleName && ServiceExists(MS_MC_GETPROTOCOLNAME)) g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
g_szMetaModuleName && db_get_b(NULL,g_szMetaModuleName,"Enabled",1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
@@ -832,7 +832,7 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref }
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP)
{
- if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded) {
+ if ( !(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || group->cl.items[group->scanIndex]->group->expanded) {
group = group->cl.items[group->scanIndex]->group;
group->scanIndex = 0;
SubCount = 0;
@@ -842,7 +842,7 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref }
if (contact->type == CLCIT_CONTACT && contact->SubAllocated)
{
- if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || contact->SubExpanded )
+ if ( !(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || contact->SubExpanded )
{
int i=0;
for (i=0; i < contact->SubAllocated; i++)
@@ -855,7 +855,7 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref int contactScanIndex = group->scanIndex;
for (; group; group = group->parent)
pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
- if (!contact->SubExpanded)
+ if ( !contact->SubExpanded)
ExpandMetaContact(hwnd, contact, dat, 1 );
return pcli->pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex+SubCount+i+1);
}
diff --git a/plugins/Clist_modern/modern_clistevents.cpp b/plugins/Clist_modern/modern_clistevents.cpp index adc2d55de0..a1fcac155a 100644 --- a/plugins/Clist_modern/modern_clistevents.cpp +++ b/plugins/Clist_modern/modern_clistevents.cpp @@ -257,7 +257,7 @@ static BOOL sttDrawEventAreaBackground(HWND hwnd, HDC hdc, RECT * rect) if (rect) rc = *rect;
else GetClientRect(hwnd,&rc);
- if (!event_area.hBmpBackground && !event_area.useWinColors)
+ if ( !event_area.hBmpBackground && !event_area.useWinColors)
{
HBRUSH hbr = CreateSolidBrush(event_area.bkColour);
FillRect(hdc, &rc, hbr);
@@ -285,7 +285,7 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
event_area.bkColour = sttGetColor("EventArea","BkColour",CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL,"EventArea","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!DBGetContactSettingString(NULL,"EventArea","BkBitmap",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"EventArea","BkBitmap",&dbv)) {
event_area.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -405,7 +405,7 @@ static void EventArea_HideShowNotifyFrame() if (desired)
{
- if (!dwVisible)
+ if ( !dwVisible)
CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
}
else
@@ -420,7 +420,7 @@ int EventArea_Create(HWND hCluiWnd) {
CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"Event Area Background/EventArea",0);
- ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhEventAreaBackgroundSettingsChanged);
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhEventAreaBackgroundSettingsChanged);
ehhEventAreaBackgroundSettingsChanged(0,0);
WNDCLASS wndclass = {0};
@@ -563,7 +563,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP }
break;
case WM_SIZE:
- if (!g_CluiData.fLayered)InvalidateRect(hwnd,NULL,FALSE);
+ if ( !g_CluiData.fLayered)InvalidateRect(hwnd,NULL,FALSE);
return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_ERASEBKGND:
return 1;
diff --git a/plugins/Clist_modern/modern_clistmenus.cpp b/plugins/Clist_modern/modern_clistmenus.cpp index 8ef9abdd83..1cb178028d 100644 --- a/plugins/Clist_modern/modern_clistmenus.cpp +++ b/plugins/Clist_modern/modern_clistmenus.cpp @@ -100,87 +100,79 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) if ( bContactRate >SIZEOF( rates ) - 1 )
bContactRate = SIZEOF( rates ) - 1;
- //if (hFavoriteContactMenu)
- // CallService(MO_REMOVEMENUITEM,(WPARAM)hFavoriteContactMenu,0);
- //hFavoriteContactMenu = NULL;
- //if (!hFavoriteContactMenu)
+
+ BOOL bModifyMenu = FALSE;
+ int i;
+ TCHAR * name = NULL;
+
+
+ memset(&mi,0,sizeof(mi));
+ mi.cbSize = sizeof(mi);
+ mi.hIcon = CLUI_LoadIconFromExternalFile("clisticons.dll",8,TRUE,TRUE,iconsName[bContactRate],"Contact List",Translate(iconsName[bContactRate]),-IDI_FAVORITE_0 - bContactRate, &NeedFree);
+ mi.pszPopupName = (char *)-1;
+ mi.position = 0;
+ if ( !bContactRate)
+ mi.ptszName = FAVMENUROOTNAME;
+ else
{
- BOOL bModifyMenu = FALSE;
- int i;
- TCHAR * name = NULL;
-
-
- memset(&mi,0,sizeof(mi));
- mi.cbSize = sizeof(mi);
- mi.hIcon = CLUI_LoadIconFromExternalFile("clisticons.dll",8,TRUE,TRUE,iconsName[bContactRate],"Contact List",Translate(iconsName[bContactRate]),-IDI_FAVORITE_0 - bContactRate, &NeedFree);
- // LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_FAVORITE_0 + bContactRate));
- mi.pszPopupName = (char *)-1;
- mi.position = 0;
- if (!bContactRate)
- mi.ptszName = FAVMENUROOTNAME;
- else
- {
- int bufsize = (lstrlen(FAVMENUROOTNAME)+lstrlen(rates[bContactRate])+15)*sizeof(TCHAR);
- name = (TCHAR*)_alloca(bufsize);
- mir_sntprintf(name,bufsize/sizeof(TCHAR),_T("%s (%s)"),FAVMENUROOTNAME,rates[bContactRate]);
- mi.ptszName = name;
- }
- //mi.pszService = "ContactRate MenuItem NoService Fake";
- mi.flags = CMIF_ROOTPOPUP|CMIF_TCHAR;
- if (!hFavoriteContactMenu)
- hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
- else
- {
- mi.flags |= CMIM_FLAGS|CMIM_ICON|CMIM_NAME;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenu, (LPARAM)&mi);
- bModifyMenu = TRUE;
- }
- {
- OptParam op;
- op.Handle = hFavoriteContactMenu;
- op.Setting = OPT_MENUITEMSETUNIQNAME;
- op.Value = (INT_PTR)"ModernClistMenu_ContactRate";
- CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
- }
+ int bufsize = (lstrlen(FAVMENUROOTNAME)+lstrlen(rates[bContactRate])+15)*sizeof(TCHAR);
+ name = (TCHAR*)_alloca(bufsize);
+ mir_sntprintf(name,bufsize/sizeof(TCHAR),_T("%s (%s)"),FAVMENUROOTNAME,rates[bContactRate]);
+ mi.ptszName = name;
+ }
+ mi.flags = CMIF_ROOTPOPUP|CMIF_TCHAR;
+ if ( !hFavoriteContactMenu)
+ hFavoriteContactMenu = Menu_AddContactMenuItem(&mi);
+ else
+ {
+ mi.flags |= CMIM_FLAGS|CMIM_ICON|CMIM_NAME;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenu, (LPARAM)&mi);
+ bModifyMenu = TRUE;
+ }
+ {
+ OptParam op;
+ op.Handle = hFavoriteContactMenu;
+ op.Setting = OPT_MENUITEMSETUNIQNAME;
+ op.Value = (INT_PTR)"ModernClistMenu_ContactRate";
+ CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
+ }
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)mi.hIcon,0);
- if (mi.hIcon && NeedFree) DestroyIcon(mi.hIcon);
+ CallService(MS_SKIN2_RELEASEICON,(WPARAM)mi.hIcon,0);
+ if (mi.hIcon && NeedFree) DestroyIcon(mi.hIcon);
- mi.pszPopupName = (char*)hFavoriteContactMenu;
- if (!hFavoriteContactMenuItems)
- {
- hFavoriteContactMenuItems = (HANDLE*)malloc(sizeof(HANDLE)*SIZEOF(rates));
- memset(hFavoriteContactMenuItems,0,sizeof(HANDLE)*SIZEOF(rates));
- }
- for (i=0; i < SIZEOF(rates); i++)
- {
- mi.hIcon = mi.hIcon = CLUI_LoadIconFromExternalFile("clisticons.dll",8+i,TRUE,TRUE,iconsName[i],"Contact List",Translate(iconsName[i]),-IDI_FAVORITE_0 - i, &NeedFree);
- mi.ptszName = rates[i];
- mi.flags = CMIF_CHILDPOPUP|CMIF_TCHAR|((bContactRate == i)?CMIF_CHECKED:0);
- mi.pszService = CLUI_FAVSETRATE;
- mi.popupPosition = i;
- if (bModifyMenu && hFavoriteContactMenuItems[i])
- {
- mi.flags |= CMIM_FLAGS|CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenuItems[i], (LPARAM)&mi);
- }
- else hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
- CallService(MS_SKIN2_RELEASEICON,(WPARAM)mi.hIcon,0);
- if (mi.hIcon && NeedFree) DestroyIcon(mi.hIcon);
- }
-
- mi.hIcon = NULL;
- mi.ptszName = _T("Show even if offline");
- mi.flags = CMIF_CHILDPOPUP|CMIF_TCHAR|(db_get_b((HANDLE)wParam,"CList","noOffline",0)?CMIF_CHECKED:0);
- mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
- mi.popupPosition = i+100000000;
- mi.position = -100000000;
- if (bModifyMenu && hShowIfOflineItem) {
+ mi.pszPopupName = (char*)hFavoriteContactMenu;
+ if ( !hFavoriteContactMenuItems) {
+ hFavoriteContactMenuItems = (HANDLE*)malloc(sizeof(HANDLE)*SIZEOF(rates));
+ memset(hFavoriteContactMenuItems,0,sizeof(HANDLE)*SIZEOF(rates));
+ }
+
+ for (i=0; i < SIZEOF(rates); i++) {
+ mi.hIcon = mi.hIcon = CLUI_LoadIconFromExternalFile("clisticons.dll",8+i,TRUE,TRUE,iconsName[i],"Contact List",Translate(iconsName[i]),-IDI_FAVORITE_0 - i, &NeedFree);
+ mi.ptszName = rates[i];
+ mi.flags = CMIF_CHILDPOPUP|CMIF_TCHAR|((bContactRate == i)?CMIF_CHECKED:0);
+ mi.pszService = CLUI_FAVSETRATE;
+ mi.popupPosition = i;
+ if (bModifyMenu && hFavoriteContactMenuItems[i]) {
mi.flags |= CMIM_FLAGS|CMIM_ICON;
- CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hShowIfOflineItem, (LPARAM)&mi);
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenuItems[i], (LPARAM)&mi);
}
- else hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
+ else hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
+ CallService(MS_SKIN2_RELEASEICON,(WPARAM)mi.hIcon,0);
+ if (mi.hIcon && NeedFree) DestroyIcon(mi.hIcon);
+ }
+
+ mi.hIcon = NULL;
+ mi.ptszName = _T("Show even if offline");
+ mi.flags = CMIF_CHILDPOPUP|CMIF_TCHAR|(db_get_b((HANDLE)wParam,"CList","noOffline",0)?CMIF_CHECKED:0);
+ mi.pszService = CLUI_FAVTOGGLESHOWOFFLINE;
+ mi.popupPosition = i+100000000;
+ mi.position = -100000000;
+ if (bModifyMenu && hShowIfOflineItem) {
+ mi.flags |= CMIM_FLAGS|CMIM_ICON;
+ CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hShowIfOflineItem, (LPARAM)&mi);
}
+ else hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
+
return 0;
}
@@ -207,14 +199,12 @@ int LoadFavoriteContactMenu() {
CreateServiceFunction(CLUI_FAVSETRATE,FAV_SetRate);
CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE,FAV_ToggleShowOffline);
- hOnContactMenuBuild_FAV = ModernHookEvent(ME_CLIST_PREBUILDCONTACTMENU,FAV_OnContactMenuBuild);
+ hOnContactMenuBuild_FAV = HookEvent(ME_CLIST_PREBUILDCONTACTMENU,FAV_OnContactMenuBuild);
return 0;
}
int UnloadFavoriteContactMenu()
{
- ModernUnhookEvent(hOnContactMenuBuild_FAV);
-
if (hFavoriteContactMenuItems)
free (hFavoriteContactMenuItems);
hFavoriteContactMenuItems = NULL;
diff --git a/plugins/Clist_modern/modern_clistmod.cpp b/plugins/Clist_modern/modern_clistmod.cpp index 118c1325f2..f46253f386 100644 --- a/plugins/Clist_modern/modern_clistmod.cpp +++ b/plugins/Clist_modern/modern_clistmod.cpp @@ -62,9 +62,6 @@ HIMAGELIST hCListImages = NULL; BOOL (WINAPI *MySetProcessWorkingSetSize)(HANDLE,SIZE_T,SIZE_T);
-
-static HANDLE hSettingChanged;
-
//returns normal icon or combined with status overlay. Needs to be destroyed.
HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
{
@@ -105,7 +102,7 @@ HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status) }
}
}
- if (!hIcon)
+ if ( !hIcon)
{
hIcon = ske_ImageList_GetIcon(g_himlCListClc,ExtIconFromStatusMode(hContact,szProto,status),ILD_NORMAL);
}
@@ -143,7 +140,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) char AdvancedService[255] = {0};
int nActStatus = nStatus;
HANDLE hActContact = hContact;
- if (!db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && g_szMetaModuleName && !mir_strcmp(szActProto,g_szMetaModuleName))
+ if ( !db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) && g_szMetaModuleName && !mir_strcmp(szActProto,g_szMetaModuleName))
{
// substitute params by mostonline contact datas
HANDLE hMostOnlineContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0);
@@ -208,16 +205,10 @@ void UnLoadContactListModule() //unhooks noncritical events {
UninitTrayMenu();
UninitCustomMenus();
- // UnloadMainMenu();
- // UnloadStatusMenu();
- ModernUnhookEvent(hookOptInitialise_CList);
- ModernUnhookEvent(hookOptInitialise_Skin);
- ModernUnhookEvent(hSettingChanged);
- ModernUnhookEvent(hookContactAdded_CListSettings);
}
+
int CListMod_ContactListShutdownProc(WPARAM wParam,LPARAM lParam)
{
- ModernUnhookEvent(hookSystemShutdown_CListMod);
FreeDisplayNameCache();
if (g_hMainThread) CloseHandle(g_hMainThread);
g_hMainThread = NULL;
@@ -266,8 +257,8 @@ HRESULT PreLoadContactListModule() //initialize firstly hooks
//clist interface is empty yet so handles should check
- hSettingChanged = ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED,ContactSettingChanged);
- CreateServiceFunction(MS_CLIST_GETCONTACTICON,GetContactIcon);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ContactSettingChanged);
+ CreateServiceFunction(MS_CLIST_GETCONTACTICON, GetContactIcon);
return S_OK;
}
@@ -281,15 +272,15 @@ HRESULT CluiLoadModule() CreateServiceFunction(MS_CLUI_GETCAPS,CLUIGetCapsService);
InitDisplayNameCache();
- hookSystemShutdown_CListMod = ModernHookEvent(ME_SYSTEM_SHUTDOWN,CListMod_ContactListShutdownProc);
- hookOptInitialise_CList = ModernHookEvent(ME_OPT_INITIALISE,CListOptInit);
- hookOptInitialise_Skin = ModernHookEvent(ME_OPT_INITIALISE,SkinOptInit);
+ hookSystemShutdown_CListMod = HookEvent(ME_SYSTEM_SHUTDOWN,CListMod_ContactListShutdownProc);
+ hookOptInitialise_CList = HookEvent(ME_OPT_INITIALISE,CListOptInit);
+ hookOptInitialise_Skin = HookEvent(ME_OPT_INITIALISE,SkinOptInit);
CreateServiceFunction("ModernSkinSel/Active", SvcActiveSkin);
CreateServiceFunction("ModernSkinSel/Preview", SvcPreviewSkin);
CreateServiceFunction("ModernSkinSel/Apply", SvcApplySkin);
- hookContactAdded_CListSettings = ModernHookEvent(ME_DB_CONTACT_ADDED,ContactAdded);
+ hookContactAdded_CListSettings = HookEvent(ME_DB_CONTACT_ADDED,ContactAdded);
CreateServiceFunction(MS_CLIST_TRAYICONPROCESSMESSAGE,cli_TrayIconProcessMessage);
CreateServiceFunction(MS_CLIST_PAUSEAUTOHIDE,TrayIconPauseAutoHide);
CreateServiceFunction(MS_CLIST_CONTACTCHANGEGROUP,ContactChangeGroup);
@@ -444,7 +435,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) { {
TCHAR buf[255];
GetClassName(hAux,buf,SIZEOF(buf));
- if (!lstrcmp(buf,CLUIFrameSubContainerClassName))
+ if ( !lstrcmp(buf,CLUIFrameSubContainerClassName))
{
hWndFound = TRUE;
break;
@@ -490,7 +481,7 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) iVisibleState = GWVS_HIDDEN;
}
- if (!method && db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT)>0)
+ if ( !method && db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT)>0)
{
g_CluiData.bBehindEdgeSettings = db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT);
CLUI_ShowFromBehindEdge();
@@ -518,12 +509,12 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) Sync( CLUIFrames_ActivateSubContainers, TRUE );
CLUI_ShowWindowMod(pcli->hwndContactList, SW_RESTORE);
- if (!db_get_b(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT))
+ if ( !db_get_b(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT))
{
Sync(CLUIFrames_OnShowHide, pcli->hwndContactList,1); //TO BE PROXIED
SetWindowPos(pcli->hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE |SWP_NOACTIVATE);
g_bCalledFromShowHide = 1;
- if (!db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT))
+ if ( !db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT))
SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
g_bCalledFromShowHide = 0;
}
@@ -575,6 +566,6 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) int CListMod_HideWindow(HWND hwndContactList, int mode)
{
KillTimer(pcli->hwndContactList,1/*TM_AUTOALPHA*/);
- if (!CLUI_HideBehindEdge()) return CLUI_SmoothAlphaTransition(pcli->hwndContactList, 0, 1);
+ if ( !CLUI_HideBehindEdge()) return CLUI_SmoothAlphaTransition(pcli->hwndContactList, 0, 1);
return 0;
}
diff --git a/plugins/Clist_modern/modern_clistopts.cpp b/plugins/Clist_modern/modern_clistopts.cpp index 42dfc18cab..649ea874d6 100644 --- a/plugins/Clist_modern/modern_clistopts.cpp +++ b/plugins/Clist_modern/modern_clistopts.cpp @@ -396,7 +396,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa SendDlgItemMessage(hwndDlg, IDC_AVATAR_BORDER_COLOR, CPM_SETCOLOUR, 0, (COLORREF)db_get_dw(NULL,"CList","AvatarsBorderColor",SETTINGS_AVATARBORDERCOLOR_DEFAULT));
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_DRAW_BORDER),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),FALSE);
@@ -423,29 +423,29 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa {
EnableWindow( GetDlgItem( hwndDlg, IDC_AVATAR_FASTDRAW), FALSE );
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR),FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_AVATAR_OVERLAY_ICONS))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_AVATAR_OVERLAY_ICONS))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_NORMAL),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_PROTOCOL),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_CONTACT),FALSE);
}
- if (!ServiceExists(MS_AV_GETAVATARBITMAP) || g_CluiData.fGDIPlusFail)
+ if ( !ServiceExists(MS_AV_GETAVATARBITMAP) || g_CluiData.fGDIPlusFail)
{
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_ANIAVATARS),FALSE);
SetDlgItemText(hwndDlg, IDC_SHOW_ANIAVATARS, TranslateT("Animate Avatars (GDI+ and Avatar Service module (avs.dll) are required)"));
@@ -594,7 +594,7 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara CheckDlgButton(hwndDlg, IDC_DRAWSTATUSOVERLAY, (db_get_b(NULL,"CLC","DrawOverlayedStatus",SETTING_DRAWOVERLAYEDSTATUS_DEFAULT)&2) ? BST_CHECKED : BST_UNCHECKED );
EnableWindow(GetDlgItem(hwndDlg,IDC_DRAWSTATUSOVERLAY),IsDlgButtonChecked(hwndDlg,IDC_USEXSTATUS));
- if (!IsDlgButtonChecked(hwndDlg,IDC_HIDE_ICON_ON_AVATAR))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_HIDE_ICON_ON_AVATAR))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_DRAW_ON_AVATAR_SPACE),FALSE);
}
@@ -732,7 +732,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara //CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_RESIZE_SMILEYS), smileAddPresent ? SW_SHOW : SW_HIDE);
CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_DRAW_SMILEYS_ON_FIRST_LINE), smileAddPresent ? SW_SHOW : SW_HIDE);
- if (!IsDlgButtonChecked(hwndDlg,IDC_REPLACE_SMILEYS))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_REPLACE_SMILEYS))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),FALSE);
//EnableWindow(GetDlgItem(hwndDlg,IDC_RESIZE_SMILEYS),FALSE); //Commented out for listening to icon
@@ -807,7 +807,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv))
+ if ( !DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv))
{
SetWindowText(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), dbv.ptszVal);
db_free(&dbv);
@@ -829,7 +829,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY, db_get_b(NULL,"CList","SecondLineShowListeningIfNoAway",SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_USE_NAME_AND_MESSAGE, db_get_b(NULL,"CList","SecondLineUseNameAndMessageForXStatus",SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOW))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOW))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TOP_SPACE_SPIN),FALSE);
@@ -853,17 +853,17 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM }
else
{
- if (!IsDlgButtonChecked(hwndDlg,IDC_TEXT))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_TEXT))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLES_L),FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_STATUS) && !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_STATUS) && !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_XSTATUS_HAS_PRIORITY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_USE_NAME_AND_MESSAGE),FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_STATUS_IF_NOAWAY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_LISTENING_IF_NOAWAY),FALSE);
@@ -1004,7 +1004,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv))
+ if ( !DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv))
{
SetWindowText(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), dbv.ptszVal);
db_free(&dbv);
@@ -1026,7 +1026,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_SHOW_LISTENING_IF_NOAWAY, db_get_b(NULL,"CList","ThirdLineShowListeningIfNoAway",SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_USE_NAME_AND_MESSAGE, db_get_b(NULL,"CList","ThirdLineUseNameAndMessageForXStatus",SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOW))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_SHOW))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_TOP_SPACE_SPIN),FALSE);
@@ -1050,17 +1050,17 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM }
else
{
- if (!IsDlgButtonChecked(hwndDlg,IDC_TEXT))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_TEXT))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLES_L),FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_STATUS) && !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_STATUS) && !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_XSTATUS_HAS_PRIORITY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_USE_NAME_AND_MESSAGE),FALSE);
}
- if (!IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE))
+ if ( !IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE))
{
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_STATUS_IF_NOAWAY),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_LISTENING_IF_NOAWAY),FALSE);
@@ -1219,7 +1219,7 @@ int ReserveExtraSlot(WPARAM wParam,LPARAM lParam) iLastFree = pESINFO->iSlot;
if (iLastFree>0)
{
- if (!OrderTreeData[iLastFree].fReserved)
+ if ( !OrderTreeData[iLastFree].fReserved)
{
OrderTreeData[iLastFree].fReserved = TRUE;
OrderTreeData[iLastFree].KeyName = pESINFO->pszSlotID;
@@ -1247,7 +1247,7 @@ static int OrderEnumProc (const char *szSetting,LPARAM lParam) {
if (szSetting == NULL) return 0;
- if (!wildcmp((char*) szSetting,(char *) lParam,0)) return 0;
+ if ( !wildcmp((char*) szSetting,(char *) lParam,0)) return 0;
nArrayLen++;
settingname = (char **)realloc(settingname,nArrayLen*sizeof(char *));
settingname[nArrayLen-1] = _strdup(szSetting);
@@ -1449,7 +1449,7 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
case WM_MOUSEMOVE:
{
- if (!dragging) break;
+ if ( !dragging) break;
{
TVHITTESTINFO hti;
hti.pt.x = (short)LOWORD(lParam);
@@ -1463,7 +1463,7 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP 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))
+ if ( !(hti.flags&TVHT_ABOVE))
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hti.hItem,1);
else
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),it,0);
@@ -1479,7 +1479,7 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case WM_LBUTTONUP:
{
- if (!dragging) break;
+ if ( !dragging) break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
dragging = 0;
ReleaseCapture();
diff --git a/plugins/Clist_modern/modern_clistsettings.cpp b/plugins/Clist_modern/modern_clistsettings.cpp index af5921e15b..cfa9bc70d6 100644 --- a/plugins/Clist_modern/modern_clistsettings.cpp +++ b/plugins/Clist_modern/modern_clistsettings.cpp @@ -36,7 +36,6 @@ static int displayNameCacheSize; BOOL CLM_AUTOREBUILD_WAS_POSTED = FALSE;
SortedList *clistCache = NULL;
-TCHAR* GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown);
char *GetProtoForContact(HANDLE hContact);
int GetStatusForContact(HANDLE hContact,char *szProto);
TCHAR *UnknownConctactTranslatedName = NULL;
@@ -92,7 +91,7 @@ ClcCacheEntryBase* cliGetCacheEntry(HANDLE hContact) {
ClcCacheEntryBase* p;
int idx;
- if (!clistCache) return NULL;
+ if ( !clistCache) return NULL;
if ( !List_GetIndex( clistCache, &hContact, &idx )) {
if (( p = pcli->pfnCreateCacheItem( hContact )) != NULL ) {
List_Insert( clistCache, p, idx );
@@ -104,12 +103,6 @@ ClcCacheEntryBase* cliGetCacheEntry(HANDLE hContact) return p;
}
-static void free_and_nil_tcsName(TCHAR* &p)
-{
- if (p && p != UnknownConctactTranslatedName)
- mir_free_and_nil(p);
-}
-
void CListSettings_FreeCacheItemData(pdisplayNameCacheEntry pDst)
{
CListSettings_FreeCacheItemDataOption( pDst, CCI_ALL);
@@ -117,12 +110,11 @@ void CListSettings_FreeCacheItemData(pdisplayNameCacheEntry pDst) void CListSettings_FreeCacheItemDataOption( pdisplayNameCacheEntry pDst, DWORD flag )
{
- if (!pDst) return;
- if ( flag & CCI_NAME) {
- if (!pDst->isUnknown) free_and_nil_tcsName(pDst->m_cache_tcsName);
+ if ( !pDst)
+ return;
- mir_free_and_nil(pDst->m_cache_szName);
- }
+ if ( flag & CCI_NAME)
+ pDst->freeName();
if ( flag & CCI_GROUP )
mir_free_and_nil(pDst->m_cache_tcsGroup);
@@ -141,7 +133,7 @@ int CListSettings_SetToCache(pdisplayNameCacheEntry pSrc, DWORD flag); void CListSettings_CopyCacheItems(pdisplayNameCacheEntry pDst, pdisplayNameCacheEntry pSrc, DWORD flag)
{
- if (!pDst || !pSrc) return;
+ if ( !pDst || !pSrc) return;
CListSettings_FreeCacheItemDataOption(pDst, flag);
if ( flag & CCI_NAME ) {
@@ -150,7 +142,6 @@ void CListSettings_CopyCacheItems(pdisplayNameCacheEntry pDst, pdisplayNameCache pDst->m_cache_tcsName = pSrc->m_cache_tcsName;
else
pDst->m_cache_tcsName = mir_tstrdup(pSrc->m_cache_tcsName);
- pDst->m_cache_szName = mir_strdup(pSrc->m_cache_szName);
}
if ( flag & CCI_GROUP ) pDst->m_cache_tcsGroup = mir_tstrdup(pSrc->m_cache_tcsGroup);
@@ -188,11 +179,11 @@ void CListSettings_CopyCacheItems(pdisplayNameCacheEntry pDst, pdisplayNameCache int CListSettings_GetCopyFromCache(pdisplayNameCacheEntry pDest, DWORD flag)
{
- if (!pDest || !pDest->m_cache_hContact)
+ if ( !pDest || !pDest->m_cache_hContact)
return -1;
pdisplayNameCacheEntry pSource = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pDest->m_cache_hContact);
- if (!pSource)
+ if ( !pSource)
return -1;
CListSettings_CopyCacheItems(pDest, pSource, flag);
@@ -201,11 +192,11 @@ int CListSettings_GetCopyFromCache(pdisplayNameCacheEntry pDest, DWORD flag) int CListSettings_SetToCache(pdisplayNameCacheEntry pSrc, DWORD flag)
{
- if (!pSrc || !pSrc->m_cache_hContact)
+ if ( !pSrc || !pSrc->m_cache_hContact)
return -1;
pdisplayNameCacheEntry pDst = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pSrc->m_cache_hContact);
- if (!pDst)
+ if ( !pDst)
return -1;
CListSettings_CopyCacheItems(pDst, pSrc, flag);
@@ -216,10 +207,7 @@ void cliFreeCacheItem( pdisplayNameCacheEntry p ) {
HANDLE hContact = p->m_cache_hContact;
TRACEVAR("cliFreeCacheItem hContact = %d",hContact);
- if ( !p->isUnknown)
- free_and_nil_tcsName(p->m_cache_tcsName);
- p->m_cache_tcsName = NULL;
- mir_free_and_nil(p->m_cache_szName);
+ p->freeName();
mir_free_and_nil(p->m_cache_tcsGroup);
mir_free_and_nil(p->szSecondLineText);
mir_free_and_nil(p->szThirdLineText);
@@ -233,8 +221,8 @@ void cliCheckCacheItem(pdisplayNameCacheEntry pdnce) return;
if (pdnce->m_cache_hContact == NULL) { //selfcontact
- if (!pdnce->m_cache_tcsName) pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown);
- if (!pdnce->m_cache_szName) pdnce->m_cache_szName = mir_t2a(pdnce->m_cache_tcsName);
+ if ( !pdnce->m_cache_tcsName)
+ pdnce->getName();
return;
}
@@ -244,41 +232,17 @@ void cliCheckCacheItem(pdisplayNameCacheEntry pdnce) pdnce->m_cache_bProtoNotExists = FALSE;
else if (CallService(MS_PROTO_ISPROTOCOLLOADED,0,(LPARAM)pdnce->m_cache_cszProto) == (int)NULL && 0)
pdnce->m_cache_bProtoNotExists = TRUE;
- else if (pdnce->m_cache_cszProto && pdnce->m_cache_tcsName) {
- if (!pdnce->isUnknown)
- free_and_nil_tcsName(pdnce->m_cache_tcsName);
- pdnce->m_cache_tcsName = NULL;
- }
+ else if (pdnce->m_cache_cszProto && pdnce->m_cache_tcsName)
+ pdnce->freeName();
}
if (pdnce->m_cache_tcsName == NULL)
- {
- if (pdnce->m_cache_bProtoNotExists || !pdnce->m_cache_cszProto)
- {
- pdnce->m_cache_tcsName = UnknownConctactTranslatedName;
- pdnce->isUnknown = TRUE;
- }
- else
- {
- if (!pdnce->isUnknown)
- free_and_nil_tcsName(pdnce->m_cache_tcsName);
-
- if (g_flag_bOnModulesLoadedCalled)
- pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown); //TODO UNICODE
- else
- pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown); //TODO UNICODE
- }
- mir_free_and_nil(pdnce->m_cache_szName);
- }
- else
- {
- if (pdnce->isUnknown && pdnce->m_cache_cszProto && pdnce->m_cache_bProtoNotExists == TRUE && g_flag_bOnModulesLoadedCalled)
- {
- if (CallService(MS_PROTO_ISPROTOCOLLOADED,0,(LPARAM)pdnce->m_cache_cszProto) == (int)NULL)
- {
- pdnce->m_cache_bProtoNotExists = FALSE;
- pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown); //TODO UNICODE
- }
+ pdnce->getName();
+
+ else if (pdnce->isUnknown && pdnce->m_cache_cszProto && pdnce->m_cache_bProtoNotExists == TRUE && g_flag_bOnModulesLoadedCalled) {
+ if (CallService(MS_PROTO_ISPROTOCOLLOADED,0,(LPARAM)pdnce->m_cache_cszProto) == 0) {
+ pdnce->m_cache_bProtoNotExists = FALSE;
+ pdnce->getName();
}
}
@@ -287,7 +251,7 @@ void cliCheckCacheItem(pdisplayNameCacheEntry pdnce) if (pdnce->m_cache_tcsGroup == NULL) {
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact,"CList","Group",&dbv)) {
+ if ( !DBGetContactSettingTString(pdnce->m_cache_hContact,"CList","Group",&dbv)) {
pdnce->m_cache_tcsGroup = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -319,9 +283,6 @@ void cliCheckCacheItem(pdisplayNameCacheEntry pdnce) if (pdnce->dwLastMsgTime == 0)
pdnce->dwLastMsgTime = CompareContacts2_getLMTime(pdnce->m_cache_hContact);
}
-
- if (!pdnce->m_cache_szName)
- pdnce->m_cache_szName = mir_t2a(pdnce->m_cache_tcsName);
}
void IvalidateDisplayNameCache(DWORD mode)
@@ -340,79 +301,59 @@ void IvalidateDisplayNameCache(DWORD mode) }
}
-void InvalidateDNCEbyPointer(HANDLE hContact,pdisplayNameCacheEntry pdnce,int SettingType)
+void InvalidateDNCEbyPointer(HANDLE hContact, pdisplayNameCacheEntry pdnce, int SettingType)
{
- if (hContact == NULL) return;
- if (pdnce == NULL) return;
+ if (hContact == NULL || pdnce == NULL)
+ return;
- if (pdnce)
- {
- if (SettingType == 16)
- {
- pdnce->ssSecondLine.DestroySmileyList();
- mir_free_and_nil(pdnce->szSecondLineText);
- pdnce->ssThirdLine.DestroySmileyList();
- mir_free_and_nil(pdnce->szThirdLineText);
- pdnce->ssSecondLine.iMaxSmileyHeight = 0;
- pdnce->ssThirdLine.iMaxSmileyHeight = 0;
- pdnce->hTimeZone = NULL;
- pdnce->dwLastMsgTime = 0;//CompareContacts2_getLMTime(pdnce->hContact);
- Cache_GetTimezone(NULL,pdnce->m_cache_hContact);
- SettingType &= ~16;
- }
+ if (SettingType == 16) {
+ pdnce->ssSecondLine.DestroySmileyList();
+ mir_free_and_nil(pdnce->szSecondLineText);
+ pdnce->ssThirdLine.DestroySmileyList();
+ mir_free_and_nil(pdnce->szThirdLineText);
+ pdnce->ssSecondLine.iMaxSmileyHeight = 0;
+ pdnce->ssThirdLine.iMaxSmileyHeight = 0;
+ pdnce->hTimeZone = NULL;
+ pdnce->dwLastMsgTime = 0;
+ Cache_GetTimezone(NULL,pdnce->m_cache_hContact);
+ SettingType &= ~16;
+ }
- if (SettingType == -1 || SettingType == DBVT_DELETED)
- {
- if (!pdnce->isUnknown)
- free_and_nil_tcsName(pdnce->m_cache_tcsName);
- pdnce->m_cache_tcsName = NULL;
- mir_free_and_nil(pdnce->m_cache_tcsGroup);
- pdnce->m_cache_tcsGroup = NULL;
+ if (SettingType >= DBVT_WCHAR) {
+ pdnce->freeName();
+ mir_free_and_nil(pdnce->m_cache_tcsGroup);
+ pdnce->m_cache_cszProto = NULL;
+ return;
+ }
- pdnce->m_cache_nHidden = -1;
- pdnce->m_cache_nHiddenSubcontact = -1;
- pdnce->m_cache_bProtoNotExists = FALSE;
- pdnce->m_cache_cszProto = NULL;
- pdnce___SetStatus( pdnce , 0 );
- pdnce->IdleTS = -1;
- pdnce->ApparentMode = -1;
- pdnce->NotOnList = -1;
- pdnce->isUnknown = FALSE;
- pdnce->m_cache_nNoHiddenOffline = -1;
- pdnce->IsExpanded = -1;
- return;
- }
- if (SettingType >= DBVT_WCHAR)
- {
- if (!pdnce->isUnknown) free_and_nil_tcsName(pdnce->m_cache_tcsName);
- mir_free_and_nil(pdnce->m_cache_tcsGroup);
- pdnce->m_cache_tcsName = NULL;
- pdnce->m_cache_tcsGroup = NULL;
- pdnce->m_cache_cszProto = NULL;
- return;
- }
- // in other cases clear all binary cache
- pdnce->m_cache_nHidden = -1;
- pdnce->m_cache_nHiddenSubcontact = -1;
- pdnce->m_cache_bProtoNotExists = FALSE;
- pdnce___SetStatus( pdnce , 0 );
- pdnce->IdleTS = -1;
- pdnce->ApparentMode = -1;
- pdnce->NotOnList = -1;
- pdnce->isUnknown = FALSE;
- pdnce->m_cache_nNoHiddenOffline = -1;
- pdnce->IsExpanded = -1;
- pdnce->dwLastMsgTime = 0;//CompareContacts2_getLMTime(pdnce->hContact);
- };
-};
+ if (SettingType == -1 || SettingType == DBVT_DELETED) {
+ pdnce->freeName();
+ mir_free_and_nil(pdnce->m_cache_tcsGroup);
+ pdnce->m_cache_cszProto = NULL;
+ }
+ // in other cases clear all binary cache
+ else pdnce->dwLastMsgTime = 0;
+
+ pdnce->m_cache_nHidden = -1;
+ pdnce->m_cache_nHiddenSubcontact = -1;
+ pdnce->m_cache_bProtoNotExists = FALSE;
+ pdnce___SetStatus(pdnce, 0);
+ pdnce->IdleTS = -1;
+ pdnce->ApparentMode = -1;
+ pdnce->NotOnList = -1;
+ pdnce->isUnknown = FALSE;
+ pdnce->m_cache_nNoHiddenOffline = -1;
+ pdnce->IsExpanded = -1;
+}
char *GetContactCachedProtocol(HANDLE hContact)
{
pdisplayNameCacheEntry cacheEntry = NULL;
cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
- if (cacheEntry && cacheEntry->m_cache_cszProto) return cacheEntry->m_cache_cszProto;
+ if (cacheEntry && cacheEntry->m_cache_cszProto)
+ return cacheEntry->m_cache_cszProto;
- return (NULL);
+ return NULL;
}
char* GetProtoForContact(HANDLE hContact)
@@ -422,28 +363,39 @@ char* GetProtoForContact(HANDLE hContact) int GetStatusForContact(HANDLE hContact,char *szProto)
{
- if (szProto)
- return (int)(db_get_w((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE));
+ return (szProto) ? (int)(db_get_w((HANDLE)hContact,szProto,"Status",ID_STATUS_OFFLINE)) : ID_STATUS_OFFLINE;
+}
+
+void displayNameCacheEntry::freeName()
+{
+ if ( !isUnknown)
+ mir_free(m_cache_tcsName);
else
- return ID_STATUS_OFFLINE;
+ isUnknown = false;
+ m_cache_tcsName = NULL;
}
-TCHAR* GetNameForContact(HANDLE hContact, int flag, boolean *isUnknown)
+void displayNameCacheEntry::getName()
{
if (UnknownConctactTranslatedName == NULL)
UnknownConctactTranslatedName = TranslateT("(Unknown Contact)");
- TCHAR* result = pcli->pfnGetContactDisplayName(hContact, flag | GCDNF_NOCACHE);
- BOOL itUnknown = lstrcmp(result, UnknownConctactTranslatedName) == 0;
- if (itUnknown) {
- mir_free(result);
- result = UnknownConctactTranslatedName;
+ freeName();
+
+ if (m_cache_bProtoNotExists || !m_cache_cszProto) {
+LBL_Unknown:
+ m_cache_tcsName = UnknownConctactTranslatedName;
+ isUnknown = true;
+ return;
}
- if (isUnknown) {
- *isUnknown = itUnknown;
+
+ m_cache_tcsName = pcli->pfnGetContactDisplayName(m_cache_hContact, GCDNF_NOCACHE);
+ if ( !lstrcmp(m_cache_tcsName, UnknownConctactTranslatedName)) {
+ mir_free(m_cache_tcsName);
+ goto LBL_Unknown;
}
- return result;
+ isUnknown = false;
}
int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status)
@@ -470,7 +422,8 @@ int GetContactCachedStatus(HANDLE hContact) int ContactAdded(WPARAM wParam,LPARAM lParam)
{
if ( !MirandaExiting()) {
- cli_ChangeContactIcon((HANDLE)wParam,ExtIconFromStatusMode((HANDLE)wParam,(char*)GetContactCachedProtocol((HANDLE)wParam),ID_STATUS_OFFLINE),1); ///by FYR
+ HANDLE hContact = (HANDLE)wParam;
+ cli_ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact,(char*)GetContactCachedProtocol(hContact),ID_STATUS_OFFLINE),1); ///by FYR
pcli->pfnSortContacts();
}
return 0;
@@ -478,135 +431,101 @@ int ContactAdded(WPARAM wParam,LPARAM lParam) int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- DBVARIANT dbv = {0};
- pdisplayNameCacheEntry pdnce;
- if (MirandaExiting() || !pcli || !clistCache || (HANDLE)wParam == NULL) return 0;
-
- dbv.pszVal = NULL;
- pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry((HANDLE)wParam);
+ HANDLE hContact = (HANDLE)wParam;
+ if (MirandaExiting() || !pcli || !clistCache || hContact == NULL)
+ return 0;
- if (pdnce == NULL)
- {
+ pdisplayNameCacheEntry pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ if (pdnce == NULL) {
TRACE("!!! Very bad pdnce not found.");
return 0;
}
- if (pdnce->m_cache_bProtoNotExists == FALSE && pdnce->m_cache_cszProto)
- {
- if (!strcmp(cws->szModule,pdnce->m_cache_cszProto))
- {
- InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- if (!strcmp(cws->szSetting,"IsSubcontact"))
- {
- PostMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0);
+ if (pdnce->m_cache_bProtoNotExists || !pdnce->m_cache_cszProto)
+ return 0;
+
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+ if ( !strcmp(cws->szModule, pdnce->m_cache_cszProto)) {
+ InvalidateDNCEbyPointer(hContact, pdnce, cws->value.type);
+
+ if ( !strcmp(cws->szSetting,"IsSubcontact"))
+ PostMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0);
+
+ if ( !mir_strcmp(cws->szSetting, "Status") || wildcmp((char*)cws->szSetting, (char*) "Status?",2)) {
+ if (g_szMetaModuleName && !mir_strcmp(cws->szModule,g_szMetaModuleName) && mir_strcmp(cws->szSetting, "Status")) {
+ int res = 0;
+ if (pcli->hwndContactTree && g_flag_bOnModulesLoadedCalled)
+ res = PostAutoRebuidMessage(pcli->hwndContactTree);
+
+ if ((db_get_w(NULL,"CList","SecondLineType",SETTING_SECONDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE || db_get_w(NULL,"CList","ThirdLineType",SETTING_THIRDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE) && pdnce->m_cache_hContact && pdnce->m_cache_cszProto)
+ amRequestAwayMsg(hContact);
+
+ return 0;
}
- if (!mir_strcmp(cws->szSetting, "Status") ||
- wildcmp((char*)cws->szSetting, (char*) "Status?",2))
- {
- if (g_szMetaModuleName && !mir_strcmp(cws->szModule,g_szMetaModuleName) && mir_strcmp(cws->szSetting, "Status"))
- {
- int res = 0;
- //InvalidateDisplayNameCacheEntryByPDNE((HANDLE)wParam,pdnce,cws->value.type);
- if (pcli->hwndContactTree && g_flag_bOnModulesLoadedCalled)
- res = PostAutoRebuidMessage(pcli->hwndContactTree);
- if ((db_get_w(NULL,"CList","SecondLineType",SETTING_SECONDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE || db_get_w(NULL,"CList","ThirdLineType",SETTING_THIRDLINE_TYPE_DEFAULT) == TEXT_STATUS_MESSAGE) && pdnce->m_cache_hContact && pdnce->m_cache_cszProto)
- {
- // if (pdnce->status != ID_STATUS_OFFLINE)
- amRequestAwayMsg((HANDLE)wParam);
- }
- db_free(&dbv);
- return 0;
- }
- if (!(pdnce->m_cache_nHidden == 1))
- {
- pdnce___SetStatus( pdnce , cws->value.wVal ); //dont use direct set
- if (cws->value.wVal == ID_STATUS_OFFLINE)
- {
- if (g_CluiData.bRemoveAwayMessageForOffline)
- {
- db_set_s((HANDLE)wParam,"CList","StatusMsg","");
- }
- }
- if ((db_get_w(NULL,"CList","SecondLineType",0) == TEXT_STATUS_MESSAGE || db_get_w(NULL,"CList","ThirdLineType",0) == TEXT_STATUS_MESSAGE) && pdnce->m_cache_hContact && pdnce->m_cache_cszProto)
- {
- // if (pdnce->status != ID_STATUS_OFFLINE)
- amRequestAwayMsg((HANDLE)wParam);
- }
- pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0);
- cli_ChangeContactIcon((HANDLE)wParam, ExtIconFromStatusMode((HANDLE)wParam,cws->szModule, cws->value.wVal), 0); //by FYR
+ if (pdnce->m_cache_nHidden != 1) {
+ pdnce___SetStatus( pdnce , cws->value.wVal ); //dont use direct set
+ if (cws->value.wVal == ID_STATUS_OFFLINE)
+ if (g_CluiData.bRemoveAwayMessageForOffline)
+ db_set_s(hContact,"CList","StatusMsg","");
+
+ if ((db_get_w(NULL,"CList","SecondLineType",0) == TEXT_STATUS_MESSAGE || db_get_w(NULL,"CList","ThirdLineType",0) == TEXT_STATUS_MESSAGE) && pdnce->m_cache_hContact && pdnce->m_cache_cszProto)
+ amRequestAwayMsg(hContact);
+
+ pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0);
+ cli_ChangeContactIcon(hContact, ExtIconFromStatusMode(hContact,cws->szModule, cws->value.wVal), 0); //by FYR
+ pcli->pfnSortContacts();
+ }
+ else {
+ if ( !(!mir_strcmp(cws->szSetting, "LogonTS") || !mir_strcmp(cws->szSetting, "TickTS") || !mir_strcmp(cws->szSetting, "InfoTS")))
pcli->pfnSortContacts();
- }
- else
- {
- if (!(!mir_strcmp(cws->szSetting, "LogonTS")
- || !mir_strcmp(cws->szSetting, "TickTS")
- || !mir_strcmp(cws->szSetting, "InfoTS")
- ))
- {
- pcli->pfnSortContacts();
- }
- db_free(&dbv);
- return 0;
- }
+
+ return 0;
}
}
+ }
- if (!strcmp(cws->szModule,"CList"))
- {
- //name is null or (setting is myhandle)
- if (!strcmp(cws->szSetting,"Rate"))
- {
- pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
- }
- else if (pdnce->m_cache_tcsName == NULL || !strcmp(cws->szSetting,"MyHandle"))
- {
- InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- }
- else if (!strcmp(cws->szSetting,"Group"))
- {
- InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- }
- else if (!strcmp(cws->szSetting,"Hidden"))
- {
- InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0)
- {
- char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
- // ChangeContactIcon((HANDLE)wParam,IconFromStatusMode(szProto,szProto == NULL?ID_STATUS_OFFLINE:DBGetContactSettingWord((HANDLE)wParam,szProto,"Status",ID_STATUS_OFFLINE)),1);
- cli_ChangeContactIcon((HANDLE)wParam,ExtIconFromStatusMode((HANDLE)wParam,szProto,szProto == NULL?ID_STATUS_OFFLINE:db_get_w((HANDLE)wParam,szProto,"Status",ID_STATUS_OFFLINE)),1); //by FYR
- }
- pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
- }
- else if (!strcmp(cws->szSetting,"noOffline"))
+ if ( !strcmp(cws->szModule,"CList")) {
+ //name is null or (setting is myhandle)
+ if ( !strcmp(cws->szSetting,"Rate"))
+ pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
+
+ else if (pdnce->m_cache_tcsName == NULL || !strcmp(cws->szSetting,"MyHandle"))
+ InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type);
+
+ else if ( !strcmp(cws->szSetting,"Group"))
+ InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type);
+
+ else if ( !strcmp(cws->szSetting,"Hidden")) {
+ InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type);
+ if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0)
{
- InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
+ char *szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,wParam,0);
+ cli_ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact,szProto,szProto == NULL?ID_STATUS_OFFLINE:db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE)),1); //by FYR
}
+ pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
}
- else if (!strcmp(cws->szModule,"Protocol"))
- {
- if (!strcmp(cws->szSetting,"p"))
- {
- char *szProto;
- InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- if (cws->value.type == DBVT_DELETED) szProto = NULL;
- else szProto = cws->value.pszVal;
- cli_ChangeContactIcon((HANDLE)wParam,ExtIconFromStatusMode((HANDLE)wParam,szProto,szProto == NULL?ID_STATUS_OFFLINE:db_get_w((HANDLE)wParam,szProto,"Status",ID_STATUS_OFFLINE)),0); //by FYR
- }
+ else if ( !strcmp(cws->szSetting,"noOffline")) {
+ InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type);
+ pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
}
-
- // Clean up
- db_free(&dbv);
- }
+ }
+ else if ( !strcmp(cws->szModule,"Protocol")) {
+ if ( !strcmp(cws->szSetting,"p")) {
+ char *szProto;
+ InvalidateDNCEbyPointer(hContact,pdnce,cws->value.type);
+ if (cws->value.type == DBVT_DELETED) szProto = NULL;
+ else szProto = cws->value.pszVal;
+ cli_ChangeContactIcon(hContact,ExtIconFromStatusMode(hContact,szProto,szProto == NULL?ID_STATUS_OFFLINE:db_get_w(hContact,szProto,"Status",ID_STATUS_OFFLINE)),0); //by FYR
+ }
+ }
return 0;
}
int PostAutoRebuidMessage(HWND hwnd)
{
- if (!CLM_AUTOREBUILD_WAS_POSTED)
+ if ( !CLM_AUTOREBUILD_WAS_POSTED)
CLM_AUTOREBUILD_WAS_POSTED = PostMessage(hwnd,CLM_AUTOREBUILD,0,0);
return CLM_AUTOREBUILD_WAS_POSTED;
}
diff --git a/plugins/Clist_modern/modern_clisttray.cpp b/plugins/Clist_modern/modern_clisttray.cpp index 741294f878..28963f200d 100644 --- a/plugins/Clist_modern/modern_clisttray.cpp +++ b/plugins/Clist_modern/modern_clisttray.cpp @@ -99,7 +99,7 @@ INT_PTR CListTray_GetGlobalStatus(WPARAM wparam,LPARAM lparam) int connectingCount = 0;
for (i=0;i < pcli->hClcProtoCount;i++)
{
- if (!pcli->pfnGetProtocolVisibility(pcli->clcProto[i].szProto)) continue;
+ if ( !pcli->pfnGetProtocolVisibility(pcli->clcProto[i].szProto)) continue;
if (pcli->clcProto[i].dwStatus >= ID_STATUS_CONNECTING &&
pcli->clcProto[i].dwStatus < ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
@@ -162,9 +162,9 @@ void cliTrayIconUpdateBase(const char *szChangedProto) int averageMode = 0;
HWND hwnd = pcli->hwndContactList;
- if (!szChangedProto) return;
+ if ( !szChangedProto) return;
- if (!pcli->pfnGetProtocolVisibility(szChangedProto)) return;
+ if ( !pcli->pfnGetProtocolVisibility(szChangedProto)) return;
pcli->pfnLockTray();
if ( pcli->cycleTimerId ) {
@@ -175,7 +175,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) for (i=0,netProtoCount = 0;i < count;i++) {
if ( pcli->pfnGetProtocolVisibility(accs[i]->szModuleName) == 0 ) continue;
netProtoCount++;
- if (!lstrcmpA(szChangedProto,accs[i]->szModuleName)) pcli->cycleStep = i;
+ if ( !lstrcmpA(szChangedProto,accs[i]->szModuleName)) pcli->cycleStep = i;
if (averageMode == 0) averageMode = CallProtoService(accs[i]->szModuleName,PS_GETSTATUS,0,0);
else if (averageMode != CallProtoService(accs[i]->szModuleName,PS_GETSTATUS,0,0)) {averageMode = -1; break;}
}
@@ -280,7 +280,7 @@ void cliTrayIconUpdateBase(const char *szChangedProto) break;
case SETTING_TRAYICON_MULTI:
- if (!pcli->trayIcon)
+ if ( !pcli->trayIcon)
pcli->pfnTrayIconRemove(NULL,NULL);
else if ( db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT )) {
if (pcli->pfnGetProtocolVisibility(szChangedProto))
@@ -579,7 +579,7 @@ INT_PTR TrayMenuExecService(WPARAM wParam,LPARAM lParam) { if (wParam != 0)
{
lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)wParam;
- if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
+ if ( !mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
diff --git a/plugins/Clist_modern/modern_clui.cpp b/plugins/Clist_modern/modern_clui.cpp index f1b1b9416f..4aeaa2f3af 100644 --- a/plugins/Clist_modern/modern_clui.cpp +++ b/plugins/Clist_modern/modern_clui.cpp @@ -115,12 +115,12 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) GetClassName(hwndClist,cls,SIZEOF(cls));
hwndClist = (!lstrcmp(CLISTCONTROL_CLASS,cls))?hwndClist:pcli->hwndContactList;
hItem = (HANDLE)SendMessage(hwndClist,CLM_GETSELECTION,0,0);
- if (!hItem) {
+ if ( !hItem) {
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
}
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hRenameMenuItem, (LPARAM)&mi);
- if (!hItem || !IsHContactContact(hItem) || !db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT))
+ if ( !hItem || !IsHContactContact(hItem) || !db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT))
{
mi.flags = CMIM_FLAGS | CMIF_HIDDEN;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hShowAvatarMenuItem, (LPARAM)&mi);
@@ -250,9 +250,9 @@ HRESULT CLUI::CreateCluiFrames() CreateUIFrames();
- ModernHookEvent(ME_SYSTEM_MODULESLOADED,CLUI::OnEvent_ModulesLoaded);
- ModernHookEvent(ME_SKIN2_ICONSCHANGED,CLUI_IconsChanged);
- ModernHookEvent(ME_FONT_RELOAD, CLUI::OnEvent_FontReload);
+ HookEvent(ME_SYSTEM_MODULESLOADED,CLUI::OnEvent_ModulesLoaded);
+ HookEvent(ME_SKIN2_ICONSCHANGED,CLUI_IconsChanged);
+ HookEvent(ME_FONT_RELOAD, CLUI::OnEvent_FontReload);
return S_OK;
}
CLUI::CLUI() :
@@ -345,7 +345,7 @@ HRESULT CLUI::RegisterAvatarMenu() hHideAvatarMenuItem = Menu_AddContactMenuItem(&mi);
DestroyIcon_protect(mi.hIcon);
- ModernHookEvent(ME_CLIST_PREBUILDCONTACTMENU, CLUI::OnEvent_ContactMenuPreBuild);
+ HookEvent(ME_CLIST_PREBUILDCONTACTMENU, CLUI::OnEvent_ContactMenuPreBuild);
return S_OK;
}
@@ -447,8 +447,7 @@ HRESULT CLUI::CreateCLC() nLastRequiredHeight = 0;
mutex_bDisableAutoUpdate = 0;
- hSettingChangedHook = ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED,CLUI::OnEvent_DBSettingChanging);
-
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED,CLUI::OnEvent_DBSettingChanging);
return S_OK;
};
@@ -488,7 +487,6 @@ HRESULT CLUI::SnappingToEdge( WINDOWPOS * lpWindowPos ) return S_OK;
}
-
HICON GetMainStatusOverlay(int STATUS)
{
return ImageList_GetIcon(hAvatarOverlays,g_pStatusOverlayIcons[STATUS-ID_STATUS_OFFLINE].listID,ILD_NORMAL);
@@ -496,9 +494,7 @@ HICON GetMainStatusOverlay(int STATUS) void UnloadAvatarOverlayIcon()
{
- int i;
- for (i=0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
- {
+ for (int i=0 ; i < MAX_REGS(g_pAvatarOverlayIcons); i++) {
g_pAvatarOverlayIcons[i].listID = -1;
g_pStatusOverlayIcons[i].listID = -1;
}
@@ -508,18 +504,17 @@ void UnloadAvatarOverlayIcon() g_hListeningToIcon = NULL;
}
-
BOOL CLUI_CheckOwnedByClui(HWND hWnd)
{
HWND hWndMid, hWndClui;
- if (!hWnd) return FALSE;
+ if ( !hWnd) return FALSE;
hWndClui = pcli->hwndContactList;
hWndMid = fnGetAncestor(hWnd,GA_ROOTOWNER);
if (hWndMid == hWndClui) return TRUE;
{
TCHAR buf[255];
GetClassName(hWndMid,buf,254);
- if (!mir_tstrcmpi(buf,CLUIFrameSubContainerClassName)) return TRUE;
+ if ( !mir_tstrcmpi(buf,CLUIFrameSubContainerClassName)) return TRUE;
}
return FALSE;
}
@@ -664,7 +659,7 @@ void CLUI_ChangeWindowMode() LONG styleMask = WS_CLIPCHILDREN|WS_BORDER|WS_CAPTION|WS_MINIMIZEBOX|WS_POPUPWINDOW|WS_CLIPCHILDREN|WS_THICKFRAME|WS_SYSMENU;
LONG styleMaskEx = WS_EX_TOOLWINDOW|WS_EX_LAYERED;
LONG curStyle,curStyleEx;
- if (!pcli->hwndContactList) return;
+ if ( !pcli->hwndContactList) return;
g_mutex_bChangingMode = TRUE;
g_bTransparentFlag = IsWinVer2000Plus() && db_get_b( NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT);
@@ -672,7 +667,7 @@ void CLUI_ChangeWindowMode() if (g_bTransparentFlag == 0 && g_CluiData.bCurrentAlpha != 0)
g_CluiData.bCurrentAlpha = 255;
//2- Calculate STYLES and STYLESEX
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
style = 0;
styleEx = 0;
@@ -798,7 +793,7 @@ void CLUI_ChangeWindowMode() CLUIFrames_UpdateBorders();
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
HRGN hRgn1;
RECT r;
@@ -1049,7 +1044,7 @@ static HICON CLUI_ExtractIconFromPath(const char *path, BOOL * needFree) return hIcon;
}
-HICON CLUI_LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean registerit,char *IconName,char *SectName,char *Description,int internalidx, BOOL * needFree)
+HICON CLUI_LoadIconFromExternalFile(char *filename,int i,BOOL UseLibrary,bool registerit,char *IconName,char *SectName,char *Description,int internalidx, BOOL * needFree)
{
char szPath[MAX_PATH],szMyPath[MAX_PATH], szFullPath[MAX_PATH],*str;
HICON hIcon = NULL;
@@ -1071,7 +1066,7 @@ HICON CLUI_LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,bool if (hi) has_proto_icon = TRUE;
if (hi && nf) DestroyIcon(hi);
}
- if (!UseLibrary) {
+ if ( !UseLibrary) {
hIcon = CLUI_ExtractIconFromPath(szFullPath,needFree);
if (hIcon) return hIcon;
if (UseLibrary)
@@ -1146,7 +1141,7 @@ INT_PTR CLUI_GetConnectingIconService(WPARAM wParam,LPARAM lParam) HICON hIcon = NULL;
char *szProto = (char *)wParam;
- if (!szProto) return 0;
+ if ( !szProto) return 0;
pt = CLUI_GetProtoTicksByProto(szProto);
@@ -1184,8 +1179,8 @@ static int CLUI_CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam) int status = (int)wParam;
char *szProto = (char *)lParam;
- if (!szProto) return (0);
- if (!status) return (0);
+ if ( !szProto) return (0);
+ if ( !status) return (0);
if ((g_StatusBarData.connectingIcon == 1) && status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
@@ -1296,13 +1291,13 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) return 1;
dat = (struct ClcData*)GetWindowLongPtr(pcli->hwndContactTree,0);
- if (!dat) return 1;
+ if ( !dat) return 1;
GetWindowRect(hwnd,&ra);
{
MENUBARINFO mbi = {0};
mbi.cbSize = sizeof(MENUBARINFO);
fnGetMenuBarInfo(hwnd,OBJID_MENU, 0, &mbi);
- if (!(mbi.rcBar.right-mbi.rcBar.left>0 && mbi.rcBar.bottom-mbi.rcBar.top>0)) return 1;
+ if ( !(mbi.rcBar.right-mbi.rcBar.left>0 && mbi.rcBar.bottom-mbi.rcBar.top>0)) return 1;
r1 = mbi.rcBar;
r1.bottom += !db_get_b(NULL,"CLUI","LineUnderMenu",SETTING_LINEUNDERMENU_DEFAULT);
if (item < 1)
@@ -1344,7 +1339,7 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) ske_SetRectOpaque(hdc,&r1);
//ske_BltBackImage(hwnd,hdc,&r1);
}
- if (!g_CluiData.fDisableSkinEngine)
+ if ( !g_CluiData.fDisableSkinEngine)
SkinDrawGlyph(hdc,&r1,&r1,"Main,ID = MenuBar");
else
{
@@ -1534,7 +1529,7 @@ int CLUI_TestCursorOnBorders() if (CLUI_CheckOwnedByClui(hAux))
{
if (g_bTransparentFlag) {
- if (!bTransparentFocus && gf != hwnd) {
+ if ( !bTransparentFocus && gf != hwnd) {
CLUI_SmoothAlphaTransition(hwnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
//g_proc_SetLayeredWindowAttributes(hwnd, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), LWA_ALPHA);
bTransparentFocus = 1;
@@ -1577,7 +1572,7 @@ int CLUI_TestCursorOnBorders() else if (pt.y >= r.top && pt.y <= r.top+SIZING_MARGIN && !g_CluiData.fAutoSize) k = 3;
if (pt.x <= r.right && pt.x >= r.right-SIZING_MARGIN && g_CluiData.bBehindEdgeSettings != 2) k += 2;
else if (pt.x >= r.left && pt.x <= r.left+SIZING_MARGIN && g_CluiData.bBehindEdgeSettings != 1) k += 1;
- if (!(pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)) k = 0;
+ if ( !(pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)) k = 0;
k *= mouse_in_window;
hCurs1 = LoadCursor(NULL, IDC_ARROW);
if (g_CluiData.nBehindEdgeState <= 0 && (!(db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT))))
@@ -1585,13 +1580,13 @@ int CLUI_TestCursorOnBorders() {
case 1:
case 2:
- if (!g_CluiData.fDocked || (g_CluiData.fDocked == 2 && k == 1) || (g_CluiData.fDocked == 1 && k == 2)){hCurs1 = LoadCursor(NULL, IDC_SIZEWE); break;}
- case 3: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;}
- case 4: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;}
- case 5: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;}
- case 6: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;}
- case 7: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;}
- case 8: if (!g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;}
+ if ( !g_CluiData.fDocked || (g_CluiData.fDocked == 2 && k == 1) || (g_CluiData.fDocked == 1 && k == 2)){hCurs1 = LoadCursor(NULL, IDC_SIZEWE); break;}
+ case 3: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;}
+ case 4: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;}
+ case 5: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;}
+ case 6: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENS); break;}
+ case 7: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENESW); break;}
+ case 8: if ( !g_CluiData.fDocked) {hCurs1 = LoadCursor(NULL, IDC_SIZENWSE); break;}
}
if (hCurs1) SetCursor(hCurs1);
return k;
@@ -1602,7 +1597,7 @@ int CLUI_TestCursorOnBorders() int CLUI_SizingOnBorder(POINT pt, int PerformSize)
{
- if (!(db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT)))
+ if ( !(db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT)))
{
RECT r;
HWND hwnd = pcli->hwndContactList;
@@ -1631,7 +1626,7 @@ int CLUI_SizingOnBorder(POINT pt, int PerformSize) if ( pt.x <= r.right && pt.x >= r.right - SIZING_MARGIN ) sizeOnBorderFlag += SCF_RIGHT;
else if ( pt.x >= r.left && pt.x <= r.left + SIZING_MARGIN ) sizeOnBorderFlag += SCF_LEFT;
- if (!(pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)) sizeOnBorderFlag = SCF_NONE;
+ if ( !(pt.x >= r.left && pt.x <= r.right && pt.y >= r.top && pt.y <= r.bottom)) sizeOnBorderFlag = SCF_NONE;
if (sizeOnBorderFlag && PerformSize)
{
@@ -1647,16 +1642,16 @@ int CLUI_SyncSmoothAnimation(WPARAM wParam, LPARAM lParam); static void CLUI_SmoothAnimationThreadProc(HWND hwnd)
{
// return;
- if (!mutex_bAnimationInProgress)
+ if ( !mutex_bAnimationInProgress)
{
g_dwSmoothAnimationThreadID = 0;
return; /// Should be some locked to avoid painting against contact deletion.
}
do
{
- if (!g_mutex_bLockUpdating)
+ if ( !g_mutex_bLockUpdating)
{
- if (!MirandaExiting())
+ if ( !MirandaExiting())
Sync(CLUI_SyncSmoothAnimation, (WPARAM)0, (LPARAM)hwnd );
SleepEx(20,TRUE);
if (MirandaExiting())
@@ -1692,7 +1687,7 @@ static int CLUI_SmoothAlphaThreadTransition(HWND hwnd) Sync(CLUIFrames_OnShowHide, hwnd,0);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = 0;
- if (!g_CluiData.fLayered) RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_ERASE|RDW_FRAME);
+ if ( !g_CluiData.fLayered) RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_ERASE|RDW_FRAME);
return 0;
}
}
@@ -1709,7 +1704,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) {
if (GoalAlpha>0 && wParam != 2)
{
- if (!IsWindowVisible(hwnd))
+ if ( !IsWindowVisible(hwnd))
{
mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList,SW_RESTORE);
@@ -1747,7 +1742,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) if (wParam != 2) //not from timer
{
bAlphaEnd = GoalAlpha;
- if (!mutex_bAnimationInProgress)
+ if ( !mutex_bAnimationInProgress)
{
if ((!IsWindowVisible(hwnd) || g_CluiData.bCurrentAlpha == 0) && bAlphaEnd>0 )
{
@@ -1847,7 +1842,7 @@ HANDLE RegisterIcolibIconHandle(char * szIcoID, char *szSectionName, char * szD if (tszDefaultFile)
{
CallService( MS_UTILS_PATHTOABSOLUTET, ( WPARAM )tszDefaultFile, ( LPARAM )fileFull );
- if (!FileExists(fileFull)) fileFull[0] = _T('\0');
+ if ( !FileExists(fileFull)) fileFull[0] = _T('\0');
}
if (fileFull[0] != _T('\0'))
{
@@ -1954,7 +1949,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) if ((rcOldWindowRect.bottom-rcOldWindowRect.top != wp->cy || rcOldWindowRect.right-rcOldWindowRect.left != wp->cx) && !(wp->flags&SWP_NOSIZE))
{
{
- if (!(wp->flags&SWP_NOMOVE))
+ if ( !(wp->flags&SWP_NOMOVE))
{
rcNewWindowRect.left = wp->x;
rcNewWindowRect.top = wp->y;
@@ -2043,8 +2038,8 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) GetWindowRect(m_hWnd, &rc);
CheckFramesPos(&rc);
Sync(CLUIFrames_OnMoving,m_hWnd,&rc);
- if (!IsIconic(m_hWnd)) {
- if (!CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
+ if ( !IsIconic(m_hWnd)) {
+ if ( !CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
{ //if g_CluiData.fDocked, dont remember pos (except for width)
db_set_dw(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top));
db_set_dw(NULL,"CList","x",(DWORD)rc.left);
@@ -2063,7 +2058,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) if ( pcli->hwndContactList == NULL )
return 0;
- if (!g_CluiData.fLayered && !g_CluiData.fDisableSkinEngine)
+ if ( !g_CluiData.fLayered && !g_CluiData.fDisableSkinEngine)
ske_ReCreateBackImage(TRUE,NULL);
GetWindowRect(m_hWnd, &rc);
@@ -2073,7 +2068,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) if (g_CluiData.fLayered)
CallService(MS_SKINENG_UPTATEFRAMEIMAGE,(WPARAM)m_hWnd,0);
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
g_mutex_bSizing = 1;
Sync(CLUIFrames_OnClistResize_mod,(WPARAM)m_hWnd,(LPARAM)1);
@@ -2084,7 +2079,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) }
// ske_RedrawCompleteWindow();
- if (!CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
+ if ( !CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
{ //if g_CluiData.fDocked, dont remember pos (except for width)
db_set_dw(NULL,"CList","Height",(DWORD)(rc.bottom - rc.top));
db_set_dw(NULL,"CList","x",(DWORD)rc.left);
@@ -2093,7 +2088,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) else SetWindowRgn(m_hWnd,NULL,0);
db_set_dw(NULL,"CList","Width",(DWORD)(rc.right - rc.left));
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
HRGN hRgn1;
RECT r;
@@ -2197,7 +2192,7 @@ LRESULT CLUI::OnNcCreate( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnPaint( UINT msg, WPARAM wParam, LPARAM lParam )
{
- if (!g_CluiData.fLayered && IsWindowVisible(m_hWnd))
+ if ( !g_CluiData.fLayered && IsWindowVisible(m_hWnd))
{
RECT w = {0};
RECT w2 = {0};
@@ -2207,9 +2202,9 @@ LRESULT CLUI::OnPaint( UINT msg, WPARAM wParam, LPARAM lParam ) HDC paintDC;
GetClientRect(m_hWnd,&w);
- if (!(w.right>0 && w.bottom>0)) return DefWindowProc(m_hWnd, msg, wParam, lParam);
+ if ( !(w.right>0 && w.bottom>0)) return DefWindowProc(m_hWnd, msg, wParam, lParam);
- if (!g_CluiData.fDisableSkinEngine)
+ if ( !g_CluiData.fDisableSkinEngine)
{
paintDC = GetDC(m_hWnd);
w2 = w;
@@ -2368,7 +2363,7 @@ LRESULT CLUI::OnStatusBarUpdateTimer( UINT msg, WPARAM wParam, LPARAM lParam ) else
status = CallProtoService(pt->szProto,PS_GETSTATUS,0,0);
- if (!(status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES))
+ if ( !(status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES))
{
pt->nCycleStartTick = 0;
ImageList_Destroy(pt->himlIconList);
@@ -2413,7 +2408,7 @@ LRESULT CLUI::OnAutoAlphaTimer( UINT msg, WPARAM wParam, LPARAM lParam ) inwnd = FALSE;
inwnd = CLUI_CheckOwnedByClui(hwndPt);
- if (! inwnd )
+ if ( ! inwnd )
inwnd = ( GetCapture() == pcli->hwndContactList );
}
@@ -2428,7 +2423,7 @@ LRESULT CLUI::OnAutoAlphaTimer( UINT msg, WPARAM wParam, LPARAM lParam ) CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)(g_bTransparentFlag?db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT):255), 1);
}
}
- if (!bTransparentFocus) KillTimer(m_hWnd,TM_AUTOALPHA);
+ if ( !bTransparentFocus) KillTimer(m_hWnd,TM_AUTOALPHA);
return TRUE;
}
LRESULT CLUI::OnSmoothAlphaTransitionTimer( UINT msg, WPARAM wParam, LPARAM lParam )
@@ -2516,15 +2511,15 @@ LRESULT CLUI::OnActivate( UINT msg, WPARAM wParam, LPARAM lParam ) {
if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && GetParent((HWND)lParam) != m_hWnd && !IsOption)
{
- if (!g_bCalledFromShowHide) CLUI_UpdateTimer(0);
+ if ( !g_bCalledFromShowHide) CLUI_UpdateTimer(0);
}
- else if (!g_bCalledFromShowHide )
+ else if ( !g_bCalledFromShowHide )
{
CLUI_ShowFromBehindEdge();
}
}
- if (!IsWindowVisible(m_hWnd) || mutex_bShowHideCalledFromAnimation)
+ if ( !IsWindowVisible(m_hWnd) || mutex_bShowHideCalledFromAnimation)
{
KillTimer(m_hWnd,TM_AUTOALPHA);
return 0;
@@ -2537,7 +2532,7 @@ LRESULT CLUI::OnActivate( UINT msg, WPARAM wParam, LPARAM lParam ) }
else {
- if (!db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT))
+ if ( !db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT))
Sync(CLUIFrames_ActivateSubContainers,TRUE);
if (g_bTransparentFlag) {
KillTimer(m_hWnd,TM_AUTOALPHA);
@@ -2564,7 +2559,7 @@ LRESULT CLUI::OnSetCursor( UINT msg, WPARAM wParam, LPARAM lParam ) HWND gf = GetForegroundWindow();
if (g_CluiData.nBehindEdgeState >= 0) CLUI_UpdateTimer(1);
if (g_bTransparentFlag) {
- if (!bTransparentFocus && gf != m_hWnd)
+ if ( !bTransparentFocus && gf != m_hWnd)
{
CLUI_SmoothAlphaTransition(m_hWnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
bTransparentFocus = 1;
@@ -2642,7 +2637,7 @@ LRESULT CLUI::OnNcHitTest( UINT msg, WPARAM wParam, LPARAM lParam ) pt.x = (short)LOWORD(lParam);
pt.y = (short)HIWORD(lParam);
k = CLUI_SizingOnBorder(pt,0);
- if (!k && (db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)))
+ if ( !k && (db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)))
return HTCAPTION;
else return k+9;
}
@@ -2657,7 +2652,7 @@ LRESULT CLUI::OnShowWindow( UINT msg, WPARAM wParam, LPARAM lParam ) if (mutex_bShowHideCalledFromAnimation) return 1;
{
- if (!wParam) gAlpha = 0;
+ if ( !wParam) gAlpha = 0;
else
gAlpha = (db_get_b(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT):255);
if (wParam)
@@ -2808,7 +2803,7 @@ LRESULT CLUI::OnListSizeChangeNotify( NMCLISTCONTROL * pnmc ) {
bNeedFixSizingRect = 0;
}
- if (!mutex_bDuringSizing)
+ if ( !mutex_bDuringSizing)
SetWindowPos(m_hWnd,0,rcWindow.left,rcWindow.top,rcWindow.right-rcWindow.left,rcWindow.bottom-rcWindow.top,SWP_NOZORDER|SWP_NOACTIVATE);
else
{
@@ -2826,7 +2821,7 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) if (hitFlags&CLCHT_ONITEMEXTRA)
{
- if (!IsHContactGroup(hItem) && !IsHContactInfo(hItem))
+ if ( !IsHContactGroup(hItem) && !IsHContactInfo(hItem))
{
pdisplayNameCacheEntry pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pnmc->hItem);
if (pdnce == NULL) return 0;
@@ -2834,7 +2829,7 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) int extra = ExtraImage_ColumnNumToExtraID(pnmc->iColumn);
NotifyEventHooks(g_CluiData.hEventExtraClick, (WPARAM)pnmc->hItem, extra);
- if (!ServiceExists("ExtraIcon/Register"))
+ if ( !ServiceExists("ExtraIcon/Register"))
{
int v,e,w;
v = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO);
@@ -2847,7 +2842,7 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) if (pnmc->iColumn == e)
{
char *email = db_get_sa(pnmc->hItem,"UserInfo", "Mye-mail0");
- if (!email)
+ if ( !email)
email = db_get_sa(pnmc->hItem, pdnce->m_cache_cszProto, "e-mail");
if (email) {
char buf[4096];
@@ -2858,7 +2853,7 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) };
if (pnmc->iColumn == w) {
char *homepage = db_get_sa(pdnce->m_cache_hContact,"UserInfo", "Homepage");
- if (!homepage)
+ if ( !homepage)
homepage = db_get_sa(pdnce->m_cache_hContact,pdnce->m_cache_cszProto, "Homepage");
if (homepage != NULL)
{
@@ -2918,7 +2913,7 @@ LRESULT CLUI::OnContextMenu( UINT msg, WPARAM wParam, LPARAM lParam ) // all this is done in screen-coords!
GetCursorPos(&pt);
// the mouse isnt near the window, so put it in the middle of the window
- if (!PtInRect(&rc,pt)) {
+ if ( !PtInRect(&rc,pt)) {
pt.x = rc.left + (rc.right - rc.left) / 2;
pt.y = rc.top + (rc.bottom - rc.top) / 2;
}
@@ -2963,11 +2958,11 @@ LRESULT CLUI::OnDrawItem( UINT msg, WPARAM wParam, LPARAM lParam ) {
struct ClcData * dat = (struct ClcData*)GetWindowLongPtr(pcli->hwndContactTree,0);
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
- if (!dat) return 0;
+ if ( !dat) return 0;
if (dis->CtlType == ODT_MENU) {
if (dis->itemData == MENU_MIRANDAMENU) {
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
char buf[255];
short offset = 1 + ( dis->itemState&ODS_SELECTED ? 1 : 0 )
@@ -2994,7 +2989,7 @@ LRESULT CLUI::OnDrawItem( UINT msg, WPARAM wParam, LPARAM lParam ) return TRUE;
}
else if (dis->itemData == MENU_STATUSMENU) {
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
char buf[255] = {0};
RECT rc = dis->rcItem;
@@ -3063,20 +3058,19 @@ LRESULT CLUI::OnDestroy( UINT msg, WPARAM wParam, LPARAM lParam ) TRACE("CLUI.c: WM_DESTROY - WaitThreadsCompletion \n");
while (CLUI_WaitThreadsCompletion(m_hWnd)); //stop all my threads
TRACE("CLUI.c: WM_DESTROY - WaitThreadsCompletion DONE\n");
- {
- for (int i=0; i < 64; i++)
- if (CycleStartTick[i].szProto)
- mir_free_and_nil(CycleStartTick[i].szProto);
- }
- if (state == SETTING_STATE_NORMAL){CLUI_ShowWindowMod(m_hWnd,SW_HIDE);};
+ for (int i=0; i < 64; i++)
+ if (CycleStartTick[i].szProto)
+ mir_free_and_nil(CycleStartTick[i].szProto);
+
+ if (state == SETTING_STATE_NORMAL)
+ CLUI_ShowWindowMod(m_hWnd,SW_HIDE);
UnLoadContactListModule();
- if (hSettingChangedHook != 0) ModernUnhookEvent(hSettingChangedHook);
ClcUnloadModule();
- RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
- RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
- DestroyMenu(g_hMenuMain);
+ RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
+ DestroyMenu(g_hMenuMain);
pcli->pfnTrayIconDestroy(m_hWnd);
mutex_bAnimationInProgress = 0;
diff --git a/plugins/Clist_modern/modern_cluiframes.cpp b/plugins/Clist_modern/modern_cluiframes.cpp index 782ffcff16..2df4d35889 100644 --- a/plugins/Clist_modern/modern_cluiframes.cpp +++ b/plugins/Clist_modern/modern_cluiframes.cpp @@ -100,7 +100,7 @@ static int backgroundBmpUse; static COLORREF bkColour;
static COLORREF SelBkColour;
static BOOL bkUseWinColours;
-boolean AlignCOLLIconToLeft; //will hide frame icon
+BYTE AlignCOLLIconToLeft; //will hide frame icon
COLORREF sttGetColor(char * module, char * color, COLORREF defColor);
//for old multiwindow
#define MPCF_CONTEXTFRAMEMENU 3
@@ -123,7 +123,7 @@ int CLUIFrames_OnMoving( HWND hwnd, RECT * r) g_CluiData.mutexPreventDockMoving = 0;
for (i=0;i < g_nFramesCount;i++) {
- if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2)
+ if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2)
{
int x;
int y;
@@ -153,14 +153,14 @@ int SetAlpha(BYTE Alpha) for (i=0;i < g_nFramesCount;i++) {
- if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
+ if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
{
HWND hwnd = g_pfwFrames[i].OwnerWindow;
if (g_proc_SetLayeredWindowAttributesNew)
{
long l;
l = GetWindowLongPtr(hwnd,GWL_EXSTYLE);
- if (!(l&WS_EX_LAYERED))
+ if ( !(l&WS_EX_LAYERED))
{
HWND parent = NULL;
if (g_CluiData.fOnDesktop)
@@ -189,7 +189,7 @@ int CLUIFrames_RepaintSubContainers() {
int i;
for (i=0;i < g_nFramesCount;i++)
- if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
+ if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
{
RedrawWindow(g_pfwFrames[i].hWnd,NULL,NULL,RDW_ALLCHILDREN|RDW_UPDATENOW|RDW_INVALIDATE|RDW_FRAME);
};
@@ -221,7 +221,7 @@ int CLUIFrames_SetParentForContainers( HWND parent ) else
g_CluiData.fOnDesktop = 0;
for (i=0;i < g_nFramesCount;i++) {
- if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
+ if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
{
HWND hwnd = g_pfwFrames[i].OwnerWindow;
SetParent(hwnd,parent);
@@ -235,7 +235,7 @@ int CLUIFrames_OnShowHide( HWND hwnd, int mode ) int i;
int prevFrameCount;
for (i=0;i < g_nFramesCount;i++) {
- if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2)
+ if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != (HWND)0 && g_pfwFrames[i].OwnerWindow != (HWND)-2)
{
{
//Try to avoid crash on exit due to unlock.
@@ -308,7 +308,7 @@ int QueueAllFramesUpdating(BYTE queue) int i;
for (i=0;i < g_nFramesCount;i++)
{
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
if (queue)
InvalidateRect(g_pfwFrames[i].hWnd,NULL,FALSE);
@@ -684,7 +684,7 @@ static int DBLoadFrameSettingsAtPos(int pos,int Frameid) _itoa(pos,sadd,10);
//DBWriteContactSettingString(0,CLUIFrameModule,strcat("Name",sadd),Frames[Frameid].name);
- //boolean
+ //bool
g_pfwFrames[Frameid].collapsed = db_get_b(0,CLUIFrameModule,AS(buf,"Collapse",sadd),g_pfwFrames[Frameid].collapsed);
g_pfwFrames[Frameid].Locked = db_get_b(0,CLUIFrameModule,AS(buf,"Locked",sadd),g_pfwFrames[Frameid].Locked);
@@ -716,7 +716,7 @@ static int DBStoreFrameSettingsAtPos(int pos,int Frameid) _itoa(pos,sadd,10);
db_set_ws(0,CLUIFrameModule,AS(buf,"Name",sadd),g_pfwFrames[Frameid].Name);
- //boolean
+ //bool
db_set_b(0,CLUIFrameModule,AS(buf,"Collapse",sadd),(BYTE)btoint(g_pfwFrames[Frameid].collapsed));
db_set_b(0,CLUIFrameModule,AS(buf,"Locked",sadd),(BYTE)btoint(g_pfwFrames[Frameid].Locked));
db_set_b(0,CLUIFrameModule,AS(buf,"Visible",sadd),(BYTE)btoint(g_pfwFrames[Frameid].visible));
@@ -1159,16 +1159,16 @@ static INT_PTR _us_DoGetFrameOptions(WPARAM wParam,LPARAM lParam) case FO_FLAGS:
retval = 0;
if (g_pfwFrames[pos].visible) retval |= F_VISIBLE;
- if (!g_pfwFrames[pos].collapsed) retval |= F_UNCOLLAPSED;
+ if ( !g_pfwFrames[pos].collapsed) retval |= F_UNCOLLAPSED;
if (g_pfwFrames[pos].Locked) retval |= F_LOCKED;
if (g_pfwFrames[pos].TitleBar.ShowTitleBar) retval |= F_SHOWTB;
if (g_pfwFrames[pos].TitleBar.ShowTitleBarTip) retval |= F_SHOWTBTIP;
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
- if (!(GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval |= F_NOBORDER;
+ if ( !(GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval |= F_NOBORDER;
}
else
- if (!g_pfwFrames[pos].UseBorder) retval |= F_NOBORDER;
+ if ( !g_pfwFrames[pos].UseBorder) retval |= F_NOBORDER;
break;
@@ -1371,7 +1371,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) int oldHeight = g_pfwFrames[pos].height;
retval = g_pfwFrames[pos].height;
g_pfwFrames[pos].height = lParam;
- if (!CLUIFramesFitInSize()) g_pfwFrames[pos].height = retval;
+ if ( !CLUIFramesFitInSize()) g_pfwFrames[pos].height = retval;
retval = g_pfwFrames[pos].height;
if (g_pfwFrames[pos].height != oldHeight)
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
@@ -1380,7 +1380,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) {
retval = g_pfwFrames[pos].HeightWhenCollapsed;
g_pfwFrames[pos].HeightWhenCollapsed = lParam;
- if (!CLUIFramesFitInSize()) g_pfwFrames[pos].HeightWhenCollapsed = retval;
+ if ( !CLUIFramesFitInSize()) g_pfwFrames[pos].HeightWhenCollapsed = retval;
retval = g_pfwFrames[pos].HeightWhenCollapsed;
}
@@ -1399,7 +1399,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) }
case FO_ALIGN:
- if (!(lParam&alTop || lParam&alBottom || lParam&alClient))
+ if ( !(lParam&alTop || lParam&alBottom || lParam&alClient))
{
TRACE("Wrong align option \r\n");
return (-1);
@@ -1487,7 +1487,7 @@ static int _us_DoShowHideFrame(WPARAM wParam,LPARAM lParam) }
if (g_pfwFrames[pos].floating){CLUIFrameResizeFloatingFrame(pos);};
- if (!g_pfwFrames[pos].floating) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
+ if ( !g_pfwFrames[pos].floating) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
}
return 0;
}
@@ -1644,7 +1644,7 @@ static int _us_DoSetFrameBorder(WPARAM wParam,LPARAM lParam) RECT rc;
int FrameId,oldflags;
HWND hw;
- boolean flt;
+ int flt;
if (_fCluiFramesModuleNotStarted) return -1;
@@ -1695,7 +1695,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) {
RECT rc;
if (CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {return 0;};
- if (!g_CluiData.fDocked && g_CluiData.fAutoSize) {return 0;};
+ if ( !g_CluiData.fDocked && g_CluiData.fAutoSize) {return 0;};
GetWindowRect(pcli->hwndContactList,&rc);
if (g_pfwFrames[FrameId].collapsed == TRUE) {
@@ -1735,10 +1735,10 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) g_pfwFrames[FrameId].collapsed = TRUE;
}
- if (!g_pfwFrames[FrameId].floating)
+ if ( !g_pfwFrames[FrameId].floating)
{
- if (!CLUIFramesFitInSize()) {
+ if ( !CLUIFramesFitInSize()) {
//cant collapse,we can resize only for height < alclient frame height
int alfrm = CLUIFramesGetalClientFrame();
@@ -1768,7 +1768,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) if (g_pfwFrames[FrameId].collapsed == FALSE) {
- if (!g_pfwFrames[FrameId].floating)
+ if ( !g_pfwFrames[FrameId].floating)
{
}
else
@@ -1783,7 +1783,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) };//floating test
//CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
- if (!g_pfwFrames[FrameId].floating)
+ if ( !g_pfwFrames[FrameId].floating)
{
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
}
@@ -1890,7 +1890,7 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam) if (pcli->hwndContactList == 0) return -1;
if (_fCluiFramesModuleNotStarted) return -1;
if (clfrm->cbSize != sizeof(CLISTFrame)) return -1;
- if (!(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont();
+ if ( !(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont();
g_pfwFrames = (FRAMEWND*)realloc(g_pfwFrames,sizeof(FRAMEWND)*(g_nFramesCount+1));
@@ -2209,7 +2209,7 @@ static BOOL CLUIFramesFitInSize(void) sumheight += (g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar))+2/*+btoint(Frames[i].UseBorder)*2*/;
if (sumheight>_nContactListHeight-tbh-2)
{
- if (!g_CluiData.fDocked && g_CluiData.fAutoSize)
+ if ( !g_CluiData.fDocked && g_CluiData.fAutoSize)
{
return TRUE; //Can be required to enlarge
}
@@ -2319,7 +2319,7 @@ static int CLUIFramesResizeFrames(const RECT newsize) for (i=0;i < g_nFramesCount;i++)
{
- if (!g_pfwFrames[i].floating)
+ if ( !g_pfwFrames[i].floating)
{
g_pfwFrames[i].needhide = FALSE;
g_pfwFrames[i].wndSize.left = newsize.left;
@@ -2543,7 +2543,7 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) int dy;
dx = 0;//rcNewWindowRect.left-rcOldWindowRect.left;
dy = 0;//_window_rect.top-rcOldWindowRect.top;
- if (!g_pfwFrames[i].floating)
+ if ( !g_pfwFrames[i].floating)
{
if (g_pfwFrames[i].visible && !g_pfwFrames[i].needhide && !IsWindowVisible(g_pfwFrames[i].hWnd))
{
@@ -2552,7 +2552,7 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) }
if (g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow) != -2 )
{
- if (!(mode&2))
+ if ( !(mode&2))
{
HWND hwnd;
hwnd = GetParent(g_pfwFrames[i].OwnerWindow);
@@ -2620,9 +2620,9 @@ int CheckFramesPos(RECT *wr) int dy;
dx = 0;//rcNewWindowRect.left-rcOldWindowRect.left;
dy = 0;//_window_rect.top-rcOldWindowRect.top;
- if (!g_pfwFrames[i].floating && g_pfwFrames[i].visible)
+ if ( !g_pfwFrames[i].floating && g_pfwFrames[i].visible)
{
- if (!(g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow) != -2))
+ if ( !(g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow) != -2))
{
RECT r;
GetWindowRect(g_pfwFrames[i].hWnd,&r);
@@ -2764,7 +2764,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam) if (g_CluiData.fDisableSkinEngine)
{
if (db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!DBGetContactSettingString(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -2901,7 +2901,7 @@ void DrawBackGround(HWND hwnd,HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColou DeleteDC(hdcMem);
paintst.fErase = FALSE;
//DeleteObject(hFont);
- if (!mhdc)
+ if ( !mhdc)
{
EndPaint(hwnd,&paintst);
}
@@ -2954,7 +2954,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid) {
if (g_CluiData.fDisableSkinEngine)
{
- if (!hBmpBackground && bkUseWinColours && xpt_IsThemed(_hFrameTitleTheme))
+ if ( !hBmpBackground && bkUseWinColours && xpt_IsThemed(_hFrameTitleTheme))
{
int state = CS_ACTIVE;
// if (GetForegroundWindow() != pcli->hwndContactList) state = CS_INACTIVE;
@@ -2964,7 +2964,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid) else
DrawBackGround(g_pfwFrames[pos].TitleBar.hwnd,hdcMem, hBmpBackground, bkColour, backgroundBmpUse);
}
- else if (!g_CluiData.fLayered)
+ else if ( !g_CluiData.fLayered)
{
ske_BltBackImage(g_pfwFrames[pos].TitleBar.hwnd,hdcMem,&rc);
}
@@ -2977,7 +2977,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid) SetTextColor(hdcMem,SelBkColour);
{
RECT textrc = rc;
- if (!AlignCOLLIconToLeft)
+ if ( !AlignCOLLIconToLeft)
{
if (g_pfwFrames[pos].TitleBar.hicon != NULL)
@@ -3001,7 +3001,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid) ske_TextOut(hdcMem,textrc.left,textrc.top,g_pfwFrames[pos].TitleBar.tbname,lstrlen(g_pfwFrames[pos].TitleBar.tbname));
}
- if (!AlignCOLLIconToLeft)
+ if ( !AlignCOLLIconToLeft)
{
mod_DrawIconEx_helper(hdcMem,g_pfwFrames[pos].TitleBar.wndSize.right-GetSystemMetrics(SM_CXSMICON)-2,rc.top+((g_nTitleBarHeight>>1)-(GetSystemMetrics(SM_CXSMICON)>>1)),g_pfwFrames[pos].collapsed?LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN):LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT),GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
}
@@ -3050,7 +3050,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam switch(msg)
{
case WM_CREATE:
- if (!_hFrameTitleTheme)
+ if ( !_hFrameTitleTheme)
_hFrameTitleTheme = xpt_AddThemeHandle(hwnd,L"WINDOW");
SendMessage(hwnd,WM_SETFONT,(WPARAM)_hTitleBarFont,0);
return FALSE;
@@ -3234,7 +3234,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam );
oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,g_pfwFrames[pos].id),(LPARAM)0);
- if (!(oldflags&F_SHOWTBTIP))
+ if ( !(oldflags&F_SHOWTBTIP))
{
oldflags |= F_SHOWTBTIP;
//CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,Frames[pos].id),(LPARAM)oldflags);
@@ -3305,7 +3305,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam //IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )
- if (!IntersectRect( &rcOverlap, &rcwnd, &rcMiranda ))
+ if ( !IntersectRect( &rcOverlap, &rcwnd, &rcMiranda ))
{
GetCursorPos(&curpt);
GetWindowRect( g_pfwFrames[pos].hWnd, &rcwnd );
@@ -3376,7 +3376,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam nLeft += (short)dX;
nTop += (short)dY;
- if (!(wParam&MK_CONTROL))
+ if ( !(wParam&MK_CONTROL))
{
PositionThumb( &g_pfwFrames[pos], nLeft, nTop );
}else
@@ -3443,7 +3443,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam if (newh>0) {
prevold = g_pfwFrames[Framemod].height;
g_pfwFrames[Framemod].height = newh;
- if (!CLUIFramesFitInSize()) { g_pfwFrames[Framemod].height = prevold; return TRUE;}
+ if ( !CLUIFramesFitInSize()) { g_pfwFrames[Framemod].height = prevold; return TRUE;}
g_pfwFrames[Framemod].height = newh;
if (newh>3) g_pfwFrames[Framemod].collapsed = TRUE;
@@ -3466,7 +3466,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam //if (lParam&PRF_CLIENT)
{
GetClientRect(hwnd,&rect);
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
ske_BltBackImage(hwnd,(HDC)wParam,&rect);
}
@@ -3503,7 +3503,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos) int width,height;
RECT rect;
- if (!g_pfwFrames[framepos].floating){return(0);};
+ if ( !g_pfwFrames[framepos].floating){return(0);};
if (g_pfwFrames[framepos].ContainerWnd == 0){return(0);};
GetClientRect(g_pfwFrames[framepos].ContainerWnd,&rect);
@@ -3695,7 +3695,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP framepos = id2pos(Frameid);
if (framepos < 0 || framepos >= g_nFramesCount){break;};
- if (!g_pfwFrames[framepos].minmaxenabled){break;};
+ if ( !g_pfwFrames[framepos].minmaxenabled){break;};
if (g_pfwFrames[framepos].ContainerWnd == 0){break;};
if (g_pfwFrames[framepos].Locked)
@@ -3892,7 +3892,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam) SetParent(g_pfwFrames[pos].TitleBar.hwnd,pcli->hwndContactList);
SetWindowLongPtr(g_pfwFrames[pos].OwnerWindow,GWLP_USERDATA,g_pfwFrames[pos].id);
g_pfwFrames[pos].floating = FALSE;
- if (!(lParam&2))
+ if ( !(lParam&2))
{
DestroyWindow(g_pfwFrames[pos].ContainerWnd);
g_pfwFrames[pos].ContainerWnd = 0;
@@ -3922,7 +3922,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam) GetWindowRect(g_pfwFrames[pos].hWnd,&rectw);
GetWindowRect(g_pfwFrames[pos].TitleBar.hwnd,&recttb);
- if (!g_pfwFrames[pos].TitleBar.ShowTitleBar){
+ if ( !g_pfwFrames[pos].TitleBar.ShowTitleBar){
recttb.top = recttb.bottom = recttb.left = recttb.right = 0;
};
@@ -4003,7 +4003,7 @@ int CLUIFrameOnModulesUnload(WPARAM wParam,LPARAM lParam) {
//
//if (MirandaExiting()) return 0;
- if (!_hmiVisible) return 0;
+ if ( !_hmiVisible) return 0;
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiVisible, 1 );
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiTBVisible, 1 );
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiLock, 1 );
@@ -4087,10 +4087,10 @@ int LoadCLUIFramesModule(void) InitFramesMenus();
- ModernHookEvent(ME_SYSTEM_MODULESLOADED,CLUIFrameOnModulesLoad);
- ModernHookEvent(ME_CLIST_PREBUILDFRAMEMENU,CLUIFramesModifyContextMenuForFrame);
- ModernHookEvent(ME_CLIST_PREBUILDMAINMENU,CLUIFrameOnMainMenuBuild);
- ModernHookEvent(ME_SYSTEM_PRESHUTDOWN, CLUIFrameOnModulesUnload);
+ HookEvent(ME_SYSTEM_MODULESLOADED,CLUIFrameOnModulesLoad);
+ HookEvent(ME_CLIST_PREBUILDFRAMEMENU,CLUIFramesModifyContextMenuForFrame);
+ HookEvent(ME_CLIST_PREBUILDMAINMENU,CLUIFrameOnMainMenuBuild);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, CLUIFrameOnModulesUnload);
CreateCluiFramesServices();
@@ -4162,11 +4162,11 @@ int UnLoadCLUIFramesModule(void) static int _us_DoSetFramePaintProc(WPARAM wParam, LPARAM lParam)
{
- if (!wParam) return 0;
+ if ( !wParam) return 0;
{
// LOOK REQUIRED OR SYNC CALL NEEDED
FRAMEWND *frm = FindFrameByItsHWND((HWND)wParam);
- if (!frm) return 0;
+ if ( !frm) return 0;
if (lParam)
frm->PaintCallbackProc = (tPaintCallbackProc)lParam;
else
diff --git a/plugins/Clist_modern/modern_cluiservices.cpp b/plugins/Clist_modern/modern_cluiservices.cpp index f88e4554c7..0b48b0ec47 100644 --- a/plugins/Clist_modern/modern_cluiservices.cpp +++ b/plugins/Clist_modern/modern_cluiservices.cpp @@ -77,7 +77,7 @@ static INT_PTR GroupAdded(WPARAM wParam, LPARAM lParam) HWND hwndFocus = GetFocus();
GetClassName(hwndFocus, szFocusClass, SIZEOF(szFocusClass));
- if (!lstrcmp(szFocusClass, CLISTCONTROL_CLASS)) {
+ if ( !lstrcmp(szFocusClass, CLISTCONTROL_CLASS)) {
hItem = (HANDLE) SendMessage(hwndFocus, CLM_FINDGROUP, wParam, 0);
if (hItem)
SendMessage(hwndFocus, CLM_EDITLABEL, (WPARAM) hItem, 0);
diff --git a/plugins/Clist_modern/modern_commonheaders.cpp b/plugins/Clist_modern/modern_commonheaders.cpp index 03e8f26487..45c2709d2b 100644 --- a/plugins/Clist_modern/modern_commonheaders.cpp +++ b/plugins/Clist_modern/modern_commonheaders.cpp @@ -6,7 +6,7 @@ BYTE gl_TrimText = 1; char * __cdecl strstri( char *a, const char *b)
{
char * x, *y;
- if (!a || !b) return FALSE;
+ if ( !a || !b) return FALSE;
x = _strdup(a);
y = _strdup(b);
x = _strupr(x);
@@ -57,7 +57,7 @@ BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b) int __cdecl mir_strcmp (const char *a, const char *b)
{
- if (!(a && b)) return a != b;
+ if ( !(a && b)) return a != b;
return (strcmp(a,b));
};
@@ -84,7 +84,7 @@ wchar_t * mir_strdupW(const wchar_t * src) wchar_t * p;
if (src == NULL) return NULL;
p = (wchar_t *) mir_alloc((lstrlenW(src)+1)*sizeof(wchar_t));
- if (!p) return 0;
+ if ( !p) return 0;
lstrcpyW(p, src);
return p;
}
@@ -95,7 +95,7 @@ char * strdupn(const char * src, int len) char * p;
if (src == NULL) return NULL;
p = (char*)malloc(len+1);
- if (!p) return 0;
+ if ( !p) return 0;
memcpy(p,src,len);
p[len] = '\0';
return p;
@@ -127,7 +127,7 @@ void TRACE_ERROR() {
DWORD t = GetLastError();
LPVOID lpMsgBuf;
- if (!FormatMessage(
+ if ( !FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM |
FORMAT_MESSAGE_IGNORE_INSERTS,
@@ -152,7 +152,7 @@ void TRACE_ERROR() BOOL DebugDeleteObject(HGDIOBJ a)
{
BOOL res = DeleteObject(a);
- if (!res) TRACE_ERROR();
+ if ( !res) TRACE_ERROR();
return res;
}
@@ -189,7 +189,7 @@ HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName) HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared)
{
HICON hResIcon = bShared?LoadSmallIcon(hInstance,lpIconName):LoadSmallIconShared(hInstance,lpIconName);
- if (!hResIcon) //Icon not found in hInstance lets try to load it from core
+ if ( !hResIcon) //Icon not found in hInstance lets try to load it from core
{
HINSTANCE hCoreInstance = GetModuleHandle(NULL);
if (hCoreInstance != hInstance)
@@ -207,7 +207,7 @@ BOOL DestroyIcon_protect(HICON icon) void li_ListDestruct(SortedList *pList, ItemDestuctor pItemDestructor)
{
int i=0;
- if (!pList) return;
+ if ( !pList) return;
for (i=0; i < pList->realCount; i++) pItemDestructor(pList->items[i]);
List_Destroy(pList);
mir_free(pList);
@@ -232,7 +232,7 @@ void li_SortList(SortedList *pList, FSortFunc pSortFunct) {
FSortFunc pOldSort = pList->sortFunc;
int i;
- if (!pSortFunct) pSortFunct = pOldSort;
+ if ( !pSortFunct) pSortFunct = pOldSort;
pList->sortFunc = NULL;
for (i=0; i < pList->realCount-1; i++)
if (pOldSort(pList->items[i],pList->items[i+1]) < 0)
@@ -245,77 +245,3 @@ void li_SortList(SortedList *pList, FSortFunc pSortFunct) }
pList->sortFunc = pOldSort;
}
-
-typedef struct _HookRec
-{
- HANDLE hHook;
-#ifdef _DEBUG
- char * HookStr;
- char * _debug_file;
- int _debug_line;
-#endif
-} HookRec;
-
-static HookRec * hooksrec = NULL;
-static DWORD hooksRecAlloced = 0;
-
-
-
-HANDLE ModernHookEvent(char *EventID, MIRANDAHOOK HookProc)
-{
- HookRec * hr = NULL;
- DWORD i;
- //1. Find free
- for (i=0;i < hooksRecAlloced;i++) {
- if (hooksrec[i].hHook == NULL)
- {
- hr = &(hooksrec[i]);
- break;
- }
- }
- if (hr == NULL)
- {
- //2. Need realloc
- hooksrec = (HookRec*)mir_realloc(hooksrec,sizeof(HookRec)*(hooksRecAlloced+1));
- hr = &(hooksrec[hooksRecAlloced]);
- hooksRecAlloced++;
- }
-
- hr->hHook = HookEvent(EventID,HookProc);
- return hr->hHook;
-}
-
-int ModernUnhookEvent(HANDLE hHook)
-{
- DWORD i;
- //1. Find free
-
- for (i=0;i < hooksRecAlloced;i++)
- {
- if (hooksrec[i].hHook == hHook)
- {
- UnhookEvent(hHook);
- hooksrec[i].hHook = NULL;
- return 1;
- }
- }
- return 0;
-}
-
-int UnhookAll()
-{
- DWORD i;
- TRACE("Unhooked Events:\n");
- if (!hooksrec) return 0;
- for (i=0;i < hooksRecAlloced;i++)
- {
- if (hooksrec[i].hHook != NULL)
- {
- UnhookEvent(hooksrec[i].hHook);
- hooksrec[i].hHook = NULL;
- }
- }
- mir_free_and_nil(hooksrec);
- hooksRecAlloced = 0;
- return 1;
-}
diff --git a/plugins/Clist_modern/modern_contact.cpp b/plugins/Clist_modern/modern_contact.cpp index 7142b6dcc2..7b1ba95544 100644 --- a/plugins/Clist_modern/modern_contact.cpp +++ b/plugins/Clist_modern/modern_contact.cpp @@ -86,10 +86,10 @@ int GetProtoIndex(char * szName) PROTOACCOUNT **accs = NULL;
int accCount = 0;
int i;
- if (!szName) return -1;
+ if ( !szName) return -1;
ProtoEnumAccounts( &accCount, &accs );
for (i=0; i < accCount; i++)
- if (!mir_strcmpi(szName,accs[i]->szModuleName))
+ if ( !mir_strcmpi(szName,accs[i]->szModuleName))
return accs[i]->iOrder;
return -1;
}
diff --git a/plugins/Clist_modern/modern_docking.cpp b/plugins/Clist_modern/modern_docking.cpp index 885c53b9db..e05de26096 100644 --- a/plugins/Clist_modern/modern_docking.cpp +++ b/plugins/Clist_modern/modern_docking.cpp @@ -111,7 +111,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) if (msg->message == WM_DESTROY)
db_set_b(NULL,"CList","Docked",(BYTE)g_CluiData.fDocked);
- if (!g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
+ if ( !g_CluiData.fDocked && msg->message != WM_CREATE && msg->message != WM_MOVING && msg->message != WM_CREATEDOCKED && msg->message != WM_MOVE && msg->message != WM_SIZE) return 0;
switch(msg->message) {
case WM_CREATE:
//if (GetSystemMetrics(SM_CMONITORS)>1) return 0;
@@ -313,7 +313,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) return TRUE;
case WM_MOUSEMOVE:
- if (!draggingTitle) return 0;
+ if ( !draggingTitle) return 0;
{ RECT rc;
POINT pt;
GetClientRect(msg->hwnd,&rc);
diff --git a/plugins/Clist_modern/modern_extraimage.cpp b/plugins/Clist_modern/modern_extraimage.cpp index cc27494d61..402c87d26d 100644 --- a/plugins/Clist_modern/modern_extraimage.cpp +++ b/plugins/Clist_modern/modern_extraimage.cpp @@ -5,7 +5,7 @@ #define ExtraImageIconsIndexCount 6
-boolean visar[EXTRACOLUMNCOUNT];
+bool visar[EXTRACOLUMNCOUNT];
int ExtraImageIconsIndex[ExtraImageIconsIndexCount];
int EnabledColumnCount = 0;
BOOL g_mutex_bSetAllExtraIconsCycle = 0;
@@ -17,7 +17,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact); void ClearExtraIcons();
-boolean ImageCreated = FALSE;
+bool ImageCreated = FALSE;
BYTE ExtraOrder[] =
{
1, // EXTRA_ICON_EMAIL
@@ -37,7 +37,7 @@ BOOL HasExtraIconsService() return ServiceExists("ExtraIcon/Register");
}
-boolean isColumnVisible(int extra)
+bool isColumnVisible(int extra)
{
if (HasExtraIconsService())
return true;
@@ -48,16 +48,16 @@ boolean isColumnVisible(int extra) {
switch(i+1)
{
- case EXTRA_ICON_EMAIL: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",SETTING_EXTRA_ICON_EMAIL_DEFAULT));
- case EXTRA_ICON_PROTO: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",SETTING_EXTRA_ICON_PROTO_DEFAULT));
- case EXTRA_ICON_SMS: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",SETTING_EXTRA_ICON_SMS_DEFAULT));
- case EXTRA_ICON_ADV1: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",SETTING_EXTRA_ICON_ADV1_DEFAULT));
- case EXTRA_ICON_ADV2: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",SETTING_EXTRA_ICON_ADV2_DEFAULT));
- case EXTRA_ICON_WEB: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",SETTING_EXTRA_ICON_WEB_DEFAULT));
- case EXTRA_ICON_CLIENT: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_CLIENT",SETTING_EXTRA_ICON_CLIENT_DEFAULT));
- case EXTRA_ICON_VISMODE: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_VISMODE",SETTING_EXTRA_ICON_VISMODE_DEFAULT));
- case EXTRA_ICON_ADV3: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV3",SETTING_EXTRA_ICON_ADV3_DEFAULT));
- case EXTRA_ICON_ADV4: return(db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV4",SETTING_EXTRA_ICON_ADV4_DEFAULT));
+ case EXTRA_ICON_EMAIL: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",SETTING_EXTRA_ICON_EMAIL_DEFAULT) != 0;
+ case EXTRA_ICON_PROTO: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",SETTING_EXTRA_ICON_PROTO_DEFAULT) != 0;
+ case EXTRA_ICON_SMS: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",SETTING_EXTRA_ICON_SMS_DEFAULT) != 0;
+ case EXTRA_ICON_ADV1: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",SETTING_EXTRA_ICON_ADV1_DEFAULT) != 0;
+ case EXTRA_ICON_ADV2: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",SETTING_EXTRA_ICON_ADV2_DEFAULT) != 0;
+ case EXTRA_ICON_WEB: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",SETTING_EXTRA_ICON_WEB_DEFAULT) != 0;
+ case EXTRA_ICON_CLIENT: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_CLIENT",SETTING_EXTRA_ICON_CLIENT_DEFAULT) != 0;
+ case EXTRA_ICON_VISMODE: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_VISMODE",SETTING_EXTRA_ICON_VISMODE_DEFAULT) != 0;
+ case EXTRA_ICON_ADV3: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV3",SETTING_EXTRA_ICON_ADV3_DEFAULT) != 0;
+ case EXTRA_ICON_ADV4: return db_get_b(NULL,CLUIFrameModule,"EXTRA_ICON_ADV4",SETTING_EXTRA_ICON_ADV4_DEFAULT) != 0;
}
break;
}
@@ -78,7 +78,7 @@ void GetVisColumns() visar[9] = isColumnVisible(9);
};
-__inline int bti(boolean b)
+__inline int bti(bool b)
{
return(b?1:0);
};
@@ -111,7 +111,7 @@ int ExtraImage_ExtraIDToColumnNum(int extra) }
int ord = ExtraOrder[extra-1];
- if (!visar[ord]) return -1;
+ if ( !visar[ord]) return -1;
return (colsum(0,ord)-1);
};
@@ -145,30 +145,29 @@ INT_PTR SetIconForExtraColumn(WPARAM wParam,LPARAM lParam) 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)
{
- int res = -1;
- if (hExtraImageList == 0 || wParam == 0){return(-1);};
- res = ((int)ImageList_AddIcon(hExtraImageList,(HICON)wParam));
- if (res>254) return -1;
- return res;
-};
+ if (hExtraImageList == 0 || wParam == 0)
+ return -1;
+ int res = ((int)ImageList_AddIcon(hExtraImageList,(HICON)wParam));
+ return (res > 254) ? -1 : res;
+}
void SetNewExtraColumnCount()
{
- int newcount;
LoadPositionsFromDB(ExtraOrder);
GetVisColumns();
- newcount = colsum(0,EXTRACOLUMNCOUNT-1);
+
+ int newcount = colsum(0,EXTRACOLUMNCOUNT-1);
db_set_b(NULL,CLUIFrameModule,"EnabledColumnCount",(BYTE)newcount);
EnabledColumnCount = newcount;
SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS,EnabledColumnCount,0);
-};
+}
void ExtraImage_ReloadExtraIcons()
{
@@ -185,12 +184,9 @@ void ExtraImage_ReloadExtraIcons() 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);
- if (!HasExtraIconsService())
- {
- HICON hIcon;
-
+ if ( !HasExtraIconsService()) {
//loading icons
- hIcon = LoadSkinnedIcon(SKINICON_OTHER_SENDEMAIL);
+ HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_SENDEMAIL);
ExtraImageIconsIndex[0] = ImageList_AddIcon(hExtraImageList, hIcon);
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
@@ -203,28 +199,27 @@ void ExtraImage_ReloadExtraIcons() //calc only needed protocols
//adding protocol icons
ProtoEnumAccounts( &count, &accs );
- for (i=0;i < count;i++)
- {
- if (!IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS,PFLAGNUM_2, 0 ) == 0)
+ for (i=0;i < count;i++) {
+ if ( !IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS,PFLAGNUM_2, 0 ) == 0)
continue;
-
+
hIcon = LoadSkinnedProtoIcon(accs[i]->szModuleName,ID_STATUS_ONLINE);
ImageList_AddIcon(hExtraImageList, hIcon);
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
}
hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",5,TRUE,TRUE,"AlwaysVis","Contact List",Translate("Always Visible"),-IDI_ALWAYSVIS,&needFree);
- if (!hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_ALWAYSVIS));needFree = TRUE;}
+ if ( !hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_ALWAYSVIS));needFree = TRUE;}
ExtraImageIconsIndex[3] = ImageList_AddIcon(hExtraImageList,hicon );
if (needFree) DestroyIcon_protect(hicon);
hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",6,TRUE,TRUE,"NeverVis","Contact List",Translate("Never Visible"),-IDI_NEVERVIS,&needFree);
- if (!hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_NEVERVIS));needFree = TRUE;}
+ if ( !hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_NEVERVIS));needFree = TRUE;}
ExtraImageIconsIndex[4] = ImageList_AddIcon(hExtraImageList,hicon );
if (needFree) DestroyIcon_protect(hicon);
hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",7,TRUE,TRUE,"ChatActivity","Contact List",Translate("Chat Activity"),-IDI_CHAT,&needFree);
- if (!hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_CHAT));needFree = TRUE;}
+ if ( !hicon) {hicon = LoadSmallIcon(g_hInst, MAKEINTRESOURCE(IDI_CHAT));needFree = TRUE;}
ExtraImageIconsIndex[5] = ImageList_AddIcon(hExtraImageList,hicon );
if (needFree) DestroyIcon_protect(hicon);
}
@@ -246,24 +241,18 @@ void ReAssignExtraIcons() void ClearExtraIcons()
{
- int i;
- HANDLE hContact,hItem;
-
- //EnabledColumnCount = DBGetContactSettingByte(NULL,CLUIFrameModule,"EnabledColumnCount",5);
- //SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS,EnabledColumnCount,0);
SetNewExtraColumnCount();
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
do {
+ HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
+ if (hItem == 0)
+ continue;
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
- if (hItem == 0){continue;};
- for (i=0;i < EnabledColumnCount;i++)
- {
+ for (int i=0;i < EnabledColumnCount;i++)
SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0xFF));
- };
-
- } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ }
+ while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
};
void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact)
@@ -271,7 +260,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) HANDLE hItem;
int locApparentMode = 0;
char * locApparentModeProto = NULL;
- boolean hcontgiven = FALSE;
+ bool hcontgiven = FALSE;
char *szProto;
char *(ImgIndex[64]);
int maxpr,count,i;
@@ -289,7 +278,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) SetNewExtraColumnCount();
BOOL hasExtraIconsService = HasExtraIconsService();
- if (!hasExtraIconsService)
+ if ( !hasExtraIconsService)
{
em = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL);
pr = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO);
@@ -326,10 +315,10 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) // szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
szProto = pdnce->m_cache_cszProto;
- if (!hasExtraIconsService)
+ if ( !hasExtraIconsService)
{
{
- boolean showweb;
+ bool showweb;
showweb = FALSE;
if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB) != -1)
{
@@ -338,7 +327,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) {
char *homepage;
homepage = db_get_sa(pdnce->m_cache_hContact,"UserInfo", "Homepage");
- if (!homepage)
+ if ( !homepage)
homepage = db_get_sa(pdnce->m_cache_hContact,pdnce->m_cache_cszProto, "Homepage");
if (homepage != NULL)
{
@@ -351,7 +340,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) }
{
DBVARIANT dbv = {0};
- boolean showemail;
+ bool showemail;
showemail = TRUE;
if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL) != -1)
{
@@ -369,7 +358,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) {
DBVARIANT dbv = {0};
- boolean showsms;
+ bool showsms;
showsms = TRUE;
if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS) != -1)
{
@@ -388,7 +377,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) {
for (i=0;i < maxpr;i++)
{
- if (!mir_strcmp(ImgIndex[i],szProto))
+ if ( !mir_strcmp(ImgIndex[i],szProto))
{
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO),i+3));
break;
@@ -400,7 +389,7 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) BYTE iconIndex = 0xFF;
if (szProto != NULL)
{
- if (!db_get_b(hContact, szProto, "ChatRoom", 0))
+ if ( !db_get_b(hContact, szProto, "ChatRoom", 0))
{
if (pdnce->ApparentMode == ID_STATUS_OFFLINE)
iconIndex = ExtraImageIconsIndex[4];
@@ -509,9 +498,9 @@ void ExtraImage_LoadModule() //HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
- ModernHookEvent(ME_CLC_SHOWEXTRAINFOTIP, ehhShowExtraInfoTip );
- ModernHookEvent(ME_CLC_HIDEINFOTIP, ehhHideExtraInfoTip );
- ModernHookEvent(ME_SYSTEM_SHUTDOWN, ehhExtraImage_UnloadModule );
+ HookEvent(ME_CLC_SHOWEXTRAINFOTIP, ehhShowExtraInfoTip );
+ HookEvent(ME_CLC_HIDEINFOTIP, ehhHideExtraInfoTip );
+ HookEvent(ME_SYSTEM_SHUTDOWN, ehhExtraImage_UnloadModule );
};
diff --git a/plugins/Clist_modern/modern_framesmenu.cpp b/plugins/Clist_modern/modern_framesmenu.cpp index 9fc07f5e07..950bf122bb 100644 --- a/plugins/Clist_modern/modern_framesmenu.cpp +++ b/plugins/Clist_modern/modern_framesmenu.cpp @@ -113,7 +113,7 @@ static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam) }
// == == == == == == == == == == == == == Frames end
-boolean InternalGenMenuModule = FALSE;
+bool InternalGenMenuModule = FALSE;
int MeasureItemProxy(WPARAM wParam,LPARAM lParam) {
@@ -172,7 +172,7 @@ int InitFramesMenus(void) {
TMenuParam tmp;
- if (!ServiceExists(MO_REMOVEMENUOBJECT))
+ if ( !ServiceExists(MO_REMOVEMENUOBJECT))
{
InitCustomMenus();
diff --git a/plugins/Clist_modern/modern_gdiplus.cpp b/plugins/Clist_modern/modern_gdiplus.cpp index 1b8a1acd27..f07e294dbd 100644 --- a/plugins/Clist_modern/modern_gdiplus.cpp +++ b/plugins/Clist_modern/modern_gdiplus.cpp @@ -128,14 +128,14 @@ void DrawAvatarImageWithGDIp(HDC hDestDC,int x, int y, DWORD width, DWORD height if (bmp.bmBitsPixel == 32 && (flag&AVS_PREMULTIPLIED))
{
bmbits = (BYTE*)bmp.bmBits;
- if (!bmbits)
+ if ( !bmbits)
{
bmbits = (BYTE*)malloc(bmp.bmHeight*bmp.bmWidthBytes);
GetBitmapBits(hbmp,bmp.bmHeight*bmp.bmWidthBytes,bmbits);
}
bm = new Bitmap(bmp.bmWidth,bmp.bmHeight,bmp.bmWidthBytes,PixelFormat32bppPARGB,bmbits);
bm->RotateFlip(RotateNoneFlipY);
- if (!bmp.bmBits)
+ if ( !bmp.bmBits)
{
bm->RotateFlip(RotateNoneFlipY);
free(bmbits);
diff --git a/plugins/Clist_modern/modern_gettextasync.cpp b/plugins/Clist_modern/modern_gettextasync.cpp index c25e274cf7..52b73f96dc 100644 --- a/plugins/Clist_modern/modern_gettextasync.cpp +++ b/plugins/Clist_modern/modern_gettextasync.cpp @@ -56,7 +56,7 @@ static HANDLE hgtaWakeupEvent = NULL; static BOOL gtaGetItem(GTACHAINITEM * mpChain)
{
gtalock;
- if (!gtaFirstItem)
+ if ( !gtaFirstItem)
{
gtaunlock;
return FALSE;
@@ -67,7 +67,7 @@ static BOOL gtaGetItem(GTACHAINITEM * mpChain) ch = gtaFirstItem;
*mpChain = *ch;
gtaFirstItem = (GTACHAINITEM *)ch->Next;
- if (!gtaFirstItem) gtaLastItem = NULL;
+ if ( !gtaFirstItem) gtaLastItem = NULL;
free(ch);
gtaunlock;
return TRUE;
@@ -88,7 +88,7 @@ static int gtaThreadProc(void * lpParam) Sync(CLUI_SyncGetShortData,(WPARAM)pcli->hwndContactTree,(LPARAM)&data);
do
{
- if (!MirandaExiting())
+ if ( !MirandaExiting())
SleepEx(0,TRUE); //1000 contacts per second
if (MirandaExiting())
{
@@ -99,25 +99,25 @@ static int gtaThreadProc(void * lpParam) {
GTACHAINITEM mpChain = {0};
struct SHORTDATA dat2 = {0};
- if (!gtaGetItem(&mpChain)) break;
+ if ( !gtaGetItem(&mpChain)) break;
if (mpChain.dat == NULL || (!IsBadReadPtr(mpChain.dat,sizeof(mpChain.dat)) && mpChain.dat->hWnd == data.hWnd)) dat = &data;
else
{
Sync(CLUI_SyncGetShortData,(WPARAM)mpChain.dat->hWnd,(LPARAM)&dat2);
dat = &dat2;
}
- if (!MirandaExiting())
+ if ( !MirandaExiting())
{
displayNameCacheEntry cacheEntry;
memset( &cacheEntry, 0, sizeof(cacheEntry));
cacheEntry.m_cache_hContact = mpChain.hContact;
- if (!Sync(CLUI_SyncGetPDNCE, (WPARAM) 0,(LPARAM)&cacheEntry))
+ if ( !Sync(CLUI_SyncGetPDNCE, (WPARAM) 0,(LPARAM)&cacheEntry))
{
- if (!MirandaExiting())
+ if ( !MirandaExiting())
Cache_GetSecondLineText(dat, &cacheEntry);
- if (!MirandaExiting())
+ if ( !MirandaExiting())
Cache_GetThirdLineText(dat, &cacheEntry);
- if (!MirandaExiting())
+ if ( !MirandaExiting())
Sync(CLUI_SyncSetPDNCE, (WPARAM) CCI_LINES,(LPARAM)&cacheEntry);
CListSettings_FreeCacheItemData(&cacheEntry);
}
@@ -190,7 +190,7 @@ void InitCacheAsync() InitializeCriticalSection(>aCS);
hgtaWakeupEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
g_dwGetTextAsyncThreadID = (DWORD)mir_forkthread((pThreadFunc)gtaThreadProc,0);
- ModernHookEvent(ME_SYSTEM_PRESHUTDOWN, gtaOnModulesUnload);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, gtaOnModulesUnload);
}
void UninitCacheAsync()
diff --git a/plugins/Clist_modern/modern_groupmenu.cpp b/plugins/Clist_modern/modern_groupmenu.cpp index 481239feb3..33c93a10a6 100644 --- a/plugins/Clist_modern/modern_groupmenu.cpp +++ b/plugins/Clist_modern/modern_groupmenu.cpp @@ -151,7 +151,7 @@ INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam) { if (wParam != 0)
{
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
- if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
+ if ( !mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
@@ -281,7 +281,7 @@ void GroupMenus_Init(void) CreateServiceFunction(MS_CLIST_REMOVEGROUPMENUITEM,RemoveGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
- ModernHookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);
InitSubGroupMenus();
@@ -431,7 +431,7 @@ void GroupMenus_Init(void) hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
- ModernHookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
+ HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
//MS_CLIST_GROUPCREATE
@@ -611,7 +611,7 @@ INT_PTR SubGroupMenuExecService(WPARAM wParam,LPARAM lParam) { if (wParam != 0)
{
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)wParam;
- if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
+ if ( !mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
@@ -664,7 +664,7 @@ void InitSubGroupMenus(void) CreateServiceFunction(MS_CLIST_REMOVESUBGROUPMENUITEM,RemoveSubGroupMenuItem);
CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP,BuildSubGroupMenu);
- ModernHookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
//SubGroup menu
memset(&tmp,0,sizeof(tmp));
diff --git a/plugins/Clist_modern/modern_image_array.cpp b/plugins/Clist_modern/modern_image_array.cpp index b1dae7be0c..c00a140f23 100644 --- a/plugins/Clist_modern/modern_image_array.cpp +++ b/plugins/Clist_modern/modern_image_array.cpp @@ -213,7 +213,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) }
// Get bounds
- if (!GetObject(hBmp,sizeof(BITMAP),&bm))
+ if ( !GetObject(hBmp,sizeof(BITMAP),&bm))
{
LeaveCriticalSection(&iad->cs);
return -1;
@@ -239,7 +239,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) }
// Alloc array
- if (!ImageArray_Alloc(iad, iad->nodes_size + 1))
+ if ( !ImageArray_Alloc(iad, iad->nodes_size + 1))
{
DeleteObject(hNewBmp);
LeaveCriticalSection(&iad->cs);
@@ -305,7 +305,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) BitBlt(iad->hdc, x, y, bm.bmWidth, bm.bmHeight, hdc_old, 0, 0, SRCCOPY);
// 3- old data
- if (!last_one)
+ if ( !last_one)
{
int ox, oy;
@@ -344,7 +344,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) iad->img = hNewBmp;
// Move array
- if (!last_one && iad->nodes_size > 1)
+ if ( !last_one && iad->nodes_size > 1)
{
memmove(&iad->nodes[pos+1], &iad->nodes[pos], (iad->nodes_size - pos) * sizeof(IMAGE_ARRAY_DATA_NODE));
}
@@ -383,7 +383,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) EnterCriticalSection(&iad->cs);
// Get bounds
- if (!GetObject(hBmp,sizeof(BITMAP),&bm))
+ if ( !GetObject(hBmp,sizeof(BITMAP),&bm))
{
LeaveCriticalSection(&iad->cs);
return FALSE;
diff --git a/plugins/Clist_modern/modern_newrowopts.cpp b/plugins/Clist_modern/modern_newrowopts.cpp index 669fad8fa7..fabbbf6adb 100644 --- a/plugins/Clist_modern/modern_newrowopts.cpp +++ b/plugins/Clist_modern/modern_newrowopts.cpp @@ -53,7 +53,7 @@ NodeList * RootNode = NULL; NodeList * AddNode(NodeList * Parent)
{
NodeList * res;
- if (!Parent)
+ if ( !Parent)
{
res = (NodeList *)mir_alloc(sizeof(NodeList));
memset(res,0,sizeof(NodeList));
@@ -69,7 +69,7 @@ NodeList * AddNode(NodeList * Parent) BOOL RemoveChildNode(NodeList * FromList, DWORD index)
{
- if (!FromList) return FALSE;
+ if ( !FromList) return FALSE;
if (FromList->AllocatedChilds <= index) return FALSE;
NodeList *work = &(FromList->childNodes[index]);
for (size_t i=0; i < work->AllocatedChilds; i++)
@@ -87,7 +87,7 @@ BOOL RemoveChildNode(NodeList * FromList, DWORD index) BOOL RemoveNode(NodeList * FromList)
{
- if (!FromList) return FALSE;
+ if ( !FromList) return FALSE;
if (FromList->itemParent)
{
DWORD k;
@@ -118,7 +118,7 @@ void PrintIdent() void TraceTreeLevel(NodeList * node)
{
DWORD i;
- if (!node) return;
+ if ( !node) return;
PrintIdent();
{
char buf[255];
diff --git a/plugins/Clist_modern/modern_popup.cpp b/plugins/Clist_modern/modern_popup.cpp index 8fa33f370a..9da27e5ff9 100644 --- a/plugins/Clist_modern/modern_popup.cpp +++ b/plugins/Clist_modern/modern_popup.cpp @@ -55,7 +55,7 @@ void ShowPopup(const char *title, const char *description, int type) POPUPDATAEX ppd;
int ret;
- if (!ServiceExists(MS_POPUP_ADDPOPUPEX) || !EnablePopups)
+ if ( !ServiceExists(MS_POPUP_ADDPOPUPEX) || !EnablePopups)
{
return;
}
diff --git a/plugins/Clist_modern/modern_row.cpp b/plugins/Clist_modern/modern_row.cpp index 202247e02f..55dcc6edc8 100644 --- a/plugins/Clist_modern/modern_row.cpp +++ b/plugins/Clist_modern/modern_row.cpp @@ -68,7 +68,7 @@ ROWCELL *cppInitModernRow(ROWCELL ** tabAccess) ROWCELL * RowRoot = NULL;
FILE * hFile;
int i=0;
- if (!db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT)) return NULL;
+ if ( !db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT)) return NULL;
tmplbuf = NULL;
if (db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT) == 1)
tmplbuf = db_get_sa(NULL,"ModernData","RowTemplate");
@@ -139,7 +139,7 @@ const ROWCELL * rowAddCell(ROWCELL* &link, int cont) //
void rowDeleteTree(ROWCELL* cell)
{
- if (!cell) return;
+ if ( !cell) return;
if (cell->child)
rowDeleteTree((ROWCELL*)(cell->child));
if (cell->next)
@@ -181,7 +181,7 @@ char * rowParserGetNextWord(char *tbuf, int &hbuf) }
// Tag-bracers found
- if (!(ch == '>' && j < 0)) //not single '>' found
+ if ( !(ch == '>' && j < 0)) //not single '>' found
{
if ( (ch == '<' || ch == '>') && j >= 0)
{
@@ -223,36 +223,36 @@ void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf) char * word = rowParserGetNextWord(tbuf, hbuf);
int param = 0;
- if (!_strnicmp(word, "avatar", strlen(word))) param = TC_AVATAR;
- else if (!_strnicmp(word, "text1", strlen(word))) param = TC_TEXT1;
- else if (!_strnicmp(word, "text2", strlen(word))) param = TC_TEXT2;
- else if (!_strnicmp(word, "text3", strlen(word))) param = TC_TEXT3;
- else if (!_strnicmp(word, "status", strlen(word))) param = TC_STATUS;
- else if (!_strnicmp(word, "extra", strlen(word))) param = TC_EXTRA;
- else if (!_strnicmp(word, "extra1", strlen(word))) param = TC_EXTRA1;
- else if (!_strnicmp(word, "extra2", strlen(word))) param = TC_EXTRA2;
- else if (!_strnicmp(word, "extra3", strlen(word))) param = TC_EXTRA3;
- else if (!_strnicmp(word, "extra4", strlen(word))) param = TC_EXTRA4;
- else if (!_strnicmp(word, "extra5", strlen(word))) param = TC_EXTRA5;
- else if (!_strnicmp(word, "extra6", strlen(word))) param = TC_EXTRA6;
- else if (!_strnicmp(word, "extra7", strlen(word))) param = TC_EXTRA7;
- else if (!_strnicmp(word, "extra8", strlen(word))) param = TC_EXTRA8;
- else if (!_strnicmp(word, "extra9", strlen(word))) param = TC_EXTRA9;
- else if (!_strnicmp(word, "time", strlen(word))) param = TC_TIME;
- else if (!_strnicmp(word, "space", strlen(word))) param = TC_SPACE;
- else if (!_strnicmp(word, "fspace", strlen(word))) param = TC_FIXED;
-
- else if (!_strnicmp(word, "left", strlen(word))) param = TC_LEFT;
- else if (!_strnicmp(word, "top", strlen(word))) param = TC_TOP;
- else if (!_strnicmp(word, "vcenter", strlen(word))) param = TC_VCENTER;
- else if (!_strnicmp(word, "hcenter", strlen(word))) param = TC_HCENTER;
- else if (!_strnicmp(word, "right", strlen(word))) param = TC_RIGHT;
- else if (!_strnicmp(word, "bottom", strlen(word))) param = TC_BOTTOM;
-
- else if (!_strnicmp(word, "layer", strlen(word))) cell->layer = TRUE;
-
- else if (!_strnicmp(word, "width", strlen(word))) param = TC_WIDTH;
- else if (!_strnicmp(word, "height", strlen(word))) param = TC_HEIGHT;
+ if ( !_strnicmp(word, "avatar", strlen(word))) param = TC_AVATAR;
+ else if ( !_strnicmp(word, "text1", strlen(word))) param = TC_TEXT1;
+ else if ( !_strnicmp(word, "text2", strlen(word))) param = TC_TEXT2;
+ else if ( !_strnicmp(word, "text3", strlen(word))) param = TC_TEXT3;
+ else if ( !_strnicmp(word, "status", strlen(word))) param = TC_STATUS;
+ else if ( !_strnicmp(word, "extra", strlen(word))) param = TC_EXTRA;
+ else if ( !_strnicmp(word, "extra1", strlen(word))) param = TC_EXTRA1;
+ else if ( !_strnicmp(word, "extra2", strlen(word))) param = TC_EXTRA2;
+ else if ( !_strnicmp(word, "extra3", strlen(word))) param = TC_EXTRA3;
+ else if ( !_strnicmp(word, "extra4", strlen(word))) param = TC_EXTRA4;
+ else if ( !_strnicmp(word, "extra5", strlen(word))) param = TC_EXTRA5;
+ else if ( !_strnicmp(word, "extra6", strlen(word))) param = TC_EXTRA6;
+ else if ( !_strnicmp(word, "extra7", strlen(word))) param = TC_EXTRA7;
+ else if ( !_strnicmp(word, "extra8", strlen(word))) param = TC_EXTRA8;
+ else if ( !_strnicmp(word, "extra9", strlen(word))) param = TC_EXTRA9;
+ else if ( !_strnicmp(word, "time", strlen(word))) param = TC_TIME;
+ else if ( !_strnicmp(word, "space", strlen(word))) param = TC_SPACE;
+ else if ( !_strnicmp(word, "fspace", strlen(word))) param = TC_FIXED;
+
+ else if ( !_strnicmp(word, "left", strlen(word))) param = TC_LEFT;
+ else if ( !_strnicmp(word, "top", strlen(word))) param = TC_TOP;
+ else if ( !_strnicmp(word, "vcenter", strlen(word))) param = TC_VCENTER;
+ else if ( !_strnicmp(word, "hcenter", strlen(word))) param = TC_HCENTER;
+ else if ( !_strnicmp(word, "right", strlen(word))) param = TC_RIGHT;
+ else if ( !_strnicmp(word, "bottom", strlen(word))) param = TC_BOTTOM;
+
+ else if ( !_strnicmp(word, "layer", strlen(word))) cell->layer = TRUE;
+
+ else if ( !_strnicmp(word, "width", strlen(word))) param = TC_WIDTH;
+ else if ( !_strnicmp(word, "height", strlen(word))) param = TC_HEIGHT;
else
{
@@ -328,8 +328,8 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque int cont;
if (!_strnicmp(word, "<tr", strlen(word)) || !_strnicmp(word, "<tr>", strlen(word))) cont = TC_ROW;
- else if (!_strnicmp(word, "<tc", strlen(word)) || !_strnicmp(word, "<tc>", strlen(word))) cont = TC_COL;
- else if (!_strnicmp(word, "/>", strlen(word)) ||
+ else if ( !_strnicmp(word, "<tc", strlen(word)) || !_strnicmp(word, "<tc>", strlen(word))) cont = TC_COL;
+ else if ( !_strnicmp(word, "/>", strlen(word)) ||
!_strnicmp(word, "</tr>", strlen(word)) ||
!_strnicmp(word, "</tc>", strlen(word))) return TRUE;
else return FALSE;
@@ -339,16 +339,16 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque if (cell->type != 0 && cell->type != TC_SPACE && cell->type != TC_FIXED)
RowTabAccess[sequence++] = cell;
- if (!rowParse(cell->child, cell, tbuf, hbuf, sequence,RowTabAccess))
+ if ( !rowParse(cell->child, cell, tbuf, hbuf, sequence,RowTabAccess))
return FALSE;
- if (!parent)
+ if ( !parent)
{
RowTabAccess[sequence] = NULL;
return TRUE;
}
- if (!rowParse(cell->next, parent, tbuf, hbuf, sequence,RowTabAccess))
+ if ( !rowParse(cell->next, parent, tbuf, hbuf, sequence,RowTabAccess))
return FALSE;
parent->sizing |= cell->sizing;
@@ -358,7 +358,7 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque void rowResetEmptyRects(ROWCELL* cell)
{
- if (!cell) return;
+ if ( !cell) return;
if (cell->type == 0)
{
SetRect(&(cell->r),0,0,0,0);
@@ -381,7 +381,7 @@ void rowCalculateMinSize(ROWCELL* cell) int w = 0,h = 0;
int wl = 0, hl = 0;
int fullWidth = 0;
- if (!cell) return;
+ if ( !cell) return;
cell->r.left = 0;
cell->r.top = 0;
@@ -396,7 +396,7 @@ void rowCalculateMinSize(ROWCELL* cell) rowCalculateMinSize(cell->child);
rowCalculateMinSize(cell->next);
- if (!(curchild = cell->child)) return;
+ if ( !(curchild = cell->child)) return;
if (cell->cont == TC_ROW)
{
@@ -453,11 +453,11 @@ void rowCalculateMinSize(ROWCELL* cell) void rowEqualize(ROWCELL* cell)
{
ROWCELL* curchild = NULL;
- if (!cell) return;
+ if ( !cell) return;
rowEqualize(cell->child);
rowEqualize(cell->next);
- if (!(curchild = cell->child)) return;
+ if ( !(curchild = cell->child)) return;
if (cell->cont == TC_ROW)
{
@@ -601,7 +601,7 @@ void rowPositioning(pROWCELL cell, int &dist) cell->r.right = dist;
dummy = dist;
- if (!(curchild = cell->child))
+ if ( !(curchild = cell->child))
{
rowPlacing(cell);
return;
@@ -705,7 +705,7 @@ void rowPositioning(pROWCELL cell, int &dist) rowPositioning(curchild, size);
x += size;
- if (!curchild->sizing)
+ if ( !curchild->sizing)
size = 0;
}
diff --git a/plugins/Clist_modern/modern_rowheight_funcs.cpp b/plugins/Clist_modern/modern_rowheight_funcs.cpp index 03de2da063..a651bce180 100644 --- a/plugins/Clist_modern/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/modern_rowheight_funcs.cpp @@ -84,10 +84,10 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * DWORD style;
style = GetWindowLongPtr(hwnd,GWL_STYLE);
pdnce = (displayNameCacheEntry*)pcli->pfnGetCacheEntry(contact->hContact);
- if (!RowHeights_Alloc(dat, item + 1))
+ if ( !RowHeights_Alloc(dat, item + 1))
return -1;
- if (!pcli->hwndContactTree) return 0;
- //if (!gl_RowRoot) RowHeight_InitModernRow();
+ if ( !pcli->hwndContactTree) return 0;
+ //if ( !gl_RowRoot) RowHeight_InitModernRow();
if (dat->hWnd != pcli->hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP)
{
int tmp = 0;
@@ -316,7 +316,7 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * {
TCHAR szResult[80];
- if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
+ if ( !tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
{
SIZE text_size = {0};
RECT rc = {0};
@@ -440,7 +440,7 @@ int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd) int max_height = 0, i, tmp;
DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
- if (!dat->text_ignore_size_for_row_height)
+ if ( !dat->text_ignore_size_for_row_height)
{
int contact_fonts[] = {FONTID_CONTACTS, FONTID_INVIS, FONTID_OFFLINE, FONTID_NOTONLIST, FONTID_OFFINVIS,
FONTID_AWAY,FONTID_DND, FONTID_NA, FONTID_OCCUPIED, FONTID_CHAT, FONTID_INVISIBLE,
@@ -501,7 +501,7 @@ int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd) }
// Icon size
- if (!dat->icon_ignore_size_for_row_height)
+ if ( !dat->icon_ignore_size_for_row_height)
{
max_height = max(max_height, ICON_HEIGHT);
}
@@ -570,7 +570,7 @@ void RowHeights_CalcRowHeights_Worker(struct ClcData *dat, HWND hwnd) line_num++;
// Calc row height
- if (!gl_RowRoot) RowHeights_GetRowHeight(dat, hwnd, Drawing, line_num);
+ if ( !gl_RowRoot) RowHeights_GetRowHeight(dat, hwnd, Drawing, line_num);
else RowHeight_CalcRowHeight(dat, hwnd, Drawing, line_num);
//increment by subcontacts
@@ -632,12 +632,12 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon BOOL selected = ((item == dat->selection) && (dat->hwndRenameEdit != NULL || dat->showSelAlways || dat->exStyle&CLS_EX_SHOWSELALWAYS || g_clcPainter.IsForegroundWindow(hwnd)) && contact->type != CLCIT_DIVIDER);
BOOL hottrack = ((item == dat->iHotTrack) && (dat->hwndRenameEdit != NULL || dat->showSelAlways || dat->exStyle&CLS_EX_SHOWSELALWAYS || g_clcPainter.IsForegroundWindow(hwnd)) && contact->type != CLCIT_DIVIDER);
BOOL minimalistic = (g_clcPainter.CheckMiniMode(dat,selected,hottrack));
- if (!RowHeights_Alloc(dat, item + 1))
+ if ( !RowHeights_Alloc(dat, item + 1))
return -1;
if (dat->row_variable_height)
{
- if (!dat->text_ignore_size_for_row_height)
+ if ( !dat->text_ignore_size_for_row_height)
{
HANDLE hContact = pdnce->m_cache_hContact;
tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
@@ -647,7 +647,7 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon }
height += tmp;
- if (!minimalistic && dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0])
+ if ( !minimalistic && dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0])
{
tmp = dat->fontModernInfo[FONTID_SECONDLINE].fontHeight;
if (dat->text_replace_smileys && dat->second_line_draw_smileys && !dat->text_resize_smileys)
@@ -657,7 +657,7 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon height += dat->second_line_top_space + tmp;
}
- if (!minimalistic && dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0])
+ if ( !minimalistic && dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0])
{
tmp = dat->fontModernInfo[FONTID_THIRDLINE].fontHeight;
if (dat->text_replace_smileys && dat->third_line_draw_smileys && !dat->text_resize_smileys)
@@ -688,7 +688,7 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon }
// Icon size
- if (!dat->icon_ignore_size_for_row_height)
+ if ( !dat->icon_ignore_size_for_row_height)
{
if (contact->type == CLCIT_GROUP
|| (contact->type == CLCIT_CONTACT && contact->iImage != -1
diff --git a/plugins/Clist_modern/modern_rowtemplateopt.cpp b/plugins/Clist_modern/modern_rowtemplateopt.cpp index 71c877abbe..8a93d63fd3 100644 --- a/plugins/Clist_modern/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/modern_rowtemplateopt.cpp @@ -49,7 +49,7 @@ RECT da = {205,58,440,130}; // Draw area //}
void rowOptBuildTA(pROWCELL cell, pROWCELL* TA, int* i)
{
- if (!cell) return;
+ if ( !cell) return;
TA[(*i)++] = cell;
rowOptBuildTA(cell->child,TA, i);
rowOptBuildTA(cell->next, TA, i);
@@ -68,7 +68,7 @@ void rowOptShowSettings(HWND hwnd) TreeView_GetItem(GetDlgItem(hwnd, IDC_ROWTREE), &tvi);
cell = (pROWCELL)tvi.lParam;
- if (!tvi.hItem)
+ if ( !tvi.hItem)
{
EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,0);
EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),0);
@@ -149,7 +149,7 @@ void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd) TVINSERTSTRUCT tvis;
HTREEITEM pnode;
- if (!cell) return;
+ if ( !cell) return;
tvis.hParent = node;
tvis.hInsertAfter = TVI_LAST;
@@ -191,7 +191,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) TVITEM tviparent;
ROWCELL *cell = NULL;
- if (!hti)
+ if ( !hti)
{
if (TreeView_GetRoot(htree)) return;
else
@@ -267,7 +267,7 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) HTREEITEM prnt = TreeView_GetParent(htree, hti);
TVITEM tvi, tvpi;
- if (!hti) return;
+ if ( !hti) return;
// Get current tree item
tvi.hItem = hti;
@@ -313,7 +313,7 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) // Change icon at parent item
- if (!prnt || (prnt != prev)) return;
+ if ( !prnt || (prnt != prev)) return;
if ( TreeView_GetChild(htree, prnt))
{
@@ -344,7 +344,7 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti) if (cell)
{
TCHAR buf[200] = {0};
- if (!cell->child)
+ if ( !cell->child)
{
if (cell->type == 0)
mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont == TC_COL?TranslateT("column"):TranslateT("line"));
@@ -384,7 +384,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hwndDlg);
rowOptTmplStr = db_get_sa(NULL, "ModernData", "RowTemplate");
- if (!rowOptTmplStr) rowOptTmplStr = mir_strdup("<TR />");
+ if ( !rowOptTmplStr) rowOptTmplStr = mir_strdup("<TR />");
{
//HIMAGELIST himlTreeIcons;
//himlTreeIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,3,2);
@@ -565,7 +565,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM HDC hdc;
TVITEM curItem;
- if (!rowOptTmplRoot) return FALSE;
+ if ( !rowOptTmplRoot) return FALSE;
hdc = BeginPaint(hwndDlg, &ps);
curItem.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_ROWTREE));
diff --git a/plugins/Clist_modern/modern_skinbutton.cpp b/plugins/Clist_modern/modern_skinbutton.cpp index 4dfd16484c..d4a7dfe5f5 100644 --- a/plugins/Clist_modern/modern_skinbutton.cpp +++ b/plugins/Clist_modern/modern_skinbutton.cpp @@ -85,14 +85,13 @@ int ModernSkinButtonLoadModule() wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
InitializeCriticalSection(&csTips);
- hookSystemShutdown_ModernSkinButton = ModernHookEvent(ME_SYSTEM_SHUTDOWN, ModernSkinButtonUnloadModule);
+ hookSystemShutdown_ModernSkinButton = HookEvent(ME_SYSTEM_SHUTDOWN, ModernSkinButtonUnloadModule);
ModernSkinButtonModuleIsLoaded = TRUE;
return 0;
}
int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam)
{
- ModernUnhookEvent(hookSystemShutdown_ModernSkinButton);
DeleteCriticalSection(&csTips);
return 0;
}
@@ -104,9 +103,9 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) RECT rc;
HDC sdc = NULL;
ModernSkinButtonCtrl* bct = (ModernSkinButtonCtrl *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (!bct) return 0;
- if (!IsWindowVisible(hwnd)) return 0;
- if (!whdc && !g_CluiData.fLayered) InvalidateRect(hwnd,NULL,FALSE);
+ if ( !bct) return 0;
+ if ( !IsWindowVisible(hwnd)) return 0;
+ if ( !whdc && !g_CluiData.fLayered) InvalidateRect(hwnd,NULL,FALSE);
if (whdc && g_CluiData.fLayered) hdc = whdc;
else
@@ -117,7 +116,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) GetClientRect(hwnd,&rc);
bmp = ske_CreateDIB32(rc.right,rc.bottom);
oldbmp = (HBITMAP)SelectObject(hdc,bmp);
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
ske_BltBackImage(bct->hwnd,hdc,NULL);
{
MODERNMASK Request = {0};
@@ -146,7 +145,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) case 's':
{
Value = db_get_sa(NULL,section,key);
- if (!Value)
+ if ( !Value)
Value = mir_strdup(bct->ValueTypeDef+1);
break;
}
@@ -181,7 +180,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) // DeleteObject(br);
}
- if (!whdc && g_CluiData.fLayered)
+ if ( !whdc && g_CluiData.fLayered)
{
RECT r;
SetRect(&r,bct->Left,bct->Top,bct->Right,bct->Bottom);
@@ -196,7 +195,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) }
SelectObject(hdc,oldbmp);
DeleteObject(bmp);
- if (!whdc || !g_CluiData.fLayered)
+ if ( !whdc || !g_CluiData.fLayered)
{
SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
mod_DeleteDC(hdc);
@@ -243,7 +242,7 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDe switch (ValueTypeDef[0]) {
case 's':
Value = db_get_sa(NULL,section,key);
- if (!Value || (Value && mir_bool_strcmpi(Value,val2)))
+ if ( !Value || (Value && mir_bool_strcmpi(Value,val2)))
Value = mir_strdup(val);
else
Value = mir_strdup(val2);
@@ -312,7 +311,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return) _skipblank(param1);
if (strlen(param1) == 0) param1 = NULL;
}
- if (!pszService) return 0;
+ if ( !pszService) return 0;
if (strlen(pszService) == 0) {
mir_free(pszService);
return 0;
@@ -339,7 +338,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return) param1 = param2;
param2 = NULL;
}
- if (!ServiceExists(pszService))
+ if ( !ServiceExists(pszService))
{
result = 0;
}
@@ -463,7 +462,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM // }
case WM_MOUSEMOVE:
{
- if (!bct->hover)
+ if ( !bct->hover)
{
SetCapture(bct->hwnd);
bct->hover = 1;
@@ -499,7 +498,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM if (bct->CommandService)
{
- if (!_CallServiceStrParams(bct->CommandService, NULL) && (bct->ValueDBSection && bct->ValueTypeDef))
+ if ( !_CallServiceStrParams(bct->CommandService, NULL) && (bct->ValueDBSection && bct->ValueTypeDef))
ModernSkinButtonToggleDBValue(bct->ValueDBSection,bct->ValueTypeDef);
}
bct->down = 0;
@@ -536,9 +535,9 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM HWND SetToolTip(HWND hwnd, TCHAR * tip)
{
TOOLINFO ti;
- if (!tip) return 0;
+ if ( !tip) return 0;
EnterCriticalSection(&csTips);
- if (!hwndToolTips) {
+ if ( !hwndToolTips) {
// hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL);
hwndToolTips = CreateWindowEx(0, TOOLTIPS_CLASS, NULL,
@@ -601,9 +600,9 @@ int ModernSkinButton_AddButton(HWND parent, char * TypeDef,
int MinWidth, int MinHeight)
{
- // if (!parent) return 0;
- if (!ModernSkinButtonModuleIsLoaded) return 0;
- if (!Buttons)
+ // if ( !parent) return 0;
+ if ( !ModernSkinButtonModuleIsLoaded) return 0;
+ if ( !Buttons)
Buttons = (MButton*)mir_alloc(sizeof(MButton));
else
Buttons = (MButton*)mir_realloc(Buttons,sizeof(MButton)*(ButtonsCount+1));
@@ -662,11 +661,11 @@ int ModernSkinButton_AddButton(HWND parent, static int ModernSkinButtonErase(int l,int t,int r, int b)
{
DWORD i;
- if (!ModernSkinButtonModuleIsLoaded) return 0;
- if (!g_CluiData.fLayered) return 0;
- if (!g_pCachedWindow) return 0;
- if (!g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0;
- if (!(l || r || t || b))
+ if ( !ModernSkinButtonModuleIsLoaded) return 0;
+ if ( !g_CluiData.fLayered) return 0;
+ if ( !g_pCachedWindow) return 0;
+ if ( !g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0;
+ if ( !(l || r || t || b))
{
for (i=0; i < ButtonsCount; i++)
{
@@ -706,7 +705,7 @@ static HWND ModernSkinButtonCreateWindow(ModernSkinButtonCtrl * bct, HWND parent int ModernSkinButtonRedrawAll(HDC hdc)
{
DWORD i;
- if (!ModernSkinButtonModuleIsLoaded) return 0;
+ if ( !ModernSkinButtonModuleIsLoaded) return 0;
g_mutex_bLockUpdating++;
for (i=0; i < ButtonsCount; i++)
{
@@ -720,7 +719,7 @@ int ModernSkinButtonRedrawAll(HDC hdc) int ModernSkinButtonDeleteAll()
{
- if (!ModernSkinButtonModuleIsLoaded)
+ if ( !ModernSkinButtonModuleIsLoaded)
return 0;
for (size_t i=0; i < ButtonsCount; i++)
@@ -740,10 +739,10 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT * r) RECT rd;
BOOL altDraw = FALSE;
static SIZE oldWndSize = {0};
- if (!ModernSkinButtonModuleIsLoaded) return 0;
+ if ( !ModernSkinButtonModuleIsLoaded) return 0;
GetWindowRect(parent,&rd);
GetClientRect(parent,&clr);
- if (!r)
+ if ( !r)
GetWindowRect(parent,&rc);
else
rc = *r;
diff --git a/plugins/Clist_modern/modern_skineditor.cpp b/plugins/Clist_modern/modern_skineditor.cpp index d3ca995c1f..fdd239e98a 100644 --- a/plugins/Clist_modern/modern_skineditor.cpp +++ b/plugins/Clist_modern/modern_skineditor.cpp @@ -76,7 +76,7 @@ int TreeAddObject(HWND hwndDlg, int ID, OPT_OBJECT_DATA * data) char buf[255];
BOOL ext = FALSE;
path = data->szPath?mir_strdup(data->szPath):(data->szName[1] == '$')?mir_strdup((data->szName)+2):NULL;
- if (!path) {
+ if ( !path) {
mir_snprintf(buf,SIZEOF(buf),"$(other)/%s",(data->szName)+1);
path = mir_strdup(buf);
}
@@ -94,7 +94,7 @@ int TreeAddObject(HWND hwndDlg, int ID, OPT_OBJECT_DATA * data) // find item if not - create;
{
cItem = FindChild(GetDlgItem(hwndDlg,ID),rootItem,ptr);
- if (!cItem) // not found - create node
+ if ( !cItem) // not found - create node
{
TVINSERTSTRUCTA tvis;
tvis.hParent = rootItem;
@@ -235,7 +235,7 @@ void SetControls(HWND hwndDlg, char * str) {
char buf[250];
int Type = 0;
- if (!str)
+ if ( !str)
{
SetAppropriateGroups(hwndDlg,-1);
return;
@@ -348,7 +348,7 @@ int GetShortFileName(char * FullFile) char buf[MAX_PATH] = {0};
char * f = strrchr(FullFile,'\\');
char * file = f?mir_strdup(f+1):0;
- if (!file) return 0;
+ if ( !file) return 0;
ske_GetFullFilename(buf,file,0,TRUE);
if (mir_bool_strcmpi(buf,FullFile))
{
@@ -442,7 +442,7 @@ char * MadeString(HWND hwndDlg) void UpdateInfo(HWND hwndDlg)
{
char *b = MadeString(hwndDlg);
- if (!b)
+ if ( !b)
{
SendDlgItemMessageA(hwndDlg,IDC_EDIT1,WM_SETTEXT,0,(LPARAM)"");
return;
@@ -730,7 +730,7 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //Save existed object
//Change to new object
NMTREEVIEWA * nmtv = (NMTREEVIEWA *) lParam;
- if (!nmtv) return 0;
+ if ( !nmtv) return 0;
if (nmtv->hdr.code == TVN_SELCHANGEDA || nmtv->hdr.code == TVN_SELCHANGEDW)
{
if (nmtv->itemOld.lParam)
@@ -778,7 +778,7 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM switch (((LPNMHDR)lParam)->code)
{
case PSN_APPLY:
- if (!glOtherSkinWasLoaded) //store only if skin is same
+ if ( !glOtherSkinWasLoaded) //store only if skin is same
{
StoreTreeToDB(GetDlgItem(hwndDlg,IDC_OBJECT_TREE),SKIN);
//ReloadSkin
@@ -813,12 +813,12 @@ int EnableGroup(HWND hwndDlg, HWND first, BOOL bEnable) {
HWND hwnd = first;
BOOL exit = FALSE;
- if (!hwnd) return 0;
+ if ( !hwnd) return 0;
do
{
EnableWindow(hwnd,bEnable);
hwnd = GetWindow(hwnd,GW_HWNDNEXT);
- if (!hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE;
+ if ( !hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE;
}
while (!exit);
return 0;
@@ -828,12 +828,12 @@ int ShowGroup(HWND hwndDlg, HWND first, BOOL bEnable) {
HWND hwnd = first;
BOOL exit = FALSE;
- if (!hwnd) return 0;
+ if ( !hwnd) return 0;
do
{
ShowWindow(hwnd,bEnable?SW_SHOW:SW_HIDE);
hwnd = GetWindow(hwnd,GW_HWNDNEXT);
- if (!hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE;
+ if ( !hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE;
}
while (!exit);
return 0;
diff --git a/plugins/Clist_modern/modern_skinengine.cpp b/plugins/Clist_modern/modern_skinengine.cpp index 8f2911c8e9..e1e2b8f214 100644 --- a/plugins/Clist_modern/modern_skinengine.cpp +++ b/plugins/Clist_modern/modern_skinengine.cpp @@ -499,7 +499,7 @@ HRESULT SkinEngineLoadModule() CreateServiceFunction(MS_DRAW_TEXT_WITH_EFFECT,ske_Service_DrawTextWithEffect);
//create event handle
- hSkinLoadedEvent = ModernHookEvent(ME_SKIN_SERVICESCREATED,CLUI_OnSkinLoad);
+ hSkinLoadedEvent = HookEvent(ME_SKIN_SERVICESCREATED,CLUI_OnSkinLoad);
NotifyEventHooks(g_CluiData.hEventSkinServicesCreated,0,0);
return S_OK;
}
@@ -507,7 +507,6 @@ HRESULT SkinEngineLoadModule() int SkinEngineUnloadModule()
{
//unload services
- ModernUnhookEvent(hSkinLoadedEvent);
ModernSkinButtonUnloadModule(0,0);
ske_UnloadSkin(&g_SkinObjectList);
@@ -537,8 +536,6 @@ int SkinEngineUnloadModule() }
DeleteCriticalSection(&cs_SkinChanging);
GdiFlush();
- DestroyServiceFunction((HANDLE)MS_SKIN_REGISTEROBJECT);
- DestroyServiceFunction((HANDLE)MS_SKIN_DRAWGLYPH);
DestroyHookableEvent(g_CluiData.hEventSkinServicesCreated);
if (hImageDecoderModule) FreeLibrary(hImageDecoderModule);
AniAva_UnloadModule();
@@ -557,7 +554,7 @@ BOOL ske_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest return BitBlt(hdcDest,nXOriginDest,nYOriginDest,nWidthDest,nHeightDest,hdcSrc,nXOriginSrc,nYOriginSrc, SRCCOPY);
}
- if (!g_CluiData.fGDIPlusFail && blendFunction.BlendFlags&128 ) //Use gdi+ engine
+ if ( !g_CluiData.fGDIPlusFail && blendFunction.BlendFlags&128 ) //Use gdi+ engine
{
return GDIPlus_AlphaBlend( hdcDest,nXOriginDest,nYOriginDest,nWidthDest,nHeightDest,
hdcSrc,nXOriginSrc,nYOriginSrc,nWidthSrc,nHeightSrc,
@@ -625,7 +622,7 @@ HDC ske_RequestBufferDC(HDC hdcOwner, int dcID, int width, int height, BOOL fCle buf.nUsageID = dcID;
buf.hDC = NULL;
pBuf = (DCBUFFER*)List_Find(BufferList,(void*)&buf);
- if (!pBuf)
+ if ( !pBuf)
{
//if not found - allocate it
pBuf = (DCBUFFER *)mir_alloc(sizeof(DCBUFFER));
@@ -728,7 +725,7 @@ BOOL ske_SetRectOpaque(HDC memdc,RECT *fr, BOOL force) if ( bmp.bmPlanes != 1 )
return FALSE;
- if (!bmp.bmBits)
+ if ( !bmp.bmBits)
{
f = 1;
bits = (BYTE*)malloc(bmp.bmWidthBytes*bmp.bmHeight);
@@ -829,7 +826,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * //SetStretchBltMode(mem2dc, HALFTONE);
mem2bmp = ske_CreateDIB32(wr.right-wr.left, rGlyph->bottom-rGlyph->top);
oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp);
- if (!oldbmp)
+ if ( !oldbmp)
return 0;
/// draw here
@@ -932,7 +929,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * mem2bmp = ske_CreateDIB32(w,h);
oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp);
- if (!oldbmp)
+ if ( !oldbmp)
return 0;
/// draw here
{
@@ -1021,7 +1018,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * h = wr.bottom-wr.top;
oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp);
#ifdef _DEBUG
- if (!oldbmp)
+ if ( !oldbmp)
(NULL,"Tile bitmap not selected","ERROR", MB_OK);
#endif
/// draw here
@@ -1158,7 +1155,7 @@ HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits) HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque)
{
- if (!g_pCachedWindow)
+ if ( !g_pCachedWindow)
return NULL;
RGBQUAD * buf = (RGBQUAD *) g_pCachedWindow->hImageDIBByte;
@@ -1231,7 +1228,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) int depth = 0;
int mode = 0; //0-FastDraw, 1-DirectAlphaDraw, 2-BufferedAlphaDraw
- if (!(preq && pobj)) return -1;
+ if ( !(preq && pobj)) return -1;
if ((!pobj->hGlyph || pobj->hGlyph == (HBITMAP)-1) && ((pobj->Style&7) == ST_IMAGE || (pobj->Style&7) == ST_FRAGMENT || (pobj->Style&7) == ST_SOLARIZE)) return 0;
// Determine painting mode
depth = GetDeviceCaps(preq->hDC,BITSPIXEL);
@@ -1273,7 +1270,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) if (pobj->hGlyph && pobj->hGlyph != (HBITMAP)-1)
{
glyphdc = CreateCompatibleDC(preq->hDC);
- if (!oldglyph)
+ if ( !oldglyph)
oldglyph = (HBITMAP)SelectObject(glyphdc,pobj->hGlyph);
else
SelectObject(glyphdc,pobj->hGlyph);
@@ -1538,7 +1535,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) for (i=0; i < pobj->plTextList->realCount; i++)
{
GLYPHTEXT * gt = (GLYPHTEXT *)pobj->plTextList->items[i];
- if (!gt->hFont)
+ if ( !gt->hFont)
{
if (gl_plSkinFonts && gl_plSkinFonts->realCount>0)
{
@@ -1554,7 +1551,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) }
}
}
- if (!gt->hFont) gt->hFont = (HFONT)-1;
+ if ( !gt->hFont) gt->hFont = (HFONT)-1;
}
if (gt->hFont != (HFONT)-1)
{
@@ -1594,12 +1591,12 @@ int ske_AddDescriptorToSkinObjectList (LPSKINOBJECTDESCRIPTOR lpDescr, SKINOBJEC {
SKINOBJECTSLIST *sk;
if (Skin) sk = Skin; else sk = &g_SkinObjectList;
- if (!sk) return 0;
+ if ( !sk) return 0;
if (mir_bool_strcmpi(lpDescr->szObjectID,"_HEADER_")) return 0;
{//check if new object allready presents.
DWORD i=0;
for (i=0; i < sk->dwObjLPAlocated;i++)
- if (!mir_strcmp(sk->pObjects[i].szObjectID,lpDescr->szObjectID)) return 0;
+ if ( !mir_strcmp(sk->pObjects[i].szObjectID,lpDescr->szObjectID)) return 0;
}
if (sk->dwObjLPAlocated+1>sk->dwObjLPReserved)
{ // Realocated list to add space for new object
@@ -1654,7 +1651,7 @@ static LPSKINOBJECTDESCRIPTOR ske_FindObjectByMask(MODERNMASK * pModernMask, BYT // DWORD i;
SKINOBJECTSLIST* sk;
sk = (Skin == NULL)?(&g_SkinObjectList):Skin;
- if (!sk->pMaskList) return NULL;
+ if ( !sk->pMaskList) return NULL;
return skin_FindObjectByMask(pModernMask,sk->pMaskList);
}
@@ -1667,7 +1664,7 @@ LPSKINOBJECTDESCRIPTOR ske_FindObjectByName(const char * szName, BYTE objType, S {
if (sk->pObjects[i].bType == objType || objType == OT_ANY)
{
- if (!mir_strcmp(sk->pObjects[i].szObjectID,szName))
+ if ( !mir_strcmp(sk->pObjects[i].szObjectID,szName))
return &(sk->pObjects[i]);
}
}
@@ -1685,7 +1682,7 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam,LPARAM lParam) LPSKINDRAWREQUEST preq;
LPSKINOBJECTDESCRIPTOR pgl;
LPGLYPHOBJECT gl;
- if (!wParam) return -1;
+ if ( !wParam) return -1;
ske_LockSkin();
__try
{
@@ -1777,7 +1774,7 @@ int ske_GetFullFilename(char * buf, char *file, char * skinfolder,BOOL madeAbsol {
char b2[MAX_PATH] = {0};
char *SkinPlace = db_get_sa(NULL,SKIN,"SkinFolder");
- if (!SkinPlace) SkinPlace = mir_strdup("\\Skin\\default");
+ if ( !SkinPlace) SkinPlace = mir_strdup("\\Skin\\default");
if (file[0] != '\\' && file[1] != ':')
_snprintf(b2, MAX_PATH,"%s\\%s",(skinfolder == NULL)?SkinPlace:((INT_PTR)skinfolder != -1)?skinfolder:"",file);
else
@@ -1797,7 +1794,7 @@ int ske_GetFullFilename(char * buf, char *file, char * skinfolder,BOOL madeAbsol static HBITMAP ske_skinLoadGlyphImage(char * szFileName)
{
- if (!g_CluiData.fGDIPlusFail && !wildcmpi(szFileName,"*.tga"))
+ if ( !g_CluiData.fGDIPlusFail && !wildcmpi(szFileName,"*.tga"))
return GDIPlus_LoadGlyphImage(szFileName);
else
return ske_LoadGlyphImageByDecoders(szFileName);
@@ -1815,7 +1812,7 @@ static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DW FILE * fp = !fromSize?(FILE*)From:NULL;
DWORD destCount = 0;
DWORD fromCount = 0;
- if (!RLE)
+ if ( !RLE)
{
while (((from && fromCount < fromSize) || (fp && fromCount < bufSize))
&& (destCount < bufSize))
@@ -1884,13 +1881,13 @@ static HBITMAP ske_LoadGlyphImage_TGA(char * szFilename) int cx = 0,cy = 0;
BOOL err = FALSE;
tga_header_t header;
- if (!szFilename) return NULL;
- if (!wildcmpi(szFilename,"*\\*%.tga"))
+ if ( !szFilename) return NULL;
+ if ( !wildcmpi(szFilename,"*\\*%.tga"))
{
//Loading TGA image from file
FILE *fp;
fp = fopen (szFilename, "rb");
- if (!fp)
+ if ( !fp)
{
TRACEVAR("error: couldn't open \"%s\"!\n", szFilename);
return NULL;
@@ -1923,9 +1920,9 @@ static HBITMAP ske_LoadGlyphImage_TGA(char * szFilename) BYTE * mem;
HGLOBAL hRes;
HRSRC hRSrc = FindResourceA(g_hInst,MAKEINTRESOURCEA(IDR_TGA_DEFAULT_SKIN),"TGA");
- if (!hRSrc) return NULL;
+ if ( !hRSrc) return NULL;
hRes = LoadResource(g_hInst,hRSrc);
- if (!hRes) return NULL;
+ if ( !hRes) return NULL;
size = SizeofResource(g_hInst,hRSrc);
mem = (BYTE*) LockResource(hRes);
if (size>sizeof(header))
@@ -2033,7 +2030,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(char * szFileName) l = mir_strlen(szFileName);
memmove(ext,szFileName +(l-4),5);
}
- if (!strchr(szFileName,'%') && !PathFileExistsA(szFileName)) return NULL;
+ if ( !strchr(szFileName,'%') && !PathFileExistsA(szFileName)) return NULL;
if (mir_bool_strcmpi(ext,".tga"))
{
hBitmap = ske_LoadGlyphImage_TGA(szFileName);
@@ -2054,7 +2051,7 @@ static HBITMAP ske_LoadGlyphImageByDecoders(char * szFileName) {
f = 1;
ImgNewDecoder(&m_pImgDecoder);
- if (!ImgNewDIBFromFile(m_pImgDecoder, szFileName, &pImg))
+ if ( !ImgNewDIBFromFile(m_pImgDecoder, szFileName, &pImg))
{
ImgGetHandle(pImg, &hBitmap, (LPVOID *)&pBitmapBits);
ImgDeleteDecoder(m_pImgDecoder);
@@ -2255,7 +2252,7 @@ static void RegisterMaskByParce(const char * szSetting, char * szValue, SKINOBJE static int ske_ProcessLoadindString(const char * szSetting, char *szValue)
{
- if (!pCurrentSkin) return 0;
+ if ( !pCurrentSkin) return 0;
if (szSetting[0] == '$')
RegisterObjectByParce((char *)szSetting, szValue);
else if (szSetting[0] == '#')
@@ -2313,7 +2310,7 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST * pObjectList) globj = (GLYPHOBJECT*)lpobj->Data;
if (globj)
{
- if (!globj->plTextList)
+ if ( !globj->plTextList)
{
globj->plTextList = List_Create(0,1);
globj->plTextList->sortFunc = ske_SortTextGlyphObjectFunc;
@@ -2363,7 +2360,7 @@ static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin) Skin->pMaskList = (LISTMODERNMASK*)mir_alloc(sizeof(LISTMODERNMASK));
memset(Skin->pMaskList,0,sizeof(LISTMODERNMASK));
Skin->szSkinPlace = db_get_sa(NULL,SKIN,"SkinFolder");
- if (!Skin->szSkinPlace || (strchr(Skin->szSkinPlace, '%') && !db_get_b(NULL,SKIN,"Modified",0)))
+ if ( !Skin->szSkinPlace || (strchr(Skin->szSkinPlace, '%') && !db_get_b(NULL,SKIN,"Modified",0)))
{
BOOL bOnlyObjects = FALSE;
if (Skin->szSkinPlace && strchr(Skin->szSkinPlace, '%'))
@@ -2486,7 +2483,7 @@ BOOL ske_TextOut(HDC hdc, int x, int y, LPCTSTR lpString, int nCount) int ta;
SIZE sz;
RECT rc = {0};
- if (!g_CluiData.fGDIPlusFail && 0) ///text via gdi+
+ if ( !g_CluiData.fGDIPlusFail && 0) ///text via gdi+
{
TextOutWithGDIp(hdc,x,y,lpString,nCount);
return 0;
@@ -2505,7 +2502,7 @@ BOOL ske_TextOut(HDC hdc, int x, int y, LPCTSTR lpString, int nCount) static INT_PTR ske_Service_AlphaTextOut(WPARAM wParam,LPARAM lParam)
{
- if (!wParam) return 0;
+ if ( !wParam) return 0;
{
AlphaTextOutParams ap = *(AlphaTextOutParams*)wParam;
return ske_AlphaTextOut(ap.hDC,ap.lpString,ap.nCount,ap.lpRect,ap.format,ap.ARGBcolor);
@@ -2538,7 +2535,7 @@ static void ske_SetTextEffect(BYTE EffectID, DWORD FirstColor, DWORD SecondColor BOOL ske_ResetTextEffect(HDC hdc)
{
int i;
- if (!pEffectStack || !pEffectStack->realCount) return TRUE;
+ if ( !pEffectStack || !pEffectStack->realCount) return TRUE;
for (i=0; i < pEffectStack->realCount; i++)
if (pEffectStack->items[i] && ((EFFECTSSTACKITEM*)(pEffectStack->items[i]))->hdc == hdc)
{
@@ -2554,7 +2551,7 @@ BOOL ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD Second {
if (EffectID>MAXPREDEFINEDEFFECTS) return 0;
if (EffectID == -1) return ske_ResetTextEffect(hdc);
- if (!pEffectStack)
+ if ( !pEffectStack)
{
pEffectStack = List_Create(0,1);
}
@@ -2585,8 +2582,8 @@ BOOL ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD Second static BOOL ske_GetTextEffect(HDC hdc, MODERNEFFECT * modernEffect)
{
int i=0;
- if (!pEffectStack || !pEffectStack->realCount) return FALSE;
- if (!modernEffect) return FALSE;
+ if ( !pEffectStack || !pEffectStack->realCount) return FALSE;
+ if ( !modernEffect) return FALSE;
for (i=0; i < pEffectStack->realCount; i++)
if (pEffectStack->items[i] && ((EFFECTSSTACKITEM*)(pEffectStack->items[i]))->hdc == hdc)
{
@@ -2621,8 +2618,8 @@ static BOOL ske_DrawTextEffect(BYTE* destPt,BYTE* maskPt, DWORD width, DWORD hei int minY = height;
int maxY = 0;
if (effect->EffectID == 0xFF) return FALSE;
- if (!width || ! height) return FALSE;
- if (!destPt) return FALSE;
+ if ( !width || ! height) return FALSE;
+ if ( !destPt) return FALSE;
buf = (sbyte*)malloc(width*height*sizeof(BYTE));
{
matrix = effect->EffectMatrix.matrix;
@@ -3071,7 +3068,7 @@ BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT * lpRect, UINT for return DrawText(hdc,lpString,nCount,lpRect,format&~DT_FORCENATIVERENDER);
form = format;
color = GetTextColor(hdc);
- if (!g_CluiData.fGDIPlusFail && 0) ///text via gdi+
+ if ( !g_CluiData.fGDIPlusFail && 0) ///text via gdi+
{
TextOutWithGDIp(hdc,lpRect->left,lpRect->top,lpString,nCount);
return 0;
@@ -3098,7 +3095,7 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i, UINT fStyle) {
BYTE * bits = NULL;
bits = (BYTE*)bm.bmBits;
- if (!bits)
+ if ( !bits)
{
bits = (BYTE*)malloc(bm.bmWidthBytes*bm.bmHeight);
GetBitmapBits(imi.hbmImage,bm.bmWidthBytes*bm.bmHeight,bits);
@@ -3137,7 +3134,7 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i, UINT fStyle) bcbits += bm.bmWidthBytes;
}
}
- if (!bm.bmBits)
+ if ( !bm.bmBits)
{
SetBitmapBits(imi.hbmImage,bm.bmWidthBytes*bm.bmHeight,bits);
free(bits);
@@ -3183,7 +3180,7 @@ BOOL ske_ImageList_DrawEx( HIMAGELIST himl,int i,HDC hdcDst,int x,int y,int dx,i static INT_PTR ske_Service_DrawIconEx(WPARAM wParam,LPARAM lParam)
{
DrawIconFixParam *p = (DrawIconFixParam*)wParam;
- if (!p) return 0;
+ if ( !p) return 0;
return ske_DrawIconEx(p->hdc,p->xLeft,p->yTop,p->hIcon,p->cxWidth,p->cyWidth,p->istepIfAniCur,p->hbrFlickerFreeDraw,p->diFlags);
}
@@ -3215,7 +3212,7 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy if ( g_CluiData.fDisableSkinEngine && !(diFlags&0x80))
return DrawIconEx(hdcDst,xLeft,yTop,hIcon,cxWidth,cyWidth,istepIfAniCur,hbrFlickerFreeDraw,diFlags&0xFFFF7F);
- if (!GetIconInfo(hIcon,&ici)) return 0;
+ if ( !GetIconInfo(hIcon,&ici)) return 0;
GetObject(ici.hbmColor,sizeof(BITMAP),&imbt);
if (imbt.bmWidth*imbt.bmHeight == 0)
@@ -3325,7 +3322,7 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy mask = ((1 << (7-x%8))&(*(t3+(x>>3)))) != 0;
if (mask)// && !hasalpha)
{
- if (!hasalpha)
+ if ( !hasalpha)
{ *dest = 0; continue; }
else
{
@@ -3337,7 +3334,7 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy }
else if (hasalpha || hasmask)
a = (((BYTE*)src)[3]>0?((BYTE*)src)[3]:255);
- else if (!hasalpha && !hasmask)
+ else if ( !hasalpha && !hasmask)
a = 255;
else { *dest = 0; continue; }
}
@@ -3414,11 +3411,11 @@ static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam) FRAMEWND *frm;
BOOL NoCancelPost = 0;
BOOL IsAnyQueued = 0;
- if (!g_CluiData.mutexOnEdgeSizing)
+ if ( !g_CluiData.mutexOnEdgeSizing)
GetWindowRect(pcli->hwndContactList,&wnd);
else
wnd = g_rcEdgeSizingRect;
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
RedrawWindow((HWND)wParam,NULL,NULL,RDW_UPDATENOW|RDW_ERASE|RDW_INVALIDATE|RDW_FRAME);
return 0;
@@ -3430,7 +3427,7 @@ static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam) {
// TO BE LOCKED OR PROXIED
frm = FindFrameByItsHWND((HWND)wParam);
- if (!frm) ske_ValidateFrameImageProc(&wnd);
+ if ( !frm) ske_ValidateFrameImageProc(&wnd);
// Validate frame, update window image and remove it from queue
else
{
@@ -3466,7 +3463,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) {
FRAMEWND *frm = FindFrameByItsHWND((HWND)wParam);
sPaintRequest * pr = (sPaintRequest*)lParam;
- if (!g_CluiData.fLayered || (frm && frm->floating)) return InvalidateRect((HWND)wParam,pr?(RECT*)&(pr->rcUpdate):NULL,FALSE);
+ if ( !g_CluiData.fLayered || (frm && frm->floating)) return InvalidateRect((HWND)wParam,pr?(RECT*)&(pr->rcUpdate):NULL,FALSE);
if (frm)
{
if (frm->PaintCallbackProc != NULL)
@@ -3476,7 +3473,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) if (pr)
{
HRGN r2;
- if (!IsRectEmpty(&pr->rcUpdate))
+ if ( !IsRectEmpty(&pr->rcUpdate))
{
RECT rcClient;
RECT rcUpdate;
@@ -3492,7 +3489,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) GetClientRect(frm->hWnd,&r);
r2 = CreateRectRgn(r.left,r.top,r.right,r.bottom);
}
- if (!frm->UpdateRgn)
+ if ( !frm->UpdateRgn)
{
frm->UpdateRgn = CreateRectRgn(0,0,1,1);
CombineRgn(frm->UpdateRgn,r2,0,RGN_COPY);
@@ -3510,7 +3507,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) }
else
Sync( QueueAllFramesUpdating , (BYTE)1 );
- if (!flag_bUpdateQueued || g_flag_bPostWasCanceled)
+ if ( !flag_bUpdateQueued || g_flag_bPostWasCanceled)
if (PostMessage(pcli->hwndContactList,UM_UPDATE,0,0))
{
flag_bUpdateQueued = 1;
@@ -3522,7 +3519,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) // Calling frame paint proc
{
- if (!g_pCachedWindow) { TRACE("ske_ValidateSingleFrameImage calling without cached\n"); return 0;}
+ if ( !g_pCachedWindow) { TRACE("ske_ValidateSingleFrameImage calling without cached\n"); return 0;}
if (Frame->hWnd == (HWND)-1 && !Frame->PaintCallbackProc) { TRACE("ske_ValidateSingleFrameImage calling without FrameProc\n"); return 0;}
{ // if ok update image
HDC hdc;
@@ -3574,7 +3571,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) if (ru.right>rc.right) ru.right = rc.right;
if (ru.bottom>rc.bottom) ru.bottom = rc.bottom;
}
- if (!IsRectEmpty(&ru))
+ if ( !IsRectEmpty(&ru))
{
x1 = ru.left;
y1 = ru.top;
@@ -3601,7 +3598,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) GetClientRect(Frame->hWnd,&r);
rgnUpdate = CreateRectRgn(r.left,r.top,r.right,r.bottom);
ru = r;
- if (!IsRectEmpty(&ru))
+ if ( !IsRectEmpty(&ru))
{
x1 = ru.left;
y1 = ru.top;
@@ -3626,7 +3623,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) DeleteObject(Frame->UpdateRgn);
Frame->UpdateRgn = 0;
}
- if (!IsRectEmpty(&ru))
+ if ( !IsRectEmpty(&ru))
{
x1 = ru.left;
y1 = ru.top;
@@ -3635,7 +3632,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) }
else
{x1 = 0; y1 = 0; w1 = w; h1 = h;}
- /* if (!SkipBkgBlitting)
+ /* if ( !SkipBkgBlitting)
{
BitBlt(g_pCachedWindow->hImageDC,x+x1,y+y1,w1,h1,g_pCachedWindow->hBackDC,x+x1,y+y1,SRCCOPY);
}
@@ -3790,7 +3787,7 @@ int ske_DrawNonFramedObjects(BOOL Erase,RECT *r) RECT w,wnd;
if (r) w = *r;
else CLUI_SizingGetWindowRect(pcli->hwndContactList,&w);
- if (!g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE,0);
+ if ( !g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE,0);
if (g_pCachedWindow == NULL)
return ske_ValidateFrameImageProc(&w);
@@ -3892,7 +3889,7 @@ int ske_ValidateFrameImageProc(RECT * r) // Calli g_mutex_bLockUpdating = 1;
ModernSkinButtonRedrawAll(0);
g_mutex_bLockUpdating = 0;
- if (!mutex_bLockUpdate) ske_UpdateWindowImageRect(&wnd);
+ if ( !mutex_bLockUpdate) ske_UpdateWindowImageRect(&wnd);
//-- Clear queue
{
Sync( QueueAllFramesUpdating, (BYTE)0 );
@@ -3925,7 +3922,7 @@ int ske_UpdateWindowImageRect(RECT * r) // U //else Update using current alpha
RECT wnd = *r;
- if (!g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE,0);
+ if ( !g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE,0);
if (g_pCachedWindow == NULL) return ske_ValidateFrameImageProc(&wnd);
if (g_pCachedWindow->Width != wnd.right-wnd.left || g_pCachedWindow->Height != wnd.bottom-wnd.top) return ske_ValidateFrameImageProc(&wnd);
if (g_flag_bFullRepaint)
@@ -3944,11 +3941,11 @@ void ske_ApplyTransluency() BOOL layered = (GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED)?TRUE:FALSE;
IsTransparancy = g_CluiData.fSmoothAnimation || g_bTransparentFlag;
- if (!g_bTransparentFlag && !g_CluiData.fSmoothAnimation && g_CluiData.bCurrentAlpha != 0)
+ if ( !g_bTransparentFlag && !g_CluiData.fSmoothAnimation && g_CluiData.bCurrentAlpha != 0)
g_CluiData.bCurrentAlpha = 255;
- if (!g_CluiData.fLayered && (/*(g_CluiData.bCurrentAlpha == 255) || */(g_proc_SetLayeredWindowAttributesNew && IsTransparancy)))
+ if ( !g_CluiData.fLayered && (/*(g_CluiData.bCurrentAlpha == 255) || */(g_proc_SetLayeredWindowAttributesNew && IsTransparancy)))
{
- if (!layered) SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
+ if ( !layered) SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
if (g_proc_SetLayeredWindowAttributesNew) g_proc_SetLayeredWindowAttributesNew(hwnd, RGB(0,0,0), (BYTE)g_CluiData.bCurrentAlpha, LWA_ALPHA);
}
@@ -3959,7 +3956,7 @@ void ske_ApplyTransluency() int ske_JustUpdateWindowImage()
{
RECT r;
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
ske_ApplyTransluency();
return 0;
@@ -3978,12 +3975,12 @@ int ske_JustUpdateWindowImageRect(RECT * rty) RECT rect;
SIZE sz = {0};
- if (!g_CluiData.fLayered)
+ if ( !g_CluiData.fLayered)
{
ske_ApplyTransluency();
return 0;
}
- if (!pcli->hwndContactList) return 0;
+ if ( !pcli->hwndContactList) return 0;
rect = wnd;
dest.x = rect.left;
dest.y = rect.top;
@@ -3991,7 +3988,7 @@ int ske_JustUpdateWindowImageRect(RECT * rty) sz.cy = rect.bottom-rect.top;
if (g_proc_UpdateLayeredWindow && g_CluiData.fLayered)
{
- if (!(GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE)&WS_EX_LAYERED))
+ if ( !(GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE)&WS_EX_LAYERED))
SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) |WS_EX_LAYERED);
Sync( SetAlpha, g_CluiData.bCurrentAlpha );
@@ -4008,7 +4005,7 @@ int ske_DrawImageAt(HDC hdc, RECT *rc) BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
BitBlt(g_pCachedWindow->hImageDC,rc->left,rc->top,rc->right-rc->left,rc->bottom-rc->top,g_pCachedWindow->hBackDC,rc->left,rc->top,SRCCOPY);
ske_AlphaBlend(g_pCachedWindow->hImageDC,rc->left,rc->top,rc->right-rc->left,rc->bottom-rc->top,hdc,0,0,rc->right-rc->left,rc->bottom-rc->top,bf);
- if (!g_mutex_bLockUpdating)
+ if ( !g_mutex_bLockUpdating)
ske_UpdateWindowImage();
return 0;
}
@@ -4056,8 +4053,8 @@ static TCHAR *ske_ReAppend(TCHAR *lfirst, TCHAR * lsecond, int len) TCHAR* ske_ReplaceVar(TCHAR *var)
{
- if (!var) return mir_tstrdup(_T(""));
- if (!lstrcmpi(var,_T("Profile")))
+ if ( !var) return mir_tstrdup(_T(""));
+ if ( !lstrcmpi(var,_T("Profile")))
{
char buf[MAX_PATH] = {0};
CallService(MS_DB_GETPROFILENAME,(WPARAM)MAX_PATH,(LPARAM)buf);
@@ -4147,7 +4144,7 @@ static void OLDske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineS {
GLYPHTEXT * glText;
- if (!globj->plTextList)
+ if ( !globj->plTextList)
{
globj->plTextList = List_Create(0,1);
globj->plTextList->sortFunc = ske_SortTextGlyphObjectFunc;
@@ -4217,7 +4214,7 @@ static void ske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineStri glText->stValueText = mir_a2u(GetParamN(szDefineString,buf,sizeof(buf),9,',',TRUE));
glText->stText = ske_ParseText(glText->stValueText);
- if (!Skin->pTextList)
+ if ( !Skin->pTextList)
Skin->pTextList = List_Create(0,1);
List_InsertPtr(Skin->pTextList,glText);
}
@@ -4266,7 +4263,7 @@ static void ske_AddParseSkinFont(char * szFontID,char * szDefineString,SKINOBJEC if (sf->hFont)
{
sf->szFontID = mir_strdup(szFontID);
- if (!gl_plSkinFonts)
+ if ( !gl_plSkinFonts)
gl_plSkinFonts = List_Create(0,1);
if (gl_plSkinFonts)
{
@@ -4292,7 +4289,7 @@ ICONINFO iciTop = {0}; BITMAP bmp = {0};
SIZE sz = {0};
{
-if (!GetIconInfo(hBottom,&iciBottom)) return NULL;
+if ( !GetIconInfo(hBottom,&iciBottom)) return NULL;
GetObject(iciBottom.hbmColor,sizeof(BITMAP),&bmp);
sz.cx = bmp.bmWidth; sz.cy = bmp.bmHeight;
if (iciBottom.hbmColor) DeleteObject(iciBottom.hbmColor);
@@ -4313,7 +4310,7 @@ iNew.fIcon = TRUE; iNew.hbmColor = nImage;
iNew.hbmMask = nMask;
res = CreateIconIndirect(&iNew);
-if (!res)
+if ( !res)
TRACE_ERROR();
DeleteObject(nImage);
DeleteObject(nMask);
@@ -4512,12 +4509,12 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) if (topHasMask)
{
if (mask_t == 1 && !topHasAlpha ) top_d &= 0xFFFFFF;
- else if (!topHasAlpha) top_d |= 0xFF000000;
+ else if ( !topHasAlpha) top_d |= 0xFF000000;
}
if (bottomHasMask)
{
if (mask_b == 1 && !bottomHasAlpha) bottom_d &= 0xFFFFFF;
- else if (!bottomHasAlpha) bottom_d |= 0xFF000000;
+ else if ( !bottomHasAlpha) bottom_d |= 0xFF000000;
}
((DWORD*)db)[x] = ske_Blend(bottom_d,top_d,alpha);
}
@@ -4528,10 +4525,10 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) db += vstep_d;
}
}
- if (!bmp_bottom.bmBits) free(BottomBuffer);
- if (!bmp_top.bmBits) free(TopBuffer);
- if (!bmp_bottom_mask.bmBits) free(BottomMaskBuffer);
- if (!bmp_top_mask.bmBits) free(TopMaskBuffer);
+ if ( !bmp_bottom.bmBits) free(BottomBuffer);
+ if ( !bmp_top.bmBits) free(TopBuffer);
+ if ( !bmp_bottom_mask.bmBits) free(BottomMaskBuffer);
+ if ( !bmp_top_mask.bmBits) free(TopMaskBuffer);
}
else
{
@@ -4588,7 +4585,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) BOOL SkinDBGetContactSetting(HANDLE hContact, const char* szSection, const char*szKey, DBVARIANT * retdbv, BOOL * bSkined )
{
- if (!hContact) { //only for not contact settings
+ if ( !hContact) { //only for not contact settings
char * szSkinKey;
NEWJOINEDSTR(szSkinKey,szSection,"@",szKey);
if ( !db_get(hContact, SKINSETSECTION, szSkinKey, retdbv)) {
@@ -4612,7 +4609,7 @@ BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const c return retVal;
} else {
db_free(&dbv);
- if (!bSkined) return db_get_b(hContact, szSection, szKey, bDefault);
+ if ( !bSkined) return db_get_b(hContact, szSection, szKey, bDefault);
}
}
return bDefault;
@@ -4629,7 +4626,7 @@ WORD SkinDBGetContactSettingWord(HANDLE hContact, const char* szSection, const c return retVal;
} else {
db_free(&dbv);
- if (!bSkined) return db_get_w(hContact, szSection, szKey, wDefault);
+ if ( !bSkined) return db_get_w(hContact, szSection, szKey, wDefault);
}
}
return wDefault;
@@ -4646,7 +4643,7 @@ DWORD SkinDBGetContactSettingDword(HANDLE hContact, const char* szSection, const return retVal;
} else {
db_free(&dbv);
- if (!bSkined) return db_get_dw(hContact, szSection, szKey, dwDefault);
+ if ( !bSkined) return db_get_dw(hContact, szSection, szKey, dwDefault);
}
}
return dwDefault;
diff --git a/plugins/Clist_modern/modern_skinopt.cpp b/plugins/Clist_modern/modern_skinopt.cpp index ef4b1532b8..bfd739edea 100644 --- a/plugins/Clist_modern/modern_skinopt.cpp +++ b/plugins/Clist_modern/modern_skinopt.cpp @@ -411,8 +411,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara }
else if ( nmtv->hdr.code == TVN_DELETEITEMA || nmtv->hdr.code == TVN_DELETEITEMW )
{
- if ( nmtv->itemOld.lParam )
- mir_free_and_nil( nmtv->itemOld.lParam );
+ mir_free_and_nil( nmtv->itemOld.lParam );
return 0;
}
break;
@@ -495,7 +494,7 @@ HTREEITEM FillAvailableSkinList( HWND hwndDlg ) CallService( MS_UTILS_PATHTOABSOLUTET, ( WPARAM )skinfile, ( LPARAM )skinfull );
res = AddSkinToListFullName( hwndDlg, skinfull );
- mir_free_and_nil( skinfile );
+ mir_free( skinfile );
}
}
return res;
@@ -658,7 +657,7 @@ HTREEITEM AddItemToTree( HWND hTree, TCHAR * folder, TCHAR * itemName, void * da }
else
{
- mir_free_and_nil( data ); //need to free otherwise memory leak
+ mir_free( data ); //need to free otherwise memory leak
return cItem;
}
return 0;
diff --git a/plugins/Clist_modern/modern_skinselector.cpp b/plugins/Clist_modern/modern_skinselector.cpp index 45f66d51bb..e0eb272f10 100644 --- a/plugins/Clist_modern/modern_skinselector.cpp +++ b/plugins/Clist_modern/modern_skinselector.cpp @@ -54,7 +54,7 @@ char * ModernMaskToString(MODERNMASK * mm, char * buf, UINT bufsize) int SkinSelector_DeleteMask(MODERNMASK * mm)
{
int i;
- if (!mm->pl_Params) return 0;
+ if ( !mm->pl_Params) return 0;
for (i=0;i < (int)mm->dwParamCnt;i++)
{
if (mm->pl_Params[i].szName) free(mm->pl_Params[i].szName);
@@ -130,7 +130,7 @@ BOOL __inline wildcmp(const char * name, const char * mask, BYTE option) BOOL MatchMask(char * name, char * mask)
{
- if (!mask || !name) return mask == name;
+ if ( !mask || !name) return mask == name;
if (*mask != '|') return wildcmpi(name,mask);
{
int s = 1,e = 1;
@@ -213,7 +213,7 @@ DWORD mod_CalcHash(const char * a) */
int AddModernMaskToList(MODERNMASK * mm, LISTMODERNMASK * mmTemplateList)
{
- if (!mmTemplateList || !mm) return -1;
+ if ( !mmTemplateList || !mm) return -1;
mmTemplateList->pl_Masks = (MODERNMASK *)mir_realloc(mmTemplateList->pl_Masks,sizeof(MODERNMASK)*(mmTemplateList->dwMaskCnt+1));
memmove(&(mmTemplateList->pl_Masks[mmTemplateList->dwMaskCnt]),mm,sizeof(MODERNMASK));
mmTemplateList->dwMaskCnt++;
@@ -223,8 +223,8 @@ int AddModernMaskToList(MODERNMASK * mm, LISTMODERNMASK * mmTemplateList) int ClearMaskList(LISTMODERNMASK * mmTemplateList)
{
int i;
- if (!mmTemplateList) return -1;
- if (!mmTemplateList->pl_Masks) return -1;
+ if ( !mmTemplateList) return -1;
+ if ( !mmTemplateList->pl_Masks) return -1;
for (i=0; i < (int)mmTemplateList->dwMaskCnt; i++)
SkinSelector_DeleteMask(&(mmTemplateList->pl_Masks[i]));
mir_free_and_nil(mmTemplateList->pl_Masks);
@@ -233,7 +233,7 @@ int ClearMaskList(LISTMODERNMASK * mmTemplateList) }
int DeleteMaskByItID(DWORD mID,LISTMODERNMASK * mmTemplateList)
{
- if (!mmTemplateList) return -1;
+ if ( !mmTemplateList) return -1;
if (mID < 0 || mID >= mmTemplateList->dwMaskCnt) return -1;
if (mmTemplateList->dwMaskCnt == 1)
{
@@ -264,7 +264,7 @@ int DeleteMaskByItID(DWORD mID,LISTMODERNMASK * mmTemplateList) int ExchangeMasksByID(DWORD mID1, DWORD mID2, LISTMODERNMASK * mmTemplateList)
{
- if (!mmTemplateList) return 0;
+ if ( !mmTemplateList) return 0;
if (mID1 < 0 || mID1 >= mmTemplateList->dwMaskCnt) return 0;
if (mID2 < 0 || mID2 >= mmTemplateList->dwMaskCnt) return 0;
if (mID1 == mID2) return 0;
@@ -406,7 +406,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len int ParseToModernMask(MODERNMASK * mm, char * szText)
{
- if (!mm || !szText) return -1;
+ if ( !mm || !szText) return -1;
unsigned int textLen = mir_strlen(szText);
BYTE curParam = 0;
@@ -494,7 +494,7 @@ BOOL CompareModernMask(MODERNMASK * mmValue,MODERNMASK * mmTemplate) }
pVal++;
}
- if (!((finded && !(p.bMaskParamFlag&MPF_DIFF)) || (!finded && (p.bMaskParamFlag&MPF_DIFF))))
+ if ( !((finded && !(p.bMaskParamFlag&MPF_DIFF)) || (!finded && (p.bMaskParamFlag&MPF_DIFF))))
{res = FALSE; break;}
pTemp++;
}
@@ -505,7 +505,7 @@ BOOL CompareStrWithModernMask(char * szValue,MODERNMASK * mmTemplate) {
MODERNMASK mmValue = {0};
int res;
- if (!ParseToModernMask(&mmValue, szValue))
+ if ( !ParseToModernMask(&mmValue, szValue))
{
res = CompareModernMask(&mmValue,mmTemplate);
SkinSelector_DeleteMask(&mmValue);
@@ -517,7 +517,7 @@ BOOL CompareStrWithModernMask(char * szValue,MODERNMASK * mmTemplate) //AddingMask
int AddStrModernMaskToList(DWORD maskID, char * szStr, char * objectName, LISTMODERNMASK * mmTemplateList, void * pObjectList)
{
- if (!szStr || !mmTemplateList) return -1;
+ if ( !szStr || !mmTemplateList) return -1;
MODERNMASK mm = {0};
if (ParseToModernMask(&mm,szStr)) return -1;
@@ -556,13 +556,13 @@ SKINOBJECTDESCRIPTOR * skin_FindObjectByRequest(char * szValue,LISTMODERNMASK * {
MODERNMASK mm = {0};
SKINOBJECTDESCRIPTOR * res = NULL;
- if (!mmTemplateList)
+ if ( !mmTemplateList)
if (g_SkinObjectList.pMaskList)
mmTemplateList = g_SkinObjectList.pMaskList;
else
return NULL;
- if (!mmTemplateList) return NULL;
+ if ( !mmTemplateList) return NULL;
ParseToModernMask(&mm,szValue);
res = skin_FindObjectByMask(&mm,mmTemplateList);
SkinSelector_DeleteMask(&mm);
@@ -671,7 +671,7 @@ int RegisterButtonByParce(char * ObjectName, char * Params) // Glyph,Image,Filename,(TileBoth|TileVert|TileHor|StretchBoth), < MarginLeft>, < MarginTop>, < MarginRight>, < MarginBottom>, < Alpha>
int RegisterObjectByParce(char * ObjectName, char * Params)
{
- if (!ObjectName || !Params) return 0;
+ if ( !ObjectName || !Params) return 0;
{
int res = 0;
SKINOBJECTDESCRIPTOR obj = {0};
@@ -758,7 +758,7 @@ int RegisterObjectByParce(char * ObjectName, char * Params) int SkinDrawGlyphMask(HDC hdc, RECT * rcSize, RECT * rcClip, MODERNMASK * ModernMask)
{
- if (!ModernMask) return 0;
+ if ( !ModernMask) return 0;
SKINDRAWREQUEST rq;
rq.hDC = hdc;
@@ -776,7 +776,7 @@ int __inline SkinDrawWindowBack(HWND hwndIn, HDC hdc, RECT * rcClip, char * obje RECT rc,r1;
HWND hwnd = (HWND)CallService(MS_CLUI_GETHWND,0,0);
- if (!objectID) return 0;
+ if ( !objectID) return 0;
GetWindowRect(hwndIn,&r1);
pt.x = r1.left;
pt.y = r1.top;
diff --git a/plugins/Clist_modern/modern_statusbar.cpp b/plugins/Clist_modern/modern_statusbar.cpp index 2a641ccca5..8c15eecc77 100644 --- a/plugins/Clist_modern/modern_statusbar.cpp +++ b/plugins/Clist_modern/modern_statusbar.cpp @@ -116,7 +116,7 @@ int LoadStatusBarData() DBVARIANT dbv;
g_StatusBarData.bkColour = sttGetColor("StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
g_StatusBarData.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -232,7 +232,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) vis = FALSE;
else
vis = pcli->pfnGetProtocolVisibility(accs[i]->szModuleName);
- if (!vis) continue;
+ if ( !vis) continue;
mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", accs[i]->szModuleName);
@@ -422,7 +422,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if (dbTitle && xstatus)
{
DBVARIANT dbv = {0};
- if (!DBGetContactSettingTString(NULL,ProtosData[i].AccountName,dbTitle,&dbv))
+ if ( !DBGetContactSettingTString(NULL,ProtosData[i].AccountName,dbTitle,&dbv))
{
ProtosData[i].ProtoXStatus = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
@@ -771,12 +771,11 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam mir_free(ProtosData[k].ProtoXStatus);
}
mir_free_and_nil(ProtosData);
- ProtosData = NULL;
allocedItemData = 0;
}
break;
case WM_SIZE:
- if (!g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList)
+ if ( !g_CluiData.fLayered || GetParent(hwnd) != pcli->hwndContactList)
InvalidateRect(hwnd,NULL,FALSE);
return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_ERASEBKGND:
@@ -1051,7 +1050,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam SetCapture( NULL );
return 0;
}
- if (!hMenu)
+ if ( !hMenu)
{
if (msg == WM_RBUTTONDOWN)
{
diff --git a/plugins/Clist_modern/modern_statusbar_options.cpp b/plugins/Clist_modern/modern_statusbar_options.cpp index 4f6c1072ce..7b9ac4b895 100644 --- a/plugins/Clist_modern/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/modern_statusbar_options.cpp @@ -114,7 +114,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) SendDlgItemMessage(hwndDlg,IDC_OFFSETSPIN_RIGHT,UDM_SETRANGE,0,MAKELONG(50,0));
SendDlgItemMessage(hwndDlg,IDC_OFFSETSPIN_RIGHT,UDM_SETPOS,0,MAKELONG(sbpo.PaddingRight,2));
- if (!sbpo.AccountIsCustomized)
+ if ( !sbpo.AccountIsCustomized)
UpdateXStatusIconOptions(hwndDlg, perProto, dat, curSelProto);
{
@@ -125,7 +125,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWXSTATUSNAME), enableOptions);
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWXSTATUS), enableOptions && enableIcons);
- if (!enableOptions) {
+ if ( !enableOptions) {
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWNORMAL), enableOptions && enableIcons);
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWBOTH), enableOptions && enableIcons );
EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), enableOptions && enableIcons);
@@ -143,7 +143,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg, IDC_OFFSETSPIN_RIGHT), enableOptions);
}
- if (!perProto || sbpo.AccountIsCustomized)
+ if ( !perProto || sbpo.AccountIsCustomized)
UpdateXStatusIconOptions(hwndDlg, perProto, dat, curSelProto);
}
diff --git a/plugins/Clist_modern/modern_tbbutton.cpp b/plugins/Clist_modern/modern_tbbutton.cpp index bdb09be349..1358cc179d 100644 --- a/plugins/Clist_modern/modern_tbbutton.cpp +++ b/plugins/Clist_modern/modern_tbbutton.cpp @@ -173,7 +173,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam lpSBData->pbState = 1;
InvalidateParentRect(lpSBData->hWnd, NULL, TRUE);
}
- if (!lpSBData->fSendOnDown)
+ if ( !lpSBData->fSendOnDown)
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
return 0;
}
@@ -235,9 +235,9 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam {
TOOLINFO ti;
- if (!(char*) wParam)
+ if ( !(char*) wParam)
break;
- if (!hwndToolTips)
+ if ( !hwndToolTips)
{
hwndToolTips = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, _T(""), WS_POPUP, 0, 0, 0, 0, NULL, NULL, GetModuleHandle(NULL), NULL);
SetWindowPos(hwndToolTips, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
@@ -373,7 +373,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam lpSBData->nStateId = PBS_NORMAL;
InvalidateParentRect(lpSBData->hWnd, NULL, TRUE);
}
- if (!lpSBData->fSendOnDown && lpSBData->fHotMark)
+ if ( !lpSBData->fSendOnDown && lpSBData->fHotMark)
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
lpSBData->fHotMark = FALSE;
break;
@@ -517,7 +517,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam }
case BM_SETIMAGE:
{
- if (!lParam)
+ if ( !lParam)
break;
if (wParam == IMAGE_ICON)
{
@@ -596,7 +596,7 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) POINT offset = {0};
if (pOffset) offset = *pOffset;
- if (!hdcPaint) return; //early exit
+ if ( !hdcPaint) return; //early exit
GetClientRect(lpSBData->hWnd, &rcClient);
width = rcClient.right - rcClient.left;
@@ -604,7 +604,7 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) hdcMem = pOffset?hdcPaint:CreateCompatibleDC(hdcPaint);
hOldFont = (HFONT)SelectObject(hdcMem, lpSBData->hFont);
- if (!pOffset)
+ if ( !pOffset)
{
hbmMem = ske_CreateDIB32(width, height);
hbmOld = (HBITMAP)SelectObject(hdcMem, hbmMem);
@@ -614,7 +614,7 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) OffsetRect(&rcClient,offset.x,offset.y);
}
{
- if (!g_CluiData.fDisableSkinEngine)
+ if ( !g_CluiData.fDisableSkinEngine)
{
char szRequest[128];
/* painting */
@@ -659,7 +659,7 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) oldBM = (HBITMAP)SelectObject ( dc, oldBM );
DeleteObject(memBM);
DeleteDC(dc);
- if (!ret) //WM_ERASEBKG return false need to paint
+ if ( !ret) //WM_ERASEBKG return false need to paint
{
HDC pdc = GetDC(hwndParent);
HBRUSH oldBrush = (HBRUSH)GetCurrentObject( pdc, OBJ_BRUSH );
@@ -696,7 +696,7 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) RECT rcText;
- if (!g_CluiData.fDisableSkinEngine)
+ if ( !g_CluiData.fDisableSkinEngine)
{
/* correct rect according to rcMargins */
@@ -762,14 +762,14 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) ske_DrawText(hdcMem, lpSBData->szText, -1, &rcText, (bCentered ? DT_CENTER: 0) | DT_VCENTER | DT_SINGLELINE);
ske_ResetTextEffect(hdcMem);
}
- if (!pOffset)
+ if ( !pOffset)
BitBlt(hdcPaint,0,0,width,height,hdcMem,0,0,SRCCOPY);
}
// better to use try/finally but looks like last one is Microsoft specific
SelectObject(hdcMem,hOldFont);
- if (!pOffset)
+ if ( !pOffset)
{
SelectObject(hdcMem,hbmOld);
DeleteObject(hbmMem);
@@ -797,15 +797,8 @@ HRESULT ToolbarButtonLoadModule() wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
hButtonWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
- hIconChangedHook = ModernHookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
- hBkgChangedHook = ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,Buttons_OnSkinModeSettingsChanged);
+ hIconChangedHook = HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
+ hBkgChangedHook = HookEvent(ME_BACKGROUNDCONFIG_CHANGED,Buttons_OnSkinModeSettingsChanged);
return S_OK;
}
-int ToolbarButtonUnloadModule(WPARAM wParam, LPARAM lParam)
-{
- ModernUnhookEvent(hBkgChangedHook);
- ModernUnhookEvent(hIconChangedHook);
- return 0;
-}
-
diff --git a/plugins/Clist_modern/modern_toolbar.cpp b/plugins/Clist_modern/modern_toolbar.cpp index b71d7208c6..914c084d36 100644 --- a/plugins/Clist_modern/modern_toolbar.cpp +++ b/plugins/Clist_modern/modern_toolbar.cpp @@ -38,7 +38,7 @@ COLORREF sttGetColor(char * module, char * color, COLORREF defColor); #define MIRANDATOOLBARCLASSNAME "MirandaToolBar"
-#define tbcheck if (!g_CluiData.hEventToolBarModuleLoaded) return
+#define tbcheck if ( !g_CluiData.hEventToolBarModuleLoaded) return
#define tblock EnterCriticalSection(&tbdat.cs)
#define tbunlock LeaveCriticalSection(&tbdat.cs)
@@ -172,8 +172,8 @@ static void delete_MTB_BUTTONINFO(void * input) HRESULT ToolbarLoadModule()
{
- tbdat.hehModulesLoaded = ModernHookEvent(ME_SYSTEM_MODULESLOADED, ehhToolbarModulesLoaded);
- tbdat.hehSystemShutdown = ModernHookEvent(ME_SYSTEM_SHUTDOWN, ehhToolBarSystemShutdown);
+ tbdat.hehModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ehhToolbarModulesLoaded);
+ tbdat.hehSystemShutdown = HookEvent(ME_SYSTEM_SHUTDOWN, ehhToolBarSystemShutdown);
{ //create window class
WNDCLASS wndclass = {0};
@@ -197,13 +197,13 @@ HRESULT ToolbarLoadModule() return S_OK;
}
-static int ehhToolbarModulesLoaded(WPARAM wParam, LPARAM lParam)
+static int ehhToolbarModulesLoaded(WPARAM wParam, LPARAM lParam)
{
CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"ToolBar Background/ToolBar",0);
- ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhToolBarBackgroundSettingsChanged);
- tbdat.hehOptInit = ModernHookEvent(ME_OPT_INITIALISE,ehhToolbarOptInit);
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhToolBarBackgroundSettingsChanged);
+ tbdat.hehOptInit = HookEvent(ME_OPT_INITIALISE,ehhToolbarOptInit);
ehhToolBarBackgroundSettingsChanged(0,0);
- tbdat.hehSettingsChanged = ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED, ehhToolBarSettingsChanged );
+ tbdat.hehSettingsChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ehhToolBarSettingsChanged );
tbdat.hToolBarWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
@@ -224,13 +224,9 @@ static int ehhToolbarModulesLoaded(WPARAM wParam, LPARAM lParam) return 0;
}
-static int ehhToolBarSystemShutdown(WPARAM wParam, LPARAM lParam)
+static int ehhToolBarSystemShutdown(WPARAM wParam, LPARAM lParam)
{
//Remove services;
- ModernUnhookEvent(tbdat.hehSettingsChanged);
- ModernUnhookEvent(tbdat.hehModulesLoaded);
- ModernUnhookEvent(tbdat.hehSystemShutdown);
- ModernUnhookEvent(tbdat.hehOptInit);
EnterCriticalSection(&tbdat.cs);
g_CluiData.hEventToolBarModuleLoaded = NULL;
@@ -242,27 +238,26 @@ static int ehhToolBarSystemShutdown(WPARAM wParam, LPARAM lParam) return 0;
}
-
-static int ehhToolBarSettingsChanged( WPARAM wParam, LPARAM lParam )
+static int ehhToolBarSettingsChanged( WPARAM wParam, LPARAM lParam )
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if ((HANDLE)wParam != NULL) return 0;
- if (!mir_strcmp(cws->szModule,"CList"))
+ if ( !mir_strcmp(cws->szModule,"CList"))
{
- if (!mir_strcmp(cws->szSetting,"HideOffline"))
+ if ( !mir_strcmp(cws->szSetting,"HideOffline"))
sttSetButtonPressed("ShowHideOffline", (BOOL) db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT));
- else if (!mir_strcmp(cws->szSetting,"UseGroups"))
+ else if ( !mir_strcmp(cws->szSetting,"UseGroups"))
sttSetButtonPressed( "UseGroups", (BOOL) db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
}
- else if (!mir_strcmp(cws->szModule,"Skin"))
+ else if ( !mir_strcmp(cws->szModule,"Skin"))
{
- if (!mir_strcmp(cws->szSetting,"UseSound"))
+ if ( !mir_strcmp(cws->szSetting,"UseSound"))
sttSetButtonPressed( "EnableSounds", (BOOL) db_get_b(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT ));
}
return 0;
}
-static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
+static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
{
if (tbdat.mtb_hBmpBackground)
{
@@ -274,7 +269,7 @@ static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
tbdat.mtb_bkColour = sttGetColor("ToolBar","BkColour",CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL,"ToolBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!DBGetContactSettingString(NULL,"ToolBar","BkBitmap",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"ToolBar","BkBitmap",&dbv)) {
tbdat.mtb_hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -308,7 +303,7 @@ static INT_PTR svcToolBarAddButton(WPARAM wParam, LPARAM lParam) DWORD dwOrder;
TBButton * bi = (TBButton *)lParam;
bVisible = (bi->tbbFlags&TBBF_VISIBLE ? TRUE : FALSE);
- if (!ServiceExists(bi->pszServiceName))
+ if ( !ServiceExists(bi->pszServiceName))
return 0;
tbcheck 0;
tblock;
@@ -366,8 +361,8 @@ static INT_PTR svcToolBarSetButtonStateById(WPARAM wParam, LPARAM lParam) static void sttTBButton2MTBBUTTONINFO(TBButton * bi, MTB_BUTTONINFO * mtbi)
{
// Convert TBButton struct to MTB_BUTTONINFO
- if (!bi || !mtbi) return;
- if (!(bi->tbbFlags&TBBF_ISSEPARATOR))
+ if ( !bi || !mtbi) return;
+ if ( !(bi->tbbFlags&TBBF_ISSEPARATOR))
{
mtbi->szButtonName = mir_strdup(bi->pszButtonName);
mtbi->szService = mir_strdup(bi->pszServiceName);
@@ -396,7 +391,7 @@ static void sttUpdateButtonState(MTB_BUTTONINFO * mtbi) SendMessage(mtbi->hWindow, BUTTONADDTOOLTIP, (WPARAM)((mtbi->bPushButton) ? mtbi->szTooltipPressed : mtbi->szTooltip), 0);
}
-static int sttSortButtons(const void * vmtbi1, const void * vmtbi2)
+static int sttSortButtons(const void * vmtbi1, const void * vmtbi2)
{
MTB_BUTTONINFO * mtbi1 = (MTB_BUTTONINFO *)*((MTB_BUTTONINFO ** )vmtbi1);
MTB_BUTTONINFO * mtbi2 = (MTB_BUTTONINFO *)*((MTB_BUTTONINFO ** )vmtbi2);
@@ -525,7 +520,7 @@ static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT * rect, MTBINFO * else
GetClientRect(hwnd,&rc);
- if (!(tbdat.mtb_backgroundBmpUse && tbdat.mtb_hBmpBackground) && tbdat.mtb_useWinColors)
+ if ( !(tbdat.mtb_backgroundBmpUse && tbdat.mtb_hBmpBackground) && tbdat.mtb_useWinColors)
{
if (xpt_IsThemed(pMTBInfo->mtbXPTheme))
{
@@ -537,7 +532,7 @@ static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT * rect, MTBINFO * FillRect(hdc, &rc, hbr);
}
}
- else if (!tbdat.mtb_hBmpBackground && !tbdat.mtb_useWinColors)
+ else if ( !tbdat.mtb_hBmpBackground && !tbdat.mtb_useWinColors)
{
hbr = CreateSolidBrush(tbdat.mtb_bkColour);
FillRect(hdc, &rc, hbr);
@@ -660,7 +655,7 @@ static int sttDBEnumProc (const char *szSetting,LPARAM lParam) {
if (szSetting == NULL) return 0;
- if (!strncmp(szSetting,"order_",6))
+ if ( !strncmp(szSetting,"order_",6))
db_unset(NULL, "ModernToolBar", szSetting);
return 0;
};
@@ -675,7 +670,7 @@ static void sttDeleteOrderSettings() static MTB_BUTTONINFO * ToolBar_AddButtonToBars(MTB_BUTTONINFO * mtbi)
{
int result = 0;
- if (!mtbi->bVisible) return 0;
+ if ( !mtbi->bVisible) return 0;
WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_ADDBUTTON, (WPARAM)mtbi, 0);
if (mtbi->hWindow)
sttUpdateButtonState( mtbi );
@@ -895,7 +890,7 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM //Adding button
MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO * )wParam;
HWND hwndButton = NULL;
- if (!(mtbi->bSeparator))
+ if ( !(mtbi->bSeparator))
hwndButton = CreateWindow(SKINBUTTONCLASS /*MIRANDABUTTONCLASS*/, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP , 0, 0, pMTBInfo->nButtonWidth, pMTBInfo->nButtonHeight,
hwnd, (HMENU) NULL, g_hInst, NULL);
mtbi->hWindow = hwndButton;
@@ -1242,7 +1237,7 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L }
case WM_MOUSEMOVE:
{
- if (!dragging) break;
+ if ( !dragging) break;
{
TVHITTESTINFO hti;
hti.pt.x = (short)LOWORD(lParam);
@@ -1255,7 +1250,7 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L HTREEITEM it = hti.hItem;
hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_BTNORDER))/2;
TreeView_HitTest(GetDlgItem(hwndDlg,IDC_BTNORDER),&hti);
- if (!(hti.flags&TVHT_ABOVE))
+ if ( !(hti.flags&TVHT_ABOVE))
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_BTNORDER),hti.hItem,1);
else
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_BTNORDER),it,0);
@@ -1271,7 +1266,7 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L break;
case WM_LBUTTONUP:
{
- if (!dragging) break;
+ if ( !dragging) break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_BTNORDER),NULL,0);
dragging = 0;
ReleaseCapture();
diff --git a/plugins/Clist_modern/modern_viewmodebar.cpp b/plugins/Clist_modern/modern_viewmodebar.cpp index e541ab5e2b..b681c01d6b 100644 --- a/plugins/Clist_modern/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/modern_viewmodebar.cpp @@ -682,8 +682,8 @@ void DeleteViewMode( char * szName ) mir_snprintf(szSetting, 256, "%c%s_SSM", 246, szName);
db_unset(NULL, CLVM_MODULE, szSetting);
db_unset(NULL, CLVM_MODULE, szName);
- if (!strcmp(g_CluiData.current_viewmode, szName) && lstrlenA(szName) == lstrlenA(g_CluiData.current_viewmode))
- {
+
+ if ( !strcmp(g_CluiData.current_viewmode, szName) && lstrlenA(szName) == lstrlenA(g_CluiData.current_viewmode)) {
g_CluiData.bFilterEffective = 0;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
SetWindowText(hwndSelector, TranslateT("All contacts"));
@@ -964,7 +964,8 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
hItem = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
if (hItem == NULL) break;
- if (!(hitFlags&CLCHT_ONITEMEXTRA))
+
+ if ( !(hitFlags&CLCHT_ONITEMEXTRA))
break;
iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
if (iImage == nullImage)
@@ -1224,7 +1225,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break;
KillTimer(hwnd, wParam);
- if (!g_CluiData.old_viewmode[0])
+ if ( !g_CluiData.old_viewmode[0])
SendMessage(hwnd, WM_COMMAND, IDC_RESETMODES, 0);
else
ApplyViewMode((const char *)g_CluiData.old_viewmode);
@@ -1279,7 +1280,7 @@ clvm_reset_command: case IDC_CONFIGUREMODES:
{
clvm_config_command:
- if (!g_ViewModeOptDlg)
+ if ( !g_ViewModeOptDlg)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
break;
}
@@ -1323,7 +1324,7 @@ static BOOL sttDrawViewModeBackground(HWND hwnd, HDC hdc, RECT * rect) if (rect) rc = *rect;
else GetClientRect(hwnd,&rc);
- if (!view_mode.hBmpBackground && !view_mode.useWinColors)
+ if ( !view_mode.hBmpBackground && !view_mode.useWinColors)
{
HBRUSH hbr = CreateSolidBrush(view_mode.bkColour);
FillRect(hdc, &rc, hbr);
@@ -1351,7 +1352,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) DBVARIANT dbv;
view_mode.bkColour = sttGetColor("ViewMode","BkColour",CLCDEFAULT_BKCOLOUR);
if (db_get_b(NULL,"ViewMode","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!DBGetContactSettingString(NULL,"ViewMode","BkBitmap",&dbv)) {
+ if ( !DBGetContactSettingString(NULL,"ViewMode","BkBitmap",&dbv)) {
view_mode.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -1366,7 +1367,7 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) void CreateViewModeFrame()
{
CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"View Mode Background/ViewMode",0);
- ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhViewModeBackgroundSettingsChanged);
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhViewModeBackgroundSettingsChanged);
ehhViewModeBackgroundSettingsChanged(0,0);
CLISTFrame frame = {0};
@@ -1416,9 +1417,9 @@ void ApplyViewMode(const char *Name, bool onlySelector ) mir_snprintf(szSetting, 256, "%c_LastMode", 246);
- if (!name) // Name is null - apply last stored view mode
+ if ( !name) // Name is null - apply last stored view mode
{
- if (!DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv))
+ if ( !DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv))
{
name = (char*)_alloca(strlen(dbv.pszVal)+1);
strcpy(name,dbv.pszVal);
@@ -1455,7 +1456,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) if ( !onlySelector )
{
mir_snprintf(szSetting, 256, "%c%s_PF", 246, name);
- if (!DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if ( !DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
if (lstrlenA(dbv.pszVal) >= 2)
{
strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
@@ -1465,7 +1466,7 @@ void ApplyViewMode(const char *Name, bool onlySelector ) mir_free(dbv.pszVal);
}
mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
- if (!DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv))
+ if ( !DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv))
{
if (lstrlen(dbv.ptszVal) >= 2)
{
diff --git a/plugins/Clist_modern/modern_xptheme.cpp b/plugins/Clist_modern/modern_xptheme.cpp index 29d1112e9c..0e1e9dddde 100644 --- a/plugins/Clist_modern/modern_xptheme.cpp +++ b/plugins/Clist_modern/modern_xptheme.cpp @@ -31,7 +31,7 @@ static HRESULT (WINAPI *_xpt_DrawThemeText)(HANDLE, HDC, int, int, LPCWSTR, int #undef MGPROC
#define MGPROC(x) GetProcAddress(_xpt_ThemeAPIHandle,x)
-#define xptcheck if (!xptModuleLoaded) return
+#define xptcheck if ( !xptModuleLoaded) return
#define xptlock() EnterCriticalSection(&xptCS)
#define xptunlock() LeaveCriticalSection(&xptCS)
@@ -43,7 +43,7 @@ static void _sttXptObjectDestructor (void * pt) static int _xpt_ThemeSupport()
{
if (IsWinVerXPPlus()) {
- if (!_xpt_ThemeAPIHandle) {
+ if ( !_xpt_ThemeAPIHandle) {
_xpt_ThemeAPIHandle = GetModuleHandleA("uxtheme");
if (_xpt_ThemeAPIHandle) {
_xpt_OpenThemeData = (HANDLE(WINAPI *)(HWND, LPCWSTR))MGPROC("OpenThemeData");
@@ -110,7 +110,7 @@ BOOL xpt_IsThemed(XPTHANDLE xptHandle) {
BOOL res = FALSE;
xptcheck FALSE;
- if (!xptHandle) return FALSE;
+ if ( !xptHandle) return FALSE;
xptlock();
{
if (xpt_IsValidHandle(xptHandle) && ((XPTObject*) xptHandle)->hThemeHandle)
@@ -124,7 +124,7 @@ BOOL xpt_IsValidHandle(XPTHANDLE xptHandle) {
BOOL res = FALSE;
xptcheck FALSE;
- if (!xptHandle) return FALSE;
+ if ( !xptHandle) return FALSE;
xptlock();
{
if (List_IndexOf(xptObjectList, (void*)xptHandle) != -1)
|