diff options
author | George Hazan <george.hazan@gmail.com> | 2012-07-06 20:23:55 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-07-06 20:23:55 +0000 |
commit | 2799d3c1c54f5b4681b45b76cfdacb081312ae88 (patch) | |
tree | 7c3fcf6b8bb40fd3226e1c76ba0f70e53fa923a1 /plugins | |
parent | fd2115f98aca6fa093498cf7a24216a12b05a885 (diff) |
- crash fix in Clist Modern cache
- code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@800 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
53 files changed, 9544 insertions, 9612 deletions
diff --git a/plugins/Clist_modern/hdr/modern_cache_funcs.h b/plugins/Clist_modern/hdr/modern_cache_funcs.h index 1298536ca1..ba2b59f2c3 100644 --- a/plugins/Clist_modern/hdr/modern_cache_funcs.h +++ b/plugins/Clist_modern/hdr/modern_cache_funcs.h @@ -2,8 +2,8 @@ Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -37,8 +37,8 @@ void Cache_GetSecondLineText(struct SHORTDATA *dat, PDNCE pdnce); void Cache_GetThirdLineText(struct SHORTDATA *dat, PDNCE pdnce);
void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact);
void Cache_GetTimezone(struct ClcData *dat, HANDLE hContact);
-int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR *variable_text, BOOL xstatus_has_priority,
- BOOL show_status_if_no_away, BOOL show_listening_if_no_away, BOOL use_name_and_message_for_xstatus,
+int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR *variable_text, BOOL xstatus_has_priority,
+ BOOL show_status_if_no_away, BOOL show_listening_if_no_away, BOOL use_name_and_message_for_xstatus,
BOOL pdnce_time_show_only_if_different);
void amRequestAwayMsg(HANDLE hContact);
diff --git a/plugins/Clist_modern/init.cpp b/plugins/Clist_modern/init.cpp index e803300569..f37e754bf7 100644 --- a/plugins/Clist_modern/init.cpp +++ b/plugins/Clist_modern/init.cpp @@ -31,12 +31,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //definitions
-#define CHECKRES(sub) if (sub!=S_OK) return S_FALSE;
+#define CHECKRES(sub) if (sub != S_OK) return S_FALSE;
HINSTANCE g_hInst = 0;
-CLIST_INTERFACE *pcli=NULL;
-CLIST_INTERFACE corecli={0};
-CLUIDATA g_CluiData={0};
+CLIST_INTERFACE *pcli = NULL;
+CLIST_INTERFACE corecli = {0};
+CLUIDATA g_CluiData = {0};
int hLangpack;
TIME_API tmi;
@@ -134,7 +134,7 @@ PLUGININTERFACE int Unload(void) TRACE("Unloading Clist Modern\r\n");
if (IsWindow(pcli->hwndContactList)) DestroyWindow(pcli->hwndContactList);
- pcli->hwndContactList=NULL;
+ pcli->hwndContactList = NULL;
UnhookAll();
@@ -168,81 +168,81 @@ static HRESULT SubclassClistInterface() // 'save*' - pointer to stored default parent handle
// 'cli_*' - new handler with default core service calling
- corecli=*pcli;
+ corecli = *pcli;
pcli->bDisplayLocked = TRUE;
- pcli->pfnCheckCacheItem = (void (*)(ClcCacheEntryBase*)) cliCheckCacheItem;
+ pcli->pfnCheckCacheItem = (void (*)(ClcCacheEntryBase*)) cliCheckCacheItem;
pcli->pfnFreeCacheItem = (void(*)(ClcCacheEntryBase*)) cliFreeCacheItem;
- pcli->pfnInvalidateDisplayNameCacheEntry = cliInvalidateDisplayNameCacheEntry;
+ pcli->pfnInvalidateDisplayNameCacheEntry = cliInvalidateDisplayNameCacheEntry;
pcli->pfnTrayIconUpdateBase = cliTrayIconUpdateBase;
- pcli->pfnCluiProtocolStatusChanged = cliCluiProtocolStatusChanged;
-
- pcli->pfnBeginRenameSelection = cliBeginRenameSelection;
- pcli->pfnCreateClcContact = cliCreateClcContact;
- pcli->pfnCreateCacheItem = cliCreateCacheItem;
- pcli->pfnGetRowBottomY = cliGetRowBottomY;
- pcli->pfnGetRowHeight = cliGetRowHeight;
- pcli->pfnGetRowTopY = cliGetRowTopY;
- pcli->pfnGetRowTotalHeight = cliGetRowTotalHeight;
- pcli->pfnInvalidateRect = CLUI__cliInvalidateRect;
- pcli->pfnGetCacheEntry = cliGetCacheEntry;
- pcli->pfnOnCreateClc = CLUI::cliOnCreateClc;
- pcli->pfnPaintClc = CLCPaint::cliPaintClc;
- pcli->pfnRebuildEntireList = cliRebuildEntireList;
- pcli->pfnRecalcScrollBar = cliRecalcScrollBar;
- pcli->pfnRowHitTest = cliRowHitTest;
- pcli->pfnScrollTo = cliScrollTo;
- pcli->pfnShowHide = cliShowHide;
- pcli->pfnHitTest = cliHitTest;
- pcli->pfnCompareContacts = cliCompareContacts;
- pcli->pfnBuildGroupPopupMenu= cliBuildGroupPopupMenu;
+ pcli->pfnCluiProtocolStatusChanged = cliCluiProtocolStatusChanged;
+
+ pcli->pfnBeginRenameSelection = cliBeginRenameSelection;
+ pcli->pfnCreateClcContact = cliCreateClcContact;
+ pcli->pfnCreateCacheItem = cliCreateCacheItem;
+ pcli->pfnGetRowBottomY = cliGetRowBottomY;
+ pcli->pfnGetRowHeight = cliGetRowHeight;
+ pcli->pfnGetRowTopY = cliGetRowTopY;
+ pcli->pfnGetRowTotalHeight = cliGetRowTotalHeight;
+ pcli->pfnInvalidateRect = CLUI__cliInvalidateRect;
+ pcli->pfnGetCacheEntry = cliGetCacheEntry;
+ pcli->pfnOnCreateClc = CLUI::cliOnCreateClc;
+ pcli->pfnPaintClc = CLCPaint::cliPaintClc;
+ pcli->pfnRebuildEntireList = cliRebuildEntireList;
+ pcli->pfnRecalcScrollBar = cliRecalcScrollBar;
+ pcli->pfnRowHitTest = cliRowHitTest;
+ pcli->pfnScrollTo = cliScrollTo;
+ pcli->pfnShowHide = cliShowHide;
+ pcli->pfnHitTest = cliHitTest;
+ pcli->pfnCompareContacts = cliCompareContacts;
+ pcli->pfnBuildGroupPopupMenu = cliBuildGroupPopupMenu;
pcli->pfnGetIconFromStatusMode = cliGetIconFromStatusMode;
- pcli->pfnFindItem = cliFindItem;
- pcli->pfnGetRowByIndex = cliGetRowByIndex;
- pcli->pfnGetRowsPriorTo = cliGetRowsPriorTo;
- pcli->pfnGetGroupContentsCount =cliGetGroupContentsCount;
+ pcli->pfnFindItem = cliFindItem;
+ pcli->pfnGetRowByIndex = cliGetRowByIndex;
+ pcli->pfnGetRowsPriorTo = cliGetRowsPriorTo;
+ pcli->pfnGetGroupContentsCount = cliGetGroupContentsCount;
pcli->pfnCreateEvent = cliCreateEvent;
- pcli->pfnFindRowByText = cliFindRowByText;
+ pcli->pfnFindRowByText = cliFindRowByText;
//partialy overloaded - call default handlers from inside
pcli->pfnIconFromStatusMode = cli_IconFromStatusMode;
pcli->pfnLoadCluiGlobalOpts = CLUI_cli_LoadCluiGlobalOpts;
- pcli->pfnSortCLC = cli_SortCLC;
- pcli->pfnAddGroup = cli_AddGroup;
- pcli->pfnGetGroupCountsText = cli_GetGroupCountsText;
- pcli->pfnAddContactToTree = cli_AddContactToTree;
+ pcli->pfnSortCLC = cli_SortCLC;
+ pcli->pfnAddGroup = cli_AddGroup;
+ pcli->pfnGetGroupCountsText = cli_GetGroupCountsText;
+ pcli->pfnAddContactToTree = cli_AddContactToTree;
pcli->pfnAddInfoItemToGroup = cli_AddInfoItemToGroup;
- pcli->pfnAddItemToGroup = cli_AddItemToGroup;
+ pcli->pfnAddItemToGroup = cli_AddItemToGroup;
pcli->pfnContactListWndProc = CLUI::cli_ContactListWndProc;
pcli->pfnDeleteItemFromTree = cli_DeleteItemFromTree;
- pcli->pfnFreeContact = cli_FreeContact;
- pcli->pfnFreeGroup = cli_FreeGroup;
- pcli->pfnChangeContactIcon = cli_ChangeContactIcon;
- pcli->pfnTrayIconProcessMessage = cli_TrayIconProcessMessage;
- pcli->pfnSaveStateAndRebuildList= cli_SaveStateAndRebuildList;
- pcli->pfnContactListControlWndProc = cli_ContactListControlWndProc;
- pcli->pfnProcessExternalMessages = cli_ProcessExternalMessages;
- pcli->pfnAddEvent = cli_AddEvent;
- pcli->pfnRemoveEvent = cli_RemoveEvent;
+ pcli->pfnFreeContact = cli_FreeContact;
+ pcli->pfnFreeGroup = cli_FreeGroup;
+ pcli->pfnChangeContactIcon = cli_ChangeContactIcon;
+ pcli->pfnTrayIconProcessMessage = cli_TrayIconProcessMessage;
+ pcli->pfnSaveStateAndRebuildList = cli_SaveStateAndRebuildList;
+ pcli->pfnContactListControlWndProc = cli_ContactListControlWndProc;
+ pcli->pfnProcessExternalMessages = cli_ProcessExternalMessages;
+ pcli->pfnAddEvent = cli_AddEvent;
+ pcli->pfnRemoveEvent = cli_RemoveEvent;
pcli->pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
return S_OK;
}
static HRESULT CreateHookableEvents()
{
- g_CluiData.hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
- g_CluiData.hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
- g_CluiData.hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
- g_CluiData.hEventBkgrChanged = CreateHookableEvent(ME_BACKGROUNDCONFIG_CHANGED);
- g_CluiData.hEventPreBuildTrayMenu = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU);
- g_CluiData.hEventPreBuildFrameMenu = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
- g_CluiData.hEventPreBuildGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
- g_CluiData.hEventPreBuildSubGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
- g_CluiData.hEventStatusBarShowToolTip = CreateHookableEvent(ME_CLIST_FRAMES_SB_SHOW_TOOLTIP);
- g_CluiData.hEventStatusBarHideToolTip = CreateHookableEvent(ME_CLIST_FRAMES_SB_HIDE_TOOLTIP);
- g_CluiData.hEventToolBarModuleLoaded = CreateHookableEvent(ME_TB_MODULELOADED);
- g_CluiData.hEventSkinServicesCreated = CreateHookableEvent(ME_SKIN_SERVICESCREATED);
+ g_CluiData.hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
+ g_CluiData.hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
+ g_CluiData.hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
+ g_CluiData.hEventBkgrChanged = CreateHookableEvent(ME_BACKGROUNDCONFIG_CHANGED);
+ g_CluiData.hEventPreBuildTrayMenu = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU);
+ g_CluiData.hEventPreBuildFrameMenu = CreateHookableEvent(ME_CLIST_PREBUILDFRAMEMENU);
+ g_CluiData.hEventPreBuildGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDGROUPMENU);
+ g_CluiData.hEventPreBuildSubGroupMenu = CreateHookableEvent(ME_CLIST_PREBUILDSUBGROUPMENU);
+ g_CluiData.hEventStatusBarShowToolTip = CreateHookableEvent(ME_CLIST_FRAMES_SB_SHOW_TOOLTIP);
+ g_CluiData.hEventStatusBarHideToolTip = CreateHookableEvent(ME_CLIST_FRAMES_SB_HIDE_TOOLTIP);
+ g_CluiData.hEventToolBarModuleLoaded = CreateHookableEvent(ME_TB_MODULELOADED);
+ g_CluiData.hEventSkinServicesCreated = CreateHookableEvent(ME_SKIN_SERVICESCREATED);
return S_OK;
}
diff --git a/plugins/Clist_modern/modern_aniavatars.cpp b/plugins/Clist_modern/modern_aniavatars.cpp index 4e801d945b..e3b83249aa 100644 --- a/plugins/Clist_modern/modern_aniavatars.cpp +++ b/plugins/Clist_modern/modern_aniavatars.cpp @@ -36,8 +36,8 @@ File contains implementation of animated avatars in contact list #define IMMEDIATE_DRAW (!AniAva.bSeparateWindow)
-void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * pBmp, int ** pframesDelay, int * pframesCount, SIZE * sizeAvatar);
-BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName);
+void GDIPlus_ExtractAnimatedGif (TCHAR * szName, int width, int height, HBITMAP * pBmp, int ** pframesDelay, int * pframesCount, SIZE * sizeAvatar);
+BOOL GDIPlus_IsAnimatedGif (TCHAR * szName);
/* Next is module */
#define ANIAVAWINDOWCLASS _T("MirandaModernAniAvatar")
@@ -177,7 +177,7 @@ static HWND _AniAva_CreateAvatarWindowSync(TCHAR *szFileName); static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
//module variables
-static ANIAVA AniAva={0};
+static ANIAVA AniAva = {0};
/// IMPLEMENTATION
@@ -209,12 +209,12 @@ int AniAva_InitModule() RegisterClassEx(&wc);
}
InitializeCriticalSection(&AniAva.CS);
- AniAva.Objects=List_Create(0,2);
- AniAva.AniAvatarList=List_Create(0,1);
- AniAva.AniAvatarList->sortFunc=_AniAva_SortAvatarInfo;
- AniAva.bModuleStarted=TRUE;
- AniAva.hExitEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
- AniAva.AnimationThreadID=(DWORD)mir_forkthread(_AniAva_AnimationTreadProc, (void*)AniAva.hExitEvent);
+ AniAva.Objects = List_Create(0,2);
+ AniAva.AniAvatarList = List_Create(0,1);
+ AniAva.AniAvatarList->sortFunc = _AniAva_SortAvatarInfo;
+ 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);
_AniAva_LoadOptions();
@@ -229,8 +229,8 @@ int AniAva_UnloadModule() aalock;
{
int i;
- AniAva.bModuleStarted=FALSE;
- for (i=0; i<AniAva.Objects->realCount; i++)
+ AniAva.bModuleStarted = FALSE;
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
if (AniAva.Objects->items[i])
{
@@ -241,9 +241,9 @@ int AniAva_UnloadModule() List_Destroy(AniAva.Objects);
mir_free(AniAva.Objects);
- for (i=0; i<AniAva.AniAvatarList->realCount; i++)
+ for (i = 0; i < AniAva.AniAvatarList->realCount; i++)
{
- ANIAVA_INFO * aai=(ANIAVA_INFO *)AniAva.AniAvatarList->items[i];
+ ANIAVA_INFO * aai = (ANIAVA_INFO *)AniAva.AniAvatarList->items[i];
if (aai->tcsFilename) mir_free(aai->tcsFilename);
if (aai->pFrameDelays) free(aai->pFrameDelays);
mir_free(aai);
@@ -261,23 +261,23 @@ int AniAva_UnloadModule() // Update options
int AniAva_UpdateOptions()
{
- BOOL bReloadAvatars=FALSE;
- BOOL bBeEnabled=(!g_CluiData.fGDIPlusFail
+ BOOL bReloadAvatars = FALSE;
+ BOOL bBeEnabled = (!g_CluiData.fGDIPlusFail
&& db_get_b(NULL,"CList","AvatarsAnimated",(ServiceExists(MS_AV_GETAVATARBITMAP)&&!g_CluiData.fGDIPlusFail))
&& db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT));
if (bBeEnabled && !AniAva.bModuleStarted)
{
AniAva_InitModule();
- bReloadAvatars=TRUE;
+ bReloadAvatars = TRUE;
}
else if (!bBeEnabled && AniAva.bModuleStarted)
{
AniAva_UnloadModule();
- bReloadAvatars=TRUE;
+ bReloadAvatars = TRUE;
}
BOOL oldSeparate = AniAva.bSeparateWindow;
_AniAva_LoadOptions();
- if ( oldSeparate != AniAva.bSeparateWindow )
+ if ( oldSeparate !=AniAva.bSeparateWindow )
{
AniAva_InvalidateAvatarPositions(NULL);
AniAva_RemoveInvalidatedAvatars();
@@ -289,59 +289,59 @@ int AniAva_UpdateOptions() // adds avatars to be displayed
int AniAva_AddAvatar(HANDLE hContact, TCHAR * szFilename, int width, int heigth)
{
- int res=0;
+ int res = 0;
aacheck 0;
- if (!GDIPlus_IsAnimatedGIF(szFilename))
+ if (!GDIPlus_IsAnimatedGif (szFilename))
return 0;
aalock;
{
//first try to find window for contact avatar
- HWND hwnd=NULL;
+ HWND hwnd = NULL;
int i;
ANIAVA_OBJECT * pavi;
- ANIAVATARIMAGEINFO avii={0};
- SIZE szAva={ width, heigth };
- for (i=0; i<AniAva.Objects->realCount; i++)
+ ANIAVATARIMAGEINFO avii = {0};
+ SIZE szAva = { width, heigth };
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- pavi=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
- if (pavi->hContact==hContact)
+ pavi = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ if (pavi->hContact == hContact)
{
- if (pavi->ObjectSize.cx==width && pavi->ObjectSize.cy==heigth)
+ if (pavi->ObjectSize.cx == width && pavi->ObjectSize.cy == heigth)
{
- hwnd=pavi->hWindow;
+ hwnd = pavi->hWindow;
break;
}
else
{
_AniAva_DestroyAvatarWindow(pavi->hWindow);
- pavi->hWindow=NULL;
+ pavi->hWindow = NULL;
_AniAva_RealRemoveAvatar(pavi->dwAvatarUniqId);
- pavi->dwAvatarUniqId=0;
+ pavi->dwAvatarUniqId = 0;
break;
}
}
}
- if (i==AniAva.Objects->realCount)
+ if (i == AniAva.Objects->realCount)
{
pavi = (ANIAVA_OBJECT *) mir_calloc( sizeof(ANIAVA_OBJECT));
- pavi->hWindow = NULL;
- pavi->hContact = hContact;
- pavi->bInvalidPos = 0;
+ pavi->hWindow = NULL;
+ pavi->hContact = hContact;
+ pavi->bInvalidPos = 0;
List_Insert( AniAva.Objects, pavi, AniAva.Objects->realCount);
}
//change avatar
- pavi->bToBeDeleted=FALSE;
- pavi->bInvalidPos = 0;
+ pavi->bToBeDeleted = FALSE;
+ pavi->bInvalidPos = 0;
// now CreateAvatar
if (pavi->dwAvatarUniqId)
_AniAva_GetAvatarImageInfo(pavi->dwAvatarUniqId,&avii);
else
- pavi->dwAvatarUniqId=_AniAva_LoadAvatarFromImage(szFilename, width, heigth, &avii);
+ pavi->dwAvatarUniqId = _AniAva_LoadAvatarFromImage(szFilename, width, heigth, &avii);
if (hwnd)
SendMessage(hwnd, AAM_SETAVATAR, (WPARAM)&avii, (LPARAM) 0);
- pavi->ObjectSize=avii.szSize;
- res=MAKELONG(avii.szSize.cx, avii.szSize.cy);
+ pavi->ObjectSize = avii.szSize;
+ res = MAKELONG(avii.szSize.cx, avii.szSize.cy);
}
aaunlock;
return res;
@@ -355,9 +355,9 @@ void AniAva_UpdateParent() {
int i;
HWND parent = fnGetAncestor(pcli->hwndContactList,GA_PARENT);
- for (i=0; i<AniAva.Objects->realCount; i++)
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
SendMessage(pai->hWindow, AAM_SETPARENT, (WPARAM)parent,0);
}
}
@@ -365,10 +365,10 @@ void AniAva_UpdateParent() }
ANIAVA_OBJECT * FindAvatarByContact( HANDLE hContact )
{
- for ( int i=0; i<AniAva.Objects->realCount; i++)
+ for ( int i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=((ANIAVA_OBJECT *)AniAva.Objects->items[i]);
- if (pai->hContact==hContact)
+ ANIAVA_OBJECT * pai = ((ANIAVA_OBJECT *)AniAva.Objects->items[i]);
+ if (pai->hContact == hContact)
return pai;
}
return NULL;
@@ -378,7 +378,7 @@ int AniAva_RenderAvatar( HANDLE hContact, HDC hdcMem, RECT * rc ) {
aacheck 0;
aalock;
- ANIAVA_OBJECT * pai=FindAvatarByContact( hContact );
+ ANIAVA_OBJECT * pai = FindAvatarByContact( hContact );
if ( pai )
SendMessage(pai->hWindow, AAM_RENDER, (WPARAM)hdcMem, (LPARAM) rc);
aaunlock;
@@ -395,49 +395,36 @@ int AniAva_SetAvatarPos(HANDLE hContact, RECT * rc, int overlayIdx, BYTE bAlpha) return 0;
}
{
- ANIAVA_OBJECT * pai=FindAvatarByContact( hContact );
+ ANIAVA_OBJECT * pai = FindAvatarByContact( hContact );
if ( pai )
{
- ANIAVA_POSINFO * api=(ANIAVA_POSINFO *)malloc(sizeof(ANIAVA_POSINFO));
+ ANIAVA_POSINFO * api = (ANIAVA_POSINFO *)malloc(sizeof(ANIAVA_POSINFO));
if (!pai->hWindow)
{
HWND hwnd;
HWND parent;
- ANIAVATARIMAGEINFO avii={0};
+ ANIAVATARIMAGEINFO avii = {0};
//not found -> create window
char szName[150] = "AniAvaWnd_";
TCHAR * tszName;
_itoa((int)hContact,szName+10,16);
-#ifdef _DEBUG
- {
- char *temp;
- PDNCE pdnce=(PDNCE)pcli->pfnGetCacheEntry(hContact);
- if ( pdnce && pdnce->m_cache_tcsName )
- {
- temp=mir_t2a(pdnce->m_cache_tcsName);
- strcat(szName,"_");
- strcat(szName,temp);
- mir_free(temp);
- }
- }
-#endif
tszName = mir_a2t( szName );
- hwnd=_AniAva_CreateAvatarWindowSync(tszName);
+ hwnd = _AniAva_CreateAvatarWindowSync(tszName);
mir_free( tszName );
- parent=fnGetAncestor(pcli->hwndContactList,GA_PARENT);
- pai->hWindow=hwnd;
+ parent = fnGetAncestor(pcli->hwndContactList,GA_PARENT);
+ pai->hWindow = hwnd;
SendMessage(hwnd,AAM_SETPARENT,(WPARAM)parent,0);
if (_AniAva_GetAvatarImageInfo(pai->dwAvatarUniqId,&avii))
SendMessage(pai->hWindow, AAM_SETAVATAR, (WPARAM)&avii, (LPARAM) 0);
}
- api->bAlpha=bAlpha;
- api->idxOverlay=overlayIdx;
- api->rcPos=*rc;
+ api->bAlpha = bAlpha;
+ api->idxOverlay = overlayIdx;
+ api->rcPos = *rc;
SendNotifyMessage(pai->hWindow, AAM_SETPOSITION, (WPARAM)0, (LPARAM) api);
// the AAM_SETPOSITION is responsible to destroy memory under api
- pai->bInvalidPos=FALSE;
- pai->bToBeDeleted=FALSE;
+ pai->bInvalidPos = FALSE;
+ pai->bToBeDeleted = FALSE;
}
}
aaunlock;
@@ -450,12 +437,12 @@ int AniAva_RemoveAvatar(HANDLE hContact) aalock;
{
int i;
- for (i=0; i<AniAva.Objects->realCount; i++)
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
if (pai->hContact == hContact)
{
- pai->bToBeDeleted=TRUE;
+ pai->bToBeDeleted = TRUE;
break;
}
}
@@ -469,10 +456,10 @@ int AniAva_InvalidateAvatarPositions(HANDLE hContact) int i;
aacheck 0;
aalock;
- for (i=0; i<AniAva.Objects->realCount; i++)
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
- if (pai->hContact==hContact || !hContact)
+ ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ if (pai->hContact == hContact || !hContact)
{
pai->bInvalidPos++;
if (hContact) break;
@@ -484,31 +471,31 @@ int AniAva_InvalidateAvatarPositions(HANDLE hContact) // all avatars without validated position will be stop painted and probably removed
int AniAva_RemoveInvalidatedAvatars()
{
- BOOL keepAvatar=FALSE;
+ BOOL keepAvatar = FALSE;
aacheck 0;
aalock;
{
int i;
- for (i=0; i<AniAva.Objects->realCount; i++)
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
if (pai->hWindow && (pai->bInvalidPos))
{
SendMessage(pai->hWindow,AAM_STOP,0,0);
if (pai->bInvalidPos)//>3)
{
- //keepAvatar=TRUE;
- //pai->bToBeDeleted=TRUE;
- pai->bInvalidPos=0;
+ //keepAvatar = TRUE;
+ //pai->bToBeDeleted = TRUE;
+ pai->bInvalidPos = 0;
_AniAva_DestroyAvatarWindow(pai->hWindow);
- pai->hWindow=NULL;
+ pai->hWindow = NULL;
}
}
if (pai->bToBeDeleted)
{
if (pai->hWindow) _AniAva_DestroyAvatarWindow(pai->hWindow);
- pai->hWindow=NULL;
+ pai->hWindow = NULL;
if (!keepAvatar) _AniAva_RealRemoveAvatar(pai->dwAvatarUniqId);
mir_free(pai);
List_Remove(AniAva.Objects,i);
@@ -526,10 +513,10 @@ int AniAva_RedrawAllAvatars(BOOL updateZOrder) int i;
aacheck 0;
aalock;
- updateZOrder=1;
- for (i=0; i<AniAva.Objects->realCount; i++)
+ updateZOrder = 1;
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
if (updateZOrder)
SendMessage(pai->hWindow,AAM_REDRAW,(WPARAM)updateZOrder,0);
else
@@ -548,22 +535,22 @@ static void CALLBACK _AniAva_SyncCallerUserAPCProc(DWORD_PTR dwParam) }
static INT_PTR _AniAva_CreateAvatarWindowSync_Worker(WPARAM tszName, LPARAM lParam)
{
- HWND hwnd=CreateWindowEx( WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_NOPARENTNOTIFY,ANIAVAWINDOWCLASS,(TCHAR*)tszName,WS_POPUP,
+ HWND hwnd = CreateWindowEx( WS_EX_TOPMOST | WS_EX_TRANSPARENT | WS_EX_NOPARENTNOTIFY,ANIAVAWINDOWCLASS,(TCHAR*)tszName,WS_POPUP,
0,0,1,1,pcli->hwndContactList, NULL, pcli->hInst, NULL );
return (INT_PTR)hwnd;
}
static HWND _AniAva_CreateAvatarWindowSync(TCHAR *szFileName)
{
- ANIAVA_SYNCCALLITEM item={0};
- int res=0;
+ ANIAVA_SYNCCALLITEM item = {0};
+ int res = 0;
if (!AniAva.AnimationThreadHandle) return NULL;
- if (AniAva.AnimationThreadID==0) return NULL;
+ if (AniAva.AnimationThreadID == 0) return NULL;
item.wParam = (WPARAM) szFileName;
item.lParam = 0;
item.pfnProc = _AniAva_CreateAvatarWindowSync_Worker;
item.hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- if (GetCurrentThreadId()!=AniAva.AnimationThreadID)
+ if (GetCurrentThreadId() != AniAva.AnimationThreadID)
QueueUserAPC(_AniAva_SyncCallerUserAPCProc, AniAva.AnimationThreadHandle, (DWORD_PTR) &item);
else
_AniAva_SyncCallerUserAPCProc((DWORD_PTR) &item);
@@ -575,13 +562,13 @@ static HWND _AniAva_CreateAvatarWindowSync(TCHAR *szFileName) static void _AniAva_RealRemoveAvatar(DWORD UniqueID)
{
int j,k;
- for (j=0; j<AniAva.AniAvatarList->realCount; j++)
+ for (j = 0; j < AniAva.AniAvatarList->realCount; j++)
{
- ANIAVA_INFO * aai=(ANIAVA_INFO *) AniAva.AniAvatarList->items[j];
- if (aai->dwAvatarUniqId==UniqueID)
+ ANIAVA_INFO * aai = (ANIAVA_INFO *) AniAva.AniAvatarList->items[j];
+ if (aai->dwAvatarUniqId == UniqueID)
{
aai->nRefCount--;
- if (aai->nRefCount==0)
+ if (aai->nRefCount == 0)
{
_AniAva_PausePainting();
#ifdef _DEBUG
@@ -590,11 +577,11 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID) if (aai->tcsFilename) mir_free(aai->tcsFilename);
if (aai->pFrameDelays) free(aai->pFrameDelays);
_AniAva_ReduceAvatarImages(aai->nStripTop,aai->FrameSize.cx*aai->nFrameCount, FALSE);
- for (k=0; k<AniAva.AniAvatarList->realCount; k++)
- if (k!=j) {
- ANIAVA_INFO * taai=(ANIAVA_INFO *) AniAva.AniAvatarList->items[k];
+ for (k = 0; k < AniAva.AniAvatarList->realCount; k++)
+ if (k != j) {
+ ANIAVA_INFO * taai = (ANIAVA_INFO *) AniAva.AniAvatarList->items[k];
if (taai->nStripTop>aai->nStripTop)
- taai->nStripTop-=aai->FrameSize.cx*aai->nFrameCount;
+ taai->nStripTop -= aai->FrameSize.cx*aai->nFrameCount;
}
if (AniAva.AniAvatarList->realCount>0)
{
@@ -602,30 +589,30 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID) HDC hNewDC;
HBITMAP hNewBmp, hNewOldBmp;
- int newWidth=AniAva.width-aai->FrameSize.cx*aai->nFrameCount;
- int newHeight=0;
+ int newWidth = AniAva.width-aai->FrameSize.cx*aai->nFrameCount;
+ int newHeight = 0;
int i;
- for (i=0; i<AniAva.AniAvatarList->realCount; i++)
- if (i!=j)
+ for (i = 0; i < AniAva.AniAvatarList->realCount; i++)
+ if (i != j)
{
- newHeight=max(newHeight,((ANIAVA_INFO *) AniAva.AniAvatarList->items[i])->FrameSize.cy);
+ newHeight = max(newHeight,((ANIAVA_INFO *) AniAva.AniAvatarList->items[i])->FrameSize.cy);
}
- hNewDC=CreateCompatibleDC(NULL);
- hNewBmp=ske_CreateDIB32(newWidth,newHeight);
- hNewOldBmp=(HBITMAP)SelectObject(hNewDC,hNewBmp);
+ hNewDC = CreateCompatibleDC(NULL);
+ hNewBmp = ske_CreateDIB32(newWidth,newHeight);
+ hNewOldBmp = (HBITMAP)SelectObject(hNewDC,hNewBmp);
// copy from old and from new strip
if (aai->nStripTop>0)
BitBlt(hNewDC,0,0,aai->nStripTop,newHeight,AniAva.hAniAvaDC,0,0, SRCCOPY);
- if (aai->nStripTop+aai->FrameSize.cx*aai->nFrameCount<AniAva.width)
+ if (aai->nStripTop+aai->FrameSize.cx*aai->nFrameCount < AniAva.width)
BitBlt(hNewDC,aai->nStripTop,0,AniAva.width-(aai->nStripTop+aai->FrameSize.cx*aai->nFrameCount),newHeight,AniAva.hAniAvaDC,aai->nStripTop+aai->FrameSize.cx*aai->nFrameCount,0, SRCCOPY);
_AniAva_RemoveAniAvaDC(&AniAva);
- AniAva.hAniAvaDC =hNewDC;
- AniAva.hAniAvaBitmap =hNewBmp;
- AniAva.hAniAvaOldBitmap =hNewOldBmp;
- AniAva.width =newWidth;
- AniAva.height =newHeight;
+ AniAva.hAniAvaDC = hNewDC;
+ AniAva.hAniAvaBitmap = hNewBmp;
+ AniAva.hAniAvaOldBitmap = hNewOldBmp;
+ AniAva.width = newWidth;
+ AniAva.height = newHeight;
}
else
@@ -645,15 +632,15 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID) }
static void _AniAva_RemoveAniAvaDC(ANIAVA * pAniAva)
{
- if(pAniAva->hAniAvaDC)
+ if (pAniAva->hAniAvaDC)
{
SelectObject(pAniAva->hAniAvaDC, pAniAva->hAniAvaOldBitmap);
DeleteObject(pAniAva->hAniAvaBitmap);
DeleteDC(pAniAva->hAniAvaDC);
- pAniAva->hAniAvaDC=NULL;
- pAniAva->height=0;
- pAniAva->width=0;
- pAniAva->hAniAvaBitmap=NULL;
+ pAniAva->hAniAvaDC = NULL;
+ pAniAva->height = 0;
+ pAniAva->width = 0;
+ pAniAva->hAniAvaBitmap = NULL;
}
};
@@ -663,18 +650,18 @@ static void _AniAva_DestroyAvatarWindow( HWND hwnd) }
static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height, ANIAVATARIMAGEINFO * pRetAII)
{
- ANIAVA_INFO aai={0};
- ANIAVA_INFO * paai=NULL;
- BOOL fNeedInsertToList=FALSE;
- int idx=0;
- aai.tcsFilename=szFileName;
- aai.FrameSize.cx=width;
- aai.FrameSize.cy=height;
-
- if (!List_GetIndex(AniAva.AniAvatarList,(void*)&aai,&idx)) idx=-1;
- if (idx==-1) //item not present in list
+ ANIAVA_INFO aai = {0};
+ ANIAVA_INFO * paai = NULL;
+ BOOL fNeedInsertToList = FALSE;
+ int idx = 0;
+ aai.tcsFilename = szFileName;
+ aai.FrameSize.cx = width;
+ aai.FrameSize.cy = height;
+
+ if (!List_GetIndex(AniAva.AniAvatarList,(void*)&aai,&idx)) idx = -1;
+ if (idx == -1) //item not present in list
{
- HBITMAP hBitmap=NULL;
+ HBITMAP hBitmap = NULL;
HDC hTempDC;
HBITMAP hOldBitmap;
HDC hNewDC;
@@ -683,28 +670,28 @@ static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height int newWidth;
int newHeight;
- paai=(ANIAVA_INFO *)mir_calloc(sizeof(ANIAVA_INFO));
- paai->tcsFilename=mir_tstrdup(szFileName);
- paai->dwAvatarUniqId=rand();
- fNeedInsertToList=TRUE;
+ paai = (ANIAVA_INFO *)mir_calloc(sizeof(ANIAVA_INFO));
+ paai->tcsFilename = mir_tstrdup(szFileName);
+ paai->dwAvatarUniqId = rand();
+ fNeedInsertToList = TRUE;
//get image strip
- GDIPlus_ExtractAnimatedGIF(szFileName, width, height, &hBitmap, &(paai->pFrameDelays), &(paai->nFrameCount), &(paai->FrameSize));
+ GDIPlus_ExtractAnimatedGif (szFileName, width, height, &hBitmap, &(paai->pFrameDelays), &(paai->nFrameCount), &(paai->FrameSize));
//copy image to temp DC
- hTempDC=CreateCompatibleDC(NULL);
- hOldBitmap=(HBITMAP)SelectObject(hTempDC,hBitmap);
+ hTempDC = CreateCompatibleDC(NULL);
+ hOldBitmap = (HBITMAP)SelectObject(hTempDC,hBitmap);
//lets create hNewDC
/*
- newWidth=max(paai->FrameSize.cx*paai->nFrameCount,AniAva.width);
- newHeight=AniAva.height+paai->FrameSize.cy;
+ newWidth = max(paai->FrameSize.cx*paai->nFrameCount,AniAva.width);
+ newHeight = AniAva.height+paai->FrameSize.cy;
*/
- newWidth=AniAva.width+paai->FrameSize.cx*paai->nFrameCount;
- newHeight=max(paai->FrameSize.cy,AniAva.height);
+ newWidth = AniAva.width+paai->FrameSize.cx*paai->nFrameCount;
+ newHeight = max(paai->FrameSize.cy,AniAva.height);
- hNewDC=CreateCompatibleDC(NULL);
- hNewBmp=ske_CreateDIB32(newWidth,newHeight);
- hNewOldBmp=(HBITMAP)SelectObject(hNewDC,hNewBmp);
+ hNewDC = CreateCompatibleDC(NULL);
+ hNewBmp = ske_CreateDIB32(newWidth,newHeight);
+ hNewOldBmp = (HBITMAP)SelectObject(hNewDC,hNewBmp);
_AniAva_PausePainting();
GdiFlush();
@@ -712,7 +699,7 @@ static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height BitBlt(hNewDC,0,0,AniAva.width,AniAva.height,AniAva.hAniAvaDC,0,0, SRCCOPY);
BitBlt(hNewDC,AniAva.width,0,paai->FrameSize.cx*paai->nFrameCount,paai->FrameSize.cy,hTempDC,0,0, SRCCOPY);
- paai->nStripTop=AniAva.width;
+ paai->nStripTop = AniAva.width;
GdiFlush();
//remove temp DC
@@ -725,30 +712,30 @@ static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height //delete old
_AniAva_RemoveAniAvaDC(&AniAva);
//setNewDC;
- AniAva.hAniAvaDC =hNewDC;
- AniAva.hAniAvaBitmap =hNewBmp;
- AniAva.hAniAvaOldBitmap =hNewOldBmp;
- AniAva.width =newWidth;
- AniAva.height =newHeight;
+ AniAva.hAniAvaDC = hNewDC;
+ AniAva.hAniAvaBitmap = hNewBmp;
+ AniAva.hAniAvaOldBitmap = hNewOldBmp;
+ AniAva.width = newWidth;
+ AniAva.height = newHeight;
GdiFlush();
_AniAva_ResumePainting();
}
else
{
- paai=(ANIAVA_INFO *)AniAva.AniAvatarList->items[idx];
+ paai = (ANIAVA_INFO *)AniAva.AniAvatarList->items[idx];
}
if (paai)
{
paai->nRefCount++;
- pRetAII->nFramesCount=paai->nFrameCount;
- pRetAII->pFrameDelays=paai->pFrameDelays;
- pRetAII->ptImagePos.x=paai->nStripTop;
- pRetAII->ptImagePos.y=0;
- pRetAII->szSize=paai->FrameSize;
+ pRetAII->nFramesCount = paai->nFrameCount;
+ pRetAII->pFrameDelays = paai->pFrameDelays;
+ pRetAII->ptImagePos.x = paai->nStripTop;
+ pRetAII->ptImagePos.y = 0;
+ pRetAII->szSize = paai->FrameSize;
if (fNeedInsertToList)
{
//add to list
- int idx=AniAva.AniAvatarList->realCount;
+ int idx = AniAva.AniAvatarList->realCount;
List_GetIndex(AniAva.AniAvatarList, paai,&idx);
List_Insert(AniAva.AniAvatarList, (void*)paai, idx);
}
@@ -759,18 +746,18 @@ static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height static BOOL _AniAva_GetAvatarImageInfo(DWORD dwAvatarUniqId, ANIAVATARIMAGEINFO * avii)
{
int j;
- BOOL res=FALSE;
- for (j=0; j<AniAva.AniAvatarList->realCount; j++)
+ BOOL res = FALSE;
+ for (j = 0; j < AniAva.AniAvatarList->realCount; j++)
{
- ANIAVA_INFO * aai=(ANIAVA_INFO *) AniAva.AniAvatarList->items[j];
- if (aai->dwAvatarUniqId==dwAvatarUniqId)
+ ANIAVA_INFO * aai = (ANIAVA_INFO *) AniAva.AniAvatarList->items[j];
+ if (aai->dwAvatarUniqId == dwAvatarUniqId)
{
- avii->nFramesCount=aai->nFrameCount;
- avii->pFrameDelays=aai->pFrameDelays;
- avii->ptImagePos.x=aai->nStripTop;
- avii->ptImagePos.y=0;
- avii->szSize=aai->FrameSize;
- res=TRUE;
+ avii->nFramesCount = aai->nFrameCount;
+ avii->pFrameDelays = aai->pFrameDelays;
+ avii->ptImagePos.x = aai->nStripTop;
+ avii->ptImagePos.y = 0;
+ avii->szSize = aai->FrameSize;
+ res = TRUE;
break;
}
}
@@ -778,28 +765,28 @@ static BOOL _AniAva_GetAvatarImageInfo(DWORD dwAvatarUniqId, ANIAVATARIMAGEINFO }
static void _AniAva_Clear_ANIAVA_WINDOWINFO(ANIAVA_WINDOWINFO * pavwi )
{
- pavwi->delaysInterval=NULL;
- pavwi->nFramesCount=0;
+ pavwi->delaysInterval = NULL;
+ pavwi->nFramesCount = 0;
KillTimer(pavwi->hWindow,2);
- pavwi->bPlaying =FALSE;
- pavwi->TimerId=0;
+ pavwi->bPlaying = FALSE;
+ pavwi->TimerId = 0;
}
static void __AniAva_DebugRenderStrip()
{
return;
#ifdef _DEBUG
{
- HDC hDC_debug=GetDC(NULL);
+ HDC hDC_debug = GetDC(NULL);
BitBlt(hDC_debug,0,0,AniAva.width, AniAva.height,AniAva.hAniAvaDC,0,0,SRCCOPY);
DeleteDC(hDC_debug);
}
#endif
}
-static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NULL*/, RECT * rcInParent /* = NULL */ )
+static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL*/, RECT * rcInParent /*= NULL */ )
{
- if (dat->bPaused>0) { dat->bPended=TRUE; return; }
- else dat->bPended=FALSE;
+ if (dat->bPaused>0) { dat->bPended = TRUE; return; }
+ else dat->bPended = FALSE;
if ( IMMEDIATE_DRAW && hdcParent == NULL ) return;
GdiFlush();
@@ -808,37 +795,37 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NUL #endif
if (dat->bPlaying && IsWindowVisible(dat->hWindow))
{
- POINT ptWnd={0};
- SIZE szWnd={dat->rcPos.right-dat->rcPos.left,dat->rcPos.bottom-dat->rcPos.top};
- BLENDFUNCTION bf={AC_SRC_OVER, 0,g_CluiData.bCurrentAlpha*dat->bAlpha/256, AC_SRC_ALPHA };
- POINT pt_from={0,0};
- HDC hDC_animation=GetDC(NULL);
+ POINT ptWnd = {0};
+ SIZE szWnd = {dat->rcPos.right-dat->rcPos.left,dat->rcPos.bottom-dat->rcPos.top};
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0,g_CluiData.bCurrentAlpha*dat->bAlpha/256, AC_SRC_ALPHA };
+ POINT pt_from = {0,0};
+ HDC hDC_animation = GetDC(NULL);
HDC copyFromDC;
RECT clistRect;
- HDC tempDC=NULL;
+ HDC tempDC = NULL;
HBITMAP hBmp;
HBITMAP hOldBmp;
/*
- int x=bf.SourceConstantAlpha;
- x=(49152/(383-x))-129;
- x=min(x,255); x=max(x,0);
- bf.SourceConstantAlpha=x;
+ int x = bf.SourceConstantAlpha;
+ x = (49152/(383-x))-129;
+ x = min(x,255); x = max(x,0);
+ bf.SourceConstantAlpha = x;
*/
if ( AniAva.bFlags == 0 ) //simple and fastest method - no borders, round corners and etc. just copy
{
- pt_from.x=dat->ptFromPoint.x+dat->currentFrame*dat->sizeAvatar.cx;
- pt_from.y=dat->ptFromPoint.y;
- copyFromDC=AniAva.hAniAvaDC;
+ pt_from.x = dat->ptFromPoint.x+dat->currentFrame*dat->sizeAvatar.cx;
+ pt_from.y = dat->ptFromPoint.y;
+ copyFromDC = AniAva.hAniAvaDC;
}
else
{
// ... need to create additional hDC_animation
- HRGN hRgn=NULL;
- int cornerRadius= AniAva.cornerRadius;
- tempDC = CreateCompatibleDC( NULL );
- hBmp = ske_CreateDIB32( szWnd.cx, szWnd.cy );
- hOldBmp = (HBITMAP)SelectObject(tempDC,hBmp);
+ HRGN hRgn = NULL;
+ int cornerRadius = AniAva.cornerRadius;
+ tempDC = CreateCompatibleDC( NULL );
+ hBmp = ske_CreateDIB32( szWnd.cx, szWnd.cy );
+ hOldBmp = (HBITMAP)SelectObject(tempDC,hBmp);
if ( AniAva.bFlags & AAO_ROUND_CORNERS )
{
if (!cornerRadius) //auto radius
@@ -849,8 +836,8 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NUL // if has borders - create region (round corners) and fill it, remember internal as clipping
HBRUSH hBrush = CreateSolidBrush( AniAva.borderColor );
HBRUSH hOldBrush = (HBRUSH)SelectObject( tempDC, hBrush );
- HRGN rgnOutside = CreateRoundRectRgn( 0, 0, szWnd.cx+1, szWnd.cy+1, cornerRadius<<1, cornerRadius<<1);
- hRgn=CreateRoundRectRgn( 1, 1, szWnd.cx, szWnd.cy, cornerRadius<<1, cornerRadius<<1);
+ HRGN rgnOutside = CreateRoundRectRgn( 0, 0, szWnd.cx+1, szWnd.cy+1, cornerRadius << 1, cornerRadius << 1);
+ hRgn = CreateRoundRectRgn( 1, 1, szWnd.cx, szWnd.cy, cornerRadius << 1, cornerRadius << 1);
CombineRgn( rgnOutside,rgnOutside,hRgn,RGN_DIFF);
FillRgn( tempDC, rgnOutside, hBrush);
ske_SetRgnOpaque( tempDC, rgnOutside, TRUE);
@@ -861,11 +848,11 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NUL else if ( cornerRadius > 0 )
{
// else create clipping area (round corners)
- hRgn=CreateRoundRectRgn(0, 0, szWnd.cx+1, szWnd.cy+1, cornerRadius<<1, cornerRadius<<1);
+ hRgn = CreateRoundRectRgn(0, 0, szWnd.cx+1, szWnd.cy+1, cornerRadius << 1, cornerRadius << 1);
}
else
{
- hRgn=CreateRectRgn(0, 0, szWnd.cx+1, szWnd.cy+1);
+ hRgn = CreateRectRgn(0, 0, szWnd.cx+1, szWnd.cy+1);
}
// select clip area
if ( hRgn )
@@ -884,7 +871,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NUL BitBlt(tempDC,0, 0, szWnd.cx, szWnd.cy , AniAva.hAniAvaDC , dat->ptFromPoint.x+dat->sizeAvatar.cx*dat->currentFrame, dat->ptFromPoint.y, SRCCOPY);
else
{
- BLENDFUNCTION abf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION abf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
ske_AlphaBlend(tempDC,0, 0, szWnd.cx, szWnd.cy , AniAva.hAniAvaDC, dat->ptFromPoint.x+dat->sizeAvatar.cx*dat->currentFrame, dat->ptFromPoint.y, szWnd.cx, szWnd.cy, abf);
}
// reset clip area
@@ -897,34 +884,33 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NUL }
if ( ( AniAva.bFlags & AAO_HAS_OVERLAY )
- && ( dat->overlayIconIdx != -1 )
+ && ( dat->overlayIconIdx !=-1 )
&& ( AniAva.overlayIconImageList ))
{
// if overlay - draw overlay icon
// position - on avatar
- int x=szWnd.cx-ICON_WIDTH;
- int y=szWnd.cy-ICON_HEIGHT;
+ int x = szWnd.cx-ICON_WIDTH;
+ int y = szWnd.cy-ICON_HEIGHT;
ske_ImageList_DrawEx(AniAva.overlayIconImageList,
dat->overlayIconIdx&0xFFFF,
tempDC, x, y, ICON_WIDTH, ICON_HEIGHT,
CLR_NONE, CLR_NONE, ILD_NORMAL);
}
- copyFromDC=tempDC;
+ copyFromDC = tempDC;
}
// intersect visible area
// update layered window
GetWindowRect(pcli->hwndContactTree, &clistRect);
- if (dat->rcPos.top<0)
+ if (dat->rcPos.top < 0)
{
- pt_from.y+=-dat->rcPos.top;
- szWnd.cy+=dat->rcPos.top;
+ pt_from.y += -dat->rcPos.top;
+ szWnd.cy += dat->rcPos.top;
}
if (dat->rcPos.bottom>clistRect.bottom-clistRect.top)
- {
- szWnd.cy-=(dat->rcPos.bottom-(clistRect.bottom-clistRect.top));
- }
- ptWnd.x=dat->rcPos.left+clistRect.left;
- ptWnd.y=(dat->rcPos.top>0 ? dat->rcPos.top :0)+clistRect.top;
+ szWnd.cy -= (dat->rcPos.bottom-(clistRect.bottom-clistRect.top));
+
+ ptWnd.x = dat->rcPos.left+clistRect.left;
+ ptWnd.y = (dat->rcPos.top>0 ? dat->rcPos.top :0)+clistRect.top;
if (szWnd.cy>0)
{
if ( hdcParent && rcInParent && IMMEDIATE_DRAW )
@@ -933,15 +919,15 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NUL BitBlt( hdcParent, rcInParent->left, rcInParent->top, szWnd.cx, szWnd.cy, copyFromDC, pt_from.x, pt_from.y, SRCCOPY);
else
{
- BLENDFUNCTION abf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION abf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
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 ))
{
LONG exStyle;
- exStyle=GetWindowLongPtr(dat->hWindow,GWL_EXSTYLE);
- exStyle|=WS_EX_LAYERED;
+ exStyle = GetWindowLongPtr(dat->hWindow,GWL_EXSTYLE);
+ exStyle |= WS_EX_LAYERED;
SetWindowLongPtr(dat->hWindow,GWL_EXSTYLE,exStyle);
if ( !IMMEDIATE_DRAW )
SetWindowPos( pcli->hwndContactTree, dat->hWindow, 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING );
@@ -953,7 +939,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NUL }
else
{
- dat->bPlaying=FALSE;
+ dat->bPlaying = FALSE;
}
ReleaseDC(NULL,hDC_animation);
if (tempDC)
@@ -973,18 +959,18 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /* = NUL static void _AniAva_PausePainting()
{
int i;
- for (i=0; i<AniAva.Objects->realCount; i++)
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
SendMessage(pai->hWindow,AAM_PAUSE,0,0);
}
}
static void _AniAva_ResumePainting()
{
int i;
- for (i=0; i<AniAva.Objects->realCount; i++)
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
SendNotifyMessage(pai->hWindow,AAM_RESUME,0,0);
}
}
@@ -992,11 +978,11 @@ static void _AniAva_ResumePainting() static void _AniAva_ReduceAvatarImages(int startY, int dY, BOOL bDestroyWindow)
{
int i;
- for (i=0; i<AniAva.Objects->realCount; i++)
+ for (i = 0; i < AniAva.Objects->realCount; i++)
{
- ANIAVA_OBJECT * pai=(ANIAVA_OBJECT *)AniAva.Objects->items[i];
- int res=SendMessage(pai->hWindow,AAM_REMOVEAVATAR,(WPARAM)startY,(LPARAM)dY);
- if (res==0xDEAD && bDestroyWindow)
+ ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)AniAva.Objects->items[i];
+ int res = SendMessage(pai->hWindow,AAM_REMOVEAVATAR,(WPARAM)startY,(LPARAM)dY);
+ if (res == 0xDEAD && bDestroyWindow)
{
_AniAva_DestroyAvatarWindow(pai->hWindow);
mir_free(pai);
@@ -1012,34 +998,34 @@ static void _AniAva_LoadOptions() aacheck;
aalock;
{
- AniAva.bFlags= (db_get_b(NULL,"CList","AvatarsDrawBorders",SETTINGS_AVATARDRAWBORDER_DEFAULT)? AAO_HAS_BORDER :0) |
+ AniAva.bFlags = (db_get_b(NULL,"CList","AvatarsDrawBorders",SETTINGS_AVATARDRAWBORDER_DEFAULT)? AAO_HAS_BORDER :0) |
(db_get_b(NULL,"CList","AvatarsRoundCorners",SETTINGS_AVATARROUNDCORNERS_DEFAULT)? AAO_ROUND_CORNERS :0) |
(db_get_b(NULL,"CList","AvatarsDrawOverlay",SETTINGS_AVATARDRAWOVERLAY_DEFAULT)? AAO_HAS_OVERLAY :0) |
( (0) ? AAO_OPAQUE :0);
if (AniAva.bFlags & AAO_HAS_BORDER)
- AniAva.borderColor=(COLORREF)db_get_dw(NULL,"CList","AvatarsBorderColor",SETTINGS_AVATARBORDERCOLOR_DEFAULT);;
+ AniAva.borderColor = (COLORREF)db_get_dw(NULL,"CList","AvatarsBorderColor",SETTINGS_AVATARBORDERCOLOR_DEFAULT);;
if (AniAva.bFlags & AAO_ROUND_CORNERS)
- AniAva.cornerRadius=db_get_b(NULL,"CList","AvatarsUseCustomCornerSize",SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT)? db_get_w(NULL,"CList","AvatarsCustomCornerSize",SETTINGS_AVATARCORNERSIZE_DEFAULT) : 0;
+ AniAva.cornerRadius = db_get_b(NULL,"CList","AvatarsUseCustomCornerSize",SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT)? db_get_w(NULL,"CList","AvatarsCustomCornerSize",SETTINGS_AVATARCORNERSIZE_DEFAULT) : 0;
if (AniAva.bFlags & AAO_HAS_OVERLAY)
{
//check image list
- BYTE type=db_get_b(NULL,"CList","AvatarsOverlayType",SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
+ BYTE type = db_get_b(NULL,"CList","AvatarsOverlayType",SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
switch(type)
{
case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
- AniAva.overlayIconImageList=hAvatarOverlays;
+ AniAva.overlayIconImageList = hAvatarOverlays;
break;
case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
- AniAva.overlayIconImageList=g_himlCListClc;
+ AniAva.overlayIconImageList = g_himlCListClc;
break;
default:
- AniAva.overlayIconImageList=NULL;
+ AniAva.overlayIconImageList = NULL;
}
}
if (AniAva.bFlags & AAO_OPAQUE)
- AniAva.bkgColor=0;
+ AniAva.bkgColor = 0;
AniAva.bSeparateWindow = db_get_b(NULL,"CList","AvatarsInSeparateWnd",SETTINGS_AVATARINSEPARATE_DEFAULT);
}
@@ -1049,9 +1035,9 @@ static void _AniAva_AnimationTreadProc(HANDLE hExitEvent) {
//wait forever till hExitEvent signalled
DWORD rc;
- HANDLE hThread=0;
+ HANDLE hThread = 0;
DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&hThread,0,FALSE,DUPLICATE_SAME_ACCESS);
- AniAva.AnimationThreadHandle=hThread;
+ AniAva.AnimationThreadHandle = hThread;
SetThreadPriority(hThread,THREAD_PRIORITY_LOWEST);
for (;;)
{
@@ -1071,35 +1057,35 @@ static void _AniAva_AnimationTreadProc(HANDLE hExitEvent) DispatchMessage(&msg);
}
}
- else if ( rc==WAIT_OBJECT_0 )
+ else if ( rc == WAIT_OBJECT_0 )
{
break;
}
}
CloseHandle(AniAva.AnimationThreadHandle);
- AniAva.AnimationThreadHandle=NULL;
+ AniAva.AnimationThreadHandle = NULL;
}
static int _AniAva_SortAvatarInfo(void * first, void * last)
{
- int res=0;
- ANIAVA_INFO * aai1=(ANIAVA_INFO *)first;
- ANIAVA_INFO * aai2=(ANIAVA_INFO *)last;
+ int res = 0;
+ ANIAVA_INFO * aai1 = (ANIAVA_INFO *)first;
+ ANIAVA_INFO * aai2 = (ANIAVA_INFO *)last;
if (aai1 && aai1->tcsFilename &&
aai2 && aai2->tcsFilename)
{
- res=_tcsicmp(aai2->tcsFilename, aai1->tcsFilename);
+ res = _tcsicmp(aai2->tcsFilename, aai1->tcsFilename);
}
else
{
- int a1=(aai1 && aai1->tcsFilename)? 1:0;
- int a2=(aai2 && aai2->tcsFilename)? 1:0;
- res=a1-a2;
+ int a1 = (aai1 && aai1->tcsFilename)? 1:0;
+ int a2 = (aai2 && aai2->tcsFilename)? 1:0;
+ res = a1-a2;
}
- if (res==0)
+ if (res == 0)
{
- if ( aai1->FrameSize.cx==aai2->FrameSize.cx && aai1->FrameSize.cy==aai2->FrameSize.cy )
+ if ( aai1->FrameSize.cx == aai2->FrameSize.cx && aai1->FrameSize.cy == aai2->FrameSize.cy )
return 0;
else
return 1;
@@ -1118,15 +1104,15 @@ void _AniAva_InvalidateParent(ANIAVA_WINDOWINFO * dat) static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- ANIAVA_WINDOWINFO * dat=NULL;
- if (msg==WM_TIMER || msg==WM_DESTROY || (msg>AAM_FIRST && msg<AAM_LAST))
- dat=(ANIAVA_WINDOWINFO *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ ANIAVA_WINDOWINFO * dat = NULL;
+ if (msg == WM_TIMER || msg == WM_DESTROY || (msg>AAM_FIRST && msg < AAM_LAST))
+ dat = (ANIAVA_WINDOWINFO *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch (msg)
{
case AAM_REMOVEAVATAR:
- if (dat->ptFromPoint.x==(int)wParam) return 0xDEAD; //need to destroy window
- else if (dat->ptFromPoint.x>(int)wParam) dat->ptFromPoint.x-=(int)lParam;
+ if (dat->ptFromPoint.x == (int)wParam) return 0xDEAD; //need to destroy window
+ else if (dat->ptFromPoint.x>(int)wParam) dat->ptFromPoint.x -= (int)lParam;
return 0;
case AAM_PAUSE:
@@ -1141,13 +1127,13 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if ( !IMMEDIATE_DRAW )
_AniAva_RenderAvatar(dat);
}
- dat->bPended=FALSE;
+ dat->bPended = FALSE;
return 0;
case AAM_STOP:
if (dat->bPlaying)
{
- dat->bPlaying=FALSE;
+ dat->bPlaying = FALSE;
KillTimer(hwnd,2);
ShowWindow(hwnd, SW_HIDE);
}
@@ -1155,31 +1141,31 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case AAM_SETAVATAR:
{
- ANIAVATARIMAGEINFO *paaii=(ANIAVATARIMAGEINFO*)wParam;
+ ANIAVATARIMAGEINFO *paaii = (ANIAVATARIMAGEINFO*)wParam;
_AniAva_Clear_ANIAVA_WINDOWINFO(dat);
- dat->nFramesCount=paaii->nFramesCount;
- dat->delaysInterval=paaii->pFrameDelays;
- dat->sizeAvatar=paaii->szSize;
- dat->ptFromPoint=paaii->ptImagePos;
- dat->currentFrame=0;
- dat->bPlaying=FALSE;
+ dat->nFramesCount = paaii->nFramesCount;
+ dat->delaysInterval = paaii->pFrameDelays;
+ dat->sizeAvatar = paaii->szSize;
+ dat->ptFromPoint = paaii->ptImagePos;
+ dat->currentFrame = 0;
+ dat->bPlaying = FALSE;
return MAKELONG(dat->sizeAvatar.cx,dat->sizeAvatar.cy);
}
case AAM_SETPOSITION:
{
- ANIAVA_POSINFO * papi=(ANIAVA_POSINFO *)lParam;
+ ANIAVA_POSINFO * papi = (ANIAVA_POSINFO *)lParam;
if (!dat->delaysInterval) return 0;
if (!papi) return 0;
- dat->rcPos=papi->rcPos;
- dat->overlayIconIdx=papi->idxOverlay;
- dat->bAlpha=papi->bAlpha;
+ dat->rcPos = papi->rcPos;
+ dat->overlayIconIdx = papi->idxOverlay;
+ dat->bAlpha = papi->bAlpha;
free(papi);
if (!dat->bPlaying)
{
- dat->bPlaying=TRUE;
+ dat->bPlaying = TRUE;
ShowWindow(hwnd,SW_SHOWNA);
- dat->currentFrame=0;
+ dat->currentFrame = 0;
KillTimer(hwnd,2);
SetTimer(hwnd,2,dat->delaysInterval[0],NULL);
}
@@ -1189,7 +1175,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR }
case AAM_SETPARENT:
if ( IMMEDIATE_DRAW ) return 0;
- dat->bOrderTop=((HWND)wParam!=GetDesktopWindow());
+ dat->bOrderTop = ((HWND)wParam != GetDesktopWindow());
SetParent(hwnd,(HWND)wParam);
if (dat->bOrderTop)
{
@@ -1198,7 +1184,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR else
{
LONG exStyle;
- exStyle=GetWindowLongPtr(pcli->hwndContactList,GWL_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))
SetWindowPos(pcli->hwndContactList,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
@@ -1217,7 +1203,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR else
{
LONG exStyle;
- exStyle=GetWindowLongPtr(pcli->hwndContactList,GWL_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))
SetWindowPos(pcli->hwndContactList,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
@@ -1244,15 +1230,15 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR LONG exStyle;
ANIAVA_WINDOWINFO * dat = (ANIAVA_WINDOWINFO *) mir_calloc(sizeof (ANIAVA_WINDOWINFO));
SetWindowLongPtr(hwnd,GWLP_USERDATA,(LONG_PTR)dat);
- dat->hWindow=hwnd;
+ dat->hWindow = hwnd;
//ShowWindow(dat->hWindow,SW_SHOW);
//change layered mode
- exStyle=GetWindowLongPtr(dat->hWindow,GWL_EXSTYLE);
- exStyle|=WS_EX_LAYERED;
+ exStyle = GetWindowLongPtr(dat->hWindow,GWL_EXSTYLE);
+ exStyle |= WS_EX_LAYERED;
SetWindowLongPtr(dat->hWindow,GWL_EXSTYLE,exStyle);
- exStyle=GetWindowLongPtr(dat->hWindow,GWL_STYLE);
- exStyle&=~WS_POPUP;
- exStyle|=WS_CHILD;
+ exStyle = GetWindowLongPtr(dat->hWindow,GWL_STYLE);
+ exStyle &= ~WS_POPUP;
+ exStyle |= WS_CHILD;
SetWindowLongPtr(dat->hWindow,GWL_STYLE,exStyle);
break;
}
@@ -1264,8 +1250,8 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR return 0;
}
dat->currentFrame++;
- if (dat->currentFrame>=dat->nFramesCount)
- dat->currentFrame=0;
+ if (dat->currentFrame >= dat->nFramesCount)
+ dat->currentFrame = 0;
if ( !IMMEDIATE_DRAW )
_AniAva_RenderAvatar( dat );
diff --git a/plugins/Clist_modern/modern_awaymsg.cpp b/plugins/Clist_modern/modern_awaymsg.cpp index 2445b27794..de53d066ba 100644 --- a/plugins/Clist_modern/modern_awaymsg.cpp +++ b/plugins/Clist_modern/modern_awaymsg.cpp @@ -65,29 +65,29 @@ static int amAddHandleToChain(HANDLE hContact) {
//check that handle is present
AMCHAINITEM * wChain;
- wChain=amFirstChainItem;
+ wChain = amFirstChainItem;
if (wChain)
do {
- if (wChain->hContact==hContact)
+ if (wChain->hContact == hContact)
{
amunlock;
return 0;
}
- } while(wChain=(AMCHAINITEM *)wChain->Next);
+ } while(wChain = (AMCHAINITEM *)wChain->Next);
}
if (!amFirstChainItem)
{
- amFirstChainItem=(AMCHAINITEM*)malloc(sizeof(AMCHAINITEM));
- workChain=amFirstChainItem;
+ amFirstChainItem = (AMCHAINITEM*)malloc(sizeof(AMCHAINITEM));
+ workChain = amFirstChainItem;
}
else
{
- amLastChainItem->Next=(AMCHAINITEM*)malloc(sizeof(AMCHAINITEM));
- workChain=(AMCHAINITEM *)amLastChainItem->Next;
+ amLastChainItem->Next = (AMCHAINITEM*)malloc(sizeof(AMCHAINITEM));
+ workChain = (AMCHAINITEM *)amLastChainItem->Next;
}
- amLastChainItem=workChain;
- workChain->Next=NULL;
- workChain->hContact=hContact;
+ amLastChainItem = workChain;
+ workChain->Next = NULL;
+ workChain->hContact = hContact;
amunlock;
SetEvent(hamProcessEvent);
return 1;
@@ -100,14 +100,14 @@ static int amAddHandleToChain(HANDLE hContact) static HANDLE amGetCurrentChain()
{
AMCHAINITEM * workChain;
- HANDLE res=NULL;
+ HANDLE res = NULL;
amlock;
if (amFirstChainItem)
{
- res=amFirstChainItem->hContact;
- workChain=amFirstChainItem->Next;
+ res = amFirstChainItem->hContact;
+ workChain = amFirstChainItem->Next;
free(amFirstChainItem);
- amFirstChainItem=(AMCHAINITEM *)workChain;
+ amFirstChainItem = (AMCHAINITEM *)workChain;
}
amunlock;
return res;
@@ -120,58 +120,58 @@ static int amThreadProc(HWND hwnd) {
DWORD time;
HANDLE hContact;
- HANDLE ACK=0;
+ HANDLE ACK = 0;
displayNameCacheEntry dnce;
memset( &dnce, 0, sizeof(dnce));
while (!MirandaExiting())
{
- hContact=amGetCurrentChain();
+ hContact = amGetCurrentChain();
while (hContact)
{
- time=GetTickCount();
- if ((time-amRequestTick)<AMASKPERIOD)
+ time = GetTickCount();
+ if ((time-amRequestTick) < AMASKPERIOD)
{
SleepEx(AMASKPERIOD-(time-amRequestTick)+10,TRUE);
if (MirandaExiting())
{
- g_dwAwayMsgThreadID=0;
+ g_dwAwayMsgThreadID = 0;
return 0;
}
}
CListSettings_FreeCacheItemData(&dnce);
- dnce.m_cache_hContact=(HANDLE)hContact;
+ dnce.m_cache_hContact = (HANDLE)hContact;
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 (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)
{
ACKDATA ack;
- ack.hContact=hContact;
- ack.type=ACKTYPE_AWAYMSG;
- ack.result=ACKRESULT_FAILED;
+ ack.hContact = hContact;
+ ack.type = ACKTYPE_AWAYMSG;
+ ack.result = ACKRESULT_FAILED;
if (dnce.m_cache_cszProto)
- ack.szModule=dnce.m_cache_cszProto;
+ ack.szModule = dnce.m_cache_cszProto;
else
- ack.szModule=NULL;
+ ack.szModule = NULL;
ClcDoProtoAck(hContact, &ack);
}
CListSettings_FreeCacheItemData(&dnce);
- amRequestTick=time;
- hContact=amGetCurrentChain();
+ amRequestTick = time;
+ hContact = amGetCurrentChain();
if (hContact)
{
- DWORD i=0;
+ DWORD i = 0;
do
{
i++;
SleepEx(50,TRUE);
- } while (i<AMASKPERIOD/50&&!MirandaExiting());
+ } while (i < AMASKPERIOD/50&&!MirandaExiting());
}
else break;
if (MirandaExiting())
{
- g_dwAwayMsgThreadID=0;
+ g_dwAwayMsgThreadID = 0;
return 0;
}
}
@@ -179,11 +179,11 @@ static int amThreadProc(HWND hwnd) ResetEvent(hamProcessEvent);
if (MirandaExiting())
{
- g_dwAwayMsgThreadID=0;
+ g_dwAwayMsgThreadID = 0;
return 0;
}
}
- g_dwAwayMsgThreadID=0;
+ g_dwAwayMsgThreadID = 0;
return 1;
}
@@ -209,7 +209,7 @@ void amRequestAwayMsg(HANDLE hContact) return;
//Do not re-ask for chat rooms
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
- if (szProto == NULL || db_get_b(hContact, szProto, "ChatRoom", 0) != 0)
+ if (szProto == NULL || db_get_b(hContact, szProto, "ChatRoom", 0) !=0)
return;
amAddHandleToChain(hContact);
}
@@ -217,8 +217,8 @@ void amRequestAwayMsg(HANDLE hContact) void InitAwayMsgModule()
{
InitializeCriticalSection(&amLockChain);
- hamProcessEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
- g_dwAwayMsgThreadID=(DWORD)mir_forkthread((pThreadFunc)amThreadProc,0);
+ hamProcessEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
+ g_dwAwayMsgThreadID = (DWORD)mir_forkthread((pThreadFunc)amThreadProc,0);
}
void UninitAwayMsgModule()
diff --git a/plugins/Clist_modern/modern_cachefuncs.cpp b/plugins/Clist_modern/modern_cachefuncs.cpp index 9beb1da22d..3e6f69bc2c 100644 --- a/plugins/Clist_modern/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/modern_cachefuncs.cpp @@ -78,9 +78,9 @@ void Cache_GetText(struct ClcData *dat, struct ClcContact *contact, BOOL forceRe Cache_GetFirstLineText(dat, contact);
if (!dat->force_in_dialog)// && !dat->isStarting)
{
- PDNCE pdnce=(PDNCE)pcli->pfnGetCacheEntry(contact->hContact);
- if ( (dat->second_line_show&&(forceRenew||pdnce->szSecondLineText==NULL))
- ||(dat->third_line_show&&(forceRenew||pdnce->szThirdLineText==NULL)) )
+ PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry(contact->hContact);
+ if ( (dat->second_line_show&&(forceRenew||pdnce->szSecondLineText == NULL))
+ ||(dat->third_line_show&&(forceRenew||pdnce->szThirdLineText == NULL)) )
{
gtaAddRequest(dat,contact, contact->hContact);
}
@@ -145,14 +145,14 @@ void CSmileyString::_CopySmileyList( SortedList *plInput ) // ASSERT( plText == NULL );
if ( !plInput || plInput->realCount == 0 ) return;
- plText=List_Create( 0, 1 );
+ plText = List_Create( 0, 1 );
for ( int i = 0; i < plInput->realCount; i++ )
{
- ClcContactTextPiece *pieceFrom=(ClcContactTextPiece *) plInput->items[i];
- if ( pieceFrom != NULL )
+ ClcContactTextPiece *pieceFrom = (ClcContactTextPiece *) plInput->items[i];
+ if ( pieceFrom !=NULL )
{
ClcContactTextPiece *piece = (ClcContactTextPiece *) mir_alloc( sizeof(ClcContactTextPiece));
- *piece=*pieceFrom;
+ *piece = *pieceFrom;
if ( pieceFrom->type == TEXT_PIECE_TYPE_SMILEY)
piece->smiley = CopyIcon( pieceFrom->smiley );
List_Insert( plText, piece, plText->realCount );
@@ -171,18 +171,18 @@ void CSmileyString::DestroySmileyList() return;
}
- if ( plText->realCount != 0 )
+ if ( plText->realCount !=0 )
{
int i;
for ( i = 0 ; i < plText->realCount ; i++ )
{
- if ( plText->items[i] != NULL )
+ if ( plText->items[i] !=NULL )
{
ClcContactTextPiece *piece = (ClcContactTextPiece *) plText->items[i];
if ( !IsBadWritePtr(piece, sizeof(ClcContactTextPiece)) )
{
- if (piece->type==TEXT_PIECE_TYPE_SMILEY && piece->smiley != g_hListeningToIcon)
+ if (piece->type == TEXT_PIECE_TYPE_SMILEY && piece->smiley !=g_hListeningToIcon)
DestroyIcon_protect(piece->smiley);
mir_free(piece);
}
@@ -202,7 +202,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, PDNCE pdnce, TCHAR * s SMADD_BATCHPARSE2 sp = {0};
SMADD_BATCHPARSERES *spr;
- int last_pos=0;
+ int last_pos = 0;
iMaxSmileyHeight = 0;
DestroySmileyList();
@@ -221,10 +221,10 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, PDNCE pdnce, TCHAR * s {
sp.Protocolname = pdnce->m_cache_cszProto;
- if (db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->m_cache_cszProto != NULL && g_szMetaModuleName && strcmp(pdnce->m_cache_cszProto, g_szMetaModuleName) == 0)
+ if (db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) !=1 && pdnce->m_cache_cszProto !=NULL && g_szMetaModuleName && strcmp(pdnce->m_cache_cszProto, g_szMetaModuleName) == 0)
{
HANDLE hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (LPARAM)pdnce->m_cache_hContact, 0);
- if (hContact != 0)
+ if (hContact !=0)
{
sp.Protocolname = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (LPARAM)hContact, 0);
}
@@ -251,7 +251,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, PDNCE pdnce, TCHAR * s for (unsigned i = 0; i < sp.numSmileys; ++i)
{
- if (spr[i].hIcon != NULL) // For deffective smileypacks
+ if (spr[i].hIcon !=NULL) // For deffective smileypacks
{
// Add text
if (spr[i].startChar - last_pos > 0)
@@ -318,24 +318,24 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, PDNCE pdnce, TCHAR * s */
int GetStatusName(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_priority)
{
- BOOL noAwayMsg=FALSE;
- BOOL noXstatus=FALSE;
+ BOOL noAwayMsg = FALSE;
+ BOOL noXstatus = FALSE;
// Hide status text if Offline /// no offline
- WORD nStatus=pdnce___GetStatus( pdnce );
- if ((nStatus==ID_STATUS_OFFLINE || nStatus==0) && g_CluiData.bRemoveAwayMessageForOffline) noAwayMsg=TRUE;
- if (nStatus==ID_STATUS_OFFLINE || nStatus==0) noXstatus=TRUE;
+ WORD nStatus = pdnce___GetStatus( pdnce );
+ if ((nStatus == ID_STATUS_OFFLINE || nStatus == 0) && g_CluiData.bRemoveAwayMessageForOffline) noAwayMsg = TRUE;
+ 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)
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
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);
- if (text[0] != '\0')
+ if (text[0] !='\0')
return -1;
}
}
@@ -345,21 +345,21 @@ int GetStatusName(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_prio TCHAR *tmp = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)nStatus, GSMDF_TCHAR_MY);
lstrcpyn(text, tmp, text_size);
//CopySkipUnprintableChars(text, dbv.pszVal, text_size-1);
- if (text[0] != '\0')
+ if (text[0] !='\0')
return 1;
}
// Get XStatusName
if (!noAwayMsg && !noXstatus && !xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto)
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
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);
- if (text[0] != '\0')
+ if (text[0] !='\0')
return -1;
}
}
@@ -372,11 +372,11 @@ int GetStatusName(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_prio */
void GetListeningTo(TCHAR *text, int text_size, PDNCE pdnce)
{
- DBVARIANT dbv={0};
- WORD wStatus=pdnce___GetStatus( pdnce );
+ DBVARIANT dbv = {0};
+ WORD wStatus = pdnce___GetStatus( pdnce );
text[0] = _T('\0');
- if (wStatus==ID_STATUS_OFFLINE || wStatus==0)
+ if (wStatus == ID_STATUS_OFFLINE || wStatus == 0)
return;
if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "ListeningTo", &dbv))
@@ -392,13 +392,13 @@ void GetListeningTo(TCHAR *text, int text_size, PDNCE pdnce) */
int GetStatusMessage(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_priority)
{
- DBVARIANT dbv={0};
- BOOL noAwayMsg=FALSE;
- WORD wStatus=pdnce___GetStatus( pdnce );
+ DBVARIANT dbv = {0};
+ BOOL noAwayMsg = FALSE;
+ WORD wStatus = pdnce___GetStatus( pdnce );
text[0] = '\0';
// Hide status text if Offline /// no offline
- if (wStatus==ID_STATUS_OFFLINE || wStatus==0) noAwayMsg=TRUE;
+ if (wStatus == ID_STATUS_OFFLINE || wStatus == 0) noAwayMsg = TRUE;
// Get XStatusMsg
if (!noAwayMsg &&xstatus_has_priority && pdnce->m_cache_hContact && pdnce->m_cache_cszProto)
{
@@ -409,7 +409,7 @@ int GetStatusMessage(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_ CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
- if (text[0] != '\0')
+ if (text[0] !='\0')
return -1;
}
}
@@ -423,7 +423,7 @@ int GetStatusMessage(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_ CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
- if (text[0] != '\0')
+ if (text[0] !='\0')
return 1;
}
}
@@ -438,7 +438,7 @@ int GetStatusMessage(TCHAR *text, int text_size, PDNCE pdnce, BOOL xstatus_has_ CopySkipUnprintableChars(text, dbv.ptszVal, text_size-1);
db_free(&dbv);
- if (text[0] != '\0')
+ if (text[0] !='\0')
return -1;
}
}
@@ -458,11 +458,11 @@ int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR * switch(type) {
case TEXT_STATUS:
if (GetStatusName(text, text_size, pdnce, xstatus_has_priority) == -1 && use_name_and_message_for_xstatus) {
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
// Try to get XStatusMsg
if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
- if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0) {
+ if (dbv.ptszVal !=NULL && dbv.ptszVal[0] !=0) {
TCHAR *tmp = mir_tstrdup(text);
mir_sntprintf(text, text_size, TEXT("%s: %s"), tmp, dbv.pszVal);
mir_free_and_nill(tmp);
@@ -476,7 +476,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};
+ DBVARIANT dbv = {0};
if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
lstrcpyn(text, dbv.ptszVal, text_size);
db_free(&dbv);
@@ -488,11 +488,11 @@ int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR * case TEXT_STATUS_MESSAGE:
if (GetStatusMessage(text, text_size, pdnce, xstatus_has_priority) == -1 && use_name_and_message_for_xstatus) {
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
// Try to get XStatusName
if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
- if (dbv.pszVal != NULL && dbv.pszVal[0] != 0) {
+ if (dbv.pszVal !=NULL && dbv.pszVal[0] !=0) {
TCHAR *tmp = mir_tstrdup(text);
mir_sntprintf(text, text_size, TEXT("%s: %s"), dbv.pszVal, tmp);
@@ -503,10 +503,10 @@ 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};
+ DBVARIANT dbv = {0};
// Try to get XStatusName
if (!DBGetContactSettingTString(pdnce->m_cache_hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
- if (dbv.pszVal != NULL && dbv.pszVal[0] != 0)
+ if (dbv.pszVal !=NULL && dbv.pszVal[0] !=0)
mir_sntprintf(text, text_size, TEXT("%s"), dbv.pszVal);
CopySkipUnprintableChars(text, text, text_size-1);
db_free(&dbv);
@@ -516,7 +516,7 @@ int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR * if (text[0] == '\0') {
if (show_listening_if_no_away) {
Cache_GetLineText(pdnce, TEXT_LISTENING_TO, text, text_size, variable_text, xstatus_has_priority, 0, 0, use_name_and_message_for_xstatus, pdnce_time_show_only_if_different);
- if (text[0] != '\0')
+ if (text[0] !='\0')
return TEXT_LISTENING_TO;
}
@@ -560,11 +560,11 @@ int Cache_GetLineText(PDNCE pdnce, int type, LPTSTR text, int text_size, TCHAR * void Cache_GetFirstLineText(struct ClcData *dat, struct ClcContact *contact)
{
- if (GetCurrentThreadId()!=g_dwMainThreadID)
+ if (GetCurrentThreadId() != g_dwMainThreadID)
return;
- PDNCE pdnce=(PDNCE)pcli->pfnGetCacheEntry(contact->hContact);
+ PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry(contact->hContact);
TCHAR *name = pcli->pfnGetContactDisplayName(contact->hContact,0);
if (dat->first_line_append_nick && (!dat->force_in_dialog)) {
DBVARIANT dbv = {0};
@@ -589,7 +589,7 @@ void Cache_GetFirstLineText(struct ClcData *dat, struct ClcContact *contact) }
if (!dat->force_in_dialog)
{
- struct SHORTDATA data={0};
+ struct SHORTDATA data = {0};
Sync(CLUI_SyncGetShortData,(WPARAM)pcli->hwndContactTree,(LPARAM)&data);
contact->ssText.ReplaceSmileys(&data, pdnce, contact->szText, dat->first_line_draw_smileys);
}
@@ -603,26 +603,26 @@ void Cache_GetFirstLineText(struct ClcData *dat, struct ClcContact *contact) void Cache_GetSecondLineText(struct SHORTDATA *dat, PDNCE pdnce)
{
- TCHAR Text[240-MAXEXTRACOLUMNS]={0};
+ TCHAR Text[240-MAXEXTRACOLUMNS] = {0};
int type = TEXT_EMPTY;
if (dat->second_line_show)
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
+ Text[SIZEOF(Text)-1] = _T('\0'); //to be sure that it is null terminated string
//LockCacheItem(hContact, __FILE__,__LINE__);
if (pdnce->szSecondLineText) mir_free(pdnce->szSecondLineText);
- if (dat->second_line_show)// Text[0]!='\0')
- pdnce->szSecondLineText=mir_tstrdup((TCHAR*)Text);
+ if (dat->second_line_show)// Text[0] != '\0')
+ pdnce->szSecondLineText = mir_tstrdup((TCHAR*)Text);
else
- pdnce->szSecondLineText=NULL;
+ pdnce->szSecondLineText = NULL;
if (pdnce->szSecondLineText)
{
- if (type == TEXT_LISTENING_TO && pdnce->szSecondLineText[0] != _T('\0'))
+ if (type == TEXT_LISTENING_TO && pdnce->szSecondLineText[0] !=_T('\0'))
{
pdnce->ssSecondLine.AddListeningToIcon(dat, pdnce, pdnce->szSecondLineText, dat->second_line_draw_smileys);
}
@@ -639,7 +639,7 @@ void Cache_GetSecondLineText(struct SHORTDATA *dat, PDNCE pdnce) */
void Cache_GetThirdLineText(struct SHORTDATA *dat, PDNCE pdnce)
{
- TCHAR Text[240-MAXEXTRACOLUMNS]={0};
+ TCHAR Text[240-MAXEXTRACOLUMNS] = {0};
int type = TEXT_EMPTY;
if (dat->third_line_show)
type = Cache_GetLineText(pdnce, dat->third_line_type,(TCHAR*)Text, SIZEOF(Text), dat->third_line_text,
@@ -647,18 +647,18 @@ void Cache_GetThirdLineText(struct SHORTDATA *dat, PDNCE pdnce) 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] = _T('\0'); //to be sure that it is null terminated string
if (pdnce->szThirdLineText) mir_free(pdnce->szThirdLineText);
- if (dat->third_line_show)//Text[0]!='\0')
- pdnce->szThirdLineText=mir_tstrdup((TCHAR*)Text);
+ if (dat->third_line_show)//Text[0] != '\0')
+ pdnce->szThirdLineText = mir_tstrdup((TCHAR*)Text);
else
- pdnce->szThirdLineText=NULL;
+ pdnce->szThirdLineText = NULL;
if (pdnce->szThirdLineText)
{
- if (type == TEXT_LISTENING_TO && pdnce->szThirdLineText[0] != _T('\0'))
+ if (type == TEXT_LISTENING_TO && pdnce->szThirdLineText[0] !=_T('\0'))
{
pdnce->ssThirdLine.AddListeningToIcon(dat, pdnce, pdnce->szThirdLineText, dat->third_line_draw_smileys);
}
@@ -673,12 +673,12 @@ void Cache_GetThirdLineText(struct SHORTDATA *dat, PDNCE pdnce) 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))
+ TCHAR * st = to;
+ int len = (int)_tcslen(tag);
+ int lastsize = (int)_tcslen(to)+1;
+ while (st = _tcsstr(st,tag))
{
- lastsize-=len;
+ lastsize -= len;
memmove((void*)st,(void*)(st+len),(lastsize)*sizeof(TCHAR));
}
}
@@ -690,48 +690,48 @@ void RemoveTag(TCHAR *to, TCHAR *tag) static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size)
{
DWORD i;
- BOOL keep=0;
- TCHAR * cp=to;
+ BOOL keep = 0;
+ TCHAR * cp = to;
if (!to) return 0;
if (!buf)
{
- to[0]='\0';
+ 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) break;
+ if (buf[i]>0 && buf[i] < ' ')
{
- *cp=' ';
+ *cp = ' ';
if (!keep) cp++;
- keep=1;
+ keep = 1;
}
else
{
- keep=0;
- *cp=buf[i];
+ keep = 0;
+ *cp = buf[i];
cp++;
}
}
- *cp=0;
+ *cp = 0;
{
- //remove bbcodes: [b] [i] [u] <b> <i> <u>
+ //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]"));
- 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;
}
@@ -741,7 +741,7 @@ static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size) static BOOL ExecuteOnAllContacts(struct ClcData *dat, ExecuteOnAllContactsFuncPtr func, void *param)
{
BOOL res;
- res=ExecuteOnAllContactsOfGroup(&dat->list, func, param);
+ res = ExecuteOnAllContactsOfGroup(&dat->list, func, param);
return res;
}
@@ -798,7 +798,7 @@ void UpdateAllAvatars(struct ClcData *dat) BOOL ReduceAvatarPosition(struct ClcContact *contact, BOOL subcontact, void *param)
{
- if (contact->avatar_pos >= *((int *)param))
+ if (contact->avatar_pos >= *((int *)param))
{
contact->avatar_pos--;
}
@@ -809,24 +809,24 @@ BOOL ReduceAvatarPosition(struct ClcContact *contact, BOOL subcontact, void *par void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact)
{
- struct avatarCacheEntry * ace=contact->avatar_data;
- int old_pos=contact->avatar_pos;
+ struct avatarCacheEntry * ace = contact->avatar_data;
+ int old_pos = contact->avatar_pos;
- if ( ace==NULL
+ if ( ace == NULL
|| ace->dwFlags == AVS_BITMAP_EXPIRED
|| ace->hbmPic == NULL)
{
//Avatar was not ready or removed - need to remove it from cache
- if (old_pos>=0)
+ if (old_pos >= 0)
{
ImageArray_RemoveImage(&dat->avatar_cache, old_pos);
// Update all items
ExecuteOnAllContacts(dat, ReduceAvatarPosition, (void *)&old_pos);
- contact->avatar_pos=AVATAR_POS_DONT_HAVE;
+ contact->avatar_pos = AVATAR_POS_DONT_HAVE;
return;
}
}
- else if (contact->avatar_data->hbmPic != NULL) //Lets Add it
+ else if (contact->avatar_data->hbmPic !=NULL) //Lets Add it
{
HDC hdc;
HBITMAP hDrawBmp,oldBmp;
@@ -852,25 +852,25 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) if (wildcmpi(contact->avatar_data->szFilename,_T("*.gif")))
{
int res;
- if (old_pos==AVATAR_POS_ANIMATED)
+ if (old_pos == AVATAR_POS_ANIMATED)
AniAva_RemoveAvatar(contact->hContact);
- res=AniAva_AddAvatar(contact->hContact, contact->avatar_data->szFilename, width_clip, height_clip);
+ res = AniAva_AddAvatar(contact->hContact, contact->avatar_data->szFilename, width_clip, height_clip);
if (res)
{
- contact->avatar_pos=AVATAR_POS_ANIMATED;
- contact->avatar_size.cy=HIWORD(res);
- contact->avatar_size.cx=LOWORD(res);
+ contact->avatar_pos = AVATAR_POS_ANIMATED;
+ contact->avatar_size.cy = HIWORD(res);
+ contact->avatar_size.cx = LOWORD(res);
return;
}
}
// Create objs
hdc = CreateCompatibleDC(dat->avatar_cache.hdc);
hDrawBmp = ske_CreateDIB32Point(width_clip, height_clip,&pt);
- oldBmp=(HBITMAP)SelectObject(hdc, hDrawBmp);
+ oldBmp = (HBITMAP)SelectObject(hdc, hDrawBmp);
//need to draw avatar bitmap here
{
- RECT real_rc={0,0,width_clip, height_clip};
+ RECT real_rc = {0,0,width_clip, height_clip};
/*
if (ServiceExists(MS_AV_BLENDDRAWAVATAR))
{
@@ -887,8 +887,8 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) else
*/
{
- int w=width_clip;
- int h=height_clip;
+ int w = width_clip;
+ int h = height_clip;
if (!g_CluiData.fGDIPlusFail) //Use gdi+ engine
{
DrawAvatarImageWithGDIp(hdc, 0, 0, w, h,ace->hbmPic,0,0,ace->bmWidth,ace->bmHeight,ace->dwFlags,255);
@@ -898,11 +898,11 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) if (!(ace->dwFlags&AVS_PREMULTIPLIED))
{
HDC hdcTmp = CreateCompatibleDC(hdc);
- RECT r={0,0,w,h};
+ RECT r = {0,0,w,h};
HDC hdcTmp2 = CreateCompatibleDC(hdc);
- HBITMAP bmo=(HBITMAP)SelectObject(hdcTmp,ace->hbmPic);
- HBITMAP b2=ske_CreateDIB32(w,h);
- HBITMAP bmo2=(HBITMAP)SelectObject(hdcTmp2,b2);
+ HBITMAP bmo = (HBITMAP)SelectObject(hdcTmp,ace->hbmPic);
+ HBITMAP b2 = ske_CreateDIB32(w,h);
+ HBITMAP bmo2 = (HBITMAP)SelectObject(hdcTmp2,b2);
SetStretchBltMode(hdcTmp, HALFTONE);
SetStretchBltMode(hdcTmp2, HALFTONE);
StretchBlt(hdcTmp2, 0, 0, w, h,
@@ -918,7 +918,7 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) DeleteObject(b2);
}
else {
- BLENDFUNCTION bf={AC_SRC_OVER, 0,255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0,255, AC_SRC_ALPHA };
HDC hdcTempAv = CreateCompatibleDC(hdc);
HBITMAP hbmTempAvOld;
hbmTempAvOld = (HBITMAP)SelectObject(hdcTempAv,ace->hbmPic);
@@ -932,7 +932,7 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) SelectObject(hdc,oldBmp);
DeleteDC(hdc);
// Add to list
- if (old_pos >= 0)
+ if (old_pos >= 0)
{
ImageArray_ChangeImage(&dat->avatar_cache, hDrawBmp, old_pos);
contact->avatar_pos = old_pos;
@@ -941,7 +941,7 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) {
contact->avatar_pos = ImageArray_AddImage(&dat->avatar_cache, hDrawBmp, -1);
}
- if (old_pos==AVATAR_POS_ANIMATED && contact->avatar_pos!=AVATAR_POS_ANIMATED)
+ if (old_pos == AVATAR_POS_ANIMATED && contact->avatar_pos != AVATAR_POS_ANIMATED)
{
AniAva_RemoveAvatar(contact->hContact);
}
@@ -954,8 +954,8 @@ void Cache_ProceedAvatarInList(struct ClcData *dat, struct ClcContact *contact) void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact)
{
- int old_pos=contact->avatar_pos;
- if (g_CluiData.bSTATE!=STATE_NORMAL
+ int old_pos = contact->avatar_pos;
+ if (g_CluiData.bSTATE != STATE_NORMAL
|| (dat->use_avatar_service && !ServiceExists(MS_AV_GETAVATARBITMAP))) // workaround for avatar service and other wich destroys service on OK_TOEXIT
{
contact->avatar_pos = AVATAR_POS_DONT_HAVE;
@@ -967,13 +967,13 @@ void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact) if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0))
{
contact->avatar_data = (struct avatarCacheEntry *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)contact->hContact, 0);
- if (contact->avatar_data == NULL || contact->avatar_data->cbSize != sizeof(struct avatarCacheEntry)
+ if (contact->avatar_data == NULL || contact->avatar_data->cbSize !=sizeof(struct avatarCacheEntry)
|| contact->avatar_data->dwFlags == AVS_BITMAP_EXPIRED)
{
contact->avatar_data = NULL;
}
- if (contact->avatar_data != NULL)
+ if (contact->avatar_data !=NULL)
{
contact->avatar_data->t_lastAccess = (DWORD)time(NULL);
}
@@ -993,7 +993,7 @@ void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact) if (!DBGetContactSettingTString(contact->hContact, "ContactPhoto", "File", &dbv))
{
HBITMAP hBmp = (HBITMAP) CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
- if (hBmp != NULL)
+ if (hBmp !=NULL)
{
// Make bounds
BITMAP bm;
@@ -1024,7 +1024,7 @@ void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact) // Create objs
hdc = CreateCompatibleDC(dat->avatar_cache.hdc);
hDrawBmp = ske_CreateDIB32(width_clip, height_clip);
- oldBmp=(HBITMAP)SelectObject(hdc, hDrawBmp);
+ oldBmp = (HBITMAP)SelectObject(hdc, hDrawBmp);
SetBkMode(hdc,TRANSPARENT);
{
POINT org;
@@ -1039,15 +1039,15 @@ void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact) // Draw bitmap 8//8
{
HDC dcMem = CreateCompatibleDC(hdc);
- HBITMAP obmp=(HBITMAP)SelectObject(dcMem, hBmp);
+ HBITMAP obmp = (HBITMAP)SelectObject(dcMem, hBmp);
StretchBlt(hdc, 0, 0, width_clip, height_clip,dcMem, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
SelectObject(dcMem,obmp);
mod_DeleteDC(dcMem);
}
{
- RECT rtr={0};
- rtr.right=width_clip+1;
- rtr.bottom=height_clip+1;
+ RECT rtr = {0};
+ rtr.right = width_clip+1;
+ rtr.bottom = height_clip+1;
ske_SetRectOpaque(hdc,&rtr);
}
@@ -1056,7 +1056,7 @@ void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact) mod_DeleteDC(hdc);
// Add to list
- if (old_pos >= 0)
+ if (old_pos >= 0)
{
ImageArray_ChangeImage(&dat->avatar_cache, hDrawBmp, old_pos);
contact->avatar_pos = old_pos;
@@ -1069,19 +1069,19 @@ void Cache_GetAvatar(struct ClcData *dat, struct ClcContact *contact) DeleteObject(hDrawBmp);
} // if (GetObject(hBmp,sizeof(BITMAP),&bm))
DeleteObject(hBmp);
- } //if (hBmp != NULL)
+ } //if (hBmp !=NULL)
}
db_free(&dbv);
}
// Remove avatar if needed
- if (old_pos >= 0 && contact->avatar_pos == AVATAR_POS_DONT_HAVE)
+ if (old_pos >= 0 && contact->avatar_pos == AVATAR_POS_DONT_HAVE)
{
ImageArray_RemoveImage(&dat->avatar_cache, old_pos);
// Update all items
ExecuteOnAllContacts(dat, ReduceAvatarPosition, (void *)&old_pos);
}
- if (old_pos==AVATAR_POS_ANIMATED && contact->avatar_pos != AVATAR_POS_ANIMATED)
+ if (old_pos == AVATAR_POS_ANIMATED && contact->avatar_pos !=AVATAR_POS_ANIMATED)
{
AniAva_RemoveAvatar( contact->hContact );
}
diff --git a/plugins/Clist_modern/modern_clc.cpp b/plugins/Clist_modern/modern_clc.cpp index e124c2c4fe..88996ec28b 100644 --- a/plugins/Clist_modern/modern_clc.cpp +++ b/plugins/Clist_modern/modern_clc.cpp @@ -47,15 +47,15 @@ static HANDLE hShowInfoTipEvent; static HANDLE hSettingChanged;
static POINT HitPoint;
static BOOL fMouseUpped;
-static BYTE IsDragToScrollMode=0;
-static int StartDragPos=0;
-static int StartScrollPos=0;
-HANDLE hSmileyAddOptionsChangedHook=NULL;
-HANDLE hIconChangedHook=NULL;
-HANDLE hAckHook=NULL;
-HANDLE hAvatarChanged=NULL;
+static BYTE IsDragToScrollMode = 0;
+static int StartDragPos = 0;
+static int StartScrollPos = 0;
+HANDLE hSmileyAddOptionsChangedHook = NULL;
+HANDLE hIconChangedHook = NULL;
+HANDLE hAckHook = NULL;
+HANDLE hAvatarChanged = NULL;
static BOOL g_bSortTimerIsSet = FALSE;
-static struct ClcContact * hitcontact=NULL;
+static struct ClcContact * hitcontact = NULL;
static int clcHookSmileyAddOptionsChanged(WPARAM wParam,LPARAM lParam);
@@ -84,7 +84,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) TCHAR szMyPath[MAX_PATH];
GetModuleFileName(g_hInst, szMyPath, SIZEOF(szMyPath));
- SKINICONDESC sid={0};
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(sid);
sid.cx = 16;
sid.cy = 16;
@@ -98,7 +98,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) Skin_AddIcon(&sid);
sid.pszSection = LPGEN("Contact List/Avatar Overlay");
- for (i=0; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++) {
+ for (i = 0; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++) {
sid.pszDescription = g_pAvatarOverlayIcons[i].description;
sid.pszName = g_pAvatarOverlayIcons[i].name;
sid.iDefaultIndex = - g_pAvatarOverlayIcons[i].id;
@@ -106,7 +106,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) }
sid.pszSection = LPGEN("Contact List/Status Overlay");
- for (i=0; i < MAX_REGS(g_pStatusOverlayIcons); i++) {
+ for (i = 0; i < MAX_REGS(g_pStatusOverlayIcons); i++) {
sid.pszDescription = g_pStatusOverlayIcons[i].description;
sid.pszName = g_pStatusOverlayIcons[i].name;
sid.iDefaultIndex = - g_pStatusOverlayIcons[i].id;
@@ -115,7 +115,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) clcHookIconsChanged(0,0);
- hIconChangedHook=ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
+ hIconChangedHook = ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
// Register smiley category
if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY)) {
@@ -127,7 +127,7 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam) CallService(MS_SMILEYADD_REGISTERCATEGORY, 0, (LPARAM)&rc);
- hSmileyAddOptionsChangedHook=ModernHookEvent(ME_SMILEYADD_OPTIONSCHANGED,clcHookSmileyAddOptionsChanged);
+ hSmileyAddOptionsChangedHook = ModernHookEvent(ME_SMILEYADD_OPTIONSCHANGED,clcHookSmileyAddOptionsChanged);
}
CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"List Background/CLC",0);
@@ -163,18 +163,18 @@ static int clcHookIconsChanged(WPARAM wParam, LPARAM lParam) if (MirandaExiting()) return 0;
for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
{
- g_pAvatarOverlayIcons[i].listID=-1;
- g_pStatusOverlayIcons[i].listID=-1;
+ g_pAvatarOverlayIcons[i].listID = -1;
+ g_pStatusOverlayIcons[i].listID = -1;
}
if (hAvatarOverlays) ImageList_Destroy(hAvatarOverlays);
- hAvatarOverlays=ImageList_Create(16,16,ILC_MASK|ILC_COLOR32,MAX_REGS(g_pAvatarOverlayIcons)*2,1);
+ hAvatarOverlays = ImageList_Create(16,16,ILC_MASK|ILC_COLOR32,MAX_REGS(g_pAvatarOverlayIcons)*2,1);
for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
{
- HICON hIcon=(HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)g_pAvatarOverlayIcons[i].name);
+ HICON hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)g_pAvatarOverlayIcons[i].name);
g_pAvatarOverlayIcons[i].listID = ImageList_AddIcon(hAvatarOverlays,hIcon);
CallService(MS_SKIN2_RELEASEICON, 0, (LPARAM)g_pAvatarOverlayIcons[i].name);
- hIcon=(HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)g_pStatusOverlayIcons[i].name);
+ hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)g_pStatusOverlayIcons[i].name);
g_pStatusOverlayIcons[i].listID = ImageList_AddIcon(hAvatarOverlays,hIcon);
CallService(MS_SKIN2_RELEASEICON, 0, (LPARAM)g_pStatusOverlayIcons[i].name);
}
@@ -188,9 +188,9 @@ static int clcHookIconsChanged(WPARAM wParam, LPARAM lParam) static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam)
{
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
if (MirandaExiting()) return 0;
- if ((HANDLE)wParam==NULL)
+ if ((HANDLE)wParam == NULL)
{
if (g_szMetaModuleName && !mir_strcmp(cws->szModule, g_szMetaModuleName))
{
@@ -206,7 +206,7 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam) CLUIServices_ProtocolStatusChanged(0,(LPARAM)cws->szModule);
}
}
- else // (HANDLE)wParam != NULL
+ else // (HANDLE)wParam !=NULL
{
if (!strcmp(cws->szSetting,"TickTS"))
{
@@ -259,7 +259,7 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam) if (!strcmp(cws->szSetting,"File"))
pcli->pfnClcBroadcast( INTM_AVATARCHANGED,wParam,0);
}
- else //if(0) //turn off
+ else //if (0) //turn off
{
{
// if (!strcmp(cws->szSetting,"UIN"))
@@ -296,18 +296,18 @@ static int clcHookDbEventAdded(WPARAM wParam,LPARAM lParam) {
DBEVENTINFO dbei = {0};
g_CluiData.t_now = time(NULL);
- if(wParam && lParam)
+ if (wParam && lParam)
{
dbei.cbSize = sizeof(dbei);
dbei.pBlob = 0;
dbei.cbBlob = 0;
CallService(MS_DB_EVENT_GET, (WPARAM)lParam, (LPARAM)&dbei);
- if(dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
{
- PDNCE pdnce=(PDNCE)pcli->pfnGetCacheEntry((HANDLE)wParam);
+ PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry((HANDLE)wParam);
db_set_dw((HANDLE)wParam, "CList", "mf_lastmsg", dbei.timestamp);
if (pdnce)
- pdnce->dwLastMsgTime=dbei.timestamp;
+ pdnce->dwLastMsgTime = dbei.timestamp;
}
}
return 0;
@@ -336,7 +336,7 @@ static int clcHookAvatarChanged(WPARAM wParam, LPARAM lParam) static int clcExitDragToScroll()
{
if (!IsDragToScrollMode) return 0;
- IsDragToScrollMode=0;
+ IsDragToScrollMode = 0;
ReleaseCapture();
return 1;
}
@@ -346,11 +346,11 @@ static int clcProceedDragToScroll(HWND hwnd, int Y) {
int pos,dy;
if (!IsDragToScrollMode) return 0;
- if(GetCapture()!=hwnd) clcExitDragToScroll();
- dy=StartDragPos-Y;
- pos=StartScrollPos+dy;
- if (pos<0)
- pos=0;
+ if (GetCapture() != hwnd) clcExitDragToScroll();
+ dy = StartDragPos-Y;
+ pos = StartScrollPos+dy;
+ if (pos < 0)
+ pos = 0;
SendMessage(hwnd, WM_VSCROLL,MAKEWPARAM(SB_THUMBTRACK,pos),0);
return 1;
}
@@ -361,9 +361,9 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const {
struct ClcGroup *group = &dat->list;
int testlen = lstrlen(text);
- BOOL fReturnAsFound=FALSE;
- int nLastFound=-1;
- if (index==-1) fReturnAsFound=TRUE;
+ BOOL fReturnAsFound = FALSE;
+ int nLastFound = -1;
+ if (index == -1) fReturnAsFound = TRUE;
group->scanIndex = 0;
for (;;)
{
@@ -375,9 +375,9 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const group->scanIndex++;
continue;
}
- if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER)
+ if (group->cl.items[group->scanIndex]->type !=CLCIT_DIVIDER)
{
- if ((prefixOk && CSTR_EQUAL==CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, group->cl.items[group->scanIndex]->szText, testlen)) ||
+ if ((prefixOk && CSTR_EQUAL == CompareString(LOCALE_INVARIANT, NORM_IGNORECASE, text, -1, group->cl.items[group->scanIndex]->szText, testlen)) ||
(!prefixOk && !lstrcmpi(text, group->cl.items[group->scanIndex]->szText)))
{
struct ClcGroup *contactGroup = group;
@@ -385,17 +385,17 @@ static int clcSearchNextContact(HWND hwnd, struct ClcData *dat, int index, const int foundindex;
for (; group; group = group->parent)
pcli->pfnSetGroupExpand(hwnd, dat, group, 1);
- foundindex=pcli->pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
+ foundindex = pcli->pfnGetRowsPriorTo(&dat->list, contactGroup, contactScanIndex);
if (fReturnAsFound)
return foundindex;
- else if (nLastFound!=-1 && fSearchUp && foundindex==index)
+ else if (nLastFound != -1 && fSearchUp && foundindex == index)
return nLastFound;
- else if (!fSearchUp && foundindex==index)
- fReturnAsFound=TRUE;
+ else if (!fSearchUp && foundindex == index)
+ fReturnAsFound = TRUE;
else
- nLastFound=foundindex;
- group=contactGroup;
- group->scanIndex=contactScanIndex;
+ nLastFound = foundindex;
+ group = contactGroup;
+ group->scanIndex = contactScanIndex;
}
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP)
{
@@ -423,7 +423,7 @@ static BOOL clcItemNotHiddenOffline(struct ClcData * dat, struct ClcGroup* group if (CLCItems_IsShowOfflineGroup(group)) return TRUE;
- pdnce=(PDNCE)pcli->pfnGetCacheEntry( contact->hContact);
+ pdnce = (PDNCE)pcli->pfnGetCacheEntry( contact->hContact);
if (!pdnce) return FALSE;
if (pdnce->m_cache_nNoHiddenOffline) return TRUE;
@@ -432,16 +432,16 @@ static BOOL clcItemNotHiddenOffline(struct ClcData * dat, struct ClcGroup* group }
static LRESULT clcOnCreate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- dat=(struct ClcData*)mir_calloc(sizeof(struct ClcData));
+ dat = (struct ClcData*)mir_calloc(sizeof(struct ClcData));
SetWindowLongPtr(hwnd,0,(LONG_PTR)dat);
- dat->hCheckBoxTheme=xpt_AddThemeHandle(hwnd, L"BUTTON");
- dat->m_paintCouter=0;
- dat->hWnd=hwnd;
+ dat->hCheckBoxTheme = xpt_AddThemeHandle(hwnd, L"BUTTON");
+ dat->m_paintCouter = 0;
+ dat->hWnd = hwnd;
dat->use_avatar_service = ServiceExists(MS_AV_GETAVATARBITMAP);
if (dat->use_avatar_service)
{
if (!hAvatarChanged)
- hAvatarChanged=ModernHookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged);
+ hAvatarChanged = ModernHookEvent(ME_AV_AVATARCHANGED, clcHookAvatarChanged);
}
//else
//{
@@ -450,21 +450,21 @@ static LRESULT clcOnCreate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPar RowHeights_Initialize(dat);
- dat->NeedResort=1;
- dat->MetaIgnoreEmptyExtra=db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
+ dat->NeedResort = 1;
+ dat->MetaIgnoreEmptyExtra = db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
- dat->IsMetaContactsEnabled=(!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
+ dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
g_szMetaModuleName && db_get_b(NULL,g_szMetaModuleName,"Enabled",1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
- dat->expandMeta=db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
- dat->useMetaIcon=db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT);
- dat->drawOverlayedStatus=db_get_b(NULL,"CLC","DrawOverlayedStatus",SETTING_DRAWOVERLAYEDSTATUS_DEFAULT);
- g_CluiData.bSortByOrder[0]=db_get_b(NULL,"CList","SortBy1",SETTING_SORTBY1_DEFAULT);
- g_CluiData.bSortByOrder[1]=db_get_b(NULL,"CList","SortBy2",SETTING_SORTBY2_DEFAULT);
- g_CluiData.bSortByOrder[2]=db_get_b(NULL,"CList","SortBy3",SETTING_SORTBY3_DEFAULT);
- g_CluiData.fSortNoOfflineBottom=db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT);
- dat->menuOwnerID=-1;
- dat->menuOwnerType=CLCIT_INVALID;
+ dat->expandMeta = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
+ dat->useMetaIcon = db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT);
+ dat->drawOverlayedStatus = db_get_b(NULL,"CLC","DrawOverlayedStatus",SETTING_DRAWOVERLAYEDSTATUS_DEFAULT);
+ g_CluiData.bSortByOrder[0] = db_get_b(NULL,"CList","SortBy1",SETTING_SORTBY1_DEFAULT);
+ g_CluiData.bSortByOrder[1] = db_get_b(NULL,"CList","SortBy2",SETTING_SORTBY2_DEFAULT);
+ g_CluiData.bSortByOrder[2] = db_get_b(NULL,"CList","SortBy3",SETTING_SORTBY3_DEFAULT);
+ g_CluiData.fSortNoOfflineBottom = db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT);
+ dat->menuOwnerID = -1;
+ dat->menuOwnerType = CLCIT_INVALID;
//InitDisplayNameCache(&dat->lCLCContactsCache);
//LoadCLCOptions(hwnd,dat);
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
@@ -495,7 +495,7 @@ static LRESULT clcOnCommand(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa switch (LOWORD(wParam))
{
case POPUP_NEWSUBGROUP:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return 0;
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_USEGROUPS);
@@ -505,19 +505,19 @@ static LRESULT clcOnCommand(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa pcli->pfnBeginRenameSelection(hwnd, dat);
return 0;
case POPUP_DELETEGROUP:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return 0;
CallService(MS_CLIST_GROUPDELETE, contact->groupId, 0);
return 0;
case POPUP_GROUPSHOWOFFLINE:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return 0;
CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId,
MAKELPARAM(CLCItems_IsShowOfflineGroup(contact->group) ? 0 : GROUPF_SHOWOFFLINE, GROUPF_SHOWOFFLINE));
pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
return 0;
case POPUP_GROUPHIDEOFFLINE:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return 0;
CallService(MS_CLIST_GROUPSETFLAGS, contact->groupId,
MAKELPARAM(contact->group->hideOffline ? 0 : GROUPF_HIDEOFFLINE, GROUPF_HIDEOFFLINE));
@@ -540,7 +540,7 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam {
HBITMAP hBmp, hBmpMask, hoBmp, hoMaskBmp;
HDC hdc,hdcMem;
- RECT rc={0};
+ RECT rc = {0};
int depth;
HBRUSH hBrush;
@@ -549,8 +549,8 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam return corecli.pfnContactListControlWndProc(hwnd,msg,wParam,lParam);;
rc.bottom = max ( dat->row_min_heigh, 1 );
- //rc.bottom=8;
- //rc.right=8;
+ //rc.bottom = 8;
+ //rc.right = 8;
hdc = GetDC(hwnd);
depth = GetDeviceCaps(hdc, BITSPIXEL);
if (depth < 16)
@@ -586,7 +586,7 @@ static LRESULT clcOnSize(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam static LRESULT clcOnChar(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if (wParam==27 && dat->szQuickSearch[0] == '\0') //escape and not quick search
+ if (wParam == 27 && dat->szQuickSearch[0] == '\0') //escape and not quick search
{
// minimize clist
CListMod_HideWindow(pcli->hwndContactList, SW_HIDE);
@@ -599,9 +599,9 @@ 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);
+ hdc = BeginPaint(hwnd,&ps);
g_clcPainter.cliPaintClc(hwnd,dat,hdc,&ps.rcPaint);
EndPaint(hwnd,&ps);
}
@@ -617,24 +617,24 @@ static LRESULT clcOnEraseBkGround(struct ClcData *dat, HWND hwnd, UINT msg, WPAR static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int selMoved=0;
- int changeGroupExpand=0;
+ int selMoved = 0;
+ int changeGroupExpand = 0;
int pageSize;
- if (wParam==VK_CONTROL)
+ if (wParam == VK_CONTROL)
return 0;
pcli->pfnHideInfoTip(hwnd,dat);
KillTimer(hwnd,TIMERID_INFOTIP);
KillTimer(hwnd,TIMERID_RENAME);
- if(CallService(MS_CLIST_MENUPROCESSHOTKEY,wParam,MPCF_CONTACTMENU))
+ if (CallService(MS_CLIST_MENUPROCESSHOTKEY,wParam,MPCF_CONTACTMENU))
return 0;
{
RECT clRect;
GetClientRect(hwnd,&clRect);
- if (dat->max_row_height) pageSize=clRect.bottom/dat->max_row_height;
- else pageSize=0;
+ if (dat->max_row_height) pageSize = clRect.bottom/dat->max_row_height;
+ else pageSize = 0;
}
switch(wParam)
@@ -642,18 +642,18 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa case VK_DOWN:
case VK_UP:
{
- if (dat->szQuickSearch[0]!='\0' && dat->selection!=-1) //get next contact
+ if (dat->szQuickSearch[0] != '\0' && dat->selection != -1) //get next contact
{
//get next contact
- int index=clcSearchNextContact(hwnd,dat,dat->selection,dat->szQuickSearch,1,(wParam==VK_UP));
- if (index==-1)
+ int index = clcSearchNextContact(hwnd,dat,dat->selection,dat->szQuickSearch,1,(wParam == VK_UP));
+ if (index == -1)
{
MessageBeep(MB_OK);
return 0;
}
else
{
- dat->selection=index;
+ dat->selection = index;
pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
return 0;
@@ -662,27 +662,27 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa }
else
{
- if (wParam==VK_DOWN) dat->selection++;
- if (wParam==VK_UP) dat->selection--;
- selMoved=1; break;
+ if (wParam == VK_DOWN) dat->selection++;
+ if (wParam == VK_UP) dat->selection--;
+ selMoved = 1; break;
}
}
- case VK_PRIOR: dat->selection-=pageSize; selMoved=1; break;
- case VK_NEXT: dat->selection+=pageSize; selMoved=1; break;
- case VK_HOME: dat->selection=0; selMoved=1; break;
- case VK_END: dat->selection=pcli->pfnGetGroupContentsCount(&dat->list,1)-1; selMoved=1; break;
- case VK_LEFT: changeGroupExpand=1; break;
- case VK_RIGHT: changeGroupExpand=2; break;
+ case VK_PRIOR: dat->selection -= pageSize; selMoved = 1; break;
+ case VK_NEXT: dat->selection += pageSize; selMoved = 1; break;
+ case VK_HOME: dat->selection = 0; selMoved = 1; break;
+ case VK_END: dat->selection = pcli->pfnGetGroupContentsCount(&dat->list,1)-1; selMoved = 1; break;
+ case VK_LEFT: changeGroupExpand = 1; break;
+ case VK_RIGHT: changeGroupExpand = 2; break;
case VK_RETURN: pcli->pfnDoSelectionDefaultAction(hwnd,dat); SetCapture(hwnd); return 0;
case VK_F2: cliBeginRenameSelection(hwnd,dat); /*SetCapture(hwnd);*/ return 0;
case VK_DELETE: pcli->pfnDeleteFromContactList(hwnd,dat); SetCapture(hwnd);return 0;
case VK_ESCAPE:
{
- if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE)
{
- dat->iDragItem=-1;
- dat->iInsertionMark=-1;
- dat->dragStage=0;
+ dat->iDragItem = -1;
+ dat->iInsertionMark = -1;
+ dat->dragStage = 0;
ReleaseCapture();
}
return 0;
@@ -690,113 +690,113 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa default:
{
NMKEY nmkey;
- nmkey.hdr.hwndFrom=hwnd;
- nmkey.hdr.idFrom=GetDlgCtrlID(hwnd);
- nmkey.hdr.code=NM_KEYDOWN;
- nmkey.nVKey=wParam;
- nmkey.uFlags=HIWORD(lParam);
+ nmkey.hdr.hwndFrom = hwnd;
+ nmkey.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nmkey.hdr.code = NM_KEYDOWN;
+ nmkey.nVKey = wParam;
+ nmkey.uFlags = HIWORD(lParam);
- if(SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nmkey))
+ if (SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nmkey))
{
SetCapture(hwnd);
return 0;
}
}
}
- if(changeGroupExpand)
+ if (changeGroupExpand)
{
int hit;
struct ClcContact *contact;
struct ClcGroup *group;
- dat->szQuickSearch[0]=0;
- hit=cliGetRowByIndex(dat,dat->selection,&contact,&group);
- if(hit!=-1)
+ dat->szQuickSearch[0] = 0;
+ hit = cliGetRowByIndex(dat,dat->selection,&contact,&group);
+ if (hit != -1)
{
- if (contact->type==CLCIT_CONTACT &&(contact->isSubcontact || contact->SubAllocated>0))
+ if (contact->type == CLCIT_CONTACT &&(contact->isSubcontact || contact->SubAllocated>0))
{
- if (contact->isSubcontact && changeGroupExpand==1)
+ if (contact->isSubcontact && changeGroupExpand == 1)
{
- dat->selection-=contact->isSubcontact;
- selMoved=1;
+ dat->selection -= contact->isSubcontact;
+ selMoved = 1;
}
else if (!contact->isSubcontact && contact->SubAllocated>0)
{
- if (changeGroupExpand==1 && !contact->SubExpanded)
+ if (changeGroupExpand == 1 && !contact->SubExpanded)
{
- dat->selection=cliGetRowsPriorTo(&dat->list,group,-1);
- selMoved=1;
+ dat->selection = cliGetRowsPriorTo(&dat->list,group,-1);
+ selMoved = 1;
}
- else if (changeGroupExpand==1 && contact->SubExpanded)
+ else if (changeGroupExpand == 1 && contact->SubExpanded)
{
//Contract
- struct ClcContact * ht=NULL;
+ struct ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
- contact->SubExpanded=0;
+ contact->SubExpanded = 0;
db_set_b(contact->hContact,"CList","Expanded",0);
- ht=contact;
- dat->NeedResort=1;
+ ht = contact;
+ dat->NeedResort = 1;
pcli->pfnSortCLC(hwnd,dat,1);
cliRecalcScrollBar(hwnd,dat);
- hitcontact=NULL;
+ hitcontact = NULL;
}
- else if (changeGroupExpand==2 && contact->SubExpanded)
+ else if (changeGroupExpand == 2 && contact->SubExpanded)
{
dat->selection++;
- selMoved=1;
+ selMoved = 1;
}
- else if (changeGroupExpand==2 && !contact->SubExpanded && dat->expandMeta)
+ else if (changeGroupExpand == 2 && !contact->SubExpanded && dat->expandMeta)
{
- struct ClcContact * ht=NULL;
+ struct ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
- contact->SubExpanded=1;
+ contact->SubExpanded = 1;
db_set_b(contact->hContact,"CList","Expanded",1);
- ht=contact;
- dat->NeedResort=1;
+ ht = contact;
+ dat->NeedResort = 1;
pcli->pfnSortCLC(hwnd,dat,1);
cliRecalcScrollBar(hwnd,dat);
if (ht)
{
- int i=0;
+ int i = 0;
struct ClcContact *contact2;
struct ClcGroup *group2;
- if(FindItem(hwnd,dat,contact->hContact,&contact2,&group2,NULL,FALSE))
+ if (FindItem(hwnd,dat,contact->hContact,&contact2,&group2,NULL,FALSE))
{
- i=cliGetRowsPriorTo(&dat->list,group2,GetContactIndex(group2,contact2));
+ i = cliGetRowsPriorTo(&dat->list,group2,GetContactIndex(group2,contact2));
pcli->pfnEnsureVisible(hwnd,dat,i+contact->SubAllocated,0);
}
}
- hitcontact=NULL;
+ hitcontact = NULL;
}
}
}
else
{
- if(changeGroupExpand==1 && contact->type==CLCIT_CONTACT) {
- if(group==&dat->list) {SetCapture(hwnd); return 0;}
- dat->selection=cliGetRowsPriorTo(&dat->list,group,-1);
- selMoved=1;
+ if (changeGroupExpand == 1 && contact->type == CLCIT_CONTACT) {
+ if (group == &dat->list) {SetCapture(hwnd); return 0;}
+ dat->selection = cliGetRowsPriorTo(&dat->list,group,-1);
+ selMoved = 1;
}
else {
- if(contact->type==CLCIT_GROUP)
+ if (contact->type == CLCIT_GROUP)
{
- if (changeGroupExpand==1)
+ if (changeGroupExpand == 1)
{
if (!contact->group->expanded)
{
dat->selection--;
- selMoved=1;
+ selMoved = 1;
}
else
{
pcli->pfnSetGroupExpand(hwnd,dat,contact->group,0);
}
}
- else if (changeGroupExpand==2)
+ else if (changeGroupExpand == 2)
{
pcli->pfnSetGroupExpand(hwnd,dat,contact->group,1);
dat->selection++;
- selMoved=1;
+ selMoved = 1;
}
else {SetCapture(hwnd);return 0;}
}//
@@ -807,12 +807,12 @@ static LRESULT clcOnKeyDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa }
else {SetCapture(hwnd);return 0; }
}
- if(selMoved)
+ if (selMoved)
{
- dat->szQuickSearch[0]=0;
- if(dat->selection>=pcli->pfnGetGroupContentsCount(&dat->list,1))
- dat->selection=pcli->pfnGetGroupContentsCount(&dat->list,1)-1;
- if(dat->selection<0) dat->selection=0;
+ dat->szQuickSearch[0] = 0;
+ if (dat->selection >= pcli->pfnGetGroupContentsCount(&dat->list,1))
+ dat->selection = pcli->pfnGetGroupContentsCount(&dat->list,1)-1;
+ if (dat->selection < 0) dat->selection = 0;
if (dat->bCompactMode)
SendMessage(hwnd,WM_SIZE,0,0);
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
@@ -856,41 +856,41 @@ static LRESULT clcOnTimer(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wPara }
case TIMERID_INVALIDATE:
{
- time_t cur_time=(time(NULL)/60);
- if (cur_time!=dat->last_tick_time)
+ time_t cur_time = (time(NULL)/60);
+ if (cur_time != dat->last_tick_time)
{
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- dat->last_tick_time=cur_time;
+ dat->last_tick_time = cur_time;
}
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
case TIMERID_SUBEXPAND:
{
- struct ClcContact * ht=NULL;
+ struct ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
if (hitcontact && dat->expandMeta)
{
- if (hitcontact->SubExpanded) hitcontact->SubExpanded=0; else hitcontact->SubExpanded=1;
+ if (hitcontact->SubExpanded) hitcontact->SubExpanded = 0; else hitcontact->SubExpanded = 1;
db_set_b(hitcontact->hContact,"CList","Expanded",hitcontact->SubExpanded);
if (hitcontact->SubExpanded)
- ht=&(hitcontact->subcontacts[hitcontact->SubAllocated-1]);
+ ht = &(hitcontact->subcontacts[hitcontact->SubAllocated-1]);
}
- dat->NeedResort=1;
+ dat->NeedResort = 1;
pcli->pfnSortCLC(hwnd,dat,1);
cliRecalcScrollBar(hwnd,dat);
if (ht)
{
- int i=0;
+ int i = 0;
struct ClcContact *contact;
struct ClcGroup *group;
- if(FindItem(hwnd,dat,hitcontact->hContact,&contact,&group,NULL,FALSE))
+ if (FindItem(hwnd,dat,hitcontact->hContact,&contact,&group,NULL,FALSE))
{
- i=cliGetRowsPriorTo(&dat->list,group,GetContactIndex(group,contact));
+ i = cliGetRowsPriorTo(&dat->list,group,GetContactIndex(group,contact));
pcli->pfnEnsureVisible(hwnd,dat,i+hitcontact->SubAllocated,0);
}
}
- hitcontact=NULL;
+ hitcontact = NULL;
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
case TIMERID_DELAYEDRESORTCLC:
@@ -923,7 +923,7 @@ static LRESULT clcOnActivate(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wP if ( dat->hwndRenameEdit == NULL )
PostMessage( hwnd, WM_SIZE, 0, 0);
}
- dat->dragStage|= DRAGSTAGEF_SKIPRENAME;
+ dat->dragStage |= DRAGSTAGEF_SKIPRENAME;
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
static LRESULT clcOnSetCursor(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -939,27 +939,27 @@ static LRESULT clcOnSetCursor(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (g_CluiData.bBehindEdgeSettings)
CLUI_UpdateTimer(0);
- lResult=CLUI_TestCursorOnBorders();
+ lResult = CLUI_TestCursorOnBorders();
return lResult ? lResult : DefWindowProc(hwnd,msg,wParam,lParam);
}
static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
{
POINT pt;
- int k=0;
+ int k = 0;
pt.x = LOWORD(lParam);
pt.y = HIWORD(lParam);
ClientToScreen(hwnd,&pt);
- k=CLUI_SizingOnBorder(pt,0);
+ k = CLUI_SizingOnBorder(pt,0);
if (k)
{
- int io=dat->iHotTrack;
- dat->iHotTrack=0;
- if(dat->exStyle&CLS_EX_TRACKSELECT)
+ int io = dat->iHotTrack;
+ dat->iHotTrack = 0;
+ if (dat->exStyle&CLS_EX_TRACKSELECT)
{
pcli->pfnInvalidateItem(hwnd,dat,io);
}
- if (k && GetCapture()==hwnd)
+ if (k && GetCapture() == hwnd)
{
SendMessage(GetParent(hwnd),WM_PARENTNOTIFY,WM_LBUTTONDOWN,lParam);
}
@@ -971,69 +971,69 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM struct ClcGroup *group;
int hit;
DWORD hitFlags;
- fMouseUpped=FALSE;
+ fMouseUpped = FALSE;
pcli->pfnHideInfoTip(hwnd,dat);
KillTimer(hwnd,TIMERID_INFOTIP);
KillTimer(hwnd,TIMERID_RENAME);
KillTimer(hwnd,TIMERID_SUBEXPAND);
pcli->pfnEndRename(hwnd,dat,1);
- dat->ptDragStart.x=(short)LOWORD(lParam);
- dat->ptDragStart.y=(short)HIWORD(lParam);
- dat->szQuickSearch[0]=0;
- hit=cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),&contact,&group,&hitFlags);
- if(GetFocus()!=hwnd) SetFocus(hwnd);
- if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE))
+ dat->ptDragStart.x = (short)LOWORD(lParam);
+ dat->ptDragStart.y = (short)HIWORD(lParam);
+ dat->szQuickSearch[0] = 0;
+ hit = cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),&contact,&group,&hitFlags);
+ if (GetFocus() != hwnd) SetFocus(hwnd);
+ if (hit != -1 && !(hitFlags&CLCHT_NOWHERE))
{
- if ( hit==dat->selection && hitFlags&CLCHT_ONITEMLABEL && dat->exStyle&CLS_EX_EDITLABELS)
+ if ( hit == dat->selection && hitFlags&CLCHT_ONITEMLABEL && dat->exStyle&CLS_EX_EDITLABELS)
{
if ( !(dat->dragStage&DRAGSTAGEF_SKIPRENAME))
{
SetCapture(hwnd);
- dat->iDragItem=dat->selection;
- dat->dragStage=DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME;
- dat->dragAutoScrolling=0;
+ dat->iDragItem = dat->selection;
+ dat->dragStage = DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME;
+ dat->dragAutoScrolling = 0;
return TRUE;
}
else
{
- dat->dragStage&= ~DRAGSTAGEF_SKIPRENAME;
+ dat->dragStage &= ~DRAGSTAGEF_SKIPRENAME;
return TRUE;
}
}
}
- if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE) && contact->type==CLCIT_CONTACT && contact->SubAllocated && !contact->isSubcontact)
- if(hitFlags&CLCHT_ONITEMICON && dat->expandMeta)
+ if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && contact->type == CLCIT_CONTACT && contact->SubAllocated && !contact->isSubcontact)
+ if (hitFlags&CLCHT_ONITEMICON && dat->expandMeta)
{
- BYTE doubleClickExpand=db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
+ BYTE doubleClickExpand = db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
- hitcontact=contact;
- HitPoint.x= (short)LOWORD(lParam);
- HitPoint.y= (short)HIWORD(lParam);
- fMouseUpped=FALSE;
+ hitcontact = contact;
+ HitPoint.x = (short)LOWORD(lParam);
+ HitPoint.y = (short)HIWORD(lParam);
+ fMouseUpped = FALSE;
if ((GetKeyState(VK_SHIFT)&0x8000)||(GetKeyState(VK_CONTROL)&0x8000) || (GetKeyState(VK_MENU)&0x8000))
{
- fMouseUpped=TRUE;
- hitcontact=contact;
+ fMouseUpped = TRUE;
+ hitcontact = contact;
KillTimer(hwnd,TIMERID_SUBEXPAND);
CLUI_SafeSetTimer(hwnd,TIMERID_SUBEXPAND,0,NULL);
}
}
else
- hitcontact=NULL;
+ hitcontact = NULL;
- if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE) && contact->type==CLCIT_GROUP)
- if(hitFlags&CLCHT_ONITEMICON)
+ if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && contact->type == CLCIT_GROUP)
+ if (hitFlags&CLCHT_ONITEMICON)
{
struct ClcGroup *selgroup;
struct ClcContact *selcontact;
- dat->selection=cliGetRowByIndex(dat,dat->selection,&selcontact,&selgroup);
+ dat->selection = cliGetRowByIndex(dat,dat->selection,&selcontact,&selgroup);
pcli->pfnSetGroupExpand(hwnd,dat,contact->group,-1);
- if(dat->selection!=-1)
+ if (dat->selection != -1)
{
- dat->selection=cliGetRowsPriorTo(&dat->list,selgroup,GetContactIndex(selgroup,selcontact));
- if(dat->selection==-1) dat->selection=cliGetRowsPriorTo(&dat->list,contact->group,-1);
+ dat->selection = cliGetRowsPriorTo(&dat->list,selgroup,GetContactIndex(selgroup,selcontact));
+ if (dat->selection == -1) dat->selection = cliGetRowsPriorTo(&dat->list,contact->group,-1);
}
if (dat->bCompactMode)
{
@@ -1046,52 +1046,52 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM }
return TRUE;
}
- if(hit!=-1 && !(hitFlags&CLCHT_NOWHERE) && hitFlags&CLCHT_ONITEMCHECK)
+ if (hit != -1 && !(hitFlags&CLCHT_NOWHERE) && hitFlags&CLCHT_ONITEMCHECK)
{
NMCLISTCONTROL nm;
- contact->flags^=CONTACTF_CHECKED;
- if(contact->type==CLCIT_GROUP) pcli->pfnSetGroupChildCheckboxes(contact->group,contact->flags&CONTACTF_CHECKED);
+ contact->flags ^= CONTACTF_CHECKED;
+ if (contact->type == CLCIT_GROUP) pcli->pfnSetGroupChildCheckboxes(contact->group,contact->flags&CONTACTF_CHECKED);
pcli->pfnRecalculateGroupCheckboxes(hwnd,dat);
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- nm.hdr.code=CLN_CHECKCHANGED;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=GetDlgCtrlID(hwnd);
- nm.flags=0;
- nm.hItem=ContactToItemHandle(contact,&nm.flags);
+ nm.hdr.code = CLN_CHECKCHANGED;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ nm.hItem = ContactToItemHandle(contact,&nm.flags);
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
}
if (!(hitFlags&(CLCHT_ONITEMICON|CLCHT_ONITEMLABEL|CLCHT_ONITEMCHECK)))
{
NMCLISTCONTROL nm;
- nm.hdr.code=NM_CLICK;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=GetDlgCtrlID(hwnd);
- nm.flags=0;
- if(hit==-1 || hitFlags&CLCHT_NOWHERE) nm.hItem=NULL;
- else nm.hItem=ContactToItemHandle(contact,&nm.flags);
- nm.iColumn=hitFlags&CLCHT_ONITEMEXTRA?HIBYTE(HIWORD(hitFlags)):-1;
- nm.pt=dat->ptDragStart;
+ nm.hdr.code = NM_CLICK;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ if (hit == -1 || hitFlags&CLCHT_NOWHERE) nm.hItem = NULL;
+ else nm.hItem = ContactToItemHandle(contact,&nm.flags);
+ nm.iColumn = hitFlags&CLCHT_ONITEMEXTRA?HIBYTE(HIWORD(hitFlags)):-1;
+ nm.pt = dat->ptDragStart;
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
}
- if(hitFlags&(CLCHT_ONITEMCHECK|CLCHT_ONITEMEXTRA))
+ if (hitFlags&(CLCHT_ONITEMCHECK|CLCHT_ONITEMEXTRA))
return FALSE;
- dat->selection=(hitFlags&CLCHT_NOWHERE)?-1:hit;
+ dat->selection = (hitFlags&CLCHT_NOWHERE)?-1:hit;
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
UpdateWindow(hwnd);
- if(dat->selection!=-1 && (contact->type==CLCIT_CONTACT || contact->type==CLCIT_GROUP) && !(hitFlags&(CLCHT_ONITEMEXTRA|CLCHT_ONITEMCHECK|CLCHT_NOWHERE)))
+ if (dat->selection != -1 && (contact->type == CLCIT_CONTACT || contact->type == CLCIT_GROUP) && !(hitFlags&(CLCHT_ONITEMEXTRA|CLCHT_ONITEMCHECK|CLCHT_NOWHERE)))
{
SetCapture(hwnd);
- dat->iDragItem=dat->selection;
- dat->dragStage=DRAGSTAGE_NOTMOVED;
- dat->dragAutoScrolling=0;
+ dat->iDragItem = dat->selection;
+ dat->dragStage = DRAGSTAGE_NOTMOVED;
+ dat->dragAutoScrolling = 0;
}
if (dat->bCompactMode)
{
SendMessage(hwnd,WM_SIZE,0,0);
}
- if(dat->selection!=-1) pcli->pfnEnsureVisible(hwnd,dat,hit,0);
+ if (dat->selection != -1) pcli->pfnEnsureVisible(hwnd,dat,hit,0);
return TRUE;
}
}
@@ -1100,13 +1100,13 @@ static LRESULT clcOnLButtonDown(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM static LRESULT clcOnCaptureChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- if ((HWND)lParam!=hwnd)
+ if ((HWND)lParam != hwnd)
{
- if (dat->iHotTrack!=-1)
+ if (dat->iHotTrack != -1)
{
int i;
- i=dat->iHotTrack;
- dat->iHotTrack=-1;
+ i = dat->iHotTrack;
+ dat->iHotTrack = -1;
pcli->pfnInvalidateItem(hwnd,dat,i);
pcli->pfnHideInfoTip(hwnd,dat);
}
@@ -1116,7 +1116,7 @@ static LRESULT clcOnCaptureChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPA static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- BOOL isOutside=FALSE;
+ BOOL isOutside = FALSE;
if (CLUI_IsInMainWindow(hwnd))
{
if (g_CluiData.bBehindEdgeSettings) CLUI_UpdateTimer(0);
@@ -1128,74 +1128,74 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if ( dat->dragStage&DRAGSTAGEF_MAYBERENAME )
{
POINT pt;
- pt.x= (short)LOWORD(lParam);
- pt.y= (short)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
if ( abs(pt.x-dat->ptDragStart.x)>GetSystemMetrics(SM_CXDOUBLECLK)
||abs(pt.y-dat->ptDragStart.y)>GetSystemMetrics(SM_CYDOUBLECLK))
{
KillTimer( hwnd, TIMERID_RENAME );
- dat->dragStage&=(~DRAGSTAGEF_MAYBERENAME);
+ dat->dragStage &= (~DRAGSTAGEF_MAYBERENAME);
}
}
- if (dat->iDragItem==-1)
+ if (dat->iDragItem == -1)
{
POINT pt;
HWND window;
- pt.x= (short)LOWORD(lParam);
- pt.y= (short)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
ClientToScreen(hwnd,&pt);
- window=WindowFromPoint(pt);
- if (window!=hwnd) isOutside=TRUE;
+ window = WindowFromPoint(pt);
+ if (window != hwnd) isOutside = TRUE;
}
- if(hitcontact!=NULL)
+ if (hitcontact != NULL)
{
int x,y,xm,ym;
- x= (short)LOWORD(lParam);
- y= (short)HIWORD(lParam);
- xm=GetSystemMetrics(SM_CXDOUBLECLK);
- ym=GetSystemMetrics(SM_CYDOUBLECLK);
- if(abs(HitPoint.x-x)>xm || abs(HitPoint.y-y)>ym)
+ x = (short)LOWORD(lParam);
+ y = (short)HIWORD(lParam);
+ xm = GetSystemMetrics(SM_CXDOUBLECLK);
+ ym = GetSystemMetrics(SM_CYDOUBLECLK);
+ if (abs(HitPoint.x-x)>xm || abs(HitPoint.y-y)>ym)
{
if (fMouseUpped)
{
KillTimer(hwnd,TIMERID_SUBEXPAND);
CLUI_SafeSetTimer(hwnd,TIMERID_SUBEXPAND,0,NULL);
- fMouseUpped=FALSE;
+ fMouseUpped = FALSE;
}
else
{
KillTimer(hwnd,TIMERID_SUBEXPAND);
- hitcontact=NULL;
- fMouseUpped=FALSE;
+ hitcontact = NULL;
+ fMouseUpped = FALSE;
}
}
}
- if(dat->iDragItem==-1)
+ if (dat->iDragItem == -1)
{
- DWORD flag=0;
- int iOldHotTrack=dat->iHotTrack;
+ DWORD flag = 0;
+ int iOldHotTrack = dat->iHotTrack;
- if(dat->hwndRenameEdit!=NULL || GetKeyState(VK_MENU)&0x8000 || GetKeyState(VK_F10)&0x8000)
+ if (dat->hwndRenameEdit != NULL || GetKeyState(VK_MENU)&0x8000 || GetKeyState(VK_F10)&0x8000)
return 0;
- dat->iHotTrack= isOutside ? -1 : cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flag);
+ dat->iHotTrack = isOutside ? -1 : cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flag);
if (flag&CLCHT_NOWHERE)
- dat->iHotTrack=-1;
+ dat->iHotTrack = -1;
- if(iOldHotTrack!=dat->iHotTrack || isOutside)
+ if (iOldHotTrack != dat->iHotTrack || isOutside)
{
- if(iOldHotTrack==-1 && !isOutside)
+ if (iOldHotTrack == -1 && !isOutside)
SetCapture(hwnd);
- if (dat->iHotTrack==-1 || isOutside)
+ if (dat->iHotTrack == -1 || isOutside)
ReleaseCapture();
- if(dat->exStyle&CLS_EX_TRACKSELECT)
+ if (dat->exStyle&CLS_EX_TRACKSELECT)
{
pcli->pfnInvalidateItem(hwnd,dat,iOldHotTrack);
pcli->pfnInvalidateItem(hwnd,dat,dat->iHotTrack);
@@ -1206,21 +1206,21 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w KillTimer(hwnd,TIMERID_INFOTIP);
- if(wParam==0 && dat->hInfoTipItem==NULL)
+ if (wParam == 0 && dat->hInfoTipItem == NULL)
{
- dat->ptInfoTip.x=(short)LOWORD(lParam);
- dat->ptInfoTip.y=(short)HIWORD(lParam);
+ dat->ptInfoTip.x = (short)LOWORD(lParam);
+ dat->ptInfoTip.y = (short)HIWORD(lParam);
CLUI_SafeSetTimer(hwnd,TIMERID_INFOTIP,dat->infoTipTimeout,NULL);
}
return 0;
}
- if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_NOTMOVED && !(dat->exStyle&CLS_EX_DISABLEDRAGDROP))
+ if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_NOTMOVED && !(dat->exStyle&CLS_EX_DISABLEDRAGDROP))
{
- if(abs((short)LOWORD(lParam)-dat->ptDragStart.x)>=GetSystemMetrics(SM_CXDRAG) || abs((short)HIWORD(lParam)-dat->ptDragStart.y)>=GetSystemMetrics(SM_CYDRAG))
- dat->dragStage=(dat->dragStage&~DRAGSTAGEM_STAGE)|DRAGSTAGE_ACTIVE;
+ if (abs((short)LOWORD(lParam)-dat->ptDragStart.x) >= GetSystemMetrics(SM_CXDRAG) || abs((short)HIWORD(lParam)-dat->ptDragStart.y) >= GetSystemMetrics(SM_CYDRAG))
+ dat->dragStage = (dat->dragStage&~DRAGSTAGEM_STAGE)|DRAGSTAGE_ACTIVE;
}
- if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE)
{
HCURSOR hNewCursor;
RECT clRect;
@@ -1228,24 +1228,24 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w int target;
GetClientRect(hwnd,&clRect);
- pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam);
- hNewCursor=LoadCursor(NULL, IDC_NO);
+ pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
+ hNewCursor = LoadCursor(NULL, IDC_NO);
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- if(dat->dragAutoScrolling)
- {KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL); dat->dragAutoScrolling=0;}
- target=GetDropTargetInformation(hwnd,dat,pt);
- if(dat->dragStage&DRAGSTAGEF_OUTSIDE && target!=DROPTARGET_OUTSIDE)
+ if (dat->dragAutoScrolling)
+ {KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL); dat->dragAutoScrolling = 0;}
+ target = GetDropTargetInformation(hwnd,dat,pt);
+ if (dat->dragStage&DRAGSTAGEF_OUTSIDE && target != DROPTARGET_OUTSIDE)
{
NMCLISTCONTROL nm;
struct ClcContact *contact;
cliGetRowByIndex(dat,dat->iDragItem,&contact,NULL);
- nm.hdr.code=CLN_DRAGSTOP;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=GetDlgCtrlID(hwnd);
- nm.flags=0;
- nm.hItem=ContactToItemHandle(contact,&nm.flags);
+ nm.hdr.code = CLN_DRAGSTOP;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ nm.hItem = ContactToItemHandle(contact,&nm.flags);
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm);
- dat->dragStage&=~DRAGSTAGEF_OUTSIDE;
+ dat->dragStage &= ~DRAGSTAGEF_OUTSIDE;
}
switch(target)
{
@@ -1257,12 +1257,12 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w {
struct ClcContact *contSour;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type==CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
- hNewCursor=LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA));
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DROPMETA));
}
}
@@ -1274,15 +1274,15 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w struct ClcContact *contSour,*contDest;
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type==CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
- if (contSour->subcontacts==contDest)
- hNewCursor=LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault
+ if (contSour->subcontacts == contDest)
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_DEFAULTSUB)); ///MakeDefault
else
- hNewCursor=LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
}
}
break;
@@ -1292,25 +1292,25 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w struct ClcContact *contSour,*contDest;
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
- if (contSour->type==CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
+ if (contSour->type == CLCIT_CONTACT && g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER)); /// Add to meta
else
- if (contDest->subcontacts==contSour->subcontacts)
+ if (contDest->subcontacts == contSour->subcontacts)
break;
else
- hNewCursor=LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
+ hNewCursor = LoadCursor(g_hInst, MAKEINTRESOURCE(IDC_REGROUP));
}
}
break;
case DROPTARGET_ONGROUP:
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
break;
case DROPTARGET_INSERTION:
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROP));
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROP));
break;
case DROPTARGET_OUTSIDE:
@@ -1318,39 +1318,39 @@ static LRESULT clcOnMouseMove(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w NMCLISTCONTROL nm;
struct ClcContact *contact;
- 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 (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(pt.y<0) dat->dragAutoScrolling=-1;
- else dat->dragAutoScrolling=1;
+ if (pt.y < 0) dat->dragAutoScrolling = -1;
+ else dat->dragAutoScrolling = 1;
CLUI_SafeSetTimer(hwnd,TIMERID_DRAGAUTOSCROLL,dat->scrollTime,NULL);
}
SendMessage(hwnd,WM_TIMER,TIMERID_DRAGAUTOSCROLL,0);
}
- dat->dragStage|=DRAGSTAGEF_OUTSIDE;
+ dat->dragStage |= DRAGSTAGEF_OUTSIDE;
cliGetRowByIndex(dat,dat->iDragItem,&contact,NULL);
- nm.hdr.code=CLN_DRAGGING;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=GetDlgCtrlID(hwnd);
- nm.flags=0;
- nm.hItem=ContactToItemHandle(contact,&nm.flags);
- nm.pt=pt;
- if(SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm))
+ nm.hdr.code = CLN_DRAGGING;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = GetDlgCtrlID(hwnd);
+ nm.flags = 0;
+ nm.hItem = ContactToItemHandle(contact,&nm.flags);
+ nm.pt = pt;
+ if (SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm))
return 0;
break;
}
default:
{
- struct ClcGroup *group=NULL;
+ struct ClcGroup *group = NULL;
cliGetRowByIndex(dat,dat->iDragItem,NULL,&group);
- if(group && group->parent)
+ if (group && group->parent)
{
struct ClcContact *contSour;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
if (!contSour->isSubcontact)
- hNewCursor=LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
+ hNewCursor = LoadCursor(GetModuleHandle(NULL), MAKEINTRESOURCE(IDC_DROPUSER));
}
break;
}
@@ -1364,37 +1364,37 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (clcExitDragToScroll())
return 0;
- fMouseUpped=TRUE;
+ fMouseUpped = TRUE;
- if (hitcontact!=NULL && dat->expandMeta)
+ if (hitcontact != NULL && dat->expandMeta)
{
- BYTE doubleClickExpand=db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
+ BYTE doubleClickExpand = db_get_b(NULL,"CLC","MetaDoubleClick",SETTING_METAAVOIDDBLCLICK_DEFAULT);
CLUI_SafeSetTimer(hwnd,TIMERID_SUBEXPAND,GetDoubleClickTime()*doubleClickExpand,NULL);
}
- else if (dat->iHotTrack==-1 && dat->iDragItem==-1)
+ else if (dat->iHotTrack == -1 && dat->iDragItem == -1)
ReleaseCapture();
- if(dat->iDragItem==-1) return 0;
+ if (dat->iDragItem == -1) return 0;
SetCursor((HCURSOR)GetClassLongPtr(hwnd,GCLP_HCURSOR));
- if(dat->exStyle&CLS_EX_TRACKSELECT)
+ if (dat->exStyle&CLS_EX_TRACKSELECT)
{
DWORD flags;
- dat->iHotTrack=cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flags);
- if(dat->iHotTrack==-1)
+ dat->iHotTrack = cliHitTest(hwnd,dat,(short)LOWORD(lParam),(short)HIWORD(lParam),NULL,NULL,&flags);
+ if (dat->iHotTrack == -1)
ReleaseCapture();
}
- else if (hitcontact==NULL)
+ else if (hitcontact == NULL)
ReleaseCapture();
KillTimer(hwnd,TIMERID_DRAGAUTOSCROLL);
- if(dat->dragStage==(DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME))
+ if (dat->dragStage == (DRAGSTAGE_NOTMOVED|DRAGSTAGEF_MAYBERENAME))
CLUI_SafeSetTimer(hwnd,TIMERID_RENAME,GetDoubleClickTime(),NULL);
- else if ((dat->dragStage&DRAGSTAGEM_STAGE)==DRAGSTAGE_ACTIVE)
+ else if ((dat->dragStage&DRAGSTAGEM_STAGE) == DRAGSTAGE_ACTIVE)
{
POINT pt;
int target;
TCHAR Wording[500];
- int res=0;
- pt.x=(short)LOWORD(lParam); pt.y=(short)HIWORD(lParam);
- target=GetDropTargetInformation(hwnd,dat,pt);
+ int res = 0;
+ pt.x = (short)LOWORD(lParam); pt.y = (short)HIWORD(lParam);
+ target = GetDropTargetInformation(hwnd,dat,pt);
switch(target)
{
case DROPTARGET_ONSELF:
@@ -1408,20 +1408,20 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- hcontact=contSour->hContact;
- if (contSour->type==CLCIT_CONTACT)
+ hcontact = contSour->hContact;
+ if (contSour->type == CLCIT_CONTACT)
{
if (g_szMetaModuleName && mir_strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
{
- HANDLE hDest=contDest->hContact;
+ 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);
- res=MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
- handle=(HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hDest,0);
+ handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hDest,0);
if (!handle) return 0;
CallService(MS_MC_ADDTOMETA,(WPARAM)hcontact,(LPARAM)handle);
}
@@ -1429,15 +1429,15 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w else
{
HANDLE handle,hcontact,hfrom,hdest;
- hcontact=contSour->hContact;
- hfrom=contSour->subcontacts->hContact;
- hdest=contDest->hContact;
+ hcontact = contSour->hContact;
+ hfrom = contSour->subcontacts->hContact;
+ 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 (remove it from '%s')?"), contDest->szText,contSour->szText,contSour->subcontacts->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Converting to MetaContact (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
- handle=(HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0);
+ handle = (HANDLE)CallService(MS_MC_CONVERTTOMETA,(WPARAM)hdest,0);
if (!handle) return 0;
CallService(MS_MC_REMOVEFROMMETA,(WPARAM)0,(LPARAM)hcontact);
@@ -1455,7 +1455,7 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w int res;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- if (contSour->type==CLCIT_CONTACT)
+ if (contSour->type == CLCIT_CONTACT)
{
if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName))
@@ -1463,11 +1463,11 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (!contSour->isSubcontact)
{
HANDLE handle,hcontact;
- hcontact=contSour->hContact;
- handle=contDest->hContact;
+ hcontact = contSour->hContact;
+ handle = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do you want to contact '%s' be added to metacontact '%s'?"),contSour->szText, contDest->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Adding contact to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Adding contact to MetaContact"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
if (!handle) return 0;
@@ -1476,14 +1476,14 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w }
else
{
- if (contSour->subcontacts==contDest)
+ if (contSour->subcontacts == contDest)
{
HANDLE hsour;
- hsour=contSour->hContact;
+ hsour = contSour->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be default ?"),contSour->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Set default contact"),MB_OKCANCEL|MB_ICONQUESTION);
+ res = MessageBox(hwnd,Wording,TranslateT("Set default contact"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ if (res == 1)
{
CallService(MS_MC_SETDEFAULTCONTACT,(WPARAM)contDest->hContact,(LPARAM)hsour);
}
@@ -1491,12 +1491,12 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w else
{
HANDLE handle,hcontact,hfrom;
- hcontact=contSour->hContact;
- hfrom=contSour->subcontacts->hContact;
- handle=contDest->hContact;
+ hcontact = contSour->hContact;
+ hfrom = contSour->subcontacts->hContact;
+ handle = contDest->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
if (!handle) return 0;
@@ -1516,18 +1516,18 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w int res;
cliGetRowByIndex(dat,dat->iDragItem,&contSour,NULL);
cliGetRowByIndex(dat,dat->selection,&contDest,NULL);
- if (contSour->type==CLCIT_CONTACT)
+ if (contSour->type == CLCIT_CONTACT)
{
if (g_szMetaModuleName && strcmp(contSour->proto,g_szMetaModuleName))
{
if (!contSour->isSubcontact)
{
HANDLE handle,hcontact;
- hcontact=contSour->hContact;
- handle=contDest->subcontacts->hContact;
+ hcontact = contSour->hContact;
+ handle = contDest->subcontacts->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be added to MetaContact '%s'?"), contSour->szText,contDest->subcontacts->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
if (!handle) return 0;
@@ -1536,15 +1536,15 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w }
else
{
- if (contSour->subcontacts!=contDest->subcontacts)
+ if (contSour->subcontacts != contDest->subcontacts)
{
HANDLE handle,hcontact,hfrom;
- hcontact=contSour->hContact;
- hfrom=contSour->subcontacts->hContact;
- handle=contDest->subcontacts->hContact;
+ hcontact = contSour->hContact;
+ hfrom = contSour->subcontacts->hContact;
+ handle = contDest->subcontacts->hContact;
mir_sntprintf(Wording,SIZEOF(Wording),TranslateT("Do You want contact '%s' to be removed from MetaContact '%s' and added to '%s'?"), contSour->szText,contSour->subcontacts->szText,contDest->subcontacts->szText);
- res=MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
- if (res==1)
+ res = MessageBox(hwnd,Wording,TranslateT("Changing MetaContacts (Moving)"),MB_OKCANCEL|MB_ICONQUESTION);
+ if (res == 1)
{
if (!handle) return 0;
@@ -1565,26 +1565,26 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w {
struct ClcContact *contact, *destcontact;
struct ClcGroup *group, *destgroup;
- BOOL NeedRename=FALSE;
- TCHAR newName[128]={0};
+ BOOL NeedRename = FALSE;
+ TCHAR newName[128] = {0};
int newIndex,i;
pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
- i=pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
- if (i!=-1 && group->groupId!=destgroup->groupId)
+ i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
+ if (i != -1 && group->groupId != destgroup->groupId)
{
- TCHAR * groupName=mir_tstrdup(pcli->pfnGetGroupName(contact->groupId,0));
- TCHAR * shortGroup=NULL;
- TCHAR * sourceGrName=mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId,0));
+ TCHAR * groupName = mir_tstrdup(pcli->pfnGetGroupName(contact->groupId,0));
+ TCHAR * shortGroup = NULL;
+ TCHAR * sourceGrName = mir_tstrdup(pcli->pfnGetGroupName(destgroup->groupId,0));
if (groupName)
{
- int len=(int)_tcslen(groupName);
- do {len--;}while(len>=0 && groupName[len]!='\\');
- if (len>=0) shortGroup=groupName+len+1;
- else shortGroup=groupName;
+ int len = (int)_tcslen(groupName);
+ do {len--;}while(len >= 0 && groupName[len] != '\\');
+ if (len >= 0) shortGroup = groupName+len+1;
+ else shortGroup = groupName;
}
if (shortGroup)
{
- NeedRename=TRUE;
+ NeedRename = TRUE;
if (sourceGrName)
mir_sntprintf(newName,SIZEOF(newName),_T("%s\\%s"),sourceGrName,shortGroup);
else
@@ -1593,8 +1593,8 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w if (groupName) mir_free_and_nill(groupName);
if (sourceGrName) mir_free_and_nill(sourceGrName);
}
- newIndex=CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact&&i!=-1)?destcontact->groupId:0);
- newIndex=newIndex?newIndex:contact->groupId;
+ newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact&&i != -1)?destcontact->groupId:0);
+ newIndex = newIndex?newIndex:contact->groupId;
if (NeedRename) pcli->pfnRenameGroup(newIndex,newName);
break;
}
@@ -1609,34 +1609,34 @@ static LRESULT clcOnLButtonUp(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM w }
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
- dat->iDragItem=-1;
- dat->iInsertionMark=-1;
+ dat->iDragItem = -1;
+ dat->iInsertionMark = -1;
return 0;
}
static LRESULT clcOnLButtonDblClick(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
KillTimer(hwnd,TIMERID_SUBEXPAND);
- hitcontact=NULL;
+ hitcontact = NULL;
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
static LRESULT clcOnDestroy(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int i=0;
+ int i = 0;
- for(i=0;i<=FONTID_MODERN_MAX;i++)
+ for(i = 0;i <= FONTID_MODERN_MAX;i++)
{
- if(dat->fontModernInfo[i].hFont) DeleteObject(dat->fontModernInfo[i].hFont);
- dat->fontModernInfo[i].hFont=NULL;
+ if (dat->fontModernInfo[i].hFont) DeleteObject(dat->fontModernInfo[i].hFont);
+ dat->fontModernInfo[i].hFont = NULL;
}
if (dat->hMenuBackground)
{
DeleteObject(dat->hMenuBackground);
- dat->hMenuBackground=NULL;
+ dat->hMenuBackground = NULL;
}
if (!dat->bkChanged && dat->hBmpBackground)
{
DeleteObject(dat->hBmpBackground);
- dat->hBmpBackground=NULL;
+ dat->hBmpBackground = NULL;
}
ImageArray_Clear(&dat->avatar_cache);
@@ -1673,7 +1673,7 @@ static LRESULT clcOnIntmGroupChanged(struct ClcData *dat, HWND hwnd, UINT msg, W if (pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL)) {
CopyMemory(contact->iExtraImage, iExtraImage, SIZEOF(iExtraImage));
CopyMemory((void*)contact->iWideExtraImage, (void*)iWideExtraImage, sizeof(iWideExtraImage));
- if(flags & CONTACTF_CHECKED)
+ if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
}
nm.hdr.code = CLN_CONTACTMOVED;
@@ -1692,13 +1692,13 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP struct ClcContact *contact = NULL;
struct ClcGroup *group = NULL;
int recalcScrollBar = 0, shouldShow;
- BOOL needRepaint=FALSE;
+ BOOL needRepaint = FALSE;
WORD status;
char *szProto;
- int nHiddenStatus=0;
- BOOL image_is_special=FALSE;
- RECT iconRect={0};
- int contacticon=CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
+ int nHiddenStatus = 0;
+ BOOL image_is_special = FALSE;
+ RECT iconRect = {0};
+ int contacticon = CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
HANDLE hSelItem = NULL;
struct ClcContact *selcontact = NULL;
@@ -1706,16 +1706,16 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP if (szProto == NULL)
status = ID_STATUS_OFFLINE;
else
- status=GetContactCachedStatus((HANDLE) wParam);
- image_is_special=(LOWORD(contacticon) != (LOWORD(lParam))); //check only base icons
+ status = GetContactCachedStatus((HANDLE) wParam);
+ image_is_special = (LOWORD(contacticon) !=(LOWORD(lParam))); //check only base icons
- nHiddenStatus=CLVM_GetContactHiddenStatus((HANDLE)wParam, szProto, dat);
+ nHiddenStatus = CLVM_GetContactHiddenStatus((HANDLE)wParam, szProto, dat);
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- bool isVisiblebyFilter = ( ( ( style & CLS_SHOWHIDDEN ) && nHiddenStatus != -1 ) || !nHiddenStatus );
+ bool isVisiblebyFilter = ( ( ( style & CLS_SHOWHIDDEN ) && nHiddenStatus !=-1 ) || !nHiddenStatus );
bool ifVisibleByClui = !pcli->pfnIsHiddenMode( dat, status );
bool isVisible = g_CluiData.bFilterEffective&CLVM_FILTER_STATUS ? TRUE : ifVisibleByClui;
- bool isIconChanged = CallService(MS_CLIST_GETCONTACTICON, wParam, 0) != LOWORD(lParam);
+ bool isIconChanged = CallService(MS_CLIST_GETCONTACTICON, wParam, 0) !=LOWORD(lParam);
shouldShow = isVisiblebyFilter && ( isVisible || isIconChanged ) ;
@@ -1725,16 +1725,16 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0))
{
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
+ if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) !=-1)
hSelItem = pcli->pfnContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, (HANDLE) wParam, (style & CLS_CONTACTLIST) == 0, 0);
recalcScrollBar = 1;
- needRepaint=TRUE;
+ needRepaint = TRUE;
pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL);
if (contact)
{
contact->iImage = lParam;
- contact->image_is_special=image_is_special;
+ contact->image_is_special = image_is_special;
pcli->pfnNotifyNewContact(hwnd, (HANDLE) wParam);
dat->NeedResort = 1;
}
@@ -1747,14 +1747,14 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP return 0;
if ( !shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE) && clcItemNotHiddenOffline(dat, group, contact))
{
- shouldShow=TRUE;
+ shouldShow = TRUE;
}
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)
+ if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) !=-1)
hSelItem = pcli->pfnContactToHItem(selcontact);
pcli->pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
- needRepaint=TRUE;
+ needRepaint = TRUE;
recalcScrollBar = 1;
dat->NeedResort = 1;
}
@@ -1764,16 +1764,16 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP if (!pcli->pfnIsHiddenMode(dat, status))
contact->flags |= CONTACTF_ONLINE;
else
- contact->flags &= ~CONTACTF_ONLINE;
- contact->image_is_special=image_is_special;
+ contact->flags &= ~CONTACTF_ONLINE;
+ contact->image_is_special = image_is_special;
if (!image_is_special) //Only if it is status changing
{
dat->NeedResort = 1;
- needRepaint=TRUE;
+ needRepaint = TRUE;
}
- else if (dat->m_paintCouter==contact->lastPaintCounter) //if contacts is visible
+ else if (dat->m_paintCouter == contact->lastPaintCounter) //if contacts is visible
{
- needRepaint=TRUE;
+ needRepaint = TRUE;
}
}
@@ -1794,7 +1794,7 @@ static LRESULT clcOnIntmIconChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP }
else if (needRepaint)
{
- if (contact && contact->pos_icon.bottom!=0 && contact->pos_icon.right!=0)
+ if (contact && contact->pos_icon.bottom != 0 && contact->pos_icon.right != 0)
CLUI__cliInvalidateRect(hwnd,&(contact->pos_icon),FALSE);
else
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
@@ -1836,7 +1836,7 @@ static LRESULT clcOnIntmTimeZoneChanged(struct ClcData *dat, HWND hwnd, UINT msg static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
struct ClcContact *contact;
- int ret=corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
+ int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
pcli->pfnInvalidateDisplayNameCacheEntry((HANDLE)wParam);
if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,FALSE))
@@ -1848,7 +1848,7 @@ static LRESULT clcOnIntmNameChanged(struct ClcData *dat, HWND hwnd, UINT msg, WP Cache_GetText(dat,contact,1);
cliRecalcScrollBar(hwnd,dat);
}
- dat->NeedResort=1;
+ dat->NeedResort = 1;
pcli->pfnSortContacts();
return ret;
@@ -1856,7 +1856,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);
+ int lResult = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
if (!ServiceExists("ExtraIcon/Register"))
ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
return lResult;
@@ -1881,19 +1881,19 @@ static LRESULT clcOnIntmStatusMsgChanged(struct ClcData *dat, HWND hwnd, UINT ms static LRESULT clcOnIntmNotOnListChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING*)lParam;
+ DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING*)lParam;
struct ClcContact *contact;
if (!FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if(contact->type!=CLCIT_CONTACT)
+ if (contact->type != CLCIT_CONTACT)
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if(dbcws->value.type==DBVT_DELETED || dbcws->value.bVal==0)
- contact->flags&=~CONTACTF_NOTONLIST;
+ if (dbcws->value.type == DBVT_DELETED || dbcws->value.bVal == 0)
+ contact->flags &= ~CONTACTF_NOTONLIST;
else
- contact->flags|=CONTACTF_NOTONLIST;
+ contact->flags |= CONTACTF_NOTONLIST;
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
@@ -1911,29 +1911,29 @@ static LRESULT clcOnIntmScrollBarChanged(struct ClcData *dat, HWND hwnd, UINT ms static LRESULT clcOnIntmStatusChanged(struct ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- int ret=corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
- if (wParam != 0)
+ int ret = corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
+ if (wParam !=0)
{
pdisplayNameCacheEntry pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry((HANDLE)wParam);
if (pdnce && pdnce->m_cache_cszProto)
{
- struct ClcContact *contact=NULL;
+ struct ClcContact *contact = NULL;
pdnce___SetStatus( pdnce, GetStatusForContact(pdnce->m_cache_hContact,pdnce->m_cache_cszProto));
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)
+ (dat->second_line_show)// && dat->second_line_type == TEXT_STATUS)
+ || (dat->third_line_show)// && dat->third_line_type == TEXT_STATUS)
))
gtaRenewText(pdnce->m_cache_hContact);
SendMessage(hwnd,INTM_ICONCHANGED, wParam, (LPARAM) CallService(MS_CLIST_GETCONTACTICON, wParam, 1));
- if(FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
+ if (FindItem(hwnd,dat,(HANDLE)wParam,&contact,NULL,NULL,TRUE))
{
- if (contact && contact->type==CLCIT_CONTACT)
+ if (contact && contact->type == CLCIT_CONTACT)
{
if (!contact->image_is_special && pdnce___GetStatus( pdnce )>ID_STATUS_OFFLINE)
- contact->iImage=CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
+ contact->iImage = CallService(MS_CLIST_GETCONTACTICON, wParam, 1);
if (contact->isSubcontact
&& contact->subcontacts
- && contact->subcontacts->type==CLCIT_CONTACT)
+ && contact->subcontacts->type == CLCIT_CONTACT)
pcli->pfnClcBroadcast( INTM_STATUSCHANGED,(WPARAM)contact->subcontacts->hContact,0); //forward status changing to host meta contact
}
}
@@ -1976,10 +1976,10 @@ 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);
+ 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);
+ hAckHook = (HANDLE)ModernHookEvent(ME_PROTO_ACK,clcHookProtoAck);
ModernHookEvent(ME_SYSTEM_MODULESLOADED, clcHookModulesLoaded);
ModernHookEvent(ME_DB_EVENT_ADDED, clcHookDbEventAdded);
ModernHookEvent(ME_SYSTEM_SHUTDOWN,clcHookSystemShutdown);
@@ -1989,16 +1989,16 @@ HRESULT ClcLoadModule() int ClcUnloadModule()
{
- if(hAvatarChanged!=0)
+ if (hAvatarChanged != 0)
ModernUnhookEvent(hAvatarChanged);
- if(hSmileyAddOptionsChangedHook!=0)
+ if (hSmileyAddOptionsChangedHook != 0)
ModernUnhookEvent(hSmileyAddOptionsChangedHook);
- if(hIconChangedHook!=0)
+ if (hIconChangedHook != 0)
ModernUnhookEvent(hIconChangedHook);
- if ( g_CluiData.bOldUseGroups != (BYTE)-1 )
+ if ( g_CluiData.bOldUseGroups !=(BYTE)-1 )
db_set_b(NULL,"CList","UseGroups",(BYTE)g_CluiData.bOldUseGroups );
- if ( g_CluiData.boldHideOffline != (BYTE)-1 )
+ if ( g_CluiData.boldHideOffline !=(BYTE)-1 )
db_set_b(NULL,"CList","HideOffline",(BYTE)g_CluiData.boldHideOffline );
return 0;
@@ -2016,22 +2016,22 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) if (!lstrcmpA(pcli->clcProto[i].szProto, ack->szModule))
{
pcli->clcProto[i].dwStatus = (WORD) ack->lParam;
- if (pcli->clcProto[i].dwStatus>=ID_STATUS_OFFLINE)
+ if (pcli->clcProto[i].dwStatus >= ID_STATUS_OFFLINE)
pcli->pfnTrayIconUpdateBase(pcli->clcProto[i].szProto);
if (!ServiceExists("ExtraIcon/Register"))
- if(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE)!=-1)
+ if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE) != -1)
ExtraImage_SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)NULL);
return 0;
}
}
}
}
- else if (ack->type==ACKTYPE_AWAYMSG)
+ else if (ack->type == ACKTYPE_AWAYMSG)
{
- if (ack->result==ACKRESULT_SUCCESS && ack->lParam) {
+ if (ack->result == ACKRESULT_SUCCESS && ack->lParam) {
{//Do not change DB if it is IRC protocol
- if (ack->szModule!= NULL)
- if(db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0) return 0;
+ if (ack->szModule != NULL)
+ if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) !=0) return 0;
}
db_set_ws(ack->hContact,"CList","StatusMsg",(const TCHAR *)ack->lParam);
@@ -2040,14 +2040,14 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) else
{
//DBDeleteContactSetting(ack->hContact,"CList","StatusMsg");
- //char a='\0';
+ //char a = '\0';
{//Do not change DB if it is IRC protocol
- if (ack->szModule!= NULL)
- if(db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) != 0) return 0;
+ if (ack->szModule != NULL)
+ if (db_get_b(ack->hContact, ack->szModule, "ChatRoom", 0) !=0) return 0;
}
if (ack->hContact)
{
- char * val= db_get_sa(ack->hContact,"CList","StatusMsg");
+ char * val = db_get_sa(ack->hContact,"CList","StatusMsg");
if (val)
{
if (!mir_bool_strcmpi(val,""))
@@ -2060,12 +2060,12 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) //pcli->pfnClcBroadcast( INTM_STATUSMSGCHANGED,(WPARAM)ack->hContact,&a);
}
}
- else if (ack->type==ACKTYPE_AVATAR)
+ else if (ack->type == ACKTYPE_AVATAR)
{
- if (ack->result==ACKRESULT_SUCCESS)
+ if (ack->result == ACKRESULT_SUCCESS)
{
PROTO_AVATAR_INFORMATIONT *pai = (PROTO_AVATAR_INFORMATIONT*)ack->hProcess;
- if (pai != NULL && pai->hContact != NULL)
+ if (pai !=NULL && pai->hContact !=NULL)
pcli->pfnClcBroadcast( INTM_AVATARCHANGED,(WPARAM)pai->hContact,0);
}
}
@@ -2079,33 +2079,33 @@ int ClcDoProtoAck(HANDLE wParam,ACKDATA * ack) int ClcGetShortData(struct ClcData* pData, struct SHORTDATA *pShortData)
{
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;
- pShortData->text_use_protocol_smileys=pData->text_use_protocol_smileys;
- pShortData->contact_time_show_only_if_different=pData->contact_time_show_only_if_different;
+ pShortData->hWnd = pData->hWnd;
+ pShortData->text_replace_smileys = pData->text_replace_smileys;
+ pShortData->text_smiley_height = pData->text_smiley_height;
+ pShortData->text_use_protocol_smileys = pData->text_use_protocol_smileys;
+ pShortData->contact_time_show_only_if_different = pData->contact_time_show_only_if_different;
// Second line
- pShortData->second_line_show=pData->second_line_show;
- pShortData->second_line_draw_smileys=pData->second_line_draw_smileys;
- pShortData->second_line_type=pData->second_line_type;
+ pShortData->second_line_show = pData->second_line_show;
+ pShortData->second_line_draw_smileys = pData->second_line_draw_smileys;
+ pShortData->second_line_type = pData->second_line_type;
_tcsncpy(pShortData->second_line_text,pData->second_line_text,TEXT_TEXT_MAX_LENGTH);
- pShortData->second_line_xstatus_has_priority=pData->second_line_xstatus_has_priority;
- pShortData->second_line_show_status_if_no_away=pData->second_line_show_status_if_no_away;
- pShortData->second_line_show_listening_if_no_away=pData->second_line_show_listening_if_no_away;
- pShortData->second_line_use_name_and_message_for_xstatus=pData->second_line_use_name_and_message_for_xstatus;
+ pShortData->second_line_xstatus_has_priority = pData->second_line_xstatus_has_priority;
+ pShortData->second_line_show_status_if_no_away = pData->second_line_show_status_if_no_away;
+ pShortData->second_line_show_listening_if_no_away = pData->second_line_show_listening_if_no_away;
+ pShortData->second_line_use_name_and_message_for_xstatus = pData->second_line_use_name_and_message_for_xstatus;
- pShortData->third_line_show=pData->third_line_show;
- pShortData->third_line_draw_smileys=pData->third_line_draw_smileys;
- pShortData->third_line_type=pData->third_line_type;
+ pShortData->third_line_show = pData->third_line_show;
+ pShortData->third_line_draw_smileys = pData->third_line_draw_smileys;
+ pShortData->third_line_type = pData->third_line_type;
_tcsncpy(pShortData->third_line_text,pData->third_line_text,TEXT_TEXT_MAX_LENGTH);
- pShortData->third_line_xstatus_has_priority=pData->third_line_xstatus_has_priority;
- pShortData->third_line_show_status_if_no_away=pData->third_line_show_status_if_no_away;
- pShortData->third_line_show_listening_if_no_away=pData->third_line_show_listening_if_no_away;
- pShortData->third_line_use_name_and_message_for_xstatus=pData->third_line_use_name_and_message_for_xstatus;
+ pShortData->third_line_xstatus_has_priority = pData->third_line_xstatus_has_priority;
+ pShortData->third_line_show_status_if_no_away = pData->third_line_show_status_if_no_away;
+ pShortData->third_line_show_listening_if_no_away = pData->third_line_show_listening_if_no_away;
+ pShortData->third_line_use_name_and_message_for_xstatus = pData->third_line_use_name_and_message_for_xstatus;
return 0;
}
@@ -2116,11 +2116,11 @@ int ClcEnterDragToScroll(HWND hwnd, int Y) {
struct ClcData * dat;
if (IsDragToScrollMode) return 0;
- dat=(struct ClcData*)GetWindowLongPtr(hwnd,0);
+ dat = (struct ClcData*)GetWindowLongPtr(hwnd,0);
if (!dat) return 0;
- StartDragPos=Y;
- StartScrollPos=dat->yScroll;
- IsDragToScrollMode=1;
+ StartDragPos = Y;
+ StartScrollPos = dat->yScroll;
+ IsDragToScrollMode = 1;
SetCapture(hwnd);
return 1;
}
@@ -2135,9 +2135,9 @@ LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wPara #define CASE_MSG_RET(msg, handler) case msg: return handler(dat, hwnd, msg, wParam, lParam);
struct ClcData *dat;
- dat=(struct ClcData*)GetWindowLongPtr(hwnd,0);
+ dat = (struct ClcData*)GetWindowLongPtr(hwnd,0);
- if(msg>=CLM_FIRST && msg<CLM_LAST)
+ if (msg >= CLM_FIRST && msg < CLM_LAST)
return cli_ProcessExternalMessages(hwnd,dat,msg,wParam,lParam);
switch (msg)
diff --git a/plugins/Clist_modern/modern_clcidents.cpp b/plugins/Clist_modern/modern_clcidents.cpp index 5e046807f3..2658d81a62 100644 --- a/plugins/Clist_modern/modern_clcidents.cpp +++ b/plugins/Clist_modern/modern_clcidents.cpp @@ -26,8 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_commonprototypes.h"
#define CacheArrSize 255
-struct ClcGroup *CacheIndex[CacheArrSize]={NULL};
-boolean CacheIndexClear=TRUE;
+struct ClcGroup *CacheIndex[CacheArrSize] = {NULL};
+boolean CacheIndexClear = TRUE;
/* the CLC uses 3 different ways to identify elements in its list, this file
contains routines to convert between them.
@@ -48,56 +48,56 @@ exclusively externally int GetContactIndex(struct ClcGroup *group,struct ClcContact *contact)
{
- int i=0;
- for (i=0; i<group->cl.count; i++)
- if (group->cl.items[i]->hContact==contact->hContact) return i;
+ int i = 0;
+ for (i = 0; i < group->cl.count; i++)
+ if (group->cl.items[i]->hContact == contact->hContact) return i;
return -1;
}
int cliGetRowsPriorTo(struct ClcGroup *group,struct ClcGroup *subgroup,int contactIndex)
{
- int count=0;
+ int count = 0;
BYTE k;
- int subcontactscount=0;
- k=db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
- group->scanIndex=0;
+ int subcontactscount = 0;
+ k = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
+ group->scanIndex = 0;
for (;;) {
- if(group->scanIndex==group->cl.count) {
- group=group->parent;
- if(group==NULL) break;
+ if (group->scanIndex == group->cl.count) {
+ group = group->parent;
+ if (group == NULL) break;
group->scanIndex++;
continue;
}
- if(group==subgroup && contactIndex-subcontactscount==group->scanIndex) return count;
+ if (group == subgroup && contactIndex-subcontactscount == group->scanIndex) return count;
count++;
- /* if ((group->cl.items[group->scanIndex]->type==CLCIT_CONTACT) && (group->cl.items[group->scanIndex].flags & CONTACTF_STATUSMSG)) {
+ /* if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) && (group->cl.items[group->scanIndex].flags & CONTACTF_STATUSMSG)) {
count++;
}
*/
- if(group->cl.items[group->scanIndex]->type==CLCIT_GROUP) {
- if(group->cl.items[group->scanIndex]->group==subgroup && contactIndex==-1)
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
+ if (group->cl.items[group->scanIndex]->group == subgroup && contactIndex == -1)
return count-1;
- if(group->cl.items[group->scanIndex]->group->expanded) {
- group=group->cl.items[group->scanIndex]->group;
- group->scanIndex=0;
- subcontactscount=0;
+ if (group->cl.items[group->scanIndex]->group->expanded) {
+ group = group->cl.items[group->scanIndex]->group;
+ group->scanIndex = 0;
+ subcontactscount = 0;
continue;
}
}
- if (group==subgroup)
+ if (group == subgroup)
{
- if(group->cl.items[group->scanIndex]->type==CLCIT_CONTACT && group->cl.items[group->scanIndex]->SubAllocated)
+ if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->SubAllocated)
{
- int rows=(group->cl.items[group->scanIndex]->SubAllocated*group->cl.items[group->scanIndex]->SubExpanded*k);
- if (group->scanIndex+rows >= contactIndex)
+ int rows = (group->cl.items[group->scanIndex]->SubAllocated*group->cl.items[group->scanIndex]->SubExpanded*k);
+ if (group->scanIndex+rows >= contactIndex)
return count+(contactIndex-group->scanIndex)-1;
}
}
- if(group->cl.items[group->scanIndex]->type==CLCIT_CONTACT)
+ if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT)
{
- count+=(group->cl.items[group->scanIndex]->SubAllocated*group->cl.items[group->scanIndex]->SubExpanded*k);
- subcontactscount+=(group->cl.items[group->scanIndex]->SubAllocated*group->cl.items[group->scanIndex]->SubExpanded*k);
+ count += (group->cl.items[group->scanIndex]->SubAllocated*group->cl.items[group->scanIndex]->SubExpanded*k);
+ subcontactscount += (group->cl.items[group->scanIndex]->SubAllocated*group->cl.items[group->scanIndex]->SubExpanded*k);
}
group->scanIndex++;
}
@@ -111,53 +111,53 @@ int cliFindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **c int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **contact,struct ClcGroup **subgroup,int *isVisible, BOOL isIgnoreSubcontacts)
{
- int index=0, i;
- int nowVisible=1;
+ int index = 0, i;
+ int nowVisible = 1;
struct ClcGroup *group;
- group=&dat->list;
+ group = &dat->list;
- group->scanIndex=0;
- group=&dat->list;
+ group->scanIndex = 0;
+ group = &dat->list;
for (;;) {
- if(group->scanIndex==group->cl.count) {
+ if (group->scanIndex == group->cl.count) {
struct ClcGroup *tgroup;
- group=group->parent;
- if(group==NULL) break;
- nowVisible=1;
- for(tgroup=group;tgroup;tgroup=tgroup->parent)
+ group = group->parent;
+ if (group == NULL) break;
+ nowVisible = 1;
+ for(tgroup = group;tgroup;tgroup = tgroup->parent)
{
if (!tgroup->expanded)
{
- nowVisible=0;
+ nowVisible = 0;
break;
}
}
group->scanIndex++;
continue;
}
- if(nowVisible) index++;
- if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_GROUP && ((UINT_PTR)hItem&~HCONTACT_ISGROUP)==group->cl.items[group->scanIndex]->groupId) ||
- (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact==hItem) ||
- (IsHContactInfo(hItem) && group->cl.items[group->scanIndex]->type==CLCIT_INFO && group->cl.items[group->scanIndex]->hContact==(HANDLE)((UINT_PTR)hItem&~HCONTACT_ISINFO)))
+ if (nowVisible) index++;
+ if ((IsHContactGroup(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && ((UINT_PTR)hItem&~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) ||
+ (IsHContactContact(hItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == hItem) ||
+ (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 (isVisible) {
+ if (!nowVisible) *isVisible = 0;
else {
int posy = cliGetRowTopY(dat,index+1);
- if(posy<dat->yScroll)
- *isVisible=0;
+ if (posy < dat->yScroll)
+ *isVisible = 0;
else {
RECT clRect;
GetClientRect(hwnd,&clRect);
- if(posy>=dat->yScroll+clRect.bottom) *isVisible=0;
- else *isVisible=1;
+ if (posy >= dat->yScroll+clRect.bottom) *isVisible = 0;
+ else *isVisible = 1;
}
}
}
- if(contact) *contact=group->cl.items[group->scanIndex];
- if(subgroup) *subgroup=group;
+ if (contact) *contact = group->cl.items[group->scanIndex];
+ if (subgroup) *subgroup = group;
return 1;
}
@@ -166,7 +166,7 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont group->cl.items[group->scanIndex]->type == CLCIT_CONTACT &&
group->cl.items[group->scanIndex]->SubAllocated > 0)
{
- for (i=0; i<group->cl.items[group->scanIndex]->SubAllocated; i++)
+ for (i = 0; i < group->cl.items[group->scanIndex]->SubAllocated; i++)
{
if (group->cl.items[group->scanIndex]->subcontacts[i].hContact == hItem)
{
@@ -179,18 +179,18 @@ int FindItem(HWND hwnd,struct ClcData *dat,HANDLE hItem,struct ClcContact **cont return 0;
}
#endif
- if(contact) *contact=&group->cl.items[group->scanIndex]->subcontacts[i];
- if(subgroup) *subgroup=group;
+ if (contact) *contact = &group->cl.items[group->scanIndex]->subcontacts[i];
+ if (subgroup) *subgroup = group;
return 1;
}
}
}
- if(group->cl.items[group->scanIndex]->type==CLCIT_GROUP) {
- group=group->cl.items[group->scanIndex]->group;
- group->scanIndex=0;
- nowVisible&=group->expanded;
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
+ group = group->cl.items[group->scanIndex]->group;
+ group->scanIndex = 0;
+ nowVisible &= group->expanded;
continue;
}
group->scanIndex++;
@@ -204,65 +204,65 @@ void ClearRowByIndexCache() if (!CacheIndexClear)
{
memset(CacheIndex,0,sizeof(CacheIndex));
- CacheIndexClear=TRUE;
+ CacheIndexClear = TRUE;
};
}
int cliGetRowByIndex(struct ClcData *dat,int testindex,struct ClcContact **contact,struct ClcGroup **subgroup)
{
- int index=0,i;
- struct ClcGroup *group=&dat->list;
+ int index = 0,i;
+ struct ClcGroup *group = &dat->list;
- if (testindex<0) return (-1);
+ if (testindex < 0) return (-1);
{
- group->scanIndex=0;
+ group->scanIndex = 0;
for (;;) {
- if(group->scanIndex==group->cl.count) {
- group=group->parent;
- if(group==NULL) break;
+ if (group->scanIndex == group->cl.count) {
+ group = group->parent;
+ if (group == NULL) break;
group->scanIndex++;
continue;
}
- if ((index>0) && (index<CacheArrSize))
+ if ((index>0) && (index < CacheArrSize))
{
- CacheIndex[index]=group;
- CacheIndexClear=FALSE;
+ CacheIndex[index] = group;
+ CacheIndexClear = FALSE;
};
- if(testindex==index) {
- if(contact) *contact=group->cl.items[group->scanIndex];
- if(subgroup) *subgroup=group;
+ if (testindex == index) {
+ if (contact) *contact = group->cl.items[group->scanIndex];
+ if (subgroup) *subgroup = group;
return index;
}
- if (group->cl.items[group->scanIndex]->type==CLCIT_CONTACT)
+ if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT)
if (group->cl.items[group->scanIndex]->SubAllocated)
if (group->cl.items[group->scanIndex]->SubExpanded && dat->expandMeta)
{
- for (i=0;i<group->cl.items[group->scanIndex]->SubAllocated;i++)
+ for (i = 0;i < group->cl.items[group->scanIndex]->SubAllocated;i++)
{
- if ((index>0) && (index<CacheArrSize))
+ if ((index>0) && (index < CacheArrSize))
{
- CacheIndex[index]=group;
- CacheIndexClear=FALSE;
+ CacheIndex[index] = group;
+ CacheIndexClear = FALSE;
};
index++;
- if(testindex==index) {
- if(contact)
+ if (testindex == index) {
+ if (contact)
{
- *contact=&group->cl.items[group->scanIndex]->subcontacts[i];
- (*contact)->subcontacts=group->cl.items[group->scanIndex];
+ *contact = &group->cl.items[group->scanIndex]->subcontacts[i];
+ (*contact)->subcontacts = group->cl.items[group->scanIndex];
}
- if(subgroup) *subgroup=group;
+ if (subgroup) *subgroup = group;
return index;
}
}
}
index++;
- if(group->cl.items[group->scanIndex]->type==CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) {
- group=group->cl.items[group->scanIndex]->group;
- group->scanIndex=0;
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) {
+ group = group->cl.items[group->scanIndex]->group;
+ group->scanIndex = 0;
continue;
}
group->scanIndex++;
@@ -290,10 +290,10 @@ HANDLE ContactToItemHandle(struct ClcContact *contact,DWORD *nmFlags) case CLCIT_CONTACT:
return contact->hContact;
case CLCIT_GROUP:
- if(nmFlags) *nmFlags|=CLNF_ISGROUP;
+ if (nmFlags) *nmFlags |= CLNF_ISGROUP;
return (HANDLE)contact->groupId;
case CLCIT_INFO:
- if(nmFlags) *nmFlags|=CLNF_ISINFO;
+ if (nmFlags) *nmFlags |= CLNF_ISINFO;
return (HANDLE)((DWORD_PTR)contact->hContact|HCONTACT_ISINFO);
}
return NULL;
diff --git a/plugins/Clist_modern/modern_clcitems.cpp b/plugins/Clist_modern/modern_clcitems.cpp index 01ed44aa02..a0684697ac 100644 --- a/plugins/Clist_modern/modern_clcitems.cpp +++ b/plugins/Clist_modern/modern_clcitems.cpp @@ -32,51 +32,51 @@ void AddSubcontacts(struct ClcData *dat, struct ClcContact * cont, BOOL showOffl int subcount,i,j;
HANDLE hsub;
pdisplayNameCacheEntry cacheEntry;
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(cont->hContact);
- cont->SubExpanded=(db_get_b(cont->hContact,"CList","Expanded",0) && (db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT)));
- subcount=(int)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)cont->hContact,0);
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(cont->hContact);
+ cont->SubExpanded = (db_get_b(cont->hContact,"CList","Expanded",0) && (db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT)));
+ subcount = (int)CallService(MS_MC_GETNUMCONTACTS,(WPARAM)cont->hContact,0);
if (subcount <= 0) {
- cont->isSubcontact=0;
- cont->subcontacts=NULL;
- cont->SubAllocated=0;
+ cont->isSubcontact = 0;
+ cont->subcontacts = NULL;
+ cont->SubAllocated = 0;
return;
}
- cont->isSubcontact=0;
+ cont->isSubcontact = 0;
mir_free(cont->subcontacts);
- cont->subcontacts=(struct ClcContact *) mir_calloc(sizeof(struct ClcContact)*subcount);
- cont->SubAllocated=subcount;
- i=0;
- for (j=0; j<subcount; j++) {
+ cont->subcontacts = (struct ClcContact *) mir_calloc(sizeof(struct ClcContact)*subcount);
+ cont->SubAllocated = subcount;
+ i = 0;
+ for (j = 0; j < subcount; j++) {
WORD wStatus;
- hsub=(HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hsub);
- wStatus=pdnce___GetStatus( cacheEntry );
+ hsub = (HANDLE)CallService(MS_MC_GETSUBCONTACT,(WPARAM)cont->hContact,j);
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hsub);
+ wStatus = pdnce___GetStatus( cacheEntry );
if (showOfflineHereGroup||(!(db_get_b(NULL,"CLC","MetaHideOfflineSub",SETTING_METAHIDEOFFLINESUB_DEFAULT) && db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)) ||
- wStatus!=ID_STATUS_OFFLINE )
+ wStatus != ID_STATUS_OFFLINE )
//&&
//(!cacheEntry->Hidden || style&CLS_SHOWHIDDEN)
)
{
- cont->subcontacts[i].hContact=cacheEntry->m_cache_hContact;
+ cont->subcontacts[i].hContact = cacheEntry->m_cache_hContact;
cont->subcontacts[i].avatar_pos = AVATAR_POS_DONT_HAVE;
Cache_GetAvatar(dat, &cont->subcontacts[i]);
- cont->subcontacts[i].iImage=CallService(MS_CLIST_GETCONTACTICON,(WPARAM)cacheEntry->m_cache_hContact,1);
+ cont->subcontacts[i].iImage = CallService(MS_CLIST_GETCONTACTICON,(WPARAM)cacheEntry->m_cache_hContact,1);
memset(cont->subcontacts[i].iExtraImage,0xFF,sizeof(cont->subcontacts[i].iExtraImage));
memset((void*)cont->subcontacts[i].iWideExtraImage,0xFF,sizeof(cont->subcontacts[i].iWideExtraImage));
- cont->subcontacts[i].proto=cacheEntry->m_cache_cszProto;
- cont->subcontacts[i].type=CLCIT_CONTACT;
- cont->subcontacts[i].flags=0;//CONTACTF_ONLINE;
- cont->subcontacts[i].isSubcontact=i+1;
- cont->subcontacts[i].lastPaintCounter=0;
- cont->subcontacts[i].subcontacts=cont;
- cont->subcontacts[i].image_is_special=FALSE;
- //cont->subcontacts[i].status=cacheEntry->status;
+ cont->subcontacts[i].proto = cacheEntry->m_cache_cszProto;
+ cont->subcontacts[i].type = CLCIT_CONTACT;
+ cont->subcontacts[i].flags = 0;//CONTACTF_ONLINE;
+ cont->subcontacts[i].isSubcontact = i+1;
+ cont->subcontacts[i].lastPaintCounter = 0;
+ cont->subcontacts[i].subcontacts = cont;
+ cont->subcontacts[i].image_is_special = FALSE;
+ //cont->subcontacts[i].status = cacheEntry->status;
Cache_GetTimezone(dat, (&cont->subcontacts[i])->hContact);
Cache_GetText(dat, &cont->subcontacts[i],1);
@@ -84,23 +84,23 @@ void AddSubcontacts(struct ClcData *dat, struct ClcContact * cont, BOOL showOffl int apparentMode;
char *szProto;
int idleMode;
- szProto=cacheEntry->m_cache_cszProto;
- if(szProto!=NULL && !pcli->pfnIsHiddenMode(dat,wStatus))
- cont->subcontacts[i].flags|=CONTACTF_ONLINE;
- apparentMode=szProto!=NULL?cacheEntry->ApparentMode:0;
- apparentMode=szProto!=NULL?cacheEntry->ApparentMode:0;
- if(apparentMode==ID_STATUS_OFFLINE) cont->subcontacts[i].flags|=CONTACTF_INVISTO;
- else if(apparentMode==ID_STATUS_ONLINE) cont->subcontacts[i].flags|=CONTACTF_VISTO;
- else if(apparentMode) cont->subcontacts[i].flags|=CONTACTF_VISTO|CONTACTF_INVISTO;
- if(cacheEntry->NotOnList) cont->subcontacts[i].flags|=CONTACTF_NOTONLIST;
- idleMode=szProto!=NULL?cacheEntry->IdleTS:0;
- if (idleMode) cont->subcontacts[i].flags|=CONTACTF_IDLE;
+ szProto = cacheEntry->m_cache_cszProto;
+ if (szProto != NULL && !pcli->pfnIsHiddenMode(dat,wStatus))
+ cont->subcontacts[i].flags |= CONTACTF_ONLINE;
+ apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
+ apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
+ if (apparentMode == ID_STATUS_OFFLINE) cont->subcontacts[i].flags |= CONTACTF_INVISTO;
+ else if (apparentMode == ID_STATUS_ONLINE) cont->subcontacts[i].flags |= CONTACTF_VISTO;
+ else if (apparentMode) cont->subcontacts[i].flags |= CONTACTF_VISTO|CONTACTF_INVISTO;
+ if (cacheEntry->NotOnList) cont->subcontacts[i].flags |= CONTACTF_NOTONLIST;
+ idleMode = szProto != NULL?cacheEntry->IdleTS:0;
+ if (idleMode) cont->subcontacts[i].flags |= CONTACTF_IDLE;
}
i++;
} }
- cont->SubAllocated=i;
- if (!i && cont->subcontacts != NULL) mir_free_and_nill(cont->subcontacts);
+ cont->SubAllocated = i;
+ if (!i && cont->subcontacts !=NULL) mir_free_and_nill(cont->subcontacts);
}
int cli_AddItemToGroup(struct ClcGroup *group,int iAboveItem)
@@ -140,17 +140,17 @@ void cli_FreeContact(struct ClcContact *p) int i;
for ( i = 0 ; i < p->SubAllocated ; i++ ) {
p->subcontacts[i].ssText.DestroySmileyList();
- if ( p->subcontacts[i].avatar_pos==AVATAR_POS_ANIMATED )
+ if ( p->subcontacts[i].avatar_pos == AVATAR_POS_ANIMATED )
AniAva_RemoveAvatar( p->subcontacts[i].hContact );
- p->subcontacts[i].avatar_pos=AVATAR_POS_DONT_HAVE;
+ p->subcontacts[i].avatar_pos = AVATAR_POS_DONT_HAVE;
}
mir_free_and_nill(p->subcontacts);
} }
p->ssText.DestroySmileyList();
- if ( p->avatar_pos==AVATAR_POS_ANIMATED )
+ if ( p->avatar_pos == AVATAR_POS_ANIMATED )
AniAva_RemoveAvatar( p->hContact );
- p->avatar_pos=AVATAR_POS_DONT_HAVE;
+ p->avatar_pos = AVATAR_POS_DONT_HAVE;
corecli.pfnFreeContact( p );
}
@@ -169,94 +169,94 @@ int cli_AddInfoItemToGroup(struct ClcGroup *group,int flags,const TCHAR *pszText static void _LoadDataToContact(struct ClcContact * cont, struct ClcGroup *group, struct ClcData *dat, HANDLE hContact)
{
- pdisplayNameCacheEntry cacheEntry=NULL;
+ pdisplayNameCacheEntry cacheEntry = NULL;
WORD apparentMode;
DWORD idleMode;
char * szProto;
if (!cont) return;
- cont->type=CLCIT_CONTACT;
- cont->SubAllocated=0;
- cont->isSubcontact=0;
- cont->subcontacts=NULL;
- cont->szText[0]=0;
- cont->lastPaintCounter=0;
- cont->image_is_special=FALSE;
- cont->hContact=hContact;
+ cont->type = CLCIT_CONTACT;
+ cont->SubAllocated = 0;
+ cont->isSubcontact = 0;
+ cont->subcontacts = NULL;
+ cont->szText[0] = 0;
+ cont->lastPaintCounter = 0;
+ cont->image_is_special = FALSE;
+ cont->hContact = hContact;
pcli->pfnInvalidateDisplayNameCacheEntry(hContact);
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
- szProto=cacheEntry->m_cache_cszProto;
- cont->proto=szProto;
+ szProto = cacheEntry->m_cache_cszProto;
+ cont->proto = szProto;
- if(szProto!=NULL&&!pcli->pfnIsHiddenMode(dat,pdnce___GetStatus( cacheEntry )))
+ if (szProto != NULL&&!pcli->pfnIsHiddenMode(dat,pdnce___GetStatus( cacheEntry )))
cont->flags |= CONTACTF_ONLINE;
- apparentMode=szProto!=NULL?cacheEntry->ApparentMode:0;
+ apparentMode = szProto != NULL?cacheEntry->ApparentMode:0;
if (apparentMode)
switch (apparentMode)
{
case ID_STATUS_OFFLINE:
- cont->flags|=CONTACTF_INVISTO;
+ cont->flags |= CONTACTF_INVISTO;
break;
case ID_STATUS_ONLINE:
- cont->flags|=CONTACTF_VISTO;
+ cont->flags |= CONTACTF_VISTO;
break;
default:
- cont->flags|=CONTACTF_VISTO|CONTACTF_INVISTO;
+ cont->flags |= CONTACTF_VISTO|CONTACTF_INVISTO;
}
- if(cacheEntry->NotOnList)
- cont->flags|=CONTACTF_NOTONLIST;
- idleMode=szProto!=NULL?cacheEntry->IdleTS:0;
+ if (cacheEntry->NotOnList)
+ cont->flags |= CONTACTF_NOTONLIST;
+ idleMode = szProto != NULL?cacheEntry->IdleTS:0;
if (idleMode)
- cont->flags|=CONTACTF_IDLE;
+ cont->flags |= CONTACTF_IDLE;
//Add subcontacts
if (szProto)
{
- if ( g_szMetaModuleName && dat->IsMetaContactsEnabled && mir_strcmp(cont->proto,g_szMetaModuleName)==0)
+ if ( g_szMetaModuleName && dat->IsMetaContactsEnabled && mir_strcmp(cont->proto,g_szMetaModuleName) == 0)
AddSubcontacts(dat,cont,CLCItems_IsShowOfflineGroup(group));
}
- cont->lastPaintCounter=0;
- cont->avatar_pos=AVATAR_POS_DONT_HAVE;
+ cont->lastPaintCounter = 0;
+ cont->avatar_pos = AVATAR_POS_DONT_HAVE;
Cache_GetAvatar(dat,cont);
Cache_GetText(dat,cont,1);
Cache_GetTimezone(dat,cont->hContact);
- cont->iImage=CallService(MS_CLIST_GETCONTACTICON,(WPARAM)hContact,1);
- cont->bContactRate=db_get_b(hContact, "CList", "Rate",0);
+ cont->iImage = CallService(MS_CLIST_GETCONTACTICON,(WPARAM)hContact,1);
+ cont->bContactRate = db_get_b(hContact, "CList", "Rate",0);
}
static struct ClcContact * AddContactToGroup(struct ClcData *dat,struct ClcGroup *group, pdisplayNameCacheEntry cacheEntry)
{
HANDLE hContact;
int i;
- if (cacheEntry==NULL) return NULL;
- if (group==NULL) return NULL;
- if (dat==NULL) return NULL;
- hContact=cacheEntry->m_cache_hContact;
- dat->NeedResort=1;
- for(i=group->cl.count-1;i>=0;i--)
- if(group->cl.items[i]->type!=CLCIT_INFO || !(group->cl.items[i]->flags&CLCIIF_BELOWCONTACTS)) break;
- i=cli_AddItemToGroup(group,i+1);
+ if (cacheEntry == NULL) return NULL;
+ if (group == NULL) return NULL;
+ if (dat == NULL) return NULL;
+ hContact = cacheEntry->m_cache_hContact;
+ dat->NeedResort = 1;
+ for(i = group->cl.count-1;i >= 0;i--)
+ if (group->cl.items[i]->type != CLCIT_INFO || !(group->cl.items[i]->flags&CLCIIF_BELOWCONTACTS)) break;
+ i = cli_AddItemToGroup(group,i+1);
_LoadDataToContact(group->cl.items[i], group, dat, hContact);
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
ClearRowByIndexCache();
return group->cl.items[i];
}
void * AddTempGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers)
{
- int i=0;
- int f=0;
+ int i = 0;
+ int f = 0;
TCHAR * szGroupName;
DWORD groupFlags;
- char *mbuf=mir_u2a((TCHAR *)szName);
+ char *mbuf = mir_u2a((TCHAR *)szName);
if (wildcmp(mbuf,"-@-HIDDEN-GROUP-@-",0))
{
@@ -264,23 +264,23 @@ void * AddTempGroup(HWND hwnd,struct ClcData *dat,const TCHAR *szName,DWORD flag return NULL;
}
mir_free_and_nill(mbuf);
- for(i=1;;i++)
+ for(i = 1;;i++)
{
szGroupName = pcli->pfnGetGroupName(i,&groupFlags);
- if(szGroupName==NULL) break;
- if (!mir_tstrcmpi(szGroupName,szName)) f=1;
+ if (szGroupName == NULL) break;
+ if (!mir_tstrcmpi(szGroupName,szName)) f = 1;
}
if (!f)
{
char buf[20];
TCHAR b2[255];
- void * res=NULL;
+ void * res = NULL;
mir_snprintf(buf,SIZEOF(buf),"%d",(i-1));
mir_sntprintf(b2,SIZEOF(b2),_T("#%s"),szName);
- b2[0]=1|GROUPF_EXPANDED;
+ b2[0] = 1|GROUPF_EXPANDED;
db_set_ws(NULL,"CListGroups",buf,b2);
pcli->pfnGetGroupName(i,&groupFlags);
- res=cli_AddGroup(hwnd,dat,szName,groupFlags,i,0);
+ res = cli_AddGroup(hwnd,dat,szName,groupFlags,i,0);
return res;
}
return NULL;
@@ -290,8 +290,8 @@ void cli_AddContactToTree(HWND hwnd,struct ClcData *dat,HANDLE hContact,int upda {
struct ClcGroup *group;
struct ClcContact * cont;
- pdisplayNameCacheEntry cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
- if(dat->IsMetaContactsEnabled && cacheEntry && cacheEntry->m_cache_nHiddenSubcontact) return; //contact should not be added
+ 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;
corecli.pfnAddContactToTree(hwnd,dat,hContact,updateTotalCount,checkHideOffline);
if (FindItem(hwnd,dat,hContact,&cont,&group,NULL,FALSE))
@@ -306,20 +306,20 @@ void cli_DeleteItemFromTree(HWND hwnd,HANDLE hItem) corecli.pfnDeleteItemFromTree(hwnd, hItem);
//check here contacts are not resorting
- if (hwnd==pcli->hwndContactTree)
+ if (hwnd == pcli->hwndContactTree)
pcli->pfnFreeCacheItem(pcli->pfnGetCacheEntry(hItem));
- dat->NeedResort=1;
+ dat->NeedResort = 1;
ClearRowByIndexCache();
}
__inline BOOL CLCItems_IsShowOfflineGroup(struct ClcGroup* group)
{
- DWORD groupFlags=0;
+ DWORD groupFlags = 0;
if (!group) return FALSE;
if (group->hideOffline) return FALSE;
pcli->pfnGetGroupName(group->groupId,&groupFlags);
- return (groupFlags&GROUPF_SHOWOFFLINE)!=0;
+ return (groupFlags&GROUPF_SHOWOFFLINE) != 0;
}
HANDLE SaveSelection( struct ClcData *dat )
@@ -351,8 +351,8 @@ int RestoreSelection( struct ClcData *dat, HANDLE hSelected ) {
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, List_IndexOf((SortedList*)&selgroup->cl, selcontact->subcontacts ));
- if (dat->selection != -1 )
- dat->selection += selcontact->isSubcontact;
+ if (dat->selection !=-1 )
+ dat->selection += selcontact->isSubcontact;
}
return dat->selection;
@@ -360,13 +360,13 @@ int RestoreSelection( struct ClcData *dat, HANDLE hSelected ) void cliRebuildEntireList(HWND hwnd,struct ClcData *dat)
{
- DWORD style=GetWindowLongPtr(hwnd,GWL_STYLE);
+ DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
HANDLE hContact;
struct ClcContact * cont;
struct ClcGroup *group;
- static int rebuildCounter=0;
+ static int rebuildCounter = 0;
- BOOL PlaceOfflineToRoot=db_get_b(NULL,"CList","PlaceOfflineToRoot",SETTING_PLACEOFFLINETOROOT_DEFAULT);
+ BOOL PlaceOfflineToRoot = db_get_b(NULL,"CList","PlaceOfflineToRoot",SETTING_PLACEOFFLINETOROOT_DEFAULT);
KillTimer(hwnd,TIMERID_REBUILDAFTER);
ClearRowByIndexCache();
@@ -375,89 +375,89 @@ void cliRebuildEntireList(HWND hwnd,struct ClcData *dat) RowHeights_GetMaxRowHeight(dat, hwnd);
TRACEVAR("Rebuild Entire List %d times\n",++rebuildCounter);
- dat->list.expanded=1;
- dat->list.hideOffline=db_get_b(NULL,"CLC","HideOfflineRoot",SETTING_HIDEOFFLINEATROOT_DEFAULT) && style&CLS_USEGROUPS;
+ dat->list.expanded = 1;
+ dat->list.hideOffline = db_get_b(NULL,"CLC","HideOfflineRoot",SETTING_HIDEOFFLINEATROOT_DEFAULT) && style&CLS_USEGROUPS;
dat->list.cl.count = dat->list.cl.limit = 0;
dat->list.cl.increment = 50;
- dat->NeedResort=1;
+ dat->NeedResort = 1;
HANDLE hSelected = SaveSelection( dat );
- dat->selection=-1;
- dat->HiLightMode=db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT);
+ dat->selection = -1;
+ dat->HiLightMode = db_get_b(NULL,"CLC","HiLightMode",SETTING_HILIGHTMODE_DEFAULT);
{
int i;
TCHAR *szGroupName;
DWORD groupFlags;
- for(i=1;;i++) {
- szGroupName=pcli->pfnGetGroupName(i,&groupFlags); //UNICODE
- if(szGroupName==NULL) break;
+ for(i = 1;;i++) {
+ szGroupName = pcli->pfnGetGroupName(i,&groupFlags); //UNICODE
+ if (szGroupName == NULL) break;
cli_AddGroup(hwnd,dat,szGroupName,groupFlags,i,0);
}
}
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
while(hContact)
{
- pdisplayNameCacheEntry cacheEntry=NULL;
+ pdisplayNameCacheEntry cacheEntry = NULL;
int nHiddenStatus;
- cont=NULL;
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ cont = NULL;
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
- nHiddenStatus=CLVM_GetContactHiddenStatus(hContact, NULL, dat);
- if ( (style&CLS_SHOWHIDDEN && nHiddenStatus!=-1) || !nHiddenStatus)
+ nHiddenStatus = CLVM_GetContactHiddenStatus(hContact, NULL, dat);
+ if ( (style&CLS_SHOWHIDDEN && nHiddenStatus != -1) || !nHiddenStatus)
{
- if(lstrlen(cacheEntry->m_cache_tcsGroup)==0)
- group=&dat->list;
+ if (lstrlen(cacheEntry->m_cache_tcsGroup) == 0)
+ group = &dat->list;
else {
- group=cli_AddGroup(hwnd,dat,cacheEntry->m_cache_tcsGroup,(DWORD)-1,0,0);
+ group = cli_AddGroup(hwnd,dat,cacheEntry->m_cache_tcsGroup,(DWORD)-1,0,0);
}
- if(group!=NULL)
+ if (group != NULL)
{
- WORD wStatus=pdnce___GetStatus( cacheEntry );
- if (wStatus==ID_STATUS_OFFLINE)
+ WORD wStatus = pdnce___GetStatus( cacheEntry );
+ if (wStatus == ID_STATUS_OFFLINE)
if (PlaceOfflineToRoot)
- group=&dat->list;
+ group = &dat->list;
group->totalMembers++;
if (!(style&CLS_NOHIDEOFFLINE) && (style&CLS_HIDEOFFLINE || group->hideOffline))
{
- if(cacheEntry->m_cache_cszProto==NULL) {
+ if (cacheEntry->m_cache_cszProto == NULL) {
if (!pcli->pfnIsHiddenMode(dat,ID_STATUS_OFFLINE)||cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
- cont=AddContactToGroup(dat,group,cacheEntry);
+ cont = AddContactToGroup(dat,group,cacheEntry);
}
else
if (!pcli->pfnIsHiddenMode(dat,wStatus)||cacheEntry->m_cache_nNoHiddenOffline || CLCItems_IsShowOfflineGroup(group))
- cont=AddContactToGroup(dat,group,cacheEntry);
+ cont = AddContactToGroup(dat,group,cacheEntry);
}
- else cont=AddContactToGroup(dat,group,cacheEntry);
+ else cont = AddContactToGroup(dat,group,cacheEntry);
}
}
if (cont)
{
- cont->SubAllocated=0;
- if (cont->proto && g_szMetaModuleName && dat->IsMetaContactsEnabled && strcmp(cont->proto,g_szMetaModuleName)==0)
+ cont->SubAllocated = 0;
+ if (cont->proto && g_szMetaModuleName && dat->IsMetaContactsEnabled && strcmp(cont->proto,g_szMetaModuleName) == 0)
AddSubcontacts(dat,cont,CLCItems_IsShowOfflineGroup(group));
}
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0);
}
- if(style&CLS_HIDEEMPTYGROUPS) {
- group=&dat->list;
- group->scanIndex=0;
+ if (style&CLS_HIDEEMPTYGROUPS) {
+ group = &dat->list;
+ group->scanIndex = 0;
for (;;) {
- if(group->scanIndex==group->cl.count) {
- group=group->parent;
- if(group==NULL) break;
+ if (group->scanIndex == group->cl.count) {
+ group = group->parent;
+ if (group == NULL) break;
}
- else if(group->cl.items[group->scanIndex]->type==CLCIT_GROUP) {
- if(group->cl.items[group->scanIndex]->group->cl.count==0) {
- group=pcli->pfnRemoveItemFromGroup(hwnd,group,group->cl.items[group->scanIndex],0);
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
+ if (group->cl.items[group->scanIndex]->group->cl.count == 0) {
+ group = pcli->pfnRemoveItemFromGroup(hwnd,group,group->cl.items[group->scanIndex],0);
}
else {
- group=group->cl.items[group->scanIndex]->group;
- group->scanIndex=0;
+ group = group->cl.items[group->scanIndex]->group;
+ group->scanIndex = 0;
}
continue;
}
@@ -482,27 +482,27 @@ void cli_SortCLC( HWND hwnd, struct ClcData *dat, int useInsertionSort ) int GetNewSelection(struct ClcGroup *group, int selection, int direction)
{
- int lastcount=0, count=0;//group->cl.count;
- if (selection<0) {
+ int lastcount = 0, count = 0;//group->cl.count;
+ if (selection < 0) {
return 0;
}
- group->scanIndex=0;
+ group->scanIndex = 0;
for (;;) {
- if(group->scanIndex==group->cl.count) {
- group=group->parent;
- if(group==NULL) break;
+ if (group->scanIndex == group->cl.count) {
+ group = group->parent;
+ if (group == NULL) break;
group->scanIndex++;
continue;
}
- if (count>=selection) return count;
+ if (count >= selection) return count;
lastcount = count;
count++;
if (!direction) {
if (count>selection) return lastcount;
}
- if(group->cl.items[group->scanIndex]->type==CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
- group=group->cl.items[group->scanIndex]->group;
- group->scanIndex=0;
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (group->cl.items[group->scanIndex]->group->expanded)) {
+ group = group->cl.items[group->scanIndex]->group;
+ group->scanIndex = 0;
continue;
}
group->scanIndex++;
@@ -526,16 +526,16 @@ struct SavedInfoState_t { struct ClcContact contact;
};
-BOOL LOCK_RECALC_SCROLLBAR=FALSE;
+BOOL LOCK_RECALC_SCROLLBAR = FALSE;
void cli_SaveStateAndRebuildList(HWND hwnd, struct ClcData *dat)
{
- LOCK_RECALC_SCROLLBAR=TRUE;
+ LOCK_RECALC_SCROLLBAR = TRUE;
NMCLISTCONTROL nm;
int i, j;
- OBJLIST<SavedGroupState_t> savedGroup( 4 );
- OBJLIST<SavedContactState_t> savedContact( 4 );
- OBJLIST<SavedInfoState_t> savedInfo( 4 );
+ OBJLIST < SavedGroupState_t> savedGroup( 4 );
+ OBJLIST < SavedContactState_t> savedContact( 4 );
+ OBJLIST < SavedInfoState_t> savedInfo( 4 );
struct ClcGroup *group;
struct ClcContact *contact;
@@ -642,7 +642,7 @@ void cli_SaveStateAndRebuildList(HWND hwnd, struct ClcData *dat) }
savedInfo.destroy();
- LOCK_RECALC_SCROLLBAR=FALSE;
+ LOCK_RECALC_SCROLLBAR = FALSE;
pcli->pfnRecalculateGroupCheckboxes(hwnd, dat);
pcli->pfnRecalcScrollBar(hwnd, dat);
@@ -671,11 +671,11 @@ WORD pdnce___GetStatus(pdisplayNameCacheEntry pdnce) void pdnce___SetStatus( pdisplayNameCacheEntry pdnce, WORD wStatus )
{
- if (pdnce) pdnce->m_cache_nStatus=wStatus;
+ if (pdnce) pdnce->m_cache_nStatus = wStatus;
}
struct ClcContact* cliCreateClcContact( void )
{
- struct ClcContact* contact=(struct ClcContact*)mir_calloc(sizeof( struct ClcContact ));
+ struct ClcContact* contact = (struct ClcContact*)mir_calloc(sizeof( struct ClcContact ));
memset((void*)contact->iWideExtraImage,0xFF,sizeof(contact->iWideExtraImage));
return contact;
}
@@ -688,10 +688,10 @@ ClcCacheEntryBase* cliCreateCacheItem( HANDLE hContact ) memset(p,0,sizeof( displayNameCacheEntry ));
p->m_cache_hContact = hContact;
InvalidateDNCEbyPointer(hContact,p,0);
- p->szSecondLineText=NULL;
- p->szThirdLineText=NULL;
- p->ssSecondLine.plText=NULL;
- p->ssThirdLine.plText=NULL;
+ p->szSecondLineText = NULL;
+ p->szThirdLineText = NULL;
+ p->ssSecondLine.plText = NULL;
+ p->ssThirdLine.plText = NULL;
}
return (ClcCacheEntryBase*)p;
}
@@ -710,7 +710,7 @@ char* cli_GetGroupCountsText(struct ClcData *dat, struct ClcContact *contact) {
char * res;
- res=corecli.pfnGetGroupCountsText(dat, contact);
+ res = corecli.pfnGetGroupCountsText(dat, contact);
return res;
}
@@ -730,14 +730,14 @@ int cliGetGroupContentsCount(struct ClcGroup *group, int visibleOnly) else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (!(visibleOnly&0x01) || group->cl.items[group->scanIndex]->group->expanded)) {
group = group->cl.items[group->scanIndex]->group;
group->scanIndex = 0;
- count += group->cl.count;
+ count += group->cl.count;
continue;
}
else if ((group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) &&
(group->cl.items[group->scanIndex]->subcontacts !=NULL) &&
((group->cl.items[group->scanIndex]->SubExpanded || (!visibleOnly))))
{
- count+=group->cl.items[group->scanIndex]->SubAllocated;
+ count += group->cl.items[group->scanIndex]->SubAllocated;
}
group->scanIndex++;
}
@@ -758,23 +758,23 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc char szTemp[64];
TCHAR szGroupMask[256];
DWORD dwLocalMask;
- PDNCE pdnce=(PDNCE)pcli->pfnGetCacheEntry(hContact);
- BOOL fEmbedded=dat->force_in_dialog;
+ PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry(hContact);
+ BOOL fEmbedded = dat->force_in_dialog;
// always hide subcontacts (but show them on embedded contact lists)
- if(g_CluiData.bMetaAvail && dat != NULL && dat->IsMetaContactsEnabled && g_szMetaModuleName && db_get_b(hContact, g_szMetaModuleName, "IsSubcontact", 0))
+ if (g_CluiData.bMetaAvail && dat !=NULL && dat->IsMetaContactsEnabled && g_szMetaModuleName && db_get_b(hContact, g_szMetaModuleName, "IsSubcontact", 0))
return -1; //subcontact
if (pdnce && pdnce->isUnknown && !fEmbedded)
return 1; //'Unknown Contact'
- if(pdnce && g_CluiData.bFilterEffective && !fEmbedded)
+ if (pdnce && g_CluiData.bFilterEffective && !fEmbedded)
{
- if(szProto == NULL)
+ if (szProto == NULL)
szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
- if(g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS)
+ if (g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS)
{
- if ((dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) != 0) {
- if(g_CluiData.bFilterEffective & CLVM_FILTER_STICKYSTATUS)
+ if ((dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) !=0) {
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_STICKYSTATUS)
{
WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
@@ -783,36 +783,36 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc }
}
// check the proto, use it as a base filter result for all further checks
- if(g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) {
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS) {
mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", szProto);
filterResult = strstr(g_CluiData.protoFilter, szTemp) ? 1 : 0;
}
- if(g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_GROUPS) {
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);
}
- else if(g_CluiData.filterFlags & CLVM_INCLUDED_UNGROUPED)
+ else if (g_CluiData.filterFlags & CLVM_INCLUDED_UNGROUPED)
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 1;
else
filterResult = (g_CluiData.filterFlags & CLVM_PROTOGROUP_OP) ? filterResult : filterResult & 0;
}
- if(g_CluiData.bFilterEffective & CLVM_FILTER_STATUS) {
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_STATUS) {
WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
filterResult = (g_CluiData.filterFlags & CLVM_GROUPSTATUS_OP) ? ((filterResult | ((1 << (wStatus - ID_STATUS_OFFLINE)) & g_CluiData.statusMaskFilter ? 1 : 0))) : (filterResult & ((1 << (wStatus - ID_STATUS_OFFLINE)) & g_CluiData.statusMaskFilter ? 1 : 0));
}
- if(g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG)
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG)
{
DWORD now;
- PDNCE pdnce=(PDNCE)pcli->pfnGetCacheEntry(hContact);
+ PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry(hContact);
if (pdnce)
{
now = g_CluiData.t_now;
- now -= g_CluiData.lastMsgFilter;
- if(g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG_OLDERTHAN)
+ now -= g_CluiData.lastMsgFilter;
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG_OLDERTHAN)
filterResult = filterResult & (pdnce->dwLastMsgTime < now);
- else if(g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG_NEWERTHAN)
+ else if (g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG_NEWERTHAN)
filterResult = filterResult & (pdnce->dwLastMsgTime > now);
}
}
diff --git a/plugins/Clist_modern/modern_clcmsgs.cpp b/plugins/Clist_modern/modern_clcmsgs.cpp index 391c5b9f8a..23892a4795 100644 --- a/plugins/Clist_modern/modern_clcmsgs.cpp +++ b/plugins/Clist_modern/modern_clcmsgs.cpp @@ -48,67 +48,67 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA else
{
clcSetDelayTimer( TIMERID_REBUILDAFTER, hwnd );
- CLM_AUTOREBUILD_WAS_POSTED=FALSE;
+ CLM_AUTOREBUILD_WAS_POSTED = FALSE;
}
return 0;
case CLM_SETEXTRACOLUMNSSPACE:
- dat->extraColumnSpacing=(int)wParam;
+ dat->extraColumnSpacing = (int)wParam;
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
return 0;
case CLM_SETFONT:
- if(HIWORD(lParam)<0 || HIWORD(lParam)>FONTID_MODERN_MAX) return 0;
+ if (HIWORD(lParam) < 0 || HIWORD(lParam)>FONTID_MODERN_MAX) return 0;
- dat->fontModernInfo[HIWORD(lParam)].hFont=(HFONT)wParam;
- dat->fontModernInfo[HIWORD(lParam)].changed=1;
+ dat->fontModernInfo[HIWORD(lParam)].hFont = (HFONT)wParam;
+ dat->fontModernInfo[HIWORD(lParam)].changed = 1;
RowHeights_GetMaxRowHeight(dat, hwnd);
- if(LOWORD(lParam))
+ if (LOWORD(lParam))
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
return 0;
case CLM_SETHIDEEMPTYGROUPS:
{
- BOOL old=((GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_HIDEEMPTYGROUPS)!=0);
- BOOL newval=old;
- if(wParam) SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)|CLS_HIDEEMPTYGROUPS);
+ BOOL old = ((GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_HIDEEMPTYGROUPS) != 0);
+ BOOL newval = old;
+ if (wParam) SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)|CLS_HIDEEMPTYGROUPS);
else SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)&~CLS_HIDEEMPTYGROUPS);
- newval=((GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_HIDEEMPTYGROUPS)!=0);
- if (newval!=old)
+ newval = ((GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_HIDEEMPTYGROUPS) != 0);
+ if (newval != old)
SendMessage(hwnd,CLM_AUTOREBUILD,0,0);
}
return 0;
case CLM_SETTEXTCOLOR:
- if(wParam<0 || wParam>FONTID_MODERN_MAX) break;
+ if (wParam < 0 || wParam>FONTID_MODERN_MAX) break;
- dat->fontModernInfo[wParam].colour=lParam;
- dat->force_in_dialog=TRUE;
+ dat->fontModernInfo[wParam].colour = lParam;
+ dat->force_in_dialog = TRUE;
// Issue 40: option knows nothing about moderns colors
// others who know have to set colors from lowest to highest
switch ( wParam )
{
case FONTID_CONTACTS:
- dat->fontModernInfo[FONTID_SECONDLINE].colour=lParam;
- dat->fontModernInfo[FONTID_THIRDLINE].colour=lParam;
- dat->fontModernInfo[FONTID_AWAY].colour=lParam;
- dat->fontModernInfo[FONTID_DND].colour=lParam;
- dat->fontModernInfo[FONTID_NA].colour=lParam;
- dat->fontModernInfo[FONTID_OCCUPIED].colour=lParam;
- dat->fontModernInfo[FONTID_CHAT].colour=lParam;
- dat->fontModernInfo[FONTID_INVISIBLE].colour=lParam;
- dat->fontModernInfo[FONTID_PHONE].colour=lParam;
- dat->fontModernInfo[FONTID_LUNCH].colour=lParam;
- dat->fontModernInfo[FONTID_CONTACT_TIME].colour=lParam;
+ dat->fontModernInfo[FONTID_SECONDLINE].colour = lParam;
+ dat->fontModernInfo[FONTID_THIRDLINE].colour = lParam;
+ dat->fontModernInfo[FONTID_AWAY].colour = lParam;
+ dat->fontModernInfo[FONTID_DND].colour = lParam;
+ dat->fontModernInfo[FONTID_NA].colour = lParam;
+ dat->fontModernInfo[FONTID_OCCUPIED].colour = lParam;
+ dat->fontModernInfo[FONTID_CHAT].colour = lParam;
+ dat->fontModernInfo[FONTID_INVISIBLE].colour = lParam;
+ dat->fontModernInfo[FONTID_PHONE].colour = lParam;
+ dat->fontModernInfo[FONTID_LUNCH].colour = lParam;
+ dat->fontModernInfo[FONTID_CONTACT_TIME].colour = lParam;
break;
case FONTID_OPENGROUPS:
- dat->fontModernInfo[FONTID_CLOSEDGROUPS].colour=lParam;
+ dat->fontModernInfo[FONTID_CLOSEDGROUPS].colour = lParam;
break;
case FONTID_OPENGROUPCOUNTS:
- dat->fontModernInfo[FONTID_CLOSEDGROUPCOUNTS].colour=lParam;
+ dat->fontModernInfo[FONTID_CLOSEDGROUPCOUNTS].colour = lParam;
break;
}
return 0;
@@ -119,11 +119,11 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA struct ClcGroup *group;
int i;
- if (wParam != CLGN_ROOT) {
+ if (wParam !=CLGN_ROOT) {
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;
+ if (i < 0) return 0;
}
switch (wParam)
{
@@ -133,7 +133,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA else
return (LRESULT) (HANDLE) NULL;
case CLGN_CHILD:
- if (contact->type != CLCIT_GROUP)
+ if (contact->type !=CLCIT_GROUP)
return (LRESULT) (HANDLE) NULL;
group = contact->group;
if (group->cl.count == 0)
@@ -143,7 +143,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA return group->groupId | HCONTACT_ISGROUP;
case CLGN_NEXT:
do {
- if (++i >= group->cl.count)
+ if (++i >= group->cl.count)
return NULL;
}
while (group->cl.items[i]->type == CLCIT_DIVIDER);
@@ -159,13 +159,13 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA for (i++; i < group->cl.count; i++)
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
- if (i >= group->cl.count)
+ if (i >= group->cl.count)
return (LRESULT) (HANDLE) NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUSCONTACT:
- if (i >= group->cl.count)
+ if (i >= group->cl.count)
return (LRESULT) (HANDLE) NULL;
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--)
if (group->cl.items[i]->type == CLCIT_CONTACT)
break;
if (i < 0)
@@ -175,13 +175,13 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA for (i++; i < group->cl.count; i++)
if (group->cl.items[i]->type == CLCIT_GROUP)
break;
- if (i >= group->cl.count)
+ if (i >= group->cl.count)
return (LRESULT) (HANDLE) NULL;
return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUSGROUP:
- if (i >= group->cl.count)
+ if (i >= group->cl.count)
return (LRESULT) (HANDLE) NULL;
- for (i--; i >= 0; i--)
+ for (i--; i >= 0; i--)
if (group->cl.items[i]->type == CLCIT_GROUP)
break;
if (i < 0)
@@ -195,8 +195,8 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA {
struct ClcContact *contact;
struct ClcGroup *group, *tgroup;
- int index=-1;
- int mainindex=-1;
+ int index = -1;
+ int mainindex = -1;
if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, &group, NULL))
break;
for (tgroup = group; tgroup; tgroup = tgroup->parent)
@@ -204,26 +204,26 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA if (!contact->isSubcontact)
{
- index=List_IndexOf((SortedList*)&group->cl,contact);
- mainindex=index;
+ index = List_IndexOf((SortedList*)&group->cl,contact);
+ mainindex = index;
}
else
{
- index=List_IndexOf((SortedList*)&group->cl,contact->subcontacts);
- mainindex=index;
- index+=contact->isSubcontact;
+ index = List_IndexOf((SortedList*)&group->cl,contact->subcontacts);
+ mainindex = index;
+ index += contact->isSubcontact;
}
{
- BYTE k=db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
+ BYTE k = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
if (k)
{
- int subcontactscount=0;
+ int subcontactscount = 0;
int i;
- for ( i=0; i<mainindex; i++)
+ for ( i = 0; i < mainindex; i++)
{
- struct ClcContact *tempCont=group->cl.items[i];
- if (tempCont->type==CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded)
- index+=tempCont->SubAllocated;
+ struct ClcContact *tempCont = group->cl.items[i];
+ if (tempCont->type == CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded)
+ index += tempCont->SubAllocated;
}
}
}
@@ -235,7 +235,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA case CLM_SETEXTRAIMAGE:
{
struct ClcContact *contact;
- if (LOWORD(lParam) >= dat->extraColumnsCount)
+ if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0;
if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
return 0;
@@ -248,7 +248,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA case CLM_SETWIDEEXTRAIMAGE:
{
struct ClcContact *contact;
- if (LOWORD(lParam) >= dat->extraColumnsCount)
+ if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0;
if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
return 0;
@@ -269,7 +269,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,struct ClcData *dat,UINT msg,WPARA case CLM_GETWIDEEXTRAIMAGE:
{
struct ClcContact *contact;
- if (LOWORD(lParam) >= dat->extraColumnsCount)
+ if (LOWORD(lParam) >= dat->extraColumnsCount)
return 0xFFFF;
if (!pcli->pfnFindItem(hwnd, dat, (HANDLE) wParam, &contact, NULL, NULL))
return 0xFFFF;
diff --git a/plugins/Clist_modern/modern_clcopts.cpp b/plugins/Clist_modern/modern_clcopts.cpp index a950c4a018..42f6092e04 100644 --- a/plugins/Clist_modern/modern_clcopts.cpp +++ b/plugins/Clist_modern/modern_clcopts.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_defsettings.h"
#include "hdr/modern_effectenum.h"
#include "hdr/modern_sync.h"
-#include <m_modernopt.h>
+#include < m_modernopt.h>
#include "m_fontservice.h"
#define FONTF_NORMAL 0
@@ -146,7 +146,7 @@ void RegisterCLUIFonts( void ) for ( i = 0; i < SIZEOF(fontOptionsList); i++, index++ )
{
- fontid.flags = FIDF_DEFAULTVALID | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_ALLOWREREGISTER | FIDF_NOAS;
+ fontid.flags = FIDF_DEFAULTVALID | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_ALLOWREREGISTER | FIDF_NOAS;
fontid.flags |= fontOptionsList[i].dwFlags;
_tcsncpy(fontid.group, fontOptionsList[i].szGroup, SIZEOF(fontid.group));
@@ -185,7 +185,7 @@ void RegisterCLUIFonts( void ) _tcsncpy(colourid.name, colourOptionsList[i].szDescr, SIZEOF(colourid.group));
strncpy(colourid.setting, colourOptionsList[i].chName, SIZEOF(colourid.setting));
strncpy(colourid.dbSettingsGroup, colourOptionsList[i].chGroup, SIZEOF(colourid.dbSettingsGroup));
- colourid.defcolour = colourOptionsList[i].defColour;
+ colourid.defcolour = colourOptionsList[i].defColour;
colourid.order = i + 1;
ColourRegisterT(&colourid);
}
@@ -201,17 +201,17 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w DWORD GetDefaultExStyle(void)
{
BOOL param;
- DWORD ret=CLCDEFAULT_EXSTYLE;
- if(SystemParametersInfo(SPI_GETLISTBOXSMOOTHSCROLLING,0,¶m,FALSE) && !param)
- ret|=CLS_EX_NOSMOOTHSCROLLING;
- if(SystemParametersInfo(SPI_GETHOTTRACKING,0,¶m,FALSE) && !param)
- ret&=~CLS_EX_TRACKSELECT;
+ DWORD ret = CLCDEFAULT_EXSTYLE;
+ if (SystemParametersInfo(SPI_GETLISTBOXSMOOTHSCROLLING,0,¶m,FALSE) && !param)
+ ret |= CLS_EX_NOSMOOTHSCROLLING;
+ if (SystemParametersInfo(SPI_GETHOTTRACKING,0,¶m,FALSE) && !param)
+ ret &= ~CLS_EX_TRACKSELECT;
return ret;
}
void GetFontSetting(int i,LOGFONT *lf,COLORREF *colour,BYTE *effect, COLORREF *eColour1,COLORREF *eColour2)
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
char idstr[32];
int index = 0;
@@ -235,11 +235,11 @@ void GetFontSetting(int i,LOGFONT *lf,COLORREF *colour,BYTE *effect, COLORREF *e if (effect)
{
mir_snprintf(idstr,SIZEOF(idstr),"Font%dEffect",i);
- *effect=db_get_b(NULL,"CLC",idstr,0);
+ *effect = db_get_b(NULL,"CLC",idstr,0);
mir_snprintf(idstr,SIZEOF(idstr),"Font%dEffectCol1",i);
- *eColour1=db_get_dw(NULL,"CLC",idstr,0);
+ *eColour1 = db_get_dw(NULL,"CLC",idstr,0);
mir_snprintf(idstr,SIZEOF(idstr),"Font%dEffectCol2",i);
- *eColour2=db_get_dw(NULL,"CLC",idstr,0);
+ *eColour2 = db_get_dw(NULL,"CLC",idstr,0);
}
}
@@ -250,7 +250,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static UINT StatusBarExpertControls[]={IDC_STATUSBAR_PER_PROTO, IDC_STATUSBAR_PROTO_LIST, IDC_SBAR_USE_ACCOUNT_SETTINGS, IDC_SBAR_HIDE_ACCOUNT_COMPLETELY};
+static UINT StatusBarExpertControls[] = {IDC_STATUSBAR_PER_PROTO, IDC_STATUSBAR_PROTO_LIST, IDC_SBAR_USE_ACCOUNT_SETTINGS, IDC_SBAR_HIDE_ACCOUNT_COMPLETELY};
struct
{
@@ -261,7 +261,7 @@ struct int nExpertControls;
DWORD flag; // Expertonly
}
-static clist_opt_items[] =
+static clist_opt_items[] =
{
{ LPGEN("General"), IDD_OPT_CLIST, DlgProcClistOpts, NULL, 0, 0},
{ LPGEN("Tray"), IDD_OPT_TRAY, DlgProcTrayOpts, NULL, 0, 0 },
@@ -285,7 +285,7 @@ int ClcOptInit(WPARAM wParam,LPARAM lParam) odp.pfnDlgProc = DlgProcClistListOpts;
odp.flags = ODPF_BOLDGROUPS;
- for (int i=0; i < SIZEOF(clist_opt_items); i++) {
+ for (int i = 0; i < SIZEOF(clist_opt_items); i++) {
odp.pszTemplate = MAKEINTRESOURCEA(clist_opt_items[i].id);
odp.pszTab = clist_opt_items[i].name;
odp.pfnDlgProc = clist_opt_items[i].wnd_proc;
@@ -314,7 +314,7 @@ struct CheckBoxToStyleEx_t DWORD flag;
int neg;
};
-static const struct CheckBoxToStyleEx_t checkBoxToStyleEx[]={
+static const struct CheckBoxToStyleEx_t checkBoxToStyleEx[] = {
{IDC_DISABLEDRAGDROP,CLS_EX_DISABLEDRAGDROP,0},
{IDC_NOTEDITLABELS,CLS_EX_EDITLABELS,1},
{IDC_SHOWSELALWAYS,CLS_EX_SHOWSELALWAYS,0},
@@ -333,7 +333,7 @@ struct CheckBoxValues_t { DWORD style;
TCHAR *szDescr;
};
-static const struct CheckBoxValues_t greyoutValues[]={
+static const struct CheckBoxValues_t greyoutValues[] = {
{GREYF_UNFOCUS,LPGENT("Not focused")},
{MODEF_OFFLINE,LPGENT("Offline")},
{PF2_ONLINE,LPGENT("Online")},
@@ -346,7 +346,7 @@ static const struct CheckBoxValues_t greyoutValues[]={ {PF2_OUTTOLUNCH,LPGENT("Out to lunch")},
{PF2_ONTHEPHONE,LPGENT("On the phone")}
};
-static const struct CheckBoxValues_t offlineValues[]=
+static const struct CheckBoxValues_t offlineValues[] =
{
{MODEF_OFFLINE,LPGENT("Offline")},
{PF2_ONLINE,LPGENT("Online")},
@@ -365,30 +365,30 @@ static void FillCheckBoxTree(HWND hwndTree,const struct CheckBoxValues_t *values TVINSERTSTRUCT tvis;
int i;
- tvis.hParent=NULL;
- tvis.hInsertAfter=TVI_LAST;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_STATE|TVIF_IMAGE;
- for(i=0;i<nValues;i++) {
- tvis.item.lParam=values[i].style;
- tvis.item.pszText=TranslateTS(values[i].szDescr);
- tvis.item.stateMask=TVIS_STATEIMAGEMASK;
- tvis.item.state=INDEXTOSTATEIMAGEMASK((style&tvis.item.lParam)!=0?2:1);
- tvis.item.iImage=tvis.item.iSelectedImage=(style&tvis.item.lParam)!=0?1:0;
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_STATE|TVIF_IMAGE;
+ for(i = 0;i < nValues;i++) {
+ tvis.item.lParam = values[i].style;
+ tvis.item.pszText = TranslateTS(values[i].szDescr);
+ tvis.item.stateMask = TVIS_STATEIMAGEMASK;
+ tvis.item.state = INDEXTOSTATEIMAGEMASK((style&tvis.item.lParam) != 0?2:1);
+ tvis.item.iImage = tvis.item.iSelectedImage = (style&tvis.item.lParam) != 0?1:0;
TreeView_InsertItem(hwndTree,&tvis);
}
}
static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
{
- DWORD flags=0;
+ DWORD flags = 0;
TVITEMA tvi;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_IMAGE;
- tvi.hItem=TreeView_GetRoot(hwndTree);
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_IMAGE;
+ tvi.hItem = TreeView_GetRoot(hwndTree);
while(tvi.hItem) {
TreeView_GetItem(hwndTree,&tvi);
- if(tvi.iImage) flags|=tvi.lParam;
- tvi.hItem=TreeView_GetNextSibling(hwndTree,tvi.hItem);
+ if (tvi.iImage) flags |= tvi.lParam;
+ tvi.hItem = TreeView_GetNextSibling(hwndTree,tvi.hItem);
}
return flags;
}
@@ -396,7 +396,7 @@ static DWORD MakeCheckBoxTreeFlags(HWND hwndTree) static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
LPNMHDR t;
- t=((LPNMHDR)lParam);
+ t = ((LPNMHDR)lParam);
switch (msg)
{
case WM_INITDIALOG:
@@ -417,7 +417,7 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA {
BYTE t;
- t=IsDlgButtonChecked(hwndDlg,IDC_METAEXPAND);
+ t = IsDlgButtonChecked(hwndDlg,IDC_METAEXPAND);
EnableWindow(GetDlgItem(hwndDlg,IDC_METADBLCLK),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_METASUBEXTRA),t);
EnableWindow(GetDlgItem(hwndDlg,IDC_METASUB_HIDEOFFLINE),t);
@@ -426,7 +426,7 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA }
{
BYTE t;
- t=ServiceExists(MS_MC_GETMOSTONLINECONTACT);
+ t = ServiceExists(MS_MC_GETMOSTONLINECONTACT);
CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_META),t);
CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_METADBLCLK),t);
CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_METASUB_HIDEOFFLINE),t);
@@ -440,17 +440,17 @@ static INT_PTR CALLBACK DlgProcClistAdditionalOpts(HWND hwndDlg, UINT msg, WPARA }
return TRUE;
case WM_COMMAND:
- if(LOWORD(wParam)==IDC_METAEXPAND)
+ if (LOWORD(wParam) == IDC_METAEXPAND)
{
BYTE t;
- t=IsDlgButtonChecked(hwndDlg,IDC_METAEXPAND);
+ 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);
}
- if ((LOWORD(wParam)==IDC_SUBINDENT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ 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:
@@ -498,19 +498,19 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),GWL_STYLE,GetWindowLongPtr(GetDlgItem(hwndDlg,IDC_HIDEOFFLINEOPTS),GWL_STYLE)|TVS_NOHSCROLL);
{
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_NOTICK)));
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++)
+ 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}};
+ UDACCEL accel[2] = {{0,10},{2,50}};
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETRANGE,0,MAKELONG(999,0));
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETACCEL,SIZEOF(accel),(LPARAM)&accel);
SendDlgItemMessage(hwndDlg,IDC_SMOOTHTIMESPIN,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"CLC","ScrollTime",CLCDEFAULT_SCROLLTIME),0));
@@ -531,30 +531,30 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
case WM_COMMAND:
- if(LOWORD(wParam)==IDC_NOTNOSMOOTHSCROLLING)
+ if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING)
EnableWindow(GetDlgItem(hwndDlg,IDC_SMOOTHTIME),IsDlgButtonChecked(hwndDlg,IDC_NOTNOSMOOTHSCROLLING));
- if(LOWORD(wParam)==IDC_GREYOUT)
+ if (LOWORD(wParam) == IDC_GREYOUT)
EnableWindow(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS),IsDlgButtonChecked(hwndDlg,IDC_GREYOUT));
- if ((/*LOWORD(wParam)==IDC_LEFTMARGIN ||*/ LOWORD(wParam)==IDC_SMOOTHTIME || LOWORD(wParam)==IDC_GROUPINDENT) && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ 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) {
+ if (((LPNMHDR)lParam)->code == NM_CLICK) {
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
+ 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) {
+ 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;
+ 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;
+ 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);
}
@@ -565,15 +565,15 @@ static INT_PTR CALLBACK DlgProcClistListOpts(HWND hwndDlg, UINT msg, WPARAM wPar {
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;
+ 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));
+ { DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg,IDC_GREYOUTOPTS));
db_set_dw(NULL,"CLC","FullGreyoutFlags",fullGreyoutFlags);
- if(IsDlgButtonChecked(hwndDlg,IDC_GREYOUT))
+ if (IsDlgButtonChecked(hwndDlg,IDC_GREYOUT))
db_set_dw(NULL,"CLC","GreyoutFlags",fullGreyoutFlags);
else
db_set_dw(NULL,"CLC","GreyoutFlags",0);
@@ -616,7 +616,7 @@ 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};
+ { DBVARIANT dbv = {0};
if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
SetDlgItemTextA(hwndDlg,IDC_FILENAME,dbv.pszVal);
if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
@@ -629,14 +629,14 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w }
}
- 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);
+ 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);
+ { 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);
@@ -647,8 +647,8 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w }
{ HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
- MySHAutoComplete=(HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandle(TEXT("shlwapi")),"SHAutoComplete");
- if(MySHAutoComplete) MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
+ MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandle(TEXT("shlwapi")),"SHAutoComplete");
+ if (MySHAutoComplete) MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
}
return TRUE;
case WM_USER+10:
@@ -663,9 +663,9 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w EnableWindow(GetDlgItem(hwndDlg,IDC_TILEVROWH),IsDlgButtonChecked(hwndDlg,IDC_BITMAP));
break;
case WM_COMMAND:
- if(LOWORD(wParam)==IDC_BROWSE) {
+ if (LOWORD(wParam) == IDC_BROWSE) {
char str[MAX_PATH];
- OPENFILENAMEA ofn={0};
+ OPENFILENAMEA ofn = {0};
char filter[512];
GetDlgItemTextA(hwndDlg,IDC_FILENAME,str,SIZEOF(str));
@@ -682,9 +682,9 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w if (!GetOpenFileNameA(&ofn)) break;
SetDlgItemTextA(hwndDlg,IDC_FILENAME,str);
}
- else if(LOWORD(wParam)==IDC_FILENAME && HIWORD(wParam)!=EN_CHANGE) break;
- if(LOWORD(wParam)==IDC_BITMAP) SendMessage(hwndDlg,WM_USER+10,0,0);
- if(LOWORD(wParam)==IDC_FILENAME && (HIWORD(wParam)!=EN_CHANGE || (HWND)lParam!=GetFocus())) return 0;
+ else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) break;
+ if (LOWORD(wParam) == IDC_BITMAP) SendMessage(hwndDlg,WM_USER+10,0,0);
+ if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) return 0;
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
case WM_NOTIFY:
@@ -698,11 +698,11 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w 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");
+ 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");
+ 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);
}
{
@@ -716,22 +716,22 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w 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;
+ { 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;
+ 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);
@@ -753,15 +753,15 @@ static int _GetNetVisibleProtoCount() int i,count,netProtoCount;
PROTOACCOUNT **accs;
ProtoEnumAccounts( &count, &accs );
- for(i=0,netProtoCount=0;i<count;i++)
+ 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 };
+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)
@@ -777,34 +777,34 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 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);
+ 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++)
+ for (i = 0; i < SIZEOF(sortby); i++)
{
- item=SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_ADDSTRING,0,(LPARAM)TranslateTS(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]));
+ 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]));
+ 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);
+ 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++)
+ for (i = 0; i < SIZEOF(sortby); i++)
{
- if (s1==sortbyValue[i])
+ if (s1 == sortbyValue[i])
SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_SETCURSEL,i,0);
- if (s2==sortbyValue[i])
+ if (s2 == sortbyValue[i])
SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_SETCURSEL,i,0);
- if (s3==sortbyValue[i])
+ if (s3 == sortbyValue[i])
SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_SETCURSEL,i,0);
}
@@ -831,18 +831,18 @@ static INT_PTR CALLBACK DlgProcClistOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 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;
+ 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];
+ 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);
@@ -876,7 +876,7 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L 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);
+ 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);
@@ -890,24 +890,24 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L 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_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)) {
+ 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)) {
+ 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)) {
+ if (IsDlgButtonChecked(hwndDlg,IDC_MULTITRAY)) {
EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIME),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),FALSE);
@@ -918,30 +918,30 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L {
int i,count,item;
PROTOACCOUNT **accs;
- DBVARIANT dbv={DBVT_DELETED};
+ DBVARIANT dbv = {DBVT_DELETED};
db_get(NULL,"CList","PrimaryStatus",&dbv);
ProtoEnumAccounts( &count, &accs );
- item=SendDlgItemMessage(hwndDlg,IDC_PRIMARYSTATUS,CB_ADDSTRING,0,(LPARAM)TranslateT("Global"));
+ 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)
+ 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);
+ 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))
+ 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))
+ 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)
+ int i = _GetNetVisibleProtoCount();
+ if (i < 2)
{
EnableWindow(GetDlgItem(hwndDlg,IDC_PRIMARYSTATUS),TRUE);
EnableWindow(GetDlgItem(hwndDlg,IDC_CYCLETIMESPIN),FALSE);
@@ -958,12 +958,12 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case WM_COMMAND:
{
- if (LOWORD(wParam)==IDC_SHOWXSTATUS||LOWORD(wParam)==IDC_SHOWNORMAL)
+ 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)
+ 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));
@@ -971,8 +971,8 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L 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
+ 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;
@@ -999,10 +999,10 @@ static INT_PTR CALLBACK DlgProcTrayOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L 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;
+ 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);
}
@@ -1037,7 +1037,7 @@ void ClcOptionsChanged(void) pcli->pfnClcBroadcast( INTM_INVALIDATE,0,0);
}
-HWND g_hCLUIOptionsWnd=NULL;
+HWND g_hCLUIOptionsWnd = NULL;
@@ -1063,9 +1063,9 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_SNAPTOEDGES, db_get_b(NULL,"CLUI","SnapToEdges",SETTING_SNAPTOEDGES_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_DOCKTOSIDES, db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EVENTAREA_NONE, db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT)==0 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EVENTAREA, db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT)==1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EVENTAREA_ALWAYS, db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT)==2 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EVENTAREA_NONE, db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 0 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EVENTAREA, db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EVENTAREA_ALWAYS, db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AUTOHIDE, db_get_b(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETRANGE,0,MAKELONG(900,1));
@@ -1075,9 +1075,9 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC01),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
{
int i, item;
- TCHAR *hidemode[]={TranslateT("Hide to tray"), TranslateT("Behind left edge"), TranslateT("Behind right edge")};
- for (i=0; i<SIZEOF(hidemode); i++) {
- item=SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_ADDSTRING,0,(LPARAM)(hidemode[i]));
+ TCHAR *hidemode[] = {TranslateT("Hide to tray"), TranslateT("Behind left edge"), TranslateT("Behind right edge")};
+ for (i = 0; i < SIZEOF(hidemode); i++) {
+ item = SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_ADDSTRING,0,(LPARAM)(hidemode[i]));
SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_SETITEMDATA,item,(LPARAM)0);
SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_SETCURSEL,db_get_b(NULL,"ModernData","HideBehind",SETTING_HIDEBEHIND_DEFAULT),0);
}
@@ -1089,19 +1089,19 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN4,UDM_SETRANGE,0,MAKELONG(50,1));
SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN4,UDM_SETPOS,0,MAKELONG(db_get_w(NULL,"ModernData","HideBehindBorderSize",SETTING_HIDEBEHINDBORDERSIZE_DEFAULT),0));
{
- int mode=SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_GETCURSEL,0,0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWDELAY),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN2),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN3),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN4),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY2),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC5),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC6),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC7),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC8),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC10),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC13),mode!=0);
+ int mode = SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_GETCURSEL,0,0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWDELAY),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN2),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN3),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN4),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY2),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC5),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC6),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC7),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC8),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC10),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC13),mode != 0);
}
if (!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
@@ -1115,18 +1115,18 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM }
return TRUE;
case WM_COMMAND:
- if(LOWORD(wParam)==IDC_AUTOHIDE) {
+ if (LOWORD(wParam) == IDC_AUTOHIDE) {
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC01),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
}
- else if(LOWORD(wParam)==IDC_DRAGTOSCROLL && IsDlgButtonChecked(hwndDlg,IDC_CLIENTDRAG)) {
+ else if (LOWORD(wParam) == IDC_DRAGTOSCROLL && IsDlgButtonChecked(hwndDlg,IDC_CLIENTDRAG)) {
CheckDlgButton(hwndDlg,IDC_CLIENTDRAG,FALSE);
}
- else if(LOWORD(wParam)==IDC_CLIENTDRAG && IsDlgButtonChecked(hwndDlg,IDC_DRAGTOSCROLL)) {
+ else if (LOWORD(wParam) == IDC_CLIENTDRAG && IsDlgButtonChecked(hwndDlg,IDC_DRAGTOSCROLL)) {
CheckDlgButton(hwndDlg,IDC_DRAGTOSCROLL,FALSE);
}
- else if(LOWORD(wParam)==IDC_AUTOSIZE) {
+ else if (LOWORD(wParam) == IDC_AUTOSIZE) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
@@ -1135,24 +1135,24 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_MINSIZESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
EnableWindow(GetDlgItem(hwndDlg,IDC_AUTOSIZEUPWARD),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
}
- else if (LOWORD(wParam)==IDC_HIDEMETHOD)
+ else if (LOWORD(wParam) == IDC_HIDEMETHOD)
{
- int mode=SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_GETCURSEL,0,0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWDELAY),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN2),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN3),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN4),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY2),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC5),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC6),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC7),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC8),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC10),mode!=0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC13),mode!=0);
+ int mode = SendDlgItemMessage(hwndDlg,IDC_HIDEMETHOD,CB_GETCURSEL,0,0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWDELAY),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN2),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN3),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN4),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDEDELAY2),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC5),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC6),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC7),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC8),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC10),mode != 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC13),mode != 0);
}
- 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()))
+ 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);
@@ -1166,7 +1166,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM //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))
+ //if (g_proc_UpdateLayeredWindow != NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE))
// DBWriteContactSettingByte(NULL,"ModernData","EnableLayering",0);
//else
// DBDeleteContactSetting(NULL,"ModernData","EnableLayering");
@@ -1177,7 +1177,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM db_set_b(NULL,"CLUI","DragToScroll",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DRAGTOSCROLL));
db_set_b(NULL,"CList","BringToFront",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BRINGTOFRONT));
- g_mutex_bChangingMode=TRUE;
+ g_mutex_bChangingMode = TRUE;
db_set_b(NULL,"CLUI","ClientAreaDrag",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CLIENTDRAG));
db_set_b(NULL,"CLUI","AutoSize",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
db_set_b(NULL,"CLUI","LockSize",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_LOCKSIZING));
@@ -1198,7 +1198,7 @@ static INT_PTR CALLBACK DlgProcClistBehaviourOpts(HWND hwndDlg, UINT msg, WPARAM CLUI_ReloadCLUIOptions();
EventArea_ConfigureEventArea();
cliShowHide(0,1);
- g_mutex_bChangingMode=FALSE;
+ g_mutex_bChangingMode = FALSE;
return TRUE;
}
break;
@@ -1208,16 +1208,16 @@ 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;
+ BOOL fEnabled = FALSE;
switch (msg)
{
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- g_hCLUIOptionsWnd=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 =======
- fEnabled=!g_CluiData.fLayered || g_CluiData.fDisableSkinEngine;
+ { // == == == Activate/Deactivate Non-Layered items == == == =
+ fEnabled = !g_CluiData.fLayered || g_CluiData.fDisableSkinEngine;
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_BORDER),fEnabled);
@@ -1226,16 +1226,16 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWMAINMENU),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),fEnabled);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AEROGLASS),!fEnabled && (g_proc_DWMEnableBlurBehindWindow != NULL));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_AEROGLASS),!fEnabled && (g_proc_DWMEnableBlurBehindWindow !=NULL));
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);
CheckDlgButton(hwndDlg, IDC_NOBORDERWND, db_get_b(NULL,"CList","NoBorder",SETTING_NOBORDER_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- if(IsDlgButtonChecked(hwndDlg,IDC_TOOLWND))
+ if (IsDlgButtonChecked(hwndDlg,IDC_TOOLWND))
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);
@@ -1255,7 +1255,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);
@@ -1275,18 +1275,18 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP CheckDlgButton(hwndDlg, IDC_DISABLEENGINE, db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AEROGLASS, db_get_b(NULL,"ModernData","AeroGlass",SETTING_AEROGLASS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg,IDC_LAYERENGINE),(g_proc_UpdateLayeredWindow!=NULL && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT))?TRUE:FALSE);
- CheckDlgButton(hwndDlg, IDC_LAYERENGINE, ((db_get_b(NULL,"ModernData","EnableLayering",SETTING_ENABLELAYERING_DEFAULT)&&g_proc_UpdateLayeredWindow!=NULL) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT)) ? BST_UNCHECKED:BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_LAYERENGINE),(g_proc_UpdateLayeredWindow != NULL && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT))?TRUE:FALSE);
+ CheckDlgButton(hwndDlg, IDC_LAYERENGINE, ((db_get_b(NULL,"ModernData","EnableLayering",SETTING_ENABLELAYERING_DEFAULT)&&g_proc_UpdateLayeredWindow != NULL) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT)) ? BST_UNCHECKED:BST_CHECKED);
{
- DBVARIANT dbv={0};
- TCHAR *s=NULL;
+ DBVARIANT dbv = {0};
+ TCHAR *s = NULL;
char szUin[20];
if (!DBGetContactSettingTString(NULL,"CList","TitleText",&dbv))
- s=mir_tstrdup(dbv.ptszVal);
+ s = mir_tstrdup(dbv.ptszVal);
else
- s=mir_tstrdup(_T(MIRANDANAME));
- //dbv.pszVal=s;
+ s = mir_tstrdup(_T(MIRANDANAME));
+ //dbv.pszVal = s;
SetDlgItemText(hwndDlg,IDC_TITLETEXT,s);
if (s) mir_free_and_nill(s);
db_free(&dbv);
@@ -1299,19 +1299,19 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
db_free(&dbv);
- dbv.pszVal=NULL;
+ dbv.pszVal = NULL;
}
if (!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
db_free(&dbv);
- dbv.pszVal=NULL;
+ dbv.pszVal = NULL;
}
if (!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
db_free(&dbv);
- dbv.pszVal=NULL;
+ dbv.pszVal = NULL;
}
}
if (!IsWinVer2000Plus()) {
@@ -1336,7 +1336,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP return TRUE;
case WM_COMMAND:
- if(LOWORD(wParam)==IDC_TRANSPARENT) {
+ if (LOWORD(wParam) == IDC_TRANSPARENT) {
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
@@ -1344,9 +1344,9 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg,IDC_ACTIVEPERC),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
EnableWindow(GetDlgItem(hwndDlg,IDC_INACTIVEPERC),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
}
- else if(LOWORD(wParam)==IDC_LAYERENGINE || LOWORD(wParam)==IDC_DISABLEENGINE)
- { // ====== Activate/Deactivate Non-Layered items =======
- fEnabled=!(IsWindowEnabled(GetDlgItem(hwndDlg,IDC_LAYERENGINE)) && !IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE) && !IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE));
+ else if (LOWORD(wParam) == IDC_LAYERENGINE || LOWORD(wParam) == IDC_DISABLEENGINE)
+ { // == == == 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)));
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),fEnabled&&(IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) && !(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER)));
@@ -1356,44 +1356,44 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg,IDC_NOBORDERWND),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWMAINMENU),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),fEnabled);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AEROGLASS),!fEnabled && (g_proc_DWMEnableBlurBehindWindow != NULL));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_AEROGLASS),!fEnabled && (g_proc_DWMEnableBlurBehindWindow !=NULL));
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLEBAR_STATIC),fEnabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_ROUNDCORNERS),fEnabled);
- if (LOWORD(wParam)==IDC_DISABLEENGINE)
+ if (LOWORD(wParam) == IDC_DISABLEENGINE)
{
- EnableWindow(GetDlgItem(hwndDlg,IDC_LAYERENGINE),!IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE) && g_proc_UpdateLayeredWindow!=NULL);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_LAYERENGINE),!IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE) && g_proc_UpdateLayeredWindow != NULL);
if (IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE))
CheckDlgButton(hwndDlg,IDC_LAYERENGINE,BST_CHECKED);
}
}
- else if(LOWORD(wParam)==IDC_ONDESKTOP && IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) {
+ else if (LOWORD(wParam) == IDC_ONDESKTOP && IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) {
CheckDlgButton(hwndDlg, IDC_ONTOP, BST_UNCHECKED);
}
- else if(LOWORD(wParam)==IDC_ONTOP && IsDlgButtonChecked(hwndDlg,IDC_ONTOP)) {
+ else if (LOWORD(wParam) == IDC_ONTOP && IsDlgButtonChecked(hwndDlg,IDC_ONTOP)) {
CheckDlgButton(hwndDlg, IDC_ONDESKTOP, BST_UNCHECKED);
}
- else if(LOWORD(wParam)==IDC_TOOLWND) {
+ else if (LOWORD(wParam) == IDC_TOOLWND) {
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),!IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
}
- else if(LOWORD(wParam)==IDC_SHOWCAPTION) {
+ else if (LOWORD(wParam) == IDC_SHOWCAPTION) {
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),!IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
}
- else if(LOWORD(wParam)==IDC_NOBORDERWND ||LOWORD(wParam)==IDC_BORDER)
+ else if (LOWORD(wParam) == IDC_NOBORDERWND ||LOWORD(wParam) == IDC_BORDER)
{
EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER)));
EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),(IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) && !(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER)));
EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),(IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))&&!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER)));
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWCAPTION),!(IsDlgButtonChecked(hwndDlg,IDC_NOBORDERWND)||IsDlgButtonChecked(hwndDlg,IDC_BORDER)));
- if (LOWORD(wParam)==IDC_BORDER) CheckDlgButton(hwndDlg, IDC_NOBORDERWND,BST_UNCHECKED);
+ if (LOWORD(wParam) == IDC_BORDER) CheckDlgButton(hwndDlg, IDC_NOBORDERWND,BST_UNCHECKED);
else CheckDlgButton(hwndDlg, IDC_BORDER,BST_UNCHECKED);
}
- 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()))
+ 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()))
return 0;
// Enable apply button
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
@@ -1406,7 +1406,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP sprintf(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0)/255);
SetDlgItemTextA(hwndDlg,IDC_ACTIVEPERC,str);
}
- if(wParam!=0x12345678) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ if (wParam != 0x12345678) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code)
@@ -1421,18 +1421,18 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP db_set_b(NULL,"ModernData","AeroGlass",IsDlgButtonChecked(hwndDlg,IDC_AEROGLASS));
if (!IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE))
{
- if (g_proc_UpdateLayeredWindow!=NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE))
+ 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);
+ 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 ======
+ { // == == == 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));
@@ -1447,17 +1447,17 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP 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;
+ } // == == == End of Non-Layered Mode == == ==
+ g_mutex_bChangingMode = TRUE;
if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP))
{
- HWND hProgMan=FindWindow(TEXT("Progman"),NULL);
+ HWND hProgMan = FindWindow(TEXT("Progman"),NULL);
if (IsWindow(hProgMan))
{
SetParent(pcli->hwndContactList,hProgMan);
Sync( CLUIFrames_SetParentForContainers, (HWND)hProgMan );
- g_CluiData.fOnDesktop=1;
+ g_CluiData.fOnDesktop = 1;
}
}
else
@@ -1467,16 +1467,16 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP SetParent(pcli->hwndContactList,NULL);
Sync( CLUIFrames_SetParentForContainers, (HWND)NULL );
}
- g_CluiData.fOnDesktop=0;
+ g_CluiData.fOnDesktop = 0;
}
AniAva_UpdateParent();
db_set_b(NULL,"CLUI","FadeInOut",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT));
- g_CluiData.fSmoothAnimation=IsWinVer2000Plus()&&(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT);
+ g_CluiData.fSmoothAnimation = IsWinVer2000Plus()&&(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT);
{
int i1;
int i2;
- i1=SendDlgItemMessage(hwndDlg,IDC_FRAMESSPIN,UDM_GETPOS,0,0);
- i2=SendDlgItemMessage(hwndDlg,IDC_CAPTIONSSPIN,UDM_GETPOS,0,0);
+ 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);
@@ -1493,7 +1493,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
cliShowHide(0,1);
- g_mutex_bChangingMode=FALSE;
+ g_mutex_bChangingMode = FALSE;
return TRUE;
}
break;
@@ -1559,7 +1559,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, HWND hList = GetDlgItem(hwndDlg, IDC_BKGRLIST);
TranslateDialogDefault(hwndDlg);
- dat=(struct BkgrData*)mir_alloc(sizeof(struct BkgrData));
+ 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);
@@ -1594,15 +1594,15 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 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);
+ MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandleA("shlwapi"),"SHAutoComplete");
+ if (MySHAutoComplete) MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
}
return TRUE;
}
case WM_DESTROY:
- if(dat)
+ if (dat)
{
- if(dat->item) mir_free(dat->item);
+ if (dat->item) mir_free(dat->item);
mir_free(dat);
}
@@ -1611,7 +1611,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, case M_BKGR_GETSTATE:
{
int indx = wParam;
- if(indx == CB_ERR || indx >= dat->count) break;
+ 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);
@@ -1622,13 +1622,13 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 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;
+ 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;
@@ -1637,9 +1637,9 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, {
int flags;
int indx = wParam;
- if (indx==-1) break;
+ if (indx == -1) break;
flags = dat->item[indx].flags;
- if(indx == CB_ERR || indx >= dat->count) break;
+ 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);
@@ -1666,10 +1666,10 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, WORD visibility;
int cy = 55;
char *sz = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
- sz += strlen(sz) + 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)
+ if (visibility & M_BKGR_BACKCOLOR)
{
SetWindowPos(GetDlgItem(hwndDlg, IDC_BC_STATIC), 0,
20, cy,
@@ -1679,9 +1679,9 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 130, cy,
0, 0,
SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE);
- cy += 25;
+ cy += 25;
}
- if(visibility & M_BKGR_SELECTCOLOR)
+ if (visibility & M_BKGR_SELECTCOLOR)
{
SetWindowPos(GetDlgItem(hwndDlg, IDC_SC_STATIC), 0,
20, cy,
@@ -1691,7 +1691,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 130, cy,
0, 0,
SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE);
- cy += 25;
+ 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);
@@ -1715,10 +1715,10 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, break;
}
case WM_COMMAND:
- if(LOWORD(wParam) == IDC_BROWSE)
+ if (LOWORD(wParam) == IDC_BROWSE)
{
char str[MAX_PATH];
- OPENFILENAMEA ofn={0};
+ OPENFILENAMEA ofn = {0};
char filter[512];
GetDlgItemTextA(hwndDlg,IDC_FILENAME, str, SIZEOF(str));
@@ -1736,14 +1736,14 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
}
else
- if(LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE) break;
- if(LOWORD(wParam) == IDC_BITMAP)
+ 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()))
+ if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) !=EN_CHANGE || (HWND)lParam !=GetFocus()))
return 0;
- if(LOWORD(wParam) == IDC_BKGRLIST)
+ if (LOWORD(wParam) == IDC_BKGRLIST)
{
- if(HIWORD(wParam) == CBN_SELCHANGE)
+ 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);
@@ -1752,14 +1752,14 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, }
{
int indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETCURSEL, 0,0);
- if(indx != CB_ERR && indx < dat->count)
+ if (indx !=CB_ERR && indx < dat->count)
{
indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
dat->item[indx].changed = TRUE;
}
{
- BOOL EnableColours=!IsDlgButtonChecked(hwndDlg,IDC_USEWINCOL);
+ BOOL EnableColours = !IsDlgButtonChecked(hwndDlg,IDC_USEWINCOL);
EnableWindow(GetDlgItem(hwndDlg,IDC_BKGCOLOUR), EnableColours);
EnableWindow(GetDlgItem(hwndDlg,IDC_SELCOLOUR), EnableColours);
}
@@ -1777,7 +1777,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, 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)
+ if (dat->item[indx].changed)
{
char *module = bkgrList[indx] + strlen(bkgrList[indx]) + 1;
db_set_b(NULL, module, "UseBitmap", (BYTE)dat->item[indx].useBitmap);
@@ -1829,7 +1829,7 @@ static INT_PTR BkgrCfg_Register(WPARAM wParam,LPARAM lParam) value = (char *)mir_alloc(len + 4); // add room for flags (DWORD)
memcpy(value, szSetting, len);
tok = strchr(value, '/');
- if(tok == NULL)
+ if (tok == NULL)
{
mir_free(value);
return 1;
@@ -1853,16 +1853,16 @@ HRESULT BackgroundsLoadModule() int BackgroundsUnloadModule(void)
{
- if(bkgrList != NULL)
+ if (bkgrList !=NULL)
{
int indx;
for(indx = 0; indx < bkgrCount; indx++)
- if(bkgrList[indx] != NULL)
+ if (bkgrList[indx] !=NULL)
mir_free(bkgrList[indx]);
mir_free(bkgrList);
}
DestroyHookableEvent(g_CluiData.hEventBkgrChanged);
- g_CluiData.hEventBkgrChanged=NULL;
+ g_CluiData.hEventBkgrChanged = NULL;
return 0;
}
@@ -1939,7 +1939,7 @@ DWORD OptCheckBox_LoadValue(struct OptCheckBox *cb) void OptCheckBox_Load(HWND hwnd, struct OptCheckBox *cb)
{
DWORD value = OptCheckBox_LoadValue(cb);
- if (cb->dwBit) value &= cb->dwBit;
+ if (cb->dwBit) value &= cb->dwBit;
CheckDlgButton(hwnd, cb->idc, value ? BST_CHECKED : BST_UNCHECKED);
}
@@ -1988,7 +1988,7 @@ void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb) static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct OptCheckBox opts[] =
+ struct OptCheckBox opts[] =
{
//{IDC_, def, bit, dbtype, dbmodule, dbsetting, valtype, pval},
{IDC_ONTOP, SETTING_ONTOP_DEFAULT, 0, DBVT_BYTE, "CList", "OnTop"},
@@ -2049,27 +2049,27 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar SendMessage(hwndDlg,WM_HSCROLL,0x12345678,0);
- for (i=0; i<SIZEOF(sortby); i++)
+ for (i = 0; i < SIZEOF(sortby); i++)
{
- item=SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_ADDSTRING,0,(LPARAM)TranslateTS(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]));
+ 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]));
+ 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);
+ 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++)
+ for (i = 0; i < SIZEOF(sortby); i++)
{
- if (s1==sortbyValue[i])
+ if (s1 == sortbyValue[i])
SendDlgItemMessage(hwndDlg,IDC_CLSORT1,CB_SETCURSEL,i,0);
- if (s2==sortbyValue[i])
+ if (s2 == sortbyValue[i])
SendDlgItemMessage(hwndDlg,IDC_CLSORT2,CB_SETCURSEL,i,0);
- if (s3==sortbyValue[i])
+ if (s3 == sortbyValue[i])
SendDlgItemMessage(hwndDlg,IDC_CLSORT3,CB_SETCURSEL,i,0);
}
@@ -2087,7 +2087,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar 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 (wParam != 0x12345678)
if (!bInit) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
break;
}
@@ -2121,7 +2121,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar {
int i;
- g_mutex_bChangingMode=TRUE;
+ g_mutex_bChangingMode = TRUE;
for (i = 0; i < SIZEOF(opts); ++i)
OptCheckBox_Save(hwndDlg, opts+i);
@@ -2133,12 +2133,12 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar 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];
+ 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);
@@ -2152,7 +2152,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged
CLUI_ReloadCLUIOptions();
cliShowHide(0,1);
- g_mutex_bChangingMode=FALSE;
+ g_mutex_bChangingMode = FALSE;
return TRUE;
}
}
@@ -2167,7 +2167,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar int ModernOptInit(WPARAM wParam,LPARAM lParam)
{
- static int iBoldControls[] =
+ static int iBoldControls[] =
{
IDC_TXT_TITLE1, IDC_TXT_TITLE2,
IDC_TXT_TITLE3, IDC_TXT_TITLE4,
diff --git a/plugins/Clist_modern/modern_clcpaint.cpp b/plugins/Clist_modern/modern_clcpaint.cpp index 548407d616..8b06600863 100644 --- a/plugins/Clist_modern/modern_clcpaint.cpp +++ b/plugins/Clist_modern/modern_clcpaint.cpp @@ -146,7 +146,7 @@ HFONT CLCPaint::ChangeToFont( HDC hdc, struct ClcData *dat, int id, int *fontHei *fontHeight = dat->fontModernInfo[id].fontHeight;
ske_ResetTextEffect( hdc );
- if ( dat->hWnd == pcli->hwndContactTree && dat->fontModernInfo[id].effect != 0 )
+ if ( dat->hWnd == pcli->hwndContactTree && dat->fontModernInfo[id].effect !=0 )
ske_SelectTextEffect( hdc, dat->fontModernInfo[id].effect-1, dat->fontModernInfo[id].effectColour1, dat->fontModernInfo[id].effectColour2 );
else
ske_ResetTextEffect( hdc );
@@ -181,7 +181,7 @@ int CLCPaint::GetBasicFontID( struct ClcContact * contact ) if ( contact->flags & CONTACTF_NOTONLIST )
return FONTID_NOTONLIST;
else if ( ( contact->flags&CONTACTF_INVISTO
- && _GetRealStatus( contact, ID_STATUS_OFFLINE ) != ID_STATUS_INVISIBLE )
+ && _GetRealStatus( contact, ID_STATUS_OFFLINE ) !=ID_STATUS_INVISIBLE )
||
( contact->flags&CONTACTF_VISTO
&& _GetRealStatus( contact, ID_STATUS_OFFLINE ) == ID_STATUS_INVISIBLE ))
@@ -300,7 +300,7 @@ tPaintCallbackProc CLCPaint::PaintCallbackProc( HWND hWnd, HDC hDC, RECT * rcPai void CLCPaint::_FillQuickHash()
{
int i;
- for ( i = 0;i<hi_LastItem;i++ )
+ for ( i = 0;i < hi_LastItem;i++ )
HASH[i] = mod_CalcHash( HASHTEXT[i] );
}
@@ -317,30 +317,30 @@ void CLCPaint::_SetHotTrackColour( HDC hdc, struct ClcData *dat ) SetTextColor( hdc, dat->hotTextColour );
return;
}
- if ( newLum>= oldLum+20 ) {
- oldLum+= 20;
+ if ( newLum >= oldLum+20 ) {
+ oldLum += 20;
newCol = RGB( GetRValue( dat->hotTextColour )*oldLum/newLum, GetGValue( dat->hotTextColour )*oldLum/newLum, GetBValue( dat->hotTextColour )*oldLum/newLum );
}
- else if ( newLum<= oldLum ) {
+ else if ( newLum <= oldLum ) {
int r, g, b;
r = GetRValue( dat->hotTextColour )*oldLum/newLum;
g = GetGValue( dat->hotTextColour )*oldLum/newLum;
b = GetBValue( dat->hotTextColour )*oldLum/newLum;
if ( r>255 ) {
- g+= ( r-255 )*3/7;
- b+= ( r-255 )*3/7;
+ g += ( r-255 )*3/7;
+ b += ( r-255 )*3/7;
r = 255;
}
if ( g>255 ) {
- r+= ( g-255 )*59/41;
+ r += ( g-255 )*59/41;
if ( r>255 ) r = 255;
- b+= ( g-255 )*59/41;
+ b += ( g-255 )*59/41;
g = 255;
}
if ( b>255 ) {
- r+= ( b-255 )*11/89;
+ r += ( b-255 )*11/89;
if ( r>255 ) r = 255;
- g+= ( b-255 )*11/89;
+ g += ( b-255 )*11/89;
if ( g>255 ) g = 255;
b = 255;
}
@@ -375,7 +375,7 @@ int CLCPaint::_GetGeneralisedStatus() int status = ID_STATUS_OFFLINE;
int statusOnlineness = 0;
- for ( int i = 0; i<pcli->hClcProtoCount; i++ )
+ for ( int i = 0; i < pcli->hClcProtoCount; i++ )
{
int thisStatus = pcli->clcProto[i].dwStatus;
if ( thisStatus == ID_STATUS_INVISIBLE )
@@ -396,7 +396,7 @@ int CLCPaint::_GetRealStatus( struct ClcContact * pContact, int nStatus ) if ( !pContact->proto )
return nStatus;
- for ( int i = 0; i<pcli->hClcProtoCount; i++ )
+ for ( int i = 0; i < pcli->hClcProtoCount; i++ )
{
if ( !lstrcmpA( pcli->clcProto[i].szProto, pContact->proto ))
return pcli->clcProto[i].dwStatus;
@@ -414,11 +414,11 @@ RECT CLCPaint::_GetRectangle( struct ClcData *dat, RECT *row_rc, RECT *free_row if ( dat->row_align_left_items_to_left )
width_tmp = real_width;
- rc.left += ( width_tmp - real_width ) >> 1;
+ rc.left += ( width_tmp - real_width ) >> 1;
rc.right = rc.left + real_width;
- rc.top += ( rc.bottom - rc.top - height ) >> 1;
+ rc.top += ( rc.bottom - rc.top - height ) >> 1;
rc.bottom = rc.top + height;
- *left_pos += width_tmp + horizontal_space;
+ *left_pos += width_tmp + horizontal_space;
free_row_rc->left = row_rc->left + *left_pos;
}
else // if ( !left )
@@ -434,10 +434,10 @@ RECT CLCPaint::_GetRectangle( struct ClcData *dat, RECT *row_rc, RECT *free_row {
rc.left = max( rc.left + horizontal_space, rc.right - width_tmp ) + ( ( width_tmp - real_width ) >> 1 );
rc.right = min( rc.left + real_width, rc.right );
- rc.top += max( 0, ( rc.bottom - rc.top - height ) >> 1 );
+ rc.top += max( 0, ( rc.bottom - rc.top - height ) >> 1 );
rc.bottom = min( rc.top + height, rc.bottom );
- *right_pos += min( width_tmp + horizontal_space, free_row_rc->right - free_row_rc->left );
+ *right_pos += min( width_tmp + horizontal_space, free_row_rc->right - free_row_rc->left );
free_row_rc->right = row_rc->right - *right_pos;
}
}
@@ -450,7 +450,7 @@ RECT CLCPaint::_GetRectangle( struct ClcData *dat, RECT *row_rc, RECT *free_row void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT * free_rc, SIZE * text_size, TCHAR *szText, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley )
{
if ( szText == NULL )return;
- uTextFormat &= ~DT_RIGHT;
+ uTextFormat &= ~DT_RIGHT;
if ( plText == NULL )
ske_DrawText( hdcMem, szText, len, free_rc, uTextFormat );
else
@@ -477,28 +477,28 @@ void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT * free_rc, SIZE * text_size, T else
{
// Draw text and smileys
- for ( ; i < plText->realCount && i >= 0 && pos_x < text_size->cx && len > 0; i += ( uTextFormat & DT_RTLREADING ? -1 : 1 ))
+ for ( ; i < plText->realCount && i >= 0 && pos_x < text_size->cx && len > 0; i += ( uTextFormat & DT_RTLREADING ? -1 : 1 ))
{
ClcContactTextPiece *piece = ( ClcContactTextPiece * ) plText->items[i];
RECT text_rc = *free_rc;
if ( uTextFormat & DT_RTLREADING )
- text_rc.right -= pos_x;
+ text_rc.right -= pos_x;
else
- text_rc.left += pos_x;
+ text_rc.left += pos_x;
if ( piece->type == TEXT_PIECE_TYPE_TEXT )
{
tmp_rc = text_rc;
- tmp_rc.right += 50;
+ tmp_rc.right += 50;
ske_DrawText( hdcMem, &szText[piece->start_pos], min( len, piece->len ), &tmp_rc, DT_CALCRECT | ( uTextFormat & ~DT_END_ELLIPSIS ));
- pos_x += tmp_rc.right - tmp_rc.left + 2;
+ pos_x += tmp_rc.right - tmp_rc.left + 2;
if ( uTextFormat & DT_RTLREADING )
text_rc.left = max( text_rc.left, text_rc.right - ( tmp_rc.right - tmp_rc.left ));
ske_DrawText( hdcMem, &szText[piece->start_pos], min( len, piece->len ), &text_rc, uTextFormat );
- len -= piece->len;
+ len -= piece->len;
}
else
{
@@ -511,7 +511,7 @@ void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT * free_rc, SIZE * text_size, T else
{
LONG fac_width, fac_height;
- len -= piece->len;
+ len -= piece->len;
if ( piece->smiley_height > row_height && ResizeSizeSmiley )
{
@@ -530,17 +530,17 @@ void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT * free_rc, SIZE * text_size, T if ( fac_width <= text_rc.right - text_rc.left )
{
- text_rc.top += ( row_height - fac_height ) >> 1;
+ text_rc.top += ( row_height - fac_height ) >> 1;
ske_DrawIconEx( hdcMem, text_rc.left, text_rc.top, piece->smiley,
- fac_width, fac_height, 0, NULL, DI_NORMAL|( ( factor<1 )?128:0 )); //TO DO enchance drawing quality
+ fac_width, fac_height, 0, NULL, DI_NORMAL|( ( factor < 1 )?128:0 )); //TO DO enchance drawing quality
}
else
{
ske_DrawText( hdcMem, TEXT( "..." ), 3, &text_rc, uTextFormat );
}
- pos_x += fac_width;
+ pos_x += fac_width;
}
}
}
@@ -630,7 +630,7 @@ MODERNMASK * CLCPaint::_GetCLCContactRowBackModernMask( struct ClcGroup * group, case ID_STATUS_IDLE: _AddParamShort( mpModernMask, hi_Status, hi_IDLE ); break;
default: _AddParamShort( mpModernMask, hi_Status, hi_OFFLINE );
}
- _AddParamShort( mpModernMask, hi_HasAvatar, ( dat->avatars_show && Drawing->avatar_data != NULL )?hi_True:hi_False );
+ _AddParamShort( mpModernMask, hi_HasAvatar, ( dat->avatars_show && Drawing->avatar_data !=NULL )?hi_True:hi_False );
_AddParamShort( mpModernMask, hi_Rate, hi_None + Drawing->bContactRate );
break;
}
@@ -666,7 +666,7 @@ MODERNMASK * CLCPaint::_GetCLCContactRowBackModernMask( struct ClcGroup * group, TCHAR * b2 = mir_tstrdup( Drawing->szText );
int i, m;
m = lstrlen( b2 );
- for ( i = 0; i<m;i++ )
+ for ( i = 0; i < m;i++ )
if ( b2[i] == TEXT( ',' )) b2[i] = TEXT( '.' );
{
char* b3 = mir_utf8encodeT( b2 );
@@ -681,7 +681,7 @@ MODERNMASK * CLCPaint::_GetCLCContactRowBackModernMask( struct ClcGroup * group, TCHAR * b2 = mir_tstrdup( group->parent->cl.items[0]->szText );
int i, m;
m = lstrlen( b2 );
- for ( i = 0; i<m;i++ )
+ for ( i = 0; i < m;i++ )
if ( b2[i] == TEXT( ',' )) b2[i] = TEXT( '.' );
{
char * b3 = mir_utf8encodeT( b2 );
@@ -729,11 +729,11 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str if ( Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing )
+ Drawing->group->parent->cl.items[0] !=Drawing )
{
dg = dat->row_before_group_space;
- free_row_rc.top+= dg;
- height-= dg;
+ free_row_rc.top += dg;
+ height -= dg;
}
if ( !InClistWindow || !gl_RowRoot || Drawing->type == CLCIT_GROUP )
{
@@ -751,7 +751,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
else if ( Drawing->type == CLCIT_CONTACT )
iImage = Drawing->iImage;
- if ( iImage != -1 )
+ if ( iImage !=-1 )
{
COLORREF colourFg;
int mode;
@@ -761,7 +761,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str p_rect.right = p_rect.left+ICON_HEIGHT;
p_rect.bottom = p_rect.top+ICON_HEIGHT;
// Store pos
- if ( dat->text_rtl != 0 ) _RTLRect( &p_rect, free_row_rc.right, dx );
+ if ( dat->text_rtl !=0 ) _RTLRect( &p_rect, free_row_rc.right, dx );
Drawing->pos_icon = p_rect;
if ( hottrack )
{
@@ -780,14 +780,14 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE )
+ _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) !=ID_STATUS_OFFLINE )
{
mode = ILD_SELECTED;
}
_DrawStatusIcon( Drawing, dat, iImage, hdcMem, p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode );
}
- fr_rc.left+= ICON_HEIGHT+2;
+ fr_rc.left += ICON_HEIGHT+2;
}
//2 draw extra
{
@@ -806,16 +806,16 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str int count = 0;
RECT rc;
int x = 0;
- for ( iImage = dat->extraColumnsCount-1; iImage>= 0 ; iImage-- )
+ for ( iImage = dat->extraColumnsCount-1; iImage >= 0 ; iImage-- )
{
COLORREF colourFg = dat->selBkColour;
int mode = BlendedInActiveState?BlendValue:ILD_NORMAL;
if ( Drawing->iExtraImage[iImage] == 0xFF && Drawing->iWideExtraImage[iImage] == 0xFFFF )
{
{
- x+= ( x>0 )?dat->extraColumnSpacing:ICON_HEIGHT;
+ x += ( x>0 )?dat->extraColumnSpacing:ICON_HEIGHT;
SetRect( &rc, fr_rc.right-x, p_rect.top, fr_rc.right-x+ICON_HEIGHT, p_rect.bottom );
- if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, 0 );
+ if ( dat->text_rtl !=0 ) _RTLRect( &rc, free_row_rc.right, 0 );
Drawing->pos_extra[iImage] = rc;
count++;
}
@@ -834,20 +834,20 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str mode = BlendValue;
}
- x+= ( x>0 )?dat->extraColumnSpacing:ICON_HEIGHT;
+ x += ( x>0 )?dat->extraColumnSpacing:ICON_HEIGHT;
SetRect( &rc, fr_rc.right-x, p_rect.top, fr_rc.right-x+ICON_HEIGHT, p_rect.bottom );
- if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, dx );
+ if ( dat->text_rtl !=0 ) _RTLRect( &rc, free_row_rc.right, dx );
Drawing->pos_extra[iImage] = rc;
Drawing->pos_extra[iImage] = rc;
- if ( Drawing->iExtraImage[iImage] != 0xFF )
+ if ( Drawing->iExtraImage[iImage] !=0xFF )
ske_ImageList_DrawEx( dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode );
- else if ( Drawing->iWideExtraImage[iImage] != 0xFFFF )
+ else if ( Drawing->iWideExtraImage[iImage] !=0xFFFF )
ske_ImageList_DrawEx( dat->himlWideExtraColumns, Drawing->iWideExtraImage[iImage], hdcMem,
rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode );
}
- fr_rc.right-= x;
+ fr_rc.right -= x;
}
}
//3 draw text
@@ -857,7 +857,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str RECT text_rect = fr_rc;
RECT counts_rc = {0};
UINT uTextFormat = DT_LEFT|DT_VCENTER|( gl_TrimText?DT_END_ELLIPSIS:0 )|DT_SINGLELINE;
- uTextFormat|= dat->text_rtl?DT_RTLREADING:0;
+ uTextFormat |= dat->text_rtl?DT_RTLREADING:0;
// Select font
ChangeToFont( hdcMem, dat, GetBasicFontID( Drawing ), NULL );
@@ -884,7 +884,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str count_rc.right = 0;
count_rc.left = 0;
ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &count_rc, DT_CALCRECT );
- count_size.cx += count_rc.right-count_rc.left;
+ count_size.cx += count_rc.right-count_rc.left;
count_size.cy = count_rc.bottom-count_rc.top;
}
// modify text rect
@@ -898,10 +898,10 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str if ( wid-count_size.cx > text_size.cx )
{
- if ( dat->row_align_group_mode != 2 ) //center or left
+ if ( dat->row_align_group_mode !=2 ) //center or left
{
int x = ( dat->row_align_group_mode == 1 )?( wid-( text_size.cx+count_size.cx ))>>1:0;
- nameRect.left+= x;
+ nameRect.left += x;
nameRect.right = nameRect.left+text_size.cx;
countRect.left = nameRect.right+space_width;
countRect.right = countRect.left+count_size.cx-space_width;
@@ -919,7 +919,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str else
{
countRect.right = nameRect.right;
- nameRect.right-= count_size.cx;
+ nameRect.right -= count_size.cx;
countRect.left = nameRect.right+space_width;
}
countRect.bottom = nameRect.bottom;
@@ -929,17 +929,17 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str //if ( !( szCounts && strlen( szCounts )>0 ))
- //uTextFormat|= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT;
+ //uTextFormat |= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT;
- uTextFormat|= DT_VCENTER;
+ uTextFormat |= DT_VCENTER;
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPS:FONTID_CLOSEDGROUPS, NULL );
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
- if ( dat->text_rtl != 0 ) _RTLRect( &nameRect, free_row_rc.right, dx );
+ if ( dat->text_rtl !=0 ) _RTLRect( &nameRect, free_row_rc.right, dx );
_DrawTextSmiley( hdcMem, &nameRect, &text_size, Drawing->szText, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if ( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] !='\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, &nameRect, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
@@ -951,12 +951,12 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str SetTextColor( hdcMem, dat->selTextColour );
else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
- if ( dat->text_rtl != 0 ) _RTLRect( &countRect, free_row_rc.right, dx );
+ if ( dat->text_rtl !=0 ) _RTLRect( &countRect, free_row_rc.right, dx );
ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &countRect, uTextFormat );
}
{
RECT rc = fr_rc;
- if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, dx );
+ if ( dat->text_rtl !=0 ) _RTLRect( &rc, free_row_rc.right, dx );
Drawing->pos_rename_rect = rc;
}
Drawing->pos_label = nameRect;
@@ -1013,9 +1013,9 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str SetTextColor( hdcMem, dat->selTextColour );
else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
- if ( dat->text_rtl != 0 ) _RTLRect( &text_rect, free_row_rc.right, dx );
+ if ( dat->text_rtl !=0 ) _RTLRect( &text_rect, free_row_rc.right, dx );
_DrawTextSmiley( hdcMem, &text_rect, &text_size, Drawing->szText, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if ( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] !='\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, &text_rect, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
@@ -1023,7 +1023,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str if ( Drawing->type == CLCIT_GROUP && szCounts && szCounts[0] && counts_rc.right-counts_rc.left>0 )
{
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- if ( dat->text_rtl != 0 ) _RTLRect( &counts_rc, free_row_rc.right, dx );
+ if ( dat->text_rtl !=0 ) _RTLRect( &counts_rc, free_row_rc.right, dx );
if ( InClistWindow && g_CluiData.fLayered )
ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &counts_rc, uTextFormat );
else
@@ -1037,7 +1037,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str Drawing->pos_label = text_rect;
{
RECT rc = fr_rc;
- if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, dx );
+ if ( dat->text_rtl !=0 ) _RTLRect( &rc, free_row_rc.right, dx );
Drawing->pos_rename_rect = rc;
}
@@ -1045,7 +1045,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str {
//???
RECT rc = fr_rc;
- if ( dat->text_rtl != 0 )
+ if ( dat->text_rtl !=0 )
{
rc.left = Drawing->pos_rename_rect.left;
rc.right = text_rect.left-3;
@@ -1054,7 +1054,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str rc.left = text_rect.right+3;
if ( rc.right-rc.left>4 )
{
- rc.top+= ( ( rc.bottom-rc.top )>>1 )-1;
+ rc.top += ( ( rc.bottom-rc.top )>>1 )-1;
rc.bottom = rc.top+2;
DrawEdge( hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT );
ske_SetRectOpaque( hdcMem, &rc );
@@ -1065,11 +1065,11 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str return;
}
minheight = max( minheight, height );
- dy+= ( minheight>height )?( ( minheight-height )>>1 ):0;
+ dy += ( minheight>height )?( ( minheight-height )>>1 ):0;
// Call Placement
cppCalculateRowItemsPos( gl_RowRoot, free_row_rc.right-free_row_rc.left );
// Now paint
- while ( ( gl_RowTabAccess[i] != NULL || ( i<2 && Drawing->type == CLCIT_GROUP )) && !( i>= 2 && Drawing->type == CLCIT_GROUP ))
+ while ( ( gl_RowTabAccess[i] !=NULL || ( i < 2 && Drawing->type == CLCIT_GROUP )) && !( i >= 2 && Drawing->type == CLCIT_GROUP ))
{
if ( gl_RowTabAccess[i]->r.right-gl_RowTabAccess[i]->r.left>0
@@ -1077,7 +1077,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str {
RECT p_rect = gl_RowTabAccess[i]->r;
OffsetRect( &p_rect, dx, dy );
- if ( dat->text_rtl != 0 && gl_RowTabAccess[i]->type != TC_EXTRA /*each extra icon modified separately*/ ) _RTLRect( &p_rect, free_row_rc.right, 0 );
+ if ( dat->text_rtl !=0 && gl_RowTabAccess[i]->type !=TC_EXTRA /*each extra icon modified separately*/ ) _RTLRect( &p_rect, free_row_rc.right, 0 );
switch ( gl_RowTabAccess[i]->type )
{
case TC_TEXT1:
@@ -1089,8 +1089,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str text_size.cy = p_rect.bottom-p_rect.top;
ChangeToFont( hdcMem, dat, GetBasicFontID( Drawing ), NULL );
- uTextFormat|= ( gl_RowTabAccess[i]->valign == TC_VCENTER )?DT_VCENTER:( gl_RowTabAccess[i]->valign == TC_BOTTOM )?DT_BOTTOM:0;
- uTextFormat|= ( gl_RowTabAccess[i]->halign == TC_HCENTER )?DT_CENTER:( gl_RowTabAccess[i]->halign == TC_RIGHT )?DT_RIGHT:0;
+ uTextFormat |= ( gl_RowTabAccess[i]->valign == TC_VCENTER )?DT_VCENTER:( gl_RowTabAccess[i]->valign == TC_BOTTOM )?DT_BOTTOM:0;
+ uTextFormat |= ( gl_RowTabAccess[i]->halign == TC_HCENTER )?DT_CENTER:( gl_RowTabAccess[i]->halign == TC_RIGHT )?DT_RIGHT:0;
uTextFormat = uTextFormat | ( gl_TrimText?DT_END_ELLIPSIS:0 )|DT_SINGLELINE;
if ( Drawing->type == CLCIT_CONTACT )
@@ -1100,7 +1100,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
_DrawTextSmiley( hdcMem, &p_rect, &text_size, Drawing->szText, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if ( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] !='\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, &p_rect, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
@@ -1135,7 +1135,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str count_rc.right = 0;
count_rc.left = 0;
ske_DrawTextA( hdcMem, szCounts, lstrlenA( szCounts ), &count_rc, DT_CALCRECT );
- count_size.cx += count_rc.right-count_rc.left;
+ count_size.cx += count_rc.right-count_rc.left;
count_size.cy = count_rc.bottom-count_rc.top;
}
// modify text rect
@@ -1149,10 +1149,10 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str if ( wid-count_size.cx > text_size.cx )
{
- if ( dat->row_align_group_mode != 2 ) //center or left
+ if ( dat->row_align_group_mode !=2 ) //center or left
{
int x = ( dat->row_align_group_mode == 1 )?( wid-( text_size.cx+count_size.cx ))>>1:0;
- nameRect.left+= x;
+ nameRect.left += x;
nameRect.right = nameRect.left+text_size.cx;
countRect.left = nameRect.right+space_width;
countRect.right = countRect.left+count_size.cx-space_width;
@@ -1170,7 +1170,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str else
{
countRect.right = nameRect.right;
- nameRect.right-= count_size.cx;
+ nameRect.right -= count_size.cx;
countRect.left = nameRect.right+space_width;
}
countRect.bottom = nameRect.bottom;
@@ -1180,16 +1180,16 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str //if ( !( szCounts && strlen( szCounts )>0 ))
- //uTextFormat|= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT;
+ //uTextFormat |= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT;
- uTextFormat|= DT_VCENTER;
+ uTextFormat |= DT_VCENTER;
ChangeToFont( hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPS:FONTID_CLOSEDGROUPS, NULL );
if ( selected )
SetTextColor( hdcMem, dat->selTextColour );
else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
_DrawTextSmiley( hdcMem, &nameRect, &text_size, Drawing->szText, lstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if ( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] !='\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, &nameRect, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
@@ -1226,8 +1226,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str pdnce->szSecondLineText = mir_tstrdup( buf );
}
}
- uTextFormat|= ( gl_RowTabAccess[i]->valign == TC_VCENTER )?DT_VCENTER:( gl_RowTabAccess[i]->valign == TC_BOTTOM )?DT_BOTTOM:0;
- uTextFormat|= ( gl_RowTabAccess[i]->halign == TC_HCENTER )?DT_CENTER:( gl_RowTabAccess[i]->halign == TC_RIGHT )?DT_RIGHT:0;
+ uTextFormat |= ( gl_RowTabAccess[i]->valign == TC_VCENTER )?DT_VCENTER:( gl_RowTabAccess[i]->valign == TC_BOTTOM )?DT_BOTTOM:0;
+ uTextFormat |= ( gl_RowTabAccess[i]->halign == TC_HCENTER )?DT_CENTER:( gl_RowTabAccess[i]->halign == TC_RIGHT )?DT_RIGHT:0;
text_size.cx = p_rect.right-p_rect.left;
text_size.cy = p_rect.bottom-p_rect.top;
@@ -1255,8 +1255,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str pdnce->szThirdLineText = mir_tstrdup( buf );
}
}
- uTextFormat|= ( gl_RowTabAccess[i]->valign == TC_VCENTER )?DT_VCENTER:( gl_RowTabAccess[i]->valign == TC_BOTTOM )?DT_BOTTOM:0;
- uTextFormat|= ( gl_RowTabAccess[i]->halign == TC_HCENTER )?DT_CENTER:( gl_RowTabAccess[i]->halign == TC_RIGHT )?DT_RIGHT:0;
+ uTextFormat |= ( gl_RowTabAccess[i]->valign == TC_VCENTER )?DT_VCENTER:( gl_RowTabAccess[i]->valign == TC_BOTTOM )?DT_BOTTOM:0;
+ uTextFormat |= ( gl_RowTabAccess[i]->halign == TC_HCENTER )?DT_CENTER:( gl_RowTabAccess[i]->halign == TC_RIGHT )?DT_RIGHT:0;
text_size.cx = p_rect.right-p_rect.left;
text_size.cy = p_rect.bottom-p_rect.top;
@@ -1271,10 +1271,10 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str {
if ( ( Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon )
- || ( Drawing->type == CLCIT_CONTACT && Drawing->iImage != -1
+ || ( Drawing->type == CLCIT_CONTACT && Drawing->iImage !=-1
&& !( dat->icon_hide_on_avatar && dat->avatars_show
- && ( ( dat->use_avatar_service && Drawing->avatar_data != NULL ) ||
- ( !dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE )
+ && ( ( dat->use_avatar_service && Drawing->avatar_data !=NULL ) ||
+ ( !dat->use_avatar_service && Drawing->avatar_pos !=AVATAR_POS_DONT_HAVE )
)
&& !Drawing->image_is_special )) )
{
@@ -1287,7 +1287,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
else if ( Drawing->type == CLCIT_CONTACT )
iImage = Drawing->iImage;
- if ( iImage != -1 )
+ if ( iImage !=-1 )
{
COLORREF colourFg;
int mode;
@@ -1310,7 +1310,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE )
+ _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) !=ID_STATUS_OFFLINE )
{
mode = ILD_SELECTED;
}
@@ -1324,19 +1324,19 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
case TC_AVATAR:
{
- BOOL hasAvatar = ( dat->use_avatar_service && Drawing->avatar_data != NULL ) ||( !dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE );
+ BOOL hasAvatar = ( dat->use_avatar_service && Drawing->avatar_data !=NULL ) ||( !dat->use_avatar_service && Drawing->avatar_pos !=AVATAR_POS_DONT_HAVE );
BYTE blendmode = 255;
if ( hottrack )
blendmode = 255;
else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
blendmode = 128;
if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE )
+ _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) !=ID_STATUS_OFFLINE )
blendmode = 128;
if ( !hasAvatar ) //if no avatar then paint icon image
{
int iImage = Drawing->iImage;
- if ( iImage != -1 )
+ if ( iImage !=-1 )
{
COLORREF colourFg;
int mode;
@@ -1359,7 +1359,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE )
+ _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) !=ID_STATUS_OFFLINE )
{
mode = ILD_SELECTED;
}
@@ -1397,8 +1397,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str HBRUSH hBrush = CreateSolidBrush( dat->avatars_border_color );
HBRUSH hOldBrush = ( HBRUSH )SelectObject( hdcMem, hBrush );
HRGN rgn2;
- rgn = CreateRoundRectRgn( p_rect.left, p_rect.top, p_rect.right+1, p_rect.bottom+1, round_radius<<1, round_radius<<1 );
- rgn2 = CreateRoundRectRgn( p_rect.left+1, p_rect.top+1, p_rect.right, p_rect.bottom, round_radius<<1, round_radius<<1 );
+ rgn = CreateRoundRectRgn( p_rect.left, p_rect.top, p_rect.right+1, p_rect.bottom+1, round_radius << 1, round_radius << 1 );
+ rgn2 = CreateRoundRectRgn( p_rect.left+1, p_rect.top+1, p_rect.right, p_rect.bottom, round_radius << 1, round_radius << 1 );
CombineRgn( rgn2, rgn, rgn2, RGN_DIFF );
// FrameRgn( hdcMem, rgn, hBrush, 1, 1 );
FillRgn( hdcMem, rgn2, hBrush );
@@ -1495,7 +1495,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str //TODO fix overlays
// Draw overlay
- if ( dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + ( dat->avatars_draw_border ? 2 : 0 )
+ if ( dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + ( dat->avatars_draw_border ? 2 : 0 )
&& GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE < MAX_REGS( g_pAvatarOverlayIcons ))
{
p_rect.top = p_rect.bottom - ICON_HEIGHT;
@@ -1512,7 +1512,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
{
UINT a = blendmode;
- a = ( a<<24 );
+ a = ( a << 24 );
ske_ImageList_DrawEx( hAvatarOverlays, g_pAvatarOverlayIcons[GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE].listID,
hdcMem,
p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
@@ -1529,7 +1529,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str item = ExtIconFromStatusMode( Drawing->hContact, Drawing->proto,
Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus( Drawing->hContact ));
- if ( item != -1 )
+ if ( item !=-1 )
_DrawStatusIcon( Drawing, dat, item, hdcMem,
p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
CLR_NONE, CLR_NONE, ( blendmode == 255 )?ILD_NORMAL:( blendmode == 128 )?ILD_BLEND50:ILD_BLEND25 );
@@ -1537,7 +1537,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
{
- if ( Drawing->iImage != -1 )
+ if ( Drawing->iImage !=-1 )
_DrawStatusIcon( Drawing, dat, Drawing->iImage, hdcMem,
p_rect.left, p_rect.top, ICON_HEIGHT, ICON_HEIGHT,
CLR_NONE, CLR_NONE, ( blendmode == 255 )?ILD_NORMAL:( blendmode == 128 )?ILD_BLEND50:ILD_BLEND25 );
@@ -1561,7 +1561,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str int count = 0;
RECT rc;
int x = 0;
- for ( iImage = 0; iImage<dat->extraColumnsCount ; iImage++ )
+ for ( iImage = 0; iImage < dat->extraColumnsCount ; iImage++ )
{
COLORREF colourFg = dat->selBkColour;
int mode = BlendedInActiveState?BlendValue:ILD_NORMAL;
@@ -1570,8 +1570,8 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str if ( !dat->MetaIgnoreEmptyExtra )
{
SetRect( &rc, p_rect.left+x, p_rect.top, p_rect.left+x+ICON_HEIGHT, p_rect.bottom );
- x+= dat->extraColumnSpacing;
- if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, 0 );
+ x += dat->extraColumnSpacing;
+ if ( dat->text_rtl !=0 ) _RTLRect( &rc, free_row_rc.right, 0 );
Drawing->pos_extra[iImage] = rc;
count++;
}
@@ -1591,14 +1591,14 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
SetRect( &rc, p_rect.left+x, p_rect.top, p_rect.left+x+ICON_HEIGHT, p_rect.bottom );
- x+= dat->extraColumnSpacing;
+ x += dat->extraColumnSpacing;
count++;
- if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, 0 );
+ if ( dat->text_rtl !=0 ) _RTLRect( &rc, free_row_rc.right, 0 );
Drawing->pos_extra[iImage] = rc;
- if ( Drawing->iExtraImage[iImage] != 0xFF )
+ if ( Drawing->iExtraImage[iImage] !=0xFF )
ske_ImageList_DrawEx( dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode );
- else if ( Drawing->iWideExtraImage[iImage] != 0xFFFF )
+ else if ( Drawing->iWideExtraImage[iImage] !=0xFFFF )
ske_ImageList_DrawEx( dat->himlWideExtraColumns, Drawing->iWideExtraImage[iImage], hdcMem,
rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode );
}
@@ -1619,13 +1619,13 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str ( !Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 ))
{
int eNum = gl_RowTabAccess[i]->type-TC_EXTRA1;
- if ( eNum<dat->extraColumnsCount )
- if ( Drawing->iExtraImage[eNum] != 0xFF || Drawing->iWideExtraImage[eNum] != 0xFFFF )
+ if ( eNum < dat->extraColumnsCount )
+ if ( Drawing->iExtraImage[eNum] !=0xFF || Drawing->iWideExtraImage[eNum] !=0xFFFF )
{
int mode = 0;
int BlendedInActiveState = dat->dbbBlendInActiveState;
int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
- if ( mode2 != -1 ) mode = mode2;
+ if ( mode2 !=-1 ) mode = mode2;
else
{
if ( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
@@ -1641,12 +1641,12 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str }
mode2 = mode;
}
- if ( dat->text_rtl != 0 ) _RTLRect( &p_rect, free_row_rc.right, 0 );
+ if ( dat->text_rtl !=0 ) _RTLRect( &p_rect, free_row_rc.right, 0 );
Drawing->pos_extra[eNum] = p_rect;
- if ( Drawing->iExtraImage[eNum] != 0xFF )
+ if ( Drawing->iExtraImage[eNum] !=0xFF )
ske_ImageList_DrawEx( dat->himlExtraColumns, Drawing->iExtraImage[eNum], hdcMem,
p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode );
- else if ( Drawing->iWideExtraImage[eNum] != 0xFFFF )
+ else if ( Drawing->iWideExtraImage[eNum] !=0xFFFF )
ske_ImageList_DrawEx( dat->himlWideExtraColumns, Drawing->iWideExtraImage[eNum], hdcMem,
p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode );
}
@@ -1676,7 +1676,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, struct ClcData *dat, str void CLCPaint::_DrawStatusIcon( struct ClcContact * Drawing, struct ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode )
{
- if ( Drawing->type != CLCIT_CONTACT )
+ if ( Drawing->type !=CLCIT_CONTACT )
{
ske_ImageList_DrawEx( g_himlCListClc, LOWORD( iImage ), hdcMem,
x, y, cx, cy, colorbg, colorfg, mode );
@@ -1686,10 +1686,10 @@ void CLCPaint::_DrawStatusIcon( struct ClcContact * Drawing, struct ClcData *dat ske_ImageList_DrawEx( g_himlCListClc, LOWORD( iImage ), hdcMem,
x, y, cx, cy, colorbg, colorfg, mode );
}
- else if ( iImage != -1 && HIWORD( iImage ) && dat->drawOverlayedStatus )
+ else if ( iImage !=-1 && HIWORD( iImage ) && dat->drawOverlayedStatus )
{
int status = GetContactCachedStatus( Drawing->hContact );
- if ( status<ID_STATUS_OFFLINE ) status = ID_STATUS_OFFLINE;
+ if ( status < ID_STATUS_OFFLINE ) status = ID_STATUS_OFFLINE;
else if ( status>ID_STATUS_OUTTOLUNCH ) status = ID_STATUS_ONLINE;
ske_ImageList_DrawEx( g_himlCListClc, HIWORD( iImage ), hdcMem,
x, y, cx, cy, colorbg, colorfg, mode );
@@ -1728,7 +1728,7 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint, switch( dat->backgroundBmpUse&CLBM_TYPE ) {
case CLB_STRETCH:
if ( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
- if ( clRect.right*bmp.bmHeight<clRect.bottom*bmp.bmWidth ) {
+ if ( clRect.right*bmp.bmHeight < clRect.bottom*bmp.bmWidth ) {
desth = clRect.bottom;
destw = desth*bmp.bmWidth/bmp.bmHeight;
}
@@ -1776,9 +1776,9 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT * rcPaint, }
break;
}
- for ( ;y<maxy;y+= desth ) {
- if ( y<rcPaint->top-desth ) continue;
- for ( x = 0;x<maxx;x+= destw )
+ for ( ;y < maxy;y += desth ) {
+ if ( y < rcPaint->top-desth ) continue;
+ for ( x = 0;x < maxx;x += destw )
StretchBlt( hdcMem, x, y, destw, desth, hdcBmp, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY );
}
SelectObject( hdcBmp, oldbm );
@@ -1802,11 +1802,11 @@ int CLCPaint::_DetermineDrawMode( HWND hWnd, struct ClcData *dat ) if ( !(paintMode&DM_CONTROL) && !CLUI_IsInMainWindow( hWnd ))
paintMode |= DM_FLOAT;
- LONG lStyle = GetWindowLongPtr( hWnd, GWL_STYLE );
+ LONG lStyle = GetWindowLongPtr( hWnd, GWL_STYLE );
int nStatus = _GetGeneralisedStatus();
if ( ( lStyle & WS_DISABLED )
|| ( dat->greyoutFlags & pcli->pfnClcStatusToPf2( nStatus ))
- || ( ( dat->greyoutFlags & GREYF_UNFOCUS) && ( GetFocus() != hWnd )) )
+ || ( ( dat->greyoutFlags & GREYF_UNFOCUS) && ( GetFocus() !=hWnd )) )
paintMode |= DM_GRAY;
if ( lStyle&CLS_GREYALTERNATE )
@@ -1831,7 +1831,7 @@ void CLCPaint::_PreparePaintContext( HWND hWnd, struct ClcData * dat, HDC hdc, i if ( paintMode&( DM_DRAW_OFFSCREEN | DM_GRAY ) )
{
pc.hdcMem = CreateCompatibleDC( hdc );
- pc.fRelease |=_PaintContext::release_hdcmem;
+ pc.fRelease |= _PaintContext::release_hdcmem;
pc.hBmpOsb = ske_CreateDIB32( clRect.right, clRect.bottom );
pc.oldbmp = ( HBITMAP ) SelectObject( pc.hdcMem, pc.hBmpOsb );
}
@@ -1881,7 +1881,7 @@ void CLCPaint::_DrawBackground( HWND hWnd, struct ClcData * dat, HDC hdc, int pa DeleteObject( hBrush );
ske_SetRectOpaque( pc.hdcMem, rcPaint );
if ( !( paintMode&DM_GREYALTERNATE ))
- SkinDrawGlyph( pc.hdcMem, &clRect, rcPaint, "CL,ID=Background,Type=Control" );
+ SkinDrawGlyph( pc.hdcMem, &clRect, rcPaint, "CL,ID = Background,Type = Control" );
}
else if ( paintMode&DM_CLASSIC)
{
@@ -1897,7 +1897,7 @@ void CLCPaint::_DrawBackground( HWND hWnd, struct ClcData * dat, HDC hdc, int pa if ( paintMode&DM_NON_LAYERED )
ske_BltBackImage( hWnd, (paintMode&DM_GRAY) ? pc.hdcMem2 : pc.hdcMem, rcPaint );
- SkinDrawGlyph( pc.hdcMem, &clRect, rcPaint, "CL,ID=Background" );
+ SkinDrawGlyph( pc.hdcMem, &clRect, rcPaint, "CL,ID = Background" );
}
}
void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc )
@@ -1911,13 +1911,13 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo int line_num = -1;
int y = -dat->yScroll;
BOOL is_foreground = IsForegroundWindow( hWnd );
- LONG lStyle = GetWindowLongPtr( hWnd, GWL_STYLE );
+ LONG lStyle = GetWindowLongPtr( hWnd, GWL_STYLE );
while( y < rcPaint->bottom )
{
if ( subindex == -1 )
{
- if ( group->scanIndex>= group->cl.count )
+ if ( group->scanIndex >= group->cl.count )
{
group = group->parent;
indent--;
@@ -1974,17 +1974,17 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo else RowHeight_CalcRowHeight( dat, hWnd, Drawing, line_num );
// Init settings
- selected = ( ( line_num == dat->selection ) && ( dat->hwndRenameEdit != NULL || dat->showSelAlways || dat->exStyle&CLS_EX_SHOWSELALWAYS || is_foreground ) && Drawing->type != CLCIT_DIVIDER );
- hottrack = dat->exStyle&CLS_EX_TRACKSELECT && Drawing->type != CLCIT_DIVIDER && dat->iHotTrack == line_num;
+ selected = ( ( line_num == dat->selection ) && ( dat->hwndRenameEdit !=NULL || dat->showSelAlways || dat->exStyle&CLS_EX_SHOWSELALWAYS || is_foreground ) && Drawing->type !=CLCIT_DIVIDER );
+ hottrack = dat->exStyle&CLS_EX_TRACKSELECT && Drawing->type !=CLCIT_DIVIDER && dat->iHotTrack == line_num;
left_pos = clRect.left + dat->leftMargin + indent * dat->groupIndent + subident;
right_pos = dat->rightMargin; // Border
SetRect( &row_rc, clRect.left, y, clRect.right, y + dat->row_heights[line_num] );
free_row_rc = row_rc;
- free_row_rc.left += left_pos;
- free_row_rc.right -= right_pos;
- free_row_rc.top += dat->row_border;
- free_row_rc.bottom -= dat->row_border;
+ free_row_rc.left += left_pos;
+ free_row_rc.right -= right_pos;
+ free_row_rc.top += dat->row_border;
+ free_row_rc.bottom -= dat->row_border;
free_row_height = free_row_rc.bottom - free_row_rc.top;
{
@@ -2003,7 +2003,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo ZeroMemory( &Drawing->pos_extra, sizeof( Drawing->pos_extra ));
- // **** Draw Background
+ //**** Draw Background
// Alternating grey
if ( paintMode&DM_GREYALTERNATE && line_num&1 )
@@ -2013,7 +2013,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo FillRect( pc.hdcMem, &row_rc, pc.hBrushAlternateGrey );
}
else
- SkinDrawGlyph( pc.hdcMem, &row_rc, rcPaint, "CL,ID=GreyAlternate" );
+ SkinDrawGlyph( pc.hdcMem, &row_rc, rcPaint, "CL,ID = GreyAlternate" );
}
if ( ! (paintMode&(DM_CLASSIC|DM_CONTROL)) )
{
@@ -2024,11 +2024,11 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo {
RECT mrc = row_rc;
if ( group->parent == 0
- && group->scanIndex != 0
- && group->scanIndex<group->cl.count
+ && group->scanIndex !=0
+ && group->scanIndex < group->cl.count
&& group->cl.items[group->scanIndex]->type == CLCIT_GROUP )
{
- mrc.top+= dat->row_before_group_space;
+ mrc.top += dat->row_before_group_space;
}
SkinDrawGlyphMask( pc.hdcMem, &mrc, rcPaint, mpRequest );
}
@@ -2038,9 +2038,9 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo RECT mrc = row_rc;
if ( Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing )
+ Drawing->group->parent->cl.items[0] !=Drawing )
{
- mrc.top+= dat->row_before_group_space;
+ mrc.top += dat->row_before_group_space;
}
// Selection background ( only if hole line - full/less )
if ( dat->HiLightMode == 1 ) // Full or default
@@ -2048,14 +2048,14 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo if ( selected )
SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL , ID = Selection " );
if ( hottrack )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking" );
+ SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID = HotTracking" );
}
else if ( dat->HiLightMode == 2 ) // Less
{
if ( selected )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection" ); //instead of free_row_rc
+ SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID = Selection" ); //instead of free_row_rc
if ( hottrack )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking" );
+ SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID = HotTracking" );
}
}
@@ -2077,7 +2077,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo {
int i = y;
int row_height = row_rc.bottom-row_rc.top;
- for ( i = y; i<y+row_height; i+= max( dat->row_min_heigh, 1 ))
+ for ( i = y; i < y+row_height; i += max( dat->row_min_heigh, 1 ))
{
ImageList_DrawEx( dat->himlHighlight, 0, pc.hdcMem, 0, i, clRect.right,
min( y+row_height-i, max( dat->row_min_heigh, 1 )), CLR_NONE, CLR_NONE,
@@ -2091,7 +2091,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo {
int i;
int row_height = row_rc.bottom-row_rc.top-1;
- for ( i = y+1; i<y+row_height; i+= max( dat->row_min_heigh, 1 ))
+ for ( i = y+1; i < y+row_height; i += max( dat->row_min_heigh, 1 ))
{
ImageList_DrawEx( dat->himlHighlight, 0, pc.hdcMem, 1, i, clRect.right-2,
min( y+row_height-i, max( dat->row_min_heigh, 1 )), CLR_NONE, CLR_NONE,
@@ -2104,7 +2104,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo }
}
- // **** Checkboxes
+ //**** Checkboxes
if ( ( lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT ) ||
( lStyle&CLS_GROUPCHECKBOXES && Drawing->type == CLCIT_GROUP ) ||
( Drawing->type == CLCIT_INFO && Drawing->flags&CLCIIF_CHECKBOX ))
@@ -2112,17 +2112,17 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo //RECT rc;
rc = free_row_rc;
rc.right = rc.left + dat->checkboxSize;
- rc.top += ( rc.bottom - rc.top - dat->checkboxSize ) >> 1;
+ rc.top += ( rc.bottom - rc.top - dat->checkboxSize ) >> 1;
rc.bottom = rc.top + dat->checkboxSize;
- if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, 0 );
+ if ( dat->text_rtl !=0 ) _RTLRect( &rc, free_row_rc.right, 0 );
if ( xpt_IsThemed( dat->hCheckBoxTheme )) {
xpt_DrawThemeBackground( dat->hCheckBoxTheme, pc.hdcMem, BP_CHECKBOX, Drawing->flags&CONTACTF_CHECKED?( hottrack?CBS_CHECKEDHOT:CBS_CHECKEDNORMAL ):( hottrack?CBS_UNCHECKEDHOT:CBS_UNCHECKEDNORMAL ), &rc, &rc );
}
else DrawFrameControl( pc.hdcMem, &rc, DFC_BUTTON, DFCS_BUTTONCHECK|DFCS_FLAT|( Drawing->flags&CONTACTF_CHECKED?DFCS_CHECKED:0 )|( hottrack?DFCS_HOT:0 ));
- left_pos += dat->checkboxSize + EXTRA_CHECKBOX_SPACE + HORIZONTAL_SPACE;
+ left_pos += dat->checkboxSize + EXTRA_CHECKBOX_SPACE + HORIZONTAL_SPACE;
free_row_rc.left = row_rc.left + left_pos;
// Store pos
@@ -2139,9 +2139,9 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo RECT mrc = row_rc;
if ( Drawing->type == CLCIT_GROUP &&
Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing )
+ Drawing->group->parent->cl.items[0] !=Drawing )
{
- mrc.top+= dat->row_before_group_space;
+ mrc.top += dat->row_before_group_space;
}
SkinDrawGlyphMask( pc.hdcMem, &mrc, rcPaint, mpRequest );
}
@@ -2151,18 +2151,18 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo }
}
}
- y += dat->row_heights[line_num];
+ y += dat->row_heights[line_num];
//increment by subcontacts
- if ( ( group->cl.items && group->scanIndex<group->cl.count && group->cl.items[group->scanIndex]->subcontacts != NULL && group->cl.items[group->scanIndex]->type != CLCIT_GROUP )
+ if ( ( group->cl.items && group->scanIndex < group->cl.count && group->cl.items[group->scanIndex]->subcontacts !=NULL && group->cl.items[group->scanIndex]->type !=CLCIT_GROUP )
&& ( group->cl.items[group->scanIndex]->SubExpanded && dat->expandMeta ))
{
- if ( subindex<group->cl.items[group->scanIndex]->SubAllocated-1 )
+ if ( subindex < group->cl.items[group->scanIndex]->SubAllocated-1 )
subindex++;
else
subindex = -1;
}
- if ( subindex == -1 && group->scanIndex<group->cl.count )
+ if ( subindex == -1 && group->scanIndex < group->cl.count )
{
if ( group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded )
{
@@ -2174,7 +2174,7 @@ void CLCPaint::_DrawLines( HWND hWnd, struct ClcData * dat, HDC hdc, int paintMo }
group->scanIndex++;
}
- else if ( group->scanIndex>= group->cl.count )
+ else if ( group->scanIndex >= group->cl.count )
{
subindex = -1;
}
@@ -2192,7 +2192,7 @@ void CLCPaint::_DrawInsertionMark( struct ClcData * dat, RECT& clRect, _PaintCon int yt = cliGetRowTopY( dat, dat->iInsertionMark );
pts[0].y = yt - dat->yScroll - 4;
- if ( pts[0].y<-3 ) pts[0].y = -3;
+ if ( pts[0].y < -3 ) pts[0].y = -3;
pts[0].x = 1+identation*( dat->text_rtl?0:1 );
pts[1].x = pts[0].x+2;
@@ -2224,7 +2224,7 @@ void CLCPaint::_CopyPaintToDest( HWND hWnd, struct ClcData * dat, HDC hdc, int p BitBlt( hdc, rcPaint->left, rcPaint->top, rcPaint->right-rcPaint->left, rcPaint->bottom-rcPaint->top, pc.hdcMem, rcPaint->left, rcPaint->top, SRCCOPY );
}
- if ( ( paintMode&DM_GRAY ) && hdc && hdc != pc.hdcMem )
+ if ( ( paintMode&DM_GRAY ) && hdc && hdc !=pc.hdcMem )
{
BLENDFUNCTION bf = {AC_SRC_OVER, 0, 80, AC_SRC_ALPHA };
BOOL a = ( ( paintMode&DM_GRAY ) && ( ( paintMode&DM_NON_LAYERED)) );
@@ -2280,7 +2280,7 @@ void CLCPaint::_PaintClc( HWND hwnd, struct ClcData *dat, HDC hdc, RECT *_rcPain _DrawLines( hwnd, dat, hdc, paintMode, rcPaint, clRect, pc );
//insertion mark
- if ( dat->iInsertionMark != -1 )
+ if ( dat->iInsertionMark !=-1 )
_DrawInsertionMark( dat, clRect, pc );
// BitBlt from memory to destination
@@ -2338,7 +2338,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct // Now let's check what we have to draw
for ( item_iterator = 0 ; item_iterator < NUM_ITEM_TYPE && free_row_rc.left < free_row_rc.right ; item_iterator++ )
{
- if ( Drawing->ext_nItemsNum>= SIZEOF( Drawing->ext_mpItemsDesc )) break;
+ if ( Drawing->ext_nItemsNum >= SIZEOF( Drawing->ext_mpItemsDesc )) break;
if ( left )
item = item_iterator;
else
@@ -2353,7 +2353,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct int width;
int height;
BOOL miniMode;
- if ( !dat->avatars_show || Drawing->type != CLCIT_CONTACT )
+ if ( !dat->avatars_show || Drawing->type !=CLCIT_CONTACT )
break;
miniMode = CheckMiniMode( dat, selected, hottrack );
AniAva_InvalidateAvatarPositions( Drawing->hContact );
@@ -2370,7 +2370,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct // Don't have to draw avatar
// Has to draw icon instead?
- if ( dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && Drawing->iImage != -1 )
+ if ( dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && Drawing->iImage !=-1 )
{
RECT rc;
@@ -2381,8 +2381,8 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct if ( rc.left < rc.right )
{
/* center icon in avatar place */
- if ( rc.right-rc.left>16 ) rc.left+= ( ( ( rc.right-rc.left )-16 )>>1 );
- if ( rc.bottom-rc.top>16 ) rc.top+= ( ( ( rc.bottom-rc.top )-16 )>>1 );
+ if ( rc.right-rc.left>16 ) rc.left += ( ( ( rc.right-rc.left )-16 )>>1 );
+ if ( rc.bottom-rc.top>16 ) rc.top += ( ( ( rc.bottom-rc.top )-16 )>>1 );
// Store position
_StoreItemPos( Drawing, CIT_ICON, &rc );
@@ -2435,8 +2435,8 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct {
RECT rc;
int iImage = -1;
- BOOL has_avatar = ( ( dat->use_avatar_service && Drawing->avatar_data != NULL ) ||
- ( !dat->use_avatar_service && Drawing->avatar_pos != AVATAR_POS_DONT_HAVE ))
+ BOOL has_avatar = ( ( dat->use_avatar_service && Drawing->avatar_data !=NULL ) ||
+ ( !dat->use_avatar_service && Drawing->avatar_pos !=AVATAR_POS_DONT_HAVE ))
&& !( CheckMiniMode( dat, selected, hottrack ));
if ( Drawing->type == CLCIT_CONTACT
@@ -2464,7 +2464,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct && ( !Drawing->image_is_special || !has_avatar ||
(
dat->avatars_draw_overlay
- && dat->avatars_maxheight_size >= ICON_HEIGHT + ( dat->avatars_draw_border ? 2 : 0 )
+ && dat->avatars_maxheight_size >= ICON_HEIGHT + ( dat->avatars_draw_border ? 2 : 0 )
&& GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE < MAX_REGS( g_pAvatarOverlayIcons )
&& dat->avatars_overlay_type == SETTING_AVATAR_OVERLAY_TYPE_CONTACT
)) )
@@ -2481,7 +2481,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct iImage = Drawing->iImage;
// Has image to draw?
- if ( iImage != -1 )
+ if ( iImage !=-1 )
{
// Make rectangle
rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
@@ -2534,7 +2534,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct // Store init text position:
text_left_pos = left_pos;
- left_pos += MIN_TEXT_WIDTH;
+ left_pos += MIN_TEXT_WIDTH;
free_row_rc.left = row_rc.left + left_pos;
item_text = item;
@@ -2550,9 +2550,9 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct int count = 0;
RECT rc;
- for ( iImage = dat->extraColumnsCount-1 ; iImage >= 0 ; iImage -- )
+ for ( iImage = dat->extraColumnsCount-1 ; iImage >= 0 ; iImage -- )
{
- if ( Drawing->iExtraImage[iImage] != 0xFF || Drawing->iWideExtraImage[iImage] != 0xFFFF || !dat->MetaIgnoreEmptyExtra )
+ if ( Drawing->iExtraImage[iImage] !=0xFF || Drawing->iWideExtraImage[iImage] !=0xFFFF || !dat->MetaIgnoreEmptyExtra )
{
rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
left, dat->extraColumnSpacing, dat->extraColumnSpacing, ICON_HEIGHT, 0 );
@@ -2606,8 +2606,8 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct // Get rect
text_rc = free_row_rc;
- free_height -= text_size.cy;
- text_rc.top += free_height >> 1;
+ free_height -= text_size.cy;
+ text_rc.top += free_height >> 1;
text_rc.bottom = text_rc.top + text_size.cy;
if ( dat->text_align_right )
@@ -2664,7 +2664,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct }
// Get rect
- free_height -= max( text_size.cy, counts_size.cy );
+ free_height -= max( text_size.cy, counts_size.cy );
text_rc.top = free_row_rc.top + ( free_height >> 1 );
text_rc.bottom = text_rc.top + max( text_size.cy, counts_size.cy );
@@ -2728,7 +2728,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct // Get rect
tmp = min( free_height, dat->second_line_top_space + second_line_text_size.cy );
- free_height -= tmp;
+ free_height -= tmp;
text_rc.top = free_row_rc.top + ( free_height >> 1 );
text_rc.bottom = text_rc.top + free_row_rc.bottom - free_row_rc.top - free_height;
@@ -2751,7 +2751,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
pdnce->szThirdLineText = mir_tstrdup( buf );
}
- if ( dat->third_line_show && pdnce->szThirdLineText != NULL && pdnce->szThirdLineText[0]
+ if ( dat->third_line_show && pdnce->szThirdLineText !=NULL && pdnce->szThirdLineText[0]
&& free_height > dat->third_line_top_space )
{
//RECT rc_tmp = free_row_rc;
@@ -2765,7 +2765,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct // Get rect
tmp = min( free_height, dat->third_line_top_space + third_line_text_size.cy );
- free_height -= tmp;
+ free_height -= tmp;
text_rc.top = free_row_rc.top + ( free_height >> 1 );
text_rc.bottom = text_rc.top + free_row_rc.bottom - free_row_rc.top - free_height;
@@ -2811,14 +2811,14 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct //devider
RECT trc = free_row_rc;
RECT rc = free_row_rc;
- rc.top += ( rc.bottom - rc.top ) >> 1;
+ rc.top += ( rc.bottom - rc.top ) >> 1;
rc.bottom = rc.top + 2;
rc.right = rc.left + ( ( rc.right - rc.left - text_size.cx )>>1 ) - 3;
trc.left = rc.right + 3;
trc.right = trc.left + text_size.cx + 6;
if ( text_size.cy < trc.bottom - trc.top )
{
- trc.top += ( trc.bottom - trc.top - text_size.cy ) >> 1;
+ trc.top += ( trc.bottom - trc.top - text_size.cy ) >> 1;
trc.bottom = trc.top + text_size.cy;
}
_StoreItemPos( Drawing, CIT_TEXT, &trc );
@@ -2839,7 +2839,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct if ( text_size.cy < rc.bottom - rc.top )
{
- rc.top += ( rc.bottom - rc.top - text_size.cy ) >> 1;
+ rc.top += ( rc.bottom - rc.top - text_size.cy ) >> 1;
rc.bottom = rc.top + text_size.cy;
}
@@ -2858,7 +2858,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct if ( counts_size.cy < counts_rc.bottom - counts_rc.top )
{
- counts_rc.top += ( counts_rc.bottom - counts_rc.top - counts_size.cy + 1 ) >> 1;
+ counts_rc.top += ( counts_rc.bottom - counts_rc.top - counts_size.cy + 1 ) >> 1;
counts_rc.bottom = counts_rc.top + counts_size.cy;
}
// Draw counts
@@ -2883,14 +2883,14 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct else
rc.right = rc.left + text_size.cx;
}
- uTextFormat|= DT_VCENTER;
+ uTextFormat |= DT_VCENTER;
_StoreItemPos( Drawing, CIT_TEXT, &rc );
free_rc.top = rc.bottom;
}
- uTextFormat&= ~DT_VCENTER;
+ uTextFormat &= ~DT_VCENTER;
if ( second_line_text_size.cx > 0 && free_rc.bottom > free_rc.top )
{
- free_rc.top += dat->second_line_top_space;
+ free_rc.top += dat->second_line_top_space;
if ( free_rc.bottom > free_rc.top )
{
@@ -2911,7 +2911,7 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, struct ClcData *dat, struct if ( third_line_text_size.cx > 0 && free_rc.bottom > free_rc.top )
{
- free_rc.top += dat->third_line_top_space;
+ free_rc.top += dat->third_line_top_space;
if ( free_rc.bottom > free_rc.top )
{
@@ -2978,7 +2978,7 @@ void CLCPaint::_GetBlendMode( IN struct ClcData *dat, IN struct ClcContact * Dra mode = ILD_NORMAL;
}
if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE &&
+ _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) !=ID_STATUS_OFFLINE &&
( bFlag&GIM_IDLE_AFFECT )
)
mode = ILD_SELECTED;
@@ -2999,7 +2999,7 @@ void CLCPaint::_DrawContactAvatar( HDC hdcMem, struct ClcData *dat, struct ClcCo {
int overlayIdx = -1;
int blendmode = 255;
- if ( dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + ( dat->avatars_draw_border ? 2 : 0 )
+ if ( dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + ( dat->avatars_draw_border ? 2 : 0 )
&& GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE < MAX_REGS( g_pAvatarOverlayIcons ))
{
switch( dat->avatars_overlay_type )
@@ -3041,8 +3041,8 @@ void CLCPaint::_DrawContactAvatar( HDC hdcMem, struct ClcData *dat, struct ClcCo {
HBRUSH hBrush = CreateSolidBrush( dat->avatars_border_color );
HBRUSH hOldBrush = ( HBRUSH )SelectObject( hdcMem, hBrush );
- HRGN rgnOutside = CreateRoundRectRgn( prcItem->left, prcItem->top, prcItem->right+1, prcItem->bottom+1, round_radius<<1, round_radius<<1 );
- HRGN rgnInside = CreateRoundRectRgn( prcItem->left+1, prcItem->top+1, prcItem->right, prcItem->bottom, round_radius<<1, round_radius<<1 );
+ HRGN rgnOutside = CreateRoundRectRgn( prcItem->left, prcItem->top, prcItem->right+1, prcItem->bottom+1, round_radius << 1, round_radius << 1 );
+ HRGN rgnInside = CreateRoundRectRgn( prcItem->left+1, prcItem->top+1, prcItem->right, prcItem->bottom, round_radius << 1, round_radius << 1 );
CombineRgn( rgnOutside, rgnOutside, rgnInside, RGN_DIFF );
FillRgn( hdcMem, rgnOutside, hBrush );
ske_SetRgnOpaque( hdcMem, rgnOutside );
@@ -3071,7 +3071,7 @@ void CLCPaint::_DrawContactAvatar( HDC hdcMem, struct ClcData *dat, struct ClcCo SelectClipRgn( hdcMem, rgn );
DeleteObject( rgn );
// Draw overlays
- if ( dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + ( dat->avatars_draw_border ? 2 : 0 )
+ if ( dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + ( dat->avatars_draw_border ? 2 : 0 )
&& GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE < MAX_REGS( g_pAvatarOverlayIcons ))
{
POINT ptOverlay = { prcItem->right-ICON_HEIGHT, prcItem->bottom-ICON_HEIGHT };
@@ -3097,7 +3097,7 @@ void CLCPaint::_DrawContactAvatar( HDC hdcMem, struct ClcData *dat, struct ClcCo item = ExtIconFromStatusMode( Drawing->hContact, Drawing->proto,
Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus( Drawing->hContact ));
- if ( item != -1 )
+ if ( item !=-1 )
_DrawStatusIcon( Drawing, dat, item, hdcMem,
ptOverlay.x, ptOverlay.y, ICON_HEIGHT, ICON_HEIGHT,
CLR_NONE, CLR_NONE, ( blendmode == 255 )?ILD_NORMAL:( blendmode == 128 )?ILD_BLEND50:ILD_BLEND25 );
@@ -3105,7 +3105,7 @@ void CLCPaint::_DrawContactAvatar( HDC hdcMem, struct ClcData *dat, struct ClcCo }
case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
{
- if ( Drawing->iImage != -1 )
+ if ( Drawing->iImage !=-1 )
_DrawStatusIcon( Drawing, dat, Drawing->iImage, hdcMem,
ptOverlay.x, ptOverlay.y, ICON_HEIGHT, ICON_HEIGHT,
CLR_NONE, CLR_NONE, ( blendmode == 255 )?ILD_NORMAL:( blendmode == 128 )?ILD_BLEND50:ILD_BLEND25 );
@@ -3130,7 +3130,7 @@ void CLCPaint::_DrawContactIcon( HDC hdcMem, struct ClcData *dat, struct ClcCont iImage = Drawing->iImage;
// Has image to draw?
- if ( iImage != -1 )
+ if ( iImage !=-1 )
{
COLORREF colourFg;
int mode;
@@ -3152,7 +3152,7 @@ void CLCPaint::_DrawContactText( HDC hdcMem, struct ClcData *dat, struct ClcCont if ( Drawing->type == CLCIT_GROUP )
{
ske_DrawText( hdcMem, Drawing->szText, -1, prcItem, uTextFormat );
- if ( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] !='\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
ske_DrawText( hdcMem, Drawing->szText, lstrlen( dat->szQuickSearch ), prcItem, uTextFormat );
@@ -3163,10 +3163,10 @@ void CLCPaint::_DrawContactText( HDC hdcMem, struct ClcData *dat, struct ClcCont SIZE text_size;
text_size.cx = _rcWidth( prcItem );
text_size.cy = _rcHeight( prcItem );
- uTextFormat|= DT_VCENTER;
+ uTextFormat |= DT_VCENTER;
//get font
_DrawTextSmiley( hdcMem, prcItem, &text_size, Drawing->szText, -1, Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if ( selected && dat->szQuickSearch[0] != '\0' )
+ if ( selected && dat->szQuickSearch[0] !='\0' )
{
SetTextColor( hdcMem, dat->quickSearchColour );
_DrawTextSmiley( hdcMem, prcItem, &text_size, Drawing->szText, lstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
@@ -3209,7 +3209,7 @@ void CLCPaint::_DrawContactSubText( HDC hdcMem, struct ClcData *dat, struct ClcC SetTextColor( hdcMem, dat->selTextColour );
else if ( hottrack )
_SetHotTrackColour( hdcMem, dat );
- uTextFormat|= DT_VCENTER;
+ uTextFormat |= DT_VCENTER;
if ( itemType == CIT_SUBTEXT1 )
_DrawTextSmiley( hdcMem, prcItem, &text_size, pdnce->szSecondLineText, -1, pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys );
else
@@ -3251,13 +3251,13 @@ void CLCPaint::_DrawContactExtraIcon( HDC hdcMem, struct ClcData *dat, struct Cl //Draw extra icon
COLORREF colourFg;
int mode;
- if ( iImage != -1 )
+ if ( iImage !=-1 )
{
_GetBlendMode( dat, Drawing, selected, hottrack, GIM_EXTRAICON_AFFECT, &colourFg, &mode );
- if ( Drawing->iExtraImage[iImage] != 0xFF )
+ if ( Drawing->iExtraImage[iImage] !=0xFF )
ske_ImageList_DrawEx( dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
rc->left, rc->top, 0, 0, CLR_NONE, colourFg, mode );
- else if ( Drawing->iWideExtraImage[iImage] != 0xFFFF )
+ else if ( Drawing->iWideExtraImage[iImage] !=0xFFFF )
ske_ImageList_DrawEx( dat->himlWideExtraColumns, Drawing->iWideExtraImage[iImage], hdcMem,
rc->left, rc->top, 0, 0, CLR_NONE, colourFg, mode );
}
@@ -3269,9 +3269,9 @@ void CLCPaint::_DrawContactLine( HDC hdcMem, struct ClcData *dat, struct ClcCont RECT rc2 = *free_row_rc;
rc1.right = text_rc.left-3;
rc2.left = text_rc.right+3;
- rc1.top += ( rc1.bottom - rc1.top ) >> 1;
+ rc1.top += ( rc1.bottom - rc1.top ) >> 1;
rc1.bottom = rc1.top + 2;
- rc2.top += ( rc2.bottom - rc2.top ) >> 1;
+ rc2.top += ( rc2.bottom - rc2.top ) >> 1;
rc2.bottom = rc2.top + 2;
{
RECT rcTemp = rc1;
@@ -3286,7 +3286,7 @@ void CLCPaint::_DrawContactLine( HDC hdcMem, struct ClcData *dat, struct ClcCont if ( !IsRectEmpty( &rcTemp )) rc2.left = rcTemp.right;
}
- if ( rc1.right-rc1.left>= 6 && !IsRectEmpty( &rc1 ))
+ if ( rc1.right-rc1.left >= 6 && !IsRectEmpty( &rc1 ))
{
DrawEdge( hdcMem, &rc1, BDR_SUNKENOUTER, BF_RECT );
ske_SetRectOpaque( hdcMem, &rc1 );
@@ -3295,7 +3295,7 @@ void CLCPaint::_DrawContactLine( HDC hdcMem, struct ClcData *dat, struct ClcCont RECT rcTemp = rc2;
IntersectRect( &rc2, &rcTemp, rcPaint );
}
- if ( rc2.right-rc2.left>= 6 && !IsRectEmpty( &rc2 ))
+ if ( rc2.right-rc2.left >= 6 && !IsRectEmpty( &rc2 ))
{
DrawEdge( hdcMem, &rc2, BDR_SUNKENOUTER, BF_RECT );
ske_SetRectOpaque( hdcMem, &rc2 );
@@ -3319,7 +3319,7 @@ void CLCPaint::_DrawContactItems( HWND hwnd, HDC hdcMem, struct ClcData *dat, st text_rc.right = row_rc->left;
text_rc.left = row_rc->right;
- for ( i = 0; i<Drawing->ext_nItemsNum; i++ )
+ for ( i = 0; i < Drawing->ext_nItemsNum; i++ )
{
RECT * prcItem = &( Drawing->ext_mpItemsDesc[i].itemRect );
if ( __IsVisible( rcPaint, prcItem ) || ( Drawing->ext_mpItemsDesc[i].itemType == CIT_AVATAR && Drawing->avatar_pos == AVATAR_POS_ANIMATED ))
diff --git a/plugins/Clist_modern/modern_clcutils.cpp b/plugins/Clist_modern/modern_clcutils.cpp index 6a30eefd71..cc99840039 100644 --- a/plugins/Clist_modern/modern_clcutils.cpp +++ b/plugins/Clist_modern/modern_clcutils.cpp @@ -30,77 +30,77 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. BOOL RectHitTest(RECT *rc, int testx, int testy)
{
- return testx >= rc->left && testx < rc->right && testy >= rc->top && testy < rc->bottom;
+ return testx >= rc->left && testx < rc->right && testy >= rc->top && testy < rc->bottom;
}
int cliHitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcContact **contact,struct ClcGroup **group,DWORD *flags)
{
- struct ClcContact *hitcontact=NULL;
- struct ClcGroup *hitgroup=NULL;
- int hit=-1;
+ struct ClcContact *hitcontact = NULL;
+ struct ClcGroup *hitgroup = NULL;
+ int hit = -1;
RECT clRect;
- if (CLUI_TestCursorOnBorders()!=0)
+ if (CLUI_TestCursorOnBorders() != 0)
{
- if(flags) *flags=CLCHT_NOWHERE;
+ if (flags) *flags = CLCHT_NOWHERE;
return -1;
}
- if(flags) *flags=0;
+ if (flags) *flags = 0;
GetClientRect(hwnd,&clRect);
- if(testx<0 || testy<0 || testy>=clRect.bottom || testx>=clRect.right) {
- if(flags) {
- if(testx<0) *flags|=CLCHT_TOLEFT;
- else if(testx>=clRect.right) *flags|=CLCHT_TORIGHT;
- if(testy<0) *flags|=CLCHT_ABOVE;
- else if(testy>=clRect.bottom) *flags|=CLCHT_BELOW;
+ if (testx < 0 || testy < 0 || testy >= clRect.bottom || testx >= clRect.right) {
+ if (flags) {
+ if (testx < 0) *flags |= CLCHT_TOLEFT;
+ else if (testx >= clRect.right) *flags |= CLCHT_TORIGHT;
+ if (testy < 0) *flags |= CLCHT_ABOVE;
+ else if (testy >= clRect.bottom) *flags |= CLCHT_BELOW;
}
return -1;
}
- if(testx<dat->leftMargin) {
- if(flags) *flags|=CLCHT_INLEFTMARGIN|CLCHT_NOWHERE;
+ if (testx < dat->leftMargin) {
+ if (flags) *flags |= CLCHT_INLEFTMARGIN|CLCHT_NOWHERE;
return -1;
}
// Get hit item
hit = cliRowHitTest(dat, dat->yScroll + testy);
- if (hit != -1)
+ if (hit !=-1)
hit = cliGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
- if(hit==-1) {
- if(flags) *flags|=CLCHT_NOWHERE|CLCHT_BELOWITEMS;
+ if (hit == -1) {
+ if (flags) *flags |= CLCHT_NOWHERE|CLCHT_BELOWITEMS;
return -1;
}
- if(contact) *contact=hitcontact;
- if(group) *group=hitgroup;
+ if (contact) *contact = hitcontact;
+ if (group) *group = hitgroup;
/////////
- if ( ((testx<hitcontact->pos_indent) && !dat->text_rtl) ||
+ if ( ((testx < hitcontact->pos_indent) && !dat->text_rtl) ||
((testx>clRect.right-hitcontact->pos_indent) && dat->text_rtl))
{
- if(flags) *flags|=CLCHT_ONITEMINDENT;
+ if (flags) *flags |= CLCHT_ONITEMINDENT;
return hit;
}
if (RectHitTest(&hitcontact->pos_check, testx, testy))
{
- if(flags) *flags|=CLCHT_ONITEMCHECK;
+ if (flags) *flags |= CLCHT_ONITEMCHECK;
return hit;
}
if (RectHitTest(&hitcontact->pos_avatar, testx, testy))
{
- if(flags) *flags|=CLCHT_ONITEMICON;
+ if (flags) *flags |= CLCHT_ONITEMICON;
return hit;
}
if (RectHitTest(&hitcontact->pos_icon, testx, testy))
{
- if(flags) *flags|=CLCHT_ONITEMICON;
+ if (flags) *flags |= CLCHT_ONITEMICON;
return hit;
}
// if (testx>hitcontact->pos_extra) {
- // if(flags)
+ // if (flags)
{
// int c = -1;
int i;
@@ -108,49 +108,49 @@ int cliHitTest(HWND hwnd,struct ClcData *dat,int testx,int testy,struct ClcConta {
if (RectHitTest(&hitcontact->pos_extra[i], testx, testy))
{
- if(flags) *flags|=CLCHT_ONITEMEXTRA|(i<<24);
+ if (flags) *flags |= CLCHT_ONITEMEXTRA|(i << 24);
return hit;
}
}
}
- if (dat->HiLightMode==1)
+ if (dat->HiLightMode == 1)
{
- if(flags) *flags|=CLCHT_ONITEMLABEL;
+ if (flags) *flags |= CLCHT_ONITEMLABEL;
return hit;
}
if (RectHitTest(&hitcontact->pos_label, testx, testy))
{
- if(flags) *flags|=CLCHT_ONITEMLABEL;
+ if (flags) *flags |= CLCHT_ONITEMLABEL;
return hit;
}
- if(flags) *flags|=CLCHT_NOWHERE;
+ if (flags) *flags |= CLCHT_NOWHERE;
return hit;
}
void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth)
{
DWORD startTick,nowTick;
- int oldy=dat->yScroll;
+ int oldy = dat->yScroll;
RECT clRect,rcInvalidate;
int maxy,previousy;
- if(dat->iHotTrack!=-1 && dat->yScroll != desty) {
+ if (dat->iHotTrack != -1 && dat->yScroll !=desty) {
pcli->pfnInvalidateItem(hwnd,dat,dat->iHotTrack);
- dat->iHotTrack=-1;
+ dat->iHotTrack = -1;
ReleaseCapture();
}
GetClientRect(hwnd,&clRect);
- rcInvalidate=clRect;
- //maxy=dat->rowHeight*GetGroupContentsCount(&dat->list,2)-clRect.bottom;
- maxy=cliGetRowTotalHeight(dat)-clRect.bottom;
- 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;
- previousy=dat->yScroll;
+ rcInvalidate = clRect;
+ //maxy = dat->rowHeight*GetGroupContentsCount(&dat->list,2)-clRect.bottom;
+ maxy = cliGetRowTotalHeight(dat)-clRect.bottom;
+ 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;
+ previousy = dat->yScroll;
BOOL keyDown = ( ( GetKeyState( VK_UP )
| GetKeyState( VK_DOWN )
@@ -163,26 +163,26 @@ void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth) if (!noSmooth && !keyDown)
{
- startTick=GetTickCount();
+ startTick = GetTickCount();
for (;;) {
- nowTick=GetTickCount();
- if(nowTick>=startTick+dat->scrollTime) break;
- dat->yScroll=oldy+(desty-oldy)*(int)(nowTick-startTick)/dat->scrollTime;
- if (/*dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground==NULL &&*/FALSE)
+ nowTick = GetTickCount();
+ if (nowTick >= startTick+dat->scrollTime) break;
+ dat->yScroll = oldy+(desty-oldy)*(int)(nowTick-startTick)/dat->scrollTime;
+ if (/*dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground == NULL &&*/FALSE)
ScrollWindowEx(hwnd,0,previousy-dat->yScroll,NULL,NULL,NULL,NULL,SW_INVALIDATE);
else
{
CallService(MS_SKINENG_UPTATEFRAMEIMAGE,(WPARAM) hwnd, (LPARAM) 0);
//InvalidateRectZ(hwnd,NULL,FALSE);
}
- previousy=dat->yScroll;
+ previousy = dat->yScroll;
SetScrollPos(hwnd,SB_VERT,dat->yScroll,TRUE);
CallService(MS_SKINENG_UPTATEFRAMEIMAGE,(WPARAM) hwnd, (LPARAM) 0);
UpdateWindow(hwnd);
}
}
- dat->yScroll=desty;
- if ((dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground==NULL) && FALSE)
+ dat->yScroll = desty;
+ if ((dat->backgroundBmpUse&CLBF_SCROLL || dat->hBmpBackground == NULL) && FALSE)
ScrollWindowEx(hwnd,0,previousy-dat->yScroll,NULL,NULL,NULL,NULL,SW_INVALIDATE);
else
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
@@ -192,7 +192,7 @@ void cliScrollTo(HWND hwnd,struct ClcData *dat,int desty,int noSmooth) void cliRecalcScrollBar(HWND hwnd,struct ClcData *dat)
{
- SCROLLINFO si={0};
+ SCROLLINFO si = {0};
RECT clRect;
NMCLISTCONTROL nm;
if (LOCK_RECALC_SCROLLBAR) return;
@@ -200,37 +200,37 @@ void cliRecalcScrollBar(HWND hwnd,struct ClcData *dat) RowHeights_CalcRowHeights(dat, hwnd);
GetClientRect(hwnd,&clRect);
- si.cbSize=sizeof(si);
- si.fMask=SIF_ALL;
- si.nMin=0;
- si.nMax=cliGetRowTotalHeight(dat)-1;
- si.nPage=clRect.bottom;
- si.nPos=dat->yScroll;
-
- nm.hdr.code=CLN_LISTSIZECHANGE;
- nm.hdr.hwndFrom=hwnd;
- nm.hdr.idFrom=0;//GetDlgCtrlID(hwnd);
- nm.pt.y=si.nMax;
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_ALL;
+ si.nMin = 0;
+ si.nMax = cliGetRowTotalHeight(dat)-1;
+ si.nPage = clRect.bottom;
+ si.nPos = dat->yScroll;
+
+ nm.hdr.code = CLN_LISTSIZECHANGE;
+ nm.hdr.hwndFrom = hwnd;
+ nm.hdr.idFrom = 0;//GetDlgCtrlID(hwnd);
+ nm.pt.y = si.nMax;
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&nm); //post
GetClientRect(hwnd,&clRect);
- si.cbSize=sizeof(si);
- si.fMask=SIF_ALL;
- si.nMin=0;
- si.nMax=cliGetRowTotalHeight(dat)-1;
- si.nPage=clRect.bottom;
- si.nPos=dat->yScroll;
+ si.cbSize = sizeof(si);
+ si.fMask = SIF_ALL;
+ si.nMin = 0;
+ si.nMax = cliGetRowTotalHeight(dat)-1;
+ si.nPage = clRect.bottom;
+ si.nPos = dat->yScroll;
if ( GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_CONTACTLIST ) {
- if ( dat->noVScrollbar==0 ) SetScrollInfo(hwnd,SB_VERT,&si,TRUE);
+ if ( dat->noVScrollbar == 0 ) SetScrollInfo(hwnd,SB_VERT,&si,TRUE);
//else SetScrollInfo(hwnd,SB_VERT,&si,FALSE);
}
else
SetScrollInfo(hwnd,SB_VERT,&si,TRUE);
- g_mutex_bSizing=1;
+ g_mutex_bSizing = 1;
cliScrollTo(hwnd,dat,dat->yScroll,1);
- g_mutex_bSizing=0;
+ g_mutex_bSizing = 0;
}
@@ -251,11 +251,11 @@ static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPara }
break;
case WM_GETDLGCODE:
- if(lParam)
+ if (lParam)
{
- MSG *msg=(MSG*)lParam;
- if(msg->message==WM_KEYDOWN && msg->wParam==VK_TAB) return 0;
- if(msg->message==WM_CHAR && msg->wParam=='\t') return 0;
+ MSG *msg = (MSG*)lParam;
+ if (msg->message == WM_KEYDOWN && msg->wParam == VK_TAB) return 0;
+ if (msg->message == WM_CHAR && msg->wParam == '\t') return 0;
}
return DLGC_WANTMESSAGE;
case WM_KILLFOCUS:
@@ -277,26 +277,26 @@ void cliBeginRenameSelection(HWND hwnd,struct ClcData *dat) KillTimer(hwnd,TIMERID_RENAME);
ReleaseCapture();
- dat->iHotTrack=-1;
- dat->selection=cliGetRowByIndex(dat,dat->selection,&contact,&group);
- if(dat->selection==-1) return;
- if(contact->type!=CLCIT_CONTACT && contact->type!=CLCIT_GROUP) return;
+ dat->iHotTrack = -1;
+ dat->selection = cliGetRowByIndex(dat,dat->selection,&contact,&group);
+ if (dat->selection == -1) return;
+ if (contact->type != CLCIT_CONTACT && contact->type != CLCIT_GROUP) return;
- if (contact->type==CLCIT_CONTACT && contact->isSubcontact)
- subident=dat->subIndent;
+ if (contact->type == CLCIT_CONTACT && contact->isSubcontact)
+ subident = dat->subIndent;
else
- subident=0;
+ subident = 0;
- for(indent=0;group->parent;indent++,group=group->parent);
+ for(indent = 0;group->parent;indent++,group = group->parent);
GetClientRect(hwnd,&clRect);
- x=indent*dat->groupIndent+dat->iconXSpace-2+subident;
- w=clRect.right-x;
- y=cliGetRowTopY(dat, dat->selection)-dat->yScroll;
- h=dat->row_heights[dat->selection];
+ x = indent*dat->groupIndent+dat->iconXSpace-2+subident;
+ w = clRect.right-x;
+ y = cliGetRowTopY(dat, dat->selection)-dat->yScroll;
+ h = dat->row_heights[dat->selection];
{
int i;
- for (i=0; i<=FONTID_MODERN_MAX; i++)
- if (h<dat->fontModernInfo[i].fontHeight+4) h=dat->fontModernInfo[i].fontHeight+4;
+ for (i = 0; i <= FONTID_MODERN_MAX; i++)
+ if (h < dat->fontModernInfo[i].fontHeight+4) h = dat->fontModernInfo[i].fontHeight+4;
}
//TODO contact->pos_label
@@ -306,44 +306,44 @@ void cliBeginRenameSelection(HWND hwnd,struct ClcData *dat) RECT rectW;
int h2;
GetWindowRect(hwnd,&rectW);
- // w=contact->pos_full_first_row.right-contact->pos_full_first_row.left;
- // h=contact->pos_full_first_row.bottom-contact->pos_full_first_row.top;
- //w=clRect.right-x;
- //w=clRect.right-x;
- //x+=rectW.left;//+contact->pos_full_first_row.left;
- //y+=rectW.top;//+contact->pos_full_first_row.top;
- x=contact->pos_rename_rect.left+rectW.left;
- y=contact->pos_label.top+rectW.top;
- w=contact->pos_rename_rect.right-contact->pos_rename_rect.left;
- h2=contact->pos_label.bottom-contact->pos_label.top+4;
- h=h2;//max(h,h2);
+ // w = contact->pos_full_first_row.right-contact->pos_full_first_row.left;
+ // h = contact->pos_full_first_row.bottom-contact->pos_full_first_row.top;
+ //w = clRect.right-x;
+ //w = clRect.right-x;
+ //x += rectW.left;//+contact->pos_full_first_row.left;
+ //y += rectW.top;//+contact->pos_full_first_row.top;
+ x = contact->pos_rename_rect.left+rectW.left;
+ y = contact->pos_label.top+rectW.top;
+ w = contact->pos_rename_rect.right-contact->pos_rename_rect.left;
+ h2 = contact->pos_label.bottom-contact->pos_label.top+4;
+ h = h2;//max(h,h2);
}
{
- int a=0;
- if (contact->type==CLCIT_GROUP)
+ int a = 0;
+ if (contact->type == CLCIT_GROUP)
{
- if (dat->row_align_group_mode==1) a|=ES_CENTER;
- else if (dat->row_align_group_mode==2) a|=ES_RIGHT;
+ if (dat->row_align_group_mode == 1) a |= ES_CENTER;
+ else if (dat->row_align_group_mode == 2) a |= ES_RIGHT;
}
- if (dat->text_rtl) a|=EN_ALIGN_RTL_EC;
- if (contact->type==CLCIT_GROUP)
- dat->hwndRenameEdit=CreateWindow(TEXT("EDIT"),contact->szText,WS_POPUP|WS_BORDER|ES_AUTOHSCROLL|a,x,y,w,h,hwnd,NULL,g_hInst,NULL);
+ if (dat->text_rtl) a |= EN_ALIGN_RTL_EC;
+ if (contact->type == CLCIT_GROUP)
+ dat->hwndRenameEdit = CreateWindow(TEXT("EDIT"),contact->szText,WS_POPUP|WS_BORDER|ES_AUTOHSCROLL|a,x,y,w,h,hwnd,NULL,g_hInst,NULL);
else
- dat->hwndRenameEdit=CreateWindow(TEXT("EDIT"),pcli->pfnGetContactDisplayName(contact->hContact,0),WS_POPUP|WS_BORDER|ES_AUTOHSCROLL|a,x,y,w,h,hwnd,NULL,g_hInst,NULL);
+ dat->hwndRenameEdit = CreateWindow(TEXT("EDIT"),pcli->pfnGetContactDisplayName(contact->hContact,0),WS_POPUP|WS_BORDER|ES_AUTOHSCROLL|a,x,y,w,h,hwnd,NULL,g_hInst,NULL);
}
SetWindowLongPtr(dat->hwndRenameEdit,GWL_STYLE,GetWindowLongPtr(dat->hwndRenameEdit,GWL_STYLE)&(~WS_CAPTION)|WS_BORDER);
SetWindowLongPtr(dat->hwndRenameEdit,GWLP_USERDATA,(LONG_PTR)dat);
- OldRenameEditWndProc=(WNDPROC)SetWindowLongPtr(dat->hwndRenameEdit,GWLP_WNDPROC,(LONG_PTR)RenameEditSubclassProc);
- SendMessage(dat->hwndRenameEdit,WM_SETFONT,(WPARAM)(contact->type==CLCIT_GROUP?dat->fontModernInfo[FONTID_OPENGROUPS].hFont:dat->fontModernInfo[FONTID_CONTACTS].hFont),0);
+ OldRenameEditWndProc = (WNDPROC)SetWindowLongPtr(dat->hwndRenameEdit,GWLP_WNDPROC,(LONG_PTR)RenameEditSubclassProc);
+ SendMessage(dat->hwndRenameEdit,WM_SETFONT,(WPARAM)(contact->type == CLCIT_GROUP?dat->fontModernInfo[FONTID_OPENGROUPS].hFont:dat->fontModernInfo[FONTID_CONTACTS].hFont),0);
SendMessage(dat->hwndRenameEdit,EM_SETMARGINS,EC_LEFTMARGIN|EC_RIGHTMARGIN|EC_USEFONTINFO,0);
SendMessage(dat->hwndRenameEdit,EM_SETSEL,0,(LPARAM)(-1));
// SetWindowLongPtr(dat->hwndRenameEdit,GWLP_USERDATA,(LONG_PTR)hwnd);
- r.top=1;
- r.bottom=h-1;
- r.left=0;
- r.right=w;
+ r.top = 1;
+ r.bottom = h-1;
+ r.left = 0;
+ r.right = w;
//ES_MULTILINE
@@ -358,109 +358,109 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt) {
RECT clRect;
int hit;
- struct ClcContact *contact=NULL,*movecontact=NULL;
+ struct ClcContact *contact = NULL,*movecontact = NULL;
struct ClcGroup *group,*movegroup;
DWORD hitFlags;
- int nSetSelection=-1;
+ int nSetSelection = -1;
GetClientRect(hwnd,&clRect);
- dat->selection=dat->iDragItem;
- dat->iInsertionMark=-1;
- dat->nInsertionLevel=0;
+ dat->selection = dat->iDragItem;
+ dat->iInsertionMark = -1;
+ dat->nInsertionLevel = 0;
if (!PtInRect(&clRect,pt)) return DROPTARGET_OUTSIDE;
- hit=cliHitTest(hwnd,dat,pt.x,pt.y,&contact,&group,&hitFlags);
+ hit = cliHitTest(hwnd,dat,pt.x,pt.y,&contact,&group,&hitFlags);
cliGetRowByIndex(dat,dat->iDragItem,&movecontact,&movegroup);
- if(hit==dat->iDragItem) return DROPTARGET_ONSELF;
- if(hit==-1 || hitFlags&CLCHT_ONITEMEXTRA || !movecontact) return DROPTARGET_ONNOTHING;
-
- if(movecontact->type==CLCIT_GROUP) {
- struct ClcContact *bottomcontact=NULL,*topcontact=NULL;
- struct ClcGroup *topgroup=NULL, *bottomgroup=NULL;
- int topItem=-1,bottomItem=-1;
- int ok=0;
- if(pt.y+dat->yScroll<cliGetRowTopY(dat,hit)+dat->insertionMarkHitHeight || contact->type!=CLCIT_GROUP) {
+ if (hit == dat->iDragItem) return DROPTARGET_ONSELF;
+ if (hit == -1 || hitFlags&CLCHT_ONITEMEXTRA || !movecontact) return DROPTARGET_ONNOTHING;
+
+ if (movecontact->type == CLCIT_GROUP) {
+ struct ClcContact *bottomcontact = NULL,*topcontact = NULL;
+ struct ClcGroup *topgroup = NULL, *bottomgroup = NULL;
+ int topItem = -1,bottomItem = -1;
+ int ok = 0;
+ if (pt.y+dat->yScroll < cliGetRowTopY(dat,hit)+dat->insertionMarkHitHeight || contact->type != CLCIT_GROUP) {
//could be insertion mark (above)
- topItem=hit-1; bottomItem=hit;
- bottomcontact=contact;
- bottomgroup=group;
- topItem=cliGetRowByIndex(dat,topItem,&topcontact,&topgroup);
- ok=1;
- } else if ((pt.y+dat->yScroll>=cliGetRowTopY(dat,hit+1)-dat->insertionMarkHitHeight)
- ||(contact->type==CLCIT_GROUP && contact->group->expanded && contact->group->cl.count>0))
+ topItem = hit-1; bottomItem = hit;
+ bottomcontact = contact;
+ bottomgroup = group;
+ topItem = cliGetRowByIndex(dat,topItem,&topcontact,&topgroup);
+ ok = 1;
+ } else if ((pt.y+dat->yScroll >= cliGetRowTopY(dat,hit+1)-dat->insertionMarkHitHeight)
+ ||(contact->type == CLCIT_GROUP && contact->group->expanded && contact->group->cl.count>0))
{
//could be insertion mark (below)
- topItem=hit; bottomItem=hit+1;
- topcontact=contact; topgroup=group;
- bottomItem=cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
- ok=1;
+ topItem = hit; bottomItem = hit+1;
+ topcontact = contact; topgroup = group;
+ bottomItem = cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
+ ok = 1;
}
if (ok)
{
- if (bottomItem==-1 && contact->type==CLCIT_GROUP)
+ if (bottomItem == -1 && contact->type == CLCIT_GROUP)
{
- bottomItem=topItem+1;
+ bottomItem = topItem+1;
}
else
{
- if (bottomItem==-1 && contact->type!=CLCIT_GROUP && contact->groupId==0)
+ if (bottomItem == -1 && contact->type != CLCIT_GROUP && contact->groupId == 0)
{
- if (contact->type!=CLCIT_GROUP && contact->groupId==0)
+ if (contact->type != CLCIT_GROUP && contact->groupId == 0)
{
- bottomItem=topItem;
+ bottomItem = topItem;
cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
}
}
- if (bottomItem!=-1 && bottomcontact->type!=CLCIT_GROUP)
+ if (bottomItem != -1 && bottomcontact->type != CLCIT_GROUP)
{
- struct ClcGroup * gr=bottomgroup;
+ struct ClcGroup * gr = bottomgroup;
do
{
- bottomItem=cliGetRowByIndex(dat,bottomItem-1,&bottomcontact,&bottomgroup);}
- while (bottomItem>=0 && bottomcontact->type!=CLCIT_GROUP && bottomgroup==gr);
- nSetSelection=bottomItem;
- bottomItem=cliGetRowByIndex(dat,bottomItem+1,&bottomcontact,&bottomgroup);
+ bottomItem = cliGetRowByIndex(dat,bottomItem-1,&bottomcontact,&bottomgroup);}
+ while (bottomItem >= 0 && bottomcontact->type != CLCIT_GROUP && bottomgroup == gr);
+ nSetSelection = bottomItem;
+ bottomItem = cliGetRowByIndex(dat,bottomItem+1,&bottomcontact,&bottomgroup);
}
}
- if (bottomItem==-1) bottomItem=topItem+1;
+ if (bottomItem == -1) bottomItem = topItem+1;
{
- int bi=cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
- if (bi!=-1)
+ int bi = cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
+ if (bi != -1)
{
- group=bottomgroup;
- if (bottomcontact==movecontact || group==movecontact->group) return DROPTARGET_ONSELF;
- dat->nInsertionLevel=-1; // decreasing here
- for (;group;group=group->parent)
+ group = bottomgroup;
+ if (bottomcontact == movecontact || group == movecontact->group) return DROPTARGET_ONSELF;
+ dat->nInsertionLevel = -1; // decreasing here
+ for (;group;group = group->parent)
{
dat->nInsertionLevel++;
- if (group==movecontact->group) return DROPTARGET_ONSELF;
+ if (group == movecontact->group) return DROPTARGET_ONSELF;
}
}
}
- dat->iInsertionMark=bottomItem;
- dat->selection=nSetSelection;
+ dat->iInsertionMark = bottomItem;
+ dat->selection = nSetSelection;
return DROPTARGET_INSERTION;
}
}
- if(contact->type==CLCIT_GROUP)
+ if (contact->type == CLCIT_GROUP)
{
- if(dat->iInsertionMark==-1)
+ if (dat->iInsertionMark == -1)
{
- if(movecontact->type==CLCIT_GROUP)
+ if (movecontact->type == CLCIT_GROUP)
{ //check not moving onto its own subgroup
- dat->iInsertionMark=hit+1;
- for (;group;group=group->parent)
+ dat->iInsertionMark = hit+1;
+ for (;group;group = group->parent)
{
dat->nInsertionLevel++;
- if(group==movecontact->group) return DROPTARGET_ONSELF;
+ if (group == movecontact->group) return DROPTARGET_ONSELF;
}
}
- dat->selection=hit;
+ dat->selection = hit;
return DROPTARGET_ONGROUP;
}
}
- dat->selection=hit;
+ dat->selection = hit;
if (g_szMetaModuleName && !mir_strcmp(contact->proto,g_szMetaModuleName)&& (ServiceExists(MS_MC_ADDTOMETA))) return DROPTARGET_ONMETACONTACT;
if (contact->isSubcontact && (ServiceExists(MS_MC_ADDTOMETA))) return DROPTARGET_ONSUBCONTACT;
@@ -468,7 +468,7 @@ int GetDropTargetInformation(HWND hwnd,struct ClcData *dat,POINT pt) }
COLORREF sttGetColor(char * module, char * color, COLORREF defColor)
{
- BOOL useWinColor=db_get_b(NULL, module, "UseWinColours",CLCDEFAULT_USEWINDOWSCOLOURS);
+ BOOL useWinColor = db_get_b(NULL, module, "UseWinColours",CLCDEFAULT_USEWINDOWSCOLOURS);
if (useWinColor) return defColor;
else return db_get_dw(NULL, module, color, defColor);
}
@@ -477,7 +477,7 @@ void LoadCLCFonts( HWND hwnd, struct ClcData *dat ) {
RegisterCLUIFonts();
- HDC hdc=GetDC(hwnd);
+ HDC hdc = GetDC(hwnd);
HFONT holdfont = (HFONT)GetCurrentObject( hdc, OBJ_FONT );
for ( int i = 0 ; i <= FONTID_MODERN_MAX; i++ )
@@ -507,27 +507,27 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) {
int i;
- g_CluiData.fDisableSkinEngine=db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
+ g_CluiData.fDisableSkinEngine = db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
LoadCLCFonts( hwnd, dat );
- g_CluiData.bSortByOrder[0]=db_get_b(NULL,"CList","SortBy1",SETTING_SORTBY1_DEFAULT);
- g_CluiData.bSortByOrder[1]=db_get_b(NULL,"CList","SortBy2",SETTING_SORTBY2_DEFAULT);
- g_CluiData.bSortByOrder[2]=db_get_b(NULL,"CList","SortBy3",SETTING_SORTBY3_DEFAULT);
- g_CluiData.fSortNoOfflineBottom=db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT);
+ g_CluiData.bSortByOrder[0] = db_get_b(NULL,"CList","SortBy1",SETTING_SORTBY1_DEFAULT);
+ g_CluiData.bSortByOrder[1] = db_get_b(NULL,"CList","SortBy2",SETTING_SORTBY2_DEFAULT);
+ g_CluiData.bSortByOrder[2] = db_get_b(NULL,"CList","SortBy3",SETTING_SORTBY3_DEFAULT);
+ g_CluiData.fSortNoOfflineBottom = db_get_b(NULL,"CList","NoOfflineBottom",SETTING_NOOFFLINEBOTTOM_DEFAULT);
// Row
dat->row_min_heigh = db_get_w(NULL,"CList","MinRowHeight",CLCDEFAULT_ROWHEIGHT);
dat->row_border = db_get_w(NULL,"CList","RowBorder",SETTING_ROWBORDER_DEFAULT);
- dat->row_before_group_space =((hwnd!=pcli->hwndContactTree&&pcli->hwndContactTree!=NULL)
+ dat->row_before_group_space = ((hwnd != pcli->hwndContactTree&&pcli->hwndContactTree != NULL)
|| !db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT))?0:db_get_w(NULL,"ModernSkin","SpaceBeforeGroup",SKIN_SPACEBEFOREGROUP_DEFAULT);
dat->row_variable_height = db_get_b(NULL,"CList","VariableRowHeight",SETTING_VARIABLEROWHEIGHT_DEFAULT);
dat->row_align_left_items_to_left = db_get_b(NULL,"CList","AlignLeftItemsToLeft",SETTING_ALIGNLEFTTOLEFT_DEFAULT);
dat->row_hide_group_icon = db_get_b(NULL,"CList","HideGroupsIcon",SETTING_HIDEGROUPSICON_DEFAULT);
dat->row_align_right_items_to_right = db_get_b(NULL,"CList","AlignRightItemsToRight",SETTING_ALIGNRIGHTORIGHT_DEFAULT);
//TODO: Add to settings
- dat->row_align_group_mode=db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
- if (pcli->hwndContactTree==NULL || dat->hWnd==pcli->hwndContactTree)
+ dat->row_align_group_mode = db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
+ if (pcli->hwndContactTree == NULL || dat->hWnd == pcli->hwndContactTree)
{
int defItemsOrder[NUM_ITEM_TYPE] = SETTINS_ROWITEMORDER_DEFAULT;
@@ -540,13 +540,13 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) }
else
{
- int defItems[]= {ITEM_ICON, ITEM_TEXT, ITEM_EXTRA_ICONS,};
+ int defItems[] = {ITEM_ICON, ITEM_TEXT, ITEM_EXTRA_ICONS,};
for (i = 0 ; i < NUM_ITEM_TYPE; i++)
- dat->row_items[i]=(i<SIZEOF(defItems)) ? defItems[i] : -1;
+ dat->row_items[i] = (i < SIZEOF(defItems)) ? defItems[i] : -1;
}
// Avatar
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree==NULL)
+ if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == NULL)
{
dat->avatars_show = db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT);
dat->avatars_draw_border = db_get_b(NULL,"CList","AvatarsDrawBorders",SETTINGS_AVATARDRAWBORDER_DEFAULT);
@@ -576,7 +576,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) }
// Icon
- if (pcli->hwndContactTree == hwnd|| pcli->hwndContactTree==NULL)
+ if (pcli->hwndContactTree == hwnd|| pcli->hwndContactTree == NULL)
{
dat->icon_hide_on_avatar = db_get_b(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT);
dat->icon_draw_on_avatar_space = db_get_b(NULL,"CList","IconDrawOnAvatarSpace",SETTING_ICONONAVATARPLACE_DEFAULT);
@@ -590,7 +590,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) }
// Contact time
- if (pcli->hwndContactTree == hwnd|| pcli->hwndContactTree==NULL)
+ if (pcli->hwndContactTree == hwnd|| pcli->hwndContactTree == NULL)
{
dat->contact_time_show = db_get_b(NULL,"CList","ContactTimeShow",SETTING_SHOWTIME_DEFAULT);
dat->contact_time_show_only_if_different = db_get_b(NULL,"CList","ContactTimeShowOnlyIfDifferent",SETTING_SHOWTIMEIFDIFF_DEFAULT);
@@ -609,7 +609,7 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) dat->text_smiley_height = 0;
dat->text_use_protocol_smileys = db_get_b(NULL,"CList","TextUseProtocolSmileys",SETTING_TEXT_PROTOSMILEY_DEFAULT);
- if (pcli->hwndContactTree == hwnd|| pcli->hwndContactTree==NULL)
+ if (pcli->hwndContactTree == hwnd|| pcli->hwndContactTree == NULL)
{
dat->text_ignore_size_for_row_height = db_get_b(NULL,"CList","TextIgnoreSizeForRownHeight",SETTING_TEXT_IGNORESIZE_DEFAULT);
}
@@ -621,17 +621,17 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) // First line
dat->first_line_draw_smileys = db_get_b(NULL,"CList","FirstLineDrawSmileys",SETTING_FIRSTLINE_SMILEYS_DEFAULT);
dat->first_line_append_nick = db_get_b(NULL,"CList","FirstLineAppendNick",SETTING_FIRSTLINE_APPENDNICK_DEFAULT);
- gl_TrimText=db_get_b(NULL,"CList","TrimText",SETTING_FIRSTLINE_TRIMTEXT_DEFAULT);
+ gl_TrimText = db_get_b(NULL,"CList","TrimText",SETTING_FIRSTLINE_TRIMTEXT_DEFAULT);
// Second line
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree==NULL)
+ if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == NULL)
{
dat->second_line_show = db_get_b(NULL,"CList","SecondLineShow",SETTING_SECONDLINE_SHOW_DEFAULT);
dat->second_line_top_space = db_get_w(NULL,"CList","SecondLineTopSpace",SETTING_SECONDLINE_TOPSPACE_DEFAULT);
dat->second_line_draw_smileys = db_get_b(NULL,"CList","SecondLineDrawSmileys",SETTING_SECONDLINE_SMILEYS_DEFAULT);
dat->second_line_type = db_get_w(NULL,"CList","SecondLineType",SETTING_SECONDLINE_TYPE_DEFAULT);
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if (!DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv))
{
@@ -645,8 +645,8 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) }
}
dat->second_line_xstatus_has_priority = db_get_b(NULL,"CList","SecondLineXStatusHasPriority",SETTING_SECONDLINE_XSTATUS_DEFAULT);
- dat->second_line_show_status_if_no_away=db_get_b(NULL,"CList","SecondLineShowStatusIfNoAway",SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT);
- dat->second_line_show_listening_if_no_away=db_get_b(NULL,"CList","SecondLineShowListeningIfNoAway",SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT);
+ dat->second_line_show_status_if_no_away = db_get_b(NULL,"CList","SecondLineShowStatusIfNoAway",SETTING_SECONDLINE_STATUSIFNOAWAY_DEFAULT);
+ dat->second_line_show_listening_if_no_away = db_get_b(NULL,"CList","SecondLineShowListeningIfNoAway",SETTING_SECONDLINE_LISTENINGIFNOAWAY_DEFAULT);
dat->second_line_use_name_and_message_for_xstatus = db_get_b(NULL,"CList","SecondLineUseNameAndMessageForXStatus",SETTING_SECONDLINE_XSTATUSNAMETEXT_DEFAULT);
}
else
@@ -662,14 +662,14 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) // Third line
- if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree==NULL)
+ if (pcli->hwndContactTree == hwnd || pcli->hwndContactTree == NULL)
{
dat->third_line_show = db_get_b(NULL,"CList","ThirdLineShow",SETTING_THIRDLINE_SHOW_DEFAULT);
dat->third_line_top_space = db_get_w(NULL,"CList","ThirdLineTopSpace",SETTING_THIRDLINE_TOPSPACE_DEFAULT);
dat->third_line_draw_smileys = db_get_b(NULL,"CList","ThirdLineDrawSmileys",SETTING_THIRDLINE_SMILEYS_DEFAULT);
dat->third_line_type = db_get_w(NULL,"CList","ThirdLineType",SETTING_THIRDLINE_TYPE_DEFAULT);
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if (!DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv))
{
@@ -683,8 +683,8 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) }
}
dat->third_line_xstatus_has_priority = db_get_b(NULL,"CList","ThirdLineXStatusHasPriority",SETTING_THIRDLINE_XSTATUS_DEFAULT);
- dat->third_line_show_status_if_no_away=db_get_b(NULL,"CList","ThirdLineShowStatusIfNoAway",SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT);
- dat->third_line_show_listening_if_no_away=db_get_b(NULL,"CList","ThirdLineShowListeningIfNoAway",SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT);
+ dat->third_line_show_status_if_no_away = db_get_b(NULL,"CList","ThirdLineShowStatusIfNoAway",SETTING_THIRDLINE_STATUSIFNOAWAY_DEFAULT);
+ dat->third_line_show_listening_if_no_away = db_get_b(NULL,"CList","ThirdLineShowListeningIfNoAway",SETTING_THIRDLINE_LISTENINGIFNOAWAY_DEFAULT);
dat->third_line_use_name_and_message_for_xstatus = db_get_b(NULL,"CList","ThirdLineUseNameAndMessageForXStatus",SETTING_THIRDLINE_XSTATUSNAMETEXT_DEFAULT);
}
else
@@ -698,20 +698,20 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) dat->third_line_use_name_and_message_for_xstatus = 0;
}
- dat->leftMargin=db_get_b(NULL,"CLC","LeftMargin",CLCDEFAULT_LEFTMARGIN);
- dat->rightMargin=db_get_b(NULL,"CLC","RightMargin",CLCDEFAULT_RIGHTMARGIN);
- dat->exStyle=db_get_dw(NULL,"CLC","ExStyle",GetDefaultExStyle());
- dat->scrollTime=db_get_w(NULL,"CLC","ScrollTime",CLCDEFAULT_SCROLLTIME);
- dat->force_in_dialog=(pcli->hwndContactTree)?(hwnd!=pcli->hwndContactTree):0;
- dat->groupIndent=db_get_b(NULL,"CLC","GroupIndent",CLCDEFAULT_GROUPINDENT);
- dat->subIndent=db_get_b(NULL,"CLC","SubIndent",CLCDEFAULT_GROUPINDENT);
- dat->gammaCorrection=db_get_b(NULL,"CLC","GammaCorrect",CLCDEFAULT_GAMMACORRECT);
- dat->showIdle=db_get_b(NULL,"CLC","ShowIdle",CLCDEFAULT_SHOWIDLE);
- dat->noVScrollbar=db_get_b(NULL,"CLC","NoVScrollBar",CLCDEFAULT_NOVSCROLL);
+ dat->leftMargin = db_get_b(NULL,"CLC","LeftMargin",CLCDEFAULT_LEFTMARGIN);
+ dat->rightMargin = db_get_b(NULL,"CLC","RightMargin",CLCDEFAULT_RIGHTMARGIN);
+ dat->exStyle = db_get_dw(NULL,"CLC","ExStyle",GetDefaultExStyle());
+ dat->scrollTime = db_get_w(NULL,"CLC","ScrollTime",CLCDEFAULT_SCROLLTIME);
+ dat->force_in_dialog = (pcli->hwndContactTree)?(hwnd != pcli->hwndContactTree):0;
+ dat->groupIndent = db_get_b(NULL,"CLC","GroupIndent",CLCDEFAULT_GROUPINDENT);
+ dat->subIndent = db_get_b(NULL,"CLC","SubIndent",CLCDEFAULT_GROUPINDENT);
+ dat->gammaCorrection = db_get_b(NULL,"CLC","GammaCorrect",CLCDEFAULT_GAMMACORRECT);
+ dat->showIdle = db_get_b(NULL,"CLC","ShowIdle",CLCDEFAULT_SHOWIDLE);
+ dat->noVScrollbar = db_get_b(NULL,"CLC","NoVScrollBar",CLCDEFAULT_NOVSCROLL);
SendMessage(hwnd,INTM_SCROLLBARCHANGED,0,0);
- if (dat->hBmpBackground) {DeleteObject(dat->hBmpBackground); dat->hBmpBackground=NULL;}
- if (dat->hMenuBackground) {DeleteObject(dat->hMenuBackground); dat->hMenuBackground=NULL;}
+ if (dat->hBmpBackground) {DeleteObject(dat->hBmpBackground); dat->hBmpBackground = NULL;}
+ if (dat->hMenuBackground) {DeleteObject(dat->hMenuBackground); dat->hMenuBackground = NULL;}
dat->useWindowsColours = db_get_b(NULL, "CLC", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
@@ -720,60 +720,60 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) DBVARIANT dbv;
if (!dat->bkChanged)
{
- dat->bkColour=sttGetColor("CLC","BkColour",GetSysColor(COLOR_3DFACE));
+ dat->bkColour = sttGetColor("CLC","BkColour",GetSysColor(COLOR_3DFACE));
{
- if(db_get_b(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP))
+ if (db_get_b(NULL,"CLC","UseBitmap",CLCDEFAULT_USEBITMAP))
{
if (!DBGetContactSettingString(NULL,"CLC","BkBitmap",&dbv))
{
- dat->hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
+ dat->hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
}
}
- dat->backgroundBmpUse=db_get_w(NULL,"CLC","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ dat->backgroundBmpUse = db_get_w(NULL,"CLC","BkBmpUse",CLCDEFAULT_BKBMPUSE);
}
- dat->MenuBkColor=sttGetColor("Menu","BkColour",CLCDEFAULT_BKCOLOUR);
- dat->MenuBkHiColor=sttGetColor("Menu","SelBkColour",CLCDEFAULT_SELBKCOLOUR);
+ dat->MenuBkColor = sttGetColor("Menu","BkColour",CLCDEFAULT_BKCOLOUR);
+ dat->MenuBkHiColor = sttGetColor("Menu","SelBkColour",CLCDEFAULT_SELBKCOLOUR);
- dat->MenuTextColor=sttGetColor("Menu","TextColour",CLCDEFAULT_TEXTCOLOUR);
- dat->MenuTextHiColor=sttGetColor("Menu","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
+ dat->MenuTextColor = sttGetColor("Menu","TextColour",CLCDEFAULT_TEXTCOLOUR);
+ dat->MenuTextHiColor = sttGetColor("Menu","SelTextColour",CLCDEFAULT_MODERN_SELTEXTCOLOUR);
- if(db_get_b(NULL,"Menu","UseBitmap",CLCDEFAULT_USEBITMAP)) {
+ if (db_get_b(NULL,"Menu","UseBitmap",CLCDEFAULT_USEBITMAP)) {
if (!DBGetContactSettingString(NULL,"Menu","BkBitmap",&dbv)) {
- dat->hMenuBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
+ dat->hMenuBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
db_free(&dbv);
}
}
- dat->MenuBmpUse=db_get_w(NULL,"Menu","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ dat->MenuBmpUse = db_get_w(NULL,"Menu","BkBmpUse",CLCDEFAULT_BKBMPUSE);
}
- dat->greyoutFlags=db_get_dw(NULL,"CLC","GreyoutFlags",CLCDEFAULT_GREYOUTFLAGS);
- dat->offlineModes=db_get_dw(NULL,"CLC","OfflineModes",CLCDEFAULT_OFFLINEMODES);
- dat->selBkColour=sttGetColor("CLC","SelBkColour",CLCDEFAULT_SELBKCOLOUR);
- 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);
+ dat->greyoutFlags = db_get_dw(NULL,"CLC","GreyoutFlags",CLCDEFAULT_GREYOUTFLAGS);
+ dat->offlineModes = db_get_dw(NULL,"CLC","OfflineModes",CLCDEFAULT_OFFLINEMODES);
+ dat->selBkColour = sttGetColor("CLC","SelBkColour",CLCDEFAULT_SELBKCOLOUR);
+ 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);
- dat->IsMetaContactsEnabled=(!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
+ dat->IsMetaContactsEnabled = (!(GetWindowLongPtr(hwnd,GWL_STYLE)&CLS_MANUALUPDATE)) &&
g_szMetaModuleName && db_get_b(NULL,g_szMetaModuleName,"Enabled",1) && ServiceExists(MS_MC_GETDEFAULTCONTACT);
- if (pcli->hwndContactTree==NULL || dat->hWnd==pcli->hwndContactTree)
- dat->MetaIgnoreEmptyExtra=db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
+ if (pcli->hwndContactTree == NULL || dat->hWnd == pcli->hwndContactTree)
+ dat->MetaIgnoreEmptyExtra = db_get_b(NULL,"CLC","MetaIgnoreEmptyExtra",SETTING_METAIGNOREEMPTYEXTRA_DEFAULT);
else
- dat->MetaIgnoreEmptyExtra=FALSE;
+ dat->MetaIgnoreEmptyExtra = FALSE;
- dat->expandMeta=db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
- dat->useMetaIcon=db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT);
+ dat->expandMeta = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
+ dat->useMetaIcon = db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT);
- dat->drawOverlayedStatus=db_get_b(NULL,"CLC","DrawOverlayedStatus",SETTING_DRAWOVERLAYEDSTATUS_DEFAULT);
+ dat->drawOverlayedStatus = db_get_b(NULL,"CLC","DrawOverlayedStatus",SETTING_DRAWOVERLAYEDSTATUS_DEFAULT);
- dat->dbbMetaHideExtra=db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT);
- dat->dbbBlendInActiveState=db_get_b(NULL,"CLC","BlendInActiveState",SETTING_BLENDINACTIVESTATE_DEFAULT);
- dat->dbbBlend25=db_get_b(NULL,"CLC","Blend25%",SETTING_BLENDINACTIVESTATE_DEFAULT);
- dat->bCompactMode=db_get_b(NULL,"CLC","CompactMode",SETTING_COMPACTMODE_DEFAULT);
- if ((pcli->hwndContactTree == hwnd || pcli->hwndContactTree==NULL))
+ dat->dbbMetaHideExtra = db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT);
+ dat->dbbBlendInActiveState = db_get_b(NULL,"CLC","BlendInActiveState",SETTING_BLENDINACTIVESTATE_DEFAULT);
+ dat->dbbBlend25 = db_get_b(NULL,"CLC","Blend25%",SETTING_BLENDINACTIVESTATE_DEFAULT);
+ dat->bCompactMode = db_get_b(NULL,"CLC","CompactMode",SETTING_COMPACTMODE_DEFAULT);
+ if ((pcli->hwndContactTree == hwnd || pcli->hwndContactTree == NULL))
{
IvalidateDisplayNameCache(16);
@@ -781,9 +781,9 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) {
NMHDR hdr;
- hdr.code=CLN_OPTIONSCHANGED;
- hdr.hwndFrom=hwnd;
- hdr.idFrom=0;//GetDlgCtrlID(hwnd);
+ hdr.code = CLN_OPTIONSCHANGED;
+ hdr.hwndFrom = hwnd;
+ hdr.idFrom = 0;//GetDlgCtrlID(hwnd);
SendMessage(GetParent(hwnd),WM_NOTIFY,0,(LPARAM)&hdr);
}
SendMessage(hwnd,WM_SIZE,0,0);
@@ -792,12 +792,12 @@ void LoadCLCOptions(HWND hwnd, struct ClcData *dat ) int ExpandMetaContact(HWND hwnd, struct ClcContact * contact, struct ClcData * dat, BOOL bExpand)
{
- struct ClcContact * ht=NULL;
+ struct ClcContact * ht = NULL;
KillTimer(hwnd,TIMERID_SUBEXPAND);
- if (contact->type!=CLCIT_CONTACT ||contact->SubAllocated==0 || contact->SubExpanded==bExpand || !db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT)) return 0;
- contact->SubExpanded=bExpand;
+ if (contact->type != CLCIT_CONTACT ||contact->SubAllocated == 0 || contact->SubExpanded == bExpand || !db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT)) return 0;
+ contact->SubExpanded = bExpand;
db_set_b(contact->hContact,"CList","Expanded",contact->SubExpanded);
- dat->NeedResort=1;
+ dat->NeedResort = 1;
pcli->pfnSortCLC(hwnd,dat,1);
cliRecalcScrollBar(hwnd,dat);
return contact->SubExpanded;
@@ -807,8 +807,8 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref {
struct ClcGroup *group = &dat->list;
int testlen = lstrlen(text);
- struct ClcContact *contact=NULL;
- int SubCount=0;
+ struct ClcContact *contact = NULL;
+ int SubCount = 0;
group->scanIndex = 0;
for (;;) {
@@ -819,8 +819,8 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref group->scanIndex++;
continue;
}
- contact=group->cl.items[group->scanIndex];
- if (contact->type != CLCIT_DIVIDER)
+ contact = group->cl.items[group->scanIndex];
+ if (contact->type !=CLCIT_DIVIDER)
{
if ((prefixOk && !_tcsnicmp(text, contact->szText, testlen)) ||
(!prefixOk && !lstrcmpi(text, contact->szText)))
@@ -836,19 +836,19 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref 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;
+ SubCount = 0;
continue;
}
}
}
- if (contact->type==CLCIT_CONTACT && contact->SubAllocated)
+ if (contact->type == CLCIT_CONTACT && contact->SubAllocated)
{
if (!(dat->exStyle & CLS_EX_QUICKSEARCHVISONLY) || contact->SubExpanded )
{
- int i=0;
- for (i=0; i<contact->SubAllocated; i++)
+ int i = 0;
+ for (i = 0; i < contact->SubAllocated; i++)
{
- struct ClcContact * subcontact=&(contact->subcontacts[i]);
+ struct ClcContact * subcontact = &(contact->subcontacts[i]);
if ((prefixOk && !_tcsnicmp(text, subcontact->szText, testlen)) ||
(!prefixOk && !lstrcmpi(text, subcontact->szText)))
{
@@ -863,8 +863,8 @@ int cliFindRowByText(HWND hwnd, struct ClcData *dat, const TCHAR *text, int pref }
}
}
- if (contact->type==CLCIT_CONTACT && contact->SubAllocated && contact->SubExpanded)
- SubCount+=contact->SubAllocated;
+ if (contact->type == CLCIT_CONTACT && contact->SubAllocated && contact->SubExpanded)
+ SubCount += contact->SubAllocated;
group->scanIndex++;
}
return -1;
diff --git a/plugins/Clist_modern/modern_clistevents.cpp b/plugins/Clist_modern/modern_clistevents.cpp index 42f65091f6..2b47b3403a 100644 --- a/plugins/Clist_modern/modern_clistevents.cpp +++ b/plugins/Clist_modern/modern_clistevents.cpp @@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /**************************************************/
/* Declarations */
-static HANDLE hNotifyFrame=NULL;
+static HANDLE hNotifyFrame = NULL;
static int EventArea_PaintCallbackProc(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData);
static int EventArea_Draw(HWND hwnd, HDC hDC);
static int EventArea_DrawWorker(HWND hwnd, HDC hDC);
@@ -106,7 +106,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) return NULL;
if (1) {
- if (p->cle.hContact != 0 && p->cle.hDbEvent != (HANDLE) 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
+ if (p->cle.hContact !=0 && p->cle.hDbEvent !=(HANDLE) 1 && !(p->cle.flags & CLEF_ONLYAFEW)) {
int j;
struct NotifyMenuItemExData *nmi = 0;
char *szProto;
@@ -120,9 +120,9 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) {
// dup check only for msg events
for (j = 0; j < GetMenuItemCount(g_CluiData.hMenuNotify); j++) {
- if (GetMenuItemInfo(g_CluiData.hMenuNotify, j, TRUE, &mii) != 0) {
+ if (GetMenuItemInfo(g_CluiData.hMenuNotify, j, TRUE, &mii) !=0) {
nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- if (nmi != 0 && (HANDLE) nmi->hContact == (HANDLE) p->cle.hContact && nmi->iIcon == p->imlIconIndex)
+ if (nmi !=0 && (HANDLE) nmi->hContact == (HANDLE) p->cle.hContact && nmi->iIcon == p->imlIconIndex)
return p;
} } }
@@ -156,7 +156,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) }
}
- else if (p->cle.hContact != 0 && (p->cle.flags & CLEF_ONLYAFEW))
+ else if (p->cle.hContact !=0 && (p->cle.flags & CLEF_ONLYAFEW))
{
g_CluiData.iIconNotify = p->imlIconIndex;
g_CluiData.hUpdateContact = p->cle.hContact;
@@ -178,7 +178,7 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle) int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent)
{
int i;
- int res=0;
+ int res = 0;
// Find the event that should be removed
for (i = 0; i < pcli->events.count; i++)
@@ -201,7 +201,7 @@ int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent) MENUITEMINFO mii = {0};
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
- if (GetMenuItemInfo(g_CluiData.hMenuNotify, pcli->events.items[i]->menuId, FALSE, &mii) != 0)
+ if (GetMenuItemInfo(g_CluiData.hMenuNotify, pcli->events.items[i]->menuId, FALSE, &mii) !=0)
{
struct NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
if (nmi && nmi->hContact == hContact && nmi->hDbEvent == hDbEvent)
@@ -213,7 +213,7 @@ int cli_RemoveEvent(HANDLE hContact, HANDLE hDbEvent) }
}
- res=corecli.pfnRemoveEvent(hContact, hDbEvent);
+ res = corecli.pfnRemoveEvent(hContact, hDbEvent);
if (pcli->events.count == 0)
{
@@ -249,17 +249,17 @@ static event_area_t event_area; static BOOL sttDrawEventAreaBackground(HWND hwnd, HDC hdc, RECT * rect)
{
- BOOL bFloat = (GetParent(hwnd)!=pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat)
{
RECT rc;
- if (rect) rc=*rect;
+ if (rect) rc = *rect;
else GetClientRect(hwnd,&rc);
if (!event_area.hBmpBackground && !event_area.useWinColors)
{
- HBRUSH hbr=CreateSolidBrush(event_area.bkColour);
+ HBRUSH hbr = CreateSolidBrush(event_area.bkColour);
FillRect(hdc, &rc, hbr);
DeleteObject(hbr);
}
@@ -275,18 +275,18 @@ COLORREF sttGetColor(char * module, char * color, COLORREF defColor); //clcutils static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
{
- if(event_area.hBmpBackground)
+ if (event_area.hBmpBackground)
{
DeleteObject(event_area.hBmpBackground);
- event_area.hBmpBackground=NULL;
+ event_area.hBmpBackground = NULL;
}
if (g_CluiData.fDisableSkinEngine)
{
DBVARIANT dbv;
- event_area.bkColour=sttGetColor("EventArea","BkColour",CLCDEFAULT_BKCOLOUR);
- if(db_get_b(NULL,"EventArea","UseBitmap",CLCDEFAULT_USEBITMAP)) {
+ event_area.bkColour = sttGetColor("EventArea","BkColour",CLCDEFAULT_BKCOLOUR);
+ if (db_get_b(NULL,"EventArea","UseBitmap",CLCDEFAULT_USEBITMAP)) {
if (!DBGetContactSettingString(NULL,"EventArea","BkBitmap",&dbv)) {
- event_area.hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
+ event_area.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
}
@@ -301,9 +301,9 @@ void EventArea_ConfigureEventArea() {
int iCount = pcli->events.count;
- g_CluiData.dwFlags&=~(CLUI_FRAME_AUTOHIDENOTIFY|CLUI_FRAME_SHOWALWAYS);
- if (db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT)==1) g_CluiData.dwFlags|=CLUI_FRAME_AUTOHIDENOTIFY;
- if (db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT)==2) g_CluiData.dwFlags|=CLUI_FRAME_SHOWALWAYS;
+ g_CluiData.dwFlags &= ~(CLUI_FRAME_AUTOHIDENOTIFY|CLUI_FRAME_SHOWALWAYS);
+ if (db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 1) g_CluiData.dwFlags |= CLUI_FRAME_AUTOHIDENOTIFY;
+ if (db_get_b(NULL,"CLUI","EventArea",SETTING_EVENTAREAMODE_DEFAULT) == 2) g_CluiData.dwFlags |= CLUI_FRAME_SHOWALWAYS;
if (g_CluiData.dwFlags & CLUI_FRAME_SHOWALWAYS)
g_CluiData.bNotifyActive = 1;
@@ -323,8 +323,8 @@ static int EventArea_PaintCallbackProc(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN static int EventArea_Draw(HWND hwnd, HDC hDC)
{
- if (hwnd==(HWND)-1) return 0;
- if (GetParent(hwnd)==pcli->hwndContactList)
+ if (hwnd == (HWND)-1) return 0;
+ if (GetParent(hwnd) == pcli->hwndContactList)
return EventArea_DrawWorker(hwnd,hDC);
else
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
@@ -342,21 +342,21 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) }
else
{
- SkinDrawGlyph(hDC,&rc,&rc,"Main,ID=EventArea");
+ SkinDrawGlyph(hDC,&rc,&rc,"Main,ID = EventArea");
}
- hOldFont=g_clcPainter.ChangeToFont(hDC,NULL,FONTID_EVENTAREA,NULL);
+ hOldFont = g_clcPainter.ChangeToFont(hDC,NULL,FONTID_EVENTAREA,NULL);
SetBkMode(hDC,TRANSPARENT);
//ske_DrawText(hDC,_T("DEBUG"),lstrlen(_T("DEBUG")),&rc,0);
{
int iCount = GetMenuItemCount(g_CluiData.hMenuNotify);
- rc.left += 26;
- if (g_CluiData.hUpdateContact != 0)
+ rc.left += 26;
+ if (g_CluiData.hUpdateContact !=0)
{
TCHAR *szName = pcli->pfnGetContactDisplayName(g_CluiData.hUpdateContact, 0);
int iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) g_CluiData.hUpdateContact, 0);
ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
- rc.left += 18;
+ rc.left += 18;
ske_DrawText(hDC, szName, -1, &rc, DT_VCENTER | DT_SINGLELINE);
ske_ImageList_DrawEx(g_himlCListClc, (int)g_CluiData.iIconNotify, hDC, 4, (rc.bottom + rc.top - 16) / 2, 16, 16, CLR_NONE, CLR_NONE, ILD_NORMAL);
}
@@ -374,7 +374,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) szName = pcli->pfnGetContactDisplayName(nmi->hContact, 0);
iIcon = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) nmi->hContact, 0);
ske_ImageList_DrawEx(g_himlCListClc, iIcon, hDC, rc.left, (rc.bottom + rc.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
- rc.left += 18;
+ rc.left += 18;
ske_ImageList_DrawEx(g_himlCListClc, nmi->iIcon, hDC, 4, (rc.bottom + rc.top) / 2 - 8, 16, 16, CLR_NONE, CLR_NONE, ILD_NORMAL);
ske_DrawText(hDC, szName, -1, &rc, DT_VCENTER | DT_SINGLELINE);
}
@@ -398,19 +398,19 @@ static void EventArea_HideShowNotifyFrame() if (g_CluiData.dwFlags & CLUI_FRAME_SHOWALWAYS)
desired = TRUE;
- else if(g_CluiData.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY)
+ else if (g_CluiData.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY)
desired = g_CluiData.bNotifyActive ? TRUE : FALSE;
else
desired = FALSE;
- if(desired)
+ if (desired)
{
if (!dwVisible)
CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
}
else
{
- if(dwVisible)
+ if (dwVisible)
CallService(MS_CLIST_FRAMES_SHFRAME, (WPARAM)hNotifyFrame, 0);
}
}
@@ -423,10 +423,10 @@ int EventArea_Create(HWND hCluiWnd) ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhEventAreaBackgroundSettingsChanged);
ehhEventAreaBackgroundSettingsChanged(0,0);
- WNDCLASS wndclass={0};
- TCHAR pluginname[]=TEXT("EventArea");
- int h=GetSystemMetrics(SM_CYSMICON)+2;
- if (GetClassInfo(g_hInst,pluginname,&wndclass) ==0)
+ WNDCLASS wndclass = {0};
+ TCHAR pluginname[] = TEXT("EventArea");
+ int h = GetSystemMetrics(SM_CYSMICON)+2;
+ if (GetClassInfo(g_hInst,pluginname,&wndclass) == 0)
{
wndclass.style = 0;
wndclass.lpfnWndProc = EventArea_WndProc;
@@ -440,27 +440,27 @@ int EventArea_Create(HWND hCluiWnd) wndclass.lpszClassName = pluginname;
RegisterClass(&wndclass);
}
- g_CluiData.hwndEventFrame=CreateWindow(pluginname,pluginname,WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,
+ g_CluiData.hwndEventFrame = CreateWindow(pluginname,pluginname,WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,
0,0,0,h,hCluiWnd,NULL,g_hInst,NULL);
// register frame
{
CLISTFrame Frame;
memset(&Frame,0,sizeof(Frame));
- Frame.cbSize=sizeof(CLISTFrame);
- Frame.hWnd=g_CluiData.hwndEventFrame;
- Frame.align=alBottom;
- Frame.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- Frame.Flags=(db_get_b(NULL,"CLUI","ShowEventArea",SETTING_SHOWEVENTAREAFRAME_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
- Frame.height=h;
- Frame.tname=_T("EventArea"); //do not translate
- Frame.TBtname=TranslateT("Event Area");
- hNotifyFrame=(HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,(LPARAM)0);
+ Frame.cbSize = sizeof(CLISTFrame);
+ Frame.hWnd = g_CluiData.hwndEventFrame;
+ Frame.align = alBottom;
+ Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ Frame.Flags = (db_get_b(NULL,"CLUI","ShowEventArea",SETTING_SHOWEVENTAREAFRAME_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
+ Frame.height = h;
+ Frame.tname = _T("EventArea"); //do not translate
+ Frame.TBtname = TranslateT("Event Area");
+ hNotifyFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,(LPARAM)0);
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)EventArea_PaintCallbackProc); //$$$$$ register sub for frame
CallService(MS_CLIST_FRAMES_UPDATEFRAME,-1,0);
EventArea_HideShowNotifyFrame();
}
- g_CluiData.szNoEvents=TranslateT("No Events");
+ g_CluiData.szNoEvents = TranslateT("No Events");
g_CluiData.hMenuNotify = CreatePopupMenu();
g_CluiData.wNextMenuID = 1;
EventArea_ConfigureEventArea();
@@ -487,7 +487,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA | MIIM_ID;
- if (GetMenuItemInfoA(g_CluiData.hMenuNotify, lpi->itemID, FALSE, &mii) != 0) {
+ if (GetMenuItemInfoA(g_CluiData.hMenuNotify, lpi->itemID, FALSE, &mii) !=0) {
if (mii.dwItemData == lpi->itemData)
{
lpi->itemWidth = 8 + 16;
@@ -509,7 +509,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
- if (GetMenuItemInfoA(g_CluiData.hMenuNotify, (UINT) dis->itemID, FALSE, &mii) != 0)
+ if (GetMenuItemInfoA(g_CluiData.hMenuNotify, (UINT) dis->itemID, FALSE, &mii) !=0)
{
nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
if (nmi)
@@ -524,11 +524,11 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP break;
}
case WM_LBUTTONUP:
- if(g_CluiData.bEventAreaEnabled)
+ if (g_CluiData.bEventAreaEnabled)
SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(IDC_NOTIFYBUTTON, 0), 0);
break;
case WM_COMMAND:
- if(LOWORD(wParam) == IDC_NOTIFYBUTTON) {
+ if (LOWORD(wParam) == IDC_NOTIFYBUTTON) {
int iSelection;
MENUITEMINFO mii = {0};
POINT pt;
@@ -544,7 +544,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP else
iSelection = GetMenuItemID(g_CluiData.hMenuNotify, 0);
result = GetMenuItemInfo(g_CluiData.hMenuNotify, (UINT) iSelection, FALSE, &mii);
- if (result != 0) {
+ if (result !=0) {
nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
if (nmi) {
CLISTEVENT *cle = MyGetEvent(iSelection);
@@ -554,7 +554,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP // re-obtain the pointer, it may already be invalid/point to another event if the
// event we're interested in was removed by the service (nasty one...)
cle1 = MyGetEvent(iSelection);
- if (cle1 != NULL)
+ if (cle1 !=NULL)
CallService(MS_CLIST_REMOVEEVENT, (WPARAM) cle->hContact, (LPARAM) cle->hDbEvent);
}
}
@@ -569,20 +569,20 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP return 1;
case WM_PAINT:
{
- if (GetParent(hwnd)==pcli->hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)hwnd,0);
- else if (GetParent(hwnd)==pcli->hwndContactList && !g_CluiData.fLayered)
+ else if (GetParent(hwnd) == pcli->hwndContactList && !g_CluiData.fLayered)
{
HDC hdc, hdc2;
HBITMAP hbmp,hbmpo;
- RECT rc={0};
+ RECT rc = {0};
GetClientRect(hwnd,&rc);
rc.right++;
rc.bottom++;
hdc = GetDC(hwnd);
- hdc2=CreateCompatibleDC(hdc);
- hbmp=ske_CreateDIB32(rc.right,rc.bottom);
- hbmpo=(HBITMAP)SelectObject(hdc2,hbmp);
+ hdc2 = CreateCompatibleDC(hdc);
+ hbmp = ske_CreateDIB32(rc.right,rc.bottom);
+ hbmpo = (HBITMAP)SelectObject(hdc2,hbmp);
ske_BltBackImage(hwnd,hdc2,&rc);
EventArea_DrawWorker(hwnd,hdc2);
BitBlt(hdc,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,
@@ -600,12 +600,12 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP HBITMAP hbmp, hbmpo;
RECT rc;
PAINTSTRUCT ps;
- HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
+ HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
GetClientRect(hwnd,&rc);
- hdc=BeginPaint(hwnd,&ps);
- hdc2=CreateCompatibleDC(hdc);
- hbmp=ske_CreateDIB32(rc.right,rc.bottom);
- hbmpo=(HBITMAP)SelectObject(hdc2,hbmp);
+ hdc = BeginPaint(hwnd,&ps);
+ hdc2 = CreateCompatibleDC(hdc);
+ hbmp = ske_CreateDIB32(rc.right,rc.bottom);
+ hbmpo = (HBITMAP)SelectObject(hdc2,hbmp);
FillRect(hdc2,&ps.rcPaint,br);
EventArea_DrawWorker(hwnd,hdc2);
BitBlt(hdc,ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right-ps.rcPaint.left,ps.rcPaint.bottom-ps.rcPaint.top,
@@ -613,7 +613,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP SelectObject(hdc2,hbmpo);
DeleteObject(hbmp);
mod_DeleteDC(hdc2);
- ps.fErase=FALSE;
+ ps.fErase = FALSE;
EndPaint(hwnd,&ps);
}
}
diff --git a/plugins/Clist_modern/modern_clistmenus.cpp b/plugins/Clist_modern/modern_clistmenus.cpp index 7212e675f0..509c4908bd 100644 --- a/plugins/Clist_modern/modern_clistmenus.cpp +++ b/plugins/Clist_modern/modern_clistmenus.cpp @@ -68,30 +68,30 @@ void UninitCustomMenus(void) #define CLUI_FAVSETRATE "CLUI/SetContactRate" //LParam is rate, Wparam is contact handle
#define CLUI_FAVTOGGLESHOWOFFLINE "CLUI/ToggleContactShowOffline"
-static HANDLE hFavoriteContactMenu=NULL;
+static HANDLE hFavoriteContactMenu = NULL;
static HANDLE *hFavoriteContactMenuItems = NULL;
-static HANDLE hShowIfOflineItem=NULL;
-static HANDLE hOnContactMenuBuild_FAV=NULL;
+static HANDLE hShowIfOflineItem = NULL;
+static HANDLE hOnContactMenuBuild_FAV = NULL;
static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam)
{
CLISTMENUITEM mi;
- BOOL NeedFree=FALSE;
- BYTE bContactRate=db_get_b((HANDLE)wParam, "CList", "Rate",0);
+ BOOL NeedFree = FALSE;
+ BYTE bContactRate = db_get_b((HANDLE)wParam, "CList", "Rate",0);
//if (hFavoriteContactMenu)
- static TCHAR * FAVMENUROOTNAME =_T("&Contact rate");
+ static TCHAR * FAVMENUROOTNAME = _T("&Contact rate");
- TCHAR *rates[]={
+ TCHAR *rates[] = {
_T( "None" ),
_T( "Low" ),
_T( "Medium" ),
_T( "High" )
};
- char* iconsName[]={
+ char* iconsName[] = {
LPGEN( "Contact rate None" ),
LPGEN( "Contact rate Low" ),
LPGEN( "Contact rate Medium" ),
@@ -102,66 +102,66 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) bContactRate = SIZEOF( rates ) - 1;
//if (hFavoriteContactMenu)
// CallService(MO_REMOVEMENUITEM,(WPARAM)hFavoriteContactMenu,0);
- //hFavoriteContactMenu=NULL;
+ //hFavoriteContactMenu = NULL;
//if (!hFavoriteContactMenu)
{
- BOOL bModifyMenu=FALSE;
+ BOOL bModifyMenu = FALSE;
int i;
- TCHAR * name=NULL;
+ 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.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;
+ mi.pszPopupName = (char *)-1;
+ mi.position = 0;
if (!bContactRate)
- mi.ptszName=FAVMENUROOTNAME;
+ mi.ptszName = FAVMENUROOTNAME;
else
{
- int bufsize=(lstrlen(FAVMENUROOTNAME)+lstrlen(rates[bContactRate])+15)*sizeof(TCHAR);
- name=(TCHAR*)_alloca(bufsize);
+ 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.ptszName = name;
}
- //mi.pszService="ContactRate MenuItem NoService Fake";
- mi.flags=CMIF_ROOTPOPUP|CMIF_TCHAR;
+ //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;
+ mi.flags |= CMIM_FLAGS|CMIM_ICON|CMIM_NAME;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenu, (LPARAM)&mi);
- bModifyMenu=TRUE;
+ bModifyMenu = TRUE;
}
{
OptParam op;
- op.Handle = hFavoriteContactMenu;
- op.Setting = OPT_MENUITEMSETUNIQNAME;
- op.Value = (INT_PTR)"ModernClistMenu_ContactRate";
+ 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);
- mi.pszPopupName=(char*)hFavoriteContactMenu;
+ mi.pszPopupName = (char*)hFavoriteContactMenu;
if (!hFavoriteContactMenuItems)
{
- hFavoriteContactMenuItems=(HANDLE*)malloc(sizeof(HANDLE)*SIZEOF(rates));
+ hFavoriteContactMenuItems = (HANDLE*)malloc(sizeof(HANDLE)*SIZEOF(rates));
memset(hFavoriteContactMenuItems,0,sizeof(HANDLE)*SIZEOF(rates));
}
- for (i=0; i<SIZEOF(rates); i++)
+ 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;
+ 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;
+ mi.flags |= CMIM_FLAGS|CMIM_ICON;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hFavoriteContactMenuItems[i], (LPARAM)&mi);
}
else hFavoriteContactMenuItems[i] = Menu_AddContactMenuItem(&mi);
@@ -169,14 +169,14 @@ static int FAV_OnContactMenuBuild(WPARAM wParam,LPARAM lParam) 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;
+ 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;
+ mi.flags |= CMIM_FLAGS|CMIM_ICON;
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM) hShowIfOflineItem, (LPARAM)&mi);
}
else hShowIfOflineItem = Menu_AddContactMenuItem(&mi);
@@ -207,7 +207,7 @@ int LoadFavoriteContactMenu() {
CreateServiceFunction(CLUI_FAVSETRATE,FAV_SetRate);
CreateServiceFunction(CLUI_FAVTOGGLESHOWOFFLINE,FAV_ToggleShowOffline);
- hOnContactMenuBuild_FAV=ModernHookEvent(ME_CLIST_PREBUILDCONTACTMENU,FAV_OnContactMenuBuild);
+ hOnContactMenuBuild_FAV = ModernHookEvent(ME_CLIST_PREBUILDCONTACTMENU,FAV_OnContactMenuBuild);
return 0;
}
@@ -217,11 +217,11 @@ int UnloadFavoriteContactMenu() if (hFavoriteContactMenuItems)
free (hFavoriteContactMenuItems);
- hFavoriteContactMenuItems=NULL;
+ hFavoriteContactMenuItems = NULL;
if (hFavoriteContactMenu)
CallService(MO_REMOVEMENUITEM,(WPARAM)hFavoriteContactMenu,0);
- hFavoriteContactMenu=NULL;
+ hFavoriteContactMenu = NULL;
return 0;
}
diff --git a/plugins/Clist_modern/modern_clistmod.cpp b/plugins/Clist_modern/modern_clistmod.cpp index c57f58405e..5f126f7f7d 100644 --- a/plugins/Clist_modern/modern_clistmod.cpp +++ b/plugins/Clist_modern/modern_clistmod.cpp @@ -22,21 +22,21 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "hdr/modern_commonheaders.h"
#include "m_clui.h"
-#include <m_file.h>
-#include <m_addcontact.h>
+#include < m_file.h>
+#include < m_addcontact.h>
#include "hdr/modern_clist.h"
#include "hdr/modern_commonprototypes.h"
#include "hdr/modern_sync.h"
#include "hdr/modern_clui.h"
-#include <m_modernopt.h>
+#include < m_modernopt.h>
pfnMyMonitorFromPoint MyMonitorFromPoint = NULL;
pfnMyMonitorFromWindow MyMonitorFromWindow = NULL;
pfnMyGetMonitorInfo MyGetMonitorInfo = NULL;
-static HANDLE hookSystemShutdown_CListMod=NULL;
-HANDLE hookOptInitialise_CList=NULL,
- hookOptInitialise_Skin=NULL,
- hookContactAdded_CListSettings=NULL;
+static HANDLE hookSystemShutdown_CListMod = NULL;
+HANDLE hookOptInitialise_CList = NULL,
+ hookOptInitialise_Skin = NULL,
+ hookContactAdded_CListSettings = NULL;
int CListMod_HideWindow(HWND hwndContactList, int mode);
@@ -58,7 +58,7 @@ INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam); void InitTrayMenus(void);
-HIMAGELIST hCListImages=NULL;
+HIMAGELIST hCListImages = NULL;
BOOL (WINAPI *MySetProcessWorkingSetSize)(HANDLE,SIZE_T,SIZE_T);
@@ -68,11 +68,11 @@ static HANDLE hSettingChanged; //returns normal icon or combined with status overlay. Needs to be destroyed.
HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
{
- HICON hIcon=NULL;
- HICON hXIcon=NULL;
+ HICON hIcon = NULL;
+ HICON hXIcon = NULL;
// check if options is turned on
- BYTE trayOption=db_get_b(NULL,"CLUI","XStatusTray",SETTING_TRAYOPTION_DEFAULT);
- if (trayOption&3 && szProto!=NULL)
+ BYTE trayOption = db_get_b(NULL,"CLUI","XStatusTray",SETTING_TRAYOPTION_DEFAULT);
+ if (trayOption&3 && szProto != NULL)
{
// check service exists
char str[MAXMODULELABELLENGTH];
@@ -84,22 +84,22 @@ HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status) if (status>ID_STATUS_OFFLINE)
{
// get xicon
- hXIcon=(HICON)CallService(str,0,0);
+ hXIcon = (HICON)CallService(str,0,0);
if (hXIcon)
{
// check overlay mode
if (trayOption&2)
{
// get overlay
- HICON MainOverlay=(HICON)GetMainStatusOverlay(status);
- hIcon=ske_CreateJoinedIcon(hXIcon,MainOverlay,(trayOption&4)?192:0);
+ HICON MainOverlay = (HICON)GetMainStatusOverlay(status);
+ hIcon = ske_CreateJoinedIcon(hXIcon,MainOverlay,(trayOption&4)?192:0);
DestroyIcon_protect(hXIcon);
DestroyIcon_protect(MainOverlay);
}
else
{
// paint it
- hIcon=hXIcon;
+ hIcon = hXIcon;
}
}
}
@@ -107,7 +107,7 @@ HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status) }
if (!hIcon)
{
- hIcon=ske_ImageList_GetIcon(g_himlCListClc,ExtIconFromStatusMode(hContact,szProto,status),ILD_NORMAL);
+ hIcon = ske_ImageList_GetIcon(g_himlCListClc,ExtIconFromStatusMode(hContact,szProto,status),ILD_NORMAL);
}
// if not ready take normal icon
return hIcon;
@@ -116,19 +116,19 @@ HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status) int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
{
/*pdisplayNameCacheEntry cacheEntry;
- if ((DBGetContactSettingByte(NULL,"CLC","Meta",0)!=1) && szProto!=NULL)
+ if ((DBGetContactSettingByte(NULL,"CLC","Meta",0) != 1) && szProto != NULL)
{
- if (meta_module && mir_strcmp(szProto,meta_module)==0)
+ if (meta_module && mir_strcmp(szProto,meta_module) == 0)
{
- hContact=(HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(UINT)hContact,0);
- if (hContact!=0)
+ hContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(UINT)hContact,0);
+ if (hContact != 0)
{
- szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(UINT)hContact,0);
- status=DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE);
+ szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(UINT)hContact,0);
+ status = DBGetContactSettingWord(hContact,szProto,"Status",ID_STATUS_OFFLINE);
}
}
}
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry->isTransport>0) return GetTrasportStatusIconIndex(cacheEntry->isTransport-1,status);
*/
return pcli->pfnIconFromStatusMode(szProto,status,hContact);
@@ -136,45 +136,45 @@ int ExtIconFromStatusMode(HANDLE hContact, const char *szProto,int status) /////////// End by FYR ////////
int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact)
{
- int result=-1;
+ int result = -1;
if (hContact && szProto)
{
- char * szActProto=(char*)szProto;
- char AdvancedService[255]={0};
- int nActStatus=nStatus;
- HANDLE hActContact=hContact;
+ char * szActProto = (char*)szProto;
+ 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))
{
// substitute params by mostonline contact datas
- HANDLE hMostOnlineContact=(HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0);
+ HANDLE hMostOnlineContact = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT,(WPARAM)hActContact,0);
if (hMostOnlineContact)
{
pdisplayNameCacheEntry cacheEntry;
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hMostOnlineContact);
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hMostOnlineContact);
if (cacheEntry && cacheEntry->m_cache_cszProto)
{
- szActProto=cacheEntry->m_cache_cszProto;
- nActStatus=pdnce___GetStatus( cacheEntry );
- hActContact=hMostOnlineContact;
+ szActProto = cacheEntry->m_cache_cszProto;
+ nActStatus = pdnce___GetStatus( cacheEntry );
+ hActContact = hMostOnlineContact;
}
}
}
mir_snprintf(AdvancedService,SIZEOF(AdvancedService),"%s%s",szActProto,"/GetAdvancedStatusIcon");
if (ServiceExists(AdvancedService))
- result=CallService(AdvancedService,(WPARAM)hActContact, (LPARAM)0);
+ result = CallService(AdvancedService,(WPARAM)hActContact, (LPARAM)0);
- if (result==-1 || !(LOWORD(result)))
+ if (result == -1 || !(LOWORD(result)))
{
//Get normal Icon
- int basicIcon=corecli.pfnIconFromStatusMode(szActProto,nActStatus,NULL);
- if (result!=-1 && basicIcon!=1) result|=basicIcon;
- else result=basicIcon;
+ int basicIcon = corecli.pfnIconFromStatusMode(szActProto,nActStatus,NULL);
+ if (result != -1 && basicIcon != 1) result |= basicIcon;
+ else result = basicIcon;
}
}
else
{
- result=corecli.pfnIconFromStatusMode(szProto,nStatus,NULL);
+ result = corecli.pfnIconFromStatusMode(szProto,nStatus,NULL);
}
return result;
}
@@ -182,7 +182,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, HANDLE hContact) int GetContactIconC(pdisplayNameCacheEntry cacheEntry)
{
- return ExtIconFromStatusMode(cacheEntry->m_cache_hContact,cacheEntry->m_cache_cszProto,cacheEntry->m_cache_cszProto==NULL ? ID_STATUS_OFFLINE : pdnce___GetStatus( cacheEntry ));
+ return ExtIconFromStatusMode(cacheEntry->m_cache_hContact,cacheEntry->m_cache_cszProto,cacheEntry->m_cache_cszProto == NULL ? ID_STATUS_OFFLINE : pdnce___GetStatus( cacheEntry ));
}
//lParam
@@ -199,8 +199,8 @@ INT_PTR GetContactIcon(WPARAM wParam,LPARAM lParam) status = ID_STATUS_OFFLINE;
else
status = db_get_w((HANDLE) wParam, szProto, "Status", ID_STATUS_OFFLINE);
- res=ExtIconFromStatusMode((HANDLE)wParam,szProto,szProto==NULL?ID_STATUS_OFFLINE:status); //by FYR
- if (lParam==0 && res!=-1) res&=0xFFFF;
+ res = ExtIconFromStatusMode((HANDLE)wParam,szProto,szProto == NULL?ID_STATUS_OFFLINE:status); //by FYR
+ if (lParam == 0 && res != -1) res &= 0xFFFF;
return res;
}
void UninitTrayMenu();
@@ -219,8 +219,8 @@ int CListMod_ContactListShutdownProc(WPARAM wParam,LPARAM lParam) {
ModernUnhookEvent(hookSystemShutdown_CListMod);
FreeDisplayNameCache();
- if(g_hMainThread) CloseHandle(g_hMainThread);
- g_hMainThread=NULL;
+ if (g_hMainThread) CloseHandle(g_hMainThread);
+ g_hMainThread = NULL;
return 0;
}
@@ -259,9 +259,9 @@ HRESULT PreLoadContactListModule() {
/* Global data initialization */
{
- g_CluiData.fOnDesktop=FALSE;
- g_CluiData.dwKeyColor=RGB(255,0,255);
- g_CluiData.bCurrentAlpha=255;
+ g_CluiData.fOnDesktop = FALSE;
+ g_CluiData.dwKeyColor = RGB(255,0,255);
+ g_CluiData.bCurrentAlpha = 255;
}
//initialize firstly hooks
@@ -302,7 +302,7 @@ HRESULT CluiLoadModule() CreateServiceFunction(MS_CLIST_GETCONTACTICON,GetContactIcon);
- MySetProcessWorkingSetSize=(BOOL (WINAPI*)(HANDLE,SIZE_T,SIZE_T))GetProcAddress(GetModuleHandle(TEXT("kernel32")),"SetProcessWorkingSetSize");
+ MySetProcessWorkingSetSize = (BOOL (WINAPI*)(HANDLE,SIZE_T,SIZE_T))GetProcAddress(GetModuleHandle(TEXT("kernel32")),"SetProcessWorkingSetSize");
hCListImages = ImageList_Create(16, 16, ILC_MASK|ILC_COLOR32, 32, 0);
InitCustomMenus();
InitTray();
@@ -328,9 +328,9 @@ Begin of Hrk's code for bug int GetWindowVisibleState(HWND, int, int);
__inline DWORD GetDIBPixelColor(int X, int Y, int Width, int Height, int ByteWidth, BYTE * ptr)
{
- DWORD res=0;
- if (X>=0 && X<Width && Y>=0 && Y<Height && ptr)
- res=*((DWORD*)(ptr+ByteWidth*(Height-Y-1)+X*4));
+ DWORD res = 0;
+ if (X >= 0 && X < Width && Y >= 0 && Y < Height && ptr)
+ res = *((DWORD*)(ptr+ByteWidth*(Height-Y-1)+X*4));
return res;
}
@@ -366,91 +366,91 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) { int hstep,vstep;
BITMAP bmp;
HBITMAP WindowImage;
- int maxx=0;
- int maxy=0;
- int wx=0;
+ int maxx = 0;
+ int maxy = 0;
+ int wx = 0;
int dx,dy;
- BYTE *ptr=NULL;
- HRGN rgn=NULL;
- WindowImage=g_CluiData.fLayered?ske_GetCurrentWindowImage():0;
+ BYTE *ptr = NULL;
+ HRGN rgn = NULL;
+ WindowImage = g_CluiData.fLayered?ske_GetCurrentWindowImage():0;
if (WindowImage&&g_CluiData.fLayered)
{
GetObject(WindowImage,sizeof(BITMAP),&bmp);
- ptr=(BYTE*)bmp.bmBits;
- maxx=bmp.bmWidth;
- maxy=bmp.bmHeight;
- wx=bmp.bmWidthBytes;
+ ptr = (BYTE*)bmp.bmBits;
+ maxx = bmp.bmWidth;
+ maxy = bmp.bmHeight;
+ wx = bmp.bmWidthBytes;
}
else
{
RECT rc;
- int i=0;
- rgn=CreateRectRgn(0,0,1,1);
+ int i = 0;
+ rgn = CreateRectRgn(0,0,1,1);
GetWindowRect(hWnd,&rc);
GetWindowRgn(hWnd,rgn);
OffsetRgn(rgn,rc.left,rc.top);
GetRgnBox(rgn,&rc);
- i=i;
- //maxx=rc.right;
- //maxy=rc.bottom;
+ i = i;
+ //maxx = rc.right;
+ //maxy = rc.bottom;
}
GetWindowRect(hWnd, &rc);
{
- RECT rcMonitor={0};
+ RECT rcMonitor = {0};
Docking_GetMonitorRectFromWindow(hWnd,&rcMonitor);
- rc.top=rc.top<rcMonitor.top?rcMonitor.top:rc.top;
- rc.left=rc.left<rcMonitor.left?rcMonitor.left:rc.left;
- rc.bottom=rc.bottom>rcMonitor.bottom?rcMonitor.bottom:rc.bottom;
- rc.right=rc.right>rcMonitor.right?rcMonitor.right:rc.right;
+ rc.top = rc.top < rcMonitor.top?rcMonitor.top:rc.top;
+ rc.left = rc.left < rcMonitor.left?rcMonitor.left:rc.left;
+ rc.bottom = rc.bottom>rcMonitor.bottom?rcMonitor.bottom:rc.bottom;
+ rc.right = rc.right>rcMonitor.right?rcMonitor.right:rc.right;
}
width = rc.right - rc.left;
height = rc.bottom- rc.top;
- dx=-rc.left;
- dy=-rc.top;
- hstep=width/iStepX;
- vstep=height/iStepY;
- hstep=hstep>0?hstep:1;
- vstep=vstep>0?vstep:1;
-
- for (i = rc.top; i < rc.bottom; i+=vstep) {
+ dx = -rc.left;
+ dy = -rc.top;
+ hstep = width/iStepX;
+ vstep = height/iStepY;
+ hstep = hstep>0?hstep:1;
+ vstep = vstep>0?vstep:1;
+
+ for (i = rc.top; i < rc.bottom; i += vstep) {
pt.y = i;
- for (j = rc.left; j < rc.right; j+=hstep) {
- BOOL po=FALSE;
+ for (j = rc.left; j < rc.right; j += hstep) {
+ BOOL po = FALSE;
pt.x = j;
if (rgn)
- po=PtInRegion(rgn,j,i);
+ po = PtInRegion(rgn,j,i);
else
{
- DWORD a=(GetDIBPixelColor(j+dx,i+dy,maxx,maxy,wx,ptr)&0xFF000000)>>24;
- a=((a*g_CluiData.bCurrentAlpha)>>8);
- po=(a>16);
+ DWORD a = (GetDIBPixelColor(j+dx,i+dy,maxx,maxy,wx,ptr)&0xFF000000)>>24;
+ a = ((a*g_CluiData.bCurrentAlpha)>>8);
+ po = (a>16);
}
- if (po||(!rgn&&ptr==0))
+ if (po||(!rgn&&ptr == 0))
{
- BOOL hWndFound=FALSE;
- HWND hAuxOld=NULL;
+ BOOL hWndFound = FALSE;
+ HWND hAuxOld = NULL;
hAux = WindowFromPoint(pt);
do
{
- if (hAux==hWnd)
+ if (hAux == hWnd)
{
- hWndFound=TRUE;
+ hWndFound = TRUE;
break;
}
//hAux = GetParent(hAux);
- hAuxOld=hAux;
+ hAuxOld = hAux;
hAux = fnGetAncestor(hAux,GA_ROOTOWNER);
- if (hAuxOld==hAux)
+ if (hAuxOld == hAux)
{
TCHAR buf[255];
GetClassName(hAux,buf,SIZEOF(buf));
if (!lstrcmp(buf,CLUIFrameSubContainerClassName))
{
- hWndFound=TRUE;
+ hWndFound = TRUE;
break;
}
}
- }while(hAux!= NULL &&hAuxOld!=hAux);
+ }while(hAux != NULL &&hAuxOld != hAux);
if (hWndFound) //There's window!
iNotCoveredDots++; //Let's count the not covered dots.
@@ -459,7 +459,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) { }
}
if (rgn) DeleteObject(rgn);
- if ( iCountedDots - iNotCoveredDots<2) //Every dot was not covered: the window is visible.
+ if ( iCountedDots - iNotCoveredDots < 2) //Every dot was not covered: the window is visible.
return GWVS_VISIBLE;
else if (iNotCoveredDots == 0) //They're all covered!
return GWVS_COVERED;
@@ -467,17 +467,17 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) { return GWVS_PARTIALLY_COVERED;
}
}
-BYTE g_bCalledFromShowHide=0;
+BYTE g_bCalledFromShowHide = 0;
int cliShowHide(WPARAM wParam,LPARAM lParam)
{
BOOL bShow = FALSE;
int iVisibleState = GetWindowVisibleState(pcli->hwndContactList,0,0);
int method;
- method=db_get_b(NULL, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT);; //(0-none, 1-leftedge, 2-rightedge);
+ method = db_get_b(NULL, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT);; //(0-none, 1-leftedge, 2-rightedge);
if (method)
{
- if (db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT)==0 && lParam!=1)
+ if (db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT) == 0 && lParam != 1)
{
//hide
CLUI_HideBehindEdge();
@@ -486,16 +486,16 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) {
CLUI_ShowFromBehindEdge();
}
- bShow=TRUE;
- iVisibleState=GWVS_HIDDEN;
+ bShow = TRUE;
+ iVisibleState = GWVS_HIDDEN;
}
if (!method && db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT)>0)
{
- g_CluiData.bBehindEdgeSettings=db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT);
+ g_CluiData.bBehindEdgeSettings = db_get_b(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT);
CLUI_ShowFromBehindEdge();
- g_CluiData.bBehindEdgeSettings=0;
- g_CluiData.nBehindEdgeState=0;
+ g_CluiData.bBehindEdgeSettings = 0;
+ g_CluiData.nBehindEdgeState = 0;
db_unset(NULL, "ModernData", "BehindEdge");
}
@@ -522,10 +522,10 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) {
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;
+ g_bCalledFromShowHide = 1;
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;
+ g_bCalledFromShowHide = 0;
}
else
{
@@ -566,7 +566,7 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) }
}
- if (MySetProcessWorkingSetSize != NULL)
+ if (MySetProcessWorkingSetSize !=NULL)
MySetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
}
return 0;
diff --git a/plugins/Clist_modern/modern_clistopts.cpp b/plugins/Clist_modern/modern_clistopts.cpp index 5a3042d8ed..41ca2c64b1 100644 --- a/plugins/Clist_modern/modern_clistopts.cpp +++ b/plugins/Clist_modern/modern_clistopts.cpp @@ -35,7 +35,7 @@ static INT_PTR CALLBACK DlgProcItemContactTimeOpts(HWND hwndDlg, UINT msg, WPARA static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-static UINT expertOnlyControls[]={IDC_ALWAYSSTATUS};
+static UINT expertOnlyControls[] = {IDC_ALWAYSSTATUS};
struct
{
@@ -43,7 +43,7 @@ struct int id; // Dialog id
DLGPROC wnd_proc; // Dialog function
}
-static row_opt_items[] =
+static row_opt_items[] =
{
{ LPGEN("Row"), IDD_OPT_ITEM_ROW, DlgProcItemRowOpts },
#ifdef _DEBUG
@@ -71,7 +71,7 @@ int CListOptInit(WPARAM wParam,LPARAM lParam) odp.flags = ODPF_BOLDGROUPS;
{
BOOL hasExtraIconsService = ServiceExists("ExtraIcon/Register");
- for (int i=0; i < SIZEOF(row_opt_items); i++) {
+ for (int i = 0; i < SIZEOF(row_opt_items); i++) {
if (hasExtraIconsService && row_opt_items[i].id == IDD_OPT_ITEM_EXTRAICONS)
continue;
@@ -123,7 +123,7 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam {
char tmp[128];
int type;
- int pos=0;
+ int pos = 0;
mir_snprintf(tmp, SIZEOF(tmp), "RowPos%d", i);
type = db_get_w(NULL, "CList", tmp, i);
@@ -184,14 +184,14 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam }
case WM_COMMAND:
{
- if (LOWORD(wParam)==IDC_UP)
+ if (LOWORD(wParam) == IDC_UP)
{
if (HIWORD(wParam) == BN_CLICKED)
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST_ORDER);
int pos = SendMessage(hwndList, LB_GETCURSEL, 0, 0);
- if (pos != LB_ERR)
+ if (pos !=LB_ERR)
{
int type = SendMessage(hwndList, LB_GETITEMDATA, pos, 0);
@@ -236,14 +236,14 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam else return 0;
}
- if (LOWORD(wParam)==IDC_DOWN)
+ if (LOWORD(wParam) == IDC_DOWN)
{
if (HIWORD(wParam) == BN_CLICKED)
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_LIST_ORDER);
int pos = SendMessage(hwndList, LB_GETCURSEL, 0, 0);
- if (pos != LB_ERR)
+ if (pos !=LB_ERR)
{
int type = SendMessage(hwndList, LB_GETITEMDATA, pos, 0);
@@ -288,17 +288,17 @@ static INT_PTR CALLBACK DlgProcItemRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam else return 0;
}
- if (LOWORD(wParam)==IDC_LIST_ORDER || LOWORD(wParam)==IDC_UP || LOWORD(wParam)==IDC_DOWN)
+ if (LOWORD(wParam) == IDC_LIST_ORDER || LOWORD(wParam) == IDC_UP || LOWORD(wParam) == IDC_DOWN)
{
int pos = SendMessage(GetDlgItem(hwndDlg, IDC_LIST_ORDER), LB_GETCURSEL, 0, 0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_UP),pos != LB_ERR && pos > 0);
- EnableWindow(GetDlgItem(hwndDlg,IDC_DOWN),pos != LB_ERR && pos < 4);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_UP),pos !=LB_ERR && pos > 0);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_DOWN),pos !=LB_ERR && pos < 4);
}
- if (LOWORD(wParam)==IDC_LIST_ORDER) return 0;
- if (LOWORD(wParam)==IDC_MIN_ROW_HEIGHT && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; // dont make apply enabled during buddy set crap
- if ((LOWORD(wParam)==IDC_LEFTMARGIN || LOWORD(wParam)==IDC_RIGHTMARGIN || LOWORD(wParam)==IDC_ROW_BORDER) && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; // dont make apply enabled during buddy set crap
+ if (LOWORD(wParam) == IDC_LIST_ORDER) return 0;
+ if (LOWORD(wParam) == IDC_MIN_ROW_HEIGHT && HIWORD(wParam) !=EN_CHANGE || (HWND)lParam !=GetFocus()) return 0; // dont make apply enabled during buddy set crap
+ if ((LOWORD(wParam) == IDC_LEFTMARGIN || LOWORD(wParam) == IDC_RIGHTMARGIN || LOWORD(wParam) == IDC_ROW_BORDER) && HIWORD(wParam) !=EN_CHANGE || (HWND)lParam !=GetFocus()) return 0; // dont make apply enabled during buddy set crap
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, 0, 0);
break;
@@ -455,7 +455,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa }
case WM_COMMAND:
{
- if (LOWORD(wParam)==IDC_SHOW_AVATARS)
+ if (LOWORD(wParam) == IDC_SHOW_AVATARS)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_DRAW_BORDER),enabled);
@@ -475,7 +475,7 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_PIXELS3),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_ANIAVATARS),enabled && (ServiceExists(MS_AV_GETAVATARBITMAP)&&!g_CluiData.fGDIPlusFail));
- // if (DBGetContactSettingByte(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT)==1)
+ // if (DBGetContactSettingByte(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT) == 1)
// {
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_WIDTH),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_WIDTH_SPIN),enabled);
@@ -490,19 +490,19 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa // EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_SIZE_PIXELS),FALSE);
// }
}
- else if (LOWORD(wParam)==IDC_SHOW_ANIAVATARS)
+ else if (LOWORD(wParam) == IDC_SHOW_ANIAVATARS)
{
EnableWindow( GetDlgItem( hwndDlg, IDC_AVATAR_FASTDRAW), IsDlgButtonChecked( hwndDlg, IDC_SHOW_ANIAVATARS ));
}
- else if (LOWORD(wParam)==IDC_AVATAR_DRAW_BORDER)
+ else if (LOWORD(wParam) == IDC_AVATAR_DRAW_BORDER)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS) && IsDlgButtonChecked(hwndDlg,IDC_AVATAR_DRAW_BORDER);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR_L),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_BORDER_COLOR),enabled);
}
- else if (LOWORD(wParam)==IDC_AVATAR_ROUND_CORNERS)
+ else if (LOWORD(wParam) == IDC_AVATAR_ROUND_CORNERS)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS) && IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK),enabled);
@@ -510,14 +510,14 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),enabled);
}
- else if (LOWORD(wParam)==IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK)
+ else if (LOWORD(wParam) == IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_AVATAR_ROUND_CORNERS);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE),enabled&&IsDlgButtonChecked(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK));
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_SPIN),enabled&&IsDlgButtonChecked(hwndDlg,IDC_AVATAR_CUSTOM_CORNER_SIZE_CHECK));
}
- else if(LOWORD(wParam)==IDC_AVATAR_OVERLAY_ICONS)
+ else if (LOWORD(wParam) == IDC_AVATAR_OVERLAY_ICONS)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_SHOW_AVATARS) && IsDlgButtonChecked(hwndDlg,IDC_AVATAR_OVERLAY_ICONS);
@@ -525,8 +525,8 @@ static INT_PTR CALLBACK DlgProcItemAvatarOpts(HWND hwndDlg, UINT msg, WPARAM wPa EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_PROTOCOL),enabled);
EnableWindow(GetDlgItem(hwndDlg,IDC_AVATAR_OVERLAY_ICON_CONTACT),enabled);
}
- else if (LOWORD(wParam)==IDC_AVATAR_SIZE && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; // dont make apply enabled during buddy set crap
- else if (LOWORD(wParam)==IDC_AVATAR_CUSTOM_CORNER_SIZE && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; // dont make apply enabled during buddy set crap
+ else if (LOWORD(wParam) == IDC_AVATAR_SIZE && HIWORD(wParam) !=EN_CHANGE || (HWND)lParam !=GetFocus()) return 0; // dont make apply enabled during buddy set crap
+ else if (LOWORD(wParam) == IDC_AVATAR_CUSTOM_CORNER_SIZE && HIWORD(wParam) !=EN_CHANGE || (HWND)lParam !=GetFocus()) return 0; // dont make apply enabled during buddy set crap
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, 0, 0);
break;
@@ -608,12 +608,12 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara }
case WM_COMMAND:
{
- if (LOWORD(wParam)==IDC_HIDE_ICON_ON_AVATAR)
+ if (LOWORD(wParam) == IDC_HIDE_ICON_ON_AVATAR)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_HIDE_ICON_ON_AVATAR);
EnableWindow(GetDlgItem(hwndDlg,IDC_DRAW_ON_AVATAR_SPACE),enabled);
}
- else if (LOWORD(wParam)==IDC_USEXSTATUS)
+ else if (LOWORD(wParam) == IDC_USEXSTATUS)
EnableWindow(GetDlgItem(hwndDlg,IDC_DRAWSTATUSOVERLAY),IsDlgButtonChecked(hwndDlg,IDC_USEXSTATUS));
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -637,8 +637,8 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara db_set_b(NULL,"CList","AlwaysShowAlwaysVisIcon", (BYTE)IsDlgButtonChecked(hwndDlg,IDC_ALWAYS_VISIBLEICON));
{
- BYTE ovr=IsDlgButtonChecked(hwndDlg,IDC_USEXSTATUS)?1:0;
- if (ovr) ovr+=IsDlgButtonChecked(hwndDlg,IDC_DRAWSTATUSOVERLAY)?2:0;
+ BYTE ovr = IsDlgButtonChecked(hwndDlg,IDC_USEXSTATUS)?1:0;
+ if (ovr) ovr += IsDlgButtonChecked(hwndDlg,IDC_DRAWSTATUSOVERLAY)?2:0;
db_set_b(NULL,"CLC","DrawOverlayedStatus", ovr );
}
ClcOptionsChanged();
@@ -711,9 +711,9 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara //TODO: init IDC_ALIGNGROUPCOMBO from DBGetContactSettingByte(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT);
{
int i, item;
- TCHAR *align[]={_T("Left align group names"), _T("Center group names"), _T("Right align group names")};
- for (i=0; i<sizeof(align)/sizeof(char*); i++)
- item=SendDlgItemMessage(hwndDlg,IDC_ALIGNGROUPCOMBO,CB_ADDSTRING,0,(LPARAM)TranslateTS(align[i]));
+ TCHAR *align[] = {_T("Left align group names"), _T("Center group names"), _T("Right align group names")};
+ for (i = 0; i < sizeof(align)/sizeof(char*); i++)
+ item = SendDlgItemMessage(hwndDlg,IDC_ALIGNGROUPCOMBO,CB_ADDSTRING,0,(LPARAM)TranslateTS(align[i]));
SendDlgItemMessage(hwndDlg,IDC_ALIGNGROUPCOMBO,CB_SETCURSEL,db_get_b(NULL,"CList","AlignGroupCaptions",SETTING_ALIGNGROPCAPTION_DEFAULT),0);
}
CheckDlgButton(hwndDlg, IDC_ALIGN_RIGHT, db_get_b(NULL,"CList","TextAlignToRight",SETTING_TEXT_RIGHTALIGN_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
@@ -726,7 +726,7 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara CheckDlgButton(hwndDlg, IDC_APPEND_NICK, db_get_b(NULL,"CList","FirstLineAppendNick",SETTING_FIRSTLINE_APPENDNICK_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
CheckDlgButton(hwndDlg, IDC_TRIM_TEXT, db_get_b(NULL,"CList","TrimText",SETTING_FIRSTLINE_TRIMTEXT_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- bool smileAddPresent = ServiceExists(MS_SMILEYADD_BATCHPARSE) != 0;
+ bool smileAddPresent = ServiceExists(MS_SMILEYADD_BATCHPARSE) !=0;
CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_REPLACE_SMILEYS), smileAddPresent ? SW_SHOW : SW_HIDE);
CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS), smileAddPresent ? SW_SHOW : SW_HIDE);
//CLUI_ShowWindowMod(GetDlgItem(hwndDlg,IDC_RESIZE_SMILEYS), smileAddPresent ? SW_SHOW : SW_HIDE);
@@ -742,13 +742,13 @@ static INT_PTR CALLBACK DlgProcItemTextOpts(HWND hwndDlg, UINT msg, WPARAM wPara }
case WM_COMMAND:
{
- if (LOWORD(wParam)==IDC_REPLACE_SMILEYS)
+ if (LOWORD(wParam) == IDC_REPLACE_SMILEYS)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_REPLACE_SMILEYS);
EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),enabled);
//EnableWindow(GetDlgItem(hwndDlg,IDC_RESIZE_SMILEYS),enabled); //Commented out for listening to icon
}
- if (LOWORD(wParam)!=IDC_ALIGNGROUPCOMBO || (LOWORD(wParam)==IDC_ALIGNGROUPCOMBO && HIWORD(wParam)==CBN_SELCHANGE))
+ if (LOWORD(wParam) != IDC_ALIGNGROUPCOMBO || (LOWORD(wParam) == IDC_ALIGNGROUPCOMBO && HIWORD(wParam) == CBN_SELCHANGE))
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, 0, 0);
break;
}
@@ -805,7 +805,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL,"CList","SecondLineDrawSmileys",SETTING_SECONDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED);
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if (!DBGetContactSettingTString(NULL, "CList","SecondLineText", &dbv))
{
@@ -877,8 +877,8 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM }
case WM_COMMAND:
{
- if (LOWORD(wParam)==IDC_TEXT || LOWORD(wParam)==IDC_STATUS || LOWORD(wParam)==IDC_NICKNAME || LOWORD(wParam)==IDC_STATUS_MESSAGE
- || LOWORD(wParam)==IDC_LISTENING_TO || LOWORD(wParam)==IDC_CONTACT_TIME)
+ if (LOWORD(wParam) == IDC_TEXT || LOWORD(wParam) == IDC_STATUS || LOWORD(wParam) == IDC_NICKNAME || LOWORD(wParam) == IDC_STATUS_MESSAGE
+ || LOWORD(wParam) == IDC_LISTENING_TO || LOWORD(wParam) == IDC_CONTACT_TIME)
{
EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), IsDlgButtonChecked(hwndDlg,IDC_TEXT)
&& IsDlgButtonChecked(hwndDlg,IDC_SHOW));
@@ -895,7 +895,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM (IsDlgButtonChecked(hwndDlg,IDC_STATUS)
|| IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)));
}
- else if (LOWORD(wParam)==IDC_SHOW)
+ else if (LOWORD(wParam) == IDC_SHOW)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_SHOW);
EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),enabled);
@@ -923,7 +923,7 @@ static INT_PTR CALLBACK DlgProcItemSecondLineOpts(HWND hwndDlg, UINT msg, WPARAM || IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)));
}
- if (LOWORD(wParam)==IDC_TOP_SPACE && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; // dont make apply enabled during buddy set crap
+ if (LOWORD(wParam) == IDC_TOP_SPACE && HIWORD(wParam) !=EN_CHANGE || (HWND)lParam !=GetFocus()) return 0; // dont make apply enabled during buddy set crap
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, 0, 0);
break;
@@ -1002,7 +1002,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM CheckDlgButton(hwndDlg, IDC_DRAW_SMILEYS, db_get_b(NULL,"CList","ThirdLineDrawSmileys",SETTING_THIRDLINE_SMILEYS_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if (!DBGetContactSettingTString(NULL, "CList","ThirdLineText", &dbv))
{
@@ -1074,8 +1074,8 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM }
case WM_COMMAND:
{
- if (LOWORD(wParam)==IDC_TEXT || LOWORD(wParam)==IDC_STATUS || LOWORD(wParam)==IDC_NICKNAME || LOWORD(wParam)==IDC_STATUS_MESSAGE
- || LOWORD(wParam)==IDC_LISTENING_TO || LOWORD(wParam)==IDC_CONTACT_TIME)
+ if (LOWORD(wParam) == IDC_TEXT || LOWORD(wParam) == IDC_STATUS || LOWORD(wParam) == IDC_NICKNAME || LOWORD(wParam) == IDC_STATUS_MESSAGE
+ || LOWORD(wParam) == IDC_LISTENING_TO || LOWORD(wParam) == IDC_CONTACT_TIME)
{
EnableWindow(GetDlgItem(hwndDlg,IDC_VARIABLE_TEXT), IsDlgButtonChecked(hwndDlg,IDC_TEXT)
&& IsDlgButtonChecked(hwndDlg,IDC_SHOW));
@@ -1088,7 +1088,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_STATUS_IF_NOAWAY), IsDlgButtonChecked(hwndDlg,IDC_SHOW) && (IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)));
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_LISTENING_IF_NOAWAY), IsDlgButtonChecked(hwndDlg,IDC_SHOW) && (IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE)));
}
- else if (LOWORD(wParam)==IDC_SHOW)
+ else if (LOWORD(wParam) == IDC_SHOW)
{
BOOL enabled = IsDlgButtonChecked(hwndDlg,IDC_SHOW);
EnableWindow(GetDlgItem(hwndDlg,IDC_USE_PROTOCOL_SMILEYS),enabled);
@@ -1116,7 +1116,7 @@ static INT_PTR CALLBACK DlgProcItemThirdLineOpts(HWND hwndDlg, UINT msg, WPARAM EnableWindow(GetDlgItem(hwndDlg,IDC_SHOW_LISTENING_IF_NOAWAY), enabled && IsDlgButtonChecked(hwndDlg,IDC_STATUS_MESSAGE));
}
- if (LOWORD(wParam)==IDC_TOP_SPACE && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; // dont make apply enabled during buddy set crap
+ if (LOWORD(wParam) == IDC_TOP_SPACE && HIWORD(wParam) !=EN_CHANGE || (HWND)lParam !=GetFocus()) return 0; // dont make apply enabled during buddy set crap
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, 0, 0);
break;
@@ -1188,7 +1188,7 @@ typedef struct _OrderTreeData BOOL fReserved;
} *pOrderTreeData, TOrderTreeData;
-static TOrderTreeData OrderTreeData[]=
+static TOrderTreeData OrderTreeData[] =
{
{EXTRA_ICON_VISMODE, _T("Visibility/Chat activity"), EXTRA_ICON_VISMODE, "EXTRA_ICON_VISMODE", SETTING_EXTRA_ICON_VISMODE_DEFAULT,0},
{EXTRA_ICON_EMAIL, _T("E-mail"), EXTRA_ICON_EMAIL, "EXTRA_ICON_EMAIL", SETTING_EXTRA_ICON_EMAIL_DEFAULT, 0},
@@ -1206,30 +1206,30 @@ static TOrderTreeData OrderTreeData[]= /*
int ReserveExtraSlot(WPARAM wParam,LPARAM lParam)
{
- int iLastFree=-1;
- EXTRASLOTINFO * pESINFO=(EXTRASLOTINFO *)wParam;
- if (pESINFO->iSlot==0)
+ int iLastFree = -1;
+ EXTRASLOTINFO * pESINFO = (EXTRASLOTINFO *)wParam;
+ if (pESINFO->iSlot == 0)
{
int i;
- for (i=8;i<SIZEOF(OrderTreeData);i++)
- if (OrderTreeData[i].fReserved==0)
- { iLastFree=i; break; }
+ for (i = 8;i < SIZEOF(OrderTreeData);i++)
+ if (OrderTreeData[i].fReserved == 0)
+ { iLastFree = i; break; }
}
- else if (pESINFO->iSlot<SIZEOF(OrderTreeData))
- iLastFree=pESINFO->iSlot;
+ else if (pESINFO->iSlot < SIZEOF(OrderTreeData))
+ iLastFree = pESINFO->iSlot;
if (iLastFree>0)
{
if (!OrderTreeData[iLastFree].fReserved)
{
- OrderTreeData[iLastFree].fReserved=TRUE;
- OrderTreeData[iLastFree].KeyName=pESINFO->pszSlotID;
+ OrderTreeData[iLastFree].fReserved = TRUE;
+ OrderTreeData[iLastFree].KeyName = pESINFO->pszSlotID;
if (pESINFO->fUnicode)
- OrderTreeData[iLastFree].Name=pESINFO->ptszSlotName;
+ OrderTreeData[iLastFree].Name = pESINFO->ptszSlotName;
else
{
- OrderTreeData[iLastFree].Name=mir_a2u(pESINFO->pszSlotName); //potential memory leak but should not be more than once
- OrderTreeData[iLastFree].fReserved=(BOOL)2; //need to free KeyName
+ OrderTreeData[iLastFree].Name = mir_a2u(pESINFO->pszSlotName); //potential memory leak but should not be more than once
+ OrderTreeData[iLastFree].fReserved = (BOOL)2; //need to free KeyName
}
}
else return -1; // Already reserved
@@ -1246,77 +1246,77 @@ static int nArrayLen; static int OrderEnumProc (const char *szSetting,LPARAM lParam)
{
- if (szSetting==NULL) return 0;
+ if (szSetting == NULL) return 0;
if (!wildcmp((char*) szSetting,(char *) lParam,0)) return 0;
nArrayLen++;
- settingname=(char **)realloc(settingname,nArrayLen*sizeof(char *));
- settingname[nArrayLen-1]=_strdup(szSetting);
+ settingname = (char **)realloc(settingname,nArrayLen*sizeof(char *));
+ settingname[nArrayLen-1] = _strdup(szSetting);
return 0;
};
static int DeleteAllSettingInOrder()
{
DBCONTACTENUMSETTINGS dbces;
- nArrayLen=0;
+ nArrayLen = 0;
- dbces.pfnEnumProc=OrderEnumProc;
- dbces.szModule=CLUIFrameModule;
- dbces.ofsSettings=0;
- dbces.lParam=(LPARAM)"ORDER_EXTRA_*";
+ dbces.pfnEnumProc = OrderEnumProc;
+ dbces.szModule = CLUIFrameModule;
+ dbces.ofsSettings = 0;
+ dbces.lParam = (LPARAM)"ORDER_EXTRA_*";
CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
//delete all settings
- if (nArrayLen==0){return(0);};
+ if (nArrayLen == 0){return(0);};
{
int i;
- for (i=0;i<nArrayLen;i++)
+ for (i = 0;i < nArrayLen;i++)
{
db_unset(0,CLUIFrameModule,settingname[i]);
free(settingname[i]);
};
free(settingname);
- settingname=NULL;
+ settingname = NULL;
};
return(0);
};
static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
- pOrderTreeData A=(pOrderTreeData)lParam1;
- pOrderTreeData B=(pOrderTreeData)lParam2;
+ pOrderTreeData A = (pOrderTreeData)lParam1;
+ pOrderTreeData B = (pOrderTreeData)lParam2;
return (int)(A->Position)-(int)(B->Position);
}
static int FillOrderTree(HWND hwndDlg, HWND Tree)
{
- int i=0;
- TVINSERTSTRUCT tvis={0};
+ int i = 0;
+ TVINSERTSTRUCT tvis = {0};
TreeView_DeleteAllItems(Tree);
- tvis.hParent=NULL;
- tvis.hInsertAfter=TVI_LAST;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- if (db_get_b(NULL,CLUIFrameModule,"ExtraCountStored",0)!=SIZEOF(OrderTreeData))
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ if (db_get_b(NULL,CLUIFrameModule,"ExtraCountStored",0) != SIZEOF(OrderTreeData))
{
DeleteAllSettingInOrder();
db_set_b(NULL,CLUIFrameModule,"ExtraCountStored",SIZEOF(OrderTreeData));
}
- for (i=0; i<SIZEOF(OrderTreeData); i++)
+ for (i = 0; i < SIZEOF(OrderTreeData); i++)
{
char buf[256];
sprintf(buf,"ORDER_%s",OrderTreeData[i].KeyName);
- OrderTreeData[i].Position=(BYTE)db_get_b(NULL,CLUIFrameModule,buf,i);
- OrderTreeData[i].Visible =(BOOL)db_get_b(NULL,CLUIFrameModule,OrderTreeData[i].KeyName,1);
- tvis.hInsertAfter=TVI_LAST;
- tvis.item.lParam=(LPARAM)(&(OrderTreeData[i]));
- tvis.item.pszText=TranslateTS(OrderTreeData[i].Name);
- tvis.item.iImage=tvis.item.iSelectedImage=OrderTreeData[i].Visible;
+ OrderTreeData[i].Position = (BYTE)db_get_b(NULL,CLUIFrameModule,buf,i);
+ OrderTreeData[i].Visible = (BOOL)db_get_b(NULL,CLUIFrameModule,OrderTreeData[i].KeyName,1);
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.lParam = (LPARAM)(&(OrderTreeData[i]));
+ tvis.item.pszText = TranslateTS(OrderTreeData[i].Name);
+ tvis.item.iImage = tvis.item.iSelectedImage = OrderTreeData[i].Visible;
TreeView_InsertItem(Tree,&tvis);
}
{
- TVSORTCB sort={0};
- sort.hParent=NULL;
- sort.lParam=0;
- sort.lpfnCompare=CompareFunc;
+ TVSORTCB sort = {0};
+ sort.hParent = NULL;
+ sort.lParam = 0;
+ sort.lpfnCompare = CompareFunc;
TreeView_SortChildrenCB(Tree,&sort,0);
}
return 0;
@@ -1324,23 +1324,23 @@ static int FillOrderTree(HWND hwndDlg, HWND Tree) static int SaveOrderTree(HWND hwndDlg, HWND Tree)
{
HTREEITEM ht;
- BYTE pos=0;
- TVITEMA tvi={0};
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
- ht=TreeView_GetRoot(Tree);
+ BYTE pos = 0;
+ TVITEMA tvi = {0};
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_PARAM;
+ ht = TreeView_GetRoot(Tree);
do
{
- TOrderTreeData * it=NULL;
- tvi.hItem=ht;
+ TOrderTreeData * it = NULL;
+ tvi.hItem = ht;
TreeView_GetItemA(Tree,&tvi);
- it=(TOrderTreeData*)(tvi.lParam);
+ it = (TOrderTreeData*)(tvi.lParam);
{
char buf[250];
sprintf(buf,"ORDER_%s",it->KeyName);
db_set_b(NULL,CLUIFrameModule,buf,pos);
db_set_b(NULL,CLUIFrameModule,it->KeyName, it->Visible);
}
- ht=TreeView_GetNextSibling(Tree,ht);
+ ht = TreeView_GetNextSibling(Tree,ht);
pos++;
}while (ht);
@@ -1349,23 +1349,23 @@ static int SaveOrderTree(HWND hwndDlg, HWND Tree) int LoadPositionsFromDB(BYTE * OrderPos)
{
- int i=0;
- if (db_get_b(NULL,CLUIFrameModule,"ExtraCountStored",0)!=SIZEOF(OrderTreeData))
+ int i = 0;
+ if (db_get_b(NULL,CLUIFrameModule,"ExtraCountStored",0) != SIZEOF(OrderTreeData))
{
DeleteAllSettingInOrder();
db_set_b(NULL,CLUIFrameModule,"ExtraCountStored",SIZEOF(OrderTreeData));
}
- for (i=0; i<SIZEOF(OrderTreeData); i++)
+ for (i = 0; i < SIZEOF(OrderTreeData); i++)
{
char buf[256];
sprintf(buf,"ORDER_%s",OrderTreeData[i].KeyName);
- OrderPos[OrderTreeData[i].ID-1]=(BYTE)db_get_b(NULL,CLUIFrameModule,buf,i);
+ OrderPos[OrderTreeData[i].ID-1] = (BYTE)db_get_b(NULL,CLUIFrameModule,buf,i);
}
return 0;
}
-static int dragging=0;
-static HANDLE hDragItem=NULL;
+static int dragging = 0;
+static HANDLE hDragItem = NULL;
INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
@@ -1378,7 +1378,7 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
HIMAGELIST himlCheckBoxes;
- himlCheckBoxes=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
+ himlCheckBoxes = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_NOTICK)));
ImageList_AddIcon(himlCheckBoxes,LoadSmallIconShared(GetModuleHandle(NULL),MAKEINTRESOURCE(IDI_TICK)));
TreeView_SetImageList(GetDlgItem(hwndDlg,IDC_EXTRAORDER),himlCheckBoxes,TVSIL_NORMAL);
@@ -1417,25 +1417,25 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP case TVN_BEGINDRAGA:
case TVN_BEGINDRAGW:
SetCapture(hwndDlg);
- dragging=1;
- hDragItem=((LPNMTREEVIEWA)lParam)->itemNew.hItem;
+ dragging = 1;
+ hDragItem = ((LPNMTREEVIEWA)lParam)->itemNew.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
break;
case NM_CLICK:
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
+ 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)
+ 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;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
TreeView_GetItemA(((LPNMHDR)lParam)->hwndFrom,&tvi);
- tvi.iImage=tvi.iSelectedImage=!tvi.iImage;
- ((TOrderTreeData *)tvi.lParam)->Visible=tvi.iImage;
+ tvi.iImage = tvi.iSelectedImage = !tvi.iImage;
+ ((TOrderTreeData *)tvi.lParam)->Visible = tvi.iImage;
TreeView_SetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
}
@@ -1452,15 +1452,15 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (!dragging) break;
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg,&hti.pt);
ScreenToClient(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti.pt);
TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
- if(hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT))
+ if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT))
{
- HTREEITEM it=hti.hItem;
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
+ HTREEITEM it = hti.hItem;
+ hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
//TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hti.hItem,1);
if (!(hti.flags&TVHT_ABOVE))
@@ -1470,8 +1470,8 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP }
else
{
- if(hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEUP,0),0);
- if(hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEDOWN,0),0);
+ if (hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEUP,0),0);
+ if (hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg,IDC_EXTRAORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEDOWN,0),0);
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
}
}
@@ -1481,36 +1481,36 @@ INT_PTR CALLBACK DlgProcExtraIconsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
if (!dragging) break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_EXTRAORDER),NULL,0);
- dragging=0;
+ dragging = 0;
ReleaseCapture();
{
TVHITTESTINFO hti;
TVITEM tvi;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg,&hti.pt);
ScreenToClient(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti.pt);
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
+ hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_EXTRAORDER))/2;
TreeView_HitTest(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&hti);
- if(hDragItem==hti.hItem) break;
- if (hti.flags&TVHT_ABOVE) hti.hItem=TVI_FIRST;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=(HTREEITEM)hDragItem;
+ if (hDragItem == hti.hItem) break;
+ if (hti.flags&TVHT_ABOVE) hti.hItem = TVI_FIRST;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = (HTREEITEM)hDragItem;
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvi);
- if(hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)||(hti.hItem==TVI_FIRST))
+ if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)||(hti.hItem == TVI_FIRST))
{
TVINSERTSTRUCT tvis;
TCHAR name[128];
- tvis.item.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvis.item.stateMask=0xFFFFFFFF;
- tvis.item.pszText=name;
- tvis.item.cchTextMax=sizeof(name);
- tvis.item.hItem=(HTREEITEM)hDragItem;
- tvis.item.iImage=tvis.item.iSelectedImage=((TOrderTreeData *)tvi.lParam)->Visible;
+ tvis.item.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvis.item.stateMask = 0xFFFFFFFF;
+ tvis.item.pszText = name;
+ tvis.item.cchTextMax = sizeof(name);
+ tvis.item.hItem = (HTREEITEM)hDragItem;
+ tvis.item.iImage = tvis.item.iSelectedImage = ((TOrderTreeData *)tvi.lParam)->Visible;
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis.item);
TreeView_DeleteItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),hDragItem);
- tvis.hParent=NULL;
- tvis.hInsertAfter=hti.hItem;
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = hti.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),TreeView_InsertItem(GetDlgItem(hwndDlg,IDC_EXTRAORDER),&tvis));
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
}
diff --git a/plugins/Clist_modern/modern_clistsettings.cpp b/plugins/Clist_modern/modern_clistsettings.cpp index 8eafbeb06d..f5134b289f 100644 --- a/plugins/Clist_modern/modern_clistsettings.cpp +++ b/plugins/Clist_modern/modern_clistsettings.cpp @@ -34,25 +34,24 @@ void CListSettings_FreeCacheItemDataOption( pdisplayNameCacheEntry pDst, DWORD f int PostAutoRebuidMessage(HWND hwnd);
static int displayNameCacheSize;
-BOOL CLM_AUTOREBUILD_WAS_POSTED=FALSE;
+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;
+TCHAR *UnknownConctactTranslatedName = NULL;
void InvalidateDNCEbyPointer(HANDLE hContact,pdisplayNameCacheEntry pdnce,int SettingType);
static int handleCompare( void* c1, void* c2 )
{
-
INT_PTR p1, p2;
- displayNameCacheEntry * dnce1=(displayNameCacheEntry *)c1;
- displayNameCacheEntry * dnce2=(displayNameCacheEntry *)c2;
+ displayNameCacheEntry * dnce1 = (displayNameCacheEntry *)c1;
+ displayNameCacheEntry * dnce2 = (displayNameCacheEntry *)c2;
- p1=(INT_PTR)dnce1->m_cache_hContact;
- p2=(INT_PTR)dnce2->m_cache_hContact;
+ p1 = (INT_PTR)dnce1->m_cache_hContact;
+ p2 = (INT_PTR)dnce2->m_cache_hContact;
if ( p1 == p2 )
return 0;
@@ -65,17 +64,18 @@ void UninitCacheAsync(); void InitDisplayNameCache(void)
{
- int i=0;
- InitCacheAsync();
+ int i = 0;
+ InitCacheAsync();
InitAwayMsgModule();
clistCache = List_Create( 0, 50 );
clistCache->sortFunc = handleCompare;
}
+
void FreeDisplayNameCache()
{
- UninitCacheAsync();
+ UninitCacheAsync();
UninitAwayMsgModule();
- if ( clistCache != NULL ) {
+ if ( clistCache !=NULL ) {
int i;
for ( i = 0; i < clistCache->realCount; i++) {
pcli->pfnFreeCacheItem(( ClcCacheEntryBase* )clistCache->items[i] );
@@ -88,14 +88,13 @@ void FreeDisplayNameCache() }
}
-
ClcCacheEntryBase* cliGetCacheEntry(HANDLE hContact)
{
ClcCacheEntryBase* p;
int idx;
if (!clistCache) return NULL;
if ( !List_GetIndex( clistCache, &hContact, &idx )) {
- if (( p = pcli->pfnCreateCacheItem( hContact )) != NULL ) {
+ if (( p = pcli->pfnCreateCacheItem( hContact )) !=NULL ) {
List_Insert( clistCache, p, idx );
pcli->pfnInvalidateDisplayNameCacheEntry( hContact );
}
@@ -105,6 +104,11 @@ ClcCacheEntryBase* cliGetCacheEntry(HANDLE hContact) return p;
}
+static void free_and_nil_tcsName(TCHAR* &p)
+{
+ if (p && p != UnknownConctactTranslatedName)
+ mir_free_and_nill(p);
+}
void CListSettings_FreeCacheItemData(pdisplayNameCacheEntry pDst)
{
@@ -113,22 +117,17 @@ void CListSettings_FreeCacheItemData(pdisplayNameCacheEntry pDst) void CListSettings_FreeCacheItemDataOption( pdisplayNameCacheEntry pDst, DWORD flag )
{
- if (!pDst) return;
- if ( flag & CCI_NAME)
- {
- if (pDst->m_cache_tcsName)
- {
- if (!pDst->isUnknown && pDst->m_cache_tcsName!=UnknownConctactTranslatedName) mir_free_and_nill(pDst->m_cache_tcsName);
-
- }
- if (pDst->m_cache_szName) mir_free_and_nill(pDst->m_cache_szName);
+ if (!pDst) return;
+ if ( flag & CCI_NAME) {
+ if (!pDst->isUnknown) free_and_nil_tcsName(pDst->m_cache_tcsName);
+
+ if (pDst->m_cache_szName) mir_free_and_nill(pDst->m_cache_szName);
}
- if ( flag & CCI_GROUP )
+ if ( flag & CCI_GROUP )
if (pDst->m_cache_tcsGroup) mir_free_and_nill(pDst->m_cache_tcsGroup);
- if ( flag & CCI_LINES )
- {
+ if ( flag & CCI_LINES ) {
if (pDst->szSecondLineText) mir_free_and_nill(pDst->szSecondLineText);
if (pDst->szThirdLineText) mir_free_and_nill(pDst->szThirdLineText);
pDst->ssSecondLine.DestroySmileyList();
@@ -136,28 +135,27 @@ void CListSettings_FreeCacheItemDataOption( pdisplayNameCacheEntry pDst, DWORD f }
}
-
int CListSettings_GetCopyFromCache(pdisplayNameCacheEntry pDest, DWORD flag);
int CListSettings_SetToCache(pdisplayNameCacheEntry pSrc, DWORD flag);
void CListSettings_CopyCacheItems(pdisplayNameCacheEntry pDst, pdisplayNameCacheEntry pSrc, DWORD flag)
{
- if (!pDst||!pSrc) return;
- CListSettings_FreeCacheItemDataOption(pDst, flag);
+ if (!pDst||!pSrc) return;
+ CListSettings_FreeCacheItemDataOption(pDst, flag);
if ( flag & CCI_NAME )
{
- pDst->isUnknown=pSrc->isUnknown;
- if (pSrc->isUnknown)
- 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);
+ pDst->isUnknown = pSrc->isUnknown;
+ if (pSrc->isUnknown)
+ 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);
- if ( flag & CCI_PROTO ) pDst->m_cache_cszProto=pSrc->m_cache_cszProto;
- if ( flag & CCI_STATUS ) pDst->m_cache_nStatus=pSrc->m_cache_nStatus;
+ if ( flag & CCI_GROUP ) pDst->m_cache_tcsGroup = mir_tstrdup(pSrc->m_cache_tcsGroup);
+ if ( flag & CCI_PROTO ) pDst->m_cache_cszProto = pSrc->m_cache_cszProto;
+ if ( flag & CCI_STATUS ) pDst->m_cache_nStatus = pSrc->m_cache_nStatus;
if ( flag & CCI_LINES )
{
if ( pDst->szThirdLineText ) mir_free( pDst->szThirdLineText );
@@ -173,33 +171,33 @@ void CListSettings_CopyCacheItems(pdisplayNameCacheEntry pDst, pdisplayNameCache }
if ( flag & CCI_TIME)
{
- pDst->hTimeZone=pSrc->hTimeZone;
+ pDst->hTimeZone = pSrc->hTimeZone;
}
if ( flag & CCI_OTHER)
{
// if ( flag & CCI_HIDDEN)
- pDst->m_cache_nHidden=pSrc->m_cache_nHidden;
+ pDst->m_cache_nHidden = pSrc->m_cache_nHidden;
// if ( flag & CCI_NOHIDEOFFLINE)
- pDst->m_cache_nNoHiddenOffline=pSrc->m_cache_nNoHiddenOffline;
+ pDst->m_cache_nNoHiddenOffline = pSrc->m_cache_nNoHiddenOffline;
// if ( flag & CCI_NOPROTO)
- pDst->m_cache_bProtoNotExists=pSrc->m_cache_bProtoNotExists;
+ pDst->m_cache_bProtoNotExists = pSrc->m_cache_bProtoNotExists;
// if ( flag & CCI_HIDESUBCONTACT)
- pDst->m_cache_nHiddenSubcontact=pSrc->m_cache_nHiddenSubcontact;
+ pDst->m_cache_nHiddenSubcontact = pSrc->m_cache_nHiddenSubcontact;
// if ( flag & CCI_I)
- pDst->i=pSrc->i;
+ pDst->i = pSrc->i;
// if ( flag & CCI_APPARENT)
- pDst->ApparentMode=pSrc->ApparentMode;
+ pDst->ApparentMode = pSrc->ApparentMode;
// if ( flag & CCI_NOTONLIST)
- pDst->NotOnList=pSrc->NotOnList;
+ pDst->NotOnList = pSrc->NotOnList;
// if ( flag & CCI_IDLETS)
- pDst->IdleTS=pSrc->IdleTS;
+ pDst->IdleTS = pSrc->IdleTS;
// if ( flag & CCI_CCONTACT)
- pDst->ClcContact=pSrc->ClcContact;
+ pDst->ClcContact = pSrc->ClcContact;
// if ( flag & CCI_EXPAND)
- pDst->IsExpanded=pSrc->IsExpanded;
+ pDst->IsExpanded = pSrc->IsExpanded;
// if ( flag & CCI_UNKNOWN)
-// pDst->isUnknown=pSrc->isUnknown;
+// pDst->isUnknown = pSrc->isUnknown;
}
}
@@ -207,7 +205,7 @@ int CListSettings_GetCopyFromCache(pdisplayNameCacheEntry pDest, DWORD flag) {
pdisplayNameCacheEntry pSource;
if (!pDest || !pDest->m_cache_hContact) return -1;
- pSource=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pDest->m_cache_hContact);
+ pSource = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pDest->m_cache_hContact);
if (!pSource) return -1;
CListSettings_CopyCacheItems(pDest, pSource, flag);
return 0;
@@ -217,7 +215,7 @@ int CListSettings_SetToCache(pdisplayNameCacheEntry pSrc, DWORD flag) {
pdisplayNameCacheEntry pDst;
if (!pSrc || !pSrc->m_cache_hContact) return -1;
- pDst=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pSrc->m_cache_hContact);
+ pDst = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pSrc->m_cache_hContact);
if (!pDst) return -1;
CListSettings_CopyCacheItems(pDst, pSrc, flag);
return 0;
@@ -225,9 +223,10 @@ int CListSettings_SetToCache(pdisplayNameCacheEntry pSrc, DWORD flag) void cliFreeCacheItem( pdisplayNameCacheEntry p )
{
- HANDLE hContact=p->m_cache_hContact;
- TRACEVAR("cliFreeCacheItem hContact=%d",hContact);
- if ( !p->isUnknown && p->m_cache_tcsName && p->m_cache_tcsName!=UnknownConctactTranslatedName) mir_free_and_nill(p->m_cache_tcsName);
+ 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;
if ( p->m_cache_szName) { mir_free_and_nill(p->m_cache_szName); p->m_cache_szName = NULL; }
if ( p->m_cache_tcsGroup) { mir_free_and_nill(p->m_cache_tcsGroup); p->m_cache_tcsGroup = NULL; }
@@ -242,7 +241,7 @@ void cliFreeCacheItem( pdisplayNameCacheEntry p ) void FreeDisplayNameCache(SortedList *list)
{
int i;
- for ( i=0; i < list->realCount; i++) {
+ for ( i = 0; i < list->realCount; i++) {
FreeDisplayNameCacheItem(( pdisplayNameCacheEntry )list->items[i] );
mir_free_and_nill(list->items[i]);
}
@@ -252,136 +251,110 @@ void FreeDisplayNameCache(SortedList *list) */
void cliCheckCacheItem(pdisplayNameCacheEntry pdnce)
{
- if (pdnce!=NULL)
- {
- 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);
- return;
+ if (pdnce == NULL)
+ 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);
+ return;
+ }
+
+ if (pdnce->m_cache_cszProto == NULL&&pdnce->m_cache_bProtoNotExists == FALSE) {
+ pdnce->m_cache_cszProto = GetProtoForContact(pdnce->m_cache_hContact);
+ if (pdnce->m_cache_cszProto == NULL)
+ 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;
}
- if (pdnce->m_cache_cszProto==NULL&&pdnce->m_cache_bProtoNotExists==FALSE)
+ }
+
+ if (pdnce->m_cache_tcsName == NULL)
+ {
+ if (pdnce->m_cache_bProtoNotExists || !pdnce->m_cache_cszProto)
{
- pdnce->m_cache_cszProto=GetProtoForContact(pdnce->m_cache_hContact);
- if (pdnce->m_cache_cszProto==NULL)
- {
- 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 && pdnce->m_cache_tcsName!=UnknownConctactTranslatedName)
- mir_free_and_nill(pdnce->m_cache_tcsName);
- pdnce->m_cache_tcsName=NULL;
- }
- }
- }
+ pdnce->m_cache_tcsName = UnknownConctactTranslatedName;
+ pdnce->isUnknown = TRUE;
}
+ else
+ {
+ if (!pdnce->isUnknown)
+ free_and_nil_tcsName(pdnce->m_cache_tcsName);
- if (pdnce->m_cache_tcsName==NULL)
- {
- if (pdnce->m_cache_bProtoNotExists || !pdnce->m_cache_cszProto)
- {
- pdnce->m_cache_tcsName=UnknownConctactTranslatedName;
- pdnce->isUnknown=TRUE;
- }
+ if (g_flag_bOnModulesLoadedCalled)
+ pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown); //TODO UNICODE
else
- {
- if (!pdnce->isUnknown && pdnce->m_cache_tcsName &&pdnce->m_cache_tcsName!=UnknownConctactTranslatedName) mir_free_and_nill (pdnce->m_cache_tcsName);
- if (g_flag_bOnModulesLoadedCalled)
- pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown); //TODO UNICODE
- else
- // what to return here???
- pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown); //TODO UNICODE
- }
- if (pdnce->m_cache_szName) mir_free_and_nill(pdnce->m_cache_szName);
- }
- else
+ pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown); //TODO UNICODE
+ }
+ if (pdnce->m_cache_szName) mir_free_and_nill(pdnce->m_cache_szName);
+ }
+ else
+ {
+ if (pdnce->isUnknown&&pdnce->m_cache_cszProto&&pdnce->m_cache_bProtoNotExists == TRUE&&g_flag_bOnModulesLoadedCalled)
{
- 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)
{
- 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->m_cache_bProtoNotExists = FALSE;
+ pdnce->m_cache_tcsName = GetNameForContact(pdnce->m_cache_hContact,0,&pdnce->isUnknown); //TODO UNICODE
}
}
+ }
- if (pdnce___GetStatus( pdnce )==0) //very strange look status sort is broken let always reread status
- {
- pdnce___SetStatus( pdnce , GetStatusForContact(pdnce->m_cache_hContact,pdnce->m_cache_cszProto));
+ if (pdnce___GetStatus( pdnce ) == 0) //very strange look status sort is broken let always reread status
+ pdnce___SetStatus( pdnce , GetStatusForContact(pdnce->m_cache_hContact,pdnce->m_cache_cszProto));
+
+ if (pdnce->m_cache_tcsGroup == NULL) {
+ DBVARIANT dbv = {0};
+ if (!DBGetContactSettingTString(pdnce->m_cache_hContact,"CList","Group",&dbv)) {
+ pdnce->m_cache_tcsGroup = mir_tstrdup(dbv.ptszVal);
+ //mir_free_and_nill(dbv.ptszVal);
+ db_free(&dbv);
}
- if (pdnce->m_cache_tcsGroup==NULL)
- {
- DBVARIANT dbv={0};
+ else pdnce->m_cache_tcsGroup = mir_tstrdup(TEXT(""));
+ }
- if (!DBGetContactSettingTString(pdnce->m_cache_hContact,"CList","Group",&dbv))
- {
- pdnce->m_cache_tcsGroup=mir_tstrdup(dbv.ptszVal);
- //mir_free_and_nill(dbv.ptszVal);
- db_free(&dbv);
- }else
- {
- pdnce->m_cache_tcsGroup=mir_tstrdup(TEXT(""));
- }
+ if (pdnce->m_cache_nHidden == -1)
+ pdnce->m_cache_nHidden = db_get_b(pdnce->m_cache_hContact,"CList","Hidden",0);
- }
- if (pdnce->m_cache_nHidden==-1)
- {
- pdnce->m_cache_nHidden=db_get_b(pdnce->m_cache_hContact,"CList","Hidden",0);
- }
- //if (pdnce->HiddenSubcontact==-1)
- //{
- pdnce->m_cache_nHiddenSubcontact=g_szMetaModuleName && db_get_b(pdnce->m_cache_hContact,g_szMetaModuleName,"IsSubcontact",0);
- //pdnce->HiddenSubcontact=ServiceExists(MS_MC_GETMETACONTACT) && CallService(MS_MC_GETMETACONTACT, (WPARAM)pdnce->hContact, 0) != 0;
- //};
+ pdnce->m_cache_nHiddenSubcontact = g_szMetaModuleName && db_get_b(pdnce->m_cache_hContact,g_szMetaModuleName,"IsSubcontact",0);
- if (pdnce->m_cache_nNoHiddenOffline==-1)
- {
- pdnce->m_cache_nNoHiddenOffline=db_get_b(pdnce->m_cache_hContact,"CList","noOffline",0);
- }
+ if (pdnce->m_cache_nNoHiddenOffline == -1)
+ pdnce->m_cache_nNoHiddenOffline = db_get_b(pdnce->m_cache_hContact,"CList","noOffline",0);
- if (pdnce->IdleTS==-1)
- {
- pdnce->IdleTS=db_get_dw(pdnce->m_cache_hContact,pdnce->m_cache_cszProto,"IdleTS",0);
- };
+ if (pdnce->IdleTS == -1)
+ pdnce->IdleTS = db_get_dw(pdnce->m_cache_hContact,pdnce->m_cache_cszProto,"IdleTS",0);
- if (pdnce->ApparentMode==-1)
- {
- pdnce->ApparentMode=db_get_w(pdnce->m_cache_hContact,pdnce->m_cache_cszProto,"ApparentMode",0);
- };
- if (pdnce->NotOnList==-1)
- {
- pdnce->NotOnList=db_get_b(pdnce->m_cache_hContact,"CList","NotOnList",0);
- };
+ if (pdnce->ApparentMode == -1)
+ pdnce->ApparentMode = db_get_w(pdnce->m_cache_hContact,pdnce->m_cache_cszProto,"ApparentMode",0);
- if (pdnce->IsExpanded==-1)
- {
- pdnce->IsExpanded=db_get_b(pdnce->m_cache_hContact,"CList","Expanded",0);
- }
- if (pdnce->dwLastMsgTime==0)
- {
- pdnce->dwLastMsgTime=db_get_dw(pdnce->m_cache_hContact, "CList", "mf_lastmsg", 0);
- 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);
+ if (pdnce->NotOnList == -1)
+ pdnce->NotOnList = db_get_b(pdnce->m_cache_hContact,"CList","NotOnList",0);
+
+ if (pdnce->IsExpanded == -1)
+ pdnce->IsExpanded = db_get_b(pdnce->m_cache_hContact,"CList","Expanded",0);
+
+ if (pdnce->dwLastMsgTime == 0) {
+ pdnce->dwLastMsgTime = db_get_dw(pdnce->m_cache_hContact, "CList", "mf_lastmsg", 0);
+ 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)
{
- if ( clistCache != NULL )
+ if ( clistCache !=NULL )
{
int i;
for ( i = 0; i < clistCache->realCount; i++)
{
- PDNCE pdnce=(PDNCE)clistCache->items[i];
+ PDNCE pdnce = (PDNCE)clistCache->items[i];
if (mode&16)
{
InvalidateDNCEbyPointer(pdnce->m_cache_hContact,pdnce,16);
@@ -392,75 +365,76 @@ void IvalidateDisplayNameCache(DWORD mode) void InvalidateDNCEbyPointer(HANDLE hContact,pdisplayNameCacheEntry pdnce,int SettingType)
{
- if (hContact==NULL) return;
- if (pdnce==NULL) return;
+ if (hContact == NULL) return;
+ if (pdnce == NULL) return;
if (pdnce)
{
- if (SettingType==16)
+ if (SettingType == 16)
{
pdnce->ssSecondLine.DestroySmileyList();
if (pdnce->szSecondLineText) mir_free_and_nill(pdnce->szSecondLineText);
pdnce->ssThirdLine.DestroySmileyList();
if (pdnce->szThirdLineText) mir_free_and_nill(pdnce->szThirdLineText);
- pdnce->ssSecondLine.iMaxSmileyHeight=0;
- pdnce->ssThirdLine.iMaxSmileyHeight=0;
- pdnce->hTimeZone=NULL;
- pdnce->dwLastMsgTime=0;//CompareContacts2_getLMTime(pdnce->hContact);
+ 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;
+ SettingType &= ~16;
}
- if (SettingType==-1||SettingType==DBVT_DELETED)
+ if (SettingType == -1||SettingType == DBVT_DELETED)
{
- if (pdnce->m_cache_tcsName && !pdnce->isUnknown) mir_free_and_nill(pdnce->m_cache_tcsName);
- pdnce->m_cache_tcsName=NULL;
+ if (!pdnce->isUnknown)
+ free_and_nil_tcsName(pdnce->m_cache_tcsName);
+ pdnce->m_cache_tcsName = NULL;
if (pdnce->m_cache_tcsGroup) mir_free_and_nill(pdnce->m_cache_tcsGroup);
// if (pdnce->szProto) mir_free_and_nill(pdnce->szProto); //free proto
- pdnce->m_cache_tcsGroup=NULL;
+ pdnce->m_cache_tcsGroup = NULL;
- pdnce->m_cache_nHidden=-1;
- pdnce->m_cache_nHiddenSubcontact=-1;
- pdnce->m_cache_bProtoNotExists=FALSE;
- pdnce->m_cache_cszProto=NULL;
+ 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;
+ 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 (SettingType >= DBVT_WCHAR)
{
- if (pdnce->m_cache_tcsName && !pdnce->isUnknown) mir_free_and_nill(pdnce->m_cache_tcsName);
+ if (!pdnce->isUnknown) free_and_nil_tcsName(pdnce->m_cache_tcsName);
if (pdnce->m_cache_tcsGroup) mir_free_and_nill(pdnce->m_cache_tcsGroup);
//if (pdnce->szProto) mir_free_and_nill(pdnce->szProto);
- pdnce->m_cache_tcsName=NULL;
- pdnce->m_cache_tcsGroup=NULL;
- pdnce->m_cache_cszProto=NULL;
+ 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->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);
+ 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);
};
};
char *GetContactCachedProtocol(HANDLE hContact)
{
- pdisplayNameCacheEntry cacheEntry=NULL;
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ pdisplayNameCacheEntry cacheEntry = NULL;
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
if (cacheEntry&&cacheEntry->m_cache_cszProto) return cacheEntry->m_cache_cszProto;
return (NULL);
@@ -485,10 +459,10 @@ TCHAR* GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown) BOOL itUnknown;
if (UnknownConctactTranslatedName == NULL)
UnknownConctactTranslatedName = TranslateT("(Unknown Contact)");
- itUnknown=lstrcmp(result ,UnknownConctactTranslatedName) == 0;
+ itUnknown = lstrcmp(result ,UnknownConctactTranslatedName) == 0;
if (itUnknown) {
mir_free(result);
- result=UnknownConctactTranslatedName;
+ result = UnknownConctactTranslatedName;
}
if (isUnknown) {
*isUnknown = itUnknown;
@@ -499,13 +473,13 @@ TCHAR* GetNameForContact(HANDLE hContact,int flag,boolean *isUnknown) int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status)
{
- pdisplayNameCacheEntry cacheEntry=NULL;
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
- if (cacheEntry!=NULL)
+ pdisplayNameCacheEntry cacheEntry = NULL;
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ if (cacheEntry != NULL)
{
- if (Proto!=NULL) *Proto=cacheEntry->m_cache_cszProto;
- if (Name!=NULL) *Name=cacheEntry->m_cache_tcsName;
- if (Status!=NULL) *Status=pdnce___GetStatus( cacheEntry );
+ if (Proto != NULL) *Proto = cacheEntry->m_cache_cszProto;
+ if (Name != NULL) *Name = cacheEntry->m_cache_tcsName;
+ if (Status != NULL) *Status = pdnce___GetStatus( cacheEntry );
}
return (0);
};
@@ -513,64 +487,65 @@ int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status int GetContactCachedStatus(HANDLE hContact)
{
- pdisplayNameCacheEntry cacheEntry=NULL;
- cacheEntry=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
+ pdisplayNameCacheEntry cacheEntry = NULL;
+ cacheEntry = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hContact);
return pdnce___GetStatus( cacheEntry );
}
int ContactAdded(WPARAM wParam,LPARAM lParam)
{
- if (MirandaExiting()) return 0;
- cli_ChangeContactIcon((HANDLE)wParam,ExtIconFromStatusMode((HANDLE)wParam,(char*)GetContactCachedProtocol((HANDLE)wParam),ID_STATUS_OFFLINE),1); ///by FYR
- pcli->pfnSortContacts();
+ if ( !MirandaExiting()) {
+ cli_ChangeContactIcon((HANDLE)wParam,ExtIconFromStatusMode((HANDLE)wParam,(char*)GetContactCachedProtocol((HANDLE)wParam),ID_STATUS_OFFLINE),1); ///by FYR
+ pcli->pfnSortContacts();
+ }
return 0;
}
int ContactSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
pdisplayNameCacheEntry pdnce;
- if (MirandaExiting() || !pcli || !clistCache || (HANDLE)wParam == NULL) return 0;
+ if (MirandaExiting() || !pcli || !clistCache || (HANDLE)wParam == NULL) return 0;
dbv.pszVal = NULL;
- pdnce=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry((HANDLE)wParam);
+ pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry((HANDLE)wParam);
- if (pdnce==NULL)
+ if (pdnce == NULL)
{
TRACE("!!! Very bad pdnce not found.");
//if (dbv.pszVal) mir_free_and_nill(dbv.pszVal);
return 0;
}
- if (pdnce->m_cache_bProtoNotExists==FALSE && pdnce->m_cache_cszProto)
+ if (pdnce->m_cache_bProtoNotExists == FALSE && pdnce->m_cache_cszProto)
{
- if (!strcmp(cws->szModule,pdnce->m_cache_cszProto))
+ if (!strcmp(cws->szModule,pdnce->m_cache_cszProto))
{
InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- if (!strcmp(cws->szSetting,"IsSubcontact"))
+ 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))
+ wildcmp((char*)cws->szSetting, (char*) "Status?",2))
{
-
+
if (g_szMetaModuleName && !mir_strcmp(cws->szModule,g_szMetaModuleName) && mir_strcmp(cws->szSetting, "Status"))
{
- int res=0;
+ 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)
+ 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)
+ // if (pdnce->status != ID_STATUS_OFFLINE)
amRequestAwayMsg((HANDLE)wParam);
}
db_free(&dbv);
return 0;
}
- if (!(pdnce->m_cache_nHidden==1))
+ if (!(pdnce->m_cache_nHidden == 1))
{
pdnce___SetStatus( pdnce , cws->value.wVal ); //dont use direct set
if (cws->value.wVal == ID_STATUS_OFFLINE)
@@ -580,9 +555,9 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) 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 ((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)
+ // if (pdnce->status != ID_STATUS_OFFLINE)
amRequestAwayMsg((HANDLE)wParam);
}
pcli->pfnClcBroadcast( INTM_STATUSCHANGED,wParam,0);
@@ -596,7 +571,7 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) ||!mir_strcmp(cws->szSetting, "InfoTS")
))
{
- pcli->pfnSortContacts();
+ pcli->pfnSortContacts();
}
db_free(&dbv);
return 0;
@@ -607,11 +582,11 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) 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"))
+ 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);
}
@@ -622,18 +597,18 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) else if (!strcmp(cws->szSetting,"Hidden"))
{
InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- if(cws->value.type==DBVT_DELETED || cws->value.bVal==0)
+ 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
+ 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"))
{
InvalidateDNCEbyPointer((HANDLE)wParam,pdnce,cws->value.type);
- pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
+ pcli->pfnClcBroadcast(CLM_AUTOREBUILD,0, 0);
}
}
else if (!strcmp(cws->szModule,"Protocol"))
@@ -642,9 +617,9 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) {
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
+ 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
}
}
// Clean up
@@ -652,13 +627,13 @@ int ContactSettingChanged(WPARAM wParam,LPARAM lParam) //if (dbv.pszVal)
// mir_free_and_nill(dbv.pszVal);
}
-
+
return 0;
}
int PostAutoRebuidMessage(HWND hwnd)
{
if (!CLM_AUTOREBUILD_WAS_POSTED)
- CLM_AUTOREBUILD_WAS_POSTED=PostMessage(hwnd,CLM_AUTOREBUILD,0,0);
+ 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 f87ab41007..7bf2e661a1 100644 --- a/plugins/Clist_modern/modern_clisttray.cpp +++ b/plugins/Clist_modern/modern_clisttray.cpp @@ -21,16 +21,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "hdr/modern_commonheaders.h"
-#include <m_clui.h>
+#include < m_clui.h>
#include "hdr/modern_clist.h"
#include "hdr/modern_commonprototypes.h"
#include "hdr/modern_statusbar.h"
int cliShowHide(WPARAM wParam,LPARAM lParam);
-int g_mutex_bOnTrayRightClick=0;
+int g_mutex_bOnTrayRightClick = 0;
-BOOL g_bMultiConnectionMode=FALSE;
-static int RefreshTimerId=0; /////by FYR
+BOOL g_bMultiConnectionMode = FALSE;
+static int RefreshTimerId = 0; /////by FYR
static VOID CALLBACK RefreshTimerProc(HWND hwnd,UINT message,UINT idEvent,DWORD dwTime); ///// by FYR
static HMENU hMainMenu, hStatusMenu;
BOOL IS_WM_MOUSE_DOWN_IN_TRAY;
@@ -61,12 +61,12 @@ typedef HRESULT (CALLBACK* DLLGETVERSIONPROC)(DLLVERSIONINFO *); void mir_strset(TCHAR ** dest, TCHAR *source)
{
if (*dest) mir_free_and_nill(*dest);
- if (source) *dest=mir_tstrdup(source);
+ if (source) *dest = mir_tstrdup(source);
}
static DLLVERSIONINFO dviShell;
-BOOL g_MultiConnectionMode=FALSE;
-char * g_szConnectingProto=NULL;
+BOOL g_MultiConnectionMode = FALSE;
+char * g_szConnectingProto = NULL;
int GetStatusVal(int status)
{
switch ( status ) {
@@ -81,57 +81,57 @@ int GetStatusVal(int status) case ID_STATUS_ONTHEPHONE: return 400;
case ID_STATUS_OUTTOLUNCH: return 410;
}
- if (status<ID_STATUS_OFFLINE && status>0) return 600; //connecting is most priority
+ if (status < ID_STATUS_OFFLINE && status>0) return 600; //connecting is most priority
return 0;
}
int GetStatusOrder(int currentStatus, int newStatus)
{
- int current=GetStatusVal(currentStatus);
- int newstat=GetStatusVal(newStatus);
+ int current = GetStatusVal(currentStatus);
+ int newstat = GetStatusVal(newStatus);
return (current>newstat)?currentStatus:newStatus;
}
INT_PTR CListTray_GetGlobalStatus(WPARAM wparam,LPARAM lparam)
{
- int curstatus=0;
+ int curstatus = 0;
int i;
- int connectingCount=0;
- for (i=0;i<pcli->hClcProtoCount;i++)
+ int connectingCount = 0;
+ for (i = 0;i < pcli->hClcProtoCount;i++)
{
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)
+ if (pcli->clcProto[i].dwStatus >= ID_STATUS_CONNECTING &&
+ pcli->clcProto[i].dwStatus < ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
connectingCount++;
- if (connectingCount==1) g_szConnectingProto=pcli->clcProto[i].szProto;
+ if (connectingCount == 1) g_szConnectingProto = pcli->clcProto[i].szProto;
}
- curstatus=GetStatusOrder(curstatus,pcli->clcProto[i].dwStatus);
+ curstatus = GetStatusOrder(curstatus,pcli->clcProto[i].dwStatus);
}
- if (connectingCount==0)
+ if (connectingCount == 0)
{
- //g_szConnectingProto=NULL;
- g_bMultiConnectionMode=FALSE;
+ //g_szConnectingProto = NULL;
+ g_bMultiConnectionMode = FALSE;
}
else if (connectingCount>1)
- g_bMultiConnectionMode=TRUE;
+ g_bMultiConnectionMode = TRUE;
else
- g_bMultiConnectionMode=FALSE;
+ g_bMultiConnectionMode = FALSE;
return curstatus?curstatus:ID_STATUS_OFFLINE;
}
int GetAverageMode()
{
int count,netProtoCount,i;
- int averageMode=0;
+ int averageMode = 0;
PROTOACCOUNT **accs;
ProtoEnumAccounts( &count, &accs );
- for(i=0,netProtoCount=0;i<count;i++) {
+ for(i = 0,netProtoCount = 0;i < count;i++) {
if ( pcli->pfnGetProtocolVisibility(accs[i]->szModuleName) == 0 ) continue;
- pcli->cycleStep=i;
+ pcli->cycleStep = i;
netProtoCount++;
- 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;}
+ 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;}
}
return averageMode;
}
@@ -145,10 +145,10 @@ static VOID CALLBACK RefreshTimerProc(HWND hwnd,UINT message,UINT idEvent,DWORD int count,i;
PROTOACCOUNT **accs;
- if(RefreshTimerId) {KillTimer(NULL,RefreshTimerId); RefreshTimerId=0;}
+ if (RefreshTimerId) {KillTimer(NULL,RefreshTimerId); RefreshTimerId = 0;}
ProtoEnumAccounts( &count, &accs );
- for (i=0; i<count; i++)
+ for (i = 0; i < count; i++)
if ( pcli->pfnGetProtocolVisibility(accs[i]->szModuleName))
pcli->pfnTrayIconUpdateBase(accs[i]->szModuleName);
@@ -157,10 +157,10 @@ static VOID CALLBACK RefreshTimerProc(HWND hwnd,UINT message,UINT idEvent,DWORD void cliTrayIconUpdateBase(const char *szChangedProto)
{
- int i,count,netProtoCount,changed=-1;
+ int i,count,netProtoCount,changed = -1;
PROTOACCOUNT **accs;
- int averageMode=0;
- HWND hwnd=pcli->hwndContactList;
+ int averageMode = 0;
+ HWND hwnd = pcli->hwndContactList;
if (!szChangedProto) return;
@@ -169,57 +169,57 @@ void cliTrayIconUpdateBase(const char *szChangedProto) pcli->pfnLockTray();
if ( pcli->cycleTimerId ) {
KillTimer( NULL, pcli->cycleTimerId);
- pcli->cycleTimerId=0;
+ pcli->cycleTimerId = 0;
}
ProtoEnumAccounts( &count, &accs );
- for(i=0,netProtoCount=0;i<count;i++) {
- if ( pcli->pfnGetProtocolVisibility(accs[i]->szModuleName)==0 ) continue;
+ 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(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;}
+ 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;}
}
- if(netProtoCount>1) {
- if(averageMode>=ID_STATUS_OFFLINE) {
- if(db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT)==SETTING_TRAYICON_MULTI) {
- if(db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT))
- changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,averageMode),szChangedProto);
- else if(pcli->trayIcon && pcli->trayIcon[0].szProto!=NULL) {
+ if (netProtoCount>1) {
+ if (averageMode >= ID_STATUS_OFFLINE) {
+ if (db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI) {
+ if (db_get_b(NULL,"CList","AlwaysMulti",SETTING_ALWAYSMULTI_DEFAULT))
+ changed = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,averageMode),szChangedProto);
+ else if (pcli->trayIcon && pcli->trayIcon[0].szProto != NULL) {
pcli->pfnTrayIconDestroy(hwnd);
pcli->pfnTrayIconInit(hwnd);
}
else
- changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,NULL,averageMode),NULL);
+ changed = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,NULL,averageMode),NULL);
}
else
{
- if(db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT)==SETTING_TRAYICON_SINGLE
+ if (db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE
&& db_get_b(NULL,"CList","AlwaysPrimary",SETTING_ALWAYSPRIMARY_DEFAULT))
{
- DBVARIANT dbv={DBVT_DELETED};
+ DBVARIANT dbv = {DBVT_DELETED};
char *szProto;
- if(DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv)) szProto=NULL;
- else szProto=dbv.pszVal;
- changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szProto,averageMode),NULL);
+ if (DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv)) szProto = NULL;
+ else szProto = dbv.pszVal;
+ changed = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szProto,averageMode),NULL);
if (szProto) mir_free_and_nill(szProto);
}
else
- changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,NULL,averageMode),NULL);
+ changed = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,NULL,averageMode),NULL);
}
}
else {
switch(db_get_b(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT)) {
case SETTING_TRAYICON_SINGLE:
{
- DBVARIANT dbv={DBVT_DELETED};
+ DBVARIANT dbv = {DBVT_DELETED};
char *szProto;
int status;
- if(DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv)) szProto=NULL;
- else szProto=dbv.pszVal;
- status=CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
+ if (DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv)) szProto = NULL;
+ else szProto = dbv.pszVal;
+ status = CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
- if ((g_StatusBarData.connectingIcon==1)&&status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
+ if ((g_StatusBarData.connectingIcon == 1)&&status >= ID_STATUS_CONNECTING&&status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
//
HICON hIcon;
// 1 check if multi connecting icon
@@ -228,17 +228,17 @@ void cliTrayIconUpdateBase(const char *szChangedProto) if (_strcmpi(szChangedProto,g_szConnectingProto))
{ pcli->pfnUnlockTray(); return; }
else
- hIcon=(HICON)CLUI_GetConnectingIconService((WPARAM)"",1);
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)"",1);
else
- hIcon=(HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);
if (hIcon) {
- changed=pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
+ changed = pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
db_free(&dbv);
break;
}
}
else
- changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szProto,szProto?CallProtoService(szProto,PS_GETSTATUS,0,0):CallService(MS_CLIST_GETSTATUSMODE,0,0)),NULL);
+ changed = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szProto,szProto?CallProtoService(szProto,PS_GETSTATUS,0,0):CallService(MS_CLIST_GETSTATUSMODE,0,0)),NULL);
db_free(&dbv);
}
@@ -246,16 +246,16 @@ void cliTrayIconUpdateBase(const char *szChangedProto) case SETTING_TRAYICON_CYCLE:
{
- int status=szChangedProto ? CallProtoService(szChangedProto,PS_GETSTATUS,0,0) : averageMode;
- if ((g_StatusBarData.connectingIcon==1 && CListTray_GetGlobalStatus(0,0)
- && ((status>=ID_STATUS_CONNECTING && status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)|| g_bMultiConnectionMode )))
+ int status = szChangedProto ? CallProtoService(szChangedProto,PS_GETSTATUS,0,0) : averageMode;
+ if ((g_StatusBarData.connectingIcon == 1 && CListTray_GetGlobalStatus(0,0)
+ && ((status >= ID_STATUS_CONNECTING && status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)|| g_bMultiConnectionMode )))
{
//connecting
- status=status;
+ status = status;
//stop cycling
if (pcli->cycleTimerId)
KillTimer(NULL,pcli->cycleTimerId);
- pcli->cycleTimerId=0;
+ pcli->cycleTimerId = 0;
{
HICON hIcon;
// 1 check if multi connecting icon
@@ -263,17 +263,17 @@ void cliTrayIconUpdateBase(const char *szChangedProto) if (_strcmpi(szChangedProto,g_szConnectingProto))
{ pcli->pfnUnlockTray(); return; }
else
- hIcon=(HICON)CLUI_GetConnectingIconService((WPARAM)"",1);
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)"",1);
else
- hIcon=(HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);
if (hIcon)
- changed=pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
+ changed = pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
}
}
else
{
- pcli->cycleTimerId=CLUI_SafeSetTimer(NULL,0,db_get_w(NULL,"CList","CycleTime",SETTING_CYCLETIME_DEFAULT)*1000,pcli->pfnTrayCycleTimerProc);
- changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,status),NULL);
+ pcli->cycleTimerId = CLUI_SafeSetTimer(NULL,0,db_get_w(NULL,"CList","CycleTime",SETTING_CYCLETIME_DEFAULT)*1000,pcli->pfnTrayCycleTimerProc);
+ changed = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,status),NULL);
}
}
@@ -287,67 +287,67 @@ void cliTrayIconUpdateBase(const char *szChangedProto) {
int status;
- status=CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
- if ((g_StatusBarData.connectingIcon==1)&&status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
+ status = CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
+ if ((g_StatusBarData.connectingIcon == 1)&&status >= ID_STATUS_CONNECTING&&status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
//
HICON hIcon;
- hIcon=(HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);;
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);;
if (hIcon)
- changed=pcli->pfnTrayIconSetBaseInfo(hIcon,szChangedProto);
+ changed = pcli->pfnTrayIconSetBaseInfo(hIcon,szChangedProto);
}
else
- changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,CallProtoService(szChangedProto,PS_GETSTATUS,0,0)),szChangedProto);
+ changed = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,CallProtoService(szChangedProto,PS_GETSTATUS,0,0)),szChangedProto);
}
}
else if (pcli->pfnGetProtocolVisibility(szChangedProto)) {
int i;
int avg;
- avg=GetAverageMode();
- i=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,CallProtoService(szChangedProto,PS_GETSTATUS,0,0)),szChangedProto);
- if (i<0 /*|| (avg!=-1)*/) {
+ avg = GetAverageMode();
+ i = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szChangedProto,CallProtoService(szChangedProto,PS_GETSTATUS,0,0)),szChangedProto);
+ if (i < 0 /*|| (avg != -1)*/) {
pcli->pfnTrayIconDestroy(hwnd);
pcli->pfnTrayIconInit(hwnd);
}
else {
int status;
- changed=i;
- status=CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
- if ((g_StatusBarData.connectingIcon==1)&&status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
+ changed = i;
+ status = CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
+ if ((g_StatusBarData.connectingIcon == 1)&&status >= ID_STATUS_CONNECTING&&status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES) {
//
HICON hIcon;
- hIcon=(HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);;
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);;
if (hIcon) {
- changed=pcli->pfnTrayIconSetBaseInfo(hIcon,szChangedProto);
+ changed = pcli->pfnTrayIconSetBaseInfo(hIcon,szChangedProto);
} } } }
break;
} }
}
else if ( pcli->pfnGetProtocolVisibility( szChangedProto ))
{
- DBVARIANT dbv={DBVT_DELETED};
+ DBVARIANT dbv = {DBVT_DELETED};
char *szProto;
- int status=CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
+ int status = CallProtoService(szChangedProto,PS_GETSTATUS,0,0);
- if ((g_StatusBarData.connectingIcon==1)&&status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
+ if ((g_StatusBarData.connectingIcon == 1)&&status >= ID_STATUS_CONNECTING&&status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
HICON hIcon = ( HICON )CLUI_GetConnectingIconService((WPARAM)szChangedProto,0);;
if (hIcon)
- changed=pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
+ changed = pcli->pfnTrayIconSetBaseInfo(hIcon,NULL);
}
- else if (status>=ID_STATUS_OFFLINE && status<=ID_STATUS_IDLE)
+ else if (status >= ID_STATUS_OFFLINE && status <= ID_STATUS_IDLE)
{
- if(DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv))
- szProto=NULL;
+ if (DBGetContactSettingString(NULL,"CList","PrimaryStatus",&dbv))
+ szProto = NULL;
else
- szProto=dbv.pszVal;
- changed=pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szProto,status),NULL);
+ szProto = dbv.pszVal;
+ changed = pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL,szProto,status),NULL);
if (szProto)
mir_free_and_nill(szProto);
}
}
- if (changed != -1) // && pcli->trayIcon[changed].isBase)
+ if (changed !=-1) // && pcli->trayIcon[changed].isBase)
pcli->pfnTrayIconUpdate(pcli->trayIcon[changed].hBaseIcon,NULL,szChangedProto,1); // by FYR (No suitable protocol)
{ pcli->pfnUnlockTray(); return; }
}
@@ -358,13 +358,13 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd,UINT message,UINT_PTR idEve {
HWND hwndClui, ActiveWindow;
KillTimer(hwnd,idEvent);
- hwndClui=pcli->hwndContactList;
- ActiveWindow=GetActiveWindow();
- if(ActiveWindow==hwndClui) return;
+ hwndClui = pcli->hwndContactList;
+ ActiveWindow = GetActiveWindow();
+ if (ActiveWindow == hwndClui) return;
if (CLUI_CheckOwnedByClui(ActiveWindow)) return;
//CLUI_ShowWindowMod(hwndClui,SW_HIDE);
CListMod_HideWindow(hwndClui, SW_HIDE);
- if(MySetProcessWorkingSetSize!=NULL)
+ if (MySetProcessWorkingSetSize != NULL)
MySetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
}
@@ -372,11 +372,11 @@ INT_PTR TrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam) {
if (db_get_b(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT))
{
- if (GetActiveWindow() != pcli->hwndContactList
- && GetWindow(GetParent(GetActiveWindow()),GW_OWNER) != pcli->hwndContactList)
+ if (GetActiveWindow() !=pcli->hwndContactList
+ && GetWindow(GetParent(GetActiveWindow()),GW_OWNER) !=pcli->hwndContactList)
{
KillTimer(NULL,autoHideTimerId);
- autoHideTimerId=CLUI_SafeSetTimer(NULL,0,1000*db_get_w(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),TrayIconAutoHideTimer);
+ autoHideTimerId = CLUI_SafeSetTimer(NULL,0,1000*db_get_w(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),TrayIconAutoHideTimer);
} }
return 0;
@@ -385,7 +385,7 @@ INT_PTR TrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam) void DestroyTrayMenu(HMENU hMenu)
{
int cnt = GetMenuItemCount(hMenu);
- for (int i=0; i<cnt; ++i)
+ for (int i = 0; i < cnt; ++i)
{
HMENU hSubMenu = GetSubMenu(hMenu, i);
if (hSubMenu == hStatusMenu || hSubMenu == hMainMenu)
@@ -396,11 +396,11 @@ void DestroyTrayMenu(HMENU hMenu) INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam)
{
- MSG *msg=(MSG*)wParam;
+ MSG *msg = (MSG*)wParam;
switch(msg->message) {
case WM_EXITMENULOOP:
if (pcli->bTrayMenuOnScreen)
- pcli->bTrayMenuOnScreen=FALSE;
+ pcli->bTrayMenuOnScreen = FALSE;
break;
// case WM_DRAWITEM:
@@ -414,12 +414,12 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam) {
HWND h1,h2,h4;
SetCursor(LoadCursor(NULL, IDC_ARROW));
- h1=(HWND)msg->lParam;
- h2=h1?GetParent(h1):NULL;
- h4=pcli->hwndContactList;
- if(db_get_b(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT)) {
- if (LOWORD(msg->wParam)==WA_INACTIVE && h2!=h4)
- autoHideTimerId=CLUI_SafeSetTimer(NULL,0,1000*db_get_w(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),TrayIconAutoHideTimer);
+ h1 = (HWND)msg->lParam;
+ h2 = h1?GetParent(h1):NULL;
+ h4 = pcli->hwndContactList;
+ if (db_get_b(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT)) {
+ if (LOWORD(msg->wParam) == WA_INACTIVE && h2 != h4)
+ autoHideTimerId = CLUI_SafeSetTimer(NULL,0,1000*db_get_w(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),TrayIconAutoHideTimer);
else {
KillTimer(NULL,autoHideTimerId);
autoHideTimerId = 0;
@@ -436,38 +436,38 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam,LPARAM lParam) if ((GetAsyncKeyState(VK_CONTROL)&0x8000) && msg->lParam == WM_LBUTTONDOWN && !db_get_b(NULL,"CList","Tray1Click",SETTING_TRAY1CLICK_DEFAULT)) {
POINT pt;
HMENU hMenu;
- hMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,(WPARAM)0,(LPARAM)0);
- g_mutex_bOnTrayRightClick=1;
- IS_WM_MOUSE_DOWN_IN_TRAY=1;
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,(WPARAM)0,(LPARAM)0);
+ g_mutex_bOnTrayRightClick = 1;
+ IS_WM_MOUSE_DOWN_IN_TRAY = 1;
SetForegroundWindow(msg->hwnd);
SetFocus(msg->hwnd);
GetCursorPos(&pt);
- pcli->bTrayMenuOnScreen=TRUE;
+ pcli->bTrayMenuOnScreen = TRUE;
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
PostMessage(msg->hwnd, WM_NULL, 0, 0);
- g_mutex_bOnTrayRightClick=0;
- IS_WM_MOUSE_DOWN_IN_TRAY=0;
+ g_mutex_bOnTrayRightClick = 0;
+ IS_WM_MOUSE_DOWN_IN_TRAY = 0;
}
- else if (msg->lParam==WM_MBUTTONDOWN ||msg->lParam==WM_LBUTTONDOWN ||msg->lParam==WM_RBUTTONDOWN) {
- IS_WM_MOUSE_DOWN_IN_TRAY=1;
+ else if (msg->lParam == WM_MBUTTONDOWN ||msg->lParam == WM_LBUTTONDOWN ||msg->lParam == WM_RBUTTONDOWN) {
+ IS_WM_MOUSE_DOWN_IN_TRAY = 1;
}
else if (msg->lParam == WM_RBUTTONUP) {
POINT pt;
HMENU hMenu;
- hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDTRAY,(WPARAM)0,(LPARAM)0);
- g_mutex_bOnTrayRightClick=1;
+ hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDTRAY,(WPARAM)0,(LPARAM)0);
+ g_mutex_bOnTrayRightClick = 1;
SetForegroundWindow(msg->hwnd);
SetFocus(msg->hwnd);
GetCursorPos(&pt);
- pcli->bTrayMenuOnScreen=TRUE;
+ pcli->bTrayMenuOnScreen = TRUE;
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, msg->hwnd, NULL);
DestroyTrayMenu(hMenu);
PostMessage(msg->hwnd, WM_NULL, 0, 0);
}
else break;
- *((LRESULT*)lParam)=0;
+ *((LRESULT*)lParam) = 0;
return TRUE;
}
return corecli.pfnTrayIconProcessMessage(wParam, lParam);
@@ -487,7 +487,7 @@ typedef struct{ }TrayMenuExecParam,*lpTrayMenuExecParam;
/*
-wparam=handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
+wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
return 0 on success.
*/
static INT_PTR RemoveTrayMenuItem(WPARAM wParam,LPARAM lParam)
@@ -503,18 +503,18 @@ static INT_PTR BuildTrayMenu(WPARAM wParam,LPARAM lParam) ListParam param;
memset(¶m,0,sizeof(param));
- param.MenuObjectHandle=hTrayMenuObject;
+ param.MenuObjectHandle = hTrayMenuObject;
- //hMenu=hMainMenu;
- hMenu=CreatePopupMenu();
- //hMenu=wParam;
- tick=GetTickCount();
+ //hMenu = hMainMenu;
+ hMenu = CreatePopupMenu();
+ //hMenu = wParam;
+ tick = GetTickCount();
NotifyEventHooks(g_CluiData.hEventPreBuildTrayMenu,0,0);
CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m);
//DrawMenuBar((HWND)CallService("CLUI/GetHwnd",0,0));
- tick=GetTickCount()-tick;
+ tick = GetTickCount()-tick;
return (INT_PTR)hMenu;
}
@@ -530,14 +530,14 @@ static INT_PTR AddTrayMenuItem(WPARAM wParam,LPARAM lParam) return 0;
//we need just one parametr.
- mmep->szServiceName=mir_strdup(mi->pszService);
- mmep->Param1=mi->popupPosition;
+ mmep->szServiceName = mir_strdup(mi->pszService);
+ mmep->Param1 = mi->popupPosition;
tmi.ownerdata = mmep;
OptParam op;
- op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hTrayMenuObject,(LPARAM)&tmi);
- op.Setting=OPT_MENUITEMSETUNIQNAME;
- op.Value=(INT_PTR)mi->pszService;
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hTrayMenuObject,(LPARAM)&tmi);
+ op.Setting = OPT_MENUITEMSETUNIQNAME;
+ op.Value = (INT_PTR)mi->pszService;
CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
return (INT_PTR)op.Handle;
@@ -547,27 +547,27 @@ static INT_PTR AddTrayMenuItem(WPARAM wParam,LPARAM lParam) INT_PTR TrayMenuonAddService(WPARAM wParam,LPARAM lParam) {
- MENUITEMINFO *mii=(MENUITEMINFO* )wParam;
- if (mii==NULL) return 0;
+ MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ if (mii == NULL) return 0;
- if (hTrayHideShowMainMenuItem==(HANDLE)lParam)
+ if (hTrayHideShowMainMenuItem == (HANDLE)lParam)
{
- mii->fMask|=MIIM_STATE;
- mii->fState|=MFS_DEFAULT;
+ mii->fMask |= MIIM_STATE;
+ mii->fState |= MFS_DEFAULT;
}
- if (hTrayMainMenuItemProxy==(HANDLE)lParam)
+ if (hTrayMainMenuItemProxy == (HANDLE)lParam)
{
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
}
- if (hTrayStatusMenuItemProxy==(HANDLE)lParam)
+ if (hTrayStatusMenuItemProxy == (HANDLE)lParam)
{
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
}
return(TRUE);
@@ -577,13 +577,13 @@ INT_PTR TrayMenuonAddService(WPARAM wParam,LPARAM lParam) { //wparam - ownerdata
//lparam - lparam from winproc
INT_PTR TrayMenuExecService(WPARAM wParam,LPARAM lParam) {
- if (wParam!=0)
+ if (wParam != 0)
{
- lpTrayMenuExecParam mmep=(lpTrayMenuExecParam)wParam;
+ lpTrayMenuExecParam mmep = (lpTrayMenuExecParam)wParam;
if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
- mmep->Param1=0;
+ mmep->Param1 = 0;
}
CallService(mmep->szServiceName,mmep->Param1,lParam);
}
@@ -594,8 +594,8 @@ INT_PTR FreeOwnerDataTrayMenu (WPARAM wParam,LPARAM lParam) {
lpTrayMenuExecParam mmep;
- mmep=(lpTrayMenuExecParam)lParam;
- if (mmep!=NULL){
+ mmep = (lpTrayMenuExecParam)lParam;
+ if (mmep != NULL){
FreeAndNil((void**)&mmep->szServiceName);
FreeAndNil((void**)&mmep);
}
@@ -619,26 +619,26 @@ void InitTrayMenus(void) //Tray menu
memset(&tmp,0,sizeof(tmp));
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService=NULL;
- tmp.ExecService="CLISTMENUSTRAY/ExecService";
- tmp.name="TrayMenu";
- hTrayMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
+ tmp.cbSize = sizeof(tmp);
+ tmp.CheckService = NULL;
+ tmp.ExecService = "CLISTMENUSTRAY/ExecService";
+ tmp.name = "TrayMenu";
+ hTrayMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
- op.Handle=hTrayMenuObject;
- op.Setting=OPT_USERDEFINEDITEMS;
- op.Value=TRUE;
+ op.Handle = hTrayMenuObject;
+ op.Setting = OPT_USERDEFINEDITEMS;
+ op.Value = TRUE;
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- op.Handle=hTrayMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSTRAY/FreeOwnerDataTrayMenu";
+ op.Handle = hTrayMenuObject;
+ op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
+ op.Value = (INT_PTR)"CLISTMENUSTRAY/FreeOwnerDataTrayMenu";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- op.Handle=hTrayMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSTRAY/TrayMenuonAddService";
+ op.Handle = hTrayMenuObject;
+ op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
+ op.Value = (INT_PTR)"CLISTMENUSTRAY/TrayMenuonAddService";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
{
@@ -646,73 +646,73 @@ void InitTrayMenus(void) CLISTMENUITEM mi;
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=900000;
- mi.pszService="CloseAction";
- mi.pszName=LPGEN("E&xit");
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_EXIT);
+ mi.cbSize = sizeof(mi);
+ mi.position = 900000;
+ mi.pszService = "CloseAction";
+ mi.pszName = LPGEN("E&xit");
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_EXIT);
AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100000;
- mi.pszService=MS_CLIST_SHOWHIDE;
- mi.pszName=LPGEN("&Hide/Show");
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
- hTrayHideShowMainMenuItem=(HANDLE)AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 100000;
+ mi.pszService = MS_CLIST_SHOWHIDE;
+ mi.pszName = LPGEN("&Hide/Show");
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
+ hTrayHideShowMainMenuItem = (HANDLE)AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=200000;
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
- mi.pszService="FindAdd/FindAddCommand";
- mi.pszName=LPGEN("&Find/Add Contacts...");
+ mi.cbSize = sizeof(mi);
+ mi.position = 200000;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
+ mi.pszService = "FindAdd/FindAddCommand";
+ mi.pszName = LPGEN("&Find/Add Contacts...");
AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=300000;
- mi.flags=CMIF_ICONFROMICOLIB; // eternity #004
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
- mi.pszService="FakeService_1";
- mi.pszName=LPGEN("&Main Menu");
- hTrayMainMenuItemProxy=(HANDLE)AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 300000;
+ mi.flags = CMIF_ICONFROMICOLIB; // eternity #004
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
+ mi.pszService = "FakeService_1";
+ mi.pszName = LPGEN("&Main Menu");
+ hTrayMainMenuItemProxy = (HANDLE)AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon); // eternity #004
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=300100;
- mi.pszService="FakeService_2";
- mi.flags=CMIF_ICONFROMICOLIB; // eternity #004
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
- mi.pszName=LPGEN("&Status");
- hTrayStatusMenuItemProxy=(HANDLE)AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 300100;
+ mi.pszService = "FakeService_2";
+ mi.flags = CMIF_ICONFROMICOLIB; // eternity #004
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
+ mi.pszName = LPGEN("&Status");
+ hTrayStatusMenuItemProxy = (HANDLE)AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon); // eternity #004
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=400000;
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
- mi.pszService="Options/OptionsCommand";
- mi.pszName=LPGEN("&Options...");
+ mi.cbSize = sizeof(mi);
+ mi.position = 400000;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
+ mi.pszService = "Options/OptionsCommand";
+ mi.pszName = LPGEN("&Options...");
AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=500000;
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
- mi.pszService="Help/AboutCommand";
- mi.pszName=LPGEN("&About");
+ mi.cbSize = sizeof(mi);
+ mi.position = 500000;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
+ mi.pszService = "Help/AboutCommand";
+ mi.pszName = LPGEN("&About");
AddTrayMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
}
@@ -725,7 +725,7 @@ void UninitTrayMenu() {
if (hTrayMenuObject && ServiceExists(MO_REMOVEMENUOBJECT))
CallService(MO_REMOVEMENUOBJECT,(WPARAM)hTrayMenuObject,0);
- hTrayMenuObject=NULL;
+ hTrayMenuObject = NULL;
}
void InitTray(void)
diff --git a/plugins/Clist_modern/modern_clui.cpp b/plugins/Clist_modern/modern_clui.cpp index c0942e0bce..6391c7e133 100644 --- a/plugins/Clist_modern/modern_clui.cpp +++ b/plugins/Clist_modern/modern_clui.cpp @@ -33,7 +33,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_statusbar.h"
#include "hdr/modern_static_clui.h"
-#include <locale.h>
+#include < locale.h>
#include "hdr/modern_clcpaint.h"
#include "hdr/modern_sync.h"
@@ -45,7 +45,7 @@ void DestroyTrayMenu(HMENU hMenu); // new sources
#ifdef _MSC_VER
-#include <crtdbg.h>
+#include < crtdbg.h>
#endif
//////////////// CLUI CLASS IMPLEMENTATION /////////////////////////////////
@@ -79,7 +79,7 @@ int CLUI::OnEvent_ModulesLoaded(WPARAM wParam,LPARAM lParam) CLUIServices_ProtocolStatusChanged(0,0);
SleepEx(0,TRUE);
- g_flag_bOnModulesLoadedCalled=TRUE;
+ g_flag_bOnModulesLoadedCalled = TRUE;
///pcli->pfnInvalidateDisplayNameCacheEntry(INVALID_HANDLE_VALUE);
SendMessage(pcli->hwndContactList,UM_CREATECLC,0,0); //$$$
InitSkinHotKeys();
@@ -95,7 +95,7 @@ int CLUI::OnEvent_FontReload(WPARAM wParam,LPARAM lParam) pcli->pfnClcBroadcast( INTM_RELOADOPTIONS, wParam, lParam );
- g_CluiData.dwKeyColor=db_get_dw(NULL,"ModernSettings","KeyColor",(DWORD)SETTING_KEYCOLOR_DEFAULT);
+ g_CluiData.dwKeyColor = db_get_dw(NULL,"ModernSettings","KeyColor",(DWORD)SETTING_KEYCOLOR_DEFAULT);
CLUI__cliInvalidateRect( pcli->hwndContactList, 0, 0 );
@@ -136,7 +136,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam) }
else
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if (DBGetContactSettingTString(hItem, "ContactPhoto", "File", &dbv))
{
has_avatar = 0;
@@ -171,13 +171,13 @@ int CLUI::OnEvent_DBSettingChanging(WPARAM wParam,LPARAM lParam) if (ServiceExists("ExtraIcon/Register"))
return 0;
- DBCONTACTWRITESETTING *dbcws=(DBCONTACTWRITESETTING *)lParam;
- if (wParam==0) return 0;
- if (dbcws==NULL) return(0);
+ DBCONTACTWRITESETTING *dbcws = (DBCONTACTWRITESETTING *)lParam;
+ if (wParam == 0) return 0;
+ if (dbcws == NULL) return(0);
if (MirandaExiting()) return 0;
- if ( ( dbcws->value.type==DBVT_WORD && !mir_strcmp(dbcws->szSetting,"ApparentMode")) ||
- ( dbcws->value.type==DBVT_ASCIIZ &&
+ if ( ( dbcws->value.type == DBVT_WORD && !mir_strcmp(dbcws->szSetting,"ApparentMode")) ||
+ ( dbcws->value.type == DBVT_ASCIIZ &&
( ( !mir_strcmp(dbcws->szSetting,"e-mail") ||
!mir_strcmp(dbcws->szSetting,"Mye-mail0") ||
!mir_strcmp(dbcws->szSetting,"Cellular")) ||
@@ -191,7 +191,7 @@ INT_PTR CLUI::Service_ShowMainMenu(WPARAM wParam,LPARAM lParam) {
HMENU hMenu;
POINT pt;
- hMenu=(HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
GetCursorPos(&pt);
TrackPopupMenu(hMenu,TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON,pt.x,pt.y,0,pcli->hwndContactList,NULL);
return 0;
@@ -200,7 +200,7 @@ INT_PTR CLUI::Service_ShowStatusMenu(WPARAM wParam,LPARAM lParam) {
HMENU hMenu;
POINT pt;
- hMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
GetCursorPos(&pt);
TrackPopupMenu(hMenu,TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON,pt.x,pt.y,0,pcli->hwndContactList,NULL);
return 0;
@@ -230,14 +230,14 @@ INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM wParam,LPARAM lParam) HRESULT CLUI::CreateCluiFrames()
{
- g_hMenuMain=GetMenu(pcli->hwndContactList);
+ g_hMenuMain = GetMenu(pcli->hwndContactList);
MENUITEMINFO mii;
ZeroMemory(&mii,sizeof(mii));
- mii.cbSize=MENUITEMINFO_V4_SIZE;
- mii.fMask=MIIM_SUBMENU;
- mii.hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_SUBMENU;
+ mii.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
SetMenuItemInfo(g_hMenuMain,0,TRUE,&mii);
- mii.hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ mii.hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
SetMenuItemInfo(g_hMenuMain,1,TRUE,&mii);
CreateCLCWindow(CluiWnd());
@@ -262,7 +262,7 @@ m_hDwmapiDll( NULL ) m_pCLUI = this;
g_CluiData.bSTATE = STATE_CLUI_LOADING;
LoadDllsRuntime();
- hFrameContactTree=NULL;
+ hFrameContactTree = NULL;
CLUIServices_LoadModule();
@@ -276,15 +276,15 @@ m_hDwmapiDll( NULL ) //TODO Add Row template loading here.
RowHeight_InitModernRow();
- nLastRequiredHeight=0;
+ nLastRequiredHeight = 0;
LoadCLUIFramesModule();
ExtraImage_LoadModule();
- g_CluiData.boldHideOffline=-1;
- bOldHideOffline=db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
+ g_CluiData.boldHideOffline = -1;
+ bOldHideOffline = db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT);
- g_CluiData.bOldUseGroups=-1;
+ g_CluiData.bOldUseGroups = -1;
bOldUseGroups = db_get_b( NULL,"CList","UseGroups", SETTING_USEGROUPS_DEFAULT );
}
@@ -302,11 +302,11 @@ HRESULT CLUI::LoadDllsRuntime() {
g_proc_UpdateLayeredWindow = (BOOL (WINAPI *)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD))GetProcAddress(m_hUserDll, "UpdateLayeredWindow");
g_proc_SetLayeredWindowAttributesNew = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(m_hUserDll, "SetLayeredWindowAttributes");
- g_proc_AnimateWindow=(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(m_hUserDll,"AnimateWindow");
+ g_proc_AnimateWindow = (BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(m_hUserDll,"AnimateWindow");
- g_CluiData.fLayered=(g_proc_UpdateLayeredWindow!=NULL) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
- g_CluiData.fSmoothAnimation=IsWinVer2000Plus()&&db_get_b(NULL, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT);
- g_CluiData.fLayered=(g_CluiData.fLayered*db_get_b(NULL, "ModernData", "EnableLayering", g_CluiData.fLayered))&&!db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
+ g_CluiData.fLayered = (g_proc_UpdateLayeredWindow != NULL) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
+ g_CluiData.fSmoothAnimation = IsWinVer2000Plus()&&db_get_b(NULL, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT);
+ g_CluiData.fLayered = (g_CluiData.fLayered*db_get_b(NULL, "ModernData", "EnableLayering", g_CluiData.fLayered))&&!db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
}
if (IsWinVerVistaPlus())
@@ -326,22 +326,22 @@ HRESULT CLUI::RegisterAvatarMenu() CLISTMENUITEM mi;
ZeroMemory(&mi,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.flags=0;
- mi.pszContactOwner=NULL; //on every contact
+ mi.cbSize = sizeof(mi);
+ mi.flags = 0;
+ mi.pszContactOwner = NULL; //on every contact
CreateServiceFunction("CList/ShowContactAvatar",CLUI::Service_Menu_ShowContactAvatar);
- mi.position=2000150000;
- mi.hIcon=LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_SHOW_AVATAR));
- mi.pszName=LPGEN("Show Contact &Avatar");
- mi.pszService="CList/ShowContactAvatar";
+ mi.position = 2000150000;
+ mi.hIcon = LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_SHOW_AVATAR));
+ mi.pszName = LPGEN("Show Contact &Avatar");
+ mi.pszService = "CList/ShowContactAvatar";
hShowAvatarMenuItem = Menu_AddContactMenuItem(&mi);
DestroyIcon_protect(mi.hIcon);
CreateServiceFunction("CList/HideContactAvatar",CLUI::Service_Menu_HideContactAvatar);
- mi.position=2000150001;
- mi.hIcon=LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_HIDE_AVATAR));
- mi.pszName=LPGEN("Hide Contact &Avatar");
- mi.pszService="CList/HideContactAvatar";
+ mi.position = 2000150001;
+ mi.hIcon = LoadSmallIcon(g_hInst,MAKEINTRESOURCE(IDI_HIDE_AVATAR));
+ mi.pszName = LPGEN("Hide Contact &Avatar");
+ mi.pszService = "CList/HideContactAvatar";
hHideAvatarMenuItem = Menu_AddContactMenuItem(&mi);
DestroyIcon_protect(mi.hIcon);
@@ -382,10 +382,10 @@ HRESULT CLUI::FillAlphaChannel( HDC hDC, RECT * prcParent, BYTE bAlpha) HRGN hRgn = CreateRectRgn(0,0,0,0);
- if ( GetWindowRgn(m_hWnd,hRgn)==ERROR )
+ if ( GetWindowRgn(m_hWnd,hRgn) == ERROR )
{
DeleteObject(hRgn);
- hRgn=CreateRectRgn(rcWindow.left ,rcWindow.top ,rcWindow.right,rcWindow.bottom);
+ hRgn = CreateRectRgn(rcWindow.left ,rcWindow.top ,rcWindow.right,rcWindow.bottom);
}
OffsetRgn(hRgn,-prcParent->left,-prcParent->top);
@@ -400,12 +400,12 @@ HRESULT CLUI::FillAlphaChannel( HDC hDC, RECT * prcParent, BYTE bAlpha) }
DWORD dwRgnSize = GetRegionData( hRgn, 0, NULL );
- RGNDATA * rgnData=(RGNDATA *)malloc(dwRgnSize);
+ RGNDATA * rgnData = (RGNDATA *)malloc(dwRgnSize);
GetRegionData(hRgn,dwRgnSize,rgnData);
- RECT * pRect=(RECT *)rgnData->Buffer;
+ RECT * pRect = (RECT *)rgnData->Buffer;
- for (DWORD i=0; i<rgnData->rdh.nCount; i++)
+ for (DWORD i = 0; i < rgnData->rdh.nCount; i++)
ske_SetRectOpaque( hDC, &pRect[i] );
free(rgnData);
@@ -417,25 +417,25 @@ HRESULT CLUI::FillAlphaChannel( HDC hDC, RECT * prcParent, BYTE bAlpha) HRESULT CLUI::CreateCLC()
{
- INIT<CLISTFrame> Frame;
+ INIT < CLISTFrame> Frame;
- Frame.hWnd=ClcWnd();
- Frame.align=alClient;
- Frame.hIcon=LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- Frame.Flags=F_VISIBLE|/*F_SHOWTB|*/F_SHOWTBTIP|F_NO_SUBCONTAINER|F_TCHAR;
- Frame.tname=LPGENT("My Contacts");
- Frame.TBtname=TranslateT("My Contacts");
- hFrameContactTree=(HWND)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,(LPARAM)0);
+ Frame.hWnd = ClcWnd();
+ Frame.align = alClient;
+ Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ Frame.Flags = F_VISIBLE|/*F_SHOWTB|*/F_SHOWTBTIP|F_NO_SUBCONTAINER|F_TCHAR;
+ Frame.tname = LPGENT("My Contacts");
+ Frame.TBtname = TranslateT("My Contacts");
+ hFrameContactTree = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,(LPARAM)0);
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)CLCPaint::PaintCallbackProc);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_TBTIPNAME,hFrameContactTree),(LPARAM)Translate("My Contacts"));
ExtraImage_ReloadExtraIcons();
- nLastRequiredHeight=0;
+ nLastRequiredHeight = 0;
if ( g_CluiData.current_viewmode[0] == '\0' )
{
- if (bOldHideOffline != (BYTE)-1)
+ if (bOldHideOffline !=(BYTE)-1)
CallService( MS_CLIST_SETHIDEOFFLINE,(WPARAM)bOldHideOffline, 0);
else
CallService( MS_CLIST_SETHIDEOFFLINE,(WPARAM)0, 0);
@@ -444,10 +444,10 @@ HRESULT CLUI::CreateCLC() else
CallService( MS_CLIST_SETUSEGROUPS ,(WPARAM)bOldUseGroups, 0);
}
- nLastRequiredHeight=0;
- mutex_bDisableAutoUpdate=0;
+ nLastRequiredHeight = 0;
+ mutex_bDisableAutoUpdate = 0;
- hSettingChangedHook=ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED,CLUI::OnEvent_DBSettingChanging);
+ hSettingChangedHook = ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED,CLUI::OnEvent_DBSettingChanging);
return S_OK;
@@ -470,11 +470,11 @@ HRESULT CLUI::SnappingToEdge( WINDOWPOS * lpWindowPos ) dr = &(monInfo.rcWork);
// Left side
- if ( lpWindowPos->x < dr->left + SNAPTOEDGESENSIVITY && lpWindowPos->x > dr->left - SNAPTOEDGESENSIVITY && g_CluiData.bBehindEdgeSettings!=1)
+ if ( lpWindowPos->x < dr->left + SNAPTOEDGESENSIVITY && lpWindowPos->x > dr->left - SNAPTOEDGESENSIVITY && g_CluiData.bBehindEdgeSettings != 1)
lpWindowPos->x = dr->left;
// Right side
- if ( dr->right - lpWindowPos->x - lpWindowPos->cx <SNAPTOEDGESENSIVITY && dr->right - lpWindowPos->x - lpWindowPos->cx > -SNAPTOEDGESENSIVITY && g_CluiData.bBehindEdgeSettings!=2)
+ if ( dr->right - lpWindowPos->x - lpWindowPos->cx < SNAPTOEDGESENSIVITY && dr->right - lpWindowPos->x - lpWindowPos->cx > -SNAPTOEDGESENSIVITY && g_CluiData.bBehindEdgeSettings != 2)
lpWindowPos->x = dr->right - lpWindowPos->cx;
// Top side
@@ -482,7 +482,7 @@ HRESULT CLUI::SnappingToEdge( WINDOWPOS * lpWindowPos ) lpWindowPos->y = dr->top;
// Bottom side
- if ( dr->bottom - lpWindowPos->y - lpWindowPos->cy <SNAPTOEDGESENSIVITY && dr->bottom - lpWindowPos->y - lpWindowPos->cy > -SNAPTOEDGESENSIVITY)
+ if ( dr->bottom - lpWindowPos->y - lpWindowPos->cy < SNAPTOEDGESENSIVITY && dr->bottom - lpWindowPos->y - lpWindowPos->cy > -SNAPTOEDGESENSIVITY)
lpWindowPos->y = dr->bottom - lpWindowPos->cy;
}
return S_OK;
@@ -499,13 +499,13 @@ void UnloadAvatarOverlayIcon() int i;
for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
{
- g_pAvatarOverlayIcons[i].listID=-1;
- g_pStatusOverlayIcons[i].listID=-1;
+ g_pAvatarOverlayIcons[i].listID = -1;
+ g_pStatusOverlayIcons[i].listID = -1;
}
ImageList_Destroy(hAvatarOverlays);
- hAvatarOverlays=NULL;
+ hAvatarOverlays = NULL;
DestroyIcon_protect(g_hListeningToIcon);
- g_hListeningToIcon=NULL;
+ g_hListeningToIcon = NULL;
}
@@ -513,9 +513,9 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd) {
HWND hWndMid, hWndClui;
if (!hWnd) return FALSE;
- hWndClui=pcli->hwndContactList;
- hWndMid=fnGetAncestor(hWnd,GA_ROOTOWNER);
- if(hWndMid==hWndClui) return TRUE;
+ hWndClui = pcli->hwndContactList;
+ hWndMid = fnGetAncestor(hWnd,GA_ROOTOWNER);
+ if (hWndMid == hWndClui) return TRUE;
{
TCHAR buf[255];
GetClassName(hWndMid,buf,254);
@@ -526,17 +526,17 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd) int CLUI_ShowWindowMod(HWND hWnd, int nCmd)
{
- int res=0;
+ int res = 0;
- if (hWnd==pcli->hwndContactList && (nCmd==SW_HIDE || nCmd==SW_MINIMIZE))
+ if (hWnd == pcli->hwndContactList && (nCmd == SW_HIDE || nCmd == SW_MINIMIZE))
{
AniAva_InvalidateAvatarPositions(NULL);
AniAva_RemoveInvalidatedAvatars();
}
- if (hWnd==pcli->hwndContactList
+ if (hWnd == pcli->hwndContactList
&& !g_mutex_bChangingMode
- && nCmd==SW_HIDE
+ && nCmd == SW_HIDE
&& !g_CluiData.fLayered
&& IsWinVerXPPlus()
&& db_get_b(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT))
@@ -544,23 +544,23 @@ int CLUI_ShowWindowMod(HWND hWnd, int nCmd) ShowWindow(hWnd,SW_MINIMIZE); //removing of shadow
return ShowWindow(hWnd,nCmd);
}
- if (hWnd==pcli->hwndContactList
+ if (hWnd == pcli->hwndContactList
&& !g_mutex_bChangingMode
- && nCmd==SW_RESTORE
+ && nCmd == SW_RESTORE
&& !g_CluiData.fLayered
&& IsWinVerXPPlus()
&& g_CluiData.fSmoothAnimation
&& !g_bTransparentFlag
)
{
- if(db_get_b(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT))
+ if (db_get_b(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT))
{
CLUI_SmoothAlphaTransition(hWnd, 255, 1);
}
else
{
- int ret=ShowWindow(hWnd,nCmd);
+ int ret = ShowWindow(hWnd,nCmd);
CLUI_SmoothAlphaTransition(hWnd, 255, 1);
return ret;
}
@@ -570,10 +570,10 @@ int CLUI_ShowWindowMod(HWND hWnd, int nCmd) static BOOL CLUI_WaitThreadsCompletion(HWND hwnd)
{
- static BYTE bEntersCount=0;
+ static BYTE bEntersCount = 0;
static const BYTE bcMAX_AWAITING_RETRY = 10; //repeat awaiting only 10 times
TRACE("CLUI_WaitThreadsCompletion Enter");
- if (bEntersCount<bcMAX_AWAITING_RETRY
+ if (bEntersCount < bcMAX_AWAITING_RETRY
&&( g_mutex_nCalcRowHeightLock ||
g_CluiData.mutexPaintLock ||
g_dwAwayMsgThreadID ||
@@ -599,23 +599,23 @@ static BOOL CLUI_WaitThreadsCompletion(HWND hwnd) void CLUI_UpdateLayeredMode()
{
- g_CluiData.fDisableSkinEngine=db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
+ g_CluiData.fDisableSkinEngine = db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
if (IsWinVer2000Plus())
{
- BOOL tLayeredFlag=TRUE;
- tLayeredFlag&=(db_get_b(NULL, "ModernData", "EnableLayering", tLayeredFlag) && !g_CluiData.fDisableSkinEngine);
+ BOOL tLayeredFlag = TRUE;
+ tLayeredFlag &= (db_get_b(NULL, "ModernData", "EnableLayering", tLayeredFlag) && !g_CluiData.fDisableSkinEngine);
- if (g_CluiData.fLayered != tLayeredFlag)
+ if (g_CluiData.fLayered !=tLayeredFlag)
{
LONG exStyle;
- BOOL fWasVisible=IsWindowVisible(pcli->hwndContactList);
+ BOOL fWasVisible = IsWindowVisible(pcli->hwndContactList);
if (fWasVisible) ShowWindow(pcli->hwndContactList,SW_HIDE);
//change layered mode
- exStyle=GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE);
+ exStyle = GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE);
if (tLayeredFlag)
- exStyle|=WS_EX_LAYERED;
+ exStyle |= WS_EX_LAYERED;
else
- exStyle&=~WS_EX_LAYERED;
+ exStyle &= ~WS_EX_LAYERED;
SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE,exStyle&~WS_EX_LAYERED);
SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE,exStyle);
g_CluiData.fLayered = tLayeredFlag;
@@ -630,7 +630,7 @@ void CLUI_UpdateLayeredMode() void CLUI_UpdateAeroGlass()
{
BOOL tAeroGlass = db_get_b(NULL, "ModernData", "AeroGlass", SETTING_AEROGLASS_DEFAULT) && (g_CluiData.fLayered);
- if (g_proc_DWMEnableBlurBehindWindow && (tAeroGlass != g_CluiData.fAeroGlass))
+ if (g_proc_DWMEnableBlurBehindWindow && (tAeroGlass !=g_CluiData.fAeroGlass))
{
if (g_CluiData.hAeroGlassRgn)
{
@@ -658,62 +658,62 @@ extern int CLUIFrames_UpdateBorders(); void CLUI_ChangeWindowMode()
{
- BOOL storedVisMode=FALSE;
+ BOOL storedVisMode = FALSE;
LONG style,styleEx;
LONG oldStyle,oldStyleEx;
- 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 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;
- g_mutex_bChangingMode=TRUE;
- g_bTransparentFlag=IsWinVer2000Plus()&&db_get_b( NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT);
- g_CluiData.fSmoothAnimation=IsWinVer2000Plus()&&db_get_b(NULL, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT);
- if (g_bTransparentFlag==0 && g_CluiData.bCurrentAlpha!=0)
- g_CluiData.bCurrentAlpha=255;
+ g_mutex_bChangingMode = TRUE;
+ g_bTransparentFlag = IsWinVer2000Plus()&&db_get_b( NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT);
+ g_CluiData.fSmoothAnimation = IsWinVer2000Plus()&&db_get_b(NULL, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT);
+ if (g_bTransparentFlag == 0 && g_CluiData.bCurrentAlpha != 0)
+ g_CluiData.bCurrentAlpha = 255;
//2- Calculate STYLES and STYLESEX
if (!g_CluiData.fLayered)
{
- style=0;
- styleEx=0;
+ style = 0;
+ styleEx = 0;
if (db_get_b(NULL,"CList","ThinBorder",SETTING_THINBORDER_DEFAULT) || (db_get_b(NULL,"CList","NoBorder",SETTING_NOBORDER_DEFAULT)))
{
- style=WS_CLIPCHILDREN| (db_get_b(NULL,"CList","ThinBorder",SETTING_THINBORDER_DEFAULT)?WS_BORDER:0);
- styleEx=WS_EX_TOOLWINDOW;
+ style = WS_CLIPCHILDREN| (db_get_b(NULL,"CList","ThinBorder",SETTING_THINBORDER_DEFAULT)?WS_BORDER:0);
+ styleEx = WS_EX_TOOLWINDOW;
styleMaskEx |= WS_EX_APPWINDOW;
}
else if (db_get_b(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) && db_get_b(NULL,"CList","ToolWindow",SETTING_TOOLWINDOW_DEFAULT))
{
- styleEx=WS_EX_TOOLWINDOW/*|WS_EX_WINDOWEDGE*/;
- style=WS_CAPTION|WS_POPUPWINDOW|WS_CLIPCHILDREN|WS_THICKFRAME;
+ styleEx = WS_EX_TOOLWINDOW/*|WS_EX_WINDOWEDGE*/;
+ style = WS_CAPTION|WS_POPUPWINDOW|WS_CLIPCHILDREN|WS_THICKFRAME;
styleMaskEx |= WS_EX_APPWINDOW;
}
else if (db_get_b(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT))
{
- style=WS_CAPTION|WS_SYSMENU|WS_POPUPWINDOW|WS_CLIPCHILDREN|WS_THICKFRAME|WS_MINIMIZEBOX;
+ style = WS_CAPTION|WS_SYSMENU|WS_POPUPWINDOW|WS_CLIPCHILDREN|WS_THICKFRAME|WS_MINIMIZEBOX;
}
else
{
- style=WS_POPUPWINDOW|WS_CLIPCHILDREN|WS_THICKFRAME;
- styleEx=WS_EX_TOOLWINDOW/*|WS_EX_WINDOWEDGE*/;
+ style = WS_POPUPWINDOW|WS_CLIPCHILDREN|WS_THICKFRAME;
+ styleEx = WS_EX_TOOLWINDOW/*|WS_EX_WINDOWEDGE*/;
styleMaskEx |= WS_EX_APPWINDOW;
}
}
else
{
- style=WS_CLIPCHILDREN;
- styleEx=WS_EX_TOOLWINDOW;
+ style = WS_CLIPCHILDREN;
+ styleEx = WS_EX_TOOLWINDOW;
styleMaskEx |= WS_EX_APPWINDOW;
}
//3- TODO Update Layered mode
- if(g_bTransparentFlag&&g_CluiData.fLayered)
- styleEx|=WS_EX_LAYERED;
+ if (g_bTransparentFlag&&g_CluiData.fLayered)
+ styleEx |= WS_EX_LAYERED;
//4- Set Title
{
- TCHAR titleText[255]={0};
- DBVARIANT dbv={0};
- if(DBGetContactSettingTString(NULL,"CList","TitleText",&dbv))
+ TCHAR titleText[255] = {0};
+ DBVARIANT dbv = {0};
+ if (DBGetContactSettingTString(NULL,"CList","TitleText",&dbv))
lstrcpyn(titleText,TEXT(MIRANDANAME),SIZEOF(titleText));
else
{
@@ -722,7 +722,7 @@ void CLUI_ChangeWindowMode() }
SetWindowText(pcli->hwndContactList,titleText);
}
- //<->
+ // < ->
//1- If visible store it and hide
if (g_CluiData.fLayered && (db_get_b(NULL,"CList","OnDesktop", SETTING_ONDESKTOP_DEFAULT)))// && !flag_bFirstTimeCall))
@@ -730,7 +730,7 @@ void CLUI_ChangeWindowMode() SetParent(pcli->hwndContactList,NULL);
Sync( CLUIFrames_SetParentForContainers, (HWND) NULL );
UpdateWindow(pcli->hwndContactList);
- g_CluiData.fOnDesktop=0;
+ g_CluiData.fOnDesktop = 0;
}
//5- TODO Apply Style
oldStyleEx = curStyleEx = GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE);
@@ -738,12 +738,12 @@ void CLUI_ChangeWindowMode() curStyleEx = (curStyleEx & ~styleMaskEx) | styleEx;
curStyle = (curStyle & ~styleMask) | style;
- if (oldStyleEx != curStyleEx || oldStyle != curStyle)
+ if (oldStyleEx !=curStyleEx || oldStyle !=curStyle)
{
if (IsWindowVisible(pcli->hwndContactList))
{
- storedVisMode=TRUE;
- mutex_bShowHideCalledFromAnimation=TRUE;
+ storedVisMode = TRUE;
+ mutex_bShowHideCalledFromAnimation = TRUE;
ShowWindow(pcli->hwndContactList,SW_HIDE);
Sync(CLUIFrames_OnShowHide, pcli->hwndContactList,0);
}
@@ -753,7 +753,7 @@ void CLUI_ChangeWindowMode() CLUI_UpdateAeroGlass();
- if(g_CluiData.fLayered || !db_get_b(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT))
+ if (g_CluiData.fLayered || !db_get_b(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT))
{
HMENU m = GetMenu(pcli->hwndContactList);
SetMenu(pcli->hwndContactList,NULL);
@@ -768,24 +768,24 @@ void CLUI_ChangeWindowMode() //6- Pin to desktop mode
if (db_get_b(NULL,"CList","OnDesktop", SETTING_ONDESKTOP_DEFAULT))
{
- HWND hProgMan=FindWindow(TEXT("Progman"),NULL);
+ HWND hProgMan = FindWindow(TEXT("Progman"),NULL);
if (IsWindow(hProgMan))
{
SetParent(pcli->hwndContactList,hProgMan);
Sync( CLUIFrames_SetParentForContainers, (HWND) hProgMan );
- g_CluiData.fOnDesktop=1;
+ g_CluiData.fOnDesktop = 1;
}
}
else
{
- // HWND parent=GetParent(pcli->hwndContactList);
- // HWND progman=FindWindow(TEXT("Progman"),NULL);
- // if (parent==progman)
+ // HWND parent = GetParent(pcli->hwndContactList);
+ // HWND progman = FindWindow(TEXT("Progman"),NULL);
+ // if (parent == progman)
{
SetParent(pcli->hwndContactList,NULL);
Sync(CLUIFrames_SetParentForContainers, (HWND) NULL);
}
- g_CluiData.fOnDesktop=0;
+ g_CluiData.fOnDesktop = 0;
}
//7- if it was visible - show
@@ -794,7 +794,7 @@ void CLUI_ChangeWindowMode() ShowWindow(pcli->hwndContactList,SW_SHOW);
Sync(CLUIFrames_OnShowHide, pcli->hwndContactList,1);
}
- mutex_bShowHideCalledFromAnimation=FALSE;
+ mutex_bShowHideCalledFromAnimation = FALSE;
CLUIFrames_UpdateBorders();
@@ -803,12 +803,12 @@ void CLUI_ChangeWindowMode() HRGN hRgn1;
RECT r;
int v,h;
- int w=10;
+ int w = 10;
GetWindowRect(pcli->hwndContactList,&r);
- h=(r.right-r.left)>(w*2)?w:(r.right-r.left);
- v=(r.bottom-r.top)>(w*2)?w:(r.bottom-r.top);
- h=(h<v)?h:v;
- hRgn1=CreateRoundRectRgn(0,0,(r.right-r.left+1),(r.bottom-r.top+1),h,h);
+ h = (r.right-r.left)>(w*2)?w:(r.right-r.left);
+ v = (r.bottom-r.top)>(w*2)?w:(r.bottom-r.top);
+ h = (h < v)?h:v;
+ hRgn1 = CreateRoundRectRgn(0,0,(r.right-r.left+1),(r.bottom-r.top+1),h,h);
if ((db_get_b(NULL,"CLC","RoundCorners",SETTING_ROUNDCORNERS_DEFAULT)) && (!CallService(MS_CLIST_DOCKINGISDOCKED,0,0)))
SetWindowRgn(pcli->hwndContactList,hRgn1,1);
else
@@ -819,8 +819,8 @@ void CLUI_ChangeWindowMode() RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
- g_mutex_bChangingMode=FALSE;
- flag_bFirstTimeCall=TRUE;
+ g_mutex_bChangingMode = FALSE;
+ flag_bFirstTimeCall = TRUE;
AniAva_UpdateParent();
}
struct _tagTimerAsync
@@ -832,66 +832,66 @@ struct _tagTimerAsync };
static UINT_PTR SetTimerSync(WPARAM wParam , LPARAM lParam)
{
- struct _tagTimerAsync * call=(struct _tagTimerAsync *) wParam;
+ struct _tagTimerAsync * call = (struct _tagTimerAsync *) wParam;
return SetTimer(call->hwnd, call->ID ,call->Timeout, call->proc);
}
UINT_PTR CLUI_SafeSetTimer(HWND hwnd, int ID, int Timeout, TIMERPROC proc)
{
- struct _tagTimerAsync param={ hwnd, ID, Timeout, proc };
+ struct _tagTimerAsync param = { hwnd, ID, Timeout, proc };
return Sync(SetTimerSync, (WPARAM) ¶m, (LPARAM) 0);
}
int CLUI_UpdateTimer(BYTE BringIn)
{
- if (g_CluiData.nBehindEdgeState==0)
+ if (g_CluiData.nBehindEdgeState == 0)
{
KillTimer(pcli->hwndContactList,TM_BRINGOUTTIMEOUT);
CLUI_SafeSetTimer(pcli->hwndContactList,TM_BRINGOUTTIMEOUT,wBehindEdgeHideDelay*100,NULL);
}
- if (bShowEventStarted==0 && g_CluiData.nBehindEdgeState>0 )
+ if (bShowEventStarted == 0 && g_CluiData.nBehindEdgeState>0 )
{
KillTimer(pcli->hwndContactList,TM_BRINGINTIMEOUT);
- bShowEventStarted=(BOOL)CLUI_SafeSetTimer(pcli->hwndContactList,TM_BRINGINTIMEOUT,wBehindEdgeShowDelay*100,NULL);
+ bShowEventStarted = (BOOL)CLUI_SafeSetTimer(pcli->hwndContactList,TM_BRINGINTIMEOUT,wBehindEdgeShowDelay*100,NULL);
}
return 0;
}
int CLUI_HideBehindEdge()
{
- int method=g_CluiData.bBehindEdgeSettings;
+ int method = g_CluiData.bBehindEdgeSettings;
if (method)
{
- // if (DBGetContactSettingByte(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT)==0)
+ // if (DBGetContactSettingByte(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT) == 0)
{
RECT rcScreen;
RECT rcWindow;
- int bordersize=0;
+ int bordersize = 0;
//Need to be moved out of screen
- bShowEventStarted=0;
+ bShowEventStarted = 0;
//1. get work area rectangle
Docking_GetMonitorRectFromWindow(pcli->hwndContactList,&rcScreen);
//SystemParametersInfo(SPI_GETWORKAREA,0,&rcScreen,FALSE);
//2. move out
- bordersize=wBehindEdgeBorderSize;
+ bordersize = wBehindEdgeBorderSize;
GetWindowRect(pcli->hwndContactList,&rcWindow);
switch (method)
{
case 1: //left
- rcWindow.left=rcScreen.left-(rcWindow.right-rcWindow.left)+bordersize;
+ rcWindow.left = rcScreen.left-(rcWindow.right-rcWindow.left)+bordersize;
break;
case 2: //right
- rcWindow.left=rcScreen.right-bordersize;
+ rcWindow.left = rcScreen.right-bordersize;
break;
}
- g_CluiData.mutexPreventDockMoving=0;
+ g_CluiData.mutexPreventDockMoving = 0;
SetWindowPos(pcli->hwndContactList,NULL,rcWindow.left,rcWindow.top,0,0,SWP_NOZORDER|SWP_NOSIZE|SWP_NOACTIVATE);
Sync(CLUIFrames_OnMoving,pcli->hwndContactList,&rcWindow);
- g_CluiData.mutexPreventDockMoving=1;
+ g_CluiData.mutexPreventDockMoving = 1;
//3. store setting
db_set_b(NULL, "ModernData", "BehindEdge",method);
- g_CluiData.nBehindEdgeState=method;
+ g_CluiData.nBehindEdgeState = method;
return 1;
}
return 2;
@@ -902,43 +902,43 @@ int CLUI_HideBehindEdge() int CLUI_ShowFromBehindEdge()
{
- int method=g_CluiData.bBehindEdgeSettings;
- bShowEventStarted=0;
+ int method = g_CluiData.bBehindEdgeSettings;
+ bShowEventStarted = 0;
if (g_mutex_bOnTrayRightClick)
{
- g_mutex_bOnTrayRightClick=0;
+ g_mutex_bOnTrayRightClick = 0;
return 0;
}
- if (method)// && (DBGetContactSettingByte(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT)==0))
+ if (method)// && (DBGetContactSettingByte(NULL, "ModernData", "BehindEdge", SETTING_BEHINDEDGE_DEFAULT) == 0))
{
RECT rcScreen;
RECT rcWindow;
- int bordersize=0;
+ int bordersize = 0;
//Need to be moved out of screen
//1. get work area rectangle
//SystemParametersInfo(SPI_GETWORKAREA,0,&rcScreen,FALSE);
Docking_GetMonitorRectFromWindow(pcli->hwndContactList,&rcScreen);
//2. move out
- bordersize=wBehindEdgeBorderSize;
+ bordersize = wBehindEdgeBorderSize;
GetWindowRect(pcli->hwndContactList,&rcWindow);
switch (method)
{
case 1: //left
- rcWindow.left=rcScreen.left;
+ rcWindow.left = rcScreen.left;
break;
case 2: //right
- rcWindow.left=rcScreen.right-(rcWindow.right-rcWindow.left);
+ rcWindow.left = rcScreen.right-(rcWindow.right-rcWindow.left);
break;
}
- g_CluiData.mutexPreventDockMoving=0;
+ g_CluiData.mutexPreventDockMoving = 0;
SetWindowPos(pcli->hwndContactList,NULL,rcWindow.left,rcWindow.top,0,0,SWP_NOZORDER|SWP_NOSIZE);
Sync(CLUIFrames_OnMoving,pcli->hwndContactList,&rcWindow);
- g_CluiData.mutexPreventDockMoving=1;
+ g_CluiData.mutexPreventDockMoving = 1;
//3. store setting
db_set_b(NULL, "ModernData", "BehindEdge",0);
- g_CluiData.nBehindEdgeState=0;
+ g_CluiData.nBehindEdgeState = 0;
}
return 0;
}
@@ -946,8 +946,8 @@ int CLUI_ShowFromBehindEdge() int CLUI_IsInMainWindow(HWND hwnd)
{
- if (hwnd==pcli->hwndContactList) return 1;
- if (GetParent(hwnd)==pcli->hwndContactList) return 2;
+ if (hwnd == pcli->hwndContactList) return 1;
+ if (GetParent(hwnd) == pcli->hwndContactList) return 2;
return 0;
}
@@ -965,21 +965,21 @@ static LPPROTOTICKS CLUI_GetProtoTicksByProto(char * szProto) {
int i;
- for (i=0;i<64;i++)
+ for (i = 0;i < 64;i++)
{
- if (CycleStartTick[i].szProto==NULL) break;
+ if (CycleStartTick[i].szProto == NULL) break;
if (mir_strcmp(CycleStartTick[i].szProto,szProto)) continue;
return(&CycleStartTick[i]);
}
- for (i=0;i<64;i++)
+ for (i = 0;i < 64;i++)
{
- if (CycleStartTick[i].szProto==NULL)
+ if (CycleStartTick[i].szProto == NULL)
{
- CycleStartTick[i].szProto=mir_strdup(szProto);
- CycleStartTick[i].nCycleStartTick=0;
- CycleStartTick[i].nIndex=i;
- CycleStartTick[i].bGlobal=( szProto[0]==0 );
- CycleStartTick[i].himlIconList=NULL;
+ CycleStartTick[i].szProto = mir_strdup(szProto);
+ CycleStartTick[i].nCycleStartTick = 0;
+ CycleStartTick[i].nIndex = i;
+ CycleStartTick[i].bGlobal = ( szProto[0] == 0 );
+ CycleStartTick[i].himlIconList = NULL;
return(&CycleStartTick[i]);
}
}
@@ -998,7 +998,7 @@ static int CLUI_GetConnectingIconForProtoCount(char *szAccoName) char szRelativePath[MAX_PATH];
GetModuleFileNameA(GetModuleHandle(NULL), szRelativePath, MAX_PATH);
char *str = strrchr( szRelativePath, '\\' );
- if ( str != NULL ) *str=0;
+ if ( str !=NULL ) *str = 0;
CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)szRelativePath, (LPARAM)szFolderPath);
}
@@ -1036,15 +1036,15 @@ static HICON CLUI_ExtractIconFromPath(const char *path, BOOL * needFree) int n;
HICON hIcon;
lstrcpynA(file,path,sizeof(file));
- comma=strrchr(file,',');
- if(comma==NULL) n=0;
- else {n=atoi(comma+1); *comma=0;}
+ comma = strrchr(file,',');
+ if (comma == NULL) n = 0;
+ else {n = atoi(comma+1); *comma = 0;}
CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)file, (LPARAM)fileFull);
- hIcon=NULL;
+ hIcon = NULL;
ExtractIconExA(fileFull,n,NULL,&hIcon,1);
if (needFree)
{
- *needFree=(hIcon!=NULL);
+ *needFree = (hIcon != NULL);
}
return hIcon;
}
@@ -1052,47 +1052,47 @@ static HICON CLUI_ExtractIconFromPath(const char *path, BOOL * needFree) HICON CLUI_LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,boolean 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;
- BOOL has_proto_icon=FALSE;
- SKINICONDESC sid={0};
- if (needFree) *needFree=FALSE;
+ HICON hIcon = NULL;
+ BOOL has_proto_icon = FALSE;
+ SKINICONDESC sid = {0};
+ if (needFree) *needFree = FALSE;
GetModuleFileNameA(GetModuleHandle(NULL), szPath, MAX_PATH);
GetModuleFileNameA(g_hInst, szMyPath, MAX_PATH);
- str=strrchr(szPath,'\\');
- if(str!=NULL) *str=0;
+ str = strrchr(szPath,'\\');
+ if (str != NULL) *str = 0;
if (UseLibrary&2)
mir_snprintf(szMyPath, SIZEOF(szMyPath), "%s\\Icons\\%s", szPath, filename);
mir_snprintf(szFullPath, SIZEOF(szFullPath), "%s\\Icons\\%s,%d", szPath, filename, i);
- if(str!=NULL) *str='\\';
+ if (str != NULL) *str = '\\';
if (UseLibrary&2)
{
BOOL nf;
- HICON hi=CLUI_ExtractIconFromPath(szFullPath,&nf);
- if (hi) has_proto_icon=TRUE;
+ HICON hi = CLUI_ExtractIconFromPath(szFullPath,&nf);
+ if (hi) has_proto_icon = TRUE;
if (hi && nf) DestroyIcon(hi);
}
if (!UseLibrary) {
- hIcon=CLUI_ExtractIconFromPath(szFullPath,needFree);
+ hIcon = CLUI_ExtractIconFromPath(szFullPath,needFree);
if (hIcon) return hIcon;
if (UseLibrary)
{
mir_snprintf(szFullPath, SIZEOF(szFullPath), "%s,%d", szMyPath, internalidx);
- hIcon=CLUI_ExtractIconFromPath(szFullPath,needFree);
+ hIcon = CLUI_ExtractIconFromPath(szFullPath,needFree);
if (hIcon) return hIcon;
}
}
else {
- if (registerit && IconName != NULL && SectName != NULL) {
+ if (registerit && IconName !=NULL && SectName !=NULL) {
sid.cbSize = sizeof(sid);
- sid.cx=16;
- sid.cy=16;
+ sid.cx = 16;
+ sid.cy = 16;
sid.hDefaultIcon = (has_proto_icon||!(UseLibrary&2))?NULL:(HICON)CallService(MS_SKIN_LOADPROTOICON,(WPARAM)NULL,(LPARAM)(-internalidx));
- sid.pszSection=SectName;
- sid.pszName=IconName;
- sid.pszDescription=Description;
- sid.pszDefaultFile=internalidx<0?szMyPath:szPath;
+ sid.pszSection = SectName;
+ sid.pszName = IconName;
+ sid.pszDescription = Description;
+ sid.pszDefaultFile = internalidx < 0?szMyPath:szPath;
- sid.iDefaultIndex=(UseLibrary&2)?i:(internalidx<0)?internalidx:-internalidx;
+ sid.iDefaultIndex = (UseLibrary&2)?i:(internalidx < 0)?internalidx:-internalidx;
Skin_AddIcon(&sid);
}
return ((HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)IconName));
@@ -1107,9 +1107,9 @@ HICON CLUI_LoadIconFromExternalFile(char *filename,int i,boolean UseLibrary,bool static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int b)
{
char szFullPath[MAX_PATH];
- HICON hIcon=NULL;
+ HICON hIcon = NULL;
BOOL needFree;
- b=b-1;
+ b = b-1;
if ( szAccoName )
{
@@ -1134,7 +1134,7 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int b) hIcon = CLUI_LoadIconFromExternalFile(szFullPath,b+1,FALSE,FALSE,NULL,NULL,NULL,0,&needFree);
if ( hIcon ) return hIcon;
- hIcon=LoadSmallIcon(g_hInst,(TCHAR *)(IDI_ICQC1+b+1));
+ hIcon = LoadSmallIcon(g_hInst,(TCHAR *)(IDI_ICQC1+b+1));
return(hIcon);
}
@@ -1142,35 +1142,35 @@ static HICON CLUI_GetConnectingIconForProto(char *szAccoName, int b) INT_PTR CLUI_GetConnectingIconService(WPARAM wParam,LPARAM lParam)
{
int b;
- PROTOTICKS *pt=NULL;
- HICON hIcon=NULL;
+ PROTOTICKS *pt = NULL;
+ HICON hIcon = NULL;
- char *szProto=(char *)wParam;
+ char *szProto = (char *)wParam;
if (!szProto) return 0;
- pt=CLUI_GetProtoTicksByProto(szProto);
+ pt = CLUI_GetProtoTicksByProto(szProto);
- if (pt!=NULL)
+ if (pt != NULL)
{
- if (pt->nCycleStartTick==0)
+ if (pt->nCycleStartTick == 0)
{
CLUI_CreateTimerForConnectingIcon(ID_STATUS_CONNECTING,wParam);
- pt=CLUI_GetProtoTicksByProto(szProto);
+ pt = CLUI_GetProtoTicksByProto(szProto);
}
}
- if (pt!=NULL)
+ if (pt != NULL)
{
- if (pt->nCycleStartTick!=0&&pt->nIconsCount!=0)
+ if (pt->nCycleStartTick != 0&&pt->nIconsCount != 0)
{
- b=((GetTickCount()-pt->nCycleStartTick)/(nAnimatedIconStep))%(pt->nIconsCount);
+ b = ((GetTickCount()-pt->nCycleStartTick)/(nAnimatedIconStep))%(pt->nIconsCount);
// if (lParam)
- // hIcon=CLUI_GetConnectingIconForProto("Global",b);
+ // hIcon = CLUI_GetConnectingIconForProto("Global",b);
// else
if (pt->himlIconList)
- hIcon=ske_ImageList_GetIcon(pt->himlIconList,b,ILD_NORMAL);
+ hIcon = ske_ImageList_GetIcon(pt->himlIconList,b,ILD_NORMAL);
else
- hIcon=NULL;
- //hIcon=CLUI_GetConnectingIconForProto(szProto,b);
+ hIcon = NULL;
+ //hIcon = CLUI_GetConnectingIconForProto(szProto,b);
};
}
@@ -1182,40 +1182,40 @@ INT_PTR CLUI_GetConnectingIconService(WPARAM wParam,LPARAM lParam) static int CLUI_CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam)
{
- int status=(int)wParam;
- char *szProto=(char *)lParam;
+ int status = (int)wParam;
+ char *szProto = (char *)lParam;
if (!szProto) return (0);
if (!status) return (0);
- if ((g_StatusBarData.connectingIcon==1)&&status>=ID_STATUS_CONNECTING&&status<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
+ if ((g_StatusBarData.connectingIcon == 1)&&status >= ID_STATUS_CONNECTING&&status <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
- PROTOTICKS *pt=NULL;
+ PROTOTICKS *pt = NULL;
int cnt;
- pt=CLUI_GetProtoTicksByProto(szProto);
- if (pt!=NULL)
+ pt = CLUI_GetProtoTicksByProto(szProto);
+ if (pt != NULL)
{
- if (pt->nCycleStartTick==0)
+ if (pt->nCycleStartTick == 0)
{
KillTimer(pcli->hwndContactList,TM_STATUSBARUPDATE+pt->nIndex);
- cnt=CLUI_GetConnectingIconForProtoCount(szProto);
- if (cnt!=0)
+ cnt = CLUI_GetConnectingIconForProtoCount(szProto);
+ if (cnt != 0)
{
- int i=0;
- nAnimatedIconStep=100;/*DBGetContactSettingWord(NULL,"CLUI","DefaultStepConnectingIcon",100);*/
- pt->nIconsCount=cnt;
+ int i = 0;
+ nAnimatedIconStep = 100;/*DBGetContactSettingWord(NULL,"CLUI","DefaultStepConnectingIcon",100);*/
+ pt->nIconsCount = cnt;
if (pt->himlIconList) ImageList_Destroy(pt->himlIconList);
- pt->himlIconList=ImageList_Create(16,16,ILC_MASK|ILC_COLOR32,cnt,1);
- for (i=0; i<cnt; i++)
+ pt->himlIconList = ImageList_Create(16,16,ILC_MASK|ILC_COLOR32,cnt,1);
+ for (i = 0; i < cnt; i++)
{
- HICON ic=CLUI_GetConnectingIconForProto(szProto,i);
+ HICON ic = CLUI_GetConnectingIconForProto(szProto,i);
if (ic) ImageList_AddIcon(pt->himlIconList,ic);
DestroyIcon_protect(ic);
}
CLUI_SafeSetTimer(pcli->hwndContactList,TM_STATUSBARUPDATE+pt->nIndex,(int)(nAnimatedIconStep)/1,0);
- pt->bTimerCreated=1;
- pt->nCycleStartTick=GetTickCount();
+ pt->bTimerCreated = 1;
+ pt->nCycleStartTick = GetTickCount();
}
};
@@ -1226,7 +1226,7 @@ static int CLUI_CreateTimerForConnectingIcon(WPARAM wParam,LPARAM lParam) static BOOL CALLBACK BroadcastEnumChildProc(HWND hwndChild, LPARAM lParam)
{
- MSG * pMsg=(MSG*)lParam;
+ MSG * pMsg = (MSG*)lParam;
SendNotifyMessage( hwndChild, pMsg->message, pMsg->wParam, pMsg->lParam );
EnumChildWindows( hwndChild, BroadcastEnumChildProc, lParam );
return TRUE;
@@ -1234,11 +1234,11 @@ static BOOL CALLBACK BroadcastEnumChildProc(HWND hwndChild, LPARAM lParam) static LRESULT BroadCastMessageToChild(HWND hwnd, int message, WPARAM wParam, LPARAM lParam )
{
- MSG msg={0};
- msg.hwnd=hwnd;
- msg.lParam=lParam;
- msg.wParam=wParam;
- msg.message=message;
+ MSG msg = {0};
+ msg.hwnd = hwnd;
+ msg.lParam = lParam;
+ msg.wParam = wParam;
+ msg.message = message;
EnumChildWindows(hwnd, BroadcastEnumChildProc, (LPARAM) &msg);
return 1;
}
@@ -1246,26 +1246,26 @@ static LRESULT BroadCastMessageToChild(HWND hwnd, int message, WPARAM wParam, LP int CLUI_ReloadCLUIOptions()
{
KillTimer(pcli->hwndContactList,TM_UPDATEBRINGTIMER);
- g_CluiData.bBehindEdgeSettings=db_get_b(NULL, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT);
- wBehindEdgeShowDelay=db_get_w(NULL,"ModernData","ShowDelay",SETTING_SHOWDELAY_DEFAULT);
- wBehindEdgeHideDelay=db_get_w(NULL,"ModernData","HideDelay",SETTING_HIDEDELAY_DEFAULT);
- wBehindEdgeBorderSize=db_get_w(NULL,"ModernData","HideBehindBorderSize",SETTING_HIDEBEHINDBORDERSIZE_DEFAULT);
+ g_CluiData.bBehindEdgeSettings = db_get_b(NULL, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT);
+ wBehindEdgeShowDelay = db_get_w(NULL,"ModernData","ShowDelay",SETTING_SHOWDELAY_DEFAULT);
+ wBehindEdgeHideDelay = db_get_w(NULL,"ModernData","HideDelay",SETTING_HIDEDELAY_DEFAULT);
+ wBehindEdgeBorderSize = db_get_w(NULL,"ModernData","HideBehindBorderSize",SETTING_HIDEBEHINDBORDERSIZE_DEFAULT);
- g_CluiData.fAutoSize=db_get_b(NULL,"CLUI","AutoSize",SETTING_AUTOSIZE_DEFAULT);
+ g_CluiData.fAutoSize = db_get_b(NULL,"CLUI","AutoSize",SETTING_AUTOSIZE_DEFAULT);
g_CluiData.bInternalAwayMsgDiscovery = db_get_b(NULL,"ModernData","InternalAwayMsgDiscovery",SETTING_INTERNALAWAYMSGREQUEST_DEFAULT);
- g_CluiData.bRemoveAwayMessageForOffline = db_get_b(NULL,"ModernData","RemoveAwayMessageForOffline",SETTING_REMOVEAWAYMSGFOROFFLINE_DEFAULT);
+ g_CluiData.bRemoveAwayMessageForOffline = db_get_b(NULL,"ModernData","RemoveAwayMessageForOffline",SETTING_REMOVEAWAYMSGFOROFFLINE_DEFAULT);
//window borders
if (g_CluiData.fDisableSkinEngine) {
- g_CluiData.LeftClientMargin=0;
- g_CluiData.RightClientMargin=0;
- g_CluiData.TopClientMargin=0;
- g_CluiData.BottomClientMargin=0;
+ g_CluiData.LeftClientMargin = 0;
+ g_CluiData.RightClientMargin = 0;
+ g_CluiData.TopClientMargin = 0;
+ g_CluiData.BottomClientMargin = 0;
} else {
//window borders
- g_CluiData.LeftClientMargin=(int)db_get_b(NULL,"CLUI","LeftClientMargin",SETTING_LEFTCLIENTMARIGN_DEFAULT);
- g_CluiData.RightClientMargin=(int)db_get_b(NULL,"CLUI","RightClientMargin",SETTING_RIGHTCLIENTMARIGN_DEFAULT);
- g_CluiData.TopClientMargin=(int)db_get_b(NULL,"CLUI","TopClientMargin",SETTING_TOPCLIENTMARIGN_DEFAULT);
- g_CluiData.BottomClientMargin=(int)db_get_b(NULL,"CLUI","BottomClientMargin",SETTING_BOTTOMCLIENTMARIGN_DEFAULT);
+ g_CluiData.LeftClientMargin = (int)db_get_b(NULL,"CLUI","LeftClientMargin",SETTING_LEFTCLIENTMARIGN_DEFAULT);
+ g_CluiData.RightClientMargin = (int)db_get_b(NULL,"CLUI","RightClientMargin",SETTING_RIGHTCLIENTMARIGN_DEFAULT);
+ g_CluiData.TopClientMargin = (int)db_get_b(NULL,"CLUI","TopClientMargin",SETTING_TOPCLIENTMARIGN_DEFAULT);
+ g_CluiData.BottomClientMargin = (int)db_get_b(NULL,"CLUI","BottomClientMargin",SETTING_BOTTOMCLIENTMARIGN_DEFAULT);
}
BroadCastMessageToChild(pcli->hwndContactList, WM_THEMECHANGED, 0, 0);
@@ -1295,26 +1295,26 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) if ( !fnGetMenuBarInfo )
return 1;
- dat=(struct ClcData*)GetWindowLongPtr(pcli->hwndContactTree,0);
+ dat = (struct ClcData*)GetWindowLongPtr(pcli->hwndContactTree,0);
if (!dat) return 1;
GetWindowRect(hwnd,&ra);
{
- MENUBARINFO mbi={0};
- mbi.cbSize=sizeof(MENUBARINFO);
+ 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;
- r1=mbi.rcBar;
- r1.bottom+= !db_get_b(NULL,"CLUI","LineUnderMenu",SETTING_LINEUNDERMENU_DEFAULT);
- if (item<1)
+ r1 = mbi.rcBar;
+ r1.bottom += !db_get_b(NULL,"CLUI","LineUnderMenu",SETTING_LINEUNDERMENU_DEFAULT);
+ if (item < 1)
{
- treg=CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,r1.bottom);
- if (item==0) //should remove item clips
+ treg = CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,r1.bottom);
+ if (item == 0) //should remove item clips
{
int t;
- for (t=1; t<=2; t++)
+ for (t = 1; t <= 2; t++)
{
fnGetMenuBarInfo(hwnd,OBJID_MENU, t, &mbi);
- treg2=CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,mbi.rcBar.bottom);
+ treg2 = CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,mbi.rcBar.bottom);
CombineRgn(treg,treg,treg2,RGN_DIFF);
DeleteObject(treg2);
}
@@ -1324,20 +1324,20 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) else
{
fnGetMenuBarInfo(hwnd,OBJID_MENU, item, &mbi);
- treg=CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,mbi.rcBar.bottom+!db_get_b(NULL,"CLUI","LineUnderMenu",SETTING_LINEUNDERMENU_DEFAULT));
+ treg = CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,mbi.rcBar.bottom+!db_get_b(NULL,"CLUI","LineUnderMenu",SETTING_LINEUNDERMENU_DEFAULT));
}
OffsetRgn(treg,-ra.left,-ra.top);
- r1.left-=ra.left;
- r1.top-=ra.top;
- r1.bottom-=ra.top;
- r1.right-=ra.left;
+ r1.left -= ra.left;
+ r1.top -= ra.top;
+ r1.bottom -= ra.top;
+ r1.right -= ra.left;
}
//SelectClipRgn(hdc,NULL);
SelectClipRgn(hdc,treg);
DeleteObject(treg);
{
RECT rc;
- HWND hwnd=pcli->hwndContactList;
+ HWND hwnd = pcli->hwndContactList;
GetWindowRect(hwnd,&rc);
OffsetRect(&rc,-rc.left, -rc.top);
FillRect(hdc,&r1,GetSysColorBrush(COLOR_MENU));
@@ -1345,10 +1345,10 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) //ske_BltBackImage(hwnd,hdc,&r1);
}
if (!g_CluiData.fDisableSkinEngine)
- SkinDrawGlyph(hdc,&r1,&r1,"Main,ID=MenuBar");
+ SkinDrawGlyph(hdc,&r1,&r1,"Main,ID = MenuBar");
else
{
- HBRUSH hbr=NULL;
+ HBRUSH hbr = NULL;
if (dat->hMenuBackground)
{
BITMAP bmp;
@@ -1357,66 +1357,66 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) int x,y;
int maxx,maxy;
int destw,desth;
- RECT clRect=r1;
+ RECT clRect = r1;
// XXX: Halftone isnt supported on 9x, however the scretch problems dont happen on 98.
SetStretchBltMode(hdc, HALFTONE);
GetObject(dat->hMenuBackground,sizeof(bmp),&bmp);
- hdcBmp=CreateCompatibleDC(hdc);
- oldbm=(HBITMAP)SelectObject(hdcBmp,dat->hMenuBackground);
- y=clRect.top;
- x=clRect.left;
- maxx=dat->MenuBmpUse&CLBF_TILEH?maxx=r1.right:x+1;
- maxy=dat->MenuBmpUse&CLBF_TILEV?maxy=r1.bottom:y+1;
+ hdcBmp = CreateCompatibleDC(hdc);
+ oldbm = (HBITMAP)SelectObject(hdcBmp,dat->hMenuBackground);
+ y = clRect.top;
+ x = clRect.left;
+ maxx = dat->MenuBmpUse&CLBF_TILEH?maxx = r1.right:x+1;
+ maxy = dat->MenuBmpUse&CLBF_TILEV?maxy = r1.bottom:y+1;
switch(dat->MenuBmpUse&CLBM_TYPE) {
case CLB_STRETCH:
- if(dat->MenuBmpUse&CLBF_PROPORTIONAL) {
- if(clRect.right-clRect.left*bmp.bmHeight<clRect.bottom-clRect.top*bmp.bmWidth)
+ if (dat->MenuBmpUse&CLBF_PROPORTIONAL) {
+ if (clRect.right-clRect.left*bmp.bmHeight < clRect.bottom-clRect.top*bmp.bmWidth)
{
- desth=clRect.bottom-clRect.top;
- destw=desth*bmp.bmWidth/bmp.bmHeight;
+ desth = clRect.bottom-clRect.top;
+ destw = desth*bmp.bmWidth/bmp.bmHeight;
}
else
{
- destw=clRect.right-clRect.left;
- desth=destw*bmp.bmHeight/bmp.bmWidth;
+ destw = clRect.right-clRect.left;
+ desth = destw*bmp.bmHeight/bmp.bmWidth;
}
}
else {
- destw=clRect.right-clRect.left;
- desth=clRect.bottom-clRect.top;
+ destw = clRect.right-clRect.left;
+ desth = clRect.bottom-clRect.top;
}
break;
case CLB_STRETCHH:
- if(dat->MenuBmpUse&CLBF_PROPORTIONAL) {
- destw=clRect.right-clRect.left;
- desth=destw*bmp.bmHeight/bmp.bmWidth;
+ if (dat->MenuBmpUse&CLBF_PROPORTIONAL) {
+ destw = clRect.right-clRect.left;
+ desth = destw*bmp.bmHeight/bmp.bmWidth;
}
else {
- destw=clRect.right-clRect.left;
- desth=bmp.bmHeight;
+ destw = clRect.right-clRect.left;
+ desth = bmp.bmHeight;
}
break;
case CLB_STRETCHV:
- if(dat->MenuBmpUse&CLBF_PROPORTIONAL) {
- desth=clRect.bottom-clRect.top;
- destw=desth*bmp.bmWidth/bmp.bmHeight;
+ if (dat->MenuBmpUse&CLBF_PROPORTIONAL) {
+ desth = clRect.bottom-clRect.top;
+ destw = desth*bmp.bmWidth/bmp.bmHeight;
}
else {
- destw=bmp.bmWidth;
- desth=clRect.bottom-clRect.top;
+ destw = bmp.bmWidth;
+ desth = clRect.bottom-clRect.top;
}
break;
default: //clb_topleft
- destw=bmp.bmWidth;
- desth=bmp.bmHeight;
+ destw = bmp.bmWidth;
+ desth = bmp.bmHeight;
break;
}
if (desth && destw)
- for(y=clRect.top;y<maxy;y+=desth) {
- for(x=clRect.left;x<maxx;x+=destw)
+ for(y = clRect.top;y < maxy;y += desth) {
+ for(x = clRect.left;x < maxx;x += destw)
StretchBlt(hdc,x,y,destw,desth,hdcBmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
}
SelectObject(hdcBmp,oldbm);
@@ -1426,13 +1426,13 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) else
{
- hbr=CreateSolidBrush(dat->MenuBkColor);
+ hbr = CreateSolidBrush(dat->MenuBkColor);
FillRect(hdc,&r1,hbr);
DeleteObject(hbr);
}
- if (item!=0 && state&(ODS_SELECTED))
+ if (item != 0 && state&(ODS_SELECTED))
{
- hbr=CreateSolidBrush(dat->MenuBkHiColor);
+ hbr = CreateSolidBrush(dat->MenuBkHiColor);
FillRect(hdc,&r1,hbr);
DeleteObject(hbr);
}
@@ -1443,8 +1443,8 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) int CLUI_SizingGetWindowRect(HWND hwnd,RECT * rc)
{
- if (mutex_bDuringSizing && hwnd==pcli->hwndContactList)
- *rc=rcSizingRect;
+ if (mutex_bDuringSizing && hwnd == pcli->hwndContactList)
+ *rc = rcSizingRect;
else
GetWindowRect(hwnd,rc);
return 1;
@@ -1465,8 +1465,8 @@ int CLUI_SyncSetPDNCE(WPARAM wParam, LPARAM lParam) int CLUI_SyncGetShortData(WPARAM wParam, LPARAM lParam)
{
- HWND hwnd=(HWND) wParam;
- struct ClcData * dat=(struct ClcData * )GetWindowLongPtr(hwnd,0);
+ HWND hwnd = (HWND) wParam;
+ struct ClcData * dat = (struct ClcData * )GetWindowLongPtr(hwnd,0);
//log0("CLUI_SyncGetShortData");
return ClcGetShortData(dat,(struct SHORTDATA *)lParam);
}
@@ -1501,18 +1501,18 @@ int CLUI_IconsChanged(WPARAM wParam,LPARAM lParam) void CLUI_cli_LoadCluiGlobalOpts()
{
- BOOL tLayeredFlag=FALSE;
- tLayeredFlag=IsWinVer2000Plus();
- tLayeredFlag&=db_get_b(NULL, "ModernData", "EnableLayering", tLayeredFlag);
+ BOOL tLayeredFlag = FALSE;
+ tLayeredFlag = IsWinVer2000Plus();
+ tLayeredFlag &= db_get_b(NULL, "ModernData", "EnableLayering", tLayeredFlag);
- if(tLayeredFlag)
+ if (tLayeredFlag)
{
- if (db_get_b(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT)==1)
+ if (db_get_b(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT) == 1)
db_set_b(NULL,"CList","WindowShadow",2);
}
else
{
- if (db_get_b(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT)==2)
+ if (db_get_b(NULL,"CList","WindowShadow",SETTING_WINDOWSHADOW_DEFAULT) == 2)
db_set_b(NULL,"CList","WindowShadow",1);
}
corecli.pfnLoadCluiGlobalOpts();
@@ -1521,71 +1521,71 @@ void CLUI_cli_LoadCluiGlobalOpts() int CLUI_TestCursorOnBorders()
{
- HWND hwnd=pcli->hwndContactList;
- HCURSOR hCurs1=NULL;
+ HWND hwnd = pcli->hwndContactList;
+ HCURSOR hCurs1 = NULL;
RECT r;
POINT pt;
- int k=0, t=0, fx,fy;
+ int k = 0, t = 0, fx,fy;
HWND hAux;
- BOOL mouse_in_window=0;
- HWND gf=GetForegroundWindow();
+ BOOL mouse_in_window = 0;
+ HWND gf = GetForegroundWindow();
GetCursorPos(&pt);
hAux = WindowFromPoint(pt);
if (CLUI_CheckOwnedByClui(hAux))
{
- if(g_bTransparentFlag) {
- if (!bTransparentFocus && gf!=hwnd) {
+ if (g_bTransparentFlag) {
+ 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;
+ bTransparentFocus = 1;
CLUI_SafeSetTimer(hwnd, TM_AUTOALPHA,250,NULL);
}
}
}
- mutex_bIgnoreActivation=0;
+ mutex_bIgnoreActivation = 0;
GetWindowRect(hwnd,&r);
/*
* Size borders offset (contract)
*/
- r.top+=db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Top",SKIN_OFFSET_TOP_DEFAULT);
- r.bottom-=db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Bottom",SKIN_OFFSET_BOTTOM_DEFAULT);
- r.left+=db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Left",SKIN_OFFSET_LEFT_DEFAULT);
- r.right-=db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Right",SKIN_OFFSET_RIGHT_DEFAULT);
+ r.top += db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Top",SKIN_OFFSET_TOP_DEFAULT);
+ r.bottom -= db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Bottom",SKIN_OFFSET_BOTTOM_DEFAULT);
+ r.left += db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Left",SKIN_OFFSET_LEFT_DEFAULT);
+ r.right -= db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Right",SKIN_OFFSET_RIGHT_DEFAULT);
- if (r.right<r.left) r.right=r.left;
- if (r.bottom<r.top) r.bottom=r.top;
+ if (r.right < r.left) r.right = r.left;
+ if (r.bottom < r.top) r.bottom = r.top;
/*
* End of size borders offset (contract)
*/
hAux = WindowFromPoint(pt);
- while(hAux != NULL)
+ while(hAux !=NULL)
{
- if (hAux == hwnd) {mouse_in_window=1; break;}
+ if (hAux == hwnd) {mouse_in_window = 1; break;}
hAux = GetParent(hAux);
}
- fx=GetSystemMetrics(SM_CXFULLSCREEN);
- fy=GetSystemMetrics(SM_CYFULLSCREEN);
- if (g_CluiData.fDocked || g_CluiData.nBehindEdgeState==0)
- //if (g_CluiData.fDocked) || ((pt.x<fx-1) && (pt.y<fy-1) && pt.x>1 && pt.y>1)) // workarounds for behind the edge.
+ fx = GetSystemMetrics(SM_CXFULLSCREEN);
+ fy = GetSystemMetrics(SM_CYFULLSCREEN);
+ if (g_CluiData.fDocked || g_CluiData.nBehindEdgeState == 0)
+ //if (g_CluiData.fDocked) || ((pt.x < fx-1) && (pt.y < fy-1) && pt.x>1 && pt.y>1)) // workarounds for behind the edge.
{
//ScreenToClient(hwnd,&pt);
//GetClientRect(hwnd,&r);
- if (pt.y<=r.bottom && pt.y>=r.bottom-SIZING_MARGIN && !g_CluiData.fAutoSize) k=6;
- 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;
- k*=mouse_in_window;
+ if (pt.y <= r.bottom && pt.y >= r.bottom-SIZING_MARGIN && !g_CluiData.fAutoSize) k = 6;
+ 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;
+ k *= mouse_in_window;
hCurs1 = LoadCursor(NULL, IDC_ARROW);
- if(g_CluiData.nBehindEdgeState<=0 && (!(db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT))))
+ if (g_CluiData.nBehindEdgeState <= 0 && (!(db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT))))
switch(k)
{
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;}
+ 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;}
@@ -1605,33 +1605,33 @@ int CLUI_SizingOnBorder(POINT pt, int PerformSize) if (!(db_get_b(NULL,"CLUI","LockSize",SETTING_LOCKSIZE_DEFAULT)))
{
RECT r;
- HWND hwnd=pcli->hwndContactList;
- int sizeOnBorderFlag=0;
+ HWND hwnd = pcli->hwndContactList;
+ int sizeOnBorderFlag = 0;
GetWindowRect(hwnd,&r);
/*
* Size borders offset (contract)
*/
- r.top+=db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Top",SKIN_OFFSET_TOP_DEFAULT);
- r.bottom-=db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Bottom",SKIN_OFFSET_BOTTOM_DEFAULT);
- r.left+=db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Left",SKIN_OFFSET_LEFT_DEFAULT);
- r.right-=db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Right",SKIN_OFFSET_RIGHT_DEFAULT);
+ r.top += db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Top",SKIN_OFFSET_TOP_DEFAULT);
+ r.bottom -= db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Bottom",SKIN_OFFSET_BOTTOM_DEFAULT);
+ r.left += db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Left",SKIN_OFFSET_LEFT_DEFAULT);
+ r.right -= db_get_dw(NULL,"ModernSkin","SizeMarginOffset_Right",SKIN_OFFSET_RIGHT_DEFAULT);
- if (r.right<r.left) r.right=r.left;
- if (r.bottom<r.top) r.bottom=r.top;
+ if (r.right < r.left) r.right = r.left;
+ if (r.bottom < r.top) r.bottom = r.top;
/*
* End of size borders offset (contract)
*/
if ( !g_CluiData.fAutoSize )
{
- if ( pt.y <= r.bottom && pt.y >= r.bottom - SIZING_MARGIN ) sizeOnBorderFlag = SCF_BOTTOM;
- else if ( pt.y >= r.top && pt.y <= r.top + SIZING_MARGIN ) sizeOnBorderFlag = SCF_TOP;
+ if ( pt.y <= r.bottom && pt.y >= r.bottom - SIZING_MARGIN ) sizeOnBorderFlag = SCF_BOTTOM;
+ else if ( pt.y >= r.top && pt.y <= r.top + SIZING_MARGIN ) sizeOnBorderFlag = SCF_TOP;
}
- 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.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)
{
@@ -1649,7 +1649,7 @@ static void CLUI_SmoothAnimationThreadProc(HWND hwnd) // return;
if (!mutex_bAnimationInProgress)
{
- g_dwSmoothAnimationThreadID=0;
+ g_dwSmoothAnimationThreadID = 0;
return; /// Should be some locked to avoid painting against contact deletion.
}
do
@@ -1661,14 +1661,14 @@ static void CLUI_SmoothAnimationThreadProc(HWND hwnd) SleepEx(20,TRUE);
if (MirandaExiting())
{
- g_dwSmoothAnimationThreadID=0;
+ g_dwSmoothAnimationThreadID = 0;
return;
}
}
else SleepEx(0,TRUE);
} while (mutex_bAnimationInProgress);
- g_dwSmoothAnimationThreadID=0;
+ g_dwSmoothAnimationThreadID = 0;
return;
}
@@ -1677,26 +1677,26 @@ static int CLUI_SmoothAlphaThreadTransition(HWND hwnd) int step;
int a;
- step=(g_CluiData.bCurrentAlpha>bAlphaEnd)?-1*ANIMATION_STEP:ANIMATION_STEP;
- a=g_CluiData.bCurrentAlpha+step;
- if ((step>=0 && a>=bAlphaEnd) || (step<=0 && a<=bAlphaEnd))
+ step = (g_CluiData.bCurrentAlpha>bAlphaEnd)?-1*ANIMATION_STEP:ANIMATION_STEP;
+ a = g_CluiData.bCurrentAlpha+step;
+ if ((step >= 0 && a >= bAlphaEnd) || (step <= 0 && a <= bAlphaEnd))
{
- mutex_bAnimationInProgress=0;
- g_CluiData.bCurrentAlpha=bAlphaEnd;
- if (g_CluiData.bCurrentAlpha==0)
+ mutex_bAnimationInProgress = 0;
+ g_CluiData.bCurrentAlpha = bAlphaEnd;
+ if (g_CluiData.bCurrentAlpha == 0)
{
- g_CluiData.bCurrentAlpha=1;
+ g_CluiData.bCurrentAlpha = 1;
ske_JustUpdateWindowImage();
- mutex_bShowHideCalledFromAnimation=1;
+ mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList,0);
Sync(CLUIFrames_OnShowHide, hwnd,0);
- mutex_bShowHideCalledFromAnimation=0;
- g_CluiData.bCurrentAlpha=0;
+ mutex_bShowHideCalledFromAnimation = 0;
+ g_CluiData.bCurrentAlpha = 0;
if (!g_CluiData.fLayered) RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_ERASE|RDW_FRAME);
return 0;
}
}
- else g_CluiData.bCurrentAlpha=a;
+ else g_CluiData.bCurrentAlpha = a;
ske_JustUpdateWindowImage();
return 1;
}
@@ -1707,62 +1707,62 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) if ((!g_CluiData.fLayered
&& (!g_CluiData.fSmoothAnimation && !g_bTransparentFlag))||!g_proc_SetLayeredWindowAttributesNew)
{
- if (GoalAlpha>0 && wParam!=2)
+ if (GoalAlpha>0 && wParam != 2)
{
if (!IsWindowVisible(hwnd))
{
- mutex_bShowHideCalledFromAnimation=1;
+ mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList,SW_RESTORE);
Sync(CLUIFrames_OnShowHide, hwnd,1);
- mutex_bShowHideCalledFromAnimation=0;
- g_CluiData.bCurrentAlpha=GoalAlpha;
+ mutex_bShowHideCalledFromAnimation = 0;
+ g_CluiData.bCurrentAlpha = GoalAlpha;
ske_UpdateWindowImage();
}
}
- else if (GoalAlpha==0 && wParam!=2)
+ else if (GoalAlpha == 0 && wParam != 2)
{
if (IsWindowVisible(hwnd))
{
- mutex_bShowHideCalledFromAnimation=1;
+ mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList,0);
Sync(CLUIFrames_OnShowHide, hwnd,0);
- g_CluiData.bCurrentAlpha=GoalAlpha;
- mutex_bShowHideCalledFromAnimation=0;
+ g_CluiData.bCurrentAlpha = GoalAlpha;
+ mutex_bShowHideCalledFromAnimation = 0;
}
}
return 0;
}
- if (g_CluiData.bCurrentAlpha==GoalAlpha &&0)
+ if (g_CluiData.bCurrentAlpha == GoalAlpha &&0)
{
if (mutex_bAnimationInProgress)
{
KillTimer(hwnd,TM_SMOTHALPHATRANSITION);
- mutex_bAnimationInProgress=0;
+ mutex_bAnimationInProgress = 0;
}
return 0;
}
if (mutex_bShowHideCalledFromAnimation) return 0;
- if (wParam!=2) //not from timer
+ if (wParam != 2) //not from timer
{
- bAlphaEnd=GoalAlpha;
+ bAlphaEnd = GoalAlpha;
if (!mutex_bAnimationInProgress)
{
- if ((!IsWindowVisible(hwnd)||g_CluiData.bCurrentAlpha==0) && bAlphaEnd>0 )
+ if ((!IsWindowVisible(hwnd)||g_CluiData.bCurrentAlpha == 0) && bAlphaEnd>0 )
{
- mutex_bShowHideCalledFromAnimation=1;
+ mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList,SW_SHOWNA);
Sync(CLUIFrames_OnShowHide, hwnd,SW_SHOW);
- mutex_bShowHideCalledFromAnimation=0;
- g_CluiData.bCurrentAlpha=1;
+ mutex_bShowHideCalledFromAnimation = 0;
+ g_CluiData.bCurrentAlpha = 1;
ske_UpdateWindowImage();
}
if (IsWindowVisible(hwnd) && !g_dwSmoothAnimationThreadID)
{
- mutex_bAnimationInProgress=1;
+ mutex_bAnimationInProgress = 1;
if (g_CluiData.fSmoothAnimation)
- g_dwSmoothAnimationThreadID=(DWORD)mir_forkthread((pThreadFunc)CLUI_SmoothAnimationThreadProc,pcli->hwndContactList);
+ g_dwSmoothAnimationThreadID = (DWORD)mir_forkthread((pThreadFunc)CLUI_SmoothAnimationThreadProc,pcli->hwndContactList);
}
}
@@ -1771,31 +1771,31 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam) {
int step;
int a;
- step=(g_CluiData.bCurrentAlpha>bAlphaEnd)?-1*ANIMATION_STEP:ANIMATION_STEP;
- a=g_CluiData.bCurrentAlpha+step;
- if ((step>=0 && a>=bAlphaEnd) || (step<=0 && a<=bAlphaEnd) || g_CluiData.bCurrentAlpha==bAlphaEnd || !g_CluiData.fSmoothAnimation) //stop animation;
+ step = (g_CluiData.bCurrentAlpha>bAlphaEnd)?-1*ANIMATION_STEP:ANIMATION_STEP;
+ a = g_CluiData.bCurrentAlpha+step;
+ if ((step >= 0 && a >= bAlphaEnd) || (step <= 0 && a <= bAlphaEnd) || g_CluiData.bCurrentAlpha == bAlphaEnd || !g_CluiData.fSmoothAnimation) //stop animation;
{
KillTimer(hwnd,TM_SMOTHALPHATRANSITION);
- mutex_bAnimationInProgress=0;
- if (bAlphaEnd==0)
+ mutex_bAnimationInProgress = 0;
+ if (bAlphaEnd == 0)
{
- g_CluiData.bCurrentAlpha=1;
+ g_CluiData.bCurrentAlpha = 1;
ske_UpdateWindowImage();
- mutex_bShowHideCalledFromAnimation=1;
+ mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList,0);
Sync(CLUIFrames_OnShowHide, pcli->hwndContactList,0);
- mutex_bShowHideCalledFromAnimation=0;
- g_CluiData.bCurrentAlpha=0;
+ mutex_bShowHideCalledFromAnimation = 0;
+ g_CluiData.bCurrentAlpha = 0;
}
else
{
- g_CluiData.bCurrentAlpha=bAlphaEnd;
+ g_CluiData.bCurrentAlpha = bAlphaEnd;
ske_UpdateWindowImage();
}
}
else
{
- g_CluiData.bCurrentAlpha=a;
+ g_CluiData.bCurrentAlpha = a;
ske_UpdateWindowImage();
}
}
@@ -1813,7 +1813,7 @@ BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase ) return SkinInvalidateFrame( hWnd, lpRect );
else
{
- g_flag_bFullRepaint=1;
+ g_flag_bFullRepaint = 1;
return 0;
}
}
@@ -1824,32 +1824,32 @@ BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase ) static BOOL FileExists(TCHAR * tszFilename)
{
- BOOL result=FALSE;
- FILE * f=_tfopen(tszFilename,_T("r"));
- if (f==NULL) return FALSE;
+ BOOL result = FALSE;
+ FILE * f = _tfopen(tszFilename,_T("r"));
+ if (f == NULL) return FALSE;
fclose(f);
return TRUE;
}
HANDLE RegisterIcolibIconHandle(char * szIcoID, char *szSectionName, char * szDescription, TCHAR * tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModuleInst, int iDefaultResource )
{
- TCHAR fileFull[MAX_PATH]={0};
- SKINICONDESC sid={0};
- HANDLE hIcolibItem=NULL;
+ TCHAR fileFull[MAX_PATH] = {0};
+ SKINICONDESC sid = {0};
+ HANDLE hIcolibItem = NULL;
sid.cbSize = sizeof(sid);
sid.cx = 16;
sid.cy = 16;
sid.pszSection = szSectionName;
sid.pszName = szIcoID;
- sid.flags|=SIDF_PATH_TCHAR;
+ sid.flags |= SIDF_PATH_TCHAR;
sid.pszDescription = szDescription;
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'))
+ if (fileFull[0] != _T('\0'))
{
sid.ptszDefaultFile = fileFull;
sid.iDefaultIndex = iDefaultIndex;
@@ -1884,22 +1884,22 @@ LRESULT CLUI::PreProcessWndProc( UINT msg, WPARAM wParam, LPARAM lParam, BOOL& b The caller is expected to create this mapping object and tell us the ID we need to open ours.
*/
- if (g_CluiData.bSTATE==STATE_EXITING && msg!=WM_DESTROY)
+ if (g_CluiData.bSTATE == STATE_EXITING && msg != WM_DESTROY)
{
bHandled = TRUE;
return 0;
}
- if (msg == uMsgGetProfile && wParam != 0) /* got IPC message */
+ if (msg == uMsgGetProfile && wParam !=0) /* got IPC message */
{
HANDLE hMap;
char szName[MAX_PATH];
int rc = 0;
mir_snprintf( szName, SIZEOF(szName), "Miranda::%u", wParam ); // caller will tell us the ID of the map
hMap = OpenFileMappingA( FILE_MAP_ALL_ACCESS,FALSE, szName );
- if ( hMap != NULL )
+ if ( hMap !=NULL )
{
void *hView = NULL;
- hView =MapViewOfFile( hMap, FILE_MAP_ALL_ACCESS, 0, 0, MAX_PATH );
+ hView = MapViewOfFile( hMap, FILE_MAP_ALL_ACCESS, 0, 0, MAX_PATH );
if (hView)
{
char szFilePath[MAX_PATH], szProfile[MAX_PATH];
@@ -1922,55 +1922,55 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) {
if (g_CluiData.fLayered)
{
- if (msg==WM_SIZING)
+ if (msg == WM_SIZING)
{
- static int a=0;
- RECT* wp=(RECT*)lParam;
- if (bNeedFixSizingRect && (rcCorrectSizeRect.bottom!=0||rcCorrectSizeRect.top!=0))
+ static int a = 0;
+ RECT* wp = (RECT*)lParam;
+ if (bNeedFixSizingRect && (rcCorrectSizeRect.bottom != 0||rcCorrectSizeRect.top != 0))
{
- if(wParam!=WMSZ_BOTTOM) wp->bottom=rcCorrectSizeRect.bottom;
- if(wParam!=WMSZ_TOP) wp->top=rcCorrectSizeRect.top;
+ if (wParam != WMSZ_BOTTOM) wp->bottom = rcCorrectSizeRect.bottom;
+ if (wParam != WMSZ_TOP) wp->top = rcCorrectSizeRect.top;
}
- bNeedFixSizingRect=0;
- rcSizingRect=*wp;
- mutex_bDuringSizing=1;
+ bNeedFixSizingRect = 0;
+ rcSizingRect = *wp;
+ mutex_bDuringSizing = 1;
return 1;
}
- if (msg==WM_WINDOWPOSCHANGING)
+ if (msg == WM_WINDOWPOSCHANGING)
{
WINDOWPOS * wp;
HDWP PosBatch;
- RECT work_rect={0};
- RECT temp_rect={0};
- wp=(WINDOWPOS *)lParam;
+ RECT work_rect = {0};
+ RECT temp_rect = {0};
+ wp = (WINDOWPOS *)lParam;
GetWindowRect(m_hWnd,&rcOldWindowRect);
// Ïðèëèïàíèå ê êðàÿì by ZorG
CLUI::SnappingToEdge(wp);
- if ((rcOldWindowRect.bottom-rcOldWindowRect.top!=wp->cy || rcOldWindowRect.right-rcOldWindowRect.left !=wp->cx)&&!(wp->flags&SWP_NOSIZE))
+ if ((rcOldWindowRect.bottom-rcOldWindowRect.top != wp->cy || rcOldWindowRect.right-rcOldWindowRect.left !=wp->cx)&&!(wp->flags&SWP_NOSIZE))
{
{
if (!(wp->flags&SWP_NOMOVE))
{
- rcNewWindowRect.left=wp->x;
- rcNewWindowRect.top=wp->y;
+ rcNewWindowRect.left = wp->x;
+ rcNewWindowRect.top = wp->y;
}
else
{
- rcNewWindowRect.left=rcOldWindowRect.left;
- rcNewWindowRect.top=rcOldWindowRect.top;
+ rcNewWindowRect.left = rcOldWindowRect.left;
+ rcNewWindowRect.top = rcOldWindowRect.top;
}
- rcNewWindowRect.right=rcNewWindowRect.left+wp->cx;
- rcNewWindowRect.bottom=rcNewWindowRect.top+wp->cy;
- work_rect=rcNewWindowRect;
+ rcNewWindowRect.right = rcNewWindowRect.left+wp->cx;
+ rcNewWindowRect.bottom = rcNewWindowRect.top+wp->cy;
+ work_rect = rcNewWindowRect;
}
//resize frames (batch)
{
- PosBatch=BeginDeferWindowPos(1);
+ PosBatch = BeginDeferWindowPos(1);
SizeFramesByWindowRect(&work_rect,&PosBatch,0);
}
//Check rect after frames resize
@@ -1978,43 +1978,43 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) GetWindowRect(m_hWnd,&temp_rect);
}
//Here work_rect should be changed to fit possible changes in cln_listsizechange
- if(bNeedFixSizingRect)
+ if (bNeedFixSizingRect)
{
- work_rect=rcSizingRect;
- wp->x=work_rect.left;
- wp->y=work_rect.top;
- wp->cx=work_rect.right-work_rect.left;
- wp->cy=work_rect.bottom-work_rect.top;
- wp->flags&=~(SWP_NOMOVE);
+ work_rect = rcSizingRect;
+ wp->x = work_rect.left;
+ wp->y = work_rect.top;
+ wp->cx = work_rect.right-work_rect.left;
+ wp->cy = work_rect.bottom-work_rect.top;
+ wp->flags &= ~(SWP_NOMOVE);
}
//reposition buttons and new size applying
{
ModernSkinButton_ReposButtons( m_hWnd, SBRF_DO_NOT_DRAW, &work_rect );
ske_PrepeareImageButDontUpdateIt(&work_rect);
- g_CluiData.mutexPreventDockMoving=0;
+ g_CluiData.mutexPreventDockMoving = 0;
ske_UpdateWindowImageRect(&work_rect);
EndDeferWindowPos(PosBatch);
- g_CluiData.mutexPreventDockMoving=1;
+ g_CluiData.mutexPreventDockMoving = 1;
}
Sleep(0);
- mutex_bDuringSizing=0;
+ mutex_bDuringSizing = 0;
DefWindowProc(m_hWnd,msg,wParam,lParam);
return SendMessage(m_hWnd,WM_WINDOWPOSCHANGED,wParam,lParam);
}
else
{
SetRect(&rcCorrectSizeRect,0,0,0,0);
- // bNeedFixSizingRect=0;
+ // bNeedFixSizingRect = 0;
}
return DefWindowProc(m_hWnd,msg,wParam,lParam);
}
}
- else if (msg==WM_WINDOWPOSCHANGING)
+ else if (msg == WM_WINDOWPOSCHANGING)
{
// Snaping if it is not in LayeredMode
WINDOWPOS * wp;
- wp=(WINDOWPOS *)lParam;
+ wp = (WINDOWPOS *)lParam;
CLUI::SnappingToEdge( wp );
return DefWindowProc(m_hWnd,msg,wParam,lParam);
}
@@ -2026,7 +2026,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) case WM_EXITSIZEMOVE:
{
- int res=DefWindowProc(m_hWnd, msg, wParam, lParam);
+ int res = DefWindowProc(m_hWnd, msg, wParam, lParam);
ReleaseCapture();
TRACE("WM_EXITSIZEMOVE\n");
SendMessage(m_hWnd, WM_ACTIVATE, (WPARAM)WA_ACTIVE, (LPARAM)m_hWnd);
@@ -2039,7 +2039,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) {
RECT rc;
CallWindowProc(DefWindowProc, m_hWnd, msg, wParam, lParam);
- mutex_bDuringSizing=0;
+ mutex_bDuringSizing = 0;
GetWindowRect(m_hWnd, &rc);
CheckFramesPos(&rc);
Sync(CLUIFrames_OnMoving,m_hWnd,&rc);
@@ -2058,7 +2058,7 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) {
RECT rc;
if (g_mutex_bSizing) return 0;
- if(wParam!=SIZE_MINIMIZED /*&& IsWindowVisible(m_hWnd)*/)
+ if (wParam != SIZE_MINIMIZED /*&& IsWindowVisible(m_hWnd)*/)
{
if ( pcli->hwndContactList == NULL )
return 0;
@@ -2075,12 +2075,12 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) if (!g_CluiData.fLayered)
{
- g_mutex_bSizing=1;
+ g_mutex_bSizing = 1;
Sync(CLUIFrames_OnClistResize_mod,(WPARAM)m_hWnd,(LPARAM)1);
CLUIFrames_ApplyNewSizes(2);
CLUIFrames_ApplyNewSizes(1);
SendMessage(m_hWnd,CLN_LISTSIZECHANGE,0,0);
- g_mutex_bSizing=0;
+ g_mutex_bSizing = 0;
}
// ske_RedrawCompleteWindow();
@@ -2098,12 +2098,12 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) HRGN hRgn1;
RECT r;
int v,h;
- int w=10;
+ int w = 10;
GetWindowRect(m_hWnd,&r);
- h=(r.right-r.left)>(w*2)?w:(r.right-r.left);
- v=(r.bottom-r.top)>(w*2)?w:(r.bottom-r.top);
- h=(h<v)?h:v;
- hRgn1=CreateRoundRectRgn(0,0,(r.right-r.left+1),(r.bottom-r.top+1),h,h);
+ h = (r.right-r.left)>(w*2)?w:(r.right-r.left);
+ v = (r.bottom-r.top)>(w*2)?w:(r.bottom-r.top);
+ h = (h < v)?h:v;
+ hRgn1 = CreateRoundRectRgn(0,0,(r.right-r.left+1),(r.bottom-r.top+1),h,h);
if ((db_get_b(NULL,"CLC","RoundCorners",SETTING_ROUNDCORNERS_DEFAULT)) && (!CallService(MS_CLIST_DOCKINGISDOCKED,0,0)))
SetWindowRgn(m_hWnd,hRgn1,FALSE);
else
@@ -2115,12 +2115,12 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) }
}
else {
- if(db_get_b(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT)) {
+ if (db_get_b(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT)) {
CLUI_ShowWindowMod(m_hWnd, SW_HIDE);
db_set_b(NULL,"CList","State",SETTING_STATE_HIDDEN);
}
else db_set_b(NULL,"CList","State",SETTING_STATE_MINIMIZED);
- if (MySetProcessWorkingSetSize != NULL)
+ if (MySetProcessWorkingSetSize !=NULL)
MySetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
}
@@ -2129,11 +2129,11 @@ LRESULT CLUI::OnSizingMoving( UINT msg, WPARAM wParam, LPARAM lParam ) case WM_WINDOWPOSCHANGING:
{
WINDOWPOS * wp;
- wp=(WINDOWPOS *)lParam;
+ wp = (WINDOWPOS *)lParam;
if (wp->flags&SWP_HIDEWINDOW && mutex_bAnimationInProgress)
return 0;
if (g_CluiData.fOnDesktop)
- wp->flags|=SWP_NOACTIVATE|SWP_NOZORDER;
+ wp->flags |= SWP_NOACTIVATE|SWP_NOZORDER;
return DefWindowProc(m_hWnd, msg, wParam, lParam);
}
}
@@ -2178,10 +2178,10 @@ LRESULT CLUI::OnNcPaint( UINT msg, WPARAM wParam, LPARAM lParam ) if ( !g_CluiData.fLayered && db_get_b( NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT ))
{
HDC hdc = NULL;
- if ( msg == WM_PRINT ) hdc=(HDC)wParam;
+ if ( msg == WM_PRINT ) hdc = (HDC)wParam;
if ( !hdc ) hdc = GetWindowDC( m_hWnd );
CLUI_DrawMenuBackGround( m_hWnd, hdc, 0, 0 );
- if ( msg != WM_PRINT ) ReleaseDC( m_hWnd, hdc );
+ if ( msg !=WM_PRINT ) ReleaseDC( m_hWnd, hdc );
}
return lRes;
}
@@ -2191,7 +2191,7 @@ LRESULT CLUI::OnEraseBkgnd( UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/ ) }
LRESULT CLUI::OnNcCreate( UINT msg, WPARAM wParam, LPARAM lParam )
{
- ( (LPCREATESTRUCT)lParam )->style &= ~(CS_HREDRAW | CS_VREDRAW);
+ ( (LPCREATESTRUCT)lParam )->style &= ~(CS_HREDRAW | CS_VREDRAW);
return DefCluiWndProc( msg, wParam, lParam );
}
@@ -2199,9 +2199,9 @@ LRESULT CLUI::OnPaint( UINT msg, WPARAM wParam, LPARAM lParam ) {
if (!g_CluiData.fLayered && IsWindowVisible(m_hWnd))
{
- RECT w={0};
- RECT w2={0};
- PAINTSTRUCT ps={0};
+ RECT w = {0};
+ RECT w2 = {0};
+ PAINTSTRUCT ps = {0};
HDC hdc;
HBITMAP hbmp,oldbmp;
HDC paintDC;
@@ -2212,10 +2212,10 @@ LRESULT CLUI::OnPaint( UINT msg, WPARAM wParam, LPARAM lParam ) if (!g_CluiData.fDisableSkinEngine)
{
paintDC = GetDC(m_hWnd);
- w2=w;
- hdc=CreateCompatibleDC(paintDC);
- hbmp=ske_CreateDIB32(w.right,w.bottom);
- oldbmp=(HBITMAP)SelectObject(hdc,hbmp);
+ w2 = w;
+ hdc = CreateCompatibleDC(paintDC);
+ hbmp = ske_CreateDIB32(w.right,w.bottom);
+ oldbmp = (HBITMAP)SelectObject(hdc,hbmp);
ske_ReCreateBackImage(FALSE,NULL);
BitBlt(paintDC,w2.left,w2.top,w2.right-w2.left,w2.bottom-w2.top,g_pCachedWindow->hBackDC,w2.left,w2.top,SRCCOPY);
SelectObject(hdc,oldbmp);
@@ -2225,9 +2225,9 @@ LRESULT CLUI::OnPaint( UINT msg, WPARAM wParam, LPARAM lParam ) }
else
{
- HDC hdc=BeginPaint(m_hWnd,&ps);
+ HDC hdc = BeginPaint(m_hWnd,&ps);
ske_BltBackImage(m_hWnd,hdc,&ps.rcPaint);
- ps.fErase=FALSE;
+ ps.fErase = FALSE;
EndPaint(m_hWnd,&ps);
}
@@ -2241,18 +2241,18 @@ LRESULT CLUI::OnPaint( UINT msg, WPARAM wParam, LPARAM lParam ) SkinInvalidateFrame(m_hWnd,NULL);
else
{
- RECT w={0};
- RECT w2={0};
- PAINTSTRUCT ps={0};
+ RECT w = {0};
+ RECT w2 = {0};
+ PAINTSTRUCT ps = {0};
GetWindowRect(m_hWnd,&w);
OffsetRect(&w,-w.left,-w.top);
BeginPaint(m_hWnd,&ps);
- if ((ps.rcPaint.bottom-ps.rcPaint.top)*(ps.rcPaint.right-ps.rcPaint.left)==0)
- w2=w;
+ if ((ps.rcPaint.bottom-ps.rcPaint.top)*(ps.rcPaint.right-ps.rcPaint.left) == 0)
+ w2 = w;
else
- w2=ps.rcPaint;
- SkinDrawGlyph(ps.hdc,&w,&w2,"Main,ID=Background,Opt=Non-Layered");
- ps.fErase=FALSE;
+ w2 = ps.rcPaint;
+ SkinDrawGlyph(ps.hdc,&w,&w2,"Main,ID = Background,Opt = Non-Layered");
+ ps.fErase = FALSE;
EndPaint(m_hWnd,&ps);
}
}
@@ -2267,27 +2267,27 @@ LRESULT CLUI::OnCreate( UINT msg, WPARAM wParam, LPARAM lParam ) { MENUITEMINFO mii;
ZeroMemory(&mii,sizeof(mii));
- mii.cbSize=MENUITEMINFO_V4_SIZE;
- mii.fMask=MIIM_TYPE|MIIM_DATA;
- mii.dwItemData=MENU_MIRANDAMENU;
- mii.fType=MFT_OWNERDRAW;
- mii.dwTypeData=NULL;
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_TYPE|MIIM_DATA;
+ mii.dwItemData = MENU_MIRANDAMENU;
+ mii.fType = MFT_OWNERDRAW;
+ mii.dwTypeData = NULL;
SetMenuItemInfo(GetMenu(m_hWnd),0,TRUE,&mii);
- // mii.fMask=MIIM_TYPE;
- mii.fType=MFT_OWNERDRAW;
- mii.dwItemData=MENU_STATUSMENU;
+ // mii.fMask = MIIM_TYPE;
+ mii.fType = MFT_OWNERDRAW;
+ mii.dwItemData = MENU_STATUSMENU;
SetMenuItemInfo(GetMenu(m_hWnd),1,TRUE,&mii);
- // mii.fMask=MIIM_TYPE;
- mii.fType=MFT_OWNERDRAW;
- mii.dwItemData=MENU_MINIMIZE;
+ // mii.fMask = MIIM_TYPE;
+ mii.fType = MFT_OWNERDRAW;
+ mii.dwItemData = MENU_MINIMIZE;
SetMenuItemInfo(GetMenu(m_hWnd),2,TRUE,&mii);
}
//PostMessage(m_hWnd, M_CREATECLC, 0, 0);
- //pcli->hwndContactList=m_hWnd;
- uMsgGetProfile=RegisterWindowMessage(TEXT("Miranda::GetProfile")); // don't localise
- bTransparentFocus=1;
+ //pcli->hwndContactList = m_hWnd;
+ uMsgGetProfile = RegisterWindowMessage(TEXT("Miranda::GetProfile")); // don't localise
+ bTransparentFocus = 1;
return FALSE;
}
LRESULT CLUI::OnSetAllExtraIcons( UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/ )
@@ -2354,36 +2354,36 @@ LRESULT CLUI::OnSetFocus( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnStatusBarUpdateTimer( UINT msg, WPARAM wParam, LPARAM lParam )
{
int status,i;
- PROTOTICKS *pt=NULL;
+ PROTOTICKS *pt = NULL;
- for (i=0;i<64;i++)
+ for (i = 0;i < 64;i++)
{
- pt=&CycleStartTick[i];
+ pt = &CycleStartTick[i];
- if (pt->szProto!=NULL&&pt->bTimerCreated==1)
+ if (pt->szProto != NULL&&pt->bTimerCreated == 1)
{
if (pt->bGlobal)
- status=g_bMultiConnectionMode?ID_STATUS_CONNECTING:0;
+ status = g_bMultiConnectionMode?ID_STATUS_CONNECTING:0;
else
- status=CallProtoService(pt->szProto,PS_GETSTATUS,0,0);
+ 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;
+ pt->nCycleStartTick = 0;
ImageList_Destroy(pt->himlIconList);
- pt->himlIconList=NULL;
+ pt->himlIconList = NULL;
KillTimer(m_hWnd,TM_STATUSBARUPDATE+pt->nIndex);
- pt->bTimerCreated=0;
+ pt->bTimerCreated = 0;
}
}
};
- pt=&CycleStartTick[wParam-TM_STATUSBARUPDATE];
+ pt = &CycleStartTick[wParam-TM_STATUSBARUPDATE];
{
- if(IsWindowVisible(pcli->hwndStatus)) pcli->pfnInvalidateRect(pcli->hwndStatus,NULL,0);//InvalidateRectZ(pcli->hwndStatus,NULL,TRUE);
- //if (DBGetContactSettingByte(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT)!=SETTING_TRAYICON_CYCLE)
+ if (IsWindowVisible(pcli->hwndStatus)) pcli->pfnInvalidateRect(pcli->hwndStatus,NULL,0);//InvalidateRectZ(pcli->hwndStatus,NULL,TRUE);
+ //if (DBGetContactSettingByte(NULL,"CList","TrayIcon",SETTING_TRAYICON_DEFAULT) != SETTING_TRAYICON_CYCLE)
if (pt->bGlobal)
cliTrayIconUpdateBase(g_szConnectingProto);
else
@@ -2398,31 +2398,31 @@ LRESULT CLUI::OnAutoAlphaTimer( UINT msg, WPARAM wParam, LPARAM lParam ) {
int inwnd;
- if (GetForegroundWindow()==m_hWnd)
+ if (GetForegroundWindow() == m_hWnd)
{
KillTimer(m_hWnd,TM_AUTOALPHA);
- inwnd=1;
+ inwnd = 1;
}
else
{
POINT pt;
HWND hwndPt;
- pt.x=(short)LOWORD(GetMessagePos());
- pt.y=(short)HIWORD(GetMessagePos());
- hwndPt=WindowFromPoint(pt);
+ pt.x = (short)LOWORD(GetMessagePos());
+ pt.y = (short)HIWORD(GetMessagePos());
+ hwndPt = WindowFromPoint(pt);
- inwnd=FALSE;
+ inwnd = FALSE;
inwnd = CLUI_CheckOwnedByClui(hwndPt);
if (! inwnd )
- inwnd = ( GetCapture()==pcli->hwndContactList );
+ inwnd = ( GetCapture() == pcli->hwndContactList );
}
- if (inwnd!=bTransparentFocus)
+ if (inwnd != bTransparentFocus)
{ //change
- HWND hwn=GetCapture();
- hwn=hwn;
- bTransparentFocus=inwnd;
- if(bTransparentFocus) CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
+ HWND hwn = GetCapture();
+ hwn = hwn;
+ bTransparentFocus = inwnd;
+ if (bTransparentFocus) CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
else
{
CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)(g_bTransparentFlag?db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT):255), 1);
@@ -2451,11 +2451,11 @@ LRESULT CLUI::OnBringOutTimer( UINT msg, WPARAM wParam, LPARAM lParam ) //hide
KillTimer(m_hWnd,TM_BRINGINTIMEOUT);
KillTimer(m_hWnd,TM_BRINGOUTTIMEOUT);
- bShowEventStarted=0;
+ bShowEventStarted = 0;
POINT pt; GetCursorPos(&pt);
HWND hAux = WindowFromPoint(pt);
BOOL mouse_in_window = CLUI_CheckOwnedByClui(hAux);
- if ( !mouse_in_window && GetForegroundWindow() != m_hWnd )
+ if ( !mouse_in_window && GetForegroundWindow() !=m_hWnd )
CLUI_HideBehindEdge();
return TRUE;
}
@@ -2463,12 +2463,12 @@ LRESULT CLUI::OnBringInTimer( UINT msg, WPARAM wParam, LPARAM lParam ) {
//show
KillTimer(m_hWnd,TM_BRINGINTIMEOUT);
- bShowEventStarted=0;
+ bShowEventStarted = 0;
KillTimer(m_hWnd,TM_BRINGOUTTIMEOUT);
POINT pt; GetCursorPos(&pt);
HWND hAux = WindowFromPoint(pt);
BOOL mouse_in_window = FALSE;
- while(hAux != NULL)
+ while(hAux !=NULL)
{
if (hAux == m_hWnd) { mouse_in_window = TRUE; break;}
hAux = GetParent(hAux);
@@ -2487,7 +2487,7 @@ LRESULT CLUI::OnTimer( UINT msg, WPARAM wParam, LPARAM lParam ) {
if ( MirandaExiting()) return FALSE;
- if ( (int)wParam >= TM_STATUSBARUPDATE && (int)wParam<=TM_STATUSBARUPDATE+64 )
+ if ( (int)wParam >= TM_STATUSBARUPDATE && (int)wParam <= TM_STATUSBARUPDATE+64 )
{
if ( !pcli->hwndStatus ) return FALSE;
else return OnStatusBarUpdateTimer( msg, wParam, lParam );
@@ -2509,12 +2509,12 @@ LRESULT CLUI::OnTimer( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnActivate( UINT msg, WPARAM wParam, LPARAM lParam )
{
- BOOL IsOption=FALSE;
+ BOOL IsOption = FALSE;
SetCursor(LoadCursor(NULL, IDC_ARROW));
SendMessage(pcli->hwndContactTree, WM_ACTIVATE, wParam, lParam);
if (db_get_b(NULL, "ModernData", "HideBehind", SETTING_HIDEBEHIND_DEFAULT))
{
- if(wParam==WA_INACTIVE && ((HWND)lParam!=m_hWnd) && GetParent((HWND)lParam)!=m_hWnd && !IsOption)
+ if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && GetParent((HWND)lParam) != m_hWnd && !IsOption)
{
if (!g_bCalledFromShowHide) CLUI_UpdateTimer(0);
}
@@ -2529,31 +2529,31 @@ LRESULT CLUI::OnActivate( UINT msg, WPARAM wParam, LPARAM lParam ) KillTimer(m_hWnd,TM_AUTOALPHA);
return 0;
}
- if(wParam==WA_INACTIVE && ((HWND)lParam!=m_hWnd) && !CLUI_CheckOwnedByClui((HWND)lParam) && !IsOption)
+ if (wParam == WA_INACTIVE && ((HWND)lParam != m_hWnd) && !CLUI_CheckOwnedByClui((HWND)lParam) && !IsOption)
{
- if(g_bTransparentFlag)
- if(bTransparentFocus)
+ if (g_bTransparentFlag)
+ if (bTransparentFocus)
CLUI_SafeSetTimer(m_hWnd, TM_AUTOALPHA,250,NULL);
}
else {
if (!db_get_b(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT))
Sync(CLUIFrames_ActivateSubContainers,TRUE);
- if(g_bTransparentFlag) {
+ if (g_bTransparentFlag) {
KillTimer(m_hWnd,TM_AUTOALPHA);
CLUI_SmoothAlphaTransition(m_hWnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
- bTransparentFocus=1;
+ bTransparentFocus = 1;
}
}
RedrawWindow(m_hWnd,NULL,NULL,RDW_INVALIDATE|RDW_ALLCHILDREN);
- if(g_bTransparentFlag)
+ if (g_bTransparentFlag)
{
BYTE alpha;
- if (wParam!=WA_INACTIVE || CLUI_CheckOwnedByClui((HWND)lParam)|| IsOption || ((HWND)lParam==m_hWnd) || GetParent((HWND)lParam)==m_hWnd) alpha=db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT);
+ if (wParam != WA_INACTIVE || CLUI_CheckOwnedByClui((HWND)lParam)|| IsOption || ((HWND)lParam == m_hWnd) || GetParent((HWND)lParam) == m_hWnd) alpha = db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT);
else
- alpha=g_bTransparentFlag?db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT):255;
+ alpha = g_bTransparentFlag?db_get_b(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT):255;
CLUI_SmoothAlphaTransition(m_hWnd, alpha, 1);
- if(IsOption) DefWindowProc(m_hWnd,msg,wParam,lParam);
+ if (IsOption) DefWindowProc(m_hWnd,msg,wParam,lParam);
else return 1;
}
return DefWindowProc(m_hWnd,msg,wParam,lParam);
@@ -2561,13 +2561,13 @@ LRESULT CLUI::OnActivate( UINT msg, WPARAM wParam, LPARAM lParam ) 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)
+ HWND gf = GetForegroundWindow();
+ if (g_CluiData.nBehindEdgeState >= 0) CLUI_UpdateTimer(1);
+ if (g_bTransparentFlag) {
+ if (!bTransparentFocus && gf != m_hWnd)
{
CLUI_SmoothAlphaTransition(m_hWnd, db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT), 1);
- bTransparentFocus=1;
+ bTransparentFocus = 1;
CLUI_SafeSetTimer(m_hWnd, TM_AUTOALPHA,250,NULL);
}
}
@@ -2583,7 +2583,7 @@ LRESULT CLUI::OnMouseActivate( UINT msg, WPARAM wParam, LPARAM lParam ) mutex_bIgnoreActivation = 0;
return( MA_NOACTIVATEANDEAT );
}
- int lRes=DefWindowProc(m_hWnd,msg,wParam,lParam);
+ int lRes = DefWindowProc(m_hWnd,msg,wParam,lParam);
CLUIFrames_RepaintSubContainers();
return lRes;
}
@@ -2615,33 +2615,33 @@ LRESULT CLUI::OnNcLButtonDblClk( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnNcHitTest( UINT msg, WPARAM wParam, LPARAM lParam )
{
LRESULT result;
- result=DefWindowProc(m_hWnd,WM_NCHITTEST,wParam,lParam);
+ result = DefWindowProc(m_hWnd,WM_NCHITTEST,wParam,lParam);
if ( (g_CluiData.fAutoSize) && ( result == HTSIZE || result == HTTOP ||
result == HTTOPLEFT || result == HTTOPRIGHT ||
- result==HTBOTTOM || result==HTBOTTOMRIGHT ||
- result==HTBOTTOMLEFT))
+ result == HTBOTTOM || result == HTBOTTOMRIGHT ||
+ result == HTBOTTOMLEFT))
return HTCLIENT;
- if (result==HTMENU)
+ if (result == HTMENU)
{
int t;
POINT pt;
- pt.x=(short)LOWORD(lParam);
- pt.y=(short)HIWORD(lParam);
- t=MenuItemFromPoint(m_hWnd,g_hMenuMain,pt);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
+ t = MenuItemFromPoint(m_hWnd,g_hMenuMain,pt);
- if (t==-1 && (db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)))
+ if (t == -1 && (db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)))
return HTCAPTION;
}
- if (result==HTCLIENT)
+ if (result == HTCLIENT)
{
POINT pt;
int k;
- pt.x=(short)LOWORD(lParam);
- pt.y=(short)HIWORD(lParam);
- k=CLUI_SizingOnBorder(pt,0);
+ 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)))
return HTCAPTION;
else return k+9;
@@ -2657,12 +2657,12 @@ 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);
+ gAlpha = (db_get_b(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT):255);
if (wParam)
{
- g_CluiData.bCurrentAlpha=0;
+ g_CluiData.bCurrentAlpha = 0;
Sync(CLUIFrames_OnShowHide, pcli->hwndContactList,1);
ske_RedrawCompleteWindow();
}
@@ -2691,7 +2691,7 @@ LRESULT CLUI::OnSysCommand( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnKeyDown( UINT msg, WPARAM wParam, LPARAM lParam )
{
- if (wParam==VK_F5)
+ if (wParam == VK_F5)
SendMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0);
return DefCluiWndProc( msg, wParam, lParam );
}
@@ -2699,10 +2699,10 @@ LRESULT CLUI::OnKeyDown( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnGetMinMaxInfo( UINT msg, WPARAM wParam, LPARAM lParam )
{
DefWindowProc(m_hWnd,msg,wParam,lParam);
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.x=max(db_get_w(NULL,"CLUI","MinWidth",SETTING_MINWIDTH_DEFAULT),max(18,db_get_b(NULL,"CLUI","LeftClientMargin",SETTING_LEFTCLIENTMARIGN_DEFAULT)+db_get_b(NULL,"CLUI","RightClientMargin",SETTING_RIGHTCLIENTMARIGN_DEFAULT)+18));
- if (nRequiredHeight==0)
+ ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = max(db_get_w(NULL,"CLUI","MinWidth",SETTING_MINWIDTH_DEFAULT),max(18,db_get_b(NULL,"CLUI","LeftClientMargin",SETTING_LEFTCLIENTMARIGN_DEFAULT)+db_get_b(NULL,"CLUI","RightClientMargin",SETTING_RIGHTCLIENTMARIGN_DEFAULT)+18));
+ if (nRequiredHeight == 0)
{
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.y=CLUIFramesGetMinHeight();
+ ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = CLUIFramesGetMinHeight();
}
return FALSE;
}
@@ -2735,27 +2735,27 @@ LRESULT CLUI::OnListSizeChangeNotify( NMCLISTCONTROL * pnmc ) static RECT rcWindow,rcTree,rcTree2,rcWorkArea,rcOld;
int maxHeight, minHeight,newHeight;
int winstyle;
- if (mutex_bDisableAutoUpdate==1)
+ if (mutex_bDisableAutoUpdate == 1)
return FALSE;
if (mutex_bDuringSizing)
- rcWindow=rcSizingRect;
+ rcWindow = rcSizingRect;
else
GetWindowRect(m_hWnd,&rcWindow);
- if ( !g_CluiData.fAutoSize || pcli->hwndContactTree==0 || CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
+ if ( !g_CluiData.fAutoSize || pcli->hwndContactTree == 0 || CallService(MS_CLIST_DOCKINGISDOCKED,0,0))
return FALSE;
- maxHeight=db_get_b(NULL,"CLUI","MaxSizeHeight",SETTING_MAXSIZEHEIGHT_DEFAULT);
- minHeight=db_get_b(NULL,"CLUI","MinSizeHeight",SETTING_MINSIZEHEIGHT_DEFAULT);
- rcOld=rcWindow;
+ maxHeight = db_get_b(NULL,"CLUI","MaxSizeHeight",SETTING_MAXSIZEHEIGHT_DEFAULT);
+ minHeight = db_get_b(NULL,"CLUI","MinSizeHeight",SETTING_MINSIZEHEIGHT_DEFAULT);
+ rcOld = rcWindow;
GetWindowRect(pcli->hwndContactTree,&rcTree);
- FRAMEWND* frm=FindFrameByItsHWND(pcli->hwndContactTree);
+ FRAMEWND* frm = FindFrameByItsHWND(pcli->hwndContactTree);
if (frm)
- rcTree2=frm->wndSize;
+ rcTree2 = frm->wndSize;
else
SetRect(&rcTree2,0,0,0,0);
- winstyle=GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE);
+ winstyle = GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE);
SystemParametersInfo(SPI_GETWORKAREA,0,&rcWorkArea,FALSE);
if (MyMonitorFromWindow)
@@ -2770,43 +2770,43 @@ LRESULT CLUI::OnListSizeChangeNotify( NMCLISTCONTROL * pnmc ) if (pnmc->pt.y>(rcWorkArea.bottom-rcWorkArea.top))
{
- pnmc->pt.y=(rcWorkArea.bottom-rcWorkArea.top);
+ pnmc->pt.y = (rcWorkArea.bottom-rcWorkArea.top);
};
- if ((pnmc->pt.y)==nLastRequiredHeight)
+ if ((pnmc->pt.y) == nLastRequiredHeight)
{
}
- nLastRequiredHeight=pnmc->pt.y;
- newHeight=max(CLUIFramesGetMinHeight(),max(pnmc->pt.y,3)+1+((winstyle&WS_BORDER)?2:0)+(rcWindow.bottom-rcWindow.top)-(rcTree.bottom-rcTree.top));
- if(newHeight<(rcWorkArea.bottom-rcWorkArea.top)*minHeight/100)
- newHeight=(rcWorkArea.bottom-rcWorkArea.top)*minHeight/100;
+ nLastRequiredHeight = pnmc->pt.y;
+ newHeight = max(CLUIFramesGetMinHeight(),max(pnmc->pt.y,3)+1+((winstyle&WS_BORDER)?2:0)+(rcWindow.bottom-rcWindow.top)-(rcTree.bottom-rcTree.top));
+ if (newHeight < (rcWorkArea.bottom-rcWorkArea.top)*minHeight/100)
+ newHeight = (rcWorkArea.bottom-rcWorkArea.top)*minHeight/100;
- if(newHeight>(rcWorkArea.bottom-rcWorkArea.top)*maxHeight/100)
- newHeight=(rcWorkArea.bottom-rcWorkArea.top)*maxHeight/100;
+ if (newHeight>(rcWorkArea.bottom-rcWorkArea.top)*maxHeight/100)
+ newHeight = (rcWorkArea.bottom-rcWorkArea.top)*maxHeight/100;
- if (newHeight==(rcWindow.bottom-rcWindow.top)) return 0;
+ if (newHeight == (rcWindow.bottom-rcWindow.top)) return 0;
- if(db_get_b(NULL,"CLUI","AutoSizeUpward",SETTING_AUTOSIZEUPWARD_DEFAULT)) {
- rcWindow.top=rcWindow.bottom-newHeight;
- if(rcWindow.top<rcWorkArea.top) rcWindow.top=rcWorkArea.top;
+ if (db_get_b(NULL,"CLUI","AutoSizeUpward",SETTING_AUTOSIZEUPWARD_DEFAULT)) {
+ rcWindow.top = rcWindow.bottom-newHeight;
+ if (rcWindow.top < rcWorkArea.top) rcWindow.top = rcWorkArea.top;
}
else {
- rcWindow.bottom=rcWindow.top+newHeight;
- if(rcWindow.bottom>rcWorkArea.bottom) rcWindow.bottom=rcWorkArea.bottom;
+ rcWindow.bottom = rcWindow.top+newHeight;
+ if (rcWindow.bottom>rcWorkArea.bottom) rcWindow.bottom = rcWorkArea.bottom;
}
- if (nRequiredHeight==1)
+ if (nRequiredHeight == 1)
return FALSE;
- nRequiredHeight=1;
+ nRequiredHeight = 1;
if (mutex_bDuringSizing)
{
- bNeedFixSizingRect=1;
- rcSizingRect.top=rcWindow.top;
- rcSizingRect.bottom=rcWindow.bottom;
- rcCorrectSizeRect=rcSizingRect;
+ bNeedFixSizingRect = 1;
+ rcSizingRect.top = rcWindow.top;
+ rcSizingRect.bottom = rcWindow.bottom;
+ rcCorrectSizeRect = rcSizingRect;
}
else
{
- bNeedFixSizingRect=0;
+ bNeedFixSizingRect = 0;
}
if (!mutex_bDuringSizing)
SetWindowPos(m_hWnd,0,rcWindow.left,rcWindow.top,rcWindow.right-rcWindow.left,rcWindow.bottom-rcWindow.top,SWP_NOZORDER|SWP_NOACTIVATE);
@@ -2814,7 +2814,7 @@ LRESULT CLUI::OnListSizeChangeNotify( NMCLISTCONTROL * pnmc ) {
SetWindowPos(m_hWnd,0,rcWindow.left,rcWindow.top,rcWindow.right-rcWindow.left,rcWindow.bottom-rcWindow.top,SWP_NOZORDER|SWP_NOACTIVATE);
}
- nRequiredHeight=0;
+ nRequiredHeight = 0;
return FALSE;
}
@@ -2828,8 +2828,8 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) {
if (!IsHContactGroup(hItem)&&!IsHContactInfo(hItem))
{
- pdisplayNameCacheEntry pdnce=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pnmc->hItem);
- if (pdnce==NULL) return 0;
+ pdisplayNameCacheEntry pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(pnmc->hItem);
+ if (pdnce == NULL) return 0;
int extra = ExtraImage_ColumnNumToExtraID(pnmc->iColumn);
NotifyEventHooks(g_CluiData.hEventExtraClick, (WPARAM)pnmc->hItem, extra);
@@ -2837,19 +2837,19 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) if (!ServiceExists("ExtraIcon/Register"))
{
int v,e,w;
- v=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO);
- e=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL);
- w=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB);
+ v = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO);
+ e = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL);
+ w = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB);
- if(pnmc->iColumn==v) {
+ if (pnmc->iColumn == v) {
CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)pnmc->hItem,0);
};
- if(pnmc->iColumn==e)
+ if (pnmc->iColumn == e)
{
char *email,buf[4096];
- email= db_get_sa(pnmc->hItem,"UserInfo", "Mye-mail0");
+ email = db_get_sa(pnmc->hItem,"UserInfo", "Mye-mail0");
if (!email)
- email= db_get_sa(pnmc->hItem, pdnce->m_cache_cszProto, "e-mail");
+ email = db_get_sa(pnmc->hItem, pdnce->m_cache_cszProto, "e-mail");
if (email)
{
sprintf(buf,"mailto:%s",email);
@@ -2857,12 +2857,12 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) ShellExecuteA(m_hWnd,"open",buf,NULL,NULL,SW_SHOW);
}
};
- if(pnmc->iColumn==w) {
+ if (pnmc->iColumn == w) {
char *homepage;
- homepage= db_get_sa(pdnce->m_cache_hContact,"UserInfo", "Homepage");
+ homepage = db_get_sa(pdnce->m_cache_hContact,"UserInfo", "Homepage");
if (!homepage)
- homepage= db_get_sa(pdnce->m_cache_hContact,pdnce->m_cache_cszProto, "Homepage");
- if (homepage!=NULL)
+ homepage = db_get_sa(pdnce->m_cache_hContact,pdnce->m_cache_cszProto, "Homepage");
+ if (homepage != NULL)
{
CallService(MS_UTILS_OPENURL, 1, (LPARAM)homepage);
mir_free_and_nill(homepage);
@@ -2871,29 +2871,29 @@ LRESULT CLUI::OnClickNotify( NMCLISTCONTROL * pnmc ) }
}
};
- if(hItem && !(hitFlags&CLCHT_NOWHERE))
+ if (hItem && !(hitFlags&CLCHT_NOWHERE))
return DefCluiWndProc( WM_NOTIFY, 0, (LPARAM)pnmc );
- if ((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS))==0)
+ if ((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS)) == 0)
return DefCluiWndProc( WM_NOTIFY, 0, (LPARAM)pnmc );
if (db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt;
int res;
- pt=pnmc->pt;
+ pt = pnmc->pt;
ClientToScreen(pcli->hwndContactTree,&pt);
- res=PostMessage(m_hWnd, WM_SYSCOMMAND, SC_MOVE|HTCAPTION,MAKELPARAM(pt.x,pt.y));
+ res = PostMessage(m_hWnd, WM_SYSCOMMAND, SC_MOVE|HTCAPTION,MAKELPARAM(pt.x,pt.y));
return res;
}
- /*===================*/
+ /*== == == == == == == == == = */
if (db_get_b(NULL,"CLUI","DragToScroll",SETTING_DRAGTOSCROLL_DEFAULT) && !db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT))
return ClcEnterDragToScroll(pcli->hwndContactTree,pnmc->pt.y);
- /*===================*/
+ /*== == == == == == == == == = */
return 0;
}
LRESULT CLUI::OnNotify( UINT msg, WPARAM wParam, LPARAM lParam )
{
LPNMHDR pnmhdr = (LPNMHDR)lParam;
- if ( pnmhdr->hwndFrom != pcli->hwndContactTree )
+ if ( pnmhdr->hwndFrom !=pcli->hwndContactTree )
return DefCluiWndProc( msg, wParam, lParam );
switch ( pnmhdr->code)
@@ -2912,8 +2912,8 @@ LRESULT CLUI::OnContextMenu( UINT msg, WPARAM wParam, LPARAM lParam ) RECT rc;
POINT pt;
- pt.x=(short)LOWORD(lParam);
- pt.y=(short)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
// x/y might be -1 if it was generated by a kb click
GetWindowRect(pcli->hwndContactTree,&rc);
if ( pt.x == -1 && pt.y == -1) {
@@ -2925,10 +2925,10 @@ LRESULT CLUI::OnContextMenu( UINT msg, WPARAM wParam, LPARAM lParam ) pt.y = rc.top + (rc.bottom - rc.top) / 2;
}
}
- if(PtInRect( &rc ,pt ))
+ if (PtInRect( &rc ,pt ))
{
HMENU hMenu;
- hMenu=(HMENU)CallService(MS_CLIST_MENUBUILDGROUP,0,0);
+ hMenu = (HMENU)CallService(MS_CLIST_MENUBUILDGROUP,0,0);
TrackPopupMenu(hMenu,TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON,pt.x,pt.y,0,m_hWnd,NULL);
DestroyTrayMenu(hMenu);
}
@@ -2950,7 +2950,7 @@ LRESULT CLUI::OnMeasureItem( UINT msg, WPARAM wParam, LPARAM lParam ) {
HDC hdc;
SIZE textSize;
- hdc=GetDC( m_hWnd );
+ hdc = GetDC( m_hWnd );
GetTextExtentPoint32A( hdc, Translate("Status"), lstrlenA( Translate( "Status" )), &textSize );
pmis->itemWidth = textSize.cx;
pmis->itemHeight = 0;
@@ -2963,22 +2963,22 @@ LRESULT CLUI::OnMeasureItem( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnDrawItem( UINT msg, WPARAM wParam, LPARAM lParam )
{
- struct ClcData * dat=(struct ClcData*)GetWindowLongPtr(pcli->hwndContactTree,0);
- LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam;
+ struct ClcData * dat = (struct ClcData*)GetWindowLongPtr(pcli->hwndContactTree,0);
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
if (!dat) return 0;
- if (dis->CtlType==ODT_MENU) {
- if (dis->itemData==MENU_MIRANDAMENU) {
+ if (dis->CtlType == ODT_MENU) {
+ if (dis->itemData == MENU_MIRANDAMENU) {
if (!g_CluiData.fLayered)
{
char buf[255];
short offset = 1 + ( dis->itemState&ODS_SELECTED ? 1 : 0 )
- ( dis->itemState&ODS_HOTLIGHT ? 1 : 0 );
- HICON hIcon=LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
+ HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MAINMENU);
CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 1, dis->itemState);
- mir_snprintf(buf,SIZEOF(buf),"Main,ID=MainMenu,Selected=%s,Hot=%s",(dis->itemState&ODS_SELECTED)?"True":"False",(dis->itemState&ODS_HOTLIGHT)?"True":"False");
+ mir_snprintf(buf,SIZEOF(buf),"Main,ID = MainMenu,Selected = %s,Hot = %s",(dis->itemState&ODS_SELECTED)?"True":"False",(dis->itemState&ODS_HOTLIGHT)?"True":"False");
SkinDrawGlyph(dis->hDC,&dis->rcItem,&dis->rcItem,buf);
int x = (dis->rcItem.right + dis->rcItem.left - GetSystemMetrics(SM_CXSMICON)) / 2 + offset;
@@ -2988,50 +2988,50 @@ LRESULT CLUI::OnDrawItem( UINT msg, WPARAM wParam, LPARAM lParam ) DST_ICON | ( dis->itemState & ODS_INACTIVE && (((FALSE))) ? DSS_DISABLED : DSS_NORMAL ));
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- nMirMenuState=dis->itemState;
+ nMirMenuState = dis->itemState;
} else {
- nMirMenuState=dis->itemState;
+ nMirMenuState = dis->itemState;
pcli->pfnInvalidateRect(m_hWnd,NULL,0);
}
return TRUE;
}
- else if(dis->itemData==MENU_STATUSMENU) {
+ else if (dis->itemData == MENU_STATUSMENU) {
if (!g_CluiData.fLayered)
{
- char buf[255]={0};
- RECT rc=dis->rcItem;
- short dx=1+(dis->itemState&ODS_SELECTED?1:0)-(dis->itemState&ODS_HOTLIGHT?1:0);
+ char buf[255] = {0};
+ RECT rc = dis->rcItem;
+ short dx = 1+(dis->itemState&ODS_SELECTED?1:0)-(dis->itemState&ODS_HOTLIGHT?1:0);
if (dx>1){
- rc.left+=dx;
- rc.top+=dx;
- }else if (dx==0){
- rc.right-=1;
- rc.bottom-=1;
+ rc.left += dx;
+ rc.top += dx;
+ }else if (dx == 0){
+ rc.right -= 1;
+ rc.bottom -= 1;
}
CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 2, dis->itemState);
SetBkMode(dis->hDC,TRANSPARENT);
- mir_snprintf(buf,SIZEOF(buf),"Main,ID=StatusMenu,Selected=%s,Hot=%s",(dis->itemState&ODS_SELECTED)?"True":"False",(dis->itemState&ODS_HOTLIGHT)?"True":"False");
+ mir_snprintf(buf,SIZEOF(buf),"Main,ID = StatusMenu,Selected = %s,Hot = %s",(dis->itemState&ODS_SELECTED)?"True":"False",(dis->itemState&ODS_HOTLIGHT)?"True":"False");
SkinDrawGlyph(dis->hDC,&dis->rcItem,&dis->rcItem,buf);
SetTextColor(dis->hDC, (dis->itemState&ODS_SELECTED/*|dis->itemState&ODS_HOTLIGHT*/)?dat->MenuTextHiColor:dat->MenuTextColor);
DrawText(dis->hDC,TranslateT("Status"), lstrlen(TranslateT("Status")),&rc, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
- nStatusMenuState=dis->itemState;
+ nStatusMenuState = dis->itemState;
} else {
- nStatusMenuState=dis->itemState;
+ nStatusMenuState = dis->itemState;
pcli->pfnInvalidateRect(m_hWnd,NULL,0);
}
return TRUE;
- } else if(dis->itemData==MENU_MINIMIZE && !g_CluiData.fLayered)
+ } else if (dis->itemData == MENU_MINIMIZE && !g_CluiData.fLayered)
{
//TODO check if caption is visible
- char buf[255]={0};
- short dx=1+(dis->itemState&ODS_SELECTED?1:0)-(dis->itemState&ODS_HOTLIGHT?1:0);
+ char buf[255] = {0};
+ short dx = 1+(dis->itemState&ODS_SELECTED?1:0)-(dis->itemState&ODS_HOTLIGHT?1:0);
HICON hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
CLUI_DrawMenuBackGround(m_hWnd, dis->hDC, 3, dis->itemState);
- mir_snprintf(buf,SIZEOF(buf),"Main,ID=MainMenu,Selected=%s,Hot=%s",(dis->itemState&ODS_SELECTED)?"True":"False",(dis->itemState&ODS_HOTLIGHT)?"True":"False");
+ mir_snprintf(buf,SIZEOF(buf),"Main,ID = MainMenu,Selected = %s,Hot = %s",(dis->itemState&ODS_SELECTED)?"True":"False",(dis->itemState&ODS_HOTLIGHT)?"True":"False");
SkinDrawGlyph(dis->hDC,&dis->rcItem,&dis->rcItem,buf);
DrawState(dis->hDC,NULL,NULL,(LPARAM)hIcon,0,(dis->rcItem.right+dis->rcItem.left-GetSystemMetrics(SM_CXSMICON))/2+dx,(dis->rcItem.bottom+dis->rcItem.top-GetSystemMetrics(SM_CYSMICON))/2+dx,0,0,DST_ICON|(dis->itemState&ODS_INACTIVE&&FALSE?DSS_DISABLED:DSS_NORMAL));
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- nMirMenuState=dis->itemState;
+ nMirMenuState = dis->itemState;
}
return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
@@ -3041,12 +3041,12 @@ LRESULT CLUI::OnDrawItem( UINT msg, WPARAM wParam, LPARAM lParam ) LRESULT CLUI::OnDestroy( UINT msg, WPARAM wParam, LPARAM lParam )
{
- int state=db_get_b(NULL,"CList","State",SETTING_STATE_NORMAL);
+ int state = db_get_b(NULL,"CList","State",SETTING_STATE_NORMAL);
BOOL wait = FALSE;
AniAva_UnloadModule();
TRACE("CLUI.c: WM_DESTROY\n");
- g_CluiData.bSTATE=STATE_EXITING;
+ g_CluiData.bSTATE = STATE_EXITING;
CLUI_DisconnectAll();
//fire the "Away Message" Event to wake the thread so it can die.
//fire the "Get Text Async" Event to wake the thread so it can die.
@@ -3066,14 +3066,14 @@ LRESULT CLUI::OnDestroy( UINT msg, WPARAM wParam, LPARAM lParam ) while (CLUI_WaitThreadsCompletion(m_hWnd)); //stop all my threads
TRACE("CLUI.c: WM_DESTROY - WaitThreadsCompletion DONE\n");
{
- int i=0;
- for(i=0; i<64; i++)
- if(CycleStartTick[i].szProto) mir_free_and_nill(CycleStartTick[i].szProto);
+ int i = 0;
+ for(i = 0; i < 64; i++)
+ if (CycleStartTick[i].szProto) mir_free_and_nill(CycleStartTick[i].szProto);
}
- if (state==SETTING_STATE_NORMAL){CLUI_ShowWindowMod(m_hWnd,SW_HIDE);};
+ if (state == SETTING_STATE_NORMAL){CLUI_ShowWindowMod(m_hWnd,SW_HIDE);};
UnLoadContactListModule();
- if(hSettingChangedHook!=0) ModernUnhookEvent(hSettingChangedHook);
+ if (hSettingChangedHook != 0) ModernUnhookEvent(hSettingChangedHook);
ClcUnloadModule();
RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
@@ -3081,20 +3081,20 @@ LRESULT CLUI::OnDestroy( UINT msg, WPARAM wParam, LPARAM lParam ) DestroyMenu(g_hMenuMain);
pcli->pfnTrayIconDestroy(m_hWnd);
- mutex_bAnimationInProgress=0;
+ mutex_bAnimationInProgress = 0;
CallService(MS_CLIST_FRAMES_REMOVEFRAME,(WPARAM)hFrameContactTree,(LPARAM)0);
TRACE("CLUI.c: WM_DESTROY - hFrameContactTree removed\n");
- pcli->hwndContactTree=NULL;
- pcli->hwndStatus=NULL;
+ pcli->hwndContactTree = NULL;
+ pcli->hwndStatus = NULL;
{
- if(g_CluiData.fAutoSize && !g_CluiData.fDocked)
+ if (g_CluiData.fAutoSize && !g_CluiData.fDocked)
{
RECT r;
GetWindowRect(pcli->hwndContactList,&r);
- if(db_get_b(NULL,"CLUI","AutoSizeUpward",SETTING_AUTOSIZEUPWARD_DEFAULT))
- r.top=r.bottom-CLUIFrames_GetTotalHeight();
+ if (db_get_b(NULL,"CLUI","AutoSizeUpward",SETTING_AUTOSIZEUPWARD_DEFAULT))
+ r.top = r.bottom-CLUIFrames_GetTotalHeight();
else
- r.bottom=r.top+CLUIFrames_GetTotalHeight();
+ r.bottom = r.top+CLUIFrames_GetTotalHeight();
db_set_dw(NULL,"CList","y",r.top);
db_set_dw(NULL,"CList","Height",r.bottom-r.top);
}
@@ -3107,8 +3107,8 @@ LRESULT CLUI::OnDestroy( UINT msg, WPARAM wParam, LPARAM lParam ) delete m_pCLUI;
- pcli->hwndContactList=NULL;
- pcli->hwndStatus=NULL;
+ pcli->hwndContactList = NULL;
+ pcli->hwndStatus = NULL;
PostQuitMessage(0);
return 0;
}
diff --git a/plugins/Clist_modern/modern_cluiframes.cpp b/plugins/Clist_modern/modern_cluiframes.cpp index 7ead50d90f..0447eaff41 100644 --- a/plugins/Clist_modern/modern_cluiframes.cpp +++ b/plugins/Clist_modern/modern_cluiframes.cpp @@ -32,12 +32,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_static_cluiframes_service.h" // contain services initialization and proxiation
-static const int UNCOLLAPSED_FRAME_SIZE = 0;
-static const int DEFAULT_TITLEBAR_HEIGHT = 18;
+static const int UNCOLLAPSED_FRAME_SIZE = 0;
+static const int DEFAULT_TITLEBAR_HEIGHT = 18;
//GLOBALS
-FRAMEWND * g_pfwFrames = NULL;
-int g_nFramesCount = 0;
+FRAMEWND * g_pfwFrames = NULL;
+int g_nFramesCount = 0;
int g_nTitleBarHeight = DEFAULT_TITLEBAR_HEIGHT;
// STATIC
@@ -60,40 +60,40 @@ static int _us_DoSetFramePaintProc(WPARAM wParam, LPARAM lParam); -static CRITICAL_SECTION _cluiFramesModuleCS = {0};
-static BOOL _cluiFramesModuleCSInitialized = FALSE;
-static BOOL _fCluiFramesModuleNotStarted = TRUE;
-static XPTHANDLE _hFrameTitleTheme = NULL;
-static int _nClientFrameId = eUnknownId; //for fast access to frame with alclient properties
-static int _iNextFrameId = 100;
-static HFONT _hTitleBarFont = NULL;
+static CRITICAL_SECTION _cluiFramesModuleCS = {0};
+static BOOL _cluiFramesModuleCSInitialized = FALSE;
+static BOOL _fCluiFramesModuleNotStarted = TRUE;
+static XPTHANDLE _hFrameTitleTheme = NULL;
+static int _nClientFrameId = eUnknownId; //for fast access to frame with alclient properties
+static int _iNextFrameId = 100;
+static HFONT _hTitleBarFont = NULL;
// menus
-static HGENMENU _hmiVisible = (HGENMENU)-1;
-static HGENMENU _hmiTBVisible = (HGENMENU)-1;
-static HGENMENU _hmiLock = (HGENMENU)-1;
-static HGENMENU _hmiColl = (HGENMENU)-1;
-static HGENMENU _hmiFloating = (HGENMENU)-1;
-static HGENMENU _hmiAlignRoot = (HGENMENU)-1;
-static HGENMENU _hmiAlignTop = (HGENMENU)-1;
-static HGENMENU _hmiAlignClient = (HGENMENU)-1;
-static HGENMENU _hmiAlignBottom = (HGENMENU)-1;
-static HGENMENU _hmiPosRoot = (HGENMENU)-1;
-static HGENMENU _hmiPosUp = (HGENMENU)-1;
-static HGENMENU _hmiPosDown = (HGENMENU)-1;
+static HGENMENU _hmiVisible = (HGENMENU)-1;
+static HGENMENU _hmiTBVisible = (HGENMENU)-1;
+static HGENMENU _hmiLock = (HGENMENU)-1;
+static HGENMENU _hmiColl = (HGENMENU)-1;
+static HGENMENU _hmiFloating = (HGENMENU)-1;
+static HGENMENU _hmiAlignRoot = (HGENMENU)-1;
+static HGENMENU _hmiAlignTop = (HGENMENU)-1;
+static HGENMENU _hmiAlignClient = (HGENMENU)-1;
+static HGENMENU _hmiAlignBottom = (HGENMENU)-1;
+static HGENMENU _hmiPosRoot = (HGENMENU)-1;
+static HGENMENU _hmiPosUp = (HGENMENU)-1;
+static HGENMENU _hmiPosDown = (HGENMENU)-1;
static HGENMENU _hmiBorder = (HGENMENU)-1;
-static HGENMENU _hmiRoot = (HGENMENU)-1;
+static HGENMENU _hmiRoot = (HGENMENU)-1;
// others
-static int _nContactListHeight = 0;
-static DWORD _dwLastStoreTick = 0;
+static int _nContactListHeight = 0;
+static DWORD _dwLastStoreTick = 0;
HWND hWndExplorerToolBar;
-static int GapBetweenFrames=1;
+static int GapBetweenFrames = 1;
BOOLEAN bMoveTogether;
-int recurs_prevent=0;
-static BOOL PreventSizeCalling=FALSE;
+int recurs_prevent = 0;
+static BOOL PreventSizeCalling = FALSE;
static HBITMAP hBmpBackground;
static int backgroundBmpUse;
@@ -105,14 +105,14 @@ COLORREF sttGetColor(char * module, char * color, COLORREF defColor); //for old multiwindow
#define MPCF_CONTEXTFRAMEMENU 3
POINT ptOld;
-short nLeft = 0;
-short nTop = 0;
+short nLeft = 0;
+short nTop = 0;
static int sortfunc(const void *a,const void *b)
{
SortData *sd1,*sd2;
- sd1=(SortData *)a;
- sd2=(SortData *)b;
+ sd1 = (SortData *)a;
+ sd2 = (SortData *)b;
if (sd1->order > sd2->order){return(1);};
if (sd1->order < sd2->order){return(-1);};
return (0);
@@ -120,30 +120,30 @@ static int sortfunc(const void *a,const void *b) int CLUIFrames_OnMoving( HWND hwnd, RECT * r)
{
int i;
- g_CluiData.mutexPreventDockMoving=0;
- for(i=0;i<g_nFramesCount;i++) {
+ 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;
int dx,dy;
FRAMEWND * Frame;
- POINT pt={0};
+ POINT pt = {0};
RECT wr;
- Frame=&(g_pfwFrames[i]);
+ Frame = &(g_pfwFrames[i]);
GetWindowRect(hwnd,&wr);
ClientToScreen(hwnd,&pt);
- dx=(r->left-wr.left)+pt.x;
- dy=(r->top-wr.top)+pt.y;
- x=Frame->wndSize.left;
- y=Frame->wndSize.top;
+ dx = (r->left-wr.left)+pt.x;
+ dy = (r->top-wr.top)+pt.y;
+ x = Frame->wndSize.left;
+ y = Frame->wndSize.top;
SetWindowPos(Frame->OwnerWindow,NULL,x+dx,y+dy,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSENDCHANGING|SWP_ASYNCWINDOWPOS|SWP_DEFERERASE|SWP_NOOWNERZORDER);
};
}
- g_CluiData.mutexPreventDockMoving=1;
+ g_CluiData.mutexPreventDockMoving = 1;
AniAva_RedrawAllAvatars(FALSE);
return 0;
}
@@ -151,23 +151,23 @@ int SetAlpha(BYTE Alpha) {
int i;
- for(i=0;i<g_nFramesCount;i++) {
+ 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;
+ HWND hwnd = g_pfwFrames[i].OwnerWindow;
if (g_proc_SetLayeredWindowAttributesNew)
{
long l;
- l=GetWindowLongPtr(hwnd,GWL_EXSTYLE);
+ l = GetWindowLongPtr(hwnd,GWL_EXSTYLE);
if (!(l&WS_EX_LAYERED))
{
- HWND parent=NULL;
+ HWND parent = NULL;
if (g_CluiData.fOnDesktop)
{
- HWND hProgMan=FindWindow(TEXT("Progman"),NULL);
+ HWND hProgMan = FindWindow(TEXT("Progman"),NULL);
if (IsWindow(hProgMan))
- parent=hProgMan;
+ parent = hProgMan;
}
CLUI_ShowWindowMod(hwnd,SW_HIDE);
@@ -188,8 +188,8 @@ int SetAlpha(BYTE Alpha) 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 )
+ 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 )
{
RedrawWindow(g_pfwFrames[i].hWnd,NULL,NULL,RDW_ALLCHILDREN|RDW_UPDATENOW|RDW_INVALIDATE|RDW_FRAME);
};
@@ -199,11 +199,11 @@ int CLUIFrames_RepaintSubContainers() int CLUIFrames_ActivateSubContainers( BOOL active)
{
int i;
- for(i=0;i<g_nFramesCount;i++)
- if (active&&!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow!=(HWND)0 &&g_pfwFrames[i].OwnerWindow!=(HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
+ for(i = 0;i < g_nFramesCount;i++)
+ if (active&&!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;
- hwnd=g_pfwFrames[i].hWnd;//OwnerWindow;
+ HWND hwnd = g_pfwFrames[i].OwnerWindow;
+ hwnd = g_pfwFrames[i].hWnd;//OwnerWindow;
if (db_get_b(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT))
{
SetWindowPos(g_pfwFrames[i].OwnerWindow,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
@@ -216,14 +216,14 @@ int CLUIFrames_ActivateSubContainers( BOOL active) int CLUIFrames_SetParentForContainers( HWND parent )
{
int i;
- if (parent&&parent!=pcli->hwndContactList)
- g_CluiData.fOnDesktop=1;
+ if (parent&&parent != pcli->hwndContactList)
+ g_CluiData.fOnDesktop = 1;
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 )
+ 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 )
{
- HWND hwnd=g_pfwFrames[i].OwnerWindow;
+ HWND hwnd = g_pfwFrames[i].OwnerWindow;
SetParent(hwnd,parent);
}
}
@@ -234,22 +234,22 @@ 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)
+ for(i = 0;i < g_nFramesCount;i++) {
+ 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.
- HWND owner=g_pfwFrames[i].OwnerWindow;
- HWND Frmhwnd=g_pfwFrames[i].hWnd;
- BOOL visible=g_pfwFrames[i].visible;
- BOOL needhide=g_pfwFrames[i].needhide;
+ HWND owner = g_pfwFrames[i].OwnerWindow;
+ HWND Frmhwnd = g_pfwFrames[i].hWnd;
+ BOOL visible = g_pfwFrames[i].visible;
+ BOOL needhide = g_pfwFrames[i].needhide;
needhide |= (!g_pfwFrames[i].collapsed || g_pfwFrames[i].height == 0 );
- prevFrameCount=g_nFramesCount;
- ShowWindow(owner,(mode==SW_HIDE||!visible||needhide)?SW_HIDE:mode);
- ShowWindow(Frmhwnd,(mode==SW_HIDE||!visible||needhide)?SW_HIDE:mode);
+ prevFrameCount = g_nFramesCount;
+ ShowWindow(owner,(mode == SW_HIDE||!visible||needhide)?SW_HIDE:mode);
+ ShowWindow(Frmhwnd,(mode == SW_HIDE||!visible||needhide)?SW_HIDE:mode);
}
- if (mode!=SW_HIDE)
+ if (mode != SW_HIDE)
{
SetWindowPos(g_pfwFrames[i].OwnerWindow,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
if (db_get_b(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT))
@@ -261,7 +261,7 @@ int CLUIFrames_OnShowHide( HWND hwnd, int mode ) }
}
}
- if (mode!=SW_HIDE) SetForegroundWindow(pcli->hwndContactList);
+ if (mode != SW_HIDE) SetForegroundWindow(pcli->hwndContactList);
AniAva_RedrawAllAvatars(TRUE);
return 0;
}
@@ -269,7 +269,7 @@ static int RemoveItemFromList(int pos,FRAMEWND **lpFrames,int *FrameItemCount) {
memmove(&((*lpFrames)[pos]),&((*lpFrames)[pos+1]),sizeof(FRAMEWND)*(*FrameItemCount-pos-1));
(*FrameItemCount)--;
- (*lpFrames)=(FRAMEWND*)realloc((*lpFrames),sizeof(FRAMEWND)*(*FrameItemCount));
+ (*lpFrames) = (FRAMEWND*)realloc((*lpFrames),sizeof(FRAMEWND)*(*FrameItemCount));
return 0;
}
@@ -277,14 +277,14 @@ static int id2pos(int id) {
int i;
if (_fCluiFramesModuleNotStarted) return -1;
- for (i=0;i<g_nFramesCount;i++)
- if (g_pfwFrames[i].id==id) return(i);
+ for (i = 0;i < g_nFramesCount;i++)
+ if (g_pfwFrames[i].id == id) return(i);
return(-1);
};
static int btoint(BOOLEAN b)
{
- if(b) return 1;
+ if (b) return 1;
return 0;
}
@@ -295,8 +295,8 @@ static FRAMEWND* FindFrameByWnd( HWND hwnd ) if ( hwnd == NULL ) return( NULL );
- for(i=0;i<g_nFramesCount;i++)
- if ((g_pfwFrames[i].floating)&&(g_pfwFrames[i].ContainerWnd==hwnd))
+ for(i = 0;i < g_nFramesCount;i++)
+ if ((g_pfwFrames[i].floating)&&(g_pfwFrames[i].ContainerWnd == hwnd))
return(&g_pfwFrames[i]);
return( NULL);
@@ -306,7 +306,7 @@ static FRAMEWND* FindFrameByWnd( HWND hwnd ) int QueueAllFramesUpdating(BYTE queue)
{
int i;
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
if (!g_CluiData.fLayered)
{
@@ -317,12 +317,12 @@ int QueueAllFramesUpdating(BYTE queue) }
if (g_pfwFrames[i].PaintCallbackProc)
{
- g_pfwFrames[i].bQueued=queue;
+ g_pfwFrames[i].bQueued = queue;
if (g_pfwFrames[i].UpdateRgn)
{
DeleteObject(g_pfwFrames[i].UpdateRgn);
}
- g_pfwFrames[i].UpdateRgn=0;
+ g_pfwFrames[i].UpdateRgn = 0;
}
}
@@ -331,9 +331,9 @@ int QueueAllFramesUpdating(BYTE queue) }
int FindFrameID(HWND FrameHwnd)
{
- FRAMEWND * frm=NULL;
+ FRAMEWND * frm = NULL;
if (FrameHwnd == NULL ) return 0;
- frm=FindFrameByItsHWND(FrameHwnd);
+ frm = FindFrameByItsHWND(FrameHwnd);
if (frm)
return frm->id;
else return 0;
@@ -342,9 +342,9 @@ FRAMEWND * FindFrameByItsHWND(HWND FrameHwnd) {
int i;
if ( FrameHwnd == NULL ) return( NULL );
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
- if (g_pfwFrames[i].hWnd==FrameHwnd){return(&g_pfwFrames[i]);};
+ if (g_pfwFrames[i].hWnd == FrameHwnd){return(&g_pfwFrames[i]);};
};
return NULL;
}
@@ -353,8 +353,8 @@ static void DockThumbs( FRAMEWND *pThumbLeft, FRAMEWND *pThumbRight, BOOL bMoveL {
if ( ( pThumbRight->dockOpt.hwndLeft == NULL ) && ( pThumbLeft->dockOpt.hwndRight == NULL ))
{
- pThumbRight->dockOpt.hwndLeft = pThumbLeft->ContainerWnd;
- pThumbLeft->dockOpt.hwndRight = pThumbRight->ContainerWnd;
+ pThumbRight->dockOpt.hwndLeft = pThumbLeft->ContainerWnd;
+ pThumbLeft->dockOpt.hwndRight = pThumbRight->ContainerWnd;
}
}
@@ -388,8 +388,8 @@ static void UndockThumbs( FRAMEWND *pThumb1, FRAMEWND *pThumb2 ) }
static void PositionThumb( FRAMEWND *pThumb, short nX, short nY )
{
- FRAMEWND *pCurThumb = &g_pfwFrames[0];
- FRAMEWND *pDockThumb = pThumb;
+ FRAMEWND *pCurThumb = &g_pfwFrames[0];
+ FRAMEWND *pDockThumb = pThumb;
FRAMEWND fakeMainWindow;
FRAMEWND fakeTaskBarWindow;
RECT rc;
@@ -398,7 +398,7 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) SIZE sizeScreen;
int nNewX;
int nNewY;
- int nOffs = 10;
+ int nOffs = 10;
int nWidth;
int nHeight;
POINT pt;
@@ -410,7 +410,7 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) BOOL bDockedLeft;
BOOL bDockedRight;
BOOL bLeading;
- int frmidx=0;
+ int frmidx = 0;
if ( pThumb == NULL ) return;
@@ -419,7 +419,7 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) // Get thumb dimnsions
GetWindowRect( pThumb->ContainerWnd, &rcThumb );
- nWidth = rcThumb.right - rcThumb.left;
+ nWidth = rcThumb.right - rcThumb.left;
nHeight = rcThumb.bottom - rcThumb.top;
// Docking to the edges of the screen
@@ -428,7 +428,7 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) nNewY = nY < nOffs ? 0 : nY;
nNewY = nNewY > ( sizeScreen.cy - nHeight - nOffs ) ? ( sizeScreen.cy - nHeight ) : nNewY;
- bLeading = pThumb->dockOpt.hwndRight != NULL;
+ bLeading = pThumb->dockOpt.hwndRight !=NULL;
if ( bMoveTogether )
{
@@ -437,19 +437,19 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) }
memset(&fakeMainWindow,0,sizeof(fakeMainWindow));
- fakeMainWindow.ContainerWnd=pcli->hwndContactList;
- fakeMainWindow.floating=TRUE;
+ fakeMainWindow.ContainerWnd = pcli->hwndContactList;
+ fakeMainWindow.floating = TRUE;
memset(&fakeTaskBarWindow,0,sizeof(fakeTaskBarWindow));
- fakeTaskBarWindow.ContainerWnd=hWndExplorerToolBar;
- fakeTaskBarWindow.floating=TRUE;
+ fakeTaskBarWindow.ContainerWnd = hWndExplorerToolBar;
+ fakeTaskBarWindow.floating = TRUE;
- while( pCurThumb != NULL )
+ while( pCurThumb !=NULL )
{
if (pCurThumb->floating) {
- if ( pCurThumb != pThumb )
+ if ( pCurThumb !=pThumb )
{
GetWindowRect( pThumb->ContainerWnd, &rcThumb );
OffsetRect( &rcThumb, nX - rcThumb.left, nY - rcThumb.top );
@@ -458,38 +458,38 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) // These are rects we will dock into
- rcLeft.left = rc.left - nOffs;
- rcLeft.top = rc.top - nOffs;
- rcLeft.right = rc.left + nOffs;
- rcLeft.bottom = rc.bottom + nOffs;
+ rcLeft.left = rc.left - nOffs;
+ rcLeft.top = rc.top - nOffs;
+ rcLeft.right = rc.left + nOffs;
+ rcLeft.bottom = rc.bottom + nOffs;
- rcTop.left = rc.left - nOffs;
- rcTop.top = rc.top - nOffs;
- rcTop.right = rc.right + nOffs;
- rcTop.bottom = rc.top + nOffs;
+ rcTop.left = rc.left - nOffs;
+ rcTop.top = rc.top - nOffs;
+ rcTop.right = rc.right + nOffs;
+ rcTop.bottom = rc.top + nOffs;
- rcRight.left = rc.right - nOffs;
- rcRight.top = rc.top - nOffs;
- rcRight.right = rc.right + nOffs;
- rcRight.bottom = rc.bottom + nOffs;
+ rcRight.left = rc.right - nOffs;
+ rcRight.top = rc.top - nOffs;
+ rcRight.right = rc.right + nOffs;
+ rcRight.bottom = rc.bottom + nOffs;
- rcBottom.left = rc.left - nOffs;
- rcBottom.top = rc.bottom - nOffs;
- rcBottom.right = rc.right + nOffs;
+ rcBottom.left = rc.left - nOffs;
+ rcBottom.top = rc.bottom - nOffs;
+ rcBottom.right = rc.right + nOffs;
rcBottom.bottom = rc.bottom + nOffs;
- bDockedLeft = FALSE;
- bDockedRight = FALSE;
+ bDockedLeft = FALSE;
+ bDockedRight = FALSE;
// Upper-left
- pt.x = rcThumb.left;
- pt.y = rcThumb.top;
- bDocked = FALSE;
+ pt.x = rcThumb.left;
+ pt.y = rcThumb.top;
+ bDocked = FALSE;
if ( PtInRect( &rcRight, pt ))
{
- nNewX = rc.right;
+ nNewX = rc.right;
bDocked = TRUE;
}
@@ -505,21 +505,21 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) if ( PtInRect( &rcTop, pt ))
{
- nNewY = rc.top;
- bDockedLeft = bDocked;
+ nNewY = rc.top;
+ bDockedLeft = bDocked;
}
// Upper-right
- pt.x = rcThumb.right;
- pt.y = rcThumb.top;
- bDocked = FALSE;
+ pt.x = rcThumb.right;
+ pt.y = rcThumb.top;
+ bDocked = FALSE;
if ( !bLeading && PtInRect( &rcLeft, pt ))
{
if ( !bDockedLeft )
{
- nNewX = rc.left - nWidth;
- bDocked = TRUE;
+ nNewX = rc.left - nWidth;
+ bDocked = TRUE;
}
else if ( rc.right == rcThumb.left )
{
@@ -540,8 +540,8 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) if ( !bLeading && PtInRect( &rcTop, pt ))
{
- nNewY = rc.top;
- bDockedRight = bDocked;
+ nNewY = rc.top;
+ bDockedRight = bDocked;
}
if ( bMoveTogether )
@@ -599,11 +599,11 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY ) };
frmidx++;
- if (pCurThumb->ContainerWnd==fakeTaskBarWindow.ContainerWnd){break;};
- if (pCurThumb->ContainerWnd==fakeMainWindow.ContainerWnd){
- pCurThumb=&fakeTaskBarWindow;continue;};
- if (frmidx==g_nFramesCount){
- pCurThumb=&fakeMainWindow;continue;
+ if (pCurThumb->ContainerWnd == fakeTaskBarWindow.ContainerWnd){break;};
+ if (pCurThumb->ContainerWnd == fakeMainWindow.ContainerWnd){
+ pCurThumb = &fakeTaskBarWindow;continue;};
+ if (frmidx == g_nFramesCount){
+ pCurThumb = &fakeMainWindow;continue;
}
pCurThumb = &g_pfwFrames[frmidx];
@@ -643,32 +643,32 @@ static void GetBorderSize(HWND hwnd,RECT *rect) {
RECT wr,cr;
POINT pt1,pt2;
- // RECT r={0};
- // *rect=r;
+ // RECT r = {0};
+ // *rect = r;
// return;
GetWindowRect(hwnd,&wr);
GetClientRect(hwnd,&cr);
- pt1.y=cr.top;pt1.x=cr.left;
- pt2.y=cr.bottom;pt2.x=cr.right;
+ pt1.y = cr.top;pt1.x = cr.left;
+ pt2.y = cr.bottom;pt2.x = cr.right;
ClientToScreen(hwnd,&pt1);
ClientToScreen(hwnd,&pt2);
- cr.top=pt1.y;cr.left=pt1.x;
- cr.bottom=pt2.y;cr.right=pt2.x;
+ cr.top = pt1.y;cr.left = pt1.x;
+ cr.bottom = pt2.y;cr.right = pt2.x;
- rect->top=cr.top-wr.top;
- rect->left=cr.left-wr.left;
- rect->right=wr.right-cr.right;
- rect->bottom=wr.bottom-cr.bottom;
- //if (rect->top+rect->bottom>10){rect->top=rect->bottom=2;};
- //if (rect->left+rect->right>10){rect->top=rect->bottom=2;};
+ rect->top = cr.top-wr.top;
+ rect->left = cr.left-wr.left;
+ rect->right = wr.right-cr.right;
+ rect->bottom = wr.bottom-cr.bottom;
+ //if (rect->top+rect->bottom>10){rect->top = rect->bottom = 2;};
+ //if (rect->left+rect->right>10){rect->top = rect->bottom = 2;};
};
static char __inline *AS(char *str,const char *setting,char *addstr)
{
- if(str!=NULL) {
+ if (str != NULL) {
strcpy(str,setting);
strcat(str,addstr);
}
@@ -685,25 +685,25 @@ static int DBLoadFrameSettingsAtPos(int pos,int Frameid) //DBWriteContactSettingString(0,CLUIFrameModule,strcat("Name",sadd),Frames[Frameid].name);
//boolean
- g_pfwFrames[Frameid].collapsed=db_get_b(0,CLUIFrameModule,AS(buf,"Collapse",sadd),g_pfwFrames[Frameid].collapsed);
+ 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);
- g_pfwFrames[Frameid].visible =db_get_b(0,CLUIFrameModule,AS(buf,"Visible",sadd),g_pfwFrames[Frameid].visible);
- g_pfwFrames[Frameid].TitleBar.ShowTitleBar =db_get_b(0,CLUIFrameModule,AS(buf,"TBVisile",sadd),g_pfwFrames[Frameid].TitleBar.ShowTitleBar);
+ g_pfwFrames[Frameid].Locked = db_get_b(0,CLUIFrameModule,AS(buf,"Locked",sadd),g_pfwFrames[Frameid].Locked);
+ g_pfwFrames[Frameid].visible = db_get_b(0,CLUIFrameModule,AS(buf,"Visible",sadd),g_pfwFrames[Frameid].visible);
+ g_pfwFrames[Frameid].TitleBar.ShowTitleBar = db_get_b(0,CLUIFrameModule,AS(buf,"TBVisile",sadd),g_pfwFrames[Frameid].TitleBar.ShowTitleBar);
- g_pfwFrames[Frameid].height =db_get_w(0,CLUIFrameModule,AS(buf,"Height",sadd),g_pfwFrames[Frameid].height);
- g_pfwFrames[Frameid].HeightWhenCollapsed =db_get_w(0,CLUIFrameModule,AS(buf,"HeightCollapsed",sadd),0);
- g_pfwFrames[Frameid].align =db_get_w(0,CLUIFrameModule,AS(buf,"Align",sadd),g_pfwFrames[Frameid].align);
+ g_pfwFrames[Frameid].height = db_get_w(0,CLUIFrameModule,AS(buf,"Height",sadd),g_pfwFrames[Frameid].height);
+ g_pfwFrames[Frameid].HeightWhenCollapsed = db_get_w(0,CLUIFrameModule,AS(buf,"HeightCollapsed",sadd),0);
+ g_pfwFrames[Frameid].align = db_get_w(0,CLUIFrameModule,AS(buf,"Align",sadd),g_pfwFrames[Frameid].align);
- g_pfwFrames[Frameid].FloatingPos.x =DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatX",sadd),100,0,2048);
- g_pfwFrames[Frameid].FloatingPos.y =DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatY",sadd),100,0,2048);
- g_pfwFrames[Frameid].FloatingSize.x =DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatW",sadd),100,0,2048);
- g_pfwFrames[Frameid].FloatingSize.y =DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatH",sadd),100,0,2048);
+ g_pfwFrames[Frameid].FloatingPos.x = DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatX",sadd),100,0,2048);
+ g_pfwFrames[Frameid].FloatingPos.y = DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatY",sadd),100,0,2048);
+ g_pfwFrames[Frameid].FloatingSize.x = DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatW",sadd),100,0,2048);
+ g_pfwFrames[Frameid].FloatingSize.y = DBGetContactSettingRangedWord(0,CLUIFrameModule,AS(buf,"FloatH",sadd),100,0,2048);
- g_pfwFrames[Frameid].floating =db_get_b(0,CLUIFrameModule,AS(buf,"Floating",sadd),0);
- g_pfwFrames[Frameid].order =db_get_w(0,CLUIFrameModule,AS(buf,"Order",sadd),0);
+ g_pfwFrames[Frameid].floating = db_get_b(0,CLUIFrameModule,AS(buf,"Floating",sadd),0);
+ g_pfwFrames[Frameid].order = db_get_w(0,CLUIFrameModule,AS(buf,"Order",sadd),0);
- g_pfwFrames[Frameid].UseBorder =db_get_b(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),g_pfwFrames[Frameid].UseBorder);
+ g_pfwFrames[Frameid].UseBorder = db_get_b(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),g_pfwFrames[Frameid].UseBorder);
return 0;
}
@@ -740,18 +740,18 @@ static int DBStoreFrameSettingsAtPos(int pos,int Frameid) static int LocateStorePosition(int Frameid,int maxstored)
{
- if(g_pfwFrames[Frameid].Name==NULL)
+ if (g_pfwFrames[Frameid].Name == NULL)
return -1;
char settingname[255];
- for ( int i=0;i<maxstored;i++)
+ for ( int i = 0;i < maxstored;i++)
{
mir_snprintf(settingname,SIZEOF(settingname),"Name%d",i);
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if ( DBGetContactSettingTString( NULL, CLUIFrameModule, settingname, &dbv ))
continue;
- if ( lstrcmpi( dbv.ptszVal, g_pfwFrames[Frameid].Name ) ==0 )
+ if ( lstrcmpi( dbv.ptszVal, g_pfwFrames[Frameid].Name ) == 0 )
{
db_free( &dbv );
return i;
@@ -767,13 +767,13 @@ static int CLUIFramesLoadFrameSettings(int Frameid) if (_fCluiFramesModuleNotStarted) return -1;
- if(Frameid<0||Frameid>=g_nFramesCount) return -1;
+ if (Frameid < 0||Frameid >= g_nFramesCount) return -1;
- maxstored=db_get_w(0,CLUIFrameModule,"StoredFrames",-1);
- if(maxstored==-1) return 0;
+ maxstored = db_get_w(0,CLUIFrameModule,"StoredFrames",-1);
+ if (maxstored == -1) return 0;
- storpos=LocateStorePosition(Frameid,maxstored);
- if(storpos==-1) return 0;
+ storpos = LocateStorePosition(Frameid,maxstored);
+ if (storpos == -1) return 0;
DBLoadFrameSettingsAtPos(storpos,Frameid);
return 0;
@@ -785,13 +785,13 @@ static int CLUIFramesStoreFrameSettings(int Frameid) if (_fCluiFramesModuleNotStarted) return -1;
- if(Frameid<0||Frameid>=g_nFramesCount) return -1;
+ if (Frameid < 0||Frameid >= g_nFramesCount) return -1;
- maxstored=db_get_w(0,CLUIFrameModule,"StoredFrames",-1);
- if(maxstored==-1) maxstored=0;
+ maxstored = db_get_w(0,CLUIFrameModule,"StoredFrames",-1);
+ if (maxstored == -1) maxstored = 0;
- storpos=LocateStorePosition(Frameid,maxstored);
- if(storpos==-1) {storpos=maxstored; maxstored++;}
+ storpos = LocateStorePosition(Frameid,maxstored);
+ if (storpos == -1) {storpos = maxstored; maxstored++;}
DBStoreFrameSettingsAtPos(storpos,Frameid);
db_set_w(0,CLUIFrameModule,"StoredFrames",(WORD)maxstored);
@@ -803,7 +803,7 @@ static int CLUIFramesStoreAllFrames() {
int i;
if (_fCluiFramesModuleNotStarted) return -1;
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
CLUIFramesStoreFrameSettings(i);
return 0;
}
@@ -813,19 +813,19 @@ static int CLUIFramesGetalClientFrame(void) int i;
if (_fCluiFramesModuleNotStarted) return -1;
- if ( _nClientFrameId != eUnknownId ) {
+ if ( _nClientFrameId !=eUnknownId ) {
/* this value could become invalid if RemoveItemFromList was called,
* so we double-check */
- if (_nClientFrameId<g_nFramesCount) {
- if(g_pfwFrames[_nClientFrameId].align==alClient) {
+ if (_nClientFrameId < g_nFramesCount) {
+ if (g_pfwFrames[_nClientFrameId].align == alClient) {
return _nClientFrameId;
}
}
}
- for(i=0;i<g_nFramesCount;i++)
- if(g_pfwFrames[i].align==alClient) {
- _nClientFrameId=i;
+ for(i = 0;i < g_nFramesCount;i++)
+ if (g_pfwFrames[i].align == alClient) {
+ _nClientFrameId = i;
return i;
}
return -1;
@@ -835,164 +835,164 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGEN {
//TMO_MenuItem tmi;
HGENMENU menuid;
- int framepos=id2pos(frameid);
+ int framepos = id2pos(frameid);
if (_fCluiFramesModuleNotStarted)
return NULL;
CLISTMENUITEM mi = { 0 };
- mi.cbSize=sizeof(mi);
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.pszPopupName=(char *)root;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Visible");
- mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
- mi.pszContactOwner=(char *)0;
- mi.pszService=MS_CLIST_FRAMES_SHFRAME;
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.pszPopupName = (char *)root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Visible");
+ mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
+ mi.pszContactOwner = (char *)0;
+ mi.pszService = MS_CLIST_FRAMES_SHFRAME;
menuid = pfnAdd(&mi);
- if(frameid==-1) _hmiVisible=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIVisible=menuid;
-
- popuppos+=100000;
-
- mi.pszPopupName=(char *)root;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Show title");
- mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
- mi.pszService=MS_CLIST_FRAMES_SHFRAMETITLEBAR;
- mi.pszContactOwner=(char *)0;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiTBVisible=menuid;
- else g_pfwFrames[framepos].MenuHandles.MITBVisible=menuid;
-
- mi.pszPopupName=(char *)root;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Locked");
- mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
- mi.pszService=MS_CLIST_FRAMES_ULFRAME;
- mi.pszContactOwner=(char *)0;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiLock=menuid;
- else g_pfwFrames[framepos].MenuHandles.MILock=menuid;
-
- mi.pszPopupName=(char *)root;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Expanded");
- mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
- mi.pszService=MS_CLIST_FRAMES_UCOLLFRAME;
- mi.pszContactOwner=(char *)0;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiColl=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIColl=menuid;
+ if (frameid == -1) _hmiVisible = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIVisible = menuid;
+
+ popuppos += 100000;
+
+ mi.pszPopupName = (char *)root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Show title");
+ mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
+ mi.pszService = MS_CLIST_FRAMES_SHFRAMETITLEBAR;
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiTBVisible = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MITBVisible = menuid;
+
+ mi.pszPopupName = (char *)root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Locked");
+ mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
+ mi.pszService = MS_CLIST_FRAMES_ULFRAME;
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiLock = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MILock = menuid;
+
+ mi.pszPopupName = (char *)root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Expanded");
+ mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
+ mi.pszService = MS_CLIST_FRAMES_UCOLLFRAME;
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiColl = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIColl = menuid;
//floating
- mi.pszPopupName=(char *)root;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Floating Mode");
- mi.flags=CMIF_CHILDPOPUP;
- mi.pszService="Set_Floating";
- mi.pszContactOwner=(char *)0;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiFloating=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIFloating=menuid;
-
- mi.pszPopupName=(char *)root;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Border");
- mi.flags=CMIF_CHILDPOPUP|CMIF_CHECKED;
- mi.pszService=MS_CLIST_FRAMES_SETUNBORDER;
- mi.pszContactOwner=(char *)0;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiBorder=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIBorder=menuid;
-
- popuppos+=100000;
+ mi.pszPopupName = (char *)root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Floating Mode");
+ mi.flags = CMIF_CHILDPOPUP;
+ mi.pszService = "Set_Floating";
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiFloating = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIFloating = menuid;
+
+ mi.pszPopupName = (char *)root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Border");
+ mi.flags = CMIF_CHILDPOPUP|CMIF_CHECKED;
+ mi.pszService = MS_CLIST_FRAMES_SETUNBORDER;
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiBorder = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIBorder = menuid;
+
+ popuppos += 100000;
{
//alignment root
- mi.pszPopupName=(char *)root;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Align");
- mi.flags=CMIF_CHILDPOPUP|CMIF_ROOTPOPUP;
- mi.pszService="";
- mi.pszContactOwner=(char *)0;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiAlignRoot=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIAlignRoot=menuid;
-
- mi.flags=CMIF_CHILDPOPUP;
+ mi.pszPopupName = (char *)root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Align");
+ mi.flags = CMIF_CHILDPOPUP|CMIF_ROOTPOPUP;
+ mi.pszService = "";
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiAlignRoot = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIAlignRoot = menuid;
+
+ mi.flags = CMIF_CHILDPOPUP;
//align top
- mi.pszPopupName=(char *)menuid;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Top");
- mi.pszService=CLUIFRAMESSETALIGNALTOP;
- mi.pszContactOwner=(char *)alTop;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiAlignTop=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIAlignTop=menuid;
+ mi.pszPopupName = (char *)menuid;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Top");
+ mi.pszService = CLUIFRAMESSETALIGNALTOP;
+ mi.pszContactOwner = (char *)alTop;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiAlignTop = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIAlignTop = menuid;
//align client
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Client");
- mi.pszService=CLUIFRAMESSETALIGNALCLIENT;
- mi.pszContactOwner=(char *)alClient;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiAlignClient=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIAlignClient=menuid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Client");
+ mi.pszService = CLUIFRAMESSETALIGNALCLIENT;
+ mi.pszContactOwner = (char *)alClient;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiAlignClient = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIAlignClient = menuid;
//align bottom
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Bottom");
- mi.pszService=CLUIFRAMESSETALIGNALBOTTOM;
- mi.pszContactOwner=(char *)alBottom;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiAlignBottom=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIAlignBottom=menuid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Bottom");
+ mi.pszService = CLUIFRAMESSETALIGNALBOTTOM;
+ mi.pszContactOwner = (char *)alBottom;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiAlignBottom = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIAlignBottom = menuid;
}
{ //position
//position root
- mi.pszPopupName=(char *)root;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Position");
- mi.flags=CMIF_CHILDPOPUP|CMIF_ROOTPOPUP;
- mi.pszService="";
- mi.pszContactOwner=(char *)0;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiPosRoot=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIPosRoot=menuid;
+ mi.pszPopupName = (char *)root;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Position");
+ mi.flags = CMIF_CHILDPOPUP|CMIF_ROOTPOPUP;
+ mi.pszService = "";
+ mi.pszContactOwner = (char *)0;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiPosRoot = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIPosRoot = menuid;
//??????
- mi.pszPopupName=(char *)menuid;
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Up");
- mi.flags=CMIF_CHILDPOPUP;
- mi.pszService=CLUIFRAMESMOVEUP;
- mi.pszContactOwner=(char *)1;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiPosUp=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIPosUp=menuid;
-
- mi.popupPosition=frameid;
- mi.position=popuppos++;
- mi.pszName=LPGEN("&Down");
- mi.flags=CMIF_CHILDPOPUP;
- mi.pszService=CLUIFRAMESMOVEDOWN;
- mi.pszContactOwner=(char *)-1;
- menuid=pfnAdd(&mi);
- if(frameid==-1) _hmiPosDown=menuid;
- else g_pfwFrames[framepos].MenuHandles.MIPosDown=menuid;
+ mi.pszPopupName = (char *)menuid;
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Up");
+ mi.flags = CMIF_CHILDPOPUP;
+ mi.pszService = CLUIFRAMESMOVEUP;
+ mi.pszContactOwner = (char *)1;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiPosUp = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIPosUp = menuid;
+
+ mi.popupPosition = frameid;
+ mi.position = popuppos++;
+ mi.pszName = LPGEN("&Down");
+ mi.flags = CMIF_CHILDPOPUP;
+ mi.pszService = CLUIFRAMESMOVEDOWN;
+ mi.pszContactOwner = (char *)-1;
+ menuid = pfnAdd(&mi);
+ if (frameid == -1) _hmiPosDown = menuid;
+ else g_pfwFrames[framepos].MenuHandles.MIPosDown = menuid;
}
@@ -1014,48 +1014,48 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam) /* HOOK */
if (MirandaExiting()) return 0;
if (_fCluiFramesModuleNotStarted) return -1;
- pos=id2pos(wParam);
- if(pos>=0&&pos<g_nFramesCount) {
+ pos = id2pos(wParam);
+ if (pos >= 0&&pos < g_nFramesCount) {
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.flags=CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
- if(g_pfwFrames[pos].visible) mi.flags|=CMIF_CHECKED;
- mi.ptszName=g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
+ if (g_pfwFrames[pos].visible) mi.flags |= CMIF_CHECKED;
+ mi.ptszName = g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
ModifyMItem((WPARAM)_hmiVisible,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].Locked) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].Locked) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)_hmiLock,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].TitleBar.ShowTitleBar) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)_hmiTBVisible,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].floating) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].floating) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)_hmiFloating,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if ( g_CluiData.fLayered ) mi.flags|=CMIF_GRAYED;
- else if ((g_pfwFrames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if ( g_CluiData.fLayered ) mi.flags |= CMIF_GRAYED;
+ else if ((g_pfwFrames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)_hmiBorder,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].align&alTop) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)_hmiAlignTop,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].align&alClient) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)_hmiAlignClient,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].align&alBottom) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)_hmiAlignBottom,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].collapsed) mi.flags|=CMIF_CHECKED;
- if ((!g_pfwFrames[pos].visible)||(g_pfwFrames[pos].Locked)||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].collapsed) mi.flags |= CMIF_CHECKED;
+ if ((!g_pfwFrames[pos].visible)||(g_pfwFrames[pos].Locked)||(pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
ModifyMItem((WPARAM)_hmiColl,(LPARAM)&mi);
}
return 0;
@@ -1063,7 +1063,7 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam,LPARAM lParam) static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam)
{
- //hiword(wParam)=frameid,loword(wParam)=flag
+ //hiword(wParam) = frameid,loword(wParam) = flag
int pos;
CLISTMENUITEM mi;
//TMO_MenuItem tmi;
@@ -1071,66 +1071,66 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam,LPARAM lParam) if (_fCluiFramesModuleNotStarted) return -1;
- pos=id2pos(wParam);
+ pos = id2pos(wParam);
- if (pos>=0&&pos<g_nFramesCount) {
+ if (pos >= 0&&pos < g_nFramesCount) {
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.flags=CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
- if(g_pfwFrames[pos].visible) mi.flags|=CMIF_CHECKED;
- mi.ptszName=g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
+ mi.cbSize = sizeof(mi);
+ mi.flags = CMIM_FLAGS|CMIM_NAME|CMIF_CHILDPOPUP|CMIF_TCHAR;
+ if (g_pfwFrames[pos].visible) mi.flags |= CMIF_CHECKED;
+ mi.ptszName = g_pfwFrames[pos].TitleBar.tbname ? g_pfwFrames[pos].TitleBar.tbname : g_pfwFrames[pos].Name;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIVisible,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].Locked) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].Locked) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MILock,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].TitleBar.ShowTitleBar) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].TitleBar.ShowTitleBar) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MITBVisible,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].floating) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].floating) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIFloating,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
- if ( g_CluiData.fLayered ) mi.flags|=CMIF_GRAYED;
- else if ((g_pfwFrames[pos].UseBorder)) mi.flags|=CMIF_CHECKED;
+ if ( g_CluiData.fLayered ) mi.flags |= CMIF_GRAYED;
+ else if ((g_pfwFrames[pos].UseBorder)) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIBorder,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
- if(g_pfwFrames[pos].align&alTop) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
+ if (g_pfwFrames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignTop,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].align&alClient) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignClient,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
- if(g_pfwFrames[pos].align&alBottom) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((g_pfwFrames[pos].align&alClient)?CMIF_GRAYED:0);
+ if (g_pfwFrames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIAlignBottom,(LPARAM)&mi);
/*
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
- if(Frames[pos].align&alTop) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
+ if (Frames[pos].align&alTop) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIAlignTop,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP|CMIF_GRAYED;
- if(Frames[pos].align&alClient) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|CMIF_GRAYED;
+ if (Frames[pos].align&alClient) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIAlignClient,(LPARAM)&mi);
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
- if(Frames[pos].align&alBottom) mi.flags|=CMIF_CHECKED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP|((Frames[pos].align&alClient)?CMIF_GRAYED:0);
+ if (Frames[pos].align&alBottom) mi.flags |= CMIF_CHECKED;
ModifyMItem((WPARAM)contMIAlignBottom,(LPARAM)&mi);
*/
- mi.flags=CMIM_FLAGS|CMIF_CHILDPOPUP;
- if(g_pfwFrames[pos].collapsed) mi.flags|=CMIF_CHECKED;
- if ((!g_pfwFrames[pos].visible)||g_pfwFrames[pos].Locked||(pos==CLUIFramesGetalClientFrame())) mi.flags|=CMIF_GRAYED;
+ mi.flags = CMIM_FLAGS|CMIF_CHILDPOPUP;
+ if (g_pfwFrames[pos].collapsed) mi.flags |= CMIF_CHECKED;
+ if ((!g_pfwFrames[pos].visible)||g_pfwFrames[pos].Locked||(pos == CLUIFramesGetalClientFrame())) mi.flags |= CMIF_GRAYED;
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)g_pfwFrames[pos].MenuHandles.MIColl,(LPARAM)&mi);
}
@@ -1142,14 +1142,14 @@ static INT_PTR _us_DoGetFrameOptions(WPARAM wParam,LPARAM lParam) {
int pos;
INT_PTR retval;
- BOOL bUnicodeText=(LOWORD(wParam) & FO_UNICODETEXT)!=0;
- wParam=MAKEWPARAM((LOWORD(wParam)) & ~FO_UNICODETEXT, HIWORD(wParam));
+ BOOL bUnicodeText = (LOWORD(wParam) & FO_UNICODETEXT) != 0;
+ wParam = MAKEWPARAM((LOWORD(wParam)) & ~FO_UNICODETEXT, HIWORD(wParam));
if (_fCluiFramesModuleNotStarted) return -1;
- pos=id2pos(HIWORD(wParam));
- if(pos<0||pos>=g_nFramesCount) {
+ pos = id2pos(HIWORD(wParam));
+ if (pos < 0||pos >= g_nFramesCount) {
return -1;
}
@@ -1157,67 +1157,67 @@ static INT_PTR _us_DoGetFrameOptions(WPARAM wParam,LPARAM lParam) switch(LOWORD(wParam))
{
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].Locked) retval|=F_LOCKED;
- if(g_pfwFrames[pos].TitleBar.ShowTitleBar) retval|=F_SHOWTB;
- if(g_pfwFrames[pos].TitleBar.ShowTitleBarTip) retval|=F_SHOWTBTIP;
+ retval = 0;
+ if (g_pfwFrames[pos].visible) retval |= F_VISIBLE;
+ 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 (!(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;
case FO_NAME:
if (bUnicodeText)
- retval=(INT_PTR)g_pfwFrames[pos].Name;
+ retval = (INT_PTR)g_pfwFrames[pos].Name;
else
- retval=(INT_PTR)g_pfwFrames[pos].szName;
+ retval = (INT_PTR)g_pfwFrames[pos].szName;
break;
case FO_TBNAME:
if (bUnicodeText)
- retval=(INT_PTR)g_pfwFrames[pos].TitleBar.tbname;
+ retval = (INT_PTR)g_pfwFrames[pos].TitleBar.tbname;
else
- retval=(INT_PTR)g_pfwFrames[pos].TitleBar.sztbname;
+ retval = (INT_PTR)g_pfwFrames[pos].TitleBar.sztbname;
break;
case FO_TBTIPNAME:
if (bUnicodeText)
- retval=(INT_PTR)g_pfwFrames[pos].TitleBar.tooltip;
+ retval = (INT_PTR)g_pfwFrames[pos].TitleBar.tooltip;
else
- retval=(INT_PTR)g_pfwFrames[pos].TitleBar.sztooltip;
+ retval = (INT_PTR)g_pfwFrames[pos].TitleBar.sztooltip;
break;
case FO_TBSTYLE:
- retval=GetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_STYLE);
+ retval = GetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_STYLE);
break;
case FO_TBEXSTYLE:
- retval=GetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_EXSTYLE);
+ retval = GetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_EXSTYLE);
break;
case FO_ICON:
- retval=(INT_PTR)g_pfwFrames[pos].TitleBar.hicon;
+ retval = (INT_PTR)g_pfwFrames[pos].TitleBar.hicon;
break;
case FO_HEIGHT:
- retval=(INT_PTR)g_pfwFrames[pos].height;
+ retval = (INT_PTR)g_pfwFrames[pos].height;
break;
case FO_ALIGN:
- retval=(INT_PTR)g_pfwFrames[pos].align;
+ retval = (INT_PTR)g_pfwFrames[pos].align;
break;
case FO_FLOATING:
- retval=(INT_PTR)g_pfwFrames[pos].floating;
+ retval = (INT_PTR)g_pfwFrames[pos].floating;
break;
default:
- retval=-1;
+ retval = -1;
break;
}
@@ -1230,28 +1230,28 @@ static int UpdateTBToolTip(int framepos) TOOLINFO ti;
ZeroMemory(&ti,sizeof(ti));
- ti.cbSize=sizeof(ti);
- ti.lpszText=g_pfwFrames[framepos].TitleBar.tooltip;
- ti.hinst=g_hInst;
- ti.uFlags=TTF_IDISHWND|TTF_SUBCLASS ;
- ti.uId=(UINT_PTR)g_pfwFrames[framepos].TitleBar.hwnd;
+ ti.cbSize = sizeof(ti);
+ ti.lpszText = g_pfwFrames[framepos].TitleBar.tooltip;
+ ti.hinst = g_hInst;
+ ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS ;
+ ti.uId = (UINT_PTR)g_pfwFrames[framepos].TitleBar.hwnd;
return(SendMessage(g_pfwFrames[framepos].TitleBar.hwndTip,TTM_UPDATETIPTEXT ,(WPARAM)0,(LPARAM)&ti));
}
};
-//hiword(wParam)=frameid,loword(wParam)=flag
+//hiword(wParam) = frameid,loword(wParam) = flag
static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
{
int pos;
int retval; // value to be returned
- BOOL bUnicodeText=(LOWORD(wParam) & FO_UNICODETEXT)!=0;
- wParam=MAKEWPARAM((LOWORD(wParam))& ~FO_UNICODETEXT, HIWORD(wParam));
+ BOOL bUnicodeText = (LOWORD(wParam) & FO_UNICODETEXT) != 0;
+ wParam = MAKEWPARAM((LOWORD(wParam))& ~FO_UNICODETEXT, HIWORD(wParam));
if (_fCluiFramesModuleNotStarted) return -1;
- pos=id2pos(HIWORD(wParam));
- if(pos<0||pos>=g_nFramesCount) {
+ pos = id2pos(HIWORD(wParam));
+ if (pos < 0||pos >= g_nFramesCount) {
return -1;
}
@@ -1259,34 +1259,34 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) switch(LOWORD(wParam))
{
case FO_FLAGS:{
- int flag=lParam;
+ int flag = lParam;
int style;
- g_pfwFrames[pos].dwFlags=flag;
- g_pfwFrames[pos].visible=FALSE;
- if(flag&F_VISIBLE) g_pfwFrames[pos].visible=TRUE;
+ g_pfwFrames[pos].dwFlags = flag;
+ g_pfwFrames[pos].visible = FALSE;
+ if (flag&F_VISIBLE) g_pfwFrames[pos].visible = TRUE;
- g_pfwFrames[pos].collapsed=TRUE;
- if(flag&F_UNCOLLAPSED) g_pfwFrames[pos].collapsed=FALSE;
+ g_pfwFrames[pos].collapsed = TRUE;
+ if (flag&F_UNCOLLAPSED) g_pfwFrames[pos].collapsed = FALSE;
- g_pfwFrames[pos].Locked=FALSE;
- if(flag&F_LOCKED) g_pfwFrames[pos].Locked=TRUE;
+ g_pfwFrames[pos].Locked = FALSE;
+ if (flag&F_LOCKED) g_pfwFrames[pos].Locked = TRUE;
- g_pfwFrames[pos].UseBorder=TRUE;
- if(flag&F_NOBORDER) g_pfwFrames[pos].UseBorder=FALSE;
+ g_pfwFrames[pos].UseBorder = TRUE;
+ if (flag&F_NOBORDER) g_pfwFrames[pos].UseBorder = FALSE;
- g_pfwFrames[pos].TitleBar.ShowTitleBar=FALSE;
- if(flag&F_SHOWTB) g_pfwFrames[pos].TitleBar.ShowTitleBar=TRUE;
+ g_pfwFrames[pos].TitleBar.ShowTitleBar = FALSE;
+ if (flag&F_SHOWTB) g_pfwFrames[pos].TitleBar.ShowTitleBar = TRUE;
- g_pfwFrames[pos].TitleBar.ShowTitleBarTip=FALSE;
- if(flag&F_SHOWTBTIP) g_pfwFrames[pos].TitleBar.ShowTitleBarTip=TRUE;
+ g_pfwFrames[pos].TitleBar.ShowTitleBarTip = FALSE;
+ if (flag&F_SHOWTBTIP) g_pfwFrames[pos].TitleBar.ShowTitleBarTip = TRUE;
SendMessageA(g_pfwFrames[pos].TitleBar.hwndTip,TTM_ACTIVATE,(WPARAM)g_pfwFrames[pos].TitleBar.ShowTitleBarTip,0);
- style=(int)GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE);
- style&=(~WS_BORDER);
+ style = (int)GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE);
+ style &= (~WS_BORDER);
- if ( !(flag&F_NOBORDER ) && !g_CluiData.fLayered ) style|=WS_BORDER;
+ if ( !(flag&F_NOBORDER ) && !g_CluiData.fLayered ) style |= WS_BORDER;
SetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE,(long)style);
SetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_STYLE,(long)style& ~(WS_VSCROLL | WS_HSCROLL));
@@ -1297,53 +1297,53 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) }
case FO_NAME:
- if(lParam==(LPARAM)NULL) { return -1;}
- if(g_pfwFrames[pos].Name!=NULL) mir_free(g_pfwFrames[pos].Name);
- if(g_pfwFrames[pos].szName!=NULL) mir_free(g_pfwFrames[pos].szName);
+ if (lParam == (LPARAM)NULL) { return -1;}
+ if (g_pfwFrames[pos].Name != NULL) mir_free(g_pfwFrames[pos].Name);
+ if (g_pfwFrames[pos].szName != NULL) mir_free(g_pfwFrames[pos].szName);
if (bUnicodeText)
{
- g_pfwFrames[pos].Name=mir_tstrdup((LPTSTR)lParam);
- g_pfwFrames[pos].szName=mir_t2a((LPTSTR)lParam);
+ g_pfwFrames[pos].Name = mir_tstrdup((LPTSTR)lParam);
+ g_pfwFrames[pos].szName = mir_t2a((LPTSTR)lParam);
}
else
{
- g_pfwFrames[pos].szName=mir_strdup((char*)lParam);
- g_pfwFrames[pos].Name=mir_a2t((char *)lParam);
+ g_pfwFrames[pos].szName = mir_strdup((char*)lParam);
+ g_pfwFrames[pos].Name = mir_a2t((char *)lParam);
}
return 0;
case FO_TBNAME:
- if(lParam==(LPARAM)NULL) { return(-1);}
+ if (lParam == (LPARAM)NULL) { return(-1);}
- if(g_pfwFrames[pos].TitleBar.tbname!=NULL) mir_free(g_pfwFrames[pos].TitleBar.tbname);
- if(g_pfwFrames[pos].TitleBar.sztbname!=NULL) mir_free(g_pfwFrames[pos].TitleBar.sztbname);
+ if (g_pfwFrames[pos].TitleBar.tbname != NULL) mir_free(g_pfwFrames[pos].TitleBar.tbname);
+ if (g_pfwFrames[pos].TitleBar.sztbname != NULL) mir_free(g_pfwFrames[pos].TitleBar.sztbname);
if (bUnicodeText)
{
- g_pfwFrames[pos].TitleBar.tbname=mir_tstrdup((LPTSTR)lParam);
- g_pfwFrames[pos].TitleBar.sztbname=mir_t2a((LPTSTR)lParam);
+ g_pfwFrames[pos].TitleBar.tbname = mir_tstrdup((LPTSTR)lParam);
+ g_pfwFrames[pos].TitleBar.sztbname = mir_t2a((LPTSTR)lParam);
}
else
{
- g_pfwFrames[pos].TitleBar.sztbname=mir_strdup((char*)lParam);
- g_pfwFrames[pos].TitleBar.tbname=mir_a2t((char*)lParam);
+ g_pfwFrames[pos].TitleBar.sztbname = mir_strdup((char*)lParam);
+ g_pfwFrames[pos].TitleBar.tbname = mir_a2t((char*)lParam);
}
- if (g_pfwFrames[pos].floating&&(g_pfwFrames[pos].TitleBar.tbname!=NULL)){SetWindowText(g_pfwFrames[pos].ContainerWnd,g_pfwFrames[pos].TitleBar.tbname);};
+ if (g_pfwFrames[pos].floating&&(g_pfwFrames[pos].TitleBar.tbname != NULL)){SetWindowText(g_pfwFrames[pos].ContainerWnd,g_pfwFrames[pos].TitleBar.tbname);};
return 0;
case FO_TBTIPNAME:
- if(lParam==(LPARAM)NULL) { return(-1);}
- if(g_pfwFrames[pos].TitleBar.tooltip!=NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.tooltip);
- if(g_pfwFrames[pos].TitleBar.sztooltip!=NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.sztooltip);
+ if (lParam == (LPARAM)NULL) { return(-1);}
+ if (g_pfwFrames[pos].TitleBar.tooltip != NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.tooltip);
+ if (g_pfwFrames[pos].TitleBar.sztooltip != NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.sztooltip);
if (bUnicodeText)
{
- g_pfwFrames[pos].TitleBar.tooltip=mir_tstrdup((LPTSTR)lParam);
- g_pfwFrames[pos].TitleBar.sztooltip=mir_t2a((LPTSTR)lParam);
+ g_pfwFrames[pos].TitleBar.tooltip = mir_tstrdup((LPTSTR)lParam);
+ g_pfwFrames[pos].TitleBar.sztooltip = mir_t2a((LPTSTR)lParam);
}
else
{
- g_pfwFrames[pos].TitleBar.sztooltip=mir_strdup((char*)lParam);
- g_pfwFrames[pos].TitleBar.tooltip=mir_a2t((char*)lParam);
+ g_pfwFrames[pos].TitleBar.sztooltip = mir_strdup((char*)lParam);
+ g_pfwFrames[pos].TitleBar.tooltip = mir_a2t((char*)lParam);
}
UpdateTBToolTip(pos);
@@ -1360,42 +1360,42 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) return 0;
case FO_ICON:
- g_pfwFrames[pos].TitleBar.hicon=(HICON)lParam;
+ g_pfwFrames[pos].TitleBar.hicon = (HICON)lParam;
return 0;
case FO_HEIGHT:
- if(lParam<0) { return -1;}
+ if (lParam < 0) { return -1;}
if (g_pfwFrames[pos].collapsed)
{
- int oldHeight=g_pfwFrames[pos].height;
- retval=g_pfwFrames[pos].height;
- g_pfwFrames[pos].height=lParam;
- if (!CLUIFramesFitInSize()) g_pfwFrames[pos].height=retval;
- retval=g_pfwFrames[pos].height;
- if (g_pfwFrames[pos].height != oldHeight)
+ int oldHeight = g_pfwFrames[pos].height;
+ retval = g_pfwFrames[pos].height;
+ g_pfwFrames[pos].height = lParam;
+ if (!CLUIFramesFitInSize()) g_pfwFrames[pos].height = retval;
+ retval = g_pfwFrames[pos].height;
+ if (g_pfwFrames[pos].height !=oldHeight)
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
}
else
{
- retval=g_pfwFrames[pos].HeightWhenCollapsed;
- g_pfwFrames[pos].HeightWhenCollapsed=lParam;
- if (!CLUIFramesFitInSize()) g_pfwFrames[pos].HeightWhenCollapsed=retval;
- retval=g_pfwFrames[pos].HeightWhenCollapsed;
+ retval = g_pfwFrames[pos].HeightWhenCollapsed;
+ g_pfwFrames[pos].HeightWhenCollapsed = lParam;
+ if (!CLUIFramesFitInSize()) g_pfwFrames[pos].HeightWhenCollapsed = retval;
+ retval = g_pfwFrames[pos].HeightWhenCollapsed;
}
return retval;
case FO_FLOATING:
- if(lParam<0) { return -1;}
+ if (lParam < 0) { return -1;}
{
- int id=g_pfwFrames[pos].id;
- g_pfwFrames[pos].floating=!(lParam);
+ int id = g_pfwFrames[pos].id;
+ g_pfwFrames[pos].floating = !(lParam);
- CLUIFrames_SetFrameFloat(id,1);//lparam=1 use stored width and height
+ CLUIFrames_SetFrameFloat(id,1);//lparam = 1 use stored width and height
return(wParam);
}
@@ -1406,12 +1406,12 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) return (-1);
};
- if ((lParam&alClient)&&(CLUIFramesGetalClientFrame()>=0)) { //only one alClient frame possible
+ if ((lParam&alClient)&&(CLUIFramesGetalClientFrame() >= 0)) { //only one alClient frame possible
_nClientFrameId = eUnknownId;//recalc it
return -1;
}
- g_pfwFrames[pos].align=lParam;
+ g_pfwFrames[pos].align = lParam;
return(0);
@@ -1421,46 +1421,46 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam) return -1;
}
-//wparam=lparam=0
+//wparam = lparam = 0
static int _us_DoShowAllFrames(WPARAM wParam,LPARAM lParam)
{
int i;
if (_fCluiFramesModuleNotStarted) return -1;
- for(i=0;i<g_nFramesCount;i++)
- g_pfwFrames[i].visible=TRUE;
+ for(i = 0;i < g_nFramesCount;i++)
+ g_pfwFrames[i].visible = TRUE;
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
return 0;
}
-//wparam=lparam=0
+//wparam = lparam = 0
static int _us_DoShowTitles(WPARAM wParam,LPARAM lParam)
{
int i;
if (_fCluiFramesModuleNotStarted) return -1;
- for(i=0;i<g_nFramesCount;i++)
- g_pfwFrames[i].TitleBar.ShowTitleBar=TRUE;
+ for(i = 0;i < g_nFramesCount;i++)
+ g_pfwFrames[i].TitleBar.ShowTitleBar = TRUE;
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
return 0;
}
-//wparam=lparam=0
+//wparam = lparam = 0
static int _us_DoHideTitles(WPARAM wParam,LPARAM lParam)
{
int i;
if (_fCluiFramesModuleNotStarted) return -1;
- for(i=0;i<g_nFramesCount;i++)
- g_pfwFrames[i].TitleBar.ShowTitleBar=FALSE;
+ for(i = 0;i < g_nFramesCount;i++)
+ g_pfwFrames[i].TitleBar.ShowTitleBar = FALSE;
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
return 0;
}
-//wparam=frameid
+//wparam = frameid
static int _us_DoShowHideFrame(WPARAM wParam,LPARAM lParam)
{
int pos;
@@ -1468,20 +1468,20 @@ static int _us_DoShowHideFrame(WPARAM wParam,LPARAM lParam) if (_fCluiFramesModuleNotStarted) return -1;
if (wParam == 0) {
- pos = lParam;
+ pos = lParam;
} else {
- pos=id2pos(wParam);
+ pos = id2pos(wParam);
}
- if(pos>=0&&(int)pos<g_nFramesCount)
+ if (pos >= 0&&(int)pos < g_nFramesCount)
{
- g_pfwFrames[pos].visible=!g_pfwFrames[pos].visible;
- if (g_pfwFrames[pos].OwnerWindow!=(HWND)-2)
+ g_pfwFrames[pos].visible = !g_pfwFrames[pos].visible;
+ if (g_pfwFrames[pos].OwnerWindow != (HWND)-2)
{
if (g_pfwFrames[pos].OwnerWindow)
CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow,(g_pfwFrames[pos].visible&& g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList))?SW_SHOW/*NOACTIVATE*/:SW_HIDE);
else if (g_pfwFrames[pos].visible)
{
- g_pfwFrames[pos].OwnerWindow=CreateSubContainerWindow(pcli->hwndContactList,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,10,10);
+ g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,10,10);
SetParent(g_pfwFrames[pos].hWnd,g_pfwFrames[pos].OwnerWindow);
CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow,(g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList))?SW_SHOW/*NOACTIVATE*/:SW_HIDE);
}
@@ -1493,7 +1493,7 @@ static int _us_DoShowHideFrame(WPARAM wParam,LPARAM lParam) return 0;
}
-//wparam=frameid
+//wparam = frameid
static int _us_DoShowHideFrameTitle(WPARAM wParam,LPARAM lParam)
{
int pos;
@@ -1501,12 +1501,12 @@ static int _us_DoShowHideFrameTitle(WPARAM wParam,LPARAM lParam) if (_fCluiFramesModuleNotStarted) return -1;
if (wParam == 0) {
- pos = lParam;
+ pos = lParam;
} else {
- pos=id2pos(wParam);
+ pos = id2pos(wParam);
}
- if(pos>=0&&(int)pos<g_nFramesCount)
- g_pfwFrames[pos].TitleBar.ShowTitleBar=!g_pfwFrames[pos].TitleBar.ShowTitleBar;
+ if (pos >= 0&&(int)pos < g_nFramesCount)
+ g_pfwFrames[pos].TitleBar.ShowTitleBar = !g_pfwFrames[pos].TitleBar.ShowTitleBar;
//if (Frames[pos].height>
@@ -1517,52 +1517,52 @@ static int _us_DoShowHideFrameTitle(WPARAM wParam,LPARAM lParam) return 0;
}
-//wparam=frameid
-//lparam=-1 up ,1 down
+//wparam = frameid
+//lparam = -1 up ,1 down
static int _us_DoMoveFrame(WPARAM wParam,LPARAM lParam)
{
int pos,i,curpos,curalign,v,tmpval;
if (_fCluiFramesModuleNotStarted) return -1;
- pos=id2pos(wParam);
- if(pos>=0&&(int)pos<g_nFramesCount) {
+ pos = id2pos(wParam);
+ if (pos >= 0&&(int)pos < g_nFramesCount) {
SortData *sd;
- curpos=g_pfwFrames[pos].order;
- curalign=g_pfwFrames[pos].align;
- v=0;
- sd=(SortData*)malloc(sizeof(SortData)*g_nFramesCount);
+ curpos = g_pfwFrames[pos].order;
+ curalign = g_pfwFrames[pos].align;
+ v = 0;
+ sd = (SortData*)malloc(sizeof(SortData)*g_nFramesCount);
memset(sd,0,sizeof(SortData)*g_nFramesCount);
- for (i=0;i<g_nFramesCount;i++)
+ for (i = 0;i < g_nFramesCount;i++)
{
- if (g_pfwFrames[i].floating||(!g_pfwFrames[i].visible)||(g_pfwFrames[i].align!=curalign)){continue;};
+ if (g_pfwFrames[i].floating||(!g_pfwFrames[i].visible)||(g_pfwFrames[i].align != curalign)){continue;};
- sd[v].order=g_pfwFrames[i].order;
- sd[v].realpos=i;
+ sd[v].order = g_pfwFrames[i].order;
+ sd[v].realpos = i;
v++;
};
- if (v==0){return(0);};
+ if (v == 0){return(0);};
qsort(sd,v,sizeof(SortData),sortfunc);
- for (i=0;i<v;i++)
- g_pfwFrames[sd[i].realpos].order=i+1; //to be sure that order is incremental
- for (i=0;i<v;i++)
+ for (i = 0;i < v;i++)
+ g_pfwFrames[sd[i].realpos].order = i+1; //to be sure that order is incremental
+ for (i = 0;i < v;i++)
{
- if (sd[i].realpos==pos)
+ if (sd[i].realpos == pos)
{
- if (lParam==-1)
+ if (lParam == -1)
{
- if (i>=v-1) break;
- tmpval=g_pfwFrames[sd[i+1].realpos].order;
- g_pfwFrames[sd[i+1].realpos].order=g_pfwFrames[pos].order;
- g_pfwFrames[pos].order=tmpval;
+ if (i >= v-1) break;
+ tmpval = g_pfwFrames[sd[i+1].realpos].order;
+ g_pfwFrames[sd[i+1].realpos].order = g_pfwFrames[pos].order;
+ g_pfwFrames[pos].order = tmpval;
break;
};
- if (lParam==+1)
+ if (lParam == +1)
{
- if (i<1) break;
- tmpval=g_pfwFrames[sd[i-1].realpos].order;
- g_pfwFrames[sd[i-1].realpos].order=g_pfwFrames[pos].order;
- g_pfwFrames[pos].order=tmpval;
+ if (i < 1) break;
+ tmpval = g_pfwFrames[sd[i-1].realpos].order;
+ g_pfwFrames[sd[i-1].realpos].order = g_pfwFrames[pos].order;
+ g_pfwFrames[pos].order = tmpval;
break;
};
@@ -1570,7 +1570,7 @@ static int _us_DoMoveFrame(WPARAM wParam,LPARAM lParam) };
};
- if (sd!=NULL){free(sd);};
+ if (sd != NULL){free(sd);};
CLUIFramesStoreFrameSettings(pos);
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
@@ -1589,8 +1589,8 @@ static int _us_DoMoveFrameDown(WPARAM wParam,LPARAM lParam) {
return CLUIFrames_MoveFrame(wParam,(LPARAM)-1);
}
-//wparam=frameid
-//lparam=alignment
+//wparam = frameid
+//lparam = alignment
static int _us_DoSetFrameAlign(WPARAM wParam,LPARAM lParam)
{
if (_fCluiFramesModuleNotStarted) return -1;
@@ -1619,7 +1619,7 @@ static int _us_DoAlignFrameClient(WPARAM wParam,LPARAM lParam) }
-//wparam=frameid
+//wparam = frameid
static int _us_DoLockFrame(WPARAM wParam,LPARAM lParam)
{
int pos;
@@ -1627,19 +1627,19 @@ static int _us_DoLockFrame(WPARAM wParam,LPARAM lParam) if (_fCluiFramesModuleNotStarted) return -1;
if (wParam == 0) {
- pos = lParam;
+ pos = lParam;
} else {
- pos=id2pos(wParam);
+ pos = id2pos(wParam);
}
- if(pos>=0&&(int)pos<g_nFramesCount) {
- g_pfwFrames[pos].Locked=!g_pfwFrames[pos].Locked;
+ if (pos >= 0&&(int)pos < g_nFramesCount) {
+ g_pfwFrames[pos].Locked = !g_pfwFrames[pos].Locked;
CLUIFramesStoreFrameSettings(pos);
}
return 0;
}
-//wparam=frameid
+//wparam = frameid
static int _us_DoSetFrameBorder(WPARAM wParam,LPARAM lParam)
{
RECT rc;
@@ -1650,20 +1650,20 @@ static int _us_DoSetFrameBorder(WPARAM wParam,LPARAM lParam) if (_fCluiFramesModuleNotStarted) return -1;
if (wParam == 0) {
- FrameId = lParam;
+ FrameId = lParam;
} else {
- FrameId=id2pos(wParam);
+ FrameId = id2pos(wParam);
}
- if (FrameId==-1){return(-1);};
- flt=
- oldflags=CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,wParam),0);
+ if (FrameId == -1){return(-1);};
+ flt =
+ oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,wParam),0);
if (oldflags&F_NOBORDER)
{
- oldflags&=(~F_NOBORDER);
+ oldflags &= (~F_NOBORDER);
}
else
{
- oldflags|=F_NOBORDER;
+ oldflags |= F_NOBORDER;
};
hw = g_pfwFrames[FrameId].hWnd;
GetWindowRect(hw,&rc);
@@ -1675,7 +1675,7 @@ static int _us_DoSetFrameBorder(WPARAM wParam,LPARAM lParam) };
return(0);
};
-//wparam=frameid
+//wparam = frameid
static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam)
{
int FrameId;
@@ -1683,33 +1683,33 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) if (_fCluiFramesModuleNotStarted) return -1;
if (wParam == 0) {
- FrameId = lParam;
+ FrameId = lParam;
} else {
- FrameId=id2pos(wParam);
+ FrameId = id2pos(wParam);
}
- if(FrameId>=0&&FrameId<g_nFramesCount)
+ if (FrameId >= 0&&FrameId < g_nFramesCount)
{
int oldHeight;
// do not collapse/uncollapse client/locked/invisible frames
- if(g_pfwFrames[FrameId].align==alClient&&!(g_pfwFrames[FrameId].Locked||(!g_pfwFrames[FrameId].visible)||g_pfwFrames[FrameId].floating))
+ if (g_pfwFrames[FrameId].align == alClient&&!(g_pfwFrames[FrameId].Locked||(!g_pfwFrames[FrameId].visible)||g_pfwFrames[FrameId].floating))
{
RECT rc;
- if(CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {return 0;};
+ if (CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {return 0;};
if (!g_CluiData.fDocked && g_CluiData.fAutoSize) {return 0;};
GetWindowRect(pcli->hwndContactList,&rc);
- if(g_pfwFrames[FrameId].collapsed==TRUE) {
- rc.bottom-=rc.top;
- rc.bottom-=g_pfwFrames[FrameId].height;
- g_pfwFrames[FrameId].HeightWhenCollapsed=g_pfwFrames[FrameId].height;
- g_pfwFrames[FrameId].collapsed=FALSE;
+ if (g_pfwFrames[FrameId].collapsed == TRUE) {
+ rc.bottom -= rc.top;
+ rc.bottom -= g_pfwFrames[FrameId].height;
+ g_pfwFrames[FrameId].HeightWhenCollapsed = g_pfwFrames[FrameId].height;
+ g_pfwFrames[FrameId].collapsed = FALSE;
}
else
{
- rc.bottom-=rc.top;
- rc.bottom+=g_pfwFrames[FrameId].HeightWhenCollapsed;
- g_pfwFrames[FrameId].collapsed=TRUE;
+ rc.bottom -= rc.top;
+ rc.bottom += g_pfwFrames[FrameId].HeightWhenCollapsed;
+ g_pfwFrames[FrameId].collapsed = TRUE;
}
SetWindowPos(pcli->hwndContactList,NULL,0,0,rc.right-rc.left,rc.bottom,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOMOVE);
@@ -1720,54 +1720,54 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) return 0;
}
- if(g_pfwFrames[FrameId].Locked||(!g_pfwFrames[FrameId].visible)) return 0;
+ if (g_pfwFrames[FrameId].Locked||(!g_pfwFrames[FrameId].visible)) return 0;
- oldHeight=g_pfwFrames[FrameId].height;
+ oldHeight = g_pfwFrames[FrameId].height;
// if collapsed, uncollapse
- if(g_pfwFrames[FrameId].collapsed==TRUE) {
- g_pfwFrames[FrameId].HeightWhenCollapsed=g_pfwFrames[FrameId].height;
- g_pfwFrames[FrameId].height=UNCOLLAPSED_FRAME_SIZE;
- g_pfwFrames[FrameId].collapsed=FALSE;
+ if (g_pfwFrames[FrameId].collapsed == TRUE) {
+ g_pfwFrames[FrameId].HeightWhenCollapsed = g_pfwFrames[FrameId].height;
+ g_pfwFrames[FrameId].height = UNCOLLAPSED_FRAME_SIZE;
+ g_pfwFrames[FrameId].collapsed = FALSE;
}
// if uncollapsed, collapse
else {
- g_pfwFrames[FrameId].height=g_pfwFrames[FrameId].HeightWhenCollapsed;
- g_pfwFrames[FrameId].collapsed=TRUE;
+ g_pfwFrames[FrameId].height = g_pfwFrames[FrameId].HeightWhenCollapsed;
+ g_pfwFrames[FrameId].collapsed = TRUE;
}
if (!g_pfwFrames[FrameId].floating)
{
if (!CLUIFramesFitInSize()) {
- //cant collapse,we can resize only for height<alclient frame height
- int alfrm=CLUIFramesGetalClientFrame();
-
- if(alfrm!=-1) {
- g_pfwFrames[FrameId].collapsed=FALSE;
- if(g_pfwFrames[alfrm].height>2*UNCOLLAPSED_FRAME_SIZE) {
- oldHeight=g_pfwFrames[alfrm].height-UNCOLLAPSED_FRAME_SIZE;
- g_pfwFrames[FrameId].collapsed=TRUE;
+ //cant collapse,we can resize only for height < alclient frame height
+ int alfrm = CLUIFramesGetalClientFrame();
+
+ if (alfrm != -1) {
+ g_pfwFrames[FrameId].collapsed = FALSE;
+ if (g_pfwFrames[alfrm].height>2*UNCOLLAPSED_FRAME_SIZE) {
+ oldHeight = g_pfwFrames[alfrm].height-UNCOLLAPSED_FRAME_SIZE;
+ g_pfwFrames[FrameId].collapsed = TRUE;
}
}else
{
- int i,sumheight=0;
- for(i=0;i<g_nFramesCount;i++) {
- if ((g_pfwFrames[i].align!=alClient)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
- sumheight+=(g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar))+2;
+ int i,sumheight = 0;
+ for(i = 0;i < g_nFramesCount;i++) {
+ if ((g_pfwFrames[i].align != alClient)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
+ sumheight += (g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar))+2;
return FALSE;
}
- if(sumheight>_nContactListHeight-0-2)
+ if (sumheight>_nContactListHeight-0-2)
{
- g_pfwFrames[FrameId].height=(_nContactListHeight-0-2)-sumheight;
+ g_pfwFrames[FrameId].height = (_nContactListHeight-0-2)-sumheight;
}
}
}
- g_pfwFrames[FrameId].height=oldHeight;
+ g_pfwFrames[FrameId].height = oldHeight;
- if(g_pfwFrames[FrameId].collapsed==FALSE) {
+ if (g_pfwFrames[FrameId].collapsed == FALSE) {
if (!g_pfwFrames[FrameId].floating)
{
@@ -1793,10 +1793,10 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam) //SetWindowPos(Frames[FrameId].hWnd,HWND_TOP,0,0,Frames[FrameId].wndSize.right-Frames[FrameId].wndSize.left,Frames[FrameId].height,SWP_SHOWWINDOW|SWP_NOMOVE);
RECT contwnd;
GetWindowRect(g_pfwFrames[FrameId].ContainerWnd,&contwnd);
- contwnd.top=contwnd.bottom-contwnd.top;//height
- contwnd.left=contwnd.right-contwnd.left;//width
+ contwnd.top = contwnd.bottom-contwnd.top;//height
+ contwnd.left = contwnd.right-contwnd.left;//width
- contwnd.top-=(oldHeight-g_pfwFrames[FrameId].height);//newheight
+ contwnd.top -= (oldHeight-g_pfwFrames[FrameId].height);//newheight
SetWindowPos(g_pfwFrames[FrameId].ContainerWnd,HWND_TOP,0,0,contwnd.left,contwnd.top,SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOMOVE);
};
CLUIFramesStoreAllFrames();
@@ -1811,13 +1811,13 @@ static int CLUIFramesLoadMainMenu() if (_fCluiFramesModuleNotStarted)
return -1;
- if(_hmiRoot!=(HGENMENU)-1) {
+ if (_hmiRoot != (HGENMENU)-1) {
CallService(MS_CLIST_REMOVEMAINMENUITEM,(WPARAM)_hmiRoot,0);
- _hmiRoot=(HGENMENU)-1;
+ _hmiRoot = (HGENMENU)-1;
}
CLISTMENUITEM mi = { 0 };
- mi.cbSize=sizeof(mi);
+ mi.cbSize = sizeof(mi);
// create root menu
mi.flags = CMIF_ICONFROMICOLIB | CMIF_ROOTHANDLE;
mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
@@ -1826,8 +1826,8 @@ static int CLUIFramesLoadMainMenu() _hmiRoot = Menu_AddMainMenuItem(&mi);
DestroyIcon_protect(mi.hIcon);
// create frames menu
- int separator=3000200000;
- for (int i=0; i < g_nFramesCount; i++) {
+ int separator = 3000200000;
+ for (int i = 0; i < g_nFramesCount; i++) {
mi.hIcon = g_pfwFrames[i].TitleBar.hicon;
mi.flags = CMIF_ROOTHANDLE | CMIF_TCHAR;
mi.position = separator;
@@ -1841,7 +1841,7 @@ static int CLUIFramesLoadMainMenu() separator++;
}
- separator+=100000;
+ separator += 100000;
// create "show all frames" menu
mi.hIcon = NULL;
@@ -1868,86 +1868,86 @@ static int CLUIFramesLoadMainMenu() static HFONT CLUILoadTitleBarFont()
{
- char facename[]="MS Shell Dlg";
+ char facename[] = "MS Shell Dlg";
HFONT hfont;
LOGFONTA logfont;
memset(&logfont,0,sizeof(logfont));
memmove(logfont.lfFaceName,facename,sizeof(facename));
- logfont.lfWeight=FW_NORMAL;
- logfont.lfHeight=-10;
- logfont.lfCharSet=DEFAULT_CHARSET;
- hfont=CreateFontIndirectA(&logfont);
+ logfont.lfWeight = FW_NORMAL;
+ logfont.lfHeight = -10;
+ logfont.lfCharSet = DEFAULT_CHARSET;
+ hfont = CreateFontIndirectA(&logfont);
return hfont;
}
-//wparam=(CLISTFrame*)clfrm
+//wparam = (CLISTFrame*)clfrm
static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam)
{
int style,retval;
- //char * CustomName=NULL;
- CLISTFrame *clfrm=(CLISTFrame *)wParam;
+ //char * CustomName = NULL;
+ CLISTFrame *clfrm = (CLISTFrame *)wParam;
- if(pcli->hwndContactList==0) return -1;
+ if (pcli->hwndContactList == 0) return -1;
if (_fCluiFramesModuleNotStarted) return -1;
- if(clfrm->cbSize!=sizeof(CLISTFrame)) return -1;
+ if (clfrm->cbSize != sizeof(CLISTFrame)) return -1;
if (!(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont();
- g_pfwFrames=(FRAMEWND*)realloc(g_pfwFrames,sizeof(FRAMEWND)*(g_nFramesCount+1));
+ g_pfwFrames = (FRAMEWND*)realloc(g_pfwFrames,sizeof(FRAMEWND)*(g_nFramesCount+1));
memset(&g_pfwFrames[g_nFramesCount],0,sizeof(FRAMEWND));
/* //removed buggy code
if (clfrm->name && 0 )
{
- CustomName=ModernDBGetStringA(NULL,"CUSTOM_CLUI_FRAMES",AS(buff,"CustomName_",clfrm->name));
- Frames[nFramescount].TitleBar.BackColour=(COLORREF)DBGetContactSettingDword(NULL,"CUSTOM_CLUI_FRAMES",AS(buff,"CustomBackColor_",clfrm->name),GetSysColor(COLOR_3DFACE));
- Frames[nFramescount].TitleBar.TextColour=(COLORREF)DBGetContactSettingDword(NULL,"CUSTOM_CLUI_FRAMES",AS(buff,"CustomTextColor_",clfrm->name),GetSysColor(COLOR_WINDOWTEXT));
+ CustomName = ModernDBGetStringA(NULL,"CUSTOM_CLUI_FRAMES",AS(buff,"CustomName_",clfrm->name));
+ Frames[nFramescount].TitleBar.BackColour = (COLORREF)DBGetContactSettingDword(NULL,"CUSTOM_CLUI_FRAMES",AS(buff,"CustomBackColor_",clfrm->name),GetSysColor(COLOR_3DFACE));
+ Frames[nFramescount].TitleBar.TextColour = (COLORREF)DBGetContactSettingDword(NULL,"CUSTOM_CLUI_FRAMES",AS(buff,"CustomTextColor_",clfrm->name),GetSysColor(COLOR_WINDOWTEXT));
if (CustomName)
{
if (clfrm->name) mir_free_and_nill(clfrm->name);
- clfrm->name=mir_strdup(CustomName);
+ clfrm->name = mir_strdup(CustomName);
mir_free_and_nill(CustomName);
}
}
*/
- g_pfwFrames[g_nFramesCount].id=_iNextFrameId++;
- g_pfwFrames[g_nFramesCount].align=clfrm->align;
- g_pfwFrames[g_nFramesCount].hWnd=clfrm->hWnd;
- g_pfwFrames[g_nFramesCount].height=clfrm->height;
- g_pfwFrames[g_nFramesCount].TitleBar.hicon=clfrm->hIcon;
+ g_pfwFrames[g_nFramesCount].id = _iNextFrameId++;
+ g_pfwFrames[g_nFramesCount].align = clfrm->align;
+ g_pfwFrames[g_nFramesCount].hWnd = clfrm->hWnd;
+ g_pfwFrames[g_nFramesCount].height = clfrm->height;
+ g_pfwFrames[g_nFramesCount].TitleBar.hicon = clfrm->hIcon;
//Frames[nFramescount].TitleBar.BackColour;
- g_pfwFrames[g_nFramesCount].floating=FALSE;
+ g_pfwFrames[g_nFramesCount].floating = FALSE;
if (clfrm->Flags&F_NO_SUBCONTAINER || !g_CluiData.fLayered)
- g_pfwFrames[g_nFramesCount].OwnerWindow=(HWND)-2;
- else g_pfwFrames[g_nFramesCount].OwnerWindow=0;
+ g_pfwFrames[g_nFramesCount].OwnerWindow = (HWND)-2;
+ else g_pfwFrames[g_nFramesCount].OwnerWindow = 0;
//override tbbtip
- //clfrm->Flags|=F_SHOWTBTIP;
+ //clfrm->Flags |= F_SHOWTBTIP;
//
- if (db_get_b(0,CLUIFrameModule,"RemoveAllBorders",0)==1)
+ if (db_get_b(0,CLUIFrameModule,"RemoveAllBorders",0) == 1)
{
- clfrm->Flags|=F_NOBORDER;
+ clfrm->Flags |= F_NOBORDER;
};
- g_pfwFrames[g_nFramesCount].dwFlags=clfrm->Flags;
+ g_pfwFrames[g_nFramesCount].dwFlags = clfrm->Flags;
- if (clfrm->name==NULL||((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->wname) : lstrlenA(clfrm->name))==0) {
- g_pfwFrames[g_nFramesCount].Name=(LPTSTR)mir_alloc(255 * sizeof(TCHAR));
+ if (clfrm->name == NULL||((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->wname) : lstrlenA(clfrm->name)) == 0) {
+ g_pfwFrames[g_nFramesCount].Name = (LPTSTR)mir_alloc(255 * sizeof(TCHAR));
GetClassName(g_pfwFrames[g_nFramesCount].hWnd,g_pfwFrames[g_nFramesCount].Name,255);
}
else
{
- g_pfwFrames[g_nFramesCount].Name=(clfrm->Flags&F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name);
+ g_pfwFrames[g_nFramesCount].Name = (clfrm->Flags&F_UNICODE) ? mir_u2t(clfrm->wname) : mir_a2t(clfrm->name);
}
- g_pfwFrames[g_nFramesCount].szName=mir_t2a(g_pfwFrames[g_nFramesCount].Name);
- if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname==NULL
+ g_pfwFrames[g_nFramesCount].szName = mir_t2a(g_pfwFrames[g_nFramesCount].Name);
+ if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == NULL
|| ((clfrm->Flags&F_UNICODE) ? lstrlenW(clfrm->TBwname) : lstrlenA(clfrm->TBname)) == 0)
- g_pfwFrames[g_nFramesCount].TitleBar.tbname=mir_tstrdup(g_pfwFrames[g_nFramesCount].Name);
+ g_pfwFrames[g_nFramesCount].TitleBar.tbname = mir_tstrdup(g_pfwFrames[g_nFramesCount].Name);
else
- g_pfwFrames[g_nFramesCount].TitleBar.tbname=(clfrm->Flags&F_UNICODE) ? mir_u2t(clfrm->TBwname) : mir_a2t(clfrm->TBname);
- g_pfwFrames[g_nFramesCount].TitleBar.sztbname=mir_t2a(g_pfwFrames[g_nFramesCount].TitleBar.tbname);
- g_pfwFrames[g_nFramesCount].needhide=FALSE;
- g_pfwFrames[g_nFramesCount].TitleBar.ShowTitleBar=(clfrm->Flags&F_SHOWTB?TRUE:FALSE);
- g_pfwFrames[g_nFramesCount].TitleBar.ShowTitleBarTip=(clfrm->Flags&F_SHOWTBTIP?TRUE:FALSE);
+ g_pfwFrames[g_nFramesCount].TitleBar.tbname = (clfrm->Flags&F_UNICODE) ? mir_u2t(clfrm->TBwname) : mir_a2t(clfrm->TBname);
+ g_pfwFrames[g_nFramesCount].TitleBar.sztbname = mir_t2a(g_pfwFrames[g_nFramesCount].TitleBar.tbname);
+ g_pfwFrames[g_nFramesCount].needhide = FALSE;
+ g_pfwFrames[g_nFramesCount].TitleBar.ShowTitleBar = (clfrm->Flags&F_SHOWTB?TRUE:FALSE);
+ g_pfwFrames[g_nFramesCount].TitleBar.ShowTitleBarTip = (clfrm->Flags&F_SHOWTBTIP?TRUE:FALSE);
g_pfwFrames[g_nFramesCount].collapsed = (clfrm->Flags&F_UNCOLLAPSED)?FALSE:TRUE;
@@ -1955,14 +1955,14 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam) g_pfwFrames[g_nFramesCount].Locked = clfrm->Flags&F_LOCKED?TRUE:FALSE;
g_pfwFrames[g_nFramesCount].visible = clfrm->Flags&F_VISIBLE?TRUE:FALSE;
- g_pfwFrames[g_nFramesCount].UseBorder=((clfrm->Flags&F_NOBORDER)||g_CluiData.fLayered)?FALSE:TRUE;
+ g_pfwFrames[g_nFramesCount].UseBorder = ((clfrm->Flags&F_NOBORDER)||g_CluiData.fLayered)?FALSE:TRUE;
- //Frames[nFramescount].OwnerWindow=0;
+ //Frames[nFramescount].OwnerWindow = 0;
g_pfwFrames[g_nFramesCount].TitleBar.hwnd
- =CreateWindow(CLUIFrameTitleBarClassName,g_pfwFrames[g_nFramesCount].Name,
+ = CreateWindow(CLUIFrameTitleBarClassName,g_pfwFrames[g_nFramesCount].Name,
(db_get_b(0,CLUIFrameModule,"RemoveAllTitleBarBorders",1)?0:WS_BORDER)
|WS_CHILD|WS_CLIPCHILDREN|
@@ -1973,7 +1973,7 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam) g_pfwFrames[g_nFramesCount].TitleBar.hwndTip
- =CreateWindowExA(0, TOOLTIPS_CLASSA, NULL,
+ = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
@@ -1987,44 +1987,44 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam) int res;
ZeroMemory(&ti,sizeof(ti));
- ti.cbSize=sizeof(ti);
- ti.lpszText="";
- ti.hinst=g_hInst;
- ti.uFlags=TTF_IDISHWND|TTF_SUBCLASS ;
- ti.uId=(UINT_PTR)g_pfwFrames[g_nFramesCount].TitleBar.hwnd;
- res=SendMessageA(g_pfwFrames[g_nFramesCount].TitleBar.hwndTip,TTM_ADDTOOL,(WPARAM)0,(LPARAM)&ti);
+ ti.cbSize = sizeof(ti);
+ ti.lpszText = "";
+ ti.hinst = g_hInst;
+ ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS ;
+ ti.uId = (UINT_PTR)g_pfwFrames[g_nFramesCount].TitleBar.hwnd;
+ res = SendMessageA(g_pfwFrames[g_nFramesCount].TitleBar.hwndTip,TTM_ADDTOOL,(WPARAM)0,(LPARAM)&ti);
}
SendMessageA(g_pfwFrames[g_nFramesCount].TitleBar.hwndTip,TTM_ACTIVATE,(WPARAM)g_pfwFrames[g_nFramesCount].TitleBar.ShowTitleBarTip,0);
- g_pfwFrames[g_nFramesCount].oldstyles=GetWindowLongPtr(g_pfwFrames[g_nFramesCount].hWnd,GWL_STYLE);
- g_pfwFrames[g_nFramesCount].TitleBar.oldstyles=GetWindowLongPtr(g_pfwFrames[g_nFramesCount].TitleBar.hwnd,GWL_STYLE);
- //Frames[nFramescount].FloatingPos.x=
+ g_pfwFrames[g_nFramesCount].oldstyles = GetWindowLongPtr(g_pfwFrames[g_nFramesCount].hWnd,GWL_STYLE);
+ g_pfwFrames[g_nFramesCount].TitleBar.oldstyles = GetWindowLongPtr(g_pfwFrames[g_nFramesCount].TitleBar.hwnd,GWL_STYLE);
+ //Frames[nFramescount].FloatingPos.x =
- retval=g_pfwFrames[g_nFramesCount].id;
- g_pfwFrames[g_nFramesCount].order=g_nFramesCount+1;
+ retval = g_pfwFrames[g_nFramesCount].id;
+ g_pfwFrames[g_nFramesCount].order = g_nFramesCount+1;
g_nFramesCount++;
CLUIFramesLoadFrameSettings(id2pos(retval));
- if (g_pfwFrames[g_nFramesCount-1].collapsed==FALSE)
+ if (g_pfwFrames[g_nFramesCount-1].collapsed == FALSE)
{
- g_pfwFrames[g_nFramesCount-1].height=0;
+ g_pfwFrames[g_nFramesCount-1].height = 0;
}
// create frame
- // else Frames[nFramescount-1].height=Frames[nFramescount-1].HeightWhenCollapsed;
+ // else Frames[nFramescount-1].height = Frames[nFramescount-1].HeightWhenCollapsed;
- style=GetWindowLongPtr(g_pfwFrames[g_nFramesCount-1].hWnd,GWL_STYLE);
- style&=(~WS_BORDER);
- style|=(((g_pfwFrames[g_nFramesCount-1].UseBorder)&&!g_CluiData.fLayered)?WS_BORDER:0);
+ style = GetWindowLongPtr(g_pfwFrames[g_nFramesCount-1].hWnd,GWL_STYLE);
+ style &= (~WS_BORDER);
+ style |= (((g_pfwFrames[g_nFramesCount-1].UseBorder)&&!g_CluiData.fLayered)?WS_BORDER:0);
SetWindowLongPtr(g_pfwFrames[g_nFramesCount-1].hWnd,GWL_STYLE,style);
SetWindowLongPtr(g_pfwFrames[g_nFramesCount-1].TitleBar.hwnd,GWL_STYLE,style& ~(WS_VSCROLL | WS_HSCROLL));
SetWindowLongPtr(g_pfwFrames[g_nFramesCount-1].TitleBar.hwnd,GWL_STYLE,GetWindowLongPtr(g_pfwFrames[g_nFramesCount-1].TitleBar.hwnd,GWL_STYLE)&~(WS_VSCROLL|WS_HSCROLL));
- if (g_pfwFrames[g_nFramesCount-1].order==0){g_pfwFrames[g_nFramesCount-1].order=g_nFramesCount;};
+ if (g_pfwFrames[g_nFramesCount-1].order == 0){g_pfwFrames[g_nFramesCount-1].order = g_nFramesCount;};
//need to enlarge parent
@@ -2032,22 +2032,22 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam) RECT mainRect;
int mainHeight, minHeight;
GetWindowRect(pcli->hwndContactList,&mainRect);
- mainHeight=mainRect.bottom-mainRect.top;
- minHeight=CLUIFrames_GetTotalHeight();
- if (mainHeight<minHeight)
+ mainHeight = mainRect.bottom-mainRect.top;
+ minHeight = CLUIFrames_GetTotalHeight();
+ if (mainHeight < minHeight)
{
- BOOL Upward=FALSE;
- Upward=!g_CluiData.fDocked&&g_CluiData.fAutoSize&&db_get_b(NULL,"CLUI","AutoSizeUpward",SETTING_AUTOSIZEUPWARD_DEFAULT);
+ BOOL Upward = FALSE;
+ Upward = !g_CluiData.fDocked&&g_CluiData.fAutoSize&&db_get_b(NULL,"CLUI","AutoSizeUpward",SETTING_AUTOSIZEUPWARD_DEFAULT);
if (Upward)
- mainRect.top=mainRect.bottom-minHeight;
+ mainRect.top = mainRect.bottom-minHeight;
else
- mainRect.bottom=mainRect.top+minHeight;
+ mainRect.bottom = mainRect.top+minHeight;
SetWindowPos(pcli->hwndContactList,NULL,mainRect.left,mainRect.top,mainRect.right-mainRect.left, mainRect.bottom-mainRect.top, SWP_NOZORDER|SWP_NOREDRAW|SWP_NOACTIVATE|SWP_NOSENDCHANGING);
}
GetWindowRect(pcli->hwndContactList,&mainRect);
- mainHeight=mainRect.bottom-mainRect.top;
- //if (mainHeight<minHeight)
+ mainHeight = mainRect.bottom-mainRect.top;
+ //if (mainHeight < minHeight)
// DebugBreak();
}
_nClientFrameId = eUnknownId;//recalc it
@@ -2056,9 +2056,9 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam) if (g_pfwFrames[g_nFramesCount-1].floating)
{
- g_pfwFrames[g_nFramesCount-1].floating=FALSE;
+ g_pfwFrames[g_nFramesCount-1].floating = FALSE;
//SetWindowPos(Frames[nFramescount-1].hw
- CLUIFrames_SetFrameFloat(retval,1);//lparam=1 use stored width and height
+ CLUIFrames_SetFrameFloat(retval,1);//lparam = 1 use stored width and height
}
else
CLUIFrames_SetFrameFloat(retval,2);
@@ -2074,34 +2074,34 @@ static int _us_DoRemoveFrame(WPARAM wParam,LPARAM lParam) int pos;
if (_fCluiFramesModuleNotStarted) return -1;
- pos=id2pos(wParam);
+ pos = id2pos(wParam);
- if (pos<0||pos>g_nFramesCount){return(-1);};
+ if (pos < 0||pos>g_nFramesCount){return(-1);};
- if (g_pfwFrames[pos].Name!=NULL) mir_free_and_nill(g_pfwFrames[pos].Name);
- if (g_pfwFrames[pos].szName!=NULL) mir_free_and_nill(g_pfwFrames[pos].szName);
- if (g_pfwFrames[pos].TitleBar.tbname!=NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.tbname);
- if (g_pfwFrames[pos].TitleBar.sztbname!=NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.sztbname);
- if (g_pfwFrames[pos].TitleBar.tooltip!=NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.tooltip);
- if (g_pfwFrames[pos].TitleBar.sztooltip!=NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.sztooltip);
+ if (g_pfwFrames[pos].Name != NULL) mir_free_and_nill(g_pfwFrames[pos].Name);
+ if (g_pfwFrames[pos].szName != NULL) mir_free_and_nill(g_pfwFrames[pos].szName);
+ if (g_pfwFrames[pos].TitleBar.tbname != NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.tbname);
+ if (g_pfwFrames[pos].TitleBar.sztbname != NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.sztbname);
+ if (g_pfwFrames[pos].TitleBar.tooltip != NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.tooltip);
+ if (g_pfwFrames[pos].TitleBar.sztooltip != NULL) mir_free_and_nill(g_pfwFrames[pos].TitleBar.sztooltip);
DestroyWindow(g_pfwFrames[pos].hWnd);
- g_pfwFrames[pos].hWnd=(HWND)-1;
+ g_pfwFrames[pos].hWnd = (HWND)-1;
DestroyWindow(g_pfwFrames[pos].TitleBar.hwnd);
- if(g_pfwFrames[pos].TitleBar.hwndTip)
+ if (g_pfwFrames[pos].TitleBar.hwndTip)
DestroyWindow(g_pfwFrames[pos].TitleBar.hwndTip);
- g_pfwFrames[pos].TitleBar.hwnd=(HWND)-1;
- if(g_pfwFrames[pos].ContainerWnd && g_pfwFrames[pos].ContainerWnd!=(HWND)-1) DestroyWindow(g_pfwFrames[pos].ContainerWnd);
- g_pfwFrames[pos].ContainerWnd=(HWND)-1;
+ g_pfwFrames[pos].TitleBar.hwnd = (HWND)-1;
+ if (g_pfwFrames[pos].ContainerWnd && g_pfwFrames[pos].ContainerWnd != (HWND)-1) DestroyWindow(g_pfwFrames[pos].ContainerWnd);
+ g_pfwFrames[pos].ContainerWnd = (HWND)-1;
if (g_pfwFrames[pos].TitleBar.hmenu) DestroyMenu(g_pfwFrames[pos].TitleBar.hmenu);
g_pfwFrames[pos].PaintCallbackProc = NULL;
if (g_pfwFrames[pos].UpdateRgn) DeleteObject(g_pfwFrames[pos].UpdateRgn);
- if (g_pfwFrames[pos].OwnerWindow!=(HWND)-1
- && g_pfwFrames[pos].OwnerWindow!=(HWND)-2
- && g_pfwFrames[pos].OwnerWindow!=(HWND)0)
+ if (g_pfwFrames[pos].OwnerWindow != (HWND)-1
+ && g_pfwFrames[pos].OwnerWindow != (HWND)-2
+ && g_pfwFrames[pos].OwnerWindow != (HWND)0)
DestroyWindow(g_pfwFrames[pos].OwnerWindow);
- g_pfwFrames[pos].OwnerWindow=NULL;
+ g_pfwFrames[pos].OwnerWindow = NULL;
RemoveItemFromList(pos,&g_pfwFrames,&g_nFramesCount);
CLUI__cliInvalidateRect(pcli->hwndContactList,NULL,TRUE);
@@ -2114,21 +2114,21 @@ static int _us_DoRemoveFrame(WPARAM wParam,LPARAM lParam) static int CLUIFramesForceUpdateTB(const FRAMEWND *Frame)
{
- if (Frame->TitleBar.hwnd!=0) RedrawWindow(Frame->TitleBar.hwnd,NULL,NULL,RDW_ALLCHILDREN|RDW_UPDATENOW|RDW_ERASE|RDW_INVALIDATE|RDW_FRAME);
+ if (Frame->TitleBar.hwnd != 0) RedrawWindow(Frame->TitleBar.hwnd,NULL,NULL,RDW_ALLCHILDREN|RDW_UPDATENOW|RDW_ERASE|RDW_INVALIDATE|RDW_FRAME);
//UpdateWindow(Frame->TitleBar.hwnd);
return 0;
}
static int CLUIFramesForceUpdateFrame(const FRAMEWND *Frame)
{
- if (Frame->hWnd!=0)
+ if (Frame->hWnd != 0)
{
RedrawWindow(Frame->hWnd,NULL,NULL,RDW_UPDATENOW|RDW_FRAME|RDW_ERASE|RDW_INVALIDATE);
UpdateWindow(Frame->hWnd);
};
- if(Frame->floating)
+ if (Frame->floating)
{
- if (Frame->ContainerWnd!=0) RedrawWindow(Frame->ContainerWnd,NULL,NULL,RDW_UPDATENOW|RDW_ALLCHILDREN|RDW_ERASE|RDW_INVALIDATE|RDW_FRAME);
+ if (Frame->ContainerWnd != 0) RedrawWindow(Frame->ContainerWnd,NULL,NULL,RDW_UPDATENOW|RDW_ALLCHILDREN|RDW_ERASE|RDW_INVALIDATE|RDW_FRAME);
//UpdateWindow(Frame->ContainerWnd);
};
return 0;
@@ -2137,16 +2137,16 @@ static int CLUIFramesForceUpdateFrame(const FRAMEWND *Frame) static int CLUIFrameMoveResize(const FRAMEWND *Frame)
{
// we need to show or hide the frame?
- if(Frame->visible&&(!Frame->needhide)) {
- if (Frame->OwnerWindow!=(HWND)-2 &&Frame->OwnerWindow)
+ if (Frame->visible&&(!Frame->needhide)) {
+ if (Frame->OwnerWindow != (HWND)-2 &&Frame->OwnerWindow)
{
// CLUI_ShowWindowMod(Frame->OwnerWindow,SW_SHOW);
}
CLUI_ShowWindowMod(Frame->hWnd,SW_SHOW/*NOACTIVATE*/);
- CLUI_ShowWindowMod(Frame->TitleBar.hwnd,Frame->TitleBar.ShowTitleBar==TRUE?SW_SHOW/*NOACTIVATE*/:SW_HIDE);
+ CLUI_ShowWindowMod(Frame->TitleBar.hwnd,Frame->TitleBar.ShowTitleBar == TRUE?SW_SHOW/*NOACTIVATE*/:SW_HIDE);
}
else {
- if (Frame->OwnerWindow && Frame->OwnerWindow!=(HWND)(-1)&& Frame->OwnerWindow!=(HWND)(-2))
+ if (Frame->OwnerWindow && Frame->OwnerWindow != (HWND)(-1)&& Frame->OwnerWindow != (HWND)(-2))
{
CLUI_ShowWindowMod(Frame->OwnerWindow,SW_HIDE);
}
@@ -2155,10 +2155,10 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame) return(0);
}
- if (Frame->OwnerWindow&&Frame->OwnerWindow!=(HWND)-2 )
+ if (Frame->OwnerWindow&&Frame->OwnerWindow != (HWND)-2 )
{
RECT pr;
- POINT Off={0};
+ POINT Off = {0};
ClientToScreen(pcli->hwndContactList,&Off);
GetWindowRect(pcli->hwndContactList,&pr);
@@ -2172,19 +2172,19 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame) {
SetWindowPos(Frame->OwnerWindow,NULL,Frame->wndSize.left+Off.x,Frame->wndSize.top+Off.y,
Frame->wndSize.right-Frame->wndSize.left,
- Frame->wndSize.bottom-Frame->wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE ); //--=-=
+ Frame->wndSize.bottom-Frame->wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE ); //- -= -=
SetWindowPos(Frame->hWnd,NULL,0,0,
Frame->wndSize.right-Frame->wndSize.left,
Frame->wndSize.bottom-Frame->wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE);
}
// set titlebar position
- if(Frame->TitleBar.ShowTitleBar) {
+ if (Frame->TitleBar.ShowTitleBar) {
SetWindowPos(Frame->TitleBar.hwnd,NULL,Frame->wndSize.left,Frame->wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar,
Frame->wndSize.right-Frame->wndSize.left,
g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE );
}
- if ( Frame->visible && IsWindowVisible( pcli->hwndContactList ) && Frame->collapsed && Frame->wndSize.bottom-Frame->wndSize.top != 0 )
+ if ( Frame->visible && IsWindowVisible( pcli->hwndContactList ) && Frame->collapsed && Frame->wndSize.bottom-Frame->wndSize.top !=0 )
{
ShowWindow( Frame->OwnerWindow, SW_SHOW );
ShowWindow( Frame->hWnd, SW_SHOW );
@@ -2198,7 +2198,7 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame) Frame->wndSize.right-Frame->wndSize.left,
Frame->wndSize.bottom-Frame->wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE);
// set titlebar position
- if(Frame->TitleBar.ShowTitleBar) {
+ if (Frame->TitleBar.ShowTitleBar) {
SetWindowPos(Frame->TitleBar.hwnd,NULL,Frame->wndSize.left,Frame->wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar,
Frame->wndSize.right-Frame->wndSize.left,
g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE);
@@ -2212,17 +2212,17 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame) static BOOL CLUIFramesFitInSize(void)
{
int i;
- int sumheight=0;
- int tbh=0; // title bar height
+ int sumheight = 0;
+ int tbh = 0; // title bar height
int clientfrm;
- clientfrm=CLUIFramesGetalClientFrame();
- if(clientfrm!=-1)
- tbh=g_nTitleBarHeight*btoint(g_pfwFrames[clientfrm].TitleBar.ShowTitleBar);
-
- for(i=0;i<g_nFramesCount;i++) {
- if ((g_pfwFrames[i].align!=alClient)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
- sumheight+=(g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar))+2/*+btoint(Frames[i].UseBorder)*2*/;
- if(sumheight>_nContactListHeight-tbh-2)
+ clientfrm = CLUIFramesGetalClientFrame();
+ if (clientfrm != -1)
+ tbh = g_nTitleBarHeight*btoint(g_pfwFrames[clientfrm].TitleBar.ShowTitleBar);
+
+ for(i = 0;i < g_nFramesCount;i++) {
+ if ((g_pfwFrames[i].align != alClient)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
+ 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)
{
@@ -2237,53 +2237,53 @@ static BOOL CLUIFramesFitInSize(void) int CLUIFrames_GetTotalHeight()
{
int i;
- int sumheight=0;
+ int sumheight = 0;
RECT border;
- if(pcli->hwndContactList==NULL) return 0;
+ if (pcli->hwndContactList == NULL) return 0;
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
- if ((g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(pcli->hwndContactTree)&& (g_pfwFrames[i].hWnd!=pcli->hwndContactTree))
- sumheight+=(g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar));
+ if ((g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(pcli->hwndContactTree)&& (g_pfwFrames[i].hWnd != pcli->hwndContactTree))
+ sumheight += (g_pfwFrames[i].height)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar));
};
GetBorderSize(pcli->hwndContactList,&border);
//GetWindowRect(pcli->hwndContactList,&winrect);
//GetClientRect(pcli->hwndContactList,&clirect);
- // clirect.bottom-=clirect.top;
- // clirect.bottom+=border.top+border.bottom;
- //allbord=(winrect.bottom-winrect.top)-(clirect.bottom-clirect.top);
+ // clirect.bottom -= clirect.top;
+ // clirect.bottom += border.top+border.bottom;
+ //allbord = (winrect.bottom-winrect.top)-(clirect.bottom-clirect.top);
//TODO minsize
- sumheight+=g_CluiData.TopClientMargin;
- sumheight+=g_CluiData.BottomClientMargin;
+ sumheight += g_CluiData.TopClientMargin;
+ sumheight += g_CluiData.BottomClientMargin;
return max(db_get_w(NULL,"CLUI","MinHeight",SETTING_MINHEIGTH_DEFAULT),
(sumheight+border.top+border.bottom));
}
int CLUIFramesGetMinHeight()
{
- int i,tbh,clientfrm,sumheight=0;
+ int i,tbh,clientfrm,sumheight = 0;
RECT border;
- int allbord=0;
- if(pcli->hwndContactList==NULL) return 0;
+ int allbord = 0;
+ if (pcli->hwndContactList == NULL) return 0;
// search for alClient frame and get the titlebar's height
- tbh=0;
- clientfrm=CLUIFramesGetalClientFrame();
- if(clientfrm!=-1)
- tbh=g_nTitleBarHeight*btoint(g_pfwFrames[clientfrm].TitleBar.ShowTitleBar);
+ tbh = 0;
+ clientfrm = CLUIFramesGetalClientFrame();
+ if (clientfrm != -1)
+ tbh = g_nTitleBarHeight*btoint(g_pfwFrames[clientfrm].TitleBar.ShowTitleBar);
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
- if ((g_pfwFrames[i].align!=alClient)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating))
+ if ((g_pfwFrames[i].align != alClient)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating))
{
RECT wsize;
GetWindowRect(g_pfwFrames[i].hWnd,&wsize);
- sumheight+=(wsize.bottom-wsize.top)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar));
+ sumheight += (wsize.bottom-wsize.top)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar));
}
};
@@ -2291,13 +2291,13 @@ int CLUIFramesGetMinHeight() //GetWindowRect(pcli->hwndContactList,&winrect);
//GetClientRect(pcli->hwndContactList,&clirect);
- // clirect.bottom-=clirect.top;
- // clirect.bottom+=border.top+border.bottom;
- //allbord=(winrect.bottom-winrect.top)-(clirect.bottom-clirect.top);
+ // clirect.bottom -= clirect.top;
+ // clirect.bottom += border.top+border.bottom;
+ //allbord = (winrect.bottom-winrect.top)-(clirect.bottom-clirect.top);
//TODO minsize
- sumheight+=g_CluiData.TopClientMargin;
- sumheight+=g_CluiData.BottomClientMargin;
+ sumheight += g_CluiData.TopClientMargin;
+ sumheight += g_CluiData.BottomClientMargin;
return max(db_get_w(NULL,"CLUI","MinHeight",SETTING_MINHEIGTH_DEFAULT),
(sumheight+border.top+border.bottom+allbord+tbh) );
}
@@ -2307,66 +2307,66 @@ int CLUIFramesGetMinHeight() static int CLUIFramesResizeFrames(const RECT newsize)
{
- int sumheight=9999999,newheight;
+ int sumheight = 9999999,newheight;
int prevframe,prevframebottomline;
int tbh,curfrmtbh;
int drawitems;
int clientfrm;
int i,j;
- int sepw=GapBetweenFrames;
- int topBorder=newsize.top;
- int minHeight=CLUIFrames_GetTotalHeight();
+ int sepw = GapBetweenFrames;
+ int topBorder = newsize.top;
+ int minHeight = CLUIFrames_GetTotalHeight();
SortData *sdarray;
- g_CluiData.nGapBetweenTitlebar=(int)db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
- GapBetweenFrames=db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
- sepw=GapBetweenFrames;
+ g_CluiData.nGapBetweenTitlebar = (int)db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
+ GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
+ sepw = GapBetweenFrames;
- if(g_nFramesCount<1) return 0;
- newheight=newsize.bottom-newsize.top;
+ if (g_nFramesCount < 1) return 0;
+ newheight = newsize.bottom-newsize.top;
// search for alClient frame and get the titlebar's height
- tbh=0;
- clientfrm=CLUIFramesGetalClientFrame();
- if(clientfrm!=-1)
- tbh=(g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[clientfrm].TitleBar.ShowTitleBar);
+ tbh = 0;
+ clientfrm = CLUIFramesGetalClientFrame();
+ if (clientfrm != -1)
+ tbh = (g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[clientfrm].TitleBar.ShowTitleBar);
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
if (!g_pfwFrames[i].floating)
{
- g_pfwFrames[i].needhide=FALSE;
- g_pfwFrames[i].wndSize.left=newsize.left;
- g_pfwFrames[i].wndSize.right=newsize.right;
+ g_pfwFrames[i].needhide = FALSE;
+ g_pfwFrames[i].wndSize.left = newsize.left;
+ g_pfwFrames[i].wndSize.right = newsize.right;
};
};
{
//sorting stuff
- sdarray=(SortData*)malloc(sizeof(SortData)*g_nFramesCount);
- if (sdarray==NULL){return(-1);};
- for(i=0;i<g_nFramesCount;i++)
- {sdarray[i].order=g_pfwFrames[i].order;
- sdarray[i].realpos=i;
+ sdarray = (SortData*)malloc(sizeof(SortData)*g_nFramesCount);
+ if (sdarray == NULL){return(-1);};
+ for(i = 0;i < g_nFramesCount;i++)
+ {sdarray[i].order = g_pfwFrames[i].order;
+ sdarray[i].realpos = i;
};
qsort(sdarray,g_nFramesCount,sizeof(SortData),sortfunc);
}
- drawitems=g_nFramesCount;
+ drawitems = g_nFramesCount;
while(sumheight>(newheight-tbh)&&drawitems>0) {
- sumheight=0;
- drawitems=0;
- for(i=0;i<g_nFramesCount;i++) {
- if (((g_pfwFrames[i].align!=alClient))&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
+ sumheight = 0;
+ drawitems = 0;
+ for(i = 0;i < g_nFramesCount;i++) {
+ if (((g_pfwFrames[i].align != alClient))&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)) {
drawitems++;
- curfrmtbh=(g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
- sumheight+=(g_pfwFrames[i].height)+curfrmtbh+(i > 0 ? sepw : 0)+( (g_pfwFrames[i].UseBorder &&!g_CluiData.fLayered)?2:0);
- if(sumheight>newheight-tbh) {
- sumheight-=(g_pfwFrames[i].height)+curfrmtbh + (i > 0 ? sepw : 0);
- g_pfwFrames[i].needhide=!g_CluiData.fDocked && g_CluiData.fAutoSize?FALSE:TRUE;
+ curfrmtbh = (g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
+ sumheight += (g_pfwFrames[i].height)+curfrmtbh+(i > 0 ? sepw : 0)+( (g_pfwFrames[i].UseBorder &&!g_CluiData.fLayered)?2:0);
+ if (sumheight>newheight-tbh) {
+ sumheight -= (g_pfwFrames[i].height)+curfrmtbh + (i > 0 ? sepw : 0);
+ g_pfwFrames[i].needhide = !g_CluiData.fDocked && g_CluiData.fAutoSize?FALSE:TRUE;
drawitems--;
break;
}
@@ -2374,42 +2374,42 @@ static int CLUIFramesResizeFrames(const RECT newsize) }
}
- prevframe=-1;
- prevframebottomline=topBorder;
- for(j=0;j<g_nFramesCount;j++) {
+ prevframe = -1;
+ prevframebottomline = topBorder;
+ for(j = 0;j < g_nFramesCount;j++) {
//move all alTop frames
- i=sdarray[j].realpos;
- if ((!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(g_pfwFrames[i].align==alTop)) {
- curfrmtbh=(g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
- g_pfwFrames[i].wndSize.top=prevframebottomline+(i > 0 ? sepw : 0)+(curfrmtbh);
- g_pfwFrames[i].wndSize.bottom=g_pfwFrames[i].height+g_pfwFrames[i].wndSize.top+((g_pfwFrames[i].UseBorder &&!g_CluiData.fLayered)?2:0);
- g_pfwFrames[i].prevvisframe=prevframe;
- prevframe=i;
- prevframebottomline=g_pfwFrames[i].wndSize.bottom;
- if(prevframebottomline>newheight){
- //prevframebottomline-=Frames[i].height+(curfrmtbh+1);
- //Frames[i].needhide=TRUE;
+ i = sdarray[j].realpos;
+ if ((!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(g_pfwFrames[i].align == alTop)) {
+ curfrmtbh = (g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
+ g_pfwFrames[i].wndSize.top = prevframebottomline+(i > 0 ? sepw : 0)+(curfrmtbh);
+ g_pfwFrames[i].wndSize.bottom = g_pfwFrames[i].height+g_pfwFrames[i].wndSize.top+((g_pfwFrames[i].UseBorder &&!g_CluiData.fLayered)?2:0);
+ g_pfwFrames[i].prevvisframe = prevframe;
+ prevframe = i;
+ prevframebottomline = g_pfwFrames[i].wndSize.bottom;
+ if (prevframebottomline>newheight){
+ //prevframebottomline -= Frames[i].height+(curfrmtbh+1);
+ //Frames[i].needhide = TRUE;
}
}
}
- if(sumheight<newheight) {
- for(j=0;j<g_nFramesCount;j++) {
+ if (sumheight < newheight) {
+ for(j = 0;j < g_nFramesCount;j++) {
//move alClient frame
- i=sdarray[j].realpos;
- if ((!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(g_pfwFrames[i].align==alClient)) {
+ i = sdarray[j].realpos;
+ if ((!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating)&&(g_pfwFrames[i].visible)&&(g_pfwFrames[i].align == alClient)) {
int oldh;
- g_pfwFrames[i].wndSize.top=prevframebottomline+(j > 0 ? sepw : 0)+(tbh);
- g_pfwFrames[i].wndSize.bottom=g_pfwFrames[i].wndSize.top+newheight-sumheight-tbh-(j > 0 ? sepw : 0);
-
- oldh=g_pfwFrames[i].height;
- g_pfwFrames[i].height=g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top;
- g_pfwFrames[i].prevvisframe=prevframe;
- prevframe=i;
- prevframebottomline=g_pfwFrames[i].wndSize.bottom;
- if(prevframebottomline>newheight) {
- //prevframebottomline-=Frames[i].height+(tbh+1);
- //Frames[i].needhide=TRUE;
+ g_pfwFrames[i].wndSize.top = prevframebottomline+(j > 0 ? sepw : 0)+(tbh);
+ g_pfwFrames[i].wndSize.bottom = g_pfwFrames[i].wndSize.top+newheight-sumheight-tbh-(j > 0 ? sepw : 0);
+
+ oldh = g_pfwFrames[i].height;
+ g_pfwFrames[i].height = g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top;
+ g_pfwFrames[i].prevvisframe = prevframe;
+ prevframe = i;
+ prevframebottomline = g_pfwFrames[i].wndSize.bottom;
+ if (prevframebottomline>newheight) {
+ //prevframebottomline -= Frames[i].height+(tbh+1);
+ //Frames[i].needhide = TRUE;
}
break;
}
@@ -2417,28 +2417,28 @@ static int CLUIFramesResizeFrames(const RECT newsize) }
//newheight
- prevframebottomline=newheight+sepw+topBorder;
- //prevframe=-1;
- for(j=g_nFramesCount-1;j>=0;j--) {
+ prevframebottomline = newheight+sepw+topBorder;
+ //prevframe = -1;
+ for(j = g_nFramesCount-1;j >= 0;j--) {
//move all alBottom frames
- i=sdarray[j].realpos;
- if ((g_pfwFrames[i].visible)&&(!g_pfwFrames[i].floating)&&(!g_pfwFrames[i].needhide)&&(g_pfwFrames[i].align==alBottom)) {
- curfrmtbh=(g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
+ i = sdarray[j].realpos;
+ if ((g_pfwFrames[i].visible)&&(!g_pfwFrames[i].floating)&&(!g_pfwFrames[i].needhide)&&(g_pfwFrames[i].align == alBottom)) {
+ curfrmtbh = (g_nTitleBarHeight+g_CluiData.nGapBetweenTitlebar)*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar);
- g_pfwFrames[i].wndSize.bottom=prevframebottomline-(j > 0 ? sepw : 0);
- g_pfwFrames[i].wndSize.top=g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].height-((g_pfwFrames[i].UseBorder &&!g_CluiData.fLayered)?2:0);
- g_pfwFrames[i].prevvisframe=prevframe;
- prevframe=i;
- prevframebottomline=g_pfwFrames[i].wndSize.top/*-1*/-curfrmtbh;
- if(prevframebottomline>newheight) {
+ g_pfwFrames[i].wndSize.bottom = prevframebottomline-(j > 0 ? sepw : 0);
+ g_pfwFrames[i].wndSize.top = g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].height-((g_pfwFrames[i].UseBorder &&!g_CluiData.fLayered)?2:0);
+ g_pfwFrames[i].prevvisframe = prevframe;
+ prevframe = i;
+ prevframebottomline = g_pfwFrames[i].wndSize.top/*-1*/-curfrmtbh;
+ if (prevframebottomline>newheight) {
}
}
}
- for(i=0;i<g_nFramesCount;i++)
- if(g_pfwFrames[i].TitleBar.ShowTitleBar)
+ for(i = 0;i < g_nFramesCount;i++)
+ if (g_pfwFrames[i].TitleBar.ShowTitleBar)
SetRect(&g_pfwFrames[i].TitleBar.wndSize,g_pfwFrames[i].wndSize.left,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar,g_pfwFrames[i].wndSize.right,g_pfwFrames[i].wndSize.top-g_CluiData.nGapBetweenTitlebar);
- if (sdarray!=NULL){free(sdarray);sdarray=NULL;};
+ if (sdarray != NULL){free(sdarray);sdarray = NULL;};
@@ -2448,7 +2448,7 @@ static int CLUIFramesResizeFrames(const RECT newsize) static int SizeMoveNewSizes()
{
int i;
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
if (g_pfwFrames[i].floating){
@@ -2471,11 +2471,11 @@ static int CLUIFramesResize(RECT newsize) int CLUIFrames_ApplyNewSizes(int mode)
{
int i;
- g_CluiData.mutexPreventDockMoving=0;
- for(i=0;i<g_nFramesCount;i++) {
- if ( (mode==1 && g_pfwFrames[i].OwnerWindow!=(HWND)-2 && g_pfwFrames[i].OwnerWindow) ||
- (mode==2 && g_pfwFrames[i].OwnerWindow==(HWND)-2) ||
- (mode==3))
+ g_CluiData.mutexPreventDockMoving = 0;
+ for(i = 0;i < g_nFramesCount;i++) {
+ if ( (mode == 1 && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].OwnerWindow) ||
+ (mode == 2 && g_pfwFrames[i].OwnerWindow == (HWND)-2) ||
+ (mode == 3))
if (g_pfwFrames[i].floating){
CLUIFrameResizeFloatingFrame(i);
}else
@@ -2488,18 +2488,18 @@ int CLUIFrames_ApplyNewSizes(int mode) ske_DrawNonFramedObjects(1,0);
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,0,0);
}
- g_CluiData.mutexPreventDockMoving=1;
+ g_CluiData.mutexPreventDockMoving = 1;
return 0;
}
static int _us_DoUpdateFrame(WPARAM wParam,LPARAM lParam)
{
if (_fCluiFramesModuleNotStarted) return -1;
- if(wParam==-1) { CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0); return 0;}
- if(lParam&FU_FMPOS) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,1);
+ if (wParam == -1) { CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0); return 0;}
+ if (lParam&FU_FMPOS) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,1);
int pos = id2pos( wParam );
- if ( pos < 0 || pos >= g_nFramesCount ) { return -1; }
+ if ( pos < 0 || pos >= g_nFramesCount ) { return -1; }
if ( lParam&FU_TBREDRAW ) CLUIFramesForceUpdateTB( &g_pfwFrames[pos] );
if ( lParam&FU_FMREDRAW ) CLUIFramesForceUpdateFrame( &g_pfwFrames[pos] );
return 0;
@@ -2509,27 +2509,27 @@ int CLUIFrames_OnClistResize_mod(WPARAM wParam,LPARAM mode) {
RECT nRect;
int tick;
- GapBetweenFrames=db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
- g_CluiData.nGapBetweenTitlebar=db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
+ GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
+ g_CluiData.nGapBetweenTitlebar = db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
if (_fCluiFramesModuleNotStarted) return -1;
GetClientRect(pcli->hwndContactList,&nRect);
- nRect.left+=g_CluiData.LeftClientMargin;
- nRect.right-=g_CluiData.RightClientMargin;
- nRect.top+=g_CluiData.TopClientMargin;
- nRect.bottom-=g_CluiData.BottomClientMargin;
- // g_CluiData.mutexPreventDockMoving=0;
- tick=GetTickCount();
+ nRect.left += g_CluiData.LeftClientMargin;
+ nRect.right -= g_CluiData.RightClientMargin;
+ nRect.top += g_CluiData.TopClientMargin;
+ nRect.bottom -= g_CluiData.BottomClientMargin;
+ // g_CluiData.mutexPreventDockMoving = 0;
+ tick = GetTickCount();
CLUIFramesResize(nRect);
- if (mode==0) CLUIFrames_ApplyNewSizes(3);
+ if (mode == 0) CLUIFrames_ApplyNewSizes(3);
- tick=GetTickCount()-tick;
+ tick = GetTickCount()-tick;
Sleep(0);
//dont save to database too many times
- if(GetTickCount()-_dwLastStoreTick>1000){ CLUIFramesStoreAllFrames();_dwLastStoreTick=GetTickCount();};
+ if (GetTickCount()-_dwLastStoreTick>1000){ CLUIFramesStoreAllFrames();_dwLastStoreTick = GetTickCount();};
return 0;
}
@@ -2539,25 +2539,25 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) RECT nRect;
if (_fCluiFramesModuleNotStarted) return -1;
- g_CluiData.nGapBetweenTitlebar=(int)db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
- GapBetweenFrames=db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
- nRect.left=0;
- nRect.top=0;
- nRect.right=r->right-r->left;
- nRect.bottom=r->bottom-r->top;
- nRect.left+=g_CluiData.LeftClientMargin;
- nRect.right-=g_CluiData.RightClientMargin;
- nRect.top+=g_CluiData.TopClientMargin;
- nRect.bottom-=g_CluiData.BottomClientMargin;
+ g_CluiData.nGapBetweenTitlebar = (int)db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
+ GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
+ nRect.left = 0;
+ nRect.top = 0;
+ nRect.right = r->right-r->left;
+ nRect.bottom = r->bottom-r->top;
+ nRect.left += g_CluiData.LeftClientMargin;
+ nRect.right -= g_CluiData.RightClientMargin;
+ nRect.top += g_CluiData.TopClientMargin;
+ nRect.bottom -= g_CluiData.BottomClientMargin;
CLUIFramesResizeFrames(nRect);
{
int i;
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
int dx;
int dy;
- dx=0;//rcNewWindowRect.left-rcOldWindowRect.left;
- dy=0;//_window_rect.top-rcOldWindowRect.top;
+ dx = 0;//rcNewWindowRect.left-rcOldWindowRect.left;
+ dy = 0;//_window_rect.top-rcOldWindowRect.top;
if (!g_pfwFrames[i].floating)
{
if (g_pfwFrames[i].visible && !g_pfwFrames[i].needhide && !IsWindowVisible(g_pfwFrames[i].hWnd))
@@ -2565,19 +2565,19 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) ShowWindow(g_pfwFrames[i].hWnd,SW_SHOW);
if (g_pfwFrames[i].TitleBar.ShowTitleBar) ShowWindow(g_pfwFrames[i].TitleBar.hwnd,SW_SHOW);
}
- if (g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow)!=-2 )
+ if (g_pfwFrames[i].OwnerWindow && (INT_PTR)(g_pfwFrames[i].OwnerWindow) != -2 )
{
if (!(mode&2))
{
HWND hwnd;
- hwnd=GetParent(g_pfwFrames[i].OwnerWindow);
- *PosBatch=DeferWindowPos(*PosBatch,g_pfwFrames[i].OwnerWindow,NULL,g_pfwFrames[i].wndSize.left+r->left,g_pfwFrames[i].wndSize.top+r->top,
+ hwnd = GetParent(g_pfwFrames[i].OwnerWindow);
+ *PosBatch = DeferWindowPos(*PosBatch,g_pfwFrames[i].OwnerWindow,NULL,g_pfwFrames[i].wndSize.left+r->left,g_pfwFrames[i].wndSize.top+r->top,
g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE);
SetWindowPos(g_pfwFrames[i].hWnd,NULL,0,0,
g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE/*|SWP_NOSENDCHANGING*/);
}
//Frame
- if(g_pfwFrames[i].TitleBar.ShowTitleBar)
+ if (g_pfwFrames[i].TitleBar.ShowTitleBar)
{
SetWindowPos(g_pfwFrames[i].TitleBar.hwnd,NULL,g_pfwFrames[i].wndSize.left+dx,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar+dy,
g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left,g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE );
@@ -2587,18 +2587,18 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) }
else
{
- if(1)
+ if (1)
{
- int res=0;
+ int res = 0;
// set frame position
- res=SetWindowPos(g_pfwFrames[i].hWnd,NULL,g_pfwFrames[i].wndSize.left+dx,g_pfwFrames[i].wndSize.top+dy,
+ res = SetWindowPos(g_pfwFrames[i].hWnd,NULL,g_pfwFrames[i].wndSize.left+dx,g_pfwFrames[i].wndSize.top+dy,
g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left,
g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSENDCHANGING);
}
- if(1)
+ if (1)
{
// set titlebar position
- if(g_pfwFrames[i].TitleBar.ShowTitleBar)
+ if (g_pfwFrames[i].TitleBar.ShowTitleBar)
{
SetWindowPos(g_pfwFrames[i].TitleBar.hwnd,NULL,g_pfwFrames[i].wndSize.left+dx,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar+dy,
g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left,g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSENDCHANGING );
@@ -2607,15 +2607,15 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode) }
}
UpdateWindow(g_pfwFrames[i].hWnd);
- if(g_pfwFrames[i].TitleBar.ShowTitleBar) UpdateWindow(g_pfwFrames[i].TitleBar.hwnd);
+ if (g_pfwFrames[i].TitleBar.ShowTitleBar) UpdateWindow(g_pfwFrames[i].TitleBar.hwnd);
};
}
}
- if(GetTickCount()-_dwLastStoreTick>1000)
+ if (GetTickCount()-_dwLastStoreTick>1000)
{
CLUIFramesStoreAllFrames();
- _dwLastStoreTick=GetTickCount();
+ _dwLastStoreTick = GetTickCount();
};
}
return 0;
@@ -2626,29 +2626,29 @@ int CheckFramesPos(RECT *wr) //CALLED only FROM MainWindow procedure at CLUI.c
int i;
if (_fCluiFramesModuleNotStarted) return -1;
- g_CluiData.nGapBetweenTitlebar=(int)db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
- GapBetweenFrames=db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
+ g_CluiData.nGapBetweenTitlebar = (int)db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
+ GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
int dx;
int dy;
- dx=0;//rcNewWindowRect.left-rcOldWindowRect.left;
- dy=0;//_window_rect.top-rcOldWindowRect.top;
+ 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].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);
- if (r.top-wr->top!=g_pfwFrames[i].wndSize.top ||r.left-wr->left!=g_pfwFrames[i].wndSize.left)
+ if (r.top-wr->top != g_pfwFrames[i].wndSize.top ||r.left-wr->left != g_pfwFrames[i].wndSize.left)
SetWindowPos(g_pfwFrames[i].hWnd,NULL,g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.top,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
}
if (g_pfwFrames[i].TitleBar.ShowTitleBar)
{
RECT r;
GetWindowRect(g_pfwFrames[i].TitleBar.hwnd,&r);
- if (r.top-wr->top!=g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar || r.left-wr->left!=g_pfwFrames[i].wndSize.left)
+ if (r.top-wr->top != g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar || r.left-wr->left != g_pfwFrames[i].wndSize.left)
{
SetWindowPos(g_pfwFrames[i].TitleBar.hwnd,NULL,g_pfwFrames[i].wndSize.left+dx,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar+dy,
g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left,g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE);
@@ -2665,8 +2665,8 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam) {
RECT nRect;
int tick;
- GapBetweenFrames=db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
- g_CluiData.nGapBetweenTitlebar=db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
+ GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
+ g_CluiData.nGapBetweenTitlebar = db_get_dw(NULL,"CLUIFrames","GapBetweenTitleBar",SETTING_GAPTITLEBAR_DEFAULT);
if (_fCluiFramesModuleNotStarted) return -1;
@@ -2675,70 +2675,70 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam) RECT mainRect;
int mainHeight, minHeight;
GetWindowRect(pcli->hwndContactList,&mainRect);
- mainHeight=mainRect.bottom-mainRect.top;
- minHeight=CLUIFrames_GetTotalHeight();
- if (mainHeight<minHeight)
+ mainHeight = mainRect.bottom-mainRect.top;
+ minHeight = CLUIFrames_GetTotalHeight();
+ if (mainHeight < minHeight)
{
- BOOL Upward=FALSE;
- Upward=!g_CluiData.fDocked && g_CluiData.fAutoSize&&db_get_b(NULL,"CLUI","AutoSizeUpward",SETTING_AUTOSIZEUPWARD_DEFAULT);
+ BOOL Upward = FALSE;
+ Upward = !g_CluiData.fDocked && g_CluiData.fAutoSize&&db_get_b(NULL,"CLUI","AutoSizeUpward",SETTING_AUTOSIZEUPWARD_DEFAULT);
if (Upward)
- mainRect.top=mainRect.bottom-minHeight;
+ mainRect.top = mainRect.bottom-minHeight;
else
- mainRect.bottom=mainRect.top+minHeight;
+ mainRect.bottom = mainRect.top+minHeight;
SetWindowPos(pcli->hwndContactList,NULL,mainRect.left,mainRect.top,mainRect.right-mainRect.left, mainRect.bottom-mainRect.top, SWP_NOZORDER|SWP_NOREDRAW|SWP_NOACTIVATE|SWP_NOSENDCHANGING);
}
GetWindowRect(pcli->hwndContactList,&mainRect);
- mainHeight=mainRect.bottom-mainRect.top;
- //if (mainHeight<minHeight)
+ mainHeight = mainRect.bottom-mainRect.top;
+ //if (mainHeight < minHeight)
// DebugBreak();
}
GetClientRect(pcli->hwndContactList,&nRect);
//$$$ Fixed borders
- if (lParam && lParam!=1 && lParam!=2)
+ if (lParam && lParam != 1 && lParam != 2)
{
RECT oldRect;
POINT pt;
- RECT * newRect=(RECT *)lParam;
+ RECT * newRect = (RECT *)lParam;
int dl,dt,dr,db;
GetWindowRect((HWND)wParam,&oldRect);
- pt.x=nRect.left;
- pt.y=nRect.top;
+ pt.x = nRect.left;
+ pt.y = nRect.top;
ClientToScreen(pcli->hwndContactList,&pt);
- dl=pt.x-oldRect.left;
- dt=pt.y-oldRect.top;
- dr=(oldRect.right-oldRect.left)-(nRect.right-nRect.left)-dl;
- db=(oldRect.bottom-oldRect.top)-(nRect.bottom-nRect.top)-dt;
- nRect.left=newRect->left+dl;
- nRect.top=newRect->top+dt;
- nRect.bottom=newRect->bottom-db;
- nRect.right=newRect->right-dr;
+ dl = pt.x-oldRect.left;
+ dt = pt.y-oldRect.top;
+ dr = (oldRect.right-oldRect.left)-(nRect.right-nRect.left)-dl;
+ db = (oldRect.bottom-oldRect.top)-(nRect.bottom-nRect.top)-dt;
+ nRect.left = newRect->left+dl;
+ nRect.top = newRect->top+dt;
+ nRect.bottom = newRect->bottom-db;
+ nRect.right = newRect->right-dr;
}
- //if(DBGetContactSettingByte(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT))GetWindowRect(pcli->hwndStatus,&rcStatus);
- //else rcStatus.top=rcStatus.bottom=0;
+ //if (DBGetContactSettingByte(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT))GetWindowRect(pcli->hwndStatus,&rcStatus);
+ //else rcStatus.top = rcStatus.bottom = 0;
// nRect.top--;
- /* $$$ rcStatus.top=rcStatus.bottom=0;
+ /* $$$ rcStatus.top = rcStatus.bottom = 0;
- nRect.bottom-=nRect.top;
- nRect.bottom-=(rcStatus.bottom-rcStatus.top);
- nRect.right-=nRect.left;
- nRect.left=0;
- nRect.top=0;
- ContactListHeight=nRect.bottom; $$$*/
+ nRect.bottom -= nRect.top;
+ nRect.bottom -= (rcStatus.bottom-rcStatus.top);
+ nRect.right -= nRect.left;
+ nRect.left = 0;
+ nRect.top = 0;
+ ContactListHeight = nRect.bottom; $$$*/
- nRect.left+=g_CluiData.LeftClientMargin;
- nRect.right-=g_CluiData.RightClientMargin;
- nRect.top+=g_CluiData.TopClientMargin;
- nRect.bottom-=g_CluiData.BottomClientMargin;
+ nRect.left += g_CluiData.LeftClientMargin;
+ nRect.right -= g_CluiData.RightClientMargin;
+ nRect.top += g_CluiData.TopClientMargin;
+ nRect.bottom -= g_CluiData.BottomClientMargin;
- if (nRect.bottom<nRect.top)
- nRect.bottom=nRect.top;
- _nContactListHeight=nRect.bottom-nRect.top; //$$
+ if (nRect.bottom < nRect.top)
+ nRect.bottom = nRect.top;
+ _nContactListHeight = nRect.bottom-nRect.top; //$$
- tick=GetTickCount();
+ tick = GetTickCount();
CLUIFramesResize(nRect);
@@ -2746,20 +2746,20 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam) CLUIFrames_ApplyNewSizes(2);
CLUIFrames_ApplyNewSizes(1);
- //resizing=FALSE;
+ //resizing = FALSE;
- tick=GetTickCount()-tick;
+ tick = GetTickCount()-tick;
- if (pcli->hwndContactList!=0) CLUI__cliInvalidateRect(pcli->hwndContactList,NULL,TRUE);
- if (pcli->hwndContactList!=0) UpdateWindow(pcli->hwndContactList);
+ if (pcli->hwndContactList != 0) CLUI__cliInvalidateRect(pcli->hwndContactList,NULL,TRUE);
+ if (pcli->hwndContactList != 0) UpdateWindow(pcli->hwndContactList);
- if(lParam==2) RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_UPDATENOW|RDW_ALLCHILDREN|RDW_ERASE|RDW_INVALIDATE);
+ if (lParam == 2) RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_UPDATENOW|RDW_ALLCHILDREN|RDW_ERASE|RDW_INVALIDATE);
Sleep(0);
//dont save to database too many times
- if(GetTickCount()-_dwLastStoreTick>1000){ CLUIFramesStoreAllFrames();_dwLastStoreTick=GetTickCount();};
+ if (GetTickCount()-_dwLastStoreTick>1000){ CLUIFramesStoreAllFrames();_dwLastStoreTick = GetTickCount();};
return 0;
}
@@ -2768,24 +2768,24 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam) {
if (MirandaExiting()) return 0;
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
- AlignCOLLIconToLeft=db_get_b(NULL,"FrameTitleBar","AlignCOLLIconToLeft",CLCDEFAULT_COLLICONTOLEFT);
+ AlignCOLLIconToLeft = db_get_b(NULL,"FrameTitleBar","AlignCOLLIconToLeft",CLCDEFAULT_COLLICONTOLEFT);
- bkColour=sttGetColor("FrameTitleBar","BkColour",CLCDEFAULT_BKCOLOUR);
- bkUseWinColours=db_get_b(NULL,"FrameTitleBar","UseWinColours",CLCDEFAULT_USEWINDOWSCOLOURS);
- SelBkColour=sttGetColor("FrameTitleBar","TextColour",CLCDEFAULT_TEXTCOLOUR);
- if(hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground=NULL;}
+ bkColour = sttGetColor("FrameTitleBar","BkColour",CLCDEFAULT_BKCOLOUR);
+ bkUseWinColours = db_get_b(NULL,"FrameTitleBar","UseWinColours",CLCDEFAULT_USEWINDOWSCOLOURS);
+ SelBkColour = sttGetColor("FrameTitleBar","TextColour",CLCDEFAULT_TEXTCOLOUR);
+ if (hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground = NULL;}
if (g_CluiData.fDisableSkinEngine)
{
- if(db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
+ if (db_get_b(NULL,"FrameTitleBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
if (!DBGetContactSettingString(NULL,"FrameTitleBar","BkBitmap",&dbv)) {
- hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
+ hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
//mir_free_and_nill(dbv.pszVal);
db_free(&dbv);
}
}
- backgroundBmpUse=db_get_w(NULL,"FrameTitleBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ backgroundBmpUse = db_get_w(NULL,"FrameTitleBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
}
};
@@ -2801,48 +2801,48 @@ void DrawBackGround(HWND hwnd,HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColou HDC hdcMem,hdc;
RECT clRect,*rcPaint;
- int yScroll=0;
+ int yScroll = 0;
int y;
- PAINTSTRUCT paintst={0};
+ PAINTSTRUCT paintst = {0};
HBITMAP hBmpOsb,hOldBmp;
- DWORD style=GetWindowLongPtr(hwnd,GWL_STYLE);
- int grey=0;
+ DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
+ int grey = 0;
HFONT oFont;
- HBRUSH hBrushAlternateGrey=NULL;
+ HBRUSH hBrushAlternateGrey = NULL;
HFONT hFont;
//InvalidateRect(hwnd,0,FALSE);
- hFont=(HFONT)SendMessage(hwnd,WM_GETFONT,0,0);
+ hFont = (HFONT)SendMessage(hwnd,WM_GETFONT,0,0);
if (mhdc)
{
- hdc=mhdc;
- rcPaint=NULL;
+ hdc = mhdc;
+ rcPaint = NULL;
}
else
{
- hdc=BeginPaint(hwnd,&paintst);
- rcPaint=&(paintst.rcPaint);
+ hdc = BeginPaint(hwnd,&paintst);
+ rcPaint = &(paintst.rcPaint);
}
GetClientRect(hwnd,&clRect);
- if(rcPaint==NULL) rcPaint=&clRect;
- if (rcPaint->right-rcPaint->left==0||rcPaint->top-rcPaint->bottom==0) rcPaint=&clRect;
- y=-yScroll;
- hdcMem=CreateCompatibleDC(hdc);
- hBmpOsb=CreateBitmap(clRect.right,clRect.bottom,1,GetDeviceCaps(hdc,BITSPIXEL),NULL);
- hOldBmp=(HBITMAP)SelectObject(hdcMem,hBmpOsb);
- oFont=(HFONT)SelectObject(hdcMem,hFont);
+ if (rcPaint == NULL) rcPaint = &clRect;
+ if (rcPaint->right-rcPaint->left == 0||rcPaint->top-rcPaint->bottom == 0) rcPaint = &clRect;
+ y = -yScroll;
+ hdcMem = CreateCompatibleDC(hdc);
+ hBmpOsb = CreateBitmap(clRect.right,clRect.bottom,1,GetDeviceCaps(hdc,BITSPIXEL),NULL);
+ hOldBmp = (HBITMAP)SelectObject(hdcMem,hBmpOsb);
+ oFont = (HFONT)SelectObject(hdcMem,hFont);
SetBkMode(hdcMem,TRANSPARENT);
SetStretchBltMode(hdcMem,HALFTONE);
{ HBRUSH hBrush;
- hBrush=CreateSolidBrush(bkColour);
+ hBrush = CreateSolidBrush(bkColour);
FillRect(hdcMem,rcPaint,hBrush);
DeleteObject(hBrush);
- if(hBmpBackground) {
+ if (hBmpBackground) {
BITMAP bmp;
HDC hdcBmp;
int x,y;
@@ -2850,57 +2850,57 @@ void DrawBackGround(HWND hwnd,HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColou int destw,desth;
GetObject(hBmpBackground,sizeof(bmp),&bmp);
- hdcBmp=CreateCompatibleDC(hdcMem);
+ hdcBmp = CreateCompatibleDC(hdcMem);
SelectObject(hdcBmp,hBmpBackground);
- y=backgroundBmpUse&CLBF_SCROLL?-yScroll:0;
- maxx=backgroundBmpUse&CLBF_TILEH?clRect.right:1;
- maxy=backgroundBmpUse&CLBF_TILEV?maxy=rcPaint->bottom:y+1;
+ y = backgroundBmpUse&CLBF_SCROLL?-yScroll:0;
+ maxx = backgroundBmpUse&CLBF_TILEH?clRect.right:1;
+ maxy = backgroundBmpUse&CLBF_TILEV?maxy = rcPaint->bottom:y+1;
switch(backgroundBmpUse&CLBM_TYPE) {
case CLB_STRETCH:
- if(backgroundBmpUse&CLBF_PROPORTIONAL) {
- if(clRect.right*bmp.bmHeight<clRect.bottom*bmp.bmWidth) {
- desth=clRect.bottom;
- destw=desth*bmp.bmWidth/bmp.bmHeight;
+ if (backgroundBmpUse&CLBF_PROPORTIONAL) {
+ if (clRect.right*bmp.bmHeight < clRect.bottom*bmp.bmWidth) {
+ desth = clRect.bottom;
+ destw = desth*bmp.bmWidth/bmp.bmHeight;
}
else {
- destw=clRect.right;
- desth=destw*bmp.bmHeight/bmp.bmWidth;
+ destw = clRect.right;
+ desth = destw*bmp.bmHeight/bmp.bmWidth;
}
}
else {
- destw=clRect.right;
- desth=clRect.bottom;
+ destw = clRect.right;
+ desth = clRect.bottom;
}
break;
case CLB_STRETCHH:
- if(backgroundBmpUse&CLBF_PROPORTIONAL) {
- destw=clRect.right;
- desth=destw*bmp.bmHeight/bmp.bmWidth;
+ if (backgroundBmpUse&CLBF_PROPORTIONAL) {
+ destw = clRect.right;
+ desth = destw*bmp.bmHeight/bmp.bmWidth;
}
else {
- destw=clRect.right;
- desth=bmp.bmHeight;
+ destw = clRect.right;
+ desth = bmp.bmHeight;
}
break;
case CLB_STRETCHV:
- if(backgroundBmpUse&CLBF_PROPORTIONAL) {
- desth=clRect.bottom;
- destw=desth*bmp.bmWidth/bmp.bmHeight;
+ if (backgroundBmpUse&CLBF_PROPORTIONAL) {
+ desth = clRect.bottom;
+ destw = desth*bmp.bmWidth/bmp.bmHeight;
}
else {
- destw=bmp.bmWidth;
- desth=clRect.bottom;
+ destw = bmp.bmWidth;
+ desth = clRect.bottom;
}
break;
default: //clb_topleft
- destw=bmp.bmWidth;
- desth=bmp.bmHeight;
+ destw = bmp.bmWidth;
+ desth = bmp.bmHeight;
break;
}
- desth=clRect.bottom -clRect.top;
- for (;y<maxy;y+=desth) {
- if(y<rcPaint->top-desth) continue;
- for(x=0;x<maxx;x+=destw)
+ desth = clRect.bottom -clRect.top;
+ for (;y < maxy;y += desth) {
+ if (y < rcPaint->top-desth) continue;
+ for(x = 0;x < maxx;x += destw)
StretchBlt(hdcMem,x,y,destw,desth,hdcBmp,0,0,bmp.bmWidth,bmp.bmHeight,SRCCOPY);
}
DeleteDC(hdcBmp);
@@ -2915,7 +2915,7 @@ void DrawBackGround(HWND hwnd,HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColou SelectObject(hdcMem,oFont);
DeleteObject(hBmpOsb);
DeleteDC(hdcMem);
- paintst.fErase=FALSE;
+ paintst.fErase = FALSE;
//DeleteObject(hFont);
if (!mhdc)
{
@@ -2928,43 +2928,43 @@ void DrawBackGround(HWND hwnd,HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColou int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid)
{
int pos;
- BOOL bThemed=FALSE;
+ BOOL bThemed = FALSE;
HDC hdcMem;
HFONT hoTTBFont;
- RECT rc=*rect;
+ RECT rc = *rect;
HBRUSH hBack,hoBrush;
- HBITMAP b1=NULL,b2=NULL;
- hdcMem=CreateCompatibleDC(hdcMem2);
+ HBITMAP b1 = NULL,b2 = NULL;
+ hdcMem = CreateCompatibleDC(hdcMem2);
SetBkMode(hdcMem,TRANSPARENT);
- hoTTBFont=(HFONT)SelectObject(hdcMem,_hTitleBarFont);
+ hoTTBFont = (HFONT)SelectObject(hdcMem,_hTitleBarFont);
ske_ResetTextEffect(hdcMem);
ske_ResetTextEffect(hdcMem2);
- hBack=GetSysColorBrush(COLOR_3DFACE);
- hoBrush=(HBRUSH)SelectObject(hdcMem,hBack);
+ hBack = GetSysColorBrush(COLOR_3DFACE);
+ hoBrush = (HBRUSH)SelectObject(hdcMem,hBack);
- pos=id2pos(Frameid);
+ pos = id2pos(Frameid);
- if (pos>=0&&pos<g_nFramesCount)
+ if (pos >= 0&&pos < g_nFramesCount)
{
GetClientRect(g_pfwFrames[pos].TitleBar.hwnd,&rc);
if (g_pfwFrames[pos].floating)
{
- rc.bottom=rc.top+g_nTitleBarHeight;
- g_pfwFrames[pos].TitleBar.wndSize=rc;
+ rc.bottom = rc.top+g_nTitleBarHeight;
+ g_pfwFrames[pos].TitleBar.wndSize = rc;
}
else
{
- g_pfwFrames[pos].TitleBar.wndSize=rc;
+ g_pfwFrames[pos].TitleBar.wndSize = rc;
}
- b1=ske_CreateDIB32(rc.right-rc.left,rc.bottom-rc.top);
- b2=(HBITMAP)SelectObject(hdcMem,b1);
+ b1 = ske_CreateDIB32(rc.right-rc.left,rc.bottom-rc.top);
+ b2 = (HBITMAP)SelectObject(hdcMem,b1);
if ( g_pfwFrames[pos].floating && !g_CluiData.fDisableSkinEngine)
{
FillRect(hdcMem,&rc,hBack);
//SelectObject(hdcMem,hoBrush);
- SkinDrawGlyph(hdcMem,&rc,&rc,"Main,ID=FrameCaption");
+ SkinDrawGlyph(hdcMem,&rc,&rc,"Main,ID = FrameCaption");
}
else
{
@@ -2972,10 +2972,10 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid) {
if (!hBmpBackground && bkUseWinColours && xpt_IsThemed(_hFrameTitleTheme))
{
- int state=CS_ACTIVE;
- // if (GetForegroundWindow()!=pcli->hwndContactList) state=CS_INACTIVE;
+ int state = CS_ACTIVE;
+ // if (GetForegroundWindow() != pcli->hwndContactList) state = CS_INACTIVE;
xpt_DrawThemeBackground(_hFrameTitleTheme,hdcMem, WP_SMALLCAPTION, state, &rc,&rc);
- bThemed=TRUE;
+ bThemed = TRUE;
}
else
DrawBackGround(g_pfwFrames[pos].TitleBar.hwnd,hdcMem, hBmpBackground, bkColour, backgroundBmpUse);
@@ -2985,34 +2985,34 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid) ske_BltBackImage(g_pfwFrames[pos].TitleBar.hwnd,hdcMem,&rc);
}
else BitBlt(hdcMem,0,0,rc.right-rc.left,rc.bottom-rc.top,hdcMem2,rect->left,rect->top,SRCCOPY);
- SkinDrawGlyph(hdcMem,&rc,&rc,"Main,ID=FrameCaption");
+ SkinDrawGlyph(hdcMem,&rc,&rc,"Main,ID = FrameCaption");
}
if (bThemed)
SetTextColor(hdcMem,GetSysColor(COLOR_CAPTIONTEXT ));
else
SetTextColor(hdcMem,SelBkColour);
{
- RECT textrc=rc;
+ RECT textrc = rc;
if (!AlignCOLLIconToLeft)
{
- if(g_pfwFrames[pos].TitleBar.hicon!=NULL)
+ if (g_pfwFrames[pos].TitleBar.hicon != NULL)
{
mod_DrawIconEx_helper(hdcMem,rc.left +2,rc.top+((g_nTitleBarHeight>>1)-(GetSystemMetrics(SM_CYSMICON)>>1)),g_pfwFrames[pos].TitleBar.hicon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
- textrc.left+=GetSystemMetrics(SM_CXSMICON)+4;
- textrc.top+=2;
+ textrc.left += GetSystemMetrics(SM_CXSMICON)+4;
+ textrc.top += 2;
}
else
{
- textrc.left+=2;
- textrc.top+=2;
+ textrc.left += 2;
+ textrc.top += 2;
}
}
else
{
- textrc.left+=GetSystemMetrics(SM_CXSMICON)+2;
- textrc.top+=2;
+ textrc.left += GetSystemMetrics(SM_CXSMICON)+2;
+ textrc.top += 2;
}
ske_TextOut(hdcMem,textrc.left,textrc.top,g_pfwFrames[pos].TitleBar.tbname,lstrlen(g_pfwFrames[pos].TitleBar.tbname));
@@ -3029,10 +3029,10 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid) }
{
- BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
if (g_pfwFrames[pos].floating || (!g_CluiData.fLayered))
{
- HRGN rgn=CreateRectRgn(rect->left,rect->top,rect->right,rect->bottom);
+ HRGN rgn = CreateRectRgn(rect->left,rect->top,rect->right,rect->bottom);
SelectClipRgn(hdcMem2,rgn);
BitBlt(hdcMem2,rect->left,rect->top,rc.right-rc.left,rc.bottom-rc.top,hdcMem,0,0,SRCCOPY);
DeleteObject(rgn);
@@ -3051,15 +3051,15 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid) }
static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- static int s_nLastByPos = -1;
- static int s_nOldFrameHeight = -1;
- static int s_nCurDragBar = -1;
+ static int s_nLastByPos = -1;
+ static int s_nOldFrameHeight = -1;
+ static int s_nCurDragBar = -1;
RECT rect;
int Frameid,Framemod,direction;
int xpos,ypos;
- Frameid=(GetWindowLongPtr(hwnd,GWLP_USERDATA));
+ Frameid = (GetWindowLongPtr(hwnd,GWLP_USERDATA));
memset(&rect,0,sizeof(rect));
@@ -3067,7 +3067,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam {
case WM_CREATE:
if (!_hFrameTitleTheme)
- _hFrameTitleTheme=xpt_AddThemeHandle(hwnd,L"WINDOW");
+ _hFrameTitleTheme = xpt_AddThemeHandle(hwnd,L"WINDOW");
SendMessage(hwnd,WM_SETFONT,(WPARAM)_hTitleBarFont,0);
return FALSE;
case WM_MEASUREITEM:
@@ -3077,7 +3077,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam case WM_USER+100:
return 1;
case WM_ENABLE:
- if (hwnd!=0) CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
+ if (hwnd != 0) CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
return 0;
case WM_ERASEBKGND:
{
@@ -3097,20 +3097,20 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam };
- if(HIWORD(wParam)==0) {//mouse events for self created menu
- int framepos=id2pos(Frameid);
- if (framepos==-1){break;};
+ if (HIWORD(wParam) == 0) {//mouse events for self created menu
+ int framepos = id2pos(Frameid);
+ if (framepos == -1){break;};
switch(LOWORD(wParam))
{
case frame_menu_lock:
- g_pfwFrames[framepos].Locked=!g_pfwFrames[framepos].Locked;
+ g_pfwFrames[framepos].Locked = !g_pfwFrames[framepos].Locked;
break;
case frame_menu_visible:
- g_pfwFrames[framepos].visible=!g_pfwFrames[framepos].visible;
+ g_pfwFrames[framepos].visible = !g_pfwFrames[framepos].visible;
break;
case frame_menu_showtitlebar:
- g_pfwFrames[framepos].TitleBar.ShowTitleBar=!g_pfwFrames[framepos].TitleBar.ShowTitleBar;
+ g_pfwFrames[framepos].TitleBar.ShowTitleBar = !g_pfwFrames[framepos].TitleBar.ShowTitleBar;
break;
case frame_menu_floating:
CLUIFrames_SetFrameFloat(Frameid,0);
@@ -3128,15 +3128,15 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam if (ServiceExists(MS_CLIST_MENUBUILDFRAMECONTEXT))
{
- hmenu=(HMENU)CallService(MS_CLIST_MENUBUILDFRAMECONTEXT,Frameid,0);
+ hmenu = (HMENU)CallService(MS_CLIST_MENUBUILDFRAMECONTEXT,Frameid,0);
}
else
{//legacy menu support
- int framepos=id2pos(Frameid);
+ int framepos = id2pos(Frameid);
- if (framepos==-1){break;};
- hmenu=CreatePopupMenu();
- // Frames[Frameid].TitleBar.hmenu=hmenu;
+ if (framepos == -1){break;};
+ hmenu = CreatePopupMenu();
+ // Frames[Frameid].TitleBar.hmenu = hmenu;
AppendMenu(hmenu,MF_STRING|MF_DISABLED|MF_GRAYED,15,g_pfwFrames[framepos].Name);
AppendMenu(hmenu,MF_SEPARATOR,16,_T(""));
@@ -3156,7 +3156,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam {AppendMenu(hmenu,MF_STRING|MF_CHECKED,frame_menu_floating,TranslateT("Floating"));}
else{AppendMenu(hmenu,MF_STRING,frame_menu_floating,TranslateT("Floating"));};
- //err=GetMenuItemCount(hmenu)
+ //err = GetMenuItemCount(hmenu)
};
@@ -3166,32 +3166,32 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam break;
case WM_LBUTTONDBLCLK:
{
- Framemod=-1;
- s_nLastByPos=-1;s_nOldFrameHeight=-1;ReleaseCapture();
+ Framemod = -1;
+ s_nLastByPos = -1;s_nOldFrameHeight = -1;ReleaseCapture();
CallService(MS_CLIST_FRAMES_UCOLLFRAME,Frameid,0);
- s_nLastByPos=-1;s_nOldFrameHeight=-1;ReleaseCapture();
+ s_nLastByPos = -1;s_nOldFrameHeight = -1;ReleaseCapture();
}
break;
case WM_LBUTTONUP:
{
- if(GetCapture()!=hwnd){break;};
- s_nCurDragBar=-1;s_nLastByPos=-1;s_nOldFrameHeight=-1;ReleaseCapture();
+ if (GetCapture() != hwnd){break;};
+ s_nCurDragBar = -1;s_nLastByPos = -1;s_nOldFrameHeight = -1;ReleaseCapture();
break;
};
case WM_LBUTTONDOWN:
{
- int framepos=id2pos(Frameid);
+ int framepos = id2pos(Frameid);
- if (framepos==-1){break;};
+ if (framepos == -1){break;};
{
if (g_pfwFrames[framepos].floating)
{
POINT pt;
GetCursorPos(&pt);
- g_pfwFrames[framepos].TitleBar.oldpos=pt;
+ g_pfwFrames[framepos].TitleBar.oldpos = pt;
};
};
@@ -3202,9 +3202,9 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam if (db_get_b(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT)) {
POINT pt;
int res;
- //pt=nm->pt;
+ //pt = nm->pt;
GetCursorPos(&pt);
- res=SendMessage(GetParent(hwnd), WM_SYSCOMMAND, SC_MOVE|HTCAPTION,MAKELPARAM(pt.x,pt.y));
+ res = SendMessage(GetParent(hwnd), WM_SYSCOMMAND, SC_MOVE|HTCAPTION,MAKELPARAM(pt.x,pt.y));
return res;
}
};
@@ -3216,8 +3216,8 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam //ClientToScreen(hwnd,&ptOld);
GetWindowRect( hwnd, &rc );
- nLeft = (short)rc.left;
- nTop = (short)rc.top;
+ nLeft = (short)rc.left;
+ nTop = (short)rc.top;
};
SetCapture(hwnd);
@@ -3235,9 +3235,9 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam char TBcapt[255];
- pos=id2pos(Frameid);
+ pos = id2pos(Frameid);
- if (pos!=-1)
+ if (pos != -1)
{
int oldflags;
@@ -3249,10 +3249,10 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam g_pfwFrames[pos].order
);
- oldflags=CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,g_pfwFrames[pos].id),(LPARAM)0);
+ oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,g_pfwFrames[pos].id),(LPARAM)0);
if (!(oldflags&F_SHOWTBTIP))
{
- oldflags|=F_SHOWTBTIP;
+ oldflags |= F_SHOWTBTIP;
//CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,Frames[pos].id),(LPARAM)oldflags);
};
//CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_TBTIPNAME,Frames[pos].id),(LPARAM)TBcapt);
@@ -3267,40 +3267,40 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam RECT rcMiranda;
RECT rcwnd,rcOverlap;
POINT newpt,ofspt,curpt,newpos;
- //if(GetCapture()!=hwnd){break;};
- //curdragbar=-1;lbypos=-1;oldframeheight=-1;ReleaseCapture();
+ //if (GetCapture() != hwnd){break;};
+ //curdragbar = -1;lbypos = -1;oldframeheight = -1;ReleaseCapture();
- pos=id2pos(Frameid);
+ pos = id2pos(Frameid);
if (g_pfwFrames[pos].floating)
{
GetCursorPos(&curpt);
- rcwnd.bottom=curpt.y+5;
- rcwnd.top=curpt.y;
- rcwnd.left=curpt.x;
- rcwnd.right=curpt.x+5;
+ rcwnd.bottom = curpt.y+5;
+ rcwnd.top = curpt.y;
+ rcwnd.left = curpt.x;
+ rcwnd.right = curpt.x+5;
GetWindowRect(pcli->hwndContactList, &rcMiranda );
//GetWindowRect( Frames[pos].ContainerWnd, &rcwnd );
//IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )
if (IsWindowVisible(pcli->hwndContactList) &&IntersectRect( &rcOverlap, &rcwnd, &rcMiranda ))
{
- int id=g_pfwFrames[pos].id;
+ int id = g_pfwFrames[pos].id;
- ofspt.x=0;ofspt.y=0;
+ ofspt.x = 0;ofspt.y = 0;
ClientToScreen(g_pfwFrames[pos].TitleBar.hwnd,&ofspt);
- ofspt.x=curpt.x-ofspt.x;ofspt.y=curpt.y-ofspt.y;
+ ofspt.x = curpt.x-ofspt.x;ofspt.y = curpt.y-ofspt.y;
CLUIFrames_SetFrameFloat(id,0);
- newpt.x=0;newpt.y=0;
+ newpt.x = 0;newpt.y = 0;
ClientToScreen(g_pfwFrames[pos].TitleBar.hwnd,&newpt);
SetCursorPos(newpt.x+ofspt.x,newpt.y+ofspt.y);
GetCursorPos(&curpt);
- g_pfwFrames[pos].TitleBar.oldpos=curpt;
+ g_pfwFrames[pos].TitleBar.oldpos = curpt;
return(0);
};
@@ -3308,13 +3308,13 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam }
else
{
- int id=g_pfwFrames[pos].id;
+ int id = g_pfwFrames[pos].id;
GetCursorPos(&curpt);
- rcwnd.bottom=curpt.y+5;
- rcwnd.top=curpt.y;
- rcwnd.left=curpt.x;
- rcwnd.right=curpt.x+5;
+ rcwnd.bottom = curpt.y+5;
+ rcwnd.top = curpt.y;
+ rcwnd.left = curpt.x;
+ rcwnd.right = curpt.x+5;
GetWindowRect(pcli->hwndContactList, &rcMiranda );
//GetWindowRect( Frames[pos].ContainerWnd, &rcwnd );
@@ -3325,32 +3325,32 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam {
GetCursorPos(&curpt);
GetWindowRect( g_pfwFrames[pos].hWnd, &rcwnd );
- rcwnd.left=rcwnd.right-rcwnd.left;
- rcwnd.top=rcwnd.bottom-rcwnd.top;
- newpos.x=curpt.x;newpos.y=curpt.y;
- if (curpt.x>=(rcMiranda.right-1)){newpos.x=curpt.x+5;};
- if (curpt.x<=(rcMiranda.left+1)){newpos.x=curpt.x-(rcwnd.left)-5;};
- if (curpt.y>=(rcMiranda.bottom-1)){newpos.y=curpt.y+5;};
- if (curpt.y<=(rcMiranda.top+1)){newpos.y=curpt.y-(rcwnd.top)-5;};
- ofspt.x=0;ofspt.y=0;
+ rcwnd.left = rcwnd.right-rcwnd.left;
+ rcwnd.top = rcwnd.bottom-rcwnd.top;
+ newpos.x = curpt.x;newpos.y = curpt.y;
+ if (curpt.x >= (rcMiranda.right-1)){newpos.x = curpt.x+5;};
+ if (curpt.x <= (rcMiranda.left+1)){newpos.x = curpt.x-(rcwnd.left)-5;};
+ if (curpt.y >= (rcMiranda.bottom-1)){newpos.y = curpt.y+5;};
+ if (curpt.y <= (rcMiranda.top+1)){newpos.y = curpt.y-(rcwnd.top)-5;};
+ ofspt.x = 0;ofspt.y = 0;
//ClientToScreen(Frames[pos].TitleBar.hwnd,&ofspt);
GetWindowRect(g_pfwFrames[pos].TitleBar.hwnd,&rcwnd);
- ofspt.x=curpt.x-ofspt.x;ofspt.y=curpt.y-ofspt.y;
+ ofspt.x = curpt.x-ofspt.x;ofspt.y = curpt.y-ofspt.y;
- g_pfwFrames[pos].FloatingPos.x=newpos.x;
- g_pfwFrames[pos].FloatingPos.y=newpos.y;
+ g_pfwFrames[pos].FloatingPos.x = newpos.x;
+ g_pfwFrames[pos].FloatingPos.y = newpos.y;
CLUIFrames_SetFrameFloat(id,0);
//SetWindowPos(Frames[pos].ContainerWnd,0,newpos.x,newpos.y,0,0,SWP_NOSIZE);
- newpt.x=0;newpt.y=0;
+ newpt.x = 0;newpt.y = 0;
ClientToScreen(g_pfwFrames[pos].TitleBar.hwnd,&newpt);
GetWindowRect( g_pfwFrames[pos].hWnd, &rcwnd );
SetCursorPos(newpt.x+(rcwnd.right-rcwnd.left)/2,newpt.y+(rcwnd.bottom-rcwnd.top)/2);
GetCursorPos(&curpt);
- g_pfwFrames[pos].TitleBar.oldpos=curpt;
+ g_pfwFrames[pos].TitleBar.oldpos = curpt;
return(0);
@@ -3361,21 +3361,21 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam //return(0);
};
- if(wParam&MK_LBUTTON) {
- int newh=-1,prevold;
+ if (wParam&MK_LBUTTON) {
+ int newh = -1,prevold;
- if(GetCapture()!=hwnd){break;};
+ if (GetCapture() != hwnd){break;};
- pos=id2pos(Frameid);
+ pos = id2pos(Frameid);
if (g_pfwFrames[pos].floating)
{
GetCursorPos(&pt);
- if ((g_pfwFrames[pos].TitleBar.oldpos.x!=pt.x)||(g_pfwFrames[pos].TitleBar.oldpos.y!=pt.y))
+ if ((g_pfwFrames[pos].TitleBar.oldpos.x != pt.x)||(g_pfwFrames[pos].TitleBar.oldpos.y != pt.y))
{
- pt2=pt;
+ pt2 = pt;
ScreenToClient(hwnd,&pt2);
GetWindowRect(g_pfwFrames[pos].ContainerWnd,&wndr);
{
@@ -3389,8 +3389,8 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam dX = ptNew.x - ptOld.x;
dY = ptNew.y - ptOld.y;
- nLeft += (short)dX;
- nTop += (short)dY;
+ nLeft += (short)dX;
+ nTop += (short)dY;
if (!(wParam&MK_CONTROL))
{
@@ -3413,9 +3413,9 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam }
- pt.x=nLeft;
- pt.y=nTop;
- g_pfwFrames[pos].TitleBar.oldpos=pt;
+ pt.x = nLeft;
+ pt.y = nTop;
+ g_pfwFrames[pos].TitleBar.oldpos = pt;
};
//break;
@@ -3423,48 +3423,48 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam };
- if(g_pfwFrames[pos].prevvisframe!=-1) {
+ if (g_pfwFrames[pos].prevvisframe != -1) {
GetCursorPos(&pt);
- if ((g_pfwFrames[pos].TitleBar.oldpos.x==pt.x)&&(g_pfwFrames[pos].TitleBar.oldpos.y==pt.y))
+ if ((g_pfwFrames[pos].TitleBar.oldpos.x == pt.x)&&(g_pfwFrames[pos].TitleBar.oldpos.y == pt.y))
{break;};
- ypos=rect.top+pt.y;xpos=rect.left+pt.x;
- Framemod=-1;
+ ypos = rect.top+pt.y;xpos = rect.left+pt.x;
+ Framemod = -1;
- if(g_pfwFrames[pos].align==alBottom) {
- direction=-1;
- Framemod=pos;
+ if (g_pfwFrames[pos].align == alBottom) {
+ direction = -1;
+ Framemod = pos;
}
else {
- direction=1;
- Framemod=g_pfwFrames[pos].prevvisframe;
+ direction = 1;
+ Framemod = g_pfwFrames[pos].prevvisframe;
}
- if(g_pfwFrames[Framemod].Locked) {break;};
- if(s_nCurDragBar!=-1&&s_nCurDragBar!=pos) {break;};
+ if (g_pfwFrames[Framemod].Locked) {break;};
+ if (s_nCurDragBar != -1&&s_nCurDragBar != pos) {break;};
- if(s_nLastByPos==-1) {
- s_nCurDragBar=pos;
- s_nLastByPos=ypos;
- s_nOldFrameHeight=g_pfwFrames[Framemod].height;
+ if (s_nLastByPos == -1) {
+ s_nCurDragBar = pos;
+ s_nLastByPos = ypos;
+ s_nOldFrameHeight = g_pfwFrames[Framemod].height;
SetCapture(hwnd);
{break;};
}
else
{
- // if(GetCapture()!=hwnd){break;};
+ // if (GetCapture() != hwnd){break;};
};
- newh=s_nOldFrameHeight+direction*(ypos-s_nLastByPos);
- if(newh>0) {
- prevold=g_pfwFrames[Framemod].height;
- g_pfwFrames[Framemod].height=newh;
- if (!CLUIFramesFitInSize()) { g_pfwFrames[Framemod].height=prevold; return TRUE;}
- g_pfwFrames[Framemod].height=newh;
- if(newh>3) g_pfwFrames[Framemod].collapsed=TRUE;
+ newh = s_nOldFrameHeight+direction*(ypos-s_nLastByPos);
+ if (newh>0) {
+ prevold = g_pfwFrames[Framemod].height;
+ g_pfwFrames[Framemod].height = newh;
+ if (!CLUIFramesFitInSize()) { g_pfwFrames[Framemod].height = prevold; return TRUE;}
+ g_pfwFrames[Framemod].height = newh;
+ if (newh>3) g_pfwFrames[Framemod].collapsed = TRUE;
}
- g_pfwFrames[pos].TitleBar.oldpos=pt;
+ g_pfwFrames[pos].TitleBar.oldpos = pt;
}
if (newh>0)
@@ -3473,7 +3473,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam };
break;
}
- s_nCurDragBar=-1;s_nLastByPos=-1;s_nOldFrameHeight=-1;ReleaseCapture();
+ s_nCurDragBar = -1;s_nLastByPos = -1;s_nOldFrameHeight = -1;ReleaseCapture();
}
break;
case WM_PRINT:
@@ -3520,11 +3520,11 @@ static int CLUIFrameResizeFloatingFrame(int framepos) RECT rect;
if (!g_pfwFrames[framepos].floating){return(0);};
- if (g_pfwFrames[framepos].ContainerWnd==0){return(0);};
+ if (g_pfwFrames[framepos].ContainerWnd == 0){return(0);};
GetClientRect(g_pfwFrames[framepos].ContainerWnd,&rect);
- width=rect.right-rect.left;
- height=rect.bottom-rect.top;
+ width = rect.right-rect.left;
+ height = rect.bottom-rect.top;
g_pfwFrames[framepos].visible?CLUI_ShowWindowMod(g_pfwFrames[framepos].ContainerWnd,SW_SHOW/*NOACTIVATE*/):CLUI_ShowWindowMod(g_pfwFrames[framepos].ContainerWnd,SW_HIDE);
@@ -3534,7 +3534,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos) {
CLUI_ShowWindowMod(g_pfwFrames[framepos].TitleBar.hwnd,SW_SHOW/*NOACTIVATE*/);
//if (Frames[framepos].Locked){return(0);};
- g_pfwFrames[framepos].height=height-DEFAULT_TITLEBAR_HEIGHT;
+ g_pfwFrames[framepos].height = height-DEFAULT_TITLEBAR_HEIGHT;
SetWindowPos(g_pfwFrames[framepos].TitleBar.hwnd,HWND_TOP,0,0,width,DEFAULT_TITLEBAR_HEIGHT,SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_DRAWFRAME);
SetWindowPos(g_pfwFrames[framepos].hWnd,HWND_TOP,0,DEFAULT_TITLEBAR_HEIGHT,width,height-DEFAULT_TITLEBAR_HEIGHT,SWP_SHOWWINDOW);
@@ -3544,18 +3544,18 @@ static int CLUIFrameResizeFloatingFrame(int framepos) {
//SetWindowPos(Frames[framepos].TitleBar.hwnd,HWND_TOP,0,0,width,DEFAULT_TITLEBAR_HEIGHT,SWP_SHOWWINDOW|SWP_NOMOVE);
//if (Frames[framepos].Locked){return(0);};
- g_pfwFrames[framepos].height=height;
+ g_pfwFrames[framepos].height = height;
CLUI_ShowWindowMod(g_pfwFrames[framepos].TitleBar.hwnd,SW_HIDE);
SetWindowPos(g_pfwFrames[framepos].hWnd,HWND_TOP,0,0,width,height,SWP_SHOWWINDOW|SWP_NOACTIVATE);
};
// CLUIFramesForceUpdateFrame(&Frames[framepos]);
- if (g_pfwFrames[framepos].ContainerWnd!=0) UpdateWindow(g_pfwFrames[framepos].ContainerWnd);
+ if (g_pfwFrames[framepos].ContainerWnd != 0) UpdateWindow(g_pfwFrames[framepos].ContainerWnd);
//GetClientRect(Frames[framepos].TitleBar.hwnd,&Frames[framepos].TitleBar.wndSize);
GetWindowRect(g_pfwFrames[framepos].hWnd,&g_pfwFrames[framepos].wndSize);
- //Frames[framepos].height=Frames[framepos].wndSize.bottom-Frames[framepos].wndSize.top;
+ //Frames[framepos].height = Frames[framepos].wndSize.bottom-Frames[framepos].wndSize.top;
//GetClientRect(Frames[framepos].hWnd,&Frames[framepos].wndSize);
- //Frames[framepos].height=Frames[framepos].wndSize.bottom-Frames[framepos].wndSize.top;
+ //Frames[framepos].height = Frames[framepos].wndSize.bottom-Frames[framepos].wndSize.top;
return(0);
};
@@ -3573,7 +3573,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP RECT rect;
int Frameid;
- Frameid=(GetWindowLongPtr(hwnd,GWLP_USERDATA));
+ Frameid = (GetWindowLongPtr(hwnd,GWLP_USERDATA));
memset(&rect,0,sizeof(rect));
/*
@@ -3587,20 +3587,20 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP SnapInfo.hWnd = hwnd;
SnapInfo.wParam = wParam;
SnapInfo.lParam = lParam;
- if (CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,msg)!=0){return(TRUE);};
+ if (CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,msg) != 0){return(TRUE);};
};
};
*/
switch(msg) {
case WM_ACTIVATE:
{
- if(g_bTransparentFlag)
+ if (g_bTransparentFlag)
{
BYTE alpha;
- if ((wParam!=WA_INACTIVE || ((HWND)lParam==hwnd) || GetParent((HWND)lParam)==hwnd))
+ if ((wParam != WA_INACTIVE || ((HWND)lParam == hwnd) || GetParent((HWND)lParam) == hwnd))
{
- HWND hw=lParam?GetParent((HWND)lParam):0;
- alpha=db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT);
+ HWND hw = lParam?GetParent((HWND)lParam):0;
+ alpha = db_get_b(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT);
if (hw) SetWindowPos(hw,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
CLUI_SmoothAlphaTransition(hwnd, alpha, 1);
}
@@ -3622,9 +3622,9 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP if (g_CluiData.mutexPreventDockMoving)
{
WINDOWPOS *wp;
- wp=(WINDOWPOS*)lParam;
- wp->flags|=SWP_NOMOVE/*|SWP_NOSIZE*/;
- wp->flags&=(wp->flags&~SWP_NOACTIVATE);
+ wp = (WINDOWPOS*)lParam;
+ wp->flags |= SWP_NOMOVE/*|SWP_NOSIZE*/;
+ wp->flags &= (wp->flags&~SWP_NOACTIVATE);
return DefWindowProc(hwnd, msg, wParam, lParam);
}
break;
@@ -3652,11 +3652,11 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP static HWND CreateSubContainerWindow(HWND parent,int x,int y,int width,int height)
{
HWND hwnd;
- hwnd=CreateWindowEx(g_proc_SetLayeredWindowAttributesNew ? WS_EX_LAYERED:0,CLUIFrameSubContainerClassName,TEXT("SubContainerWindow"),WS_POPUP|(!g_CluiData.fLayered ? WS_BORDER : 0),x,y,width,height,parent,0,g_hInst,0);
+ hwnd = CreateWindowEx(g_proc_SetLayeredWindowAttributesNew ? WS_EX_LAYERED:0,CLUIFrameSubContainerClassName,TEXT("SubContainerWindow"),WS_POPUP|(!g_CluiData.fLayered ? WS_BORDER : 0),x,y,width,height,parent,0,g_hInst,0);
SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)&~(WS_CAPTION|WS_BORDER));
if (g_CluiData.fOnDesktop)
{
- HWND hProgMan=FindWindow(TEXT("Progman"),NULL);
+ HWND hProgMan = FindWindow(TEXT("Progman"),NULL);
if (IsWindow(hProgMan))
SetParent(hwnd,hProgMan);
}
@@ -3673,7 +3673,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP RECT rect;
int Frameid;
- Frameid=(GetWindowLongPtr(hwnd,GWLP_USERDATA));
+ Frameid = (GetWindowLongPtr(hwnd,GWLP_USERDATA));
memset(&rect,0,sizeof(rect));
/*
if ((msg == WM_MOVE) || (msg == WM_MOVING) || (msg == WM_NCLBUTTONDOWN) || (msg == WM_SYSCOMMAND) )
@@ -3686,7 +3686,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP SnapInfo.hWnd = hwnd;
SnapInfo.wParam = wParam;
SnapInfo.lParam = lParam;
- if (CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,msg)!=0){return(TRUE);};
+ if (CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,msg) != 0){return(TRUE);};
};
};
*/
@@ -3697,7 +3697,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP {
int framepos;
- framepos=id2pos(Frameid);
+ framepos = id2pos(Frameid);
//SetWindowPos(Frames[framepos].TitleBar.hwndTip, HWND_TOPMOST,0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE );
return(0);
@@ -3709,37 +3709,37 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP MINMAXINFO minmax;
- framepos=id2pos(Frameid);
- if(framepos<0||framepos>=g_nFramesCount){break;};
+ framepos = id2pos(Frameid);
+ if (framepos < 0||framepos >= g_nFramesCount){break;};
if (!g_pfwFrames[framepos].minmaxenabled){break;};
- if (g_pfwFrames[framepos].ContainerWnd==0){break;};
+ if (g_pfwFrames[framepos].ContainerWnd == 0){break;};
if (g_pfwFrames[framepos].Locked)
{
RECT rct;
GetWindowRect(hwnd,&rct);
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.x=rct.right-rct.left;
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.y=rct.bottom-rct.top;
- ((LPMINMAXINFO)lParam)->ptMaxTrackSize.x=rct.right-rct.left;
- ((LPMINMAXINFO)lParam)->ptMaxTrackSize.y=rct.bottom-rct.top;
+ ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = rct.right-rct.left;
+ ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = rct.bottom-rct.top;
+ ((LPMINMAXINFO)lParam)->ptMaxTrackSize.x = rct.right-rct.left;
+ ((LPMINMAXINFO)lParam)->ptMaxTrackSize.y = rct.bottom-rct.top;
//
//return(0);
};
memset(&minmax,0,sizeof(minmax));
- if (SendMessage(g_pfwFrames[framepos].hWnd,WM_GETMINMAXINFO,(WPARAM)0,(LPARAM)&minmax)==0)
+ if (SendMessage(g_pfwFrames[framepos].hWnd,WM_GETMINMAXINFO,(WPARAM)0,(LPARAM)&minmax) == 0)
{
RECT border;
- int tbh=g_nTitleBarHeight*btoint(g_pfwFrames[framepos].TitleBar.ShowTitleBar);
+ int tbh = g_nTitleBarHeight*btoint(g_pfwFrames[framepos].TitleBar.ShowTitleBar);
GetBorderSize(hwnd,&border);
- if (minmax.ptMaxTrackSize.x!=0&&minmax.ptMaxTrackSize.y!=0){
+ if (minmax.ptMaxTrackSize.x != 0&&minmax.ptMaxTrackSize.y != 0){
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.x=minmax.ptMinTrackSize.x;
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.y=minmax.ptMinTrackSize.y;
- ((LPMINMAXINFO)lParam)->ptMaxTrackSize.x=minmax.ptMaxTrackSize.x+border.left+border.right;
- ((LPMINMAXINFO)lParam)->ptMaxTrackSize.y=minmax.ptMaxTrackSize.y+tbh+border.top+border.bottom;
+ ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = minmax.ptMinTrackSize.x;
+ ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = minmax.ptMinTrackSize.y;
+ ((LPMINMAXINFO)lParam)->ptMaxTrackSize.x = minmax.ptMaxTrackSize.x+border.left+border.right;
+ ((LPMINMAXINFO)lParam)->ptMaxTrackSize.y = minmax.ptMaxTrackSize.y+tbh+border.top+border.bottom;
};
}
@@ -3760,16 +3760,16 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP int framepos;
RECT rect;
- framepos=id2pos(Frameid);
+ framepos = id2pos(Frameid);
- if(framepos<0||framepos>=g_nFramesCount){break;};
- if (g_pfwFrames[framepos].ContainerWnd==0){return(0);};
+ if (framepos < 0||framepos >= g_nFramesCount){break;};
+ if (g_pfwFrames[framepos].ContainerWnd == 0){return(0);};
GetWindowRect(g_pfwFrames[framepos].ContainerWnd,&rect);
- g_pfwFrames[framepos].FloatingPos.x=rect.left;
- g_pfwFrames[framepos].FloatingPos.y=rect.top;
- g_pfwFrames[framepos].FloatingSize.x=rect.right-rect.left;
- g_pfwFrames[framepos].FloatingSize.y=rect.bottom-rect.top;
+ g_pfwFrames[framepos].FloatingPos.x = rect.left;
+ g_pfwFrames[framepos].FloatingPos.y = rect.top;
+ g_pfwFrames[framepos].FloatingSize.x = rect.right-rect.left;
+ g_pfwFrames[framepos].FloatingSize.y = rect.bottom-rect.top;
CLUIFramesStoreFrameSettings(framepos);
@@ -3779,10 +3779,10 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP RECT rcwnd, rcOverlap, rcMiranda;
GetCursorPos(&curpt);
- rcwnd.bottom=curpt.y+5;
- rcwnd.top=curpt.y;
- rcwnd.left=curpt.x;
- rcwnd.right=curpt.x+5;
+ rcwnd.bottom = curpt.y+5;
+ rcwnd.top = curpt.y;
+ rcwnd.left = curpt.x;
+ rcwnd.right = curpt.x+5;
GetWindowRect(pcli->hwndContactList, &rcMiranda );
//GetWindowRect( Frames[pos].ContainerWnd, &rcwnd );
@@ -3793,32 +3793,32 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP {
GetCursorPos(&curpt);
GetWindowRect( g_pfwFrames[framepos].hWnd, &rcwnd );
- rcwnd.left=rcwnd.right-rcwnd.left;
- rcwnd.top=rcwnd.bottom-rcwnd.top;
- newpos.x=curpt.x;newpos.y=curpt.y;
- if (curpt.x>=(rcMiranda.right-1)){newpos.x=curpt.x+5;};
- if (curpt.x<=(rcMiranda.left+1)){newpos.x=curpt.x-(rcwnd.left)-5;};
- if (curpt.y>=(rcMiranda.bottom-1)){newpos.y=curpt.y+5;};
- if (curpt.y<=(rcMiranda.top+1)){newpos.y=curpt.y-(rcwnd.top)-5;};
- ofspt.x=0;ofspt.y=0;
+ rcwnd.left = rcwnd.right-rcwnd.left;
+ rcwnd.top = rcwnd.bottom-rcwnd.top;
+ newpos.x = curpt.x;newpos.y = curpt.y;
+ if (curpt.x >= (rcMiranda.right-1)){newpos.x = curpt.x+5;};
+ if (curpt.x <= (rcMiranda.left+1)){newpos.x = curpt.x-(rcwnd.left)-5;};
+ if (curpt.y >= (rcMiranda.bottom-1)){newpos.y = curpt.y+5;};
+ if (curpt.y <= (rcMiranda.top+1)){newpos.y = curpt.y-(rcwnd.top)-5;};
+ ofspt.x = 0;ofspt.y = 0;
//ClientToScreen(Frames[pos].TitleBar.hwnd,&ofspt);
GetWindowRect(g_pfwFrames[framepos].TitleBar.hwnd,&rcwnd);
- ofspt.x=curpt.x-ofspt.x;ofspt.y=curpt.y-ofspt.y;
+ ofspt.x = curpt.x-ofspt.x;ofspt.y = curpt.y-ofspt.y;
- g_pfwFrames[framepos].FloatingPos.x=newpos.x;
- g_pfwFrames[framepos].FloatingPos.y=newpos.y;
+ g_pfwFrames[framepos].FloatingPos.x = newpos.x;
+ g_pfwFrames[framepos].FloatingPos.y = newpos.y;
CLUIFrames_SetFrameFloat(Frameid,0);
//SetWindowPos(Frames[pos].ContainerWnd,0,newpos.x,newpos.y,0,0,SWP_NOSIZE);
- newpt.x=0;newpt.y=0;
+ newpt.x = 0;newpt.y = 0;
ClientToScreen(g_pfwFrames[framepos].TitleBar.hwnd,&newpt);
GetWindowRect( g_pfwFrames[framepos].hWnd, &rcwnd );
SetCursorPos(newpt.x+(rcwnd.right-rcwnd.left)/2,newpt.y+(rcwnd.bottom-rcwnd.top)/2);
GetCursorPos(&curpt);
- g_pfwFrames[framepos].TitleBar.oldpos=curpt;
+ g_pfwFrames[framepos].TitleBar.oldpos = curpt;
return(0);
@@ -3837,17 +3837,17 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP CallWindowProc(DefWindowProc, hwnd, msg, wParam, lParam);
- framepos=id2pos(Frameid);
+ framepos = id2pos(Frameid);
- if(framepos<0||framepos>=g_nFramesCount){break;};
- if (g_pfwFrames[framepos].ContainerWnd==0){return(0);};
+ if (framepos < 0||framepos >= g_nFramesCount){break;};
+ if (g_pfwFrames[framepos].ContainerWnd == 0){return(0);};
CLUIFrameResizeFloatingFrame(framepos);
GetWindowRect(g_pfwFrames[framepos].ContainerWnd,&rect);
- g_pfwFrames[framepos].FloatingPos.x=rect.left;
- g_pfwFrames[framepos].FloatingPos.y=rect.top;
- g_pfwFrames[framepos].FloatingSize.x=rect.right-rect.left;
- g_pfwFrames[framepos].FloatingSize.y=rect.bottom-rect.top;
+ g_pfwFrames[framepos].FloatingPos.x = rect.left;
+ g_pfwFrames[framepos].FloatingPos.y = rect.top;
+ g_pfwFrames[framepos].FloatingSize.x = rect.right-rect.left;
+ g_pfwFrames[framepos].FloatingSize.y = rect.bottom-rect.top;
CLUIFramesStoreFrameSettings(framepos);
@@ -3896,31 +3896,31 @@ static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam) int pos = id2pos( wParam );
- if ( pos >= 0&& pos < g_nFramesCount )
+ if ( pos >= 0&& pos < g_nFramesCount )
if (g_pfwFrames[pos].floating || (lParam&2))
{
- if (g_pfwFrames[pos].OwnerWindow!=(HWND)-2 &&g_pfwFrames[pos].visible)
+ if (g_pfwFrames[pos].OwnerWindow != (HWND)-2 &&g_pfwFrames[pos].visible)
{
- if (g_pfwFrames[pos].OwnerWindow==0) g_pfwFrames[pos].OwnerWindow=CreateSubContainerWindow(pcli->hwndContactList,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,10,10);
+ if (g_pfwFrames[pos].OwnerWindow == 0) g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,10,10);
CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow,(g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList))?SW_SHOW/*NOACTIVATE*/:SW_HIDE);
SetParent(g_pfwFrames[pos].hWnd,g_pfwFrames[pos].OwnerWindow);
SetParent(g_pfwFrames[pos].TitleBar.hwnd,pcli->hwndContactList);
SetWindowLongPtr(g_pfwFrames[pos].OwnerWindow,GWLP_USERDATA,g_pfwFrames[pos].id);
- g_pfwFrames[pos].floating=FALSE;
+ g_pfwFrames[pos].floating = FALSE;
if (!(lParam&2))
{
DestroyWindow(g_pfwFrames[pos].ContainerWnd);
- g_pfwFrames[pos].ContainerWnd=0;
+ g_pfwFrames[pos].ContainerWnd = 0;
}
}
else
{
SetParent(g_pfwFrames[pos].hWnd,pcli->hwndContactList);
SetParent(g_pfwFrames[pos].TitleBar.hwnd,pcli->hwndContactList);
- g_pfwFrames[pos].floating=FALSE;
+ g_pfwFrames[pos].floating = FALSE;
if (g_pfwFrames[pos].ContainerWnd) DestroyWindow(g_pfwFrames[pos].ContainerWnd);
- g_pfwFrames[pos].ContainerWnd=0;
+ g_pfwFrames[pos].ContainerWnd = 0;
}
}
else
@@ -3930,53 +3930,53 @@ static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam) int neww,newh;
BOOLEAN locked;
- g_pfwFrames[pos].oldstyles=GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE);
- g_pfwFrames[pos].TitleBar.oldstyles=GetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_STYLE);
- locked=g_pfwFrames[pos].Locked;
- g_pfwFrames[pos].Locked=FALSE;
- g_pfwFrames[pos].minmaxenabled=FALSE;
+ g_pfwFrames[pos].oldstyles = GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE);
+ g_pfwFrames[pos].TitleBar.oldstyles = GetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_STYLE);
+ locked = g_pfwFrames[pos].Locked;
+ g_pfwFrames[pos].Locked = FALSE;
+ g_pfwFrames[pos].minmaxenabled = FALSE;
GetWindowRect(g_pfwFrames[pos].hWnd,&rectw);
GetWindowRect(g_pfwFrames[pos].TitleBar.hwnd,&recttb);
if (!g_pfwFrames[pos].TitleBar.ShowTitleBar){
- recttb.top=recttb.bottom=recttb.left=recttb.right=0;
+ recttb.top = recttb.bottom = recttb.left = recttb.right = 0;
};
- g_pfwFrames[pos].ContainerWnd=CreateContainerWindow(pcli->hwndContactList,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,10,10);
+ g_pfwFrames[pos].ContainerWnd = CreateContainerWindow(pcli->hwndContactList,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,10,10);
SetParent(g_pfwFrames[pos].hWnd,g_pfwFrames[pos].ContainerWnd);
SetParent(g_pfwFrames[pos].TitleBar.hwnd,g_pfwFrames[pos].ContainerWnd);
- if (g_pfwFrames[pos].OwnerWindow!=(HWND)-2 && g_pfwFrames[pos].OwnerWindow!=0)
+ if (g_pfwFrames[pos].OwnerWindow != (HWND)-2 && g_pfwFrames[pos].OwnerWindow != 0)
{
DestroyWindow(g_pfwFrames[pos].OwnerWindow);
- g_pfwFrames[pos].OwnerWindow=0;
+ g_pfwFrames[pos].OwnerWindow = 0;
}
GetBorderSize(g_pfwFrames[pos].ContainerWnd,&border);
SetWindowLongPtr(g_pfwFrames[pos].ContainerWnd,GWLP_USERDATA,g_pfwFrames[pos].id);
- if ((lParam==1))
+ if ((lParam == 1))
{
- //if ((Frames[pos].FloatingPos.x!=0)&&(Frames[pos].FloatingPos.y!=0))
+ //if ((Frames[pos].FloatingPos.x != 0)&&(Frames[pos].FloatingPos.y != 0))
{
- if (g_pfwFrames[pos].FloatingPos.x<0){g_pfwFrames[pos].FloatingPos.x=0;};
- if (g_pfwFrames[pos].FloatingPos.y<0){g_pfwFrames[pos].FloatingPos.y=0;};
+ if (g_pfwFrames[pos].FloatingPos.x < 0){g_pfwFrames[pos].FloatingPos.x = 0;};
+ if (g_pfwFrames[pos].FloatingPos.y < 0){g_pfwFrames[pos].FloatingPos.y = 0;};
SetWindowPos(g_pfwFrames[pos].ContainerWnd,HWND_TOPMOST,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,g_pfwFrames[pos].FloatingSize.x,g_pfwFrames[pos].FloatingSize.y,SWP_HIDEWINDOW|SWP_NOACTIVATE);
}
}
- else if (lParam==0)
+ else if (lParam == 0)
{
- neww=rectw.right-rectw.left+border.left+border.right;
- newh=(rectw.bottom-rectw.top)+(recttb.bottom-recttb.top)+border.top+border.bottom;
- if (neww<20){neww=40;};
- if (newh<20){newh=40;};
- if (g_pfwFrames[pos].FloatingPos.x<20){g_pfwFrames[pos].FloatingPos.x=40;};
- if (g_pfwFrames[pos].FloatingPos.y<20){g_pfwFrames[pos].FloatingPos.y=40;};
+ neww = rectw.right-rectw.left+border.left+border.right;
+ newh = (rectw.bottom-rectw.top)+(recttb.bottom-recttb.top)+border.top+border.bottom;
+ if (neww < 20){neww = 40;};
+ if (newh < 20){newh = 40;};
+ if (g_pfwFrames[pos].FloatingPos.x < 20){g_pfwFrames[pos].FloatingPos.x = 40;};
+ if (g_pfwFrames[pos].FloatingPos.y < 20){g_pfwFrames[pos].FloatingPos.y = 40;};
SetWindowPos(g_pfwFrames[pos].ContainerWnd,HWND_TOPMOST,g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,neww,newh,SWP_HIDEWINDOW|SWP_NOACTIVATE);
};
@@ -3984,19 +3984,19 @@ static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam) SetWindowText(g_pfwFrames[pos].ContainerWnd,g_pfwFrames[pos].TitleBar.tbname);
- temp=GetWindowLongPtr(g_pfwFrames[pos].ContainerWnd,GWL_EXSTYLE);
- temp|=WS_EX_TOOLWINDOW|WS_EX_TOPMOST ;
+ temp = GetWindowLongPtr(g_pfwFrames[pos].ContainerWnd,GWL_EXSTYLE);
+ temp |= WS_EX_TOOLWINDOW|WS_EX_TOPMOST ;
SetWindowLongPtr(g_pfwFrames[pos].ContainerWnd,GWL_EXSTYLE,temp);
- g_pfwFrames[pos].floating=TRUE;
- g_pfwFrames[pos].Locked=locked;
+ g_pfwFrames[pos].floating = TRUE;
+ g_pfwFrames[pos].Locked = locked;
}
CLUIFramesStoreFrameSettings(pos);
- g_pfwFrames[pos].minmaxenabled=TRUE;
- hwndtooltiptmp=g_pfwFrames[pos].TitleBar.hwndTip;
+ g_pfwFrames[pos].minmaxenabled = TRUE;
+ hwndtooltiptmp = g_pfwFrames[pos].TitleBar.hwndTip;
- hwndtmp=g_pfwFrames[pos].ContainerWnd;
+ hwndtmp = g_pfwFrames[pos].ContainerWnd;
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
if (hwndtmp) SendMessage(hwndtmp,WM_SIZE,0,0);
@@ -4046,7 +4046,7 @@ int CLUIFrameOnModulesUnload(WPARAM wParam,LPARAM lParam) CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiAlignRoot, 1 );
CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiPosRoot, 1 );
- _hmiVisible=0;
+ _hmiVisible = 0;
return 0;
}
@@ -4056,7 +4056,7 @@ int LoadCLUIFramesModule(void) WNDCLASS cntclass;
WNDCLASS subconclass;
InitializeCriticalSection(&_cluiFramesModuleCS);
- _cluiFramesModuleCSInitialized=TRUE;
+ _cluiFramesModuleCSInitialized = TRUE;
wndclass.style = CS_DBLCLKS;//|CS_HREDRAW|CS_VREDRAW ;
wndclass.lpfnWndProc = CLUIFrameTitleBarProc;
@@ -4097,9 +4097,9 @@ int LoadCLUIFramesModule(void) RegisterClass(&cntclass);
//end container helper
- GapBetweenFrames=db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
+ GapBetweenFrames = db_get_dw(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
- g_nFramesCount=0;
+ g_nFramesCount = 0;
InitFramesMenus();
@@ -4111,19 +4111,19 @@ int LoadCLUIFramesModule(void) CreateCluiFramesServices();
- hWndExplorerToolBar =FindWindowEx(0,0,TEXT("Shell_TrayWnd"),NULL);
+ hWndExplorerToolBar = FindWindowEx(0,0,TEXT("Shell_TrayWnd"),NULL);
OnFrameTitleBarBackgroundChange(0,0);
- _fCluiFramesModuleNotStarted=FALSE;
+ _fCluiFramesModuleNotStarted = FALSE;
return 0;
}
static INT_PTR UnloadMainMenu()
{
CLUIFrameOnModulesUnload(0,0);
- if(_hmiRoot!=(HANDLE)-1)
+ if (_hmiRoot != (HANDLE)-1)
{
CallService(MS_CLIST_REMOVEMAINMENUITEM,(WPARAM)_hmiRoot,0);
- _hmiRoot=(HGENMENU)-1;
+ _hmiRoot = (HGENMENU)-1;
}
return (INT_PTR) _hmiRoot;
@@ -4133,45 +4133,45 @@ int UnLoadCLUIFramesModule(void) {
int i;
- _fCluiFramesModuleNotStarted=TRUE;
- if(hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground=NULL;}
+ _fCluiFramesModuleNotStarted = TRUE;
+ if (hBmpBackground) {DeleteObject(hBmpBackground); hBmpBackground = NULL;}
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
CLUIFramesStoreAllFrames();
UnitFramesMenu();
UnloadMainMenu();
- for (i=0;i<g_nFramesCount;i++)
+ for (i = 0;i < g_nFramesCount;i++)
{
- if (g_pfwFrames[i].hWnd!=pcli->hwndContactTree)
+ if (g_pfwFrames[i].hWnd != pcli->hwndContactTree)
DestroyWindow(g_pfwFrames[i].hWnd);
- g_pfwFrames[i].hWnd=(HWND)-1;
+ g_pfwFrames[i].hWnd = (HWND)-1;
DestroyWindow(g_pfwFrames[i].TitleBar.hwnd);
- g_pfwFrames[i].TitleBar.hwnd=(HWND)-1;
- if (g_pfwFrames[i].ContainerWnd && g_pfwFrames[i].ContainerWnd!=(HWND)(-2)&& g_pfwFrames[i].ContainerWnd!=(HWND)(-1)) DestroyWindow(g_pfwFrames[i].ContainerWnd);
- g_pfwFrames[i].ContainerWnd=(HWND)-1;
+ g_pfwFrames[i].TitleBar.hwnd = (HWND)-1;
+ if (g_pfwFrames[i].ContainerWnd && g_pfwFrames[i].ContainerWnd != (HWND)(-2)&& g_pfwFrames[i].ContainerWnd != (HWND)(-1)) DestroyWindow(g_pfwFrames[i].ContainerWnd);
+ g_pfwFrames[i].ContainerWnd = (HWND)-1;
if (g_pfwFrames[i].TitleBar.hmenu) DestroyMenu(g_pfwFrames[i].TitleBar.hmenu);
- if (g_pfwFrames[i].OwnerWindow && g_pfwFrames[i].OwnerWindow!=(HWND)(-2)&& g_pfwFrames[i].OwnerWindow!=(HWND)(-1))
+ if (g_pfwFrames[i].OwnerWindow && g_pfwFrames[i].OwnerWindow != (HWND)(-2)&& g_pfwFrames[i].OwnerWindow != (HWND)(-1))
DestroyWindow(g_pfwFrames[i].OwnerWindow );
- g_pfwFrames[i].OwnerWindow=(HWND)-2;
+ g_pfwFrames[i].OwnerWindow = (HWND)-2;
if (g_pfwFrames[i].UpdateRgn) DeleteObject(g_pfwFrames[i].UpdateRgn);
- if (g_pfwFrames[i].Name!=NULL) mir_free_and_nill(g_pfwFrames[i].Name);
- if (g_pfwFrames[i].szName!=NULL) mir_free_and_nill(g_pfwFrames[i].szName);
- if (g_pfwFrames[i].TitleBar.tbname!=NULL) mir_free_and_nill(g_pfwFrames[i].TitleBar.tbname);
- if (g_pfwFrames[i].TitleBar.sztbname!=NULL) mir_free_and_nill(g_pfwFrames[i].TitleBar.sztbname);
- if (g_pfwFrames[i].TitleBar.tooltip!=NULL) mir_free_and_nill(g_pfwFrames[i].TitleBar.tooltip);
- if (g_pfwFrames[i].TitleBar.sztooltip!=NULL) mir_free_and_nill(g_pfwFrames[i].TitleBar.sztooltip);
+ if (g_pfwFrames[i].Name != NULL) mir_free_and_nill(g_pfwFrames[i].Name);
+ if (g_pfwFrames[i].szName != NULL) mir_free_and_nill(g_pfwFrames[i].szName);
+ if (g_pfwFrames[i].TitleBar.tbname != NULL) mir_free_and_nill(g_pfwFrames[i].TitleBar.tbname);
+ if (g_pfwFrames[i].TitleBar.sztbname != NULL) mir_free_and_nill(g_pfwFrames[i].TitleBar.sztbname);
+ if (g_pfwFrames[i].TitleBar.tooltip != NULL) mir_free_and_nill(g_pfwFrames[i].TitleBar.tooltip);
+ if (g_pfwFrames[i].TitleBar.sztooltip != NULL) mir_free_and_nill(g_pfwFrames[i].TitleBar.sztooltip);
}
- if(g_pfwFrames) free(g_pfwFrames);
- g_pfwFrames=NULL;
- g_nFramesCount=0;
+ if (g_pfwFrames) free(g_pfwFrames);
+ g_pfwFrames = NULL;
+ g_nFramesCount = 0;
UnregisterClass(CLUIFrameTitleBarClassName,g_hInst);
DeleteObject(_hTitleBarFont);
- _cluiFramesModuleCSInitialized=FALSE;
+ _cluiFramesModuleCSInitialized = FALSE;
DeleteCriticalSection(&_cluiFramesModuleCS);
return 0;
}
@@ -4181,38 +4181,38 @@ static int _us_DoSetFramePaintProc(WPARAM wParam, LPARAM lParam) if (!wParam) return 0;
{
// LOOK REQUIRED OR SYNC CALL NEEDED
- FRAMEWND *frm=FindFrameByItsHWND((HWND)wParam);
+ FRAMEWND *frm = FindFrameByItsHWND((HWND)wParam);
if (!frm) return 0;
if (lParam)
- frm->PaintCallbackProc=(tPaintCallbackProc)lParam;
+ frm->PaintCallbackProc = (tPaintCallbackProc)lParam;
else
- frm->PaintCallbackProc=NULL;
+ frm->PaintCallbackProc = NULL;
return 1;
}
}
int CLUIFrames_SetLayeredMode( BOOL fLayeredMode, HWND hwnd )
{
int i;
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
{
if (fLayeredMode)
{
- if (g_pfwFrames[i].visible && GetParent(g_pfwFrames[i].hWnd)==pcli->hwndContactList && g_pfwFrames[i].PaintCallbackProc==NULL)
+ if (g_pfwFrames[i].visible && GetParent(g_pfwFrames[i].hWnd) == pcli->hwndContactList && g_pfwFrames[i].PaintCallbackProc == NULL)
{
//create owner window
- g_pfwFrames[i].OwnerWindow=CreateSubContainerWindow(pcli->hwndContactList,g_pfwFrames[i].FloatingPos.x,g_pfwFrames[i].FloatingPos.y,10,10);
+ g_pfwFrames[i].OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList,g_pfwFrames[i].FloatingPos.x,g_pfwFrames[i].FloatingPos.y,10,10);
SetParent(g_pfwFrames[i].hWnd,g_pfwFrames[i].OwnerWindow);
}
}
else
{
- if (GetParent(g_pfwFrames[i].hWnd)==g_pfwFrames[i].OwnerWindow)
+ if (GetParent(g_pfwFrames[i].hWnd) == g_pfwFrames[i].OwnerWindow)
{
SetParent(g_pfwFrames[i].hWnd,hwnd);
if ((INT_PTR)g_pfwFrames[i].OwnerWindow>0)
{
DestroyWindow(g_pfwFrames[i].OwnerWindow);
- g_pfwFrames[i].OwnerWindow=(HWND)-2;
+ g_pfwFrames[i].OwnerWindow = (HWND)-2;
}
}
}
@@ -4229,7 +4229,7 @@ int CLUIFrames_UpdateBorders() if ( !g_pfwFrames[i].floating )
{
DWORD style = (int)GetWindowLongPtr( g_pfwFrames[i].hWnd, GWL_STYLE ) & ( ~WS_BORDER );
- if ( !g_CluiData.fLayered && g_pfwFrames[i].UseBorder ) style|=WS_BORDER;
+ if ( !g_CluiData.fLayered && g_pfwFrames[i].UseBorder ) style |= WS_BORDER;
SetWindowLongPtr( g_pfwFrames[i].hWnd, GWL_STYLE, style );
CLUIFramesModifyMainMenuItems( g_pfwFrames[i].id, 0 );
RedrawWindow( g_pfwFrames[i].hWnd, NULL, NULL, RDW_FRAME | RDW_INVALIDATE );
diff --git a/plugins/Clist_modern/modern_cluiservices.cpp b/plugins/Clist_modern/modern_cluiservices.cpp index f88e4554c7..fb5d85f390 100644 --- a/plugins/Clist_modern/modern_cluiservices.cpp +++ b/plugins/Clist_modern/modern_cluiservices.cpp @@ -120,21 +120,21 @@ static INT_PTR ListEndRebuild(WPARAM wParam, LPARAM lParam) {
int rebuild = 0;
//CLC does this automatically, but we need to force it if hideoffline or hideempty has changed
- if ((db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) == 0) != ((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEOFFLINE) == 0)) {
+ if ((db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) == 0) !=((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEOFFLINE) == 0)) {
if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) | CLS_HIDEOFFLINE);
else
SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & ~CLS_HIDEOFFLINE);
rebuild = 1;
}
- if ((db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) == 0)) {
+ if ((db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) == 0) !=((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) == 0)) {
if (db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT))
SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) | CLS_HIDEEMPTYGROUPS);
else
SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS);
rebuild = 1;
}
- if ((db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS) == 0)) {
+ if ((db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) == 0) !=((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS) == 0)) {
if (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) | CLS_USEGROUPS);
else
diff --git a/plugins/Clist_modern/modern_commonheaders.cpp b/plugins/Clist_modern/modern_commonheaders.cpp index 4b4fe7f9be..2556a9f624 100644 --- a/plugins/Clist_modern/modern_commonheaders.cpp +++ b/plugins/Clist_modern/modern_commonheaders.cpp @@ -1,16 +1,16 @@ #define DB_USEHELPERFUNCTIONS
#include "hdr/modern_commonheaders.h"
-BYTE gl_TrimText=1;
+BYTE gl_TrimText = 1;
char * __cdecl strstri( char *a, const char *b)
{
char * x, *y;
if (!a || !b) return FALSE;
- x=_strdup(a);
- y=_strdup(b);
- x=_strupr(x);
- y=_strupr(y);
+ x = _strdup(a);
+ y = _strdup(b);
+ x = _strupr(x);
+ y = _strupr(y);
char * pos = strstr(x,y);
if ( pos )
{
@@ -25,29 +25,29 @@ char * __cdecl strstri( char *a, const char *b) }
int __cdecl mir_strcmpi(const char *a, const char *b)
{
- if (a==NULL && b==NULL) return 0;
- if (a==NULL || b==NULL) return _stricmp(a?a:"",b?b:"");
+ if (a == NULL && b == NULL) return 0;
+ if (a == NULL || b == NULL) return _stricmp(a?a:"",b?b:"");
return _stricmp(a,b);
}
int __cdecl mir_tstrcmpi(const TCHAR *a, const TCHAR *b)
{
- if (a==NULL && b==NULL) return 0;
- if (a==NULL || b==NULL) return _tcsicmp(a?a:TEXT(""),b?b:TEXT(""));
+ if (a == NULL && b == NULL) return 0;
+ if (a == NULL || b == NULL) return _tcsicmp(a?a:TEXT(""),b?b:TEXT(""));
return _tcsicmp(a,b);
}
BOOL __cdecl mir_bool_strcmpi(const char *a, const char *b)
{
- if (a==NULL && b==NULL) return 1;
- if (a==NULL || b==NULL) return _stricmp(a?a:"",b?b:"")==0;
- return _stricmp(a,b)==0;
+ if (a == NULL && b == NULL) return 1;
+ if (a == NULL || b == NULL) return _stricmp(a?a:"",b?b:"") == 0;
+ return _stricmp(a,b) == 0;
}
BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b)
{
- if (a==NULL && b==NULL) return 1;
- if (a==NULL || b==NULL) return _tcsicmp(a?a:TEXT(""),b?b:TEXT(""))==0;
- return _tcsicmp(a,b)==0;
+ if (a == NULL && b == NULL) return 1;
+ if (a == NULL || b == NULL) return _tcsicmp(a?a:TEXT(""),b?b:TEXT("")) == 0;
+ return _tcsicmp(a,b) == 0;
}
#ifdef strlen
@@ -57,13 +57,13 @@ 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));
};
int mir_strlen (const char *a)
{
- if (a==NULL) return 0;
+ if (a == NULL) return 0;
return (int)(strlen(a));
};
@@ -73,8 +73,8 @@ int mir_strlen (const char *a) /*
__inline void *mir_calloc( size_t num, size_t size )
{
- void *p=mir_alloc(num*size);
- if (p==NULL) return NULL;
+ void *p = mir_alloc(num*size);
+ if (p == NULL) return NULL;
memset(p,0,num*size);
return p;
};
@@ -82,8 +82,8 @@ __inline void *mir_calloc( size_t num, size_t size ) 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 (src == NULL) return NULL;
+ p = (wchar_t *) mir_alloc((lstrlenW(src)+1)*sizeof(wchar_t));
if (!p) return 0;
lstrcpyW(p, src);
return p;
@@ -93,11 +93,11 @@ wchar_t * mir_strdupW(const wchar_t * src) char * strdupn(const char * src, int len)
{
char * p;
- if (src==NULL) return NULL;
- p= (char*)malloc(len+1);
+ if (src == NULL) return NULL;
+ p = (char*)malloc(len+1);
if (!p) return 0;
memcpy(p,src,len);
- p[len]='\0';
+ p[len] = '\0';
return p;
}
@@ -151,7 +151,7 @@ void TRACE_ERROR() BOOL DebugDeleteObject(HGDIOBJ a)
{
- BOOL res=DeleteObject(a);
+ BOOL res = DeleteObject(a);
if (!res) TRACE_ERROR();
return res;
}
@@ -170,16 +170,16 @@ BOOL mod_DeleteDC(HDC hdc) HICON LoadSmallIconShared(HINSTANCE hInstance, LPCTSTR lpIconName)
{
- int cx=GetSystemMetrics(SM_CXSMICON);
+ int cx = GetSystemMetrics(SM_CXSMICON);
return (HICON)LoadImage(hInstance,lpIconName, IMAGE_ICON,cx,cx, LR_DEFAULTCOLOR|LR_SHARED);
}
// load small icon (not shared) it IS NEED to be destroyed
HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName)
{
- HICON hIcon=NULL; // icon handle
- int index=-(int)lpIconName;
- TCHAR filename[MAX_PATH]={0};
+ HICON hIcon = NULL; // icon handle
+ int index = -(int)lpIconName;
+ TCHAR filename[MAX_PATH] = {0};
GetModuleFileName(hInstance,filename,MAX_PATH);
ExtractIconEx(filename,index,NULL,&hIcon,1);
return hIcon;
@@ -188,12 +188,12 @@ HICON LoadSmallIcon(HINSTANCE hInstance, LPCTSTR lpIconName) // load small icon from hInstance
HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared)
{
- HICON hResIcon=bShared?LoadSmallIcon(hInstance,lpIconName):LoadSmallIconShared(hInstance,lpIconName);
+ HICON hResIcon = bShared?LoadSmallIcon(hInstance,lpIconName):LoadSmallIconShared(hInstance,lpIconName);
if (!hResIcon) //Icon not found in hInstance lets try to load it from core
{
- HINSTANCE hCoreInstance=GetModuleHandle(NULL);
- if (hCoreInstance!=hInstance)
- hResIcon=bShared?LoadSmallIcon(hInstance,lpIconName):LoadSmallIconShared(hInstance,lpIconName);
+ HINSTANCE hCoreInstance = GetModuleHandle(NULL);
+ if (hCoreInstance != hInstance)
+ hResIcon = bShared?LoadSmallIcon(hInstance,lpIconName):LoadSmallIconShared(hInstance,lpIconName);
}
return hResIcon;
}
@@ -206,16 +206,16 @@ BOOL DestroyIcon_protect(HICON icon) void li_ListDestruct(SortedList *pList, ItemDestuctor pItemDestructor)
{
- int i=0;
+ int i = 0;
if (!pList) return;
- for (i=0; i<pList->realCount; i++) pItemDestructor(pList->items[i]);
+ for (i = 0; i < pList->realCount; i++) pItemDestructor(pList->items[i]);
List_Destroy(pList);
mir_free(pList);
}
void li_RemoveDestruct(SortedList *pList, int index, ItemDestuctor pItemDestructor)
{
- if (index>=0 && index<pList->realCount)
+ if (index >= 0 && index < pList->realCount)
{
pItemDestructor(pList->items[index]);
List_Remove(pList, index);
@@ -230,20 +230,20 @@ void li_RemovePtrDestruct(SortedList *pList, void * ptr, ItemDestuctor pItemDest void li_SortList(SortedList *pList, FSortFunc pSortFunct)
{
- FSortFunc pOldSort=pList->sortFunc;
+ FSortFunc pOldSort = pList->sortFunc;
int i;
- 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)
+ 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)
{
- void * temp=pList->items[i];
- pList->items[i]=pList->items[i+1];
- pList->items[i+1]=temp;
+ void * temp = pList->items[i];
+ pList->items[i] = pList->items[i+1];
+ pList->items[i+1] = temp;
i--;
if (i>0) i--;
}
- pList->sortFunc=pOldSort;
+ pList->sortFunc = pOldSort;
}
typedef struct _HookRec
@@ -256,33 +256,32 @@ typedef struct _HookRec #endif
} HookRec;
-static HookRec * hooksrec=NULL;
-static DWORD hooksRecAlloced=0;
+static HookRec * hooksrec = NULL;
+static DWORD hooksRecAlloced = 0;
HANDLE ModernHookEvent(char *EventID, MIRANDAHOOK HookProc)
{
- HookRec * hr=NULL;
+ HookRec * hr = NULL;
DWORD i;
//1. Find free
- for (i=0;i<hooksRecAlloced;i++)
- {
- if (hooksrec[i].hHook==NULL)
+ for (i = 0;i < hooksRecAlloced;i++) {
+ if (hooksrec[i].hHook == NULL)
{
- hr=&(hooksrec[i]);
+ hr = &(hooksrec[i]);
break;
}
}
- if (hr==NULL)
+ if (hr == NULL)
{
//2. Need realloc
- hooksrec=(HookRec*)mir_realloc(hooksrec,sizeof(HookRec)*(hooksRecAlloced+1));
- hr=&(hooksrec[hooksRecAlloced]);
+ hooksrec = (HookRec*)mir_realloc(hooksrec,sizeof(HookRec)*(hooksRecAlloced+1));
+ hr = &(hooksrec[hooksRecAlloced]);
hooksRecAlloced++;
}
- hr->hHook=HookEvent(EventID,HookProc);
+ hr->hHook = HookEvent(EventID,HookProc);
return hr->hHook;
}
@@ -291,12 +290,12 @@ int ModernUnhookEvent(HANDLE hHook) DWORD i;
//1. Find free
- for (i=0;i<hooksRecAlloced;i++)
+ for (i = 0;i < hooksRecAlloced;i++)
{
- if (hooksrec[i].hHook==hHook)
+ if (hooksrec[i].hHook == hHook)
{
UnhookEvent(hHook);
- hooksrec[i].hHook=NULL;
+ hooksrec[i].hHook = NULL;
return 1;
}
}
@@ -308,15 +307,15 @@ int UnhookAll() DWORD i;
TRACE("Unhooked Events:\n");
if (!hooksrec) return 0;
- for (i=0;i<hooksRecAlloced;i++)
+ for (i = 0;i < hooksRecAlloced;i++)
{
- if (hooksrec[i].hHook!=NULL)
+ if (hooksrec[i].hHook != NULL)
{
UnhookEvent(hooksrec[i].hHook);
- hooksrec[i].hHook=NULL;
+ hooksrec[i].hHook = NULL;
}
}
mir_free_and_nill(hooksrec);
- hooksRecAlloced=0;
+ hooksRecAlloced = 0;
return 1;
}
diff --git a/plugins/Clist_modern/modern_contact.cpp b/plugins/Clist_modern/modern_contact.cpp index 1b43db4610..9f5a98d492 100644 --- a/plugins/Clist_modern/modern_contact.cpp +++ b/plugins/Clist_modern/modern_contact.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. struct
{
int m_cache_nStatus,order;
-} statusModeOrder[]={
+} statusModeOrder[] = {
{ID_STATUS_OFFLINE,500},
{ID_STATUS_ONLINE,10},
{ID_STATUS_AWAY,200},
@@ -54,8 +54,8 @@ void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add) static int GetStatusModeOrdering(int statusMode)
{
int i;
- for(i=0;i<SIZEOF(statusModeOrder);i++)
- if(statusModeOrder[i].m_cache_nStatus==statusMode) return statusModeOrder[i].order;
+ for(i = 0;i < SIZEOF(statusModeOrder);i++)
+ if (statusModeOrder[i].m_cache_nStatus == statusMode) return statusModeOrder[i].order;
return 1000;
}
@@ -71,7 +71,7 @@ DWORD CompareContacts2_getLMTime(HANDLE hContact) dbei.pBlob = 0;
dbei.cbBlob = 0;
CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei);
- if(dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
return dbei.timestamp;
hDbEvent = (HANDLE)CallService(MS_DB_EVENT_FINDPREV, (WPARAM)hDbEvent, 0);
}
@@ -83,12 +83,12 @@ DWORD CompareContacts2_getLMTime(HANDLE hContact) int GetProtoIndex(char * szName)
{
- PROTOACCOUNT **accs=NULL;
- int accCount=0;
+ PROTOACCOUNT **accs = NULL;
+ int accCount = 0;
int i;
if (!szName) return -1;
ProtoEnumAccounts( &accCount, &accs );
- for (i=0; i<accCount; i++)
+ for (i = 0; i < accCount; i++)
if (!mir_strcmpi(szName,accs[i]->szModuleName))
return accs[i]->iOrder;
return -1;
@@ -103,57 +103,57 @@ int CompareContacts2(const struct ClcContact *contact1,const struct ClcContact * int statusa,statusb;
char *szProto1,*szProto2;
- if ((INT_PTR)contact1<100 || (INT_PTR)contact2<100) return 0;
+ if ((INT_PTR)contact1 < 100 || (INT_PTR)contact2 < 100) return 0;
- a=contact1->hContact;
- b=contact2->hContact;
+ a = contact1->hContact;
+ b = contact2->hContact;
- namea=(TCHAR *)contact1->szText;
- statusa=GetContactCachedStatus(contact1->hContact);
- szProto1=contact1->proto;
+ namea = (TCHAR *)contact1->szText;
+ statusa = GetContactCachedStatus(contact1->hContact);
+ szProto1 = contact1->proto;
- nameb=(TCHAR *)contact2->szText;
- statusb=GetContactCachedStatus(contact2->hContact);
- szProto2=contact2->proto;
+ nameb = (TCHAR *)contact2->szText;
+ statusb = GetContactCachedStatus(contact2->hContact);
+ szProto2 = contact2->proto;
- if (by==SORTBY_STATUS)
+ if (by == SORTBY_STATUS)
{ //status
int ordera,orderb;
- ordera=GetStatusModeOrdering(statusa);
- orderb=GetStatusModeOrdering(statusb);
- if(ordera!=orderb) return ordera-orderb;
+ ordera = GetStatusModeOrdering(statusa);
+ orderb = GetStatusModeOrdering(statusb);
+ if (ordera != orderb) return ordera-orderb;
else return 0;
}
- if(g_CluiData.fSortNoOfflineBottom==0 && (statusa==ID_STATUS_OFFLINE)!=(statusb==ID_STATUS_OFFLINE)) { //one is offline: offline goes below online
- return 2*(statusa==ID_STATUS_OFFLINE)-1;
+ if (g_CluiData.fSortNoOfflineBottom == 0 && (statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE)) { //one is offline: offline goes below online
+ return 2*(statusa == ID_STATUS_OFFLINE)-1;
}
- if (by==SORTBY_NAME)
+ if (by == SORTBY_NAME)
{ //name
return mir_tstrcmpi(namea,nameb);
}
- if (by==SORTBY_NAME_LOCALE)
+ if (by == SORTBY_NAME_LOCALE)
{ //name
- static int LocaleId=-1;
- if (LocaleId==-1) LocaleId=CallService(MS_LANGPACK_GETLOCALE,0,0);
+ static int LocaleId = -1;
+ if (LocaleId == -1) LocaleId = CallService(MS_LANGPACK_GETLOCALE,0,0);
return (CompareString(LocaleId,NORM_IGNORECASE,SAFETSTRING(namea),-1,SAFETSTRING(nameb),-1))-2;
}
- else if (by==SORTBY_LASTMSG)
+ else if (by == SORTBY_LASTMSG)
{ //last message
- DWORD ta=CompareContacts2_getLMTime(a);
- DWORD tb=CompareContacts2_getLMTime(b);
+ DWORD ta = CompareContacts2_getLMTime(a);
+ DWORD tb = CompareContacts2_getLMTime(b);
return tb-ta;
}
- else if (by==SORTBY_PROTO)
+ else if (by == SORTBY_PROTO)
{
- int rc=GetProtoIndex(szProto1)-GetProtoIndex(szProto2);
+ int rc = GetProtoIndex(szProto1)-GetProtoIndex(szProto2);
- if (rc != 0 && (szProto1 != NULL && szProto2 != NULL)) return rc;
+ if (rc !=0 && (szProto1 !=NULL && szProto2 !=NULL)) return rc;
}
- else if (by==SORTBY_RATE)
+ else if (by == SORTBY_RATE)
return contact2->bContactRate-contact1->bContactRate;
// else :o)
return 0;
@@ -162,10 +162,10 @@ int CompareContacts2(const struct ClcContact *contact1,const struct ClcContact * int cliCompareContacts(const struct ClcContact *contact1,const struct ClcContact *contact2)
{
int i, r;
- for (i=0; i<SIZEOF(g_CluiData.bSortByOrder); i++)
+ for (i = 0; i < SIZEOF(g_CluiData.bSortByOrder); i++)
{
- r=CompareContacts2(contact1, contact2, g_CluiData.bSortByOrder[i]);
- if (r!=0)
+ r = CompareContacts2(contact1, contact2, g_CluiData.bSortByOrder[i]);
+ if (r != 0)
return r;
}
return 0;
@@ -176,7 +176,7 @@ int cliCompareContacts(const struct ClcContact *contact1,const struct ClcContact INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam)
{
CallService(MS_CLUI_CONTACTDELETED,wParam,0);
- if ((HANDLE)lParam==NULL)
+ if ((HANDLE)lParam == NULL)
db_unset((HANDLE)wParam,"CList","Group");
else
db_set_ws((HANDLE)wParam,"CList","Group",pcli->pfnGetGroupName(lParam, NULL));
@@ -200,8 +200,8 @@ INT_PTR ToggleGroups(WPARAM wParam,LPARAM lParam) INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam)
{
- int newVal= !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS);
- if ( wParam != -1 )
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS);
+ if ( wParam !=-1 )
{
if ( !newVal == wParam ) return 0;
newVal = wParam;
diff --git a/plugins/Clist_modern/modern_docking.cpp b/plugins/Clist_modern/modern_docking.cpp index d9d4c717da..ad5a719c43 100644 --- a/plugins/Clist_modern/modern_docking.cpp +++ b/plugins/Clist_modern/modern_docking.cpp @@ -35,10 +35,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define DOCKED_LEFT 1
#define DOCKED_RIGHT 2
-BOOL LockSubframeMoving=0;
-static int TempDock=0;
-static int dock_drag_dx=0;
-static int dock_drag_dy=0;
+BOOL LockSubframeMoving = 0;
+static int TempDock = 0;
+static int dock_drag_dx = 0;
+static int dock_drag_dy = 0;
static void Docking_GetMonitorRectFromPoint(POINT pt,RECT *rc)
{
@@ -78,23 +78,23 @@ static void Docking_AdjustPosition(HWND hwnd,RECT *rcDisplay,RECT *rc) APPBARDATA abd;
ZeroMemory(&abd,sizeof(abd));
- abd.cbSize=sizeof(abd);
- abd.hWnd=hwnd;
- abd.uEdge=g_CluiData.fDocked==DOCKED_LEFT?ABE_LEFT:ABE_RIGHT;
- abd.rc=*rc;
- abd.rc.top=rcDisplay->top;
- abd.rc.bottom=rcDisplay->bottom;
- if(g_CluiData.fDocked==DOCKED_LEFT) {
- abd.rc.right=rcDisplay->left+abd.rc.right-abd.rc.left;
- abd.rc.left=rcDisplay->left;
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = hwnd;
+ abd.uEdge = g_CluiData.fDocked == DOCKED_LEFT?ABE_LEFT:ABE_RIGHT;
+ abd.rc = *rc;
+ abd.rc.top = rcDisplay->top;
+ abd.rc.bottom = rcDisplay->bottom;
+ if (g_CluiData.fDocked == DOCKED_LEFT) {
+ abd.rc.right = rcDisplay->left+abd.rc.right-abd.rc.left;
+ abd.rc.left = rcDisplay->left;
}
else {
- abd.rc.left=rcDisplay->right-(abd.rc.right-abd.rc.left);
- abd.rc.right=rcDisplay->right;
+ abd.rc.left = rcDisplay->right-(abd.rc.right-abd.rc.left);
+ abd.rc.right = rcDisplay->right;
}
SHAppBarMessage(ABM_SETPOS,&abd);
- *rc=abd.rc;
+ *rc = abd.rc;
}
int Docking_IsDocked(WPARAM wParam,LPARAM lParam)
@@ -106,40 +106,40 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) {
APPBARDATA abd;
static int draggingTitle;
- MSG *msg=(MSG*)wParam;
+ MSG *msg = (MSG*)wParam;
- if(msg->message==WM_DESTROY)
+ 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;
- if(db_get_b(NULL,"CList","Docked",0) && db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT))
+ //if (GetSystemMetrics(SM_CMONITORS)>1) return 0;
+ if (db_get_b(NULL,"CList","Docked",0) && db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT))
{
PostMessage(msg->hwnd,WM_CREATEDOCKED,0,0);
}
- draggingTitle=0;
+ draggingTitle = 0;
return 0;
case WM_CREATEDOCKED:
//we need to post a message just after creation to let main message function do some work
- g_CluiData.fDocked=(BOOL)db_get_b(NULL,"CList","Docked",0);
- if(IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
+ g_CluiData.fDocked = (BOOL)db_get_b(NULL,"CList","Docked",0);
+ if (IsWindowVisible(msg->hwnd) && !IsIconic(msg->hwnd)) {
RECT rc, rcMonitor;
ZeroMemory(&abd,sizeof(abd));
- abd.cbSize=sizeof(abd);
- abd.hWnd=msg->hwnd;
- abd.lParam=0;
- abd.uCallbackMessage=WM_DOCKCALLBACK;
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
+ abd.lParam = 0;
+ abd.uCallbackMessage = WM_DOCKCALLBACK;
SHAppBarMessage(ABM_NEW,&abd);
GetWindowRect(msg->hwnd,&rc);
Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
Docking_AdjustPosition(msg->hwnd,&rcMonitor,&rc);
MoveWindow(msg->hwnd,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,TRUE);
- g_CluiData.mutexPreventDockMoving=0;
+ g_CluiData.mutexPreventDockMoving = 0;
Sync(CLUIFrames_OnMoving,msg->hwnd,&rc);
- g_CluiData.mutexPreventDockMoving=1;
+ g_CluiData.mutexPreventDockMoving = 1;
ModernSkinButton_ReposButtons( msg->hwnd, SBRF_DO_NOT_DRAW, NULL );
}
break;
@@ -148,8 +148,8 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) return 0;
case WM_ACTIVATE:
ZeroMemory(&abd,sizeof(abd));
- abd.cbSize=sizeof(abd);
- abd.hWnd=msg->hwnd;
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_ACTIVATE,&abd);
return 0;
case WM_SIZE:
@@ -161,8 +161,8 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) if (g_CluiData.fDocked) ModernSkinButton_ReposButtons( msg->hwnd,SBRF_DO_NOT_DRAW, NULL );
return 0;
ZeroMemory(&abd,sizeof(abd));
- abd.cbSize=sizeof(abd);
- abd.hWnd=msg->hwnd;
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_WINDOWPOSCHANGED,&abd);
ModernSkinButton_ReposButtons( msg->hwnd, SBRF_DO_NOT_DRAW, NULL );
return 0;
@@ -172,7 +172,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) RECT rcMonitor;
RECT rcWindow;
RECT *rc;
- int dx=0;
+ int dx = 0;
POINT ptCursor;
if (g_CluiData.fDocked) return 0;
// stop early
@@ -181,35 +181,35 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) // GetMessagePos() is no good, position is always unsigned
GetCursorPos(&ptCursor);
GetWindowRect(msg->hwnd,&rcWindow);
- dock_drag_dx=rcWindow.left-ptCursor.x;
- dock_drag_dy=rcWindow.top-ptCursor.y;
+ dock_drag_dx = rcWindow.left-ptCursor.x;
+ dock_drag_dy = rcWindow.top-ptCursor.y;
Docking_GetMonitorRectFromPoint(ptCursor,&rcMonitor);
- if (((ptCursor.x<rcMonitor.left+EDGESENSITIVITY)
- || (ptCursor.x>=rcMonitor.right-EDGESENSITIVITY))
+ if (((ptCursor.x < rcMonitor.left+EDGESENSITIVITY)
+ || (ptCursor.x >= rcMonitor.right-EDGESENSITIVITY))
&& db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT))
{
ZeroMemory(&abd,sizeof(abd));
- abd.cbSize=sizeof(abd);
- abd.hWnd=msg->hwnd;
- abd.lParam=0;
- abd.uCallbackMessage=WM_DOCKCALLBACK;
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
+ abd.lParam = 0;
+ abd.uCallbackMessage = WM_DOCKCALLBACK;
SHAppBarMessage(ABM_NEW,&abd);
- if(ptCursor.x<rcMonitor.left+EDGESENSITIVITY) g_CluiData.fDocked=DOCKED_LEFT;
- else g_CluiData.fDocked=DOCKED_RIGHT;
- // TempDock=1;
+ if (ptCursor.x < rcMonitor.left+EDGESENSITIVITY) g_CluiData.fDocked = DOCKED_LEFT;
+ else g_CluiData.fDocked = DOCKED_RIGHT;
+ // TempDock = 1;
GetWindowRect(msg->hwnd,(LPRECT)msg->lParam);
- rc=(RECT*)msg->lParam;
- if (g_CluiData.fDocked==DOCKED_RIGHT)
- dx=(rc->right>rcMonitor.right)?rc->right-rcMonitor.right:0;
+ rc = (RECT*)msg->lParam;
+ if (g_CluiData.fDocked == DOCKED_RIGHT)
+ dx = (rc->right>rcMonitor.right)?rc->right-rcMonitor.right:0;
else
- dx=(rc->left<rcMonitor.left)?rc->left-rcMonitor.left:0;
+ dx = (rc->left < rcMonitor.left)?rc->left-rcMonitor.left:0;
OffsetRect(rc,-dx,0);
Docking_AdjustPosition(msg->hwnd,(LPRECT)&rcMonitor,(LPRECT)msg->lParam);
SendMessage(msg->hwnd,WM_SIZE,0,0);
- g_CluiData.mutexPreventDockMoving=0;
+ g_CluiData.mutexPreventDockMoving = 0;
Sync(CLUIFrames_OnMoving,msg->hwnd,(LPRECT)msg->lParam);
- g_CluiData.mutexPreventDockMoving=1;
+ g_CluiData.mutexPreventDockMoving = 1;
mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);
db_set_b(NULL,"CList","Docked",(BYTE)g_CluiData.fDocked);
ModernSkinButton_ReposButtons( msg->hwnd, SBRF_DO_NOT_DRAW, NULL );
@@ -221,30 +221,30 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) {
RECT rcMonitor;
RECT rcWindow;
- if (TempDock) TempDock=0;
+ if (TempDock) TempDock = 0;
GetWindowRect(msg->hwnd,&rcWindow);
Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
Docking_AdjustPosition(msg->hwnd,&rcMonitor,&rcWindow);
- *((LRESULT*)lParam)=TRUE;
- g_CluiData.mutexPreventDockMoving=0;
+ *((LRESULT*)lParam) = TRUE;
+ g_CluiData.mutexPreventDockMoving = 0;
SetWindowPos(msg->hwnd,0,rcWindow.left,rcWindow.top,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOREDRAW|SWP_NOSENDCHANGING);
Sync(CLUIFrames_OnMoving,msg->hwnd,&rcWindow);
- ModernSkinButton_ReposButtons( msg->hwnd, SBRF_DO_NOT_DRAW, NULL );//-=-=-=
- g_CluiData.mutexPreventDockMoving=1;
+ ModernSkinButton_ReposButtons( msg->hwnd, SBRF_DO_NOT_DRAW, NULL );// -= -= -=
+ g_CluiData.mutexPreventDockMoving = 1;
return 1;
}
case WM_MOVE:
{
- if(g_CluiData.fDocked && 0) {
+ if (g_CluiData.fDocked && 0) {
RECT rc, rcMonitor;
Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
GetWindowRect(msg->hwnd,&rc);
Docking_AdjustPosition(msg->hwnd,&rcMonitor,&rc);
MoveWindow(msg->hwnd,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,TRUE);
Sync(CLUIFrames_OnMoving,msg->hwnd,&rc);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);//-=-=-=
+ ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);// -= -= -=
return 1;
}
@@ -257,36 +257,36 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) /*RECT rcMonitor;
Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
Docking_AdjustPosition(msg->hwnd,&rcMonitor,(LPRECT)msg->lParam);
- *((LRESULT*)lParam)=TRUE;
+ *((LRESULT*)lParam) = TRUE;
*/
RECT rc;
if (g_CluiData.fDocked) ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW,NULL);
return FALSE;
- rc=*(RECT*)(msg->lParam);
- g_CluiData.mutexPreventDockMoving=0;
+ rc = *(RECT*)(msg->lParam);
+ g_CluiData.mutexPreventDockMoving = 0;
Sync(CLUIFrames_OnMoving,msg->hwnd,&rc);
- //-=-=-=
+ // -= -= -=
return TRUE;
}
case WM_SHOWWINDOW:
{
- if(msg->lParam) return 0;
+ if (msg->lParam) return 0;
BOOL toBeDocked = (BOOL) db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT);
- if ((msg->wParam && g_CluiData.fDocked<0) || (!msg->wParam && g_CluiData.fDocked>0)) g_CluiData.fDocked=-g_CluiData.fDocked;
+ if ((msg->wParam && g_CluiData.fDocked < 0) || (!msg->wParam && g_CluiData.fDocked>0)) g_CluiData.fDocked = -g_CluiData.fDocked;
ZeroMemory(&abd,sizeof(abd));
- abd.cbSize=sizeof(abd);
- abd.hWnd=msg->hwnd;
- if(msg->wParam) {
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
+ if (msg->wParam) {
RECT rc, rcMonitor;
Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
- abd.lParam=0;
- abd.uCallbackMessage=WM_DOCKCALLBACK;
+ abd.lParam = 0;
+ abd.uCallbackMessage = WM_DOCKCALLBACK;
SHAppBarMessage(ABM_NEW,&abd);
GetWindowRect(msg->hwnd,&rc);
Docking_AdjustPosition(msg->hwnd,&rcMonitor,&rc);
MoveWindow(msg->hwnd,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,FALSE);
Sync(CLUIFrames_OnMoving,msg->hwnd,&rc);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW,NULL);//-=-=-=
+ ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW,NULL);// -= -= -=
}
else {
SHAppBarMessage(ABM_REMOVE,&abd);
@@ -295,21 +295,21 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) return 0;
case WM_NCHITTEST:
{ LONG result;
- result=DefWindowProc(msg->hwnd,WM_NCHITTEST,msg->wParam,msg->lParam);
- if(result==HTSIZE || result==HTTOP || result==HTTOPLEFT || result==HTTOPRIGHT ||
- result==HTBOTTOM || result==HTBOTTOMRIGHT || result==HTBOTTOMLEFT) {*((LRESULT*)lParam)=HTCLIENT; return TRUE;}
- if(g_CluiData.fDocked==DOCKED_LEFT && result==HTLEFT) {*((LRESULT*)lParam)=HTCLIENT; return TRUE;}
- if(g_CluiData.fDocked==DOCKED_RIGHT && result==HTRIGHT) {*((LRESULT*)lParam)=HTCLIENT; return TRUE;}
+ result = DefWindowProc(msg->hwnd,WM_NCHITTEST,msg->wParam,msg->lParam);
+ if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT ||
+ result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT) {*((LRESULT*)lParam) = HTCLIENT; return TRUE;}
+ if (g_CluiData.fDocked == DOCKED_LEFT && result == HTLEFT) {*((LRESULT*)lParam) = HTCLIENT; return TRUE;}
+ if (g_CluiData.fDocked == DOCKED_RIGHT && result == HTRIGHT) {*((LRESULT*)lParam) = HTCLIENT; return TRUE;}
return 0;
}
case WM_SYSCOMMAND:
- if ((msg->wParam&0xFFF0)!=SC_MOVE) return 0;
+ if ((msg->wParam&0xFFF0) != SC_MOVE) return 0;
SetActiveWindow(msg->hwnd);
SetCapture(msg->hwnd);
- draggingTitle=1;
- *((LRESULT*)lParam)=0;
+ draggingTitle = 1;
+ *((LRESULT*)lParam) = 0;
return TRUE;
case WM_MOUSEMOVE:
@@ -317,15 +317,15 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) { RECT rc;
POINT pt;
GetClientRect(msg->hwnd,&rc);
- if (((g_CluiData.fDocked==DOCKED_LEFT || g_CluiData.fDocked==-DOCKED_LEFT) && (short)LOWORD(msg->lParam)>rc.right) ||
- ((g_CluiData.fDocked==DOCKED_RIGHT || g_CluiData.fDocked==-DOCKED_RIGHT) && (short)LOWORD(msg->lParam)<0)) {
+ if (((g_CluiData.fDocked == DOCKED_LEFT || g_CluiData.fDocked == -DOCKED_LEFT) && (short)LOWORD(msg->lParam)>rc.right) ||
+ ((g_CluiData.fDocked == DOCKED_RIGHT || g_CluiData.fDocked == -DOCKED_RIGHT) && (short)LOWORD(msg->lParam) < 0)) {
ReleaseCapture();
- draggingTitle=0;
+ draggingTitle = 0;
ZeroMemory(&abd,sizeof(abd));
- abd.cbSize=sizeof(abd);
- abd.hWnd=msg->hwnd;
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_REMOVE,&abd);
- g_CluiData.fDocked=0;
+ g_CluiData.fDocked = 0;
GetCursorPos(&pt);
PostMessage(msg->hwnd,WM_NCLBUTTONDOWN,HTCAPTION,MAKELPARAM(pt.x,pt.y));
SetWindowPos(msg->hwnd,0,pt.x-rc.right/2,pt.y-GetSystemMetrics(SM_CYFRAME)-GetSystemMetrics(SM_CYSMCAPTION)/2,db_get_dw(NULL,"CList","Width",0),db_get_dw(NULL,"CList","Height",0),SWP_NOZORDER);
@@ -335,9 +335,9 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) return 1;
}
case WM_LBUTTONUP:
- if(draggingTitle) {
+ if (draggingTitle) {
ReleaseCapture();
- draggingTitle=0;
+ draggingTitle = 0;
}
return 0;
case WM_DOCKCALLBACK:
@@ -350,19 +350,19 @@ int Docking_ProcessWindowMessage(WPARAM wParam,LPARAM lParam) Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
GetWindowRect(msg->hwnd,&rc);
Docking_AdjustPosition(msg->hwnd,&rcMonitor,&rc);
- Sync(CLUIFrames_OnMoving,msg->hwnd,&rc); //-=-=-=
+ Sync(CLUIFrames_OnMoving,msg->hwnd,&rc); // -= -= -=
ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
- g_CluiData.mutexPreventDockMoving=1;
+ g_CluiData.mutexPreventDockMoving = 1;
}
break;
}
return TRUE;
case WM_DESTROY:
- if(g_CluiData.fDocked>0) {
+ if (g_CluiData.fDocked>0) {
ZeroMemory(&abd,sizeof(abd));
- abd.cbSize=sizeof(abd);
- abd.hWnd=msg->hwnd;
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
SHAppBarMessage(ABM_REMOVE,&abd);
ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
}
diff --git a/plugins/Clist_modern/modern_extraimage.cpp b/plugins/Clist_modern/modern_extraimage.cpp index 2fb3a26331..6217592c07 100644 --- a/plugins/Clist_modern/modern_extraimage.cpp +++ b/plugins/Clist_modern/modern_extraimage.cpp @@ -7,18 +7,18 @@ boolean visar[EXTRACOLUMNCOUNT];
int ExtraImageIconsIndex[ExtraImageIconsIndexCount];
-int EnabledColumnCount=0;
-BOOL g_mutex_bSetAllExtraIconsCycle=0;
+int EnabledColumnCount = 0;
+BOOL g_mutex_bSetAllExtraIconsCycle = 0;
-static HIMAGELIST hExtraImageList=NULL;
-static HIMAGELIST hWideExtraImageList=NULL;
+static HIMAGELIST hExtraImageList = NULL;
+static HIMAGELIST hWideExtraImageList = NULL;
void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact);
void ClearExtraIcons();
-boolean ImageCreated=FALSE;
-BYTE ExtraOrder[]=
+boolean ImageCreated = FALSE;
+BYTE ExtraOrder[] =
{
1, // EXTRA_ICON_EMAIL
2, // EXTRA_ICON_PROTO
@@ -42,9 +42,9 @@ boolean isColumnVisible(int extra) if (HasExtraIconsService())
return true;
- int i=0;
- for (i=0; i<sizeof(ExtraOrder)/sizeof(ExtraOrder[0]); i++)
- if (ExtraOrder[i]==extra)
+ int i = 0;
+ for (i = 0; i < sizeof(ExtraOrder)/sizeof(ExtraOrder[0]); i++)
+ if (ExtraOrder[i] == extra)
{
switch(i+1)
{
@@ -66,16 +66,16 @@ boolean isColumnVisible(int extra) void GetVisColumns()
{
- visar[0]=isColumnVisible(0);
- visar[1]=isColumnVisible(1);
- visar[2]=isColumnVisible(2);
- visar[3]=isColumnVisible(3);
- visar[4]=isColumnVisible(4);
- visar[5]=isColumnVisible(5);
- visar[6]=isColumnVisible(6);
- visar[7]=isColumnVisible(7);
- visar[8]=isColumnVisible(8);
- visar[9]=isColumnVisible(9);
+ visar[0] = isColumnVisible(0);
+ visar[1] = isColumnVisible(1);
+ visar[2] = isColumnVisible(2);
+ visar[3] = isColumnVisible(3);
+ visar[4] = isColumnVisible(4);
+ visar[5] = isColumnVisible(5);
+ visar[6] = isColumnVisible(6);
+ visar[7] = isColumnVisible(7);
+ visar[8] = isColumnVisible(8);
+ visar[9] = isColumnVisible(9);
};
__inline int bti(boolean b)
@@ -85,14 +85,14 @@ __inline int bti(boolean b) int colsum(int from,int to)
{
int i,sum;
- if (from<0||from>=EXTRACOLUMNCOUNT){return(-1);};
- if (to<0||to>=EXTRACOLUMNCOUNT){return(-1);};
- if (to<from){return(-1);};
+ if (from < 0||from >= EXTRACOLUMNCOUNT){return(-1);};
+ if (to < 0||to >= EXTRACOLUMNCOUNT){return(-1);};
+ if (to < from){return(-1);};
- sum=0;
- for (i=from;i<=to;i++)
+ sum = 0;
+ for (i = from;i <= to;i++)
{
- sum+=bti(visar[i]);
+ sum += bti(visar[i]);
};
return(sum);
};
@@ -110,7 +110,7 @@ int ExtraImage_ExtraIDToColumnNum(int extra) return extra-1;
}
- int ord=ExtraOrder[extra-1];
+ int ord = ExtraOrder[extra-1];
if (!visar[ord]) return -1;
return (colsum(0,ord)-1);
};
@@ -120,8 +120,8 @@ int ExtraImage_ColumnNumToExtraID(int column) if (HasExtraIconsService())
return column+1;
- for (int i=0; i<EXTRA_ICON_COUNT; i++)
- if (ExtraImage_ExtraIDToColumnNum(i)==column)
+ for (int i = 0; i < EXTRA_ICON_COUNT; i++)
+ if (ExtraImage_ExtraIDToColumnNum(i) == column)
return i;
return -1;
@@ -133,27 +133,27 @@ INT_PTR SetIconForExtraColumn(WPARAM wParam,LPARAM lParam) int icol;
HANDLE hItem;
- if (pcli->hwndContactTree==0){return(-1);};
- if (wParam==0||lParam==0){return(-1);};
- piec=(pIconExtraColumn)lParam;
+ if (pcli->hwndContactTree == 0){return(-1);};
+ if (wParam == 0||lParam == 0){return(-1);};
+ piec = (pIconExtraColumn)lParam;
- if (piec->cbSize!=sizeof(IconExtraColumn)){return(-1);};
- icol=ExtraImage_ExtraIDToColumnNum(piec->ColumnType);
- if (icol==-1){return(-1);};
- hItem=(HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
- if (hItem==0){return(-1);};
+ if (piec->cbSize != sizeof(IconExtraColumn)){return(-1);};
+ icol = ExtraImage_ExtraIDToColumnNum(piec->ColumnType);
+ if (icol == -1){return(-1);};
+ hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
+ if (hItem == 0){return(-1);};
SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(icol,piec->hImage));
return(0);
};
-//wparam=hIcon
+//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));
+ int res = -1;
+ if (hExtraImageList == 0||wParam == 0){return(-1);};
+ res = ((int)ImageList_AddIcon(hExtraImageList,(HICON)wParam));
if (res>254) return -1;
return res;
};
@@ -164,9 +164,9 @@ void SetNewExtraColumnCount() int newcount;
LoadPositionsFromDB(ExtraOrder);
GetVisColumns();
- newcount=colsum(0,EXTRACOLUMNCOUNT-1);
+ newcount = colsum(0,EXTRACOLUMNCOUNT-1);
db_set_b(NULL,CLUIFrameModule,"EnabledColumnCount",(BYTE)newcount);
- EnabledColumnCount=newcount;
+ EnabledColumnCount = newcount;
SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS,EnabledColumnCount,0);
};
@@ -182,8 +182,8 @@ void ExtraImage_ReloadExtraIcons() if (hExtraImageList){ImageList_Destroy(hExtraImageList);};
if (hWideExtraImageList){ImageList_Destroy(hWideExtraImageList);};
- hExtraImageList=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,1,256);
- hWideExtraImageList=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,1,256);
+ 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())
{
@@ -191,21 +191,21 @@ void ExtraImage_ReloadExtraIcons() //loading icons
hIcon = LoadSkinnedIcon(SKINICON_OTHER_SENDEMAIL);
- ExtraImageIconsIndex[0]=ImageList_AddIcon(hExtraImageList, hIcon);
+ ExtraImageIconsIndex[0] = ImageList_AddIcon(hExtraImageList, hIcon);
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
hIcon = LoadSkinnedIcon(SKINICON_OTHER_SMS);
- ExtraImageIconsIndex[1]=ImageList_AddIcon(hExtraImageList, hIcon);
+ ExtraImageIconsIndex[1] = ImageList_AddIcon(hExtraImageList, hIcon);
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
hIcon = LoadSkinnedIcon(SKINICON_EVENT_URL);
- ExtraImageIconsIndex[2]=ImageList_AddIcon(hExtraImageList, hIcon);
+ ExtraImageIconsIndex[2] = ImageList_AddIcon(hExtraImageList, hIcon);
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
//calc only needed protocols
//adding protocol icons
ProtoEnumAccounts( &count, &accs );
- for(i=0;i<count;i++)
+ for(i = 0;i < count;i++)
{
- if (!IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS,PFLAGNUM_2, 0 )== 0)
+ if (!IsAccountEnabled(accs[i]) || CallProtoService(accs[i]->szModuleName, PS_GETCAPS,PFLAGNUM_2, 0 ) == 0)
continue;
hIcon = LoadSkinnedProtoIcon(accs[i]->szModuleName,ID_STATUS_ONLINE);
@@ -213,19 +213,19 @@ void ExtraImage_ReloadExtraIcons() 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;}
- ExtraImageIconsIndex[3]=ImageList_AddIcon(hExtraImageList,hicon );
+ 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;}
+ 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;}
- ExtraImageIconsIndex[4]=ImageList_AddIcon(hExtraImageList,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;}
+ 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;}
- ExtraImageIconsIndex[5]=ImageList_AddIcon(hExtraImageList,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;}
+ ExtraImageIconsIndex[5] = ImageList_AddIcon(hExtraImageList,hicon );
if (needFree) DestroyIcon_protect(hicon);
}
@@ -233,7 +233,7 @@ void ExtraImage_ReloadExtraIcons() //ExtraImage_SetAllExtraIcons(hImgList);
SetNewExtraColumnCount();
NotifyEventHooks(g_CluiData.hEventExtraImageListRebuilding,0,0);
- ImageCreated=TRUE;
+ ImageCreated = TRUE;
}
void ReAssignExtraIcons()
@@ -249,100 +249,100 @@ void ClearExtraIcons() int i;
HANDLE hContact,hItem;
- //EnabledColumnCount=DBGetContactSettingByte(NULL,CLUIFrameModule,"EnabledColumnCount",5);
+ //EnabledColumnCount = DBGetContactSettingByte(NULL,CLUIFrameModule,"EnabledColumnCount",5);
//SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS,EnabledColumnCount,0);
SetNewExtraColumnCount();
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
do {
- hItem=(HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
- if (hItem==0){continue;};
- for (i=0;i<EnabledColumnCount;i++)
+ hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
+ if (hItem == 0){continue;};
+ for (i = 0;i < EnabledColumnCount;i++)
{
SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0xFF));
};
- } while(hContact=(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)
{
HANDLE hItem;
- int locApparentMode=0;
- char * locApparentModeProto=NULL;
- boolean hcontgiven=FALSE;
+ int locApparentMode = 0;
+ char * locApparentModeProto = NULL;
+ boolean hcontgiven = FALSE;
char *szProto;
char *(ImgIndex[64]);
int maxpr,count,i;
PROTOACCOUNT **accs;
pdisplayNameCacheEntry pdnce;
int em,pr,sms,a1,a2,w1,c1;
- int tick=0;
- g_mutex_bSetAllExtraIconsCycle=1;
- hcontgiven=(hContact!=0);
+ int tick = 0;
+ g_mutex_bSetAllExtraIconsCycle = 1;
+ hcontgiven = (hContact != 0);
- if (pcli->hwndContactTree==0){return;};
- tick=GetTickCount();
- if (ImageCreated==FALSE) ExtraImage_ReloadExtraIcons();
+ if (pcli->hwndContactTree == 0){return;};
+ tick = GetTickCount();
+ if (ImageCreated == FALSE) ExtraImage_ReloadExtraIcons();
SetNewExtraColumnCount();
BOOL hasExtraIconsService = HasExtraIconsService();
if (!hasExtraIconsService)
{
- em=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL);
- pr=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO);
- sms=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS);
- a1=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_ADV1);
- a2=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_ADV2);
- w1=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB);
- c1=ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_CLIENT);
+ em = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL);
+ pr = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO);
+ sms = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS);
+ a1 = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_ADV1);
+ a2 = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_ADV2);
+ w1 = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB);
+ c1 = ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_CLIENT);
memset( ImgIndex, 0, sizeof( ImgIndex ));
ProtoEnumAccounts( &count, &accs );
- maxpr=0;
+ maxpr = 0;
//calc only needed protocols
- for(i=0;i<count;i++) {
- if ( !IsAccountEnabled( accs[i] ) || CallProtoService(accs[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0)==0) continue;
- ImgIndex[maxpr]=accs[i]->szModuleName;
+ for(i = 0;i < count;i++) {
+ if ( !IsAccountEnabled( accs[i] ) || CallProtoService(accs[i]->szModuleName,PS_GETCAPS,PFLAGNUM_2,0) == 0) continue;
+ ImgIndex[maxpr] = accs[i]->szModuleName;
maxpr++;
}
}
- if (hContact==NULL)
+ if (hContact == NULL)
{
- hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST,0,0);
}
do {
- szProto=NULL;
- hItem=hContact;
- if (hItem==0){continue;};
- pdnce=(pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hItem);
- if (pdnce==NULL) {continue;};
+ szProto = NULL;
+ hItem = hContact;
+ if (hItem == 0){continue;};
+ pdnce = (pdisplayNameCacheEntry)pcli->pfnGetCacheEntry(hItem);
+ if (pdnce == NULL) {continue;};
- // szProto=(char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- szProto=pdnce->m_cache_cszProto;
+ // szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
+ szProto = pdnce->m_cache_cszProto;
if (!hasExtraIconsService)
{
{
boolean showweb;
- showweb=FALSE;
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB)!=-1)
+ showweb = FALSE;
+ if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_WEB) != -1)
{
- if (szProto != NULL)
+ if (szProto !=NULL)
{
char *homepage;
- homepage= db_get_sa(pdnce->m_cache_hContact,"UserInfo", "Homepage");
+ homepage = db_get_sa(pdnce->m_cache_hContact,"UserInfo", "Homepage");
if (!homepage)
- homepage= db_get_sa(pdnce->m_cache_hContact,pdnce->m_cache_cszProto, "Homepage");
- if (homepage!=NULL)
+ homepage = db_get_sa(pdnce->m_cache_hContact,pdnce->m_cache_cszProto, "Homepage");
+ if (homepage != NULL)
{
- showweb=TRUE;
+ showweb = TRUE;
mir_free_and_nill(homepage);
}
}
@@ -350,17 +350,17 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) }
}
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
boolean showemail;
- showemail=TRUE;
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL)!=-1)
+ showemail = TRUE;
+ if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL) != -1)
{
if (szProto == NULL || DBGetContactSettingString(hContact, szProto, "e-mail",&dbv))
{
db_free(&dbv);
if (DBGetContactSettingString(hContact, "UserInfo", "Mye-mail0", &dbv))
- showemail=FALSE;
+ showemail = FALSE;
}
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_EMAIL),(showemail)?0:0xFF));
db_free(&dbv);
@@ -368,25 +368,25 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) }
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
boolean showsms;
- showsms=TRUE;
- if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS)!=-1)
+ showsms = TRUE;
+ if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS) != -1)
{
if (szProto == NULL || DBGetContactSettingString(hContact, szProto, "Cellular",&dbv))
{
db_free(&dbv);
if (DBGetContactSettingString(hContact, "UserInfo", "MyPhone0", &dbv))
- showsms=FALSE;
+ showsms = FALSE;
}
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_SMS),(showsms)?1:0xFF));
db_free(&dbv);
}
}
- if(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO)!=-1)
+ if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_PROTO) != -1)
{
- for (i=0;i<maxpr;i++)
+ for (i = 0;i < maxpr;i++)
{
if (!mir_strcmp(ImgIndex[i],szProto))
{
@@ -395,30 +395,30 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) };
};
};
- if(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE)!=-1)
+ if (ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE) != -1)
{
- BYTE iconIndex=0xFF;
- if (szProto != NULL)
+ BYTE iconIndex = 0xFF;
+ if (szProto !=NULL)
{
if (!db_get_b(hContact, szProto, "ChatRoom", 0))
{
- if (pdnce->ApparentMode==ID_STATUS_OFFLINE)
- iconIndex=ExtraImageIconsIndex[4];
- else if (pdnce->ApparentMode==ID_STATUS_ONLINE)
+ if (pdnce->ApparentMode == ID_STATUS_OFFLINE)
+ iconIndex = ExtraImageIconsIndex[4];
+ else if (pdnce->ApparentMode == ID_STATUS_ONLINE)
{
- if (szProto!=locApparentModeProto)
+ if (szProto != locApparentModeProto)
{
- locApparentModeProto=szProto;
- locApparentMode=CallProtoService(locApparentModeProto,PS_GETSTATUS,0,0);
+ locApparentModeProto = szProto;
+ locApparentMode = CallProtoService(locApparentModeProto,PS_GETSTATUS,0,0);
}
- if(locApparentMode == ID_STATUS_INVISIBLE || db_get_b(NULL,"CList","AlwaysShowAlwaysVisIcon",SETTING_ALWAYSVISICON_DEFAULT) == 1)
- iconIndex=ExtraImageIconsIndex[3]; }
+ if (locApparentMode == ID_STATUS_INVISIBLE || db_get_b(NULL,"CList","AlwaysShowAlwaysVisIcon",SETTING_ALWAYSVISICON_DEFAULT) == 1)
+ iconIndex = ExtraImageIconsIndex[3]; }
}
else
{
- if (pdnce->ApparentMode==ID_STATUS_OFFLINE)
- iconIndex=ExtraImageIconsIndex[5];
- else iconIndex=255;
+ if (pdnce->ApparentMode == ID_STATUS_OFFLINE)
+ iconIndex = ExtraImageIconsIndex[5];
+ else iconIndex = 255;
}
}
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraImage_ExtraIDToColumnNum(EXTRA_ICON_VISMODE),iconIndex));
@@ -427,22 +427,22 @@ void ExtraImage_SetAllExtraIcons(HWND hwndList,HANDLE hContact) NotifyEventHooks(g_CluiData.hEventExtraImageApplying,(WPARAM)hContact,0);
if (hcontgiven) break;
Sleep(0);
- } while(hContact=(HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
+ } while(hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT,(WPARAM)hContact,0));
- tick=GetTickCount()-tick;
- g_mutex_bSetAllExtraIconsCycle=0;
+ tick = GetTickCount()-tick;
+ g_mutex_bSetAllExtraIconsCycle = 0;
CLUI__cliInvalidateRect(hwndList,NULL,FALSE);
Sleep(0);
}
HWND SetToolTip(HWND hwnd, TCHAR * tip);
-HWND tipHWND=NULL;
+HWND tipHWND = NULL;
static int ehhShowExtraInfoTip(WPARAM wParam, LPARAM lParam)
{
- CLCEXTRAINFOTIP * eit=(CLCEXTRAINFOTIP *)lParam;
- //tipHWND=SetToolTip(eit->hwnd,_T("TEST"));
+ CLCEXTRAINFOTIP * eit = (CLCEXTRAINFOTIP *)lParam;
+ //tipHWND = SetToolTip(eit->hwnd,_T("TEST"));
//SendMessage(tipHWND,TTM_ACTIVATE,1,0);
//SendMessage(tipHWND,TTM_POPUP,0,0);
return 1;
@@ -463,30 +463,30 @@ INT_PTR WideSetIconForExtraColumn(WPARAM wParam,LPARAM lParam) int icol;
HANDLE hItem;
- if (pcli->hwndContactTree==0){return(-1);};
- if (wParam==0||lParam==0){return(-1);};
- piec=(pIconExtraColumn)lParam;
+ if (pcli->hwndContactTree == 0){return(-1);};
+ if (wParam == 0||lParam == 0){return(-1);};
+ piec = (pIconExtraColumn)lParam;
- if (piec->cbSize!=sizeof(IconExtraColumn)){return(-1);};
- icol=ExtraImage_ExtraIDToColumnNum(piec->ColumnType);
- if (icol==-1){return(-1);};
+ if (piec->cbSize != sizeof(IconExtraColumn)){return(-1);};
+ icol = ExtraImage_ExtraIDToColumnNum(piec->ColumnType);
+ if (icol == -1){return(-1);};
- hItem=(HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
- if (hItem==0){return(-1);};
- if (piec->hImage==(HANDLE)0xFF) piec->hImage=(HANDLE)0xFFFF;
+ hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
+ if (hItem == 0){return(-1);};
+ if (piec->hImage == (HANDLE)0xFF) piec->hImage = (HANDLE)0xFFFF;
SendMessage(pcli->hwndContactTree,CLM_SETWIDEEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(icol,piec->hImage));
return(0);
};
-//wparam=hIcon
+//wparam = hIcon
//return hImage on success,-1 on failure
INT_PTR WideAddIconToExtraImageList(WPARAM wParam,LPARAM lParam)
{
- int res=-1;
- if (hWideExtraImageList==0||wParam==0){return(-1);};
- res=((int)ImageList_AddIcon(hWideExtraImageList,(HICON)wParam));
- if (res==0xFF) res=((int)ImageList_AddIcon(hWideExtraImageList,(HICON)wParam));
+ int res = -1;
+ if (hWideExtraImageList == 0||wParam == 0){return(-1);};
+ res = ((int)ImageList_AddIcon(hWideExtraImageList,(HICON)wParam));
+ if (res == 0xFF) res = ((int)ImageList_AddIcon(hWideExtraImageList,(HICON)wParam));
if (res>0xFFFE) return -1;
return res;
};
diff --git a/plugins/Clist_modern/modern_framesmenu.cpp b/plugins/Clist_modern/modern_framesmenu.cpp index 766adf4974..359f3c1f36 100644 --- a/plugins/Clist_modern/modern_framesmenu.cpp +++ b/plugins/Clist_modern/modern_framesmenu.cpp @@ -1,7 +1,7 @@ #include "hdr/modern_commonheaders.h"
#include "hdr/modern_commonprototypes.h"
-//==========================Frames
+// == == == == == == == == == == == == == Frames
HANDLE hFrameMenuObject;
//contactmenu exec param(ownerdata)
@@ -18,7 +18,7 @@ void FreeAndNil( void **p ) if ( p == NULL )
return;
- if ( *p != NULL ) {
+ if ( *p !=NULL ) {
mir_free( *p );
*p = NULL;
} }
@@ -48,15 +48,15 @@ static INT_PTR AddContextFrameMenuItem(WPARAM wParam,LPARAM lParam) static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam)
{
lpFrameMenuExecParam fmep;
- fmep=(lpFrameMenuExecParam)CallService(MO_MENUITEMGETOWNERDATA,wParam,lParam);
- if (fmep!=NULL){
- if (fmep->szServiceName!=NULL){
+ fmep = (lpFrameMenuExecParam)CallService(MO_MENUITEMGETOWNERDATA,wParam,lParam);
+ if (fmep != NULL){
+ if (fmep->szServiceName != NULL){
mir_free_and_nill(fmep->szServiceName);
};
mir_free_and_nill(fmep);
}
- if (lParam!=1)
+ if (lParam != 1)
CallService(MO_REMOVEMENUITEM,wParam,0);
return 0;
@@ -66,8 +66,8 @@ static INT_PTR RemoveContextFrameMenuItem(WPARAM wParam,LPARAM lParam) //wparam - ownerdata
//lparam - lparam from winproc
INT_PTR FrameMenuExecService(WPARAM wParam,LPARAM lParam) {
- lpFrameMenuExecParam fmep=(lpFrameMenuExecParam)wParam;
- if (fmep==NULL){return(-1);};
+ lpFrameMenuExecParam fmep = (lpFrameMenuExecParam)wParam;
+ if (fmep == NULL){return(-1);};
CallService(fmep->szServiceName,lParam,fmep->param1);
return(0);
@@ -76,18 +76,18 @@ INT_PTR FrameMenuExecService(WPARAM wParam,LPARAM lParam) { //true - ok,false ignore
INT_PTR FrameMenuCheckService(WPARAM wParam,LPARAM lParam) {
- PCheckProcParam pcpp=(PCheckProcParam)wParam;
+ PCheckProcParam pcpp = (PCheckProcParam)wParam;
lpFrameMenuExecParam fmep;
TMO_MenuItem mi;
- if (pcpp==NULL){return(FALSE);};
- if (CallService(MO_GETMENUITEM,(WPARAM)pcpp->MenuItemHandle,(LPARAM)&mi)==0)
+ if (pcpp == NULL){return(FALSE);};
+ if (CallService(MO_GETMENUITEM,(WPARAM)pcpp->MenuItemHandle,(LPARAM)&mi) == 0)
{
- fmep=(lpFrameMenuExecParam)mi.ownerdata;
- if (fmep!=NULL)
+ fmep = (lpFrameMenuExecParam)mi.ownerdata;
+ if (fmep != NULL)
{
//pcpp->wParam - frameid
- if (((WPARAM)fmep->Frameid==pcpp->wParam)||fmep->Frameid==-1) return(TRUE);
+ if (((WPARAM)fmep->Frameid == pcpp->wParam)||fmep->Frameid == -1) return(TRUE);
};
};
@@ -103,19 +103,19 @@ static INT_PTR ContextFrameMenuNotify(WPARAM wParam,LPARAM lParam) static INT_PTR BuildContextFrameMenu(WPARAM wParam,LPARAM lParam)
{
ListParam param = { 0 };
- param.MenuObjectHandle=hFrameMenuObject;
- param.wParam=wParam;
- param.lParam=lParam;
+ param.MenuObjectHandle = hFrameMenuObject;
+ param.wParam = wParam;
+ param.lParam = lParam;
- HMENU hMenu=CreatePopupMenu();
+ HMENU hMenu = CreatePopupMenu();
//NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,-1);
ContextFrameMenuNotify(wParam,-1);
CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m);
return (INT_PTR)hMenu;
}
-//==========================Frames end
-boolean InternalGenMenuModule=FALSE;
+// == == == == == == == == == == == == == Frames end
+boolean InternalGenMenuModule = FALSE;
int MeasureItemProxy(WPARAM wParam,LPARAM lParam) {
@@ -123,7 +123,7 @@ int MeasureItemProxy(WPARAM wParam,LPARAM lParam) { if (InternalGenMenuModule)
{
- val=CallService(MS_INT_MENUMEASUREITEM,wParam,lParam);
+ val = CallService(MS_INT_MENUMEASUREITEM,wParam,lParam);
if (val) return(val);
};
return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
@@ -136,7 +136,7 @@ int DrawItemProxy(WPARAM wParam,LPARAM lParam) { if (InternalGenMenuModule)
{
int val;
- val=CallService(MS_INT_MENUDRAWITEM,wParam,lParam);
+ val = CallService(MS_INT_MENUDRAWITEM,wParam,lParam);
if (val) return(val);
}
return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
@@ -149,7 +149,7 @@ int ProcessCommandProxy(WPARAM wParam,LPARAM lParam) { if (InternalGenMenuModule)
{
int val;
- val=CallService(MS_INT_MENUPROCESSCOMMAND,wParam,lParam);
+ val = CallService(MS_INT_MENUPROCESSCOMMAND,wParam,lParam);
if (val) return(val);
};
@@ -161,7 +161,7 @@ int ModifyMenuItemProxy(WPARAM wParam,LPARAM lParam) { if (InternalGenMenuModule)
{
int val;
- val=CallService(MS_INT_MODIFYMENUITEM,wParam,lParam);
+ val = CallService(MS_INT_MODIFYMENUITEM,wParam,lParam);
if (val) return(val);
};
@@ -178,7 +178,7 @@ int InitFramesMenus(void) {
InitCustomMenus();
- InternalGenMenuModule=TRUE;
+ InternalGenMenuModule = TRUE;
};
if (ServiceExists(MO_REMOVEMENUOBJECT))
@@ -194,11 +194,11 @@ int InitFramesMenus(void) //frame menu object
memset(&tmp,0,sizeof(tmp));
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService="FrameMenuCheckService";
- tmp.ExecService="FrameMenuExecService";
- tmp.name="FrameMenu";
- hFrameMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
+ tmp.cbSize = sizeof(tmp);
+ tmp.CheckService = "FrameMenuCheckService";
+ tmp.ExecService = "FrameMenuExecService";
+ tmp.name = "FrameMenu";
+ hFrameMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,0,(LPARAM)&tmp);
}
return 0;
}
diff --git a/plugins/Clist_modern/modern_gdiplus.cpp b/plugins/Clist_modern/modern_gdiplus.cpp index 4ab8604697..b62bed4231 100644 --- a/plugins/Clist_modern/modern_gdiplus.cpp +++ b/plugins/Clist_modern/modern_gdiplus.cpp @@ -6,7 +6,7 @@ #include "hdr/modern_commonheaders.h"
#undef Translate //otherwise will conflict with gdi plus Translate
-#include <gdiplus.h>
+#include < gdiplus.h>
#include "hdr/modern_global_structure.h"
@@ -45,7 +45,7 @@ void ShutdownGdiPlus(void) using namespace Gdiplus;
-static ColorMatrix ClrMatrix = {
+static ColorMatrix ClrMatrix = {
1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
@@ -64,14 +64,14 @@ DWORD argb_from_cola(COLORREF col, BYTE alpha) HBITMAP GDIPlus_LoadGlyphImage(char *szFileName)
{
WCHAR *string;
- string=(WCHAR*)malloc(sizeof(WCHAR)*(mir_strlen(szFileName)+2));
+ string = (WCHAR*)malloc(sizeof(WCHAR)*(mir_strlen(szFileName)+2));
MultiByteToWideChar(CP_ACP, 0, szFileName, -1, string, (mir_strlen(szFileName)+2)*sizeof(WCHAR));
// Create a Bitmap object from a JPEG file.
Bitmap bitmap(string,0);
free(string);
// Clone a portion of the bitmap.
Bitmap* clone = bitmap.Clone(0, 0, bitmap.GetWidth(), bitmap.GetHeight(), PixelFormat32bppPARGB);
- HBITMAP hbmp=NULL;
+ HBITMAP hbmp = NULL;
if (clone)
{
clone->GetHBITMAP(Color(0,0,0),&hbmp);
@@ -83,9 +83,9 @@ void TextOutWithGDIp(HDC hDestDC, int x, int y, LPCTSTR lpString, int nCount) {
// Graphics s(hDestDC);
// HBITMAP hs;
-// hs=(HBITMAP)GetCurrentObject(hDestDC,OBJ_BITMAP);
+// hs = (HBITMAP)GetCurrentObject(hDestDC,OBJ_BITMAP);
// Bitmap sb(hs,NULL);
-// Bitmap *b=(sb.Clone(x,y,150,30,PixelFormat32bppARGB));
+// Bitmap *b = (sb.Clone(x,y,150,30,PixelFormat32bppARGB));
// Graphics g(b);//(100,100,PixelFormat32bppPARGB);
// //g.DrawImage(sb);
// // s.SetCompositingMode(CompositingModeSourceCopy);
@@ -96,7 +96,7 @@ void TextOutWithGDIp(HDC hDestDC, int x, int y, LPCTSTR lpString, int nCount) // // Create a string.
//
// WCHAR *string;
-// string=(WCHAR*)malloc(sizeof(WCHAR)*(nCount+2));
+// string = (WCHAR*)malloc(sizeof(WCHAR)*(nCount+2));
// MultiByteToWideChar(CP_ACP, 0, lpString, -1, string, (nCount+2)*sizeof(WCHAR));
// Font myFont(hDestDC);
//
@@ -104,14 +104,14 @@ void TextOutWithGDIp(HDC hDestDC, int x, int y, LPCTSTR lpString, int nCount) // PointF origin2((float)x, (float)y);
// g.SetTextRenderingHint(TextRenderingHintSystemDefault);
// g.SetSmoothingMode(SmoothingModeAntiAlias);
-// COLORREF ref=GetTextColor(hDestDC);
+// COLORREF ref = GetTextColor(hDestDC);
// SolidBrush blackBrush(Color(255, GetRValue(ref),GetGValue(ref),GetBValue(ref)));
// g.SetInterpolationMode(InterpolationModeHighQualityBicubic);
// g.DrawString(string,nCount,&myFont,origin, &blackBrush);
// //g.SetCompositingMode(CompositingModeSourceCopy);
// //s.SetCompositingMode(CompositingModeSourceCopy);
// free(string);
-// //HDC temp=g.GetHDC();
+// //HDC temp = g.GetHDC();
// //BitBlt(hDestDC,x,y,100,100,temp,0,0,SRCCOPY);
// //g.ReleaseHDC(temp);
// s.DrawImage(b,origin2);
@@ -122,18 +122,18 @@ void DrawAvatarImageWithGDIp(HDC hDestDC,int x, int y, DWORD width, DWORD height {
BITMAP bmp;
Bitmap *bm;
- BYTE * bmbits=NULL;
+ BYTE * bmbits = NULL;
GetObject(hbmp,sizeof(BITMAP),&bmp);
Graphics g(hDestDC);
- if (bmp.bmBitsPixel==32 && (flag&AVS_PREMULTIPLIED))
+ if (bmp.bmBitsPixel == 32 && (flag&AVS_PREMULTIPLIED))
{
- bmbits=(BYTE*)bmp.bmBits;
+ bmbits = (BYTE*)bmp.bmBits;
if (!bmbits)
{
- bmbits=(BYTE*)malloc(bmp.bmHeight*bmp.bmWidthBytes);
+ 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 = new Bitmap(bmp.bmWidth,bmp.bmHeight,bmp.bmWidthBytes,PixelFormat32bppPARGB,bmbits);
bm->RotateFlip(RotateNoneFlipY);
if (!bmp.bmBits)
{
@@ -142,10 +142,10 @@ void DrawAvatarImageWithGDIp(HDC hDestDC,int x, int y, DWORD width, DWORD height }
}
else
- bm=new Bitmap(hbmp,NULL);
+ bm = new Bitmap(hbmp,NULL);
ImageAttributes attr;
- ColorMatrix ClrMatrix =
+ ColorMatrix ClrMatrix =
{
1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
@@ -163,18 +163,18 @@ BOOL GDIPlus_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidth {
Graphics g(hdcDest);
BITMAP bmp;
- HBITMAP hbmp=(HBITMAP)GetCurrentObject(hdcSrc,OBJ_BITMAP);
+ HBITMAP hbmp = (HBITMAP)GetCurrentObject(hdcSrc,OBJ_BITMAP);
GetObject(hbmp,sizeof(BITMAP),&bmp);
- Bitmap *bm=new Bitmap(hbmp,NULL);
- if (bmp.bmBitsPixel==32 && bf->AlphaFormat)
+ Bitmap *bm = new Bitmap(hbmp,NULL);
+ if (bmp.bmBitsPixel == 32 && bf->AlphaFormat)
{
- bm= new Bitmap(bmp.bmWidth,bmp.bmHeight,bmp.bmWidthBytes,PixelFormat32bppPARGB,(BYTE*)bmp.bmBits);
+ bm = new Bitmap(bmp.bmWidth,bmp.bmHeight,bmp.bmWidthBytes,PixelFormat32bppPARGB,(BYTE*)bmp.bmBits);
bm->RotateFlip(RotateNoneFlipY);
}
else
- bm=new Bitmap(hbmp,NULL);
+ bm = new Bitmap(hbmp,NULL);
ImageAttributes attr;
- ColorMatrix ClrMatrix =
+ ColorMatrix ClrMatrix =
{
1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
@@ -184,7 +184,7 @@ BOOL GDIPlus_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidth };
attr.SetColorMatrix(&ClrMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
- if (bf->BlendFlags&128 && nWidthDest<nWidthSrc && nHeightDest<nHeightSrc)
+ if (bf->BlendFlags&128 && nWidthDest < nWidthSrc && nHeightDest < nHeightSrc)
{
g.SetInterpolationMode(InterpolationModeHighQualityBicubic);
g.SetPixelOffsetMode(PixelOffsetModeHalf);
@@ -211,9 +211,9 @@ COLORREF __inline _revcolref(COLORREF colref) // based on routine from http://www.codeproject.com/vcpp/gdiplus/imageexgdi.asp
//
-BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName)
+BOOL GDIPlus_IsAnimatedGif (TCHAR * szName)
{
- int nFrameCount=0;
+ int nFrameCount = 0;
Image image(szName);
UINT count = 0;
@@ -231,9 +231,9 @@ BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName) return (BOOL) (nFrameCount > 1);
}
-void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * pBitmap, int ** pframesDelay, int * pframesCount, SIZE * pSizeAvatar)
+void GDIPlus_ExtractAnimatedGif (TCHAR * szName, int width, int height, HBITMAP * pBitmap, int ** pframesDelay, int * pframesCount, SIZE * pSizeAvatar)
{
- int nFrameCount=0;
+ int nFrameCount = 0;
Bitmap image(szName);
PropertyItem * pPropertyItem;
@@ -259,23 +259,23 @@ void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * int clipWidth;
int clipHeight;
- int imWidth=image.GetWidth();
- int imHeight=image.GetHeight();
- float xscale=(float)width/imWidth;
- float yscale=(float)height/imHeight;
- xscale=min(xscale,yscale);
- clipWidth=(int)(xscale*imWidth+.5);
- clipHeight=(int)(xscale*imHeight+.5);
-
- HBITMAP hBitmap=ske_CreateDIB32(clipWidth*nFrameCount, height);
- HDC hdc=CreateCompatibleDC(NULL);
- HBITMAP oldBmp=(HBITMAP)SelectObject(hdc,hBitmap);
+ int imWidth = image.GetWidth();
+ int imHeight = image.GetHeight();
+ float xscale = (float)width/imWidth;
+ float yscale = (float)height/imHeight;
+ xscale = min(xscale,yscale);
+ clipWidth = (int)(xscale*imWidth+.5);
+ clipHeight = (int)(xscale*imHeight+.5);
+
+ HBITMAP hBitmap = ske_CreateDIB32(clipWidth*nFrameCount, height);
+ HDC hdc = CreateCompatibleDC(NULL);
+ HBITMAP oldBmp = (HBITMAP)SelectObject(hdc,hBitmap);
Graphics graphics(hdc);
ImageAttributes attr;
graphics.SetInterpolationMode( InterpolationModeHighQualityBicubic );
graphics.SetPixelOffsetMode( PixelOffsetModeHalf );
- int * delays=(int*)malloc(nFrameCount*sizeof(int));
+ int * delays = (int*)malloc(nFrameCount*sizeof(int));
memset(delays,0,nFrameCount*sizeof(int));
GUID pageGuid = FrameDimensionTime;
@@ -285,12 +285,12 @@ void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * if ( nFrameCount > 1 )
image.SelectActiveFrame(&pageGuid, 1 );
- for (int i=0; i<nFrameCount; i++)
+ for (int i = 0; i < nFrameCount; i++)
{
image.SelectActiveFrame( &pageGuid, i );
graphics.DrawImage( &image, Rect(i*clipWidth, 0,clipWidth,clipHeight ), 0, 0, imWidth, imHeight , UnitPixel, &attr);
long lPause = ((long*) pPropertyItem->value)[i] * 10;
- delays[i]=(int)lPause;
+ delays[i] = (int)lPause;
}
SelectObject(hdc,oldBmp);
DeleteDC(hdc);
@@ -298,11 +298,11 @@ void GDIPlus_ExtractAnimatedGIF(TCHAR * szName, int width, int height, HBITMAP * delete[] pDimensionIDs;
if (pBitmap && pframesDelay && pframesCount && pSizeAvatar)
{
- *pBitmap=hBitmap;
- *pframesDelay=delays;
- *pframesCount=nFrameCount;
- pSizeAvatar->cx=clipWidth;
- pSizeAvatar->cy=clipHeight;
+ *pBitmap = hBitmap;
+ *pframesDelay = delays;
+ *pframesCount = nFrameCount;
+ pSizeAvatar->cx = clipWidth;
+ pSizeAvatar->cy = clipHeight;
}
GdiFlush();
}
\ No newline at end of file diff --git a/plugins/Clist_modern/modern_gettextasync.cpp b/plugins/Clist_modern/modern_gettextasync.cpp index c7dea9a18e..c25e274cf7 100644 --- a/plugins/Clist_modern/modern_gettextasync.cpp +++ b/plugins/Clist_modern/modern_gettextasync.cpp @@ -47,10 +47,10 @@ typedef struct _GetTextAsyncItem { struct _GetTextAsyncItem *Next;
} GTACHAINITEM;
-static GTACHAINITEM * gtaFirstItem=NULL;
-static GTACHAINITEM * gtaLastItem=NULL;
+static GTACHAINITEM * gtaFirstItem = NULL;
+static GTACHAINITEM * gtaLastItem = NULL;
static CRITICAL_SECTION gtaCS;
-static HANDLE hgtaWakeupEvent=NULL;
+static HANDLE hgtaWakeupEvent = NULL;
static BOOL gtaGetItem(GTACHAINITEM * mpChain)
@@ -64,10 +64,10 @@ static BOOL gtaGetItem(GTACHAINITEM * mpChain) else if (mpChain)
{
GTACHAINITEM * ch;
- ch=gtaFirstItem;
- *mpChain=*ch;
- gtaFirstItem=(GTACHAINITEM *)ch->Next;
- if (!gtaFirstItem) gtaLastItem=NULL;
+ ch = gtaFirstItem;
+ *mpChain = *ch;
+ gtaFirstItem = (GTACHAINITEM *)ch->Next;
+ if (!gtaFirstItem) gtaLastItem = NULL;
free(ch);
gtaunlock;
return TRUE;
@@ -78,9 +78,9 @@ static BOOL gtaGetItem(GTACHAINITEM * mpChain) static int gtaThreadProc(void * lpParam)
{
- BOOL exit=FALSE;
- HWND hwnd=pcli->hwndContactList;
- struct SHORTDATA data={0};
+ BOOL exit = FALSE;
+ HWND hwnd = pcli->hwndContactList;
+ struct SHORTDATA data = {0};
struct SHORTDATA * dat;
while (!MirandaExiting())
@@ -92,25 +92,25 @@ static int gtaThreadProc(void * lpParam) SleepEx(0,TRUE); //1000 contacts per second
if (MirandaExiting())
{
- g_dwGetTextAsyncThreadID=0;
+ g_dwGetTextAsyncThreadID = 0;
return 0;
}
else
{
- GTACHAINITEM mpChain={0};
- struct SHORTDATA dat2={0};
+ GTACHAINITEM mpChain = {0};
+ struct SHORTDATA dat2 = {0};
if (!gtaGetItem(&mpChain)) break;
- if (mpChain.dat==NULL || (!IsBadReadPtr(mpChain.dat,sizeof(mpChain.dat)) && mpChain.dat->hWnd==data.hWnd)) dat=&data;
+ 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;
+ dat = &dat2;
}
if (!MirandaExiting())
{
displayNameCacheEntry cacheEntry;
memset( &cacheEntry, 0, sizeof(cacheEntry));
- cacheEntry.m_cache_hContact=mpChain.hContact;
+ cacheEntry.m_cache_hContact = mpChain.hContact;
if (!Sync(CLUI_SyncGetPDNCE, (WPARAM) 0,(LPARAM)&cacheEntry))
{
if (!MirandaExiting())
@@ -124,7 +124,7 @@ static int gtaThreadProc(void * lpParam) }
else
{
- g_dwGetTextAsyncThreadID=0;
+ g_dwGetTextAsyncThreadID = 0;
return 0;
}
KillTimer(dat->hWnd,TIMERID_INVALIDATE_FULL);
@@ -136,7 +136,7 @@ static int gtaThreadProc(void * lpParam) WaitForSingleObjectEx(hgtaWakeupEvent, INFINITE, FALSE );
ResetEvent(hgtaWakeupEvent);
}
- g_dwGetTextAsyncThreadID=0;
+ g_dwGetTextAsyncThreadID = 0;
return 1;
}
@@ -157,19 +157,19 @@ int gtaAddRequest(struct ClcData *dat,struct ClcContact *contact,HANDLE hContact if (MirandaExiting()) return 0;
gtalock;
{
- GTACHAINITEM * mpChain=(GTACHAINITEM *)malloc(sizeof(GTACHAINITEM));
- mpChain->hContact=hContact;
- mpChain->dat=dat;
- mpChain->Next=NULL;
+ GTACHAINITEM * mpChain = (GTACHAINITEM *)malloc(sizeof(GTACHAINITEM));
+ mpChain->hContact = hContact;
+ mpChain->dat = dat;
+ mpChain->Next = NULL;
if (gtaLastItem)
{
- gtaLastItem->Next=(GTACHAINITEM *)mpChain;
- gtaLastItem=mpChain;
+ gtaLastItem->Next = (GTACHAINITEM *)mpChain;
+ gtaLastItem = mpChain;
}
else
{
- gtaFirstItem=mpChain;
- gtaLastItem=mpChain;
+ gtaFirstItem = mpChain;
+ gtaLastItem = mpChain;
SetEvent(hgtaWakeupEvent);
}
}
@@ -188,8 +188,8 @@ int gtaOnModulesUnload(WPARAM wParam,LPARAM lParam) void InitCacheAsync()
{
InitializeCriticalSection(>aCS);
- hgtaWakeupEvent=CreateEvent(NULL,FALSE,FALSE,NULL);
- g_dwGetTextAsyncThreadID=(DWORD)mir_forkthread((pThreadFunc)gtaThreadProc,0);
+ hgtaWakeupEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
+ g_dwGetTextAsyncThreadID = (DWORD)mir_forkthread((pThreadFunc)gtaThreadProc,0);
ModernHookEvent(ME_SYSTEM_PRESHUTDOWN, gtaOnModulesUnload);
}
diff --git a/plugins/Clist_modern/modern_global.cpp b/plugins/Clist_modern/modern_global.cpp index b43dc5f163..269abb136e 100644 --- a/plugins/Clist_modern/modern_global.cpp +++ b/plugins/Clist_modern/modern_global.cpp @@ -30,6 +30,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //int hClcProtoCount = 0;
//ClcProtoStatus *clcProto = NULL;
-HIMAGELIST g_himlCListClc=NULL;
+HIMAGELIST g_himlCListClc = NULL;
HICON g_hListeningToIcon = NULL;
char* g_szMetaModuleName = 0;
diff --git a/plugins/Clist_modern/modern_groupmenu.cpp b/plugins/Clist_modern/modern_groupmenu.cpp index a19615c861..a481d4e426 100644 --- a/plugins/Clist_modern/modern_groupmenu.cpp +++ b/plugins/Clist_modern/modern_groupmenu.cpp @@ -50,7 +50,7 @@ int Param1,Param2; }GroupMenuExecParam,*lpGroupMenuExecParam;
/*
-wparam=handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
+wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
return 0 on success.
*/
static INT_PTR RemoveGroupMenuItem(WPARAM wParam,LPARAM lParam)
@@ -63,18 +63,18 @@ static INT_PTR RemoveGroupMenuItem(WPARAM wParam,LPARAM lParam) INT_PTR BuildGroupMenu(WPARAM wParam,LPARAM lParam)
{
ListParam param = { 0 };
- param.MenuObjectHandle=hGroupMenuObject;
+ param.MenuObjectHandle = hGroupMenuObject;
- //hMenu=hMainMenu;
- HMENU hMenu=CreatePopupMenu();
- //hMenu=wParam;
- int tick=GetTickCount();
+ //hMenu = hMainMenu;
+ HMENU hMenu = CreatePopupMenu();
+ //hMenu = wParam;
+ int tick = GetTickCount();
NotifyEventHooks(g_CluiData.hEventPreBuildGroupMenu,0,0);
CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m);
//DrawMenuBar((HWND)CallService("CLUI/GetHwnd",0,0));
- tick=GetTickCount()-tick;
+ tick = GetTickCount()-tick;
return (INT_PTR)hMenu;
}
@@ -93,11 +93,11 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam,LPARAM lParam) mmep->szServiceName = mir_strdup(mi->pszService);
mmep->Param1 = mi->popupPosition;
lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
- if (gmp != NULL) {
+ if (gmp !=NULL) {
mmep->Param1 = gmp->wParam;
mmep->Param2 = gmp->lParam;
}
- tmi.ownerdata=mmep;
+ tmi.ownerdata = mmep;
char buf[1024];
sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
@@ -117,27 +117,27 @@ int GroupMenuCheckService(WPARAM wParam,LPARAM lParam) { INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam) {
- MENUITEMINFO *mii=(MENUITEMINFO* )wParam;
- if (mii==NULL) return 0;
+ MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ if (mii == NULL) return 0;
- if (hHideShowMainMenuItem==(HANDLE)lParam)
+ if (hHideShowMainMenuItem == (HANDLE)lParam)
{
- mii->fMask|=MIIM_STATE;
- mii->fState|=MFS_DEFAULT;
+ mii->fMask |= MIIM_STATE;
+ mii->fState |= MFS_DEFAULT;
}
- if (hGroupMainMenuItemProxy==(HANDLE)lParam)
+ if (hGroupMainMenuItemProxy == (HANDLE)lParam)
{
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
}
- if (hGroupStatusMenuItemProxy==(HANDLE)lParam)
+ if (hGroupStatusMenuItemProxy == (HANDLE)lParam)
{
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
}
return(TRUE);
@@ -148,13 +148,13 @@ INT_PTR GroupMenuonAddService(WPARAM wParam,LPARAM lParam) { //wparam - ownerdata
//lparam - lparam from winproc
INT_PTR GroupMenuExecService(WPARAM wParam,LPARAM lParam) {
- if (wParam!=0)
+ if (wParam != 0)
{
- lpGroupMenuExecParam mmep=(lpGroupMenuExecParam)wParam;
+ lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
- mmep->Param1=0;
+ mmep->Param1 = 0;
CallService(mmep->szServiceName,mmep->Param1,lParam);
}else
{
@@ -168,8 +168,8 @@ INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam,LPARAM lParam) {
lpGroupMenuExecParam mmep;
- mmep=(lpGroupMenuExecParam)lParam;
- if (mmep!=NULL){
+ mmep = (lpGroupMenuExecParam)lParam;
+ if (mmep != NULL){
FreeAndNil((void **)&mmep->szServiceName);
FreeAndNil((void **)&mmep);
}
@@ -179,7 +179,7 @@ return(0); INT_PTR HideGroupsHelper(WPARAM wParam,LPARAM lParam)
{
- int newVal=!(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
db_set_b(NULL,"CList","HideEmptyGroups",(BYTE)newVal);
SendMessage(pcli->hwndContactTree,CLM_SETHIDEEMPTYGROUPS,newVal,0);
return 0;
@@ -187,7 +187,7 @@ INT_PTR HideGroupsHelper(WPARAM wParam,LPARAM lParam) INT_PTR UseGroupsHelper(WPARAM wParam,LPARAM lParam)
{
- int newVal=!(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS);
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS);
db_set_b(NULL,"CList","UseGroups",(BYTE)newVal);
SendMessage(pcli->hwndContactTree,CLM_SETUSEGROUPS,newVal,0);
return 0;
@@ -243,15 +243,15 @@ static int OnBuildGroupMenu(WPARAM wParam,LPARAM lParam) int static OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
{
HICON hicon;
- CLISTMENUITEM clmi={0};
+ CLISTMENUITEM clmi = {0};
BOOL needFree;
if (MirandaExiting()) return 0;
- hicon=CLUI_LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,&needFree);
- NewGroupIconidx=ImageList_ReplaceIcon(hCListImages,NewGroupIconidx,hicon);
+ hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",2,TRUE,FALSE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,&needFree);
+ NewGroupIconidx = ImageList_ReplaceIcon(hCListImages,NewGroupIconidx,hicon);
if (needFree) DestroyIcon_protect(hicon);
- clmi.cbSize=sizeof(clmi);
- clmi.flags=CMIM_ICON;
- clmi.hIcon=ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ clmi.cbSize = sizeof(clmi);
+ clmi.flags = CMIM_ICON;
+ clmi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewSubGroupMenuItem,(LPARAM)&clmi);
CallService(MS_CLIST_MODIFYMENUITEM,(WPARAM)hNewGroupMenuItem,(LPARAM)&clmi);
//
@@ -266,8 +266,8 @@ void GroupMenus_Init(void) OptParam op;
HICON hicon;
BOOL needFree;
- hicon=CLUI_LoadIconFromExternalFile("clisticons.dll",2,TRUE,TRUE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,&needFree);
- NewGroupIconidx=hicon?ImageList_AddIcon(hCListImages,hicon ):-1;
+ hicon = CLUI_LoadIconFromExternalFile("clisticons.dll",2,TRUE,TRUE,"NewGroup","Contact List","New Group",-IDI_NEWGROUP2,&needFree);
+ NewGroupIconidx = hicon?ImageList_AddIcon(hCListImages,hicon ):-1;
if (needFree) DestroyIcon_protect(hicon);
CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu",FreeOwnerDataGroupMenu);
@@ -287,26 +287,26 @@ void GroupMenus_Init(void) //Group menu
memset(&tmp,0,sizeof(tmp));
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService=NULL;
- tmp.ExecService="CLISTMENUSGroup/ExecService";
- tmp.name=LPGEN("GroupMenu");
- hGroupMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
+ tmp.cbSize = sizeof(tmp);
+ tmp.CheckService = NULL;
+ tmp.ExecService = "CLISTMENUSGroup/ExecService";
+ tmp.name = LPGEN("GroupMenu");
+ hGroupMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
- op.Handle=hGroupMenuObject;
- op.Setting=OPT_USERDEFINEDITEMS;
- op.Value=TRUE;
+ op.Handle = hGroupMenuObject;
+ op.Setting = OPT_USERDEFINEDITEMS;
+ op.Value = TRUE;
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- op.Handle=hGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSGroup/FreeOwnerDataGroupMenu";
+ op.Handle = hGroupMenuObject;
+ op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
+ op.Value = (INT_PTR)"CLISTMENUSGroup/FreeOwnerDataGroupMenu";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- op.Handle=hGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSGroup/GroupMenuonAddService";
+ op.Handle = hGroupMenuObject;
+ op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
+ op.Value = (INT_PTR)"CLISTMENUSGroup/GroupMenuonAddService";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
{
@@ -315,120 +315,120 @@ void GroupMenus_Init(void) GroupMenuParam gmp;
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=1900000;
- mi.pszService="CloseAction";
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_EXIT);
- mi.pszName=LPGEN("E&xit");
- mi.flags=CMIF_ICONFROMICOLIB;
+ mi.cbSize = sizeof(mi);
+ mi.position = 1900000;
+ mi.pszService = "CloseAction";
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_EXIT);
+ mi.pszName = LPGEN("E&xit");
+ mi.flags = CMIF_ICONFROMICOLIB;
AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=500;
- mi.pszService=MS_CLIST_SHOWHIDE;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
- mi.pszName=LPGEN("&Hide/Show");
- mi.flags=CMIF_ICONFROMICOLIB;
- hHideShowMainMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 500;
+ mi.pszService = MS_CLIST_SHOWHIDE;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_SHOWHIDE);
+ mi.pszName = LPGEN("&Hide/Show");
+ mi.flags = CMIF_ICONFROMICOLIB;
+ hHideShowMainMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=200000;
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
- mi.pszService="FindAdd/FindAddCommand";
- mi.pszName=LPGEN("&Find/Add Contacts...");
+ mi.cbSize = sizeof(mi);
+ mi.position = 200000;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_FINDUSER);
+ mi.pszService = "FindAdd/FindAddCommand";
+ mi.pszName = LPGEN("&Find/Add Contacts...");
AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=300000;
- mi.pszService="";
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
- mi.pszName=LPGEN("&Main Menu");
- mi.flags=CMIF_ICONFROMICOLIB; // eternity #004
- hGroupMainMenuItemProxy=(HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 300000;
+ mi.pszService = "";
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MAINMENU); // eternity #004
+ mi.pszName = LPGEN("&Main Menu");
+ mi.flags = CMIF_ICONFROMICOLIB; // eternity #004
+ hGroupMainMenuItemProxy = (HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon); // eternity #004
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=300100;
- mi.pszService="";
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
- mi.pszName=LPGEN("&Status");
- mi.flags=CMIF_ICONFROMICOLIB; // eternity #004
- hGroupStatusMenuItemProxy=(HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 300100;
+ mi.pszService = "";
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_STATUS); // eternity #004
+ mi.pszName = LPGEN("&Status");
+ mi.flags = CMIF_ICONFROMICOLIB; // eternity #004
+ hGroupStatusMenuItemProxy = (HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon); // eternity #004
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=400000;
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
- mi.pszService="Options/OptionsCommand";
- mi.pszName=LPGEN("&Options...");
+ mi.cbSize = sizeof(mi);
+ mi.position = 400000;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_OPTIONS);
+ mi.pszService = "Options/OptionsCommand";
+ mi.pszName = LPGEN("&Options...");
AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=500000;
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
- mi.pszService="Help/AboutCommand";
- mi.pszName=LPGEN("&About");
+ mi.cbSize = sizeof(mi);
+ mi.position = 500000;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_MIRANDA);
+ mi.pszService = "Help/AboutCommand";
+ mi.pszName = LPGEN("&About");
AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100000;
- mi.hIcon=ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- mi.pszService="CLISTMENUSGroup/CreateGroupHelper";
- mi.pszName=LPGEN("&New Group");
- hNewGroupMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 100000;
+ mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ mi.pszService = "CLISTMENUSGroup/CreateGroupHelper";
+ mi.pszName = LPGEN("&New Group");
+ hNewGroupMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100001;
- mi.hIcon=NULL;
- mi.pszService=MS_CLIST_SETHIDEOFFLINE;
- mi.pszName=LPGEN("&Hide Offline Users");
- gmp.lParam=0;gmp.wParam=-1;
- hHideOfflineUsersMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 100001;
+ mi.hIcon = NULL;
+ mi.pszService = MS_CLIST_SETHIDEOFFLINE;
+ mi.pszName = LPGEN("&Hide Offline Users");
+ gmp.lParam = 0;gmp.wParam = -1;
+ hHideOfflineUsersMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100002;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSGroup/HideOfflineRootHelper";
- mi.pszName=LPGEN("Hide &Offline Users out here");
- hHideOfflineUsersOutHereMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 100002;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSGroup/HideOfflineRootHelper";
+ mi.pszName = LPGEN("Hide &Offline Users out here");
+ hHideOfflineUsersOutHereMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100003;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSGroup/HideGroupsHelper";
- mi.pszName=LPGEN("Hide &Empty Groups");
- hHideEmptyGroupsMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 100003;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSGroup/HideGroupsHelper";
+ mi.pszName = LPGEN("Hide &Empty Groups");
+ hHideEmptyGroupsMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=100004;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSGroup/UseGroupsHelper";
- mi.pszName=LPGEN("Disable &Groups");
- hDisableGroupsMenuItem=(HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 100004;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSGroup/UseGroupsHelper";
+ mi.pszName = LPGEN("Disable &Groups");
+ hDisableGroupsMenuItem = (HANDLE)AddGroupMenuItem((WPARAM)0,(LPARAM)&mi);
ModernHookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
@@ -458,7 +458,7 @@ int Param1,Param2; }SubGroupMenuExecParam,*lpSubGroupMenuExecParam;
/*
-wparam=handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
+wparam = handle to the menu item returned by MS_CLIST_ADDCONTACTMENUITEM
return 0 on success.
*/
static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
@@ -471,24 +471,24 @@ static INT_PTR RemoveSubGroupMenuItem(WPARAM wParam,LPARAM lParam) static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
CLISTMENUITEM mi;
- BOOL gray1=FALSE;
- BOOL gray2=FALSE;
- BOOL showOfflineinGroup=FALSE;
+ BOOL gray1 = FALSE;
+ BOOL gray2 = FALSE;
+ BOOL showOfflineinGroup = FALSE;
- struct ClcGroup *group=(struct ClcGroup *)wParam;
- if (wParam==0) return 0;
+ struct ClcGroup *group = (struct ClcGroup *)wParam;
+ if (wParam == 0) return 0;
if (MirandaExiting()) return 0;
//contact->group
ZeroMemory(&mi,sizeof(mi));
mi.cbSize = sizeof(mi);
- showOfflineinGroup=CLCItems_IsShowOfflineGroup(group);
- gray1=(showOfflineinGroup!=FALSE);
- gray2=(group->hideOffline!=FALSE);
+ showOfflineinGroup = CLCItems_IsShowOfflineGroup(group);
+ gray1 = (showOfflineinGroup != FALSE);
+ gray2 = (group->hideOffline != FALSE);
- if (gray1&&gray2) gray1=FALSE; //should not be cause CLCItems_IsShowOfflineGroup return false if group->hideOffline
+ if (gray1&&gray2) gray1 = FALSE; //should not be cause CLCItems_IsShowOfflineGroup return false if group->hideOffline
mi.flags = CMIM_FLAGS | ((group->hideOffline&&!gray1)?CMIF_CHECKED:0)| (gray1?CMIF_GRAYED:0);
CallService(MS_CLIST_MODIFYMENUITEM, (WPARAM)hHideOfflineUsersHereMenuItem, (LPARAM)&mi);
@@ -501,26 +501,26 @@ static int OnBuildSubGroupMenu(WPARAM wParam,LPARAM lParam) INT_PTR BuildSubGroupMenu(WPARAM wParam,LPARAM lParam)
{
ListParam param = { 0 };
- param.MenuObjectHandle=hSubGroupMenuObject;
- param.wParam=wParam;
- param.lParam=lParam;
+ param.MenuObjectHandle = hSubGroupMenuObject;
+ param.wParam = wParam;
+ param.lParam = lParam;
- //hMenu=hMainMenu;
- HMENU hMenu=CreatePopupMenu();
- //hMenu=wParam;
- int tick=GetTickCount();
+ //hMenu = hMainMenu;
+ HMENU hMenu = CreatePopupMenu();
+ //hMenu = wParam;
+ int tick = GetTickCount();
NotifyEventHooks(g_CluiData.hEventPreBuildSubGroupMenu,wParam,0);
CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)¶m);
//DrawMenuBar((HWND)CallService("CLUI/GetHwnd",0,0));
- tick=GetTickCount()-tick;
+ tick = GetTickCount()-tick;
return (INT_PTR)hMenu;
}
HMENU cliBuildGroupPopupMenu(struct ClcGroup *group)
{
- //HWND wnd=GetForegroundWindow();
+ //HWND wnd = GetForegroundWindow();
return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP,(WPARAM)group,0);
}
static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam)
@@ -537,20 +537,20 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam,LPARAM lParam) //we need just one parametr.
mmep->szServiceName = mir_strdup(mi->pszService);
mmep->Param1 = mi->popupPosition;
- lpGroupMenuParam gmp=(lpGroupMenuParam)wParam;
- if (gmp != NULL) {
+ lpGroupMenuParam gmp = (lpGroupMenuParam)wParam;
+ if (gmp !=NULL) {
mmep->Param1 = gmp->wParam;
mmep->Param2 = gmp->lParam;
}
- tmi.ownerdata=mmep;
+ tmi.ownerdata = mmep;
char buf[1024];
sprintf(buf,"%s/%s",mi->pszService,mi->pszName);
OptParam op;
- op.Handle=(HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hSubGroupMenuObject,(LPARAM)&tmi);
- op.Setting=OPT_MENUITEMSETUNIQNAME;
- op.Value=(INT_PTR)buf;
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hSubGroupMenuObject,(LPARAM)&tmi);
+ op.Setting = OPT_MENUITEMSETUNIQNAME;
+ op.Value = (INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM,(WPARAM)0,(LPARAM)&op);
return (INT_PTR)op.Handle;
}
@@ -559,14 +559,14 @@ INT_PTR SubGroupMenuCheckService(WPARAM wParam,LPARAM lParam) { //not used
//TODO ADD
lpSubGroupMenuExecParam mmep;
- TCheckProcParam * CParam=(TCheckProcParam*)wParam;
+ TCheckProcParam * CParam = (TCheckProcParam*)wParam;
if (CParam)
{
- mmep=(lpSubGroupMenuExecParam)(CParam->MenuItemOwnerData);
+ mmep = (lpSubGroupMenuExecParam)(CParam->MenuItemOwnerData);
if (mmep)
{
- mmep->Param2=CParam->lParam;
+ mmep->Param2 = CParam->lParam;
}
}
@@ -575,29 +575,29 @@ INT_PTR SubGroupMenuCheckService(WPARAM wParam,LPARAM lParam) { INT_PTR SubGroupMenuonAddService(WPARAM wParam,LPARAM lParam) {
- MENUITEMINFO *mii=(MENUITEMINFO* )wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
- if (mii==NULL) return 0;
+ if (mii == NULL) return 0;
/*
- if (hHideShowMainMenuItem==(HANDLE)lParam)
+ if (hHideShowMainMenuItem == (HANDLE)lParam)
{
- mii->fMask|=MIIM_STATE;
- mii->fState|=MFS_DEFAULT;
+ mii->fMask |= MIIM_STATE;
+ mii->fState |= MFS_DEFAULT;
}
- if (hSubGroupMainMenuItemProxy==(HANDLE)lParam)
+ if (hSubGroupMainMenuItemProxy == (HANDLE)lParam)
{
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
}
- if (hSubGroupStatusMenuItemProxy==(HANDLE)lParam)
+ if (hSubGroupStatusMenuItemProxy == (HANDLE)lParam)
{
- mii->fMask|=MIIM_SUBMENU;
- //mi.fType=MFT_STRING;
- mii->hSubMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ mii->fMask |= MIIM_SUBMENU;
+ //mi.fType = MFT_STRING;
+ mii->hSubMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
}
*/
return(TRUE);
@@ -608,13 +608,13 @@ INT_PTR SubGroupMenuonAddService(WPARAM wParam,LPARAM lParam) { //wparam - ownerdata
//lparam - lparam from winproc
INT_PTR SubGroupMenuExecService(WPARAM wParam,LPARAM lParam) {
- if (wParam!=0)
+ if (wParam != 0)
{
- lpSubGroupMenuExecParam mmep=(lpSubGroupMenuExecParam)wParam;
+ lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)wParam;
if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand"))
{
//bug in help.c,it used wparam as parent window handle without reason.
- mmep->Param1=0;
+ mmep->Param1 = 0;
CallService(mmep->szServiceName,mmep->Param1,lParam);
}else
{
@@ -628,8 +628,8 @@ INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam,LPARAM lParam) {
lpSubGroupMenuExecParam mmep;
- mmep=(lpSubGroupMenuExecParam)lParam;
- if (mmep!=NULL){
+ mmep = (lpSubGroupMenuExecParam)lParam;
+ if (mmep != NULL){
FreeAndNil((void **)&mmep->szServiceName);
FreeAndNil((void **)&mmep);
}
@@ -668,30 +668,30 @@ void InitSubGroupMenus(void) //SubGroup menu
memset(&tmp,0,sizeof(tmp));
- tmp.cbSize=sizeof(tmp);
- tmp.CheckService=NULL;
- tmp.ExecService="CLISTMENUSSubGroup/ExecService";
- tmp.name=LPGEN("SubGroupMenu");
- hSubGroupMenuObject=(HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
-
- op.Handle=hSubGroupMenuObject;
- op.Setting=OPT_USERDEFINEDITEMS;
- op.Value=TRUE;
+ tmp.cbSize = sizeof(tmp);
+ tmp.CheckService = NULL;
+ tmp.ExecService = "CLISTMENUSSubGroup/ExecService";
+ tmp.name = LPGEN("SubGroupMenu");
+ hSubGroupMenuObject = (HANDLE)CallService(MO_CREATENEWMENUOBJECT,(WPARAM)0,(LPARAM)&tmp);
+
+ op.Handle = hSubGroupMenuObject;
+ op.Setting = OPT_USERDEFINEDITEMS;
+ op.Value = TRUE;
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- op.Handle=hSubGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_FREE_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu";
+ op.Handle = hSubGroupMenuObject;
+ op.Setting = OPT_MENUOBJECT_SET_FREE_SERVICE;
+ op.Value = (INT_PTR)"CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- op.Handle=hSubGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_ONADD_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuonAddService";
+ op.Handle = hSubGroupMenuObject;
+ op.Setting = OPT_MENUOBJECT_SET_ONADD_SERVICE;
+ op.Value = (INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuonAddService";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
- op.Handle=hSubGroupMenuObject;
- op.Setting=OPT_MENUOBJECT_SET_CHECK_SERVICE;
- op.Value=(INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuCheckService";
+ op.Handle = hSubGroupMenuObject;
+ op.Setting = OPT_MENUOBJECT_SET_CHECK_SERVICE;
+ op.Value = (INT_PTR)"CLISTMENUSSubGroup/SubGroupMenuCheckService";
CallService(MO_SETOPTIONSMENUOBJECT,(WPARAM)0,(LPARAM)&op);
//add exit command to menu
@@ -699,54 +699,54 @@ void InitSubGroupMenus(void) GroupMenuParam gmp;
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=1000;
- mi.hIcon=ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&New SubGroup");
- gmp.lParam=0;gmp.wParam=POPUP_NEWSUBGROUP;
- hNewSubGroupMenuItem=(HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 1000;
+ mi.hIcon = ske_ImageList_GetIcon(hCListImages,NewGroupIconidx,0);
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&New SubGroup");
+ gmp.lParam = 0;gmp.wParam = POPUP_NEWSUBGROUP;
+ hNewSubGroupMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=1001;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&Hide Offline Users in here");
- gmp.lParam=0;
- gmp.wParam=POPUP_GROUPHIDEOFFLINE;
- hHideOfflineUsersHereMenuItem=(HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 1001;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&Hide Offline Users in here");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_GROUPHIDEOFFLINE;
+ hHideOfflineUsersHereMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=1002;
- mi.hIcon=NULL;
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&Show Offline Users in here");
- gmp.lParam=0;
- gmp.wParam=POPUP_GROUPSHOWOFFLINE;
- hShowOfflineUsersHereMenuItem=(HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
+ mi.cbSize = sizeof(mi);
+ mi.position = 1002;
+ mi.hIcon = NULL;
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&Show Offline Users in here");
+ gmp.lParam = 0;
+ gmp.wParam = POPUP_GROUPSHOWOFFLINE;
+ hShowOfflineUsersHereMenuItem = (HANDLE)AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=900001;
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_RENAME);
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&Rename Group");
- gmp.lParam=0;gmp.wParam=POPUP_RENAMEGROUP;
+ mi.cbSize = sizeof(mi);
+ mi.position = 900001;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_RENAME);
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&Rename Group");
+ gmp.lParam = 0;gmp.wParam = POPUP_RENAMEGROUP;
AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
memset(&mi,0,sizeof(mi));
- mi.cbSize=sizeof(mi);
- mi.position=900002;
- mi.flags=CMIF_ICONFROMICOLIB;
- mi.icolibItem=LoadSkinnedIconHandle(SKINICON_OTHER_DELETE);
- mi.pszService="CLISTMENUSSubGroup/GroupMenuExecProxy";
- mi.pszName=LPGEN("&Delete Group");
- gmp.lParam=0;gmp.wParam=POPUP_DELETEGROUP;
+ mi.cbSize = sizeof(mi);
+ mi.position = 900002;
+ mi.flags = CMIF_ICONFROMICOLIB;
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_OTHER_DELETE);
+ mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy";
+ mi.pszName = LPGEN("&Delete Group");
+ gmp.lParam = 0;gmp.wParam = POPUP_DELETEGROUP;
AddSubGroupMenuItem((WPARAM)&gmp,(LPARAM)&mi);
DestroyIcon_protect(mi.hIcon);
}
diff --git a/plugins/Clist_modern/modern_image_array.cpp b/plugins/Clist_modern/modern_image_array.cpp index 1c055e9357..0bd302c0a9 100644 --- a/plugins/Clist_modern/modern_image_array.cpp +++ b/plugins/Clist_modern/modern_image_array.cpp @@ -41,9 +41,9 @@ static BOOL ImageArray_Alloc(LP_IMAGE_ARRAY_DATA iad, int size) if (size_grow > iad->nodes_allocated_size)
{
- size_grow += iad->grow_step - (size_grow % iad->grow_step);
+ size_grow += iad->grow_step - (size_grow % iad->grow_step);
- if (iad->nodes != NULL)
+ if (iad->nodes !=NULL)
{
IMAGE_ARRAY_DATA_NODE *tmp = (IMAGE_ARRAY_DATA_NODE *) realloc((void *)iad->nodes,
sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
@@ -79,11 +79,11 @@ static BOOL ImageArray_Alloc(LP_IMAGE_ARRAY_DATA iad, int size) else if (size < iad->nodes_allocated_size)
{
// Give some more space to try to avoid a free
- if ( (iad->nodes_allocated_size - size) / iad->grow_step >= 2 )
+ if ( (iad->nodes_allocated_size - size) / iad->grow_step >= 2 )
{
IMAGE_ARRAY_DATA_NODE *tmp;
- size_grow += iad->grow_step - (size_grow % iad->grow_step);
+ size_grow += iad->grow_step - (size_grow % iad->grow_step);
tmp = (IMAGE_ARRAY_DATA_NODE *) realloc((void *)iad->nodes, sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
@@ -135,7 +135,7 @@ HBITMAP ImageArray_Free(LP_IMAGE_ARRAY_DATA iad, BOOL keep_bitmap) {
mod_DeleteDC(iad->hdc);
- if (iad->img != NULL && !keep_bitmap)
+ if (iad->img !=NULL && !keep_bitmap)
{
DeleteObject(iad->img);
iad->img = NULL;
@@ -143,7 +143,7 @@ HBITMAP ImageArray_Free(LP_IMAGE_ARRAY_DATA iad, BOOL keep_bitmap) iad->height = 0;
}
- if (iad->nodes != NULL)
+ if (iad->nodes !=NULL)
{
free(iad->nodes);
iad->nodes = NULL;
@@ -163,7 +163,7 @@ void ImageArray_Clear(LP_IMAGE_ARRAY_DATA iad) if (iad->hdc) mod_DeleteDC(iad->hdc);
iad->hdc = tmpdc;
- if (iad->img != NULL)
+ if (iad->img !=NULL)
{
DeleteObject(iad->img);
iad->img = NULL;
@@ -171,7 +171,7 @@ void ImageArray_Clear(LP_IMAGE_ARRAY_DATA iad) iad->height = 0;
}
- if (iad->nodes != NULL)
+ if (iad->nodes !=NULL)
{
free(iad->nodes);
iad->nodes = NULL;
@@ -202,7 +202,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) pos = iad->nodes_size;
// Add to end?
- if (pos >= iad->nodes_size)
+ if (pos >= iad->nodes_size)
{
pos = iad->nodes_size;
last_one = TRUE;
@@ -275,7 +275,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) h = 0;
for(i = 0; i < pos; i++)
{
- h += iad->nodes[i].height;
+ h += iad->nodes[i].height;
}
}
else
@@ -284,7 +284,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) w = 0;
for(i = 0; i < pos; i++)
{
- w += iad->nodes[i].width;
+ w += iad->nodes[i].width;
}
}
BitBlt(iad->hdc, 0, 0, w, h, hdc_old, 0, 0, SRCCOPY);
@@ -317,7 +317,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) oy = y;
x = 0;
- y += bm.bmHeight;
+ y += bm.bmHeight;
w = iad->width;
h = iad->height - h;
@@ -327,7 +327,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) ox = x;
oy = 0;
- x += bm.bmWidth;
+ x += bm.bmWidth;
y = 0;
w = iad->width - w;
@@ -340,7 +340,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) // restore things
SelectObject(hdc_old,old_bmp);
mod_DeleteDC(hdc_old);
- if (iad->img != NULL) DeleteObject(iad->img);
+ if (iad->img !=NULL) DeleteObject(iad->img);
iad->img = hNewBmp;
// Move array
@@ -377,7 +377,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) if (pos < 0)
return FALSE;
- if (pos >= iad->nodes_size)
+ if (pos >= iad->nodes_size)
return FALSE;
EnterCriticalSection(&iad->cs);
@@ -436,7 +436,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) h = 0;
for(i = 0; i < pos; i++)
{
- h += iad->nodes[i].height;
+ h += iad->nodes[i].height;
}
}
else
@@ -445,7 +445,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) w = 0;
for(i = 0; i < pos; i++)
{
- w += iad->nodes[i].width;
+ w += iad->nodes[i].width;
}
}
BitBlt(iad->hdc, 0, 0, w, h, hdc_old, 0, 0, SRCCOPY);
@@ -478,7 +478,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) oy = y + iad->nodes[pos].height;
x = 0;
- y += bm.bmHeight;
+ y += bm.bmHeight;
w = iad->width;
h = iad->height - h - iad->nodes[pos].height;
@@ -488,7 +488,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) ox = x + iad->nodes[pos].width;
oy = 0;
- x += bm.bmWidth;
+ x += bm.bmWidth;
y = 0;
w = iad->width - w - iad->nodes[pos].width;
@@ -500,7 +500,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos) // restore things
mod_DeleteDC(hdc_old);
- if (iad->img != NULL) DeleteObject(iad->img);
+ if (iad->img !=NULL) DeleteObject(iad->img);
iad->img = hNewBmp;
// Move array
@@ -528,7 +528,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos) if (pos < 0)
return FALSE;
- if (pos >= iad->nodes_size)
+ if (pos >= iad->nodes_size)
return FALSE;
EnterCriticalSection(&iad->cs);
@@ -580,7 +580,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos) h = 0;
for(i = 0; i < pos; i++)
{
- h += iad->nodes[i].height;
+ h += iad->nodes[i].height;
}
}
else
@@ -589,7 +589,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos) w = 0;
for(i = 0; i < pos; i++)
{
- w += iad->nodes[i].width;
+ w += iad->nodes[i].width;
}
}
BitBlt(iad->hdc, 0, 0, w, h, hdc_old, 0, 0, SRCCOPY);
@@ -629,7 +629,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos) // restore things
mod_DeleteDC(hdc_old);
- if (iad->img != NULL) DeleteObject(iad->img);
+ if (iad->img !=NULL) DeleteObject(iad->img);
iad->img = hNewBmp;
// Move array
@@ -656,7 +656,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos) BOOL ImageArray_DrawImage(LP_IMAGE_ARRAY_DATA iad, int pos, HDC hdcDest, int nXDest, int nYDest, BYTE Alpha)
{
- if (hdcDest == NULL || pos < 0 || pos >= iad->nodes_size)
+ if (hdcDest == NULL || pos < 0 || pos >= iad->nodes_size)
return FALSE;
EnterCriticalSection(&iad->cs);
@@ -669,7 +669,7 @@ BOOL ImageArray_DrawImage(LP_IMAGE_ARRAY_DATA iad, int pos, HDC hdcDest, int nXD h = 0;
for(i = 0; i < pos; i++)
{
- h += iad->nodes[i].height;
+ h += iad->nodes[i].height;
}
}
else
@@ -678,11 +678,11 @@ BOOL ImageArray_DrawImage(LP_IMAGE_ARRAY_DATA iad, int pos, HDC hdcDest, int nXD w = 0;
for(i = 0; i < pos; i++)
{
- w += iad->nodes[i].width;
+ w += iad->nodes[i].width;
}
}
{
- BLENDFUNCTION bf={AC_SRC_OVER, 0, Alpha, AC_SRC_ALPHA };
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0, Alpha, AC_SRC_ALPHA };
/*ske_*/AlphaBlend(hdcDest, nXDest, nYDest, iad->nodes[pos].width, iad->nodes[pos].height, iad->hdc, w, h, iad->nodes[pos].width, iad->nodes[pos].height,bf);
}
}
@@ -697,8 +697,8 @@ BOOL ImageArray_GetImageSize(LP_IMAGE_ARRAY_DATA iad, int pos, SIZE * lpSize) EnterCriticalSection(&iad->cs);
if (lpSize)
{
- lpSize->cx=iad->nodes[pos].width;
- lpSize->cy=iad->nodes[pos].height;
+ lpSize->cx = iad->nodes[pos].width;
+ lpSize->cy = iad->nodes[pos].height;
}
LeaveCriticalSection(&iad->cs);
return TRUE;
diff --git a/plugins/Clist_modern/modern_keyboard.cpp b/plugins/Clist_modern/modern_keyboard.cpp index 56f9ed6d2e..a8c8dc2931 100644 --- a/plugins/Clist_modern/modern_keyboard.cpp +++ b/plugins/Clist_modern/modern_keyboard.cpp @@ -21,7 +21,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "hdr/modern_commonheaders.h"
-#include <m_hotkeys.h>
+#include < m_hotkeys.h>
int InitSkinHotKeys(void);
diff --git a/plugins/Clist_modern/modern_log.cpp b/plugins/Clist_modern/modern_log.cpp index 2f44f59d8e..09e7e1dd6d 100644 --- a/plugins/Clist_modern/modern_log.cpp +++ b/plugins/Clist_modern/modern_log.cpp @@ -1,8 +1,8 @@ #include "hdr/modern_commonheaders.h"
-#include <stdarg.h>
-#include <stdio.h>
-#include <string.h>
+#include < stdarg.h>
+#include < stdio.h>
+#include < string.h>
void Log(const char *file,int line,const char *fmt,...)
@@ -24,10 +24,10 @@ void Log(const char *file,int line,const char *fmt,...) mir_vsnprintf(str,SIZEOF(str),fmt,vararg);
va_end(vararg);
{
- char * tmp=str;
- while(*tmp!='\0')
+ char * tmp = str;
+ while(*tmp != '\0')
{
- if (*tmp=='\n') *tmp=' ';
+ if (*tmp == '\n') *tmp = ' ';
tmp++;
}
}
@@ -35,7 +35,7 @@ void Log(const char *file,int line,const char *fmt,...) #ifdef _FILELOG_
{
FILE *fp;
- fp=fopen(_FILELOG_,"at");
+ fp = fopen(_FILELOG_,"at");
fprintf(fp,buf);
fclose(fp);
}
diff --git a/plugins/Clist_modern/modern_newrowopts.cpp b/plugins/Clist_modern/modern_newrowopts.cpp index fbd3ec60ed..78082a9d5a 100644 --- a/plugins/Clist_modern/modern_newrowopts.cpp +++ b/plugins/Clist_modern/modern_newrowopts.cpp @@ -48,20 +48,20 @@ typedef struct _NodeList struct _NodeList * itemParent;
} NodeList;
-NodeList * RootNode=NULL;
+NodeList * RootNode = NULL;
NodeList * AddNode(NodeList * Parent)
{
NodeList * res;
if (!Parent)
{
- res=(NodeList *)mir_alloc(sizeof(NodeList));
+ res = (NodeList *)mir_alloc(sizeof(NodeList));
memset(res,0,sizeof(NodeList));
return res;
}
- Parent->childNodes=(NodeList*) mir_realloc(Parent->childNodes,sizeof(NodeList)*(Parent->AllocatedChilds+1));
+ Parent->childNodes = (NodeList*) mir_realloc(Parent->childNodes,sizeof(NodeList)*(Parent->AllocatedChilds+1));
memset(&(Parent->childNodes[Parent->AllocatedChilds]),0,sizeof(NodeList));
- Parent->childNodes[Parent->AllocatedChilds].itemParent=Parent;
+ Parent->childNodes[Parent->AllocatedChilds].itemParent = Parent;
Parent->AllocatedChilds++;
return &(Parent->childNodes[Parent->AllocatedChilds-1]);
}
@@ -72,9 +72,9 @@ BOOL RemoveChildNode(NodeList * FromList, DWORD index) DWORD i;
NodeList * work;
if (!FromList) return FALSE;
- if (FromList->AllocatedChilds<=index) return FALSE;
- work=&(FromList->childNodes[index]);
- for(i=0; i<work->AllocatedChilds; i++)
+ if (FromList->AllocatedChilds <= index) return FALSE;
+ work = &(FromList->childNodes[index]);
+ for(i = 0; i < work->AllocatedChilds; i++)
{
if (work->childNodes[i].AllocatedChilds)
RemoveChildNode(work->childNodes,i);
@@ -82,7 +82,7 @@ BOOL RemoveChildNode(NodeList * FromList, DWORD index) if (work->AllocatedChilds)
{
mir_free_and_nill(work->childNodes);
- work->AllocatedChilds=0;
+ work->AllocatedChilds = 0;
}
//mir_free_and_nill(work);
memmove(FromList->childNodes+index,FromList->childNodes+index+1,sizeof(NodeList)*(FromList->AllocatedChilds-index-1));
@@ -97,10 +97,10 @@ BOOL RemoveNode(NodeList * FromList) if (FromList->itemParent)
{
DWORD k;
- for (k=0;k<FromList->itemParent->AllocatedChilds;k++)
- if (&(FromList->itemParent->childNodes[k])==FromList)
+ for (k = 0;k < FromList->itemParent->AllocatedChilds;k++)
+ if (&(FromList->itemParent->childNodes[k]) == FromList)
{
- BOOL res=RemoveChildNode(FromList->itemParent,k);
+ BOOL res = RemoveChildNode(FromList->itemParent,k);
return res;
}
}
@@ -112,11 +112,11 @@ BOOL RemoveNode(NodeList * FromList) mir_free_and_nill(FromList);
return TRUE;
}
-int ident=0;
+int ident = 0;
void PrintIdent()
{
int k;
- for (k=0;k<ident;k++)
+ for (k = 0;k < ident;k++)
TRACE("-");
}
@@ -130,8 +130,8 @@ void TraceTreeLevel(NodeList * node) mir_snprintf(buf,SIZEOF(buf),"%d\n",node->pData);
TRACE(buf);
}
- ident+=5;
- for(i=0; i<node->AllocatedChilds;i++)
+ ident += 5;
+ for(i = 0; i < node->AllocatedChilds;i++)
{
if (node->childNodes[i].AllocatedChilds>0)
@@ -146,7 +146,7 @@ void TraceTreeLevel(NodeList * node) }
}
}
- ident-=5;
+ ident -= 5;
}
BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -156,26 +156,26 @@ BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA case WM_INITDIALOG:
{
NodeList * res1,*res2, *res3;
- int i=0;
- RootNode=AddNode(NULL);
- RootNode->pData=i++;
- res1=AddNode(RootNode);
- res1->pData=i++;
- res1=AddNode(RootNode);
- res1->pData=i++;
- res2=AddNode(res1);
- res2->pData=i++;
- res2=AddNode(res1);
- res2->pData=i++;
- res3=AddNode(res2);
- res3->pData=i++;
- res3=AddNode(res1);
- res3->pData=i++;
- res3=AddNode(RootNode);
- res3->pData=i++;
+ int i = 0;
+ RootNode = AddNode(NULL);
+ RootNode->pData = i++;
+ res1 = AddNode(RootNode);
+ res1->pData = i++;
+ res1 = AddNode(RootNode);
+ res1->pData = i++;
+ res2 = AddNode(res1);
+ res2->pData = i++;
+ res2 = AddNode(res1);
+ res2->pData = i++;
+ res3 = AddNode(res2);
+ res3->pData = i++;
+ res3 = AddNode(res1);
+ res3->pData = i++;
+ res3 = AddNode(RootNode);
+ res3->pData = i++;
TRACE("*********** Nodes DUMP 1 ***********\n");
TraceTreeLevel(RootNode);
- if (RemoveNode(res1)) res1=0;
+ if (RemoveNode(res1)) res1 = 0;
TRACE("*********** Nodes DUMP 2 ***********\n");
TraceTreeLevel(RootNode);
//CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, DBGetContactSettingByte(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
diff --git a/plugins/Clist_modern/modern_popup.cpp b/plugins/Clist_modern/modern_popup.cpp index 8fa33f370a..839b0c9ba0 100644 --- a/plugins/Clist_modern/modern_popup.cpp +++ b/plugins/Clist_modern/modern_popup.cpp @@ -68,7 +68,7 @@ void ShowPopup(const char *title, const char *description, int type) strncpy(ppd.lpzContactName, title == NULL ? "Modern Contact List" : title, SIZEOF(ppd.lpzContactName)-1);
ppd.lpzContactName[SIZEOF(ppd.lpzContactName)-1] = '\0';
- if (description != NULL)
+ if (description !=NULL)
{
strncpy(ppd.lpzText, description, SIZEOF(ppd.lpzText)-1);
ppd.lpzText[SIZEOF(ppd.lpzText)-1] = '\0';
diff --git a/plugins/Clist_modern/modern_row.cpp b/plugins/Clist_modern/modern_row.cpp index b728b5c516..3767d2122a 100644 --- a/plugins/Clist_modern/modern_row.cpp +++ b/plugins/Clist_modern/modern_row.cpp @@ -29,15 +29,15 @@ Created by Anton Senko aka ZORG , tweaked by Artem Shpynov aka FYR /*
#include "m_stdhdr.h"
-#include <windows.h>
-#include <commctrl.h>
-#include <stdio.h>
-#include <time.h>
-#include <stddef.h>
-#include <process.h>
-#include <io.h>
-#include <string.h>
-#include <direct.h>
+#include < windows.h>
+#include < commctrl.h>
+#include < stdio.h>
+#include < time.h>
+#include < stddef.h>
+#include < process.h>
+#include < io.h>
+#include < string.h>
+#include < direct.h>
#include "resource.h"
#include "hdr/modern_commonheaders.h"
*/
@@ -52,7 +52,7 @@ void rowDeleteTree(ROWCELL* cell); -//extern ROWCELL * gl_RowRoot; // Óêàçàòåëü íà êîðíåâîé òýã <contact> â øàáëîíå
+//extern ROWCELL * gl_RowRoot; // Óêàçàòåëü íà êîðíåâîé òýã < contact> â øàáëîíå
//ROWOBJECTS RowTA; // Ñòðóêòóðà, ÷åðåç êîòîðóþ îñóùåñòâëÿåòñÿ äîñòóï ê ýëåìåíòàì êîíòàêòà.
// Ôîðìèðóåòñÿ ïðè âûïîëíåíèè ôó-è RowParce. Íåÿâíûé ïàðàìåòð ôóè rowParserGetParam
@@ -64,14 +64,14 @@ char *tmplbuf; // Áóôåð äëÿ õðàíåíèÿ øàáëîíà â òåêñòîâîì âèäå ROWCELL *cppInitModernRow(ROWCELL ** tabAccess)
{
int fsize;
- int seq=0;
- ROWCELL * RowRoot=NULL;
+ int seq = 0;
+ ROWCELL * RowRoot = NULL;
FILE * hFile;
- int i=0;
+ int i = 0;
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");
+ tmplbuf = NULL;
+ if (db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT) == 1)
+ tmplbuf = db_get_sa(NULL,"ModernData","RowTemplate");
if (tmplbuf)
{
rowParse(RowRoot, RowRoot, tmplbuf, i, seq,tabAccess);
@@ -84,7 +84,7 @@ ROWCELL *cppInitModernRow(ROWCELL ** tabAccess) tmplbuf = (char*)malloc(fsize+1);
ZeroMemory(tmplbuf, fsize+1);
- for (i=0; i<fsize; i++) tmplbuf[i] = getc(hFile);
+ for (i = 0; i < fsize; i++) tmplbuf[i] = getc(hFile);
tmplbuf[i] = 0;
i = 0;
rowParse(RowRoot, RowRoot, tmplbuf, i, seq,tabAccess);
@@ -99,14 +99,14 @@ ROWCELL *cppInitModernRow(ROWCELL ** tabAccess) void cppDeleteTree(ROWCELL * RowRoot)
{
- ROWCELL *rc=RowRoot;
+ ROWCELL *rc = RowRoot;
rowDeleteTree(rc);
}
int cppCalculateRowHeight(ROWCELL *RowRoot)
{
- RowRoot->h=0;
- RowRoot->w=0;
+ RowRoot->h = 0;
+ RowRoot->w = 0;
rowResetEmptyRects(RowRoot);
rowCalculateMinSize(RowRoot);
rowEqualize(RowRoot);
@@ -129,7 +129,7 @@ const ROWCELL * rowAddCell(ROWCELL* &link, int cont) {
link = (ROWCELL*)malloc(sizeof(ROWCELL));
ZeroMemory(link, sizeof(ROWCELL));
- link->cont=cont;
+ link->cont = cont;
return link;
}
@@ -152,7 +152,7 @@ void rowDeleteTree(ROWCELL* cell) // rowParserGetNextWord
// Âûáèðàåò èç ïîòîêà äàííûõ (ñåé÷àñ ôàéëîâîãî) î÷åðåäíîå ñëîâî.
-// Ñëîâîì ñ÷èòàåòñÿ ïîñëåäîâàòåëüíîñòü ñèìâîëîâ, îãðàíè÷åííàÿ çíàêàìè: SP, <, >, ;, TAB, CR, LF
+// Ñëîâîì ñ÷èòàåòñÿ ïîñëåäîâàòåëüíîñòü ñèìâîëîâ, îãðàíè÷åííàÿ çíàêàìè: SP, < , >, ;, TAB, CR, LF
// ñèìâîëû îò ; è äî êîíöà ñòðîêè ñ÷èòàþòñÿ êîììåíòàðèåì.
// NOTE: Äàííàÿ ðåàëèçàöèÿ íå ñîâñåì ïîäõîäèò äëÿ âêëþ÷åíèÿ åå â ModernCL,
// à ïî ñåìó, òóò íàäî áóäåò ïåðåäåëûâàòü
@@ -165,36 +165,36 @@ char * rowParserGetNextWord(char *tbuf, int &hbuf) static char buf[256];
char ch;
- int j=-1;
+ int j = -1;
ZeroMemory(buf, 256);
- while(tbuf[hbuf]!=0)
+ while(tbuf[hbuf] != 0)
{
ch = tbuf[hbuf];
// Remark found
- if (ch==';')
+ if (ch == ';')
{
- if (j>=0) return buf;
+ if (j >= 0) return buf;
- while (tbuf[hbuf]!=10 && tbuf[hbuf]!=13) hbuf++;
+ while (tbuf[hbuf] != 10 && tbuf[hbuf] != 13) hbuf++;
}
// Tag-bracers found
- if (!(ch == '>' && j<0)) //not single '>' found
+ if (!(ch == '>' && j < 0)) //not single '>' found
{
- if ( (ch=='<' || ch=='>') && j>=0)
+ if ( (ch == ' < ' || ch == '>') && j >= 0)
{
if (ch == '>')
{
- if (buf[0]=='/' || buf[0]=='<') buf[++j] = ch;
+ if (buf[0] == '/' || buf[0] == ' < ') buf[++j] = ch;
hbuf++;
}
return buf;
}
- if (ch == ' ' || ch == 9 || ch == 10 || ch == 13 || ch==';' || ch == '>')
+ if (ch == ' ' || ch == 9 || ch == 10 || ch == 13 || ch == ';' || ch == '>')
{
if (ch == '>')
{
@@ -202,7 +202,7 @@ char * rowParserGetNextWord(char *tbuf, int &hbuf) hbuf++;
}
- if (j>=0) return buf; // Word is selected
+ if (j >= 0) return buf; // Word is selected
}
else
buf[++j] = ch;
@@ -221,8 +221,8 @@ char * rowParserGetNextWord(char *tbuf, int &hbuf) //
void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf)
{
- char * word=rowParserGetNextWord(tbuf, hbuf);
- int param=0;
+ 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;
@@ -257,11 +257,11 @@ void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf) else
{
- hbuf-=(int)strlen(word);
+ hbuf -= (int)strlen(word);
return;
}
- if (param>TC_TEXT3 && param != TC_SPACE) cell->hasfixed = 1;
+ if (param>TC_TEXT3 && param !=TC_SPACE) cell->hasfixed = 1;
switch (param)
{
@@ -314,7 +314,7 @@ void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf) return;
}
// rowParse
-// Èùåò â øàáëîíå òåãè <contact>, <tr> è <tc>, è äîáàâëÿåò ñîîòâåòñòâóþùèå óçëû
+// Èùåò â øàáëîíå òåãè < contact>, < tr> è < tc>, è äîáàâëÿåò ñîîòâåòñòâóþùèå óçëû
// â äåðåâî îïèñàíèÿ êîíòàêòà
// cell - ïîëå child èëè next ðîäèòåëüñêîãî êîíòåéíåðà
// parent - óêàçàòåëü íà ðîäèòåëüñêèé êîíòåéíåð
@@ -328,16 +328,16 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque word = rowParserGetNextWord(tbuf, hbuf);
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;
+ 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))||
- !_strnicmp(word, "</tr>", strlen(word))||
- !_strnicmp(word, "</tc>", strlen(word))) return TRUE;
+ !_strnicmp(word, " < /tr>", strlen(word))||
+ !_strnicmp(word, " < /tc>", strlen(word))) return TRUE;
else return FALSE;
rowAddCell(cell, cont);
rowParserGetParam(cell, tbuf, hbuf);
- if (cell->type != 0 && cell->type !=TC_SPACE && cell->type !=TC_FIXED)
+ if (cell->type !=0 && cell->type !=TC_SPACE && cell->type !=TC_FIXED)
RowTabAccess[sequence++] = cell;
if (!rowParse(cell->child, cell, tbuf, hbuf, sequence,RowTabAccess))
@@ -353,18 +353,18 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque return FALSE;
parent->sizing |= cell->sizing;
- parent->hasfixed|=cell->hasfixed;
+ parent->hasfixed |= cell->hasfixed;
return TRUE;
}
void rowResetEmptyRects(ROWCELL* cell)
{
if (!cell) return;
- if (cell->type==0)
+ if (cell->type == 0)
{
SetRect(&(cell->r),0,0,0,0);
- cell->full_width=0;
- cell->fixed_width=0;
+ cell->full_width = 0;
+ cell->fixed_width = 0;
}
rowResetEmptyRects(cell->child);
rowResetEmptyRects(cell->next);
@@ -378,21 +378,21 @@ void rowResetEmptyRects(ROWCELL* cell) //
void rowCalculateMinSize(ROWCELL* cell)
{
- ROWCELL* curchild=NULL;
- int w=0,h=0;
- int wl=0, hl=0;
- int fullWidth=0;
+ ROWCELL* curchild = NULL;
+ int w = 0,h = 0;
+ int wl = 0, hl = 0;
+ int fullWidth = 0;
if (!cell) return;
- cell->r.left = 0;
- cell->r.top = 0;
+ cell->r.left = 0;
+ cell->r.top = 0;
- if (cell->type < TC_TEXT1 || cell->type > TC_TEXT3 && cell->type!=TC_SPACE)
- cell->r.right = cell->w;
+ if (cell->type < TC_TEXT1 || cell->type > TC_TEXT3 && cell->type != TC_SPACE)
+ cell->r.right = cell->w;
else
- cell->r.right = 0;
+ cell->r.right = 0;
- cell->r.bottom = cell->h;
+ cell->r.bottom = cell->h;
rowCalculateMinSize(cell->child);
rowCalculateMinSize(cell->next);
@@ -408,13 +408,13 @@ void rowCalculateMinSize(ROWCELL* cell) if (curchild->layer)
{
//w = max(w, curchild->r.right);
- wl += curchild->r.right;
- fullWidth=max(fullWidth,max(curchild->full_width,curchild->w));
+ wl += curchild->r.right;
+ fullWidth = max(fullWidth,max(curchild->full_width,curchild->w));
}
else
{
- w += curchild->r.right;
- fullWidth+=max(curchild->full_width,curchild->w);
+ w += curchild->r.right;
+ fullWidth += max(curchild->full_width,curchild->w);
}
}
while (curchild = curchild->next);
@@ -425,7 +425,7 @@ void rowCalculateMinSize(ROWCELL* cell) while (curchild)
{
w = max(w, curchild->r.right);
- fullWidth=max(fullWidth,max(curchild->full_width,curchild->w));
+ fullWidth = max(fullWidth,max(curchild->full_width,curchild->w));
if (curchild->layer)
{
@@ -433,7 +433,7 @@ void rowCalculateMinSize(ROWCELL* cell) // h = max(h, curchild->r.bottom);
}
else
- h += curchild->r.bottom;
+ h += curchild->r.bottom;
curchild = curchild->next;
}
@@ -453,7 +453,7 @@ void rowCalculateMinSize(ROWCELL* cell) //
void rowEqualize(ROWCELL* cell)
{
- ROWCELL* curchild=NULL;
+ ROWCELL* curchild = NULL;
if (!cell) return;
rowEqualize(cell->child);
rowEqualize(cell->next);
@@ -500,7 +500,7 @@ void rowPlacing(pROWCELL cell) case TC_TEXT2:
case TC_TEXT3:
case TC_SPACE:
- cell->r.right += cell->r.left;
+ cell->r.right += cell->r.left;
break;
default:
{
@@ -509,10 +509,10 @@ void rowPlacing(pROWCELL cell) case TC_LEFT:
break;
case TC_HCENTER:
- cell->r.left += (cell->r.right - cell->w)/2;
+ cell->r.left += (cell->r.right - cell->w)/2;
break;
case TC_RIGHT:
- cell->r.left += cell->r.right - cell->w;
+ cell->r.left += cell->r.right - cell->w;
}
cell->r.right = cell->r.left + cell->w;
}
@@ -523,10 +523,10 @@ void rowPlacing(pROWCELL cell) case TC_TOP:
break;
case TC_VCENTER:
- cell->r.top += (cell->r.bottom - cell->h)/2;
+ cell->r.top += (cell->r.bottom - cell->h)/2;
break;
case TC_BOTTOM:
- cell->r.top += cell->r.bottom - cell->h;
+ cell->r.top += cell->r.bottom - cell->h;
}
cell->r.bottom = cell->r.top + cell->h;
}
@@ -542,7 +542,7 @@ void rowLayerProc(pROWCELL cell, pROWCELL parent) if (cell->sizing)
{
cell->r.left = parent->r.left;
- //cell->r.right += cell->r.left;
+ //cell->r.right += cell->r.left;
}
else
{
@@ -592,16 +592,16 @@ void rowPositioning(pROWCELL cell, int &dist) int r = 0;
int size = 0;
int cw = 0;
- int fixedsized=0;
- int autosized=0;
+ int fixedsized = 0;
+ int autosized = 0;
int dummy = 0;
// Êîðððåêòèðîâêà íàçíà÷àåìîé øèðèíû dist
- if (w < cell->r.right && (cell->type < TC_TEXT1 || cell->type > TC_TEXT3 && cell->type!=TC_SPACE) || !cell->sizing)
+ if (w < cell->r.right && (cell->type < TC_TEXT1 || cell->type > TC_TEXT3 && cell->type != TC_SPACE) || !cell->sizing)
dist = w = cell->r.right;
- cell->r.right= dist;
- dummy=dist;
+ cell->r.right = dist;
+ dummy = dist;
if (!(curchild = cell->child))
{
rowPlacing(cell);
@@ -611,7 +611,7 @@ void rowPositioning(pROWCELL cell, int &dist) // Ïîçèöèîíèðîâàíèå êîíòåéíåðîâ â ñòðîêå
if (cell->cont == TC_ROW)
{
- fixedsized=cell->fixed_width;
+ fixedsized = cell->fixed_width;
while (curchild)
{
// Êîíòåéíåðû layer íå äîëæíû âëèÿòü íà ïîçèöèîíèðîâàíèå êîíòåéíåðîâ tc
@@ -621,31 +621,31 @@ void rowPositioning(pROWCELL cell, int &dist) continue;
}
- cw += curchild->r.right;
+ cw += curchild->r.right;
if (curchild->sizing)
{
- autosized+=max(curchild->w,curchild->full_width);
+ autosized += max(curchild->w,curchild->full_width);
r++;
}
else
- size += curchild->r.right;
+ size += curchild->r.right;
curchild = curchild->next;
}
- w -= size;
- fixedsized-=size;
+ w -= size;
+ fixedsized -= size;
if (r == 0)
{
switch(cell->halign)
{
case TC_HCENTER:
- x += (dist - cw)/2;// - 1;
+ x += (dist - cw)/2;// - 1;
break;
case TC_RIGHT:
- x += dist - cw;
+ x += dist - cw;
break;
}
}
@@ -668,35 +668,35 @@ void rowPositioning(pROWCELL cell, int &dist) curchild->r.left = x;
- w -= size;
+ w -= size;
if (curchild->sizing)
{
if ((0&!curchild->fitwidth) || r>1) //ïîêà îòêëþ÷åíî -ïðîáëåìû ñ âûðàâíèâàíèåì
{
if (curchild->hasfixed)
- fixedsized-=curchild->fixed_width;
+ fixedsized -= curchild->fixed_width;
switch (cell->halign)
{
case TC_RIGHT:
- size=(w-fixedsized)-(autosized-max(curchild->full_width,curchild->w));
+ size = (w-fixedsized)-(autosized-max(curchild->full_width,curchild->w));
break;
case TC_LEFT:
- size=min(w-fixedsized,max(curchild->full_width,curchild->w));
+ size = min(w-fixedsized,max(curchild->full_width,curchild->w));
break;
case TC_HCENTER:
- if (autosized) {size=max(curchild->full_width,curchild->w)*w/autosized; break;}
+ if (autosized) {size = max(curchild->full_width,curchild->w)*w/autosized; break;}
default:
size = w / r;
}
- autosized-=(max(curchild->full_width,curchild->w));
- if (autosized<0) autosized=0;
- if (size<0) size=0;
+ autosized -= (max(curchild->full_width,curchild->w));
+ if (autosized < 0) autosized = 0;
+ if (size < 0) size = 0;
}
else size = w;
/* ïîêà îòêëþ÷åíî èáî ïàðàìåòð âëèÿåò íà âûðàâíèâàíèå âêëþ÷àåòñÿ ïî ëåâîìó êðàþ
if (0 &&!curchild->fitwidth)
- if(size>max(curchild->full_width,curchild->w))
- size=max(curchild->full_width,curchild->w);
+ if (size>max(curchild->full_width,curchild->w))
+ size = max(curchild->full_width,curchild->w);
*/
r--;
}
@@ -704,10 +704,10 @@ void rowPositioning(pROWCELL cell, int &dist) size = curchild->r.right;
rowPositioning(curchild, size);
- x += size;
+ x += size;
if (!curchild->sizing)
- size=0;
+ size = 0;
}
curchild = curchild->next;
@@ -726,7 +726,7 @@ void rowPositioning(pROWCELL cell, int &dist) continue;
}
- size += curchild->r.bottom;
+ size += curchild->r.bottom;
curchild = curchild->next;
}
@@ -735,10 +735,10 @@ void rowPositioning(pROWCELL cell, int &dist) switch(cell->valign)
{
case TC_VCENTER:
- y += (h - size) / 2;
+ y += (h - size) / 2;
break;
case TC_BOTTOM:
- y += (h - size);
+ y += (h - size);
break;
}
}
@@ -754,7 +754,7 @@ void rowPositioning(pROWCELL cell, int &dist) else
{
curchild->r.top = y;
- y += curchild->r.bottom;
+ y += curchild->r.bottom;
curchild->r.left = cell->r.left;
curchild->r.right = dist;
diff --git a/plugins/Clist_modern/modern_rowheight_funcs.cpp b/plugins/Clist_modern/modern_rowheight_funcs.cpp index 065f6820c1..06de4347ee 100644 --- a/plugins/Clist_modern/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/modern_rowheight_funcs.cpp @@ -29,7 +29,7 @@ Created by Pescuma, modified by Artem Shpynov #include "hdr/modern_row.h"
#include "hdr/modern_clcpaint.h"
-int g_mutex_nCalcRowHeightLock=0;
+int g_mutex_nCalcRowHeightLock = 0;
int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item);
void RowHeights_CalcRowHeights_Worker(struct ClcData *dat, HWND hwnd);
int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item);
@@ -38,7 +38,7 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon *
*/
-ROWCELL * gl_RowTabAccess[TC_ELEMENTSCOUNT+1]={0}; // Ìàññèâ, ÷åðåç êîòîðûé îñóùåñòâëÿåòñÿ äîñòóï ê ýëåìåíòàì êîíòàêòà.
+ROWCELL * gl_RowTabAccess[TC_ELEMENTSCOUNT+1] = {0}; // Ìàññèâ, ÷åðåç êîòîðûé îñóùåñòâëÿåòñÿ äîñòóï ê ýëåìåíòàì êîíòàêòà.
ROWCELL * gl_RowRoot;
void FreeRowCell ()
@@ -49,19 +49,19 @@ void FreeRowCell () void RowHeight_InitModernRow()
{
- gl_RowRoot=cppInitModernRow(gl_RowTabAccess);
+ gl_RowRoot = cppInitModernRow(gl_RowTabAccess);
return;
}
SIZE GetAvatarSize(int imageWidth, int imageHeight, int maxWidth, int maxHeight)
{
- float scalefactor=0;
- SIZE sz={0};
- if (imageWidth==0 || imageHeight==0) return sz;
- if (maxWidth==0) maxWidth=maxHeight;
- scalefactor=min((float)maxWidth/imageWidth,(float)maxHeight/imageHeight);
- sz.cx=(LONG)(imageWidth*scalefactor);
- sz.cy=(LONG)(imageHeight*scalefactor);
+ float scalefactor = 0;
+ SIZE sz = {0};
+ if (imageWidth == 0 || imageHeight == 0) return sz;
+ if (maxWidth == 0) maxWidth = maxHeight;
+ scalefactor = min((float)maxWidth/imageWidth,(float)maxHeight/imageHeight);
+ sz.cx = (LONG)(imageWidth*scalefactor);
+ sz.cy = (LONG)(imageHeight*scalefactor);
return sz;
}
@@ -70,27 +70,27 @@ int RowHeight_CalcRowHeight(struct ClcData *dat, HWND hwnd, struct ClcContact *c int res;
if (MirandaExiting()) return 0;
g_mutex_nCalcRowHeightLock++;
- res=mod_CalcRowHeight_worker(dat,hwnd,contact,item);
+ res = mod_CalcRowHeight_worker(dat,hwnd,contact,item);
g_mutex_nCalcRowHeightLock--;
return res;
}
int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact *contact, int item)
{
- BYTE i=0;
- int res=0;
- int height=0;
+ BYTE i = 0;
+ int res = 0;
+ int height = 0;
displayNameCacheEntry * pdnce;
- BOOL hasAvatar=FALSE;
+ BOOL hasAvatar = FALSE;
DWORD style;
- style=GetWindowLongPtr(hwnd,GWL_STYLE);
- pdnce=(displayNameCacheEntry*)pcli->pfnGetCacheEntry(contact->hContact);
+ style = GetWindowLongPtr(hwnd,GWL_STYLE);
+ pdnce = (displayNameCacheEntry*)pcli->pfnGetCacheEntry(contact->hContact);
if (!RowHeights_Alloc(dat, item + 1))
return -1;
if (!pcli->hwndContactTree) return 0;
//if (!gl_RowRoot) RowHeight_InitModernRow();
- if (dat->hWnd!=pcli->hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP)
+ if (dat->hWnd != pcli->hwndContactTree || !gl_RowRoot || contact->type == CLCIT_GROUP)
{
- int tmp=0;
+ int tmp = 0;
tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
@@ -98,132 +98,132 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * {
char * szCounts = pcli->pfnGetGroupCountsText(dat, contact);
// Has the count?
- if(szCounts && szCounts[0])
- tmp=max(tmp,dat->fontModernInfo[contact->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS].fontHeight);
+ if (szCounts && szCounts[0])
+ tmp = max(tmp,dat->fontModernInfo[contact->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS].fontHeight);
}
- tmp=max(tmp, ICON_HEIGHT);
- tmp=max(tmp,dat->row_min_heigh);
- tmp+=dat->row_border*2;
+ tmp = max(tmp, ICON_HEIGHT);
+ tmp = max(tmp,dat->row_min_heigh);
+ tmp += dat->row_border*2;
if (contact->type == CLCIT_GROUP &&
- contact->group->parent->groupId==0 &&
- contact->group->parent->cl.items[0]!=contact)
- tmp+=dat->row_before_group_space;
- if (item!=-1) dat->row_heights[item] = tmp;
+ contact->group->parent->groupId == 0 &&
+ contact->group->parent->cl.items[0] != contact)
+ tmp += dat->row_before_group_space;
+ if (item != -1) dat->row_heights[item] = tmp;
return tmp;
}
- hasAvatar=(dat->use_avatar_service && contact->avatar_data != NULL) ||(!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE);
- while (gl_RowTabAccess[i]!=NULL)
+ hasAvatar = (dat->use_avatar_service && contact->avatar_data !=NULL) ||(!dat->use_avatar_service && contact->avatar_pos !=AVATAR_POS_DONT_HAVE);
+ while (gl_RowTabAccess[i] != NULL)
{
- if (gl_RowTabAccess[i]->type!=TC_SPACE)
+ if (gl_RowTabAccess[i]->type != TC_SPACE)
{
- gl_RowTabAccess[i]->h=0;
- gl_RowTabAccess[i]->w=0;
+ gl_RowTabAccess[i]->h = 0;
+ gl_RowTabAccess[i]->w = 0;
SetRect(&(gl_RowTabAccess[i]->r),0,0,0,0);
switch (gl_RowTabAccess[i]->type)
{
case TC_TEXT1:
{
- int tmp=0;
+ int tmp = 0;
tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
- if (item==-1)
+ if (item == -1)
{
//calculate text width here
- SIZE size={0};
- RECT dummyRect={0,0,1024,tmp};
- HDC hdc=CreateCompatibleDC(NULL);
+ SIZE size = {0};
+ RECT dummyRect = {0,0,1024,tmp};
+ HDC hdc = CreateCompatibleDC(NULL);
g_clcPainter.ChangeToFont(hdc,dat,g_clcPainter.GetBasicFontID(contact),NULL);
g_clcPainter.GetTextSize(&size,hdc,dummyRect,contact->szText,contact->ssText.plText,0, dat->text_resize_smileys ? 0 : contact->ssText.iMaxSmileyHeight);
- if (contact->type==CLCIT_GROUP)
+ if (contact->type == CLCIT_GROUP)
{
char * szCounts = pcli->pfnGetGroupCountsText(dat, contact);
- if(szCounts && strlen(szCounts)>0)
+ if (szCounts && strlen(szCounts)>0)
{
- RECT count_rc={0};
+ RECT count_rc = {0};
// calc width and height
g_clcPainter.ChangeToFont(hdc,dat,contact->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS,NULL);
ske_DrawText(hdc,_T(" "),1,&count_rc,DT_CALCRECT | DT_NOPREFIX);
- size.cx +=count_rc.right-count_rc.left;
- count_rc.right=0;
- count_rc.left=0;
+ size.cx += count_rc.right-count_rc.left;
+ count_rc.right = 0;
+ count_rc.left = 0;
ske_DrawTextA(hdc,szCounts,lstrlenA(szCounts),&count_rc,DT_CALCRECT);
- size.cx +=count_rc.right-count_rc.left;
+ size.cx += count_rc.right-count_rc.left;
tmp = max(tmp,count_rc.bottom-count_rc.top);
}
}
- gl_RowTabAccess[i]->w=size.cx;
+ gl_RowTabAccess[i]->w = size.cx;
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
mod_DeleteDC(hdc);
}
- gl_RowTabAccess[i]->h=tmp;
+ gl_RowTabAccess[i]->h = tmp;
break;
}
case TC_TEXT2:
{
- int tmp=0;
- HANDLE hContact=pdnce->m_cache_hContact;
+ int tmp = 0;
+ HANDLE hContact = pdnce->m_cache_hContact;
if (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)
tmp = max(tmp, pdnce->ssSecondLine.iMaxSmileyHeight);
- if (item==-1)
+ if (item == -1)
{
//calculate text width here
- SIZE size={0};
- RECT dummyRect={0,0,1024,tmp};
- HDC hdc=CreateCompatibleDC(NULL);
+ SIZE size = {0};
+ RECT dummyRect = {0,0,1024,tmp};
+ HDC hdc = CreateCompatibleDC(NULL);
g_clcPainter.ChangeToFont(hdc,dat,FONTID_SECONDLINE,NULL);
g_clcPainter.GetTextSize(&size,hdc,dummyRect,pdnce->szSecondLineText,pdnce->ssSecondLine.plText,0, dat->text_resize_smileys ? 0 : pdnce->ssSecondLine.iMaxSmileyHeight);
- gl_RowTabAccess[i]->w=size.cx;
+ gl_RowTabAccess[i]->w = size.cx;
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
mod_DeleteDC(hdc);
}
}
- gl_RowTabAccess[i]->h=tmp;
+ gl_RowTabAccess[i]->h = tmp;
break;
}
case TC_TEXT3:
{
- int tmp=0;
- HANDLE hContact=pdnce->m_cache_hContact;
+ int tmp = 0;
+ HANDLE hContact = pdnce->m_cache_hContact;
if (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)
tmp = max(tmp, pdnce->ssThirdLine.iMaxSmileyHeight);
- if (item==-1)
+ if (item == -1)
{
//calculate text width here
- SIZE size={0};
- RECT dummyRect={0,0,1024,tmp};
- HDC hdc=CreateCompatibleDC(NULL);
+ SIZE size = {0};
+ RECT dummyRect = {0,0,1024,tmp};
+ HDC hdc = CreateCompatibleDC(NULL);
g_clcPainter.ChangeToFont(hdc,dat,FONTID_THIRDLINE,NULL);
g_clcPainter.GetTextSize(&size,hdc,dummyRect,pdnce->szThirdLineText,pdnce->ssThirdLine.plText,0, dat->text_resize_smileys ? 0 : pdnce->ssThirdLine.iMaxSmileyHeight);
- gl_RowTabAccess[i]->w=size.cx;
+ gl_RowTabAccess[i]->w = size.cx;
SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
mod_DeleteDC(hdc);
}
}
- gl_RowTabAccess[i]->h=tmp;
+ gl_RowTabAccess[i]->h = tmp;
break;
}
case TC_STATUS:
{
if (
(contact->type == CLCIT_GROUP && !dat->row_hide_group_icon)||
- ( contact->type == CLCIT_CONTACT && contact->iImage != -1 &&
- !(dat->icon_hide_on_avatar && dat->avatars_show && (hasAvatar|| (!hasAvatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)) && !contact->image_is_special))
+ ( contact->type == CLCIT_CONTACT && contact->iImage !=-1 &&
+ !(dat->icon_hide_on_avatar && dat->avatars_show && (hasAvatar|| (!hasAvatar && dat->icon_draw_on_avatar_space && contact->iImage !=-1)) && !contact->image_is_special))
)
{
- gl_RowTabAccess[i]->h=ICON_HEIGHT;
- gl_RowTabAccess[i]->w=ICON_HEIGHT;
+ gl_RowTabAccess[i]->h = ICON_HEIGHT;
+ gl_RowTabAccess[i]->w = ICON_HEIGHT;
}
break;
}
@@ -231,17 +231,17 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * {
if (dat->avatars_show &&
contact->type == CLCIT_CONTACT &&
- (hasAvatar || (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage != -1) )
+ (hasAvatar || (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage !=-1) )
)
{
- SIZE sz={0};
- int iW=0, iH=0;
+ SIZE sz = {0};
+ int iW = 0, iH = 0;
if (dat->use_avatar_service)
{
if (contact->avatar_data)
{
- iH=contact->avatar_data->bmHeight;
- iW=contact->avatar_data->bmWidth;
+ iH = contact->avatar_data->bmHeight;
+ iW = contact->avatar_data->bmWidth;
}
}
else if (dat->avatar_cache.nodes)
@@ -249,12 +249,12 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * iW = dat->avatar_cache.nodes[contact->avatar_pos].width;
iH = dat->avatar_cache.nodes[contact->avatar_pos].height;
}
- sz=GetAvatarSize(iW,iH,dat->avatars_maxwidth_size,dat->avatars_maxheight_size);
- if ((sz.cx==0 || sz.cy==0) && dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage != -1)
- { sz.cx=ICON_HEIGHT; sz.cy=ICON_HEIGHT; }
+ sz = GetAvatarSize(iW,iH,dat->avatars_maxwidth_size,dat->avatars_maxheight_size);
+ if ((sz.cx == 0 || sz.cy == 0) && dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && contact->iImage !=-1)
+ { sz.cx = ICON_HEIGHT; sz.cy = ICON_HEIGHT; }
- gl_RowTabAccess[i]->h=sz.cy;
- gl_RowTabAccess[i]->w=sz.cx;
+ gl_RowTabAccess[i]->h = sz.cy;
+ gl_RowTabAccess[i]->w = sz.cx;
}
break;
@@ -266,20 +266,20 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * if (contact->type == CLCIT_CONTACT &&
(!contact->isSubcontact || db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
{
- BOOL hasExtra=FALSE;
+ BOOL hasExtra = FALSE;
int k;
- int width=0;
- for (k=0; k<dat->extraColumnsCount; k++)
- if (contact->iExtraImage[k]!=0xFF || contact->iWideExtraImage[k]!=0xFFFF || !dat->MetaIgnoreEmptyExtra)
+ int width = 0;
+ for (k = 0; k < dat->extraColumnsCount; k++)
+ if (contact->iExtraImage[k] != 0xFF || contact->iWideExtraImage[k] != 0xFFFF || !dat->MetaIgnoreEmptyExtra)
{
- hasExtra=TRUE;
- if (item!=-1) break;
- width+=(width>0)?dat->extraColumnSpacing:(dat->extraColumnSpacing-2);
+ hasExtra = TRUE;
+ if (item != -1) break;
+ width += (width>0)?dat->extraColumnSpacing:(dat->extraColumnSpacing-2);
}
if (hasExtra)
{
- gl_RowTabAccess[i]->h=ICON_HEIGHT;
- gl_RowTabAccess[i]->w=width;
+ gl_RowTabAccess[i]->h = ICON_HEIGHT;
+ gl_RowTabAccess[i]->w = width;
}
}
break;
@@ -297,12 +297,12 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * if (contact->type == CLCIT_CONTACT &&
(!contact->isSubcontact || db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
{
- int eNum=gl_RowTabAccess[i]->type-TC_EXTRA1;
- if (eNum<dat->extraColumnsCount)
- if (contact->iExtraImage[eNum]!=255 || contact->iWideExtraImage[eNum]!=0xFFFF || !dat->MetaIgnoreEmptyExtra)
+ int eNum = gl_RowTabAccess[i]->type-TC_EXTRA1;
+ if (eNum < dat->extraColumnsCount)
+ if (contact->iExtraImage[eNum] != 255 || contact->iWideExtraImage[eNum] != 0xFFFF || !dat->MetaIgnoreEmptyExtra)
{
- gl_RowTabAccess[i]->h=ICON_HEIGHT;
- gl_RowTabAccess[i]->w=ICON_HEIGHT;
+ gl_RowTabAccess[i]->h = ICON_HEIGHT;
+ gl_RowTabAccess[i]->w = ICON_HEIGHT;
}
}
break;
@@ -311,17 +311,17 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * {
if (contact->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone)
{
- gl_RowTabAccess[i]->h=dat->fontModernInfo[FONTID_CONTACT_TIME].fontHeight;
- if (item==-1)
+ gl_RowTabAccess[i]->h = dat->fontModernInfo[FONTID_CONTACT_TIME].fontHeight;
+ if (item == -1)
{
TCHAR szResult[80];
if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
{
- SIZE text_size={0};
- RECT rc={0};
+ SIZE text_size = {0};
+ RECT rc = {0};
// Select font
- HDC hdc=CreateCompatibleDC(NULL);
+ HDC hdc = CreateCompatibleDC(NULL);
g_clcPainter.ChangeToFont(hdc,dat,FONTID_CONTACT_TIME,NULL);
// Get text size
@@ -330,7 +330,7 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * ske_ResetTextEffect(hdc);
mod_DeleteDC(hdc);
text_size.cx = rc.right - rc.left;
- gl_RowTabAccess[i]->w=text_size.cx;
+ gl_RowTabAccess[i]->w = text_size.cx;
}
}
@@ -342,10 +342,10 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * i++;
}
- height=cppCalculateRowHeight(gl_RowRoot);
- height+=dat->row_border*2;
- height=max(height,dat->row_min_heigh);
- if (item!=-1) dat->row_heights[item] = height;
+ height = cppCalculateRowHeight(gl_RowRoot);
+ height += dat->row_border*2;
+ height = max(height,dat->row_min_heigh);
+ if (item != -1) dat->row_heights[item] = height;
return height;
}
@@ -361,8 +361,8 @@ int mod_CalcRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcContact * BOOL RowHeights_Initialize(struct ClcData *dat)
{
- dat->max_row_height = 0;
- dat->row_heights_size = 0;
+ dat->max_row_height = 0;
+ dat->row_heights_size = 0;
dat->row_heights_allocated = 0;
dat->row_heights = NULL;
@@ -371,7 +371,7 @@ BOOL RowHeights_Initialize(struct ClcData *dat) void RowHeights_Free(struct ClcData *dat)
{
- if (dat->row_heights != NULL)
+ if (dat->row_heights !=NULL)
{
free(dat->row_heights);
dat->row_heights = NULL;
@@ -395,9 +395,9 @@ BOOL RowHeights_Alloc(struct ClcData *dat, int size) {
int size_grow = size;
- size_grow += 100 - (size_grow % 100);
+ size_grow += 100 - (size_grow % 100);
- if (dat->row_heights != NULL)
+ if (dat->row_heights !=NULL)
{
int *tmp = (int *) realloc((void *)dat->row_heights, sizeof(int) * size_grow);
@@ -438,7 +438,7 @@ BOOL RowHeights_Alloc(struct ClcData *dat, int size) int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd)
{
int max_height = 0, i, tmp;
- DWORD style=GetWindowLongPtr(hwnd,GWL_STYLE);
+ DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
if (!dat->text_ignore_size_for_row_height)
{
@@ -458,7 +458,7 @@ int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd) {
tmp = max(tmp, dat->text_smiley_height);
}
- max_height += tmp;
+ max_height += tmp;
if (dat->second_line_show)
{
@@ -467,7 +467,7 @@ int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd) {
tmp = max(tmp, dat->text_smiley_height);
}
- max_height += dat->second_line_top_space + tmp;
+ max_height += dat->second_line_top_space + tmp;
}
if (dat->third_line_show)
@@ -477,7 +477,7 @@ int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd) {
tmp = max(tmp, dat->text_smiley_height);
}
- max_height += dat->third_line_top_space + tmp;
+ max_height += dat->third_line_top_space + tmp;
}
// Get other font sizes
@@ -506,7 +506,7 @@ int RowHeights_GetMaxRowHeight(struct ClcData *dat, HWND hwnd) max_height = max(max_height, ICON_HEIGHT);
}
- max_height += 2 * dat->row_border;
+ max_height += 2 * dat->row_border;
// Min size
max_height = max(max_height, dat->row_min_heigh);
@@ -535,23 +535,23 @@ void RowHeights_CalcRowHeights_Worker(struct ClcData *dat, HWND hwnd) if (MirandaExiting()) return;
// Draw lines
- group=&dat->list;
- group->scanIndex=0;
- indent=0;
- subindex=-1;
+ group = &dat->list;
+ group->scanIndex = 0;
+ indent = 0;
+ subindex = -1;
line_num = -1;
RowHeights_Clear(dat);
while(TRUE)
{
- if (subindex==-1)
+ if (subindex == -1)
{
- if (group->scanIndex==group->cl.count)
+ if (group->scanIndex == group->cl.count)
{
- group=group->parent;
+ group = group->parent;
indent--;
- if(group==NULL) break; // Finished list
+ if (group == NULL) break; // Finished list
group->scanIndex++;
continue;
}
@@ -574,29 +574,29 @@ void RowHeights_CalcRowHeights_Worker(struct ClcData *dat, HWND hwnd) else RowHeight_CalcRowHeight(dat, hwnd, Drawing, line_num);
//increment by subcontacts
- if (group->cl.items[group->scanIndex]->subcontacts!=NULL && group->cl.items[group->scanIndex]->type!=CLCIT_GROUP)
+ if (group->cl.items[group->scanIndex]->subcontacts != NULL && group->cl.items[group->scanIndex]->type != CLCIT_GROUP)
{
if (group->cl.items[group->scanIndex]->SubExpanded && dat->expandMeta)
{
- if (subindex<group->cl.items[group->scanIndex]->SubAllocated-1)
+ if (subindex < group->cl.items[group->scanIndex]->SubAllocated-1)
{
subindex++;
}
else
{
- subindex=-1;
+ subindex = -1;
}
}
}
- if(subindex==-1)
+ if (subindex == -1)
{
- if(group->cl.items[group->scanIndex]->type==CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded)
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded)
{
- group=group->cl.items[group->scanIndex]->group;
+ group = group->cl.items[group->scanIndex]->group;
indent++;
- group->scanIndex=0;
- subindex=-1;
+ group->scanIndex = 0;
+ subindex = -1;
continue;
}
group->scanIndex++;
@@ -612,7 +612,7 @@ int RowHeights_GetRowHeight(struct ClcData *dat, HWND hwnd, struct ClcContact *c int res;
if (MirandaExiting()) return 0;
g_mutex_nCalcRowHeightLock++;
- res=RowHeights_GetRowHeight_worker(dat, hwnd, contact, item);
+ res = RowHeights_GetRowHeight_worker(dat, hwnd, contact, item);
g_mutex_nCalcRowHeightLock--;
return res;
}
@@ -625,13 +625,13 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon return RowHeight_CalcRowHeight(dat, hwnd, contact, item);
else
{
- displayNameCacheEntry *pdnce=(displayNameCacheEntry *)pcli->pfnGetCacheEntry(contact->hContact);
- DWORD style=GetWindowLongPtr(hwnd,GWL_STYLE);
+ displayNameCacheEntry *pdnce = (displayNameCacheEntry *)pcli->pfnGetCacheEntry(contact->hContact);
+ DWORD style = GetWindowLongPtr(hwnd,GWL_STYLE);
//TODO replace futher code with new rowheight definition
int tmp;
- 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));
+ 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))
return -1;
@@ -639,13 +639,13 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon {
if (!dat->text_ignore_size_for_row_height)
{
- HANDLE hContact=pdnce->m_cache_hContact;
+ HANDLE hContact = pdnce->m_cache_hContact;
tmp = dat->fontModernInfo[g_clcPainter.GetBasicFontID(contact)].fontHeight;
if (dat->text_replace_smileys && dat->first_line_draw_smileys && !dat->text_resize_smileys)
{
tmp = max(tmp, contact->ssText.iMaxSmileyHeight);
}
- height += tmp;
+ height += tmp;
if (!minimalistic && dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0])
{
@@ -654,7 +654,7 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon {
tmp = max(tmp, pdnce->ssSecondLine.iMaxSmileyHeight);
}
- height += dat->second_line_top_space + tmp;
+ height += dat->second_line_top_space + tmp;
}
if (!minimalistic && dat->third_line_show && pdnce->szThirdLineText && pdnce->szThirdLineText[0])
@@ -664,7 +664,7 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon {
tmp = max(tmp, pdnce->ssThirdLine.iMaxSmileyHeight);
}
- height += dat->third_line_top_space + tmp;
+ height += dat->third_line_top_space + tmp;
}
}
@@ -672,17 +672,17 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon if (dat->avatars_show && !dat->avatars_ignore_size_for_row_height &&
contact->type == CLCIT_CONTACT &&
(
- (dat->use_avatar_service && contact->avatar_data != NULL) ||
- (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE)
+ (dat->use_avatar_service && contact->avatar_data !=NULL) ||
+ (!dat->use_avatar_service && contact->avatar_pos !=AVATAR_POS_DONT_HAVE)
) && !minimalistic )
{
height = max(height, dat->avatars_maxheight_size);
}
// Checkbox size
- if ((style&CLS_CHECKBOXES && contact->type==CLCIT_CONTACT) ||
- (style&CLS_GROUPCHECKBOXES && contact->type==CLCIT_GROUP) ||
- (contact->type==CLCIT_INFO && contact->flags&CLCIIF_CHECKBOX))
+ if ((style&CLS_CHECKBOXES && contact->type == CLCIT_CONTACT) ||
+ (style&CLS_GROUPCHECKBOXES && contact->type == CLCIT_GROUP) ||
+ (contact->type == CLCIT_INFO && contact->flags&CLCIIF_CHECKBOX))
{
height = max(height, dat->checkboxSize);
}
@@ -691,10 +691,10 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon if (!dat->icon_ignore_size_for_row_height)
{
if (contact->type == CLCIT_GROUP
- || (contact->type == CLCIT_CONTACT && contact->iImage != -1
+ || (contact->type == CLCIT_CONTACT && contact->iImage !=-1
&& !(dat->icon_hide_on_avatar && dat->avatars_show
- && ( (dat->use_avatar_service && contact->avatar_data != NULL) ||
- (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE)
+ && ( (dat->use_avatar_service && contact->avatar_data !=NULL) ||
+ (!dat->use_avatar_service && contact->avatar_pos !=AVATAR_POS_DONT_HAVE)
)
&& !contact->image_is_special)))
{
@@ -702,7 +702,7 @@ int RowHeights_GetRowHeight_worker(struct ClcData *dat, HWND hwnd, struct ClcCon }
}
- height += 2 * dat->row_border;
+ height += 2 * dat->row_border;
// Min size
height = max(height, dat->row_min_heigh);
@@ -724,12 +724,12 @@ int cliGetRowTopY(struct ClcData *dat, int item) {
int i;
int y = 0;
- if (item >= dat->row_heights_size)
+ if (item >= dat->row_heights_size)
return cliGetRowBottomY(dat,item-1);
for (i = 0 ; i < item ; i++)
{
- y += dat->row_heights[i];
+ y += dat->row_heights[i];
}
return y;
@@ -742,12 +742,12 @@ int cliGetRowBottomY(struct ClcData *dat, int item) int i;
int y = 0;
- if (item >= dat->row_heights_size)
+ if (item >= dat->row_heights_size)
return -1;
for (i = 0 ; i <= item ; i++)
{
- y += dat->row_heights[i];
+ y += dat->row_heights[i];
}
return y;
@@ -762,7 +762,7 @@ int cliGetRowTotalHeight(struct ClcData *dat) for (i = 0 ; i < dat->row_heights_size ; i++)
{
- y += dat->row_heights[i];
+ y += dat->row_heights[i];
}
return y;
@@ -779,7 +779,7 @@ int cliRowHitTest(struct ClcData *dat, int pos_y) for (i = 0 ; i < dat->row_heights_size ; i++)
{
- y += dat->row_heights[i];
+ y += dat->row_heights[i];
if (pos_y < y)
return i;
@@ -790,7 +790,7 @@ int cliRowHitTest(struct ClcData *dat, int pos_y) int cliGetRowHeight(struct ClcData *dat, int item)
{
- if ( item >= dat->row_heights_size || item <0 )
+ if ( item >= dat->row_heights_size || item < 0 )
return dat->max_row_height;
return dat->row_heights[ item ];
}
diff --git a/plugins/Clist_modern/modern_rowtemplateopt.cpp b/plugins/Clist_modern/modern_rowtemplateopt.cpp index 5d97c201f7..4178d17215 100644 --- a/plugins/Clist_modern/modern_rowtemplateopt.cpp +++ b/plugins/Clist_modern/modern_rowtemplateopt.cpp @@ -37,11 +37,11 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti); static char* rowOptTmplStr;
static ROWCELL* rowOptTmplRoot;
static ROWCELL* rowOptTA[100];
- TCHAR *types[]={_T("none"), _T("text1"), _T("text2"), _T("text3"), _T("status"),
+ TCHAR *types[] = {_T("none"), _T("text1"), _T("text2"), _T("text3"), _T("status"),
_T("avatar"), _T("extra"), _T("extra1"), _T("extra2"), _T("extra3"),
_T("extra4"), _T("extra5"), _T("extra6"), _T("extra7"), _T("extra8"),
_T("extra9"), _T("time"), _T("space"), _T("fspace")};
-RECT da={205,58,440,130}; // Draw area
+RECT da = {205,58,440,130}; // Draw area
// Add by ZorG
//char * rowOptBuildTmpl(HTREEITEM node, HWND htree)
@@ -63,7 +63,7 @@ void rowOptShowSettings(HWND hwnd) int param;
tvi.hItem = node;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
TreeView_GetItem(GetDlgItem(hwnd, IDC_ROWTREE), &tvi);
cell = (pROWCELL)tvi.lParam;
@@ -89,7 +89,7 @@ void rowOptShowSettings(HWND hwnd) EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,1);
EnableWindow(GetDlgItem(hwnd,IDC_CONTLAYER),1);
- if (cell->type != TC_SPACE && cell->type != TC_FIXED)
+ if (cell->type !=TC_SPACE && cell->type !=TC_FIXED)
{
EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,0);
EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),0);
@@ -151,19 +151,19 @@ void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd) if (!cell) return;
- tvis.hParent=node;
- tvis.hInsertAfter=TVI_LAST;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvis.item.stateMask=TVIS_STATEIMAGEMASK;
+ tvis.hParent = node;
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.lParam = (LPARAM)cell;
switch (cell->cont)
{
case TC_ROW:
- tvis.item.pszText=_T("Line");
+ tvis.item.pszText = _T("Line");
break;
case TC_COL:
- tvis.item.pszText=_T("Column");
+ tvis.item.pszText = _T("Column");
}
tvis.item.iImage = cell->child?1:2;
@@ -177,7 +177,7 @@ void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd) int rowOptFillRowTree(HWND hwnd)
{
- int i=0;
+ int i = 0;
TreeView_DeleteAllItems(hwnd);
rowOptGenerateTreeView(rowOptTmplRoot, NULL, hwnd);
TreeView_Expand(hwnd, TreeView_GetRoot(hwnd), TVM_EXPAND);
@@ -199,7 +199,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) rowAddCell(rowOptTmplRoot, TC_ROW);
tvis.hParent = NULL;
tvis.hInsertAfter = TVI_ROOT;
- tvis.item.pszText=_T("Line");
+ tvis.item.pszText = _T("Line");
tvis.item.lParam = (LPARAM)rowOptTmplRoot;
cell = rowOptTmplRoot;
}
@@ -233,14 +233,14 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti) cell = cell->child;
}
- tvis.hInsertAfter=TVI_LAST;
+ tvis.hInsertAfter = TVI_LAST;
}
tvis.item.lParam = (LPARAM)cell;
tvis.hParent = hti;
tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvis.item.stateMask=TVIS_STATEIMAGEMASK;
+ tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.iImage = 2;
tvis.item.iSelectedImage = 2;
@@ -271,7 +271,7 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti) // Get current tree item
tvi.hItem = hti;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
TreeView_GetItem(htree, &tvi);
tvpi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
@@ -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))
{
@@ -333,41 +333,41 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti) {
HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
pROWCELL cell;
- TVITEM tvi={0};
- if (hti==NULL) hti = TreeView_GetRoot(htree);
+ TVITEM tvi = {0};
+ if (hti == NULL) hti = TreeView_GetRoot(htree);
while (hti)
{
tvi.hItem = hti;
- tvi.mask=TVIF_HANDLE;//|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_TEXT;
+ tvi.mask = TVIF_HANDLE;//|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_TEXT;
TreeView_GetItem(htree, &tvi);
cell = (pROWCELL)tvi.lParam;
if (cell)
{
- TCHAR buf[200]={0};
+ TCHAR buf[200] = {0};
if (!cell->child)
{
- if (cell->type==0)
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont==TC_COL?TranslateT("column"):TranslateT("line"));
+ if (cell->type == 0)
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Empty %s cell"), cell->cont == TC_COL?TranslateT("column"):TranslateT("line"));
else
mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s"), TranslateTS(types[cell->type]));
}
else
{
- if (cell->type==0)
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s"), cell->cont!=TC_COL?TranslateT("columns"):TranslateT("lines"));
+ if (cell->type == 0)
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s"), cell->cont != TC_COL?TranslateT("columns"):TranslateT("lines"));
else
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s, contain %s"), TranslateTS(types[cell->type]),cell->cont!=TC_COL?TranslateT("columns"):TranslateT("lines"));
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("%s, contain %s"), TranslateTS(types[cell->type]),cell->cont != TC_COL?TranslateT("columns"):TranslateT("lines"));
}
if (cell->layer) _tcsncat(buf,TranslateT(" layered"),SIZEOF(buf));
- tvi.mask=TVIF_HANDLE|TVIF_TEXT;
- tvi.pszText=buf;
+ tvi.mask = TVIF_HANDLE|TVIF_TEXT;
+ tvi.pszText = buf;
TreeView_SetItem(htree,&tvi);
}
{
- HTREEITEM child_hti=TreeView_GetChild(htree,hti);
+ HTREEITEM child_hti = TreeView_GetChild(htree,hti);
if (child_hti) RefreshTree(hwndDlg,child_hti);
}
- hti=TreeView_GetNextSibling(htree,hti);
+ hti = TreeView_GetNextSibling(htree,hti);
}
RedrawWindow(hwndDlg,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
@@ -379,15 +379,15 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
case WM_INITDIALOG:
{
- int hbuf=0, seq=0;
+ int hbuf = 0, seq = 0;
HWND htree = GetDlgItem(hwndDlg,IDC_ROWTREE);
TranslateDialogDefault(hwndDlg);
- rowOptTmplStr = db_get_sa(NULL, "ModernData", "RowTemplate");
- if (!rowOptTmplStr) rowOptTmplStr=mir_strdup("<TR />");
+ rowOptTmplStr = db_get_sa(NULL, "ModernData", "RowTemplate");
+ if (!rowOptTmplStr) rowOptTmplStr = mir_strdup(" < TR />");
{
//HIMAGELIST himlTreeIcons;
- //himlTreeIcons=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,3,2);
+ //himlTreeIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,3,2);
//ImageList_AddIcon(himlTreeIcons,LoadSmallIconShared(g_hInst,MAKEINTRESOURCE(IDI_ROWCONT1)));
//ImageList_AddIcon(himlTreeIcons,LoadSmallIconShared(g_hInst,MAKEINTRESOURCE(IDI_ROWCONT2)));
//ImageList_AddIcon(himlTreeIcons,LoadSmallIconShared(g_hInst,MAKEINTRESOURCE(IDI_ROWCONT3)));
@@ -400,9 +400,9 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
int i, item;
- for (i=0; i<SIZEOF(types); i++)
+ for (i = 0; i < SIZEOF(types); i++)
{
- item=SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_ADDSTRING,0,(LPARAM)TranslateTS(types[i]));
+ item = SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_ADDSTRING,0,(LPARAM)TranslateTS(types[i]));
SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETITEMDATA,item,(LPARAM)0);
}
SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETCURSEL,0,0);
@@ -410,10 +410,10 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
int i, item;
- TCHAR *alignment[]={_T("left"), _T("hCenter"), _T("right")};
- for (i=0; i<SIZEOF(alignment); i++)
+ TCHAR *alignment[] = {_T("left"), _T("hCenter"), _T("right")};
+ for (i = 0; i < SIZEOF(alignment); i++)
{
- item=SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(alignment[i]));
+ item = SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(alignment[i]));
SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETITEMDATA,item,(LPARAM)0);
}
SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETCURSEL,0,0);
@@ -422,10 +422,10 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
int i, item;
- TCHAR *alignment[]={_T("top"), _T("vCenter"), _T("bottom")};
- for (i=0; i<SIZEOF(alignment); i++)
+ TCHAR *alignment[] = {_T("top"), _T("vCenter"), _T("bottom")};
+ for (i = 0; i < SIZEOF(alignment); i++)
{
- item=SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(alignment[i]));
+ item = SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(alignment[i]));
SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETITEMDATA,item,(LPARAM)0);
}
SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETCURSEL,0,0);
@@ -450,28 +450,28 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM {
HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
pROWCELL cell;
- TVITEM tvi={0};
+ TVITEM tvi = {0};
HTREEITEM hti = TreeView_GetSelection(htree);
tvi.hItem = hti;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
TreeView_GetItem(htree, &tvi);
cell = (pROWCELL)tvi.lParam;
switch (LOWORD(wParam))
{
case IDC_CONTTYPE:
- if(HIWORD(wParam)==CBN_SELENDOK)
+ if (HIWORD(wParam) == CBN_SELENDOK)
{
- TVITEM tv={0};
- int index=SendMessage(GetDlgItem(hwndDlg,IDC_CONTTYPE),CB_GETCURSEL, 0, 0);
+ TVITEM tv = {0};
+ int index = SendMessage(GetDlgItem(hwndDlg,IDC_CONTTYPE),CB_GETCURSEL, 0, 0);
cell->type = index;
RefreshTree(hwndDlg,NULL);
}
case IDC_VALIGN:
- if(HIWORD(wParam)==CBN_SELENDOK)
+ if (HIWORD(wParam) == CBN_SELENDOK)
{
switch (SendMessage(GetDlgItem(hwndDlg,IDC_VALIGN),CB_GETCURSEL, 0, 0))
{
@@ -489,7 +489,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
case IDC_HALIGN:
- if(HIWORD(wParam)==CBN_SELENDOK)
+ if (HIWORD(wParam) == CBN_SELENDOK)
{
switch (SendMessage(GetDlgItem(hwndDlg,IDC_HALIGN),CB_GETCURSEL, 0, 0))
{
@@ -509,24 +509,24 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
- if (HIWORD(wParam)==BN_CLICKED)
+ if (HIWORD(wParam) == BN_CLICKED)
{
- if (lParam==(LPARAM)GetDlgItem(hwndDlg,IDC_ADDCONTAINER))
+ if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_ADDCONTAINER))
// Adding new container
{
rowOptAddContainer(htree, hti);
}
- else if (lParam==(LPARAM)GetDlgItem(hwndDlg,IDC_DELCONTAINER))
+ else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_DELCONTAINER))
// Deleting container
{
rowOptDelContainer(htree, hti);
}
- else if (lParam==(LPARAM)GetDlgItem(hwndDlg,IDC_CONTUP))
+ else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_CONTUP))
// Moving container to up
{
RedrawWindow(htree,&da,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
- else if (lParam==(LPARAM)GetDlgItem(hwndDlg,IDC_CONTDOWN))
+ else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_CONTDOWN))
// Moving container to down
{
}
@@ -558,7 +558,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case WM_PAINT:
{
- int i=0;
+ int i = 0;
// Drawning row template at properties page
PAINTSTRUCT ps;
@@ -569,7 +569,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM hdc = BeginPaint(hwndDlg, &ps);
curItem.hItem = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_ROWTREE));
- curItem.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ curItem.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_ROWTREE), &curItem);
while(rowOptTA[i])
@@ -635,7 +635,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM case TC_SPACE:
case TC_FIXED:
case 0:
- //if (rowOptTA[i] != (pROWCELL)curItem.lParam)
+ //if (rowOptTA[i] !=(pROWCELL)curItem.lParam)
continue;
}
Rectangle(hdc,
@@ -673,8 +673,8 @@ BOOL CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP }
case WM_COMMAND:
{
- //LOWORD(wParam)==IDC_control
- //HIWORD(wParam)==Message
+ //LOWORD(wParam) == IDC_control
+ //HIWORD(wParam) == Message
//SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
}
diff --git a/plugins/Clist_modern/modern_skinbutton.cpp b/plugins/Clist_modern/modern_skinbutton.cpp index 3d5208f997..f15b8ee633 100644 --- a/plugins/Clist_modern/modern_skinbutton.cpp +++ b/plugins/Clist_modern/modern_skinbutton.cpp @@ -34,8 +34,8 @@ This file contains code related to new modern free positioned skinned buttons #define MODERNSKINBUTTONCLASS "MirandaModernSkinButtonClass"
-BOOL ModernSkinButtonModuleIsLoaded=FALSE;
-static HANDLE hookSystemShutdown_ModernSkinButton=NULL;
+BOOL ModernSkinButtonModuleIsLoaded = FALSE;
+static HANDLE hookSystemShutdown_ModernSkinButton = NULL;
static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam);
int SkinSelector_DeleteMask(MODERNMASK * mm);
@@ -85,8 +85,8 @@ int ModernSkinButtonLoadModule() wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
InitializeCriticalSection(&csTips);
- hookSystemShutdown_ModernSkinButton=ModernHookEvent(ME_SYSTEM_SHUTDOWN, ModernSkinButtonUnloadModule);
- ModernSkinButtonModuleIsLoaded=TRUE;
+ hookSystemShutdown_ModernSkinButton = ModernHookEvent(ME_SYSTEM_SHUTDOWN, ModernSkinButtonUnloadModule);
+ ModernSkinButtonModuleIsLoaded = TRUE;
return 0;
}
@@ -102,65 +102,65 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) HDC hdc;
HBITMAP bmp,oldbmp;
RECT rc;
- HDC sdc=NULL;
- ModernSkinButtonCtrl* bct = (ModernSkinButtonCtrl *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ 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 (whdc && g_CluiData.fLayered) hdc=whdc;
+ if (whdc && g_CluiData.fLayered) hdc = whdc;
else
{
- //sdc=GetWindowDC(GetParent(hwnd));
- hdc=CreateCompatibleDC(NULL);
+ //sdc = GetWindowDC(GetParent(hwnd));
+ hdc = CreateCompatibleDC(NULL);
}
GetClientRect(hwnd,&rc);
- bmp=ske_CreateDIB32(rc.right,rc.bottom);
- oldbmp=(HBITMAP)SelectObject(hdc,bmp);
+ bmp = ske_CreateDIB32(rc.right,rc.bottom);
+ oldbmp = (HBITMAP)SelectObject(hdc,bmp);
if (!g_CluiData.fLayered)
ske_BltBackImage(bct->hwnd,hdc,NULL);
{
- MODERNMASK Request={0};
+ MODERNMASK Request = {0};
// int res;
- //HBRUSH br=CreateSolidBrush(RGB(255,255,255));
- char * Value=NULL;
- DWORD val=0;
+ //HBRUSH br = CreateSolidBrush(RGB(255,255,255));
+ char * Value = NULL;
+ DWORD val = 0;
{
if (bct->ValueDBSection && bct->ValueTypeDef)
{
char * key;
char * section;
- DWORD defval=0;
+ DWORD defval = 0;
char buf[20];
- key=mir_strdup(bct->ValueDBSection);
- section=key;
- if (bct->ValueTypeDef[0]!='s')
- defval=(DWORD)atol(bct->ValueTypeDef+1);
+ key = mir_strdup(bct->ValueDBSection);
+ section = key;
+ if (bct->ValueTypeDef[0] != 's')
+ defval = (DWORD)atol(bct->ValueTypeDef+1);
do
{
- if (key[0]=='/') {key[0]='\0'; key++; break;}
+ if (key[0] == '/') {key[0] = '\0'; key++; break;}
key++;
- } while (key[0]!='\0');
+ } while (key[0] != '\0');
switch (bct->ValueTypeDef[0])
{
case 's':
{
- Value= db_get_sa(NULL,section,key);
+ Value = db_get_sa(NULL,section,key);
if (!Value)
- Value=mir_strdup(bct->ValueTypeDef+1);
+ Value = mir_strdup(bct->ValueTypeDef+1);
break;
}
case 'd':
- defval=db_get_dw(NULL,section,key,defval);
- Value=mir_strdup(_ltoa(defval,buf,SIZEOF(buf)));
+ defval = db_get_dw(NULL,section,key,defval);
+ Value = mir_strdup(_ltoa(defval,buf,SIZEOF(buf)));
break;
case 'w':
- defval=db_get_w(NULL,section,key,defval);
- Value=mir_strdup(_ltoa(defval,buf,SIZEOF(buf)));
+ defval = db_get_w(NULL,section,key,defval);
+ Value = mir_strdup(_ltoa(defval,buf,SIZEOF(buf)));
break;
case 'b':
- defval=db_get_b(NULL,section,key,defval);
- Value=mir_strdup(_ltoa(defval,buf,SIZEOF(buf)));
+ defval = db_get_b(NULL,section,key,defval);
+ Value = mir_strdup(_ltoa(defval,buf,SIZEOF(buf)));
break;
}
mir_free_and_nill(section);
@@ -191,7 +191,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) }
if (whdc && !g_CluiData.fLayered)
{
- RECT r={0};
+ RECT r = {0};
GetClientRect(bct->hwnd,&r);
BitBlt(whdc,0,0,r.right,r.bottom,hdc,0,0,SRCCOPY);
}
@@ -217,56 +217,56 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDe char * val2;
char * Value;
long l1,l2,curval;
- DWORD defval=0;
+ DWORD defval = 0;
// char buf[20];
- key=mir_strdup(ValueDBSection);
- section=key;
+ key = mir_strdup(ValueDBSection);
+ section = key;
do
{
- if (key[0]=='/') {key[0]='\0'; key++; break;}
+ if (key[0] == '/') {key[0] = '\0'; key++; break;}
key++;
- } while (key[0]!='\0');
+ } while (key[0] != '\0');
- val=mir_strdup(ValueTypeDef+1);
- val2=val;
+ val = mir_strdup(ValueTypeDef+1);
+ val2 = val;
do
{
- if (val2[0]=='/') {val2[0]='\0'; val2++; break;}
+ if (val2[0] == '/') {val2[0] = '\0'; val2++; break;}
val2++;
- } while (val2[0]!='\0');
+ } while (val2[0] != '\0');
- if (ValueTypeDef[0]!='s')
+ if (ValueTypeDef[0] != 's')
{
- l1=(DWORD)atol(val);
- l2=(DWORD)atol(val2);
+ l1 = (DWORD)atol(val);
+ l2 = (DWORD)atol(val2);
}
switch (ValueTypeDef[0])
{
case 's':
{
- Value= db_get_sa(NULL,section,key);
+ Value = db_get_sa(NULL,section,key);
if (!Value ||(Value && mir_bool_strcmpi(Value,val2)))
- Value=mir_strdup(val);
+ Value = mir_strdup(val);
else
- Value=mir_strdup(val2);
+ Value = mir_strdup(val2);
db_set_s(NULL,section,key,Value);
mir_free_and_nill(Value);
break;
}
case 'd':
- curval=db_get_dw(NULL,section,key,l2);
- curval=(curval==l2)?l1:l2;
+ curval = db_get_dw(NULL,section,key,l2);
+ curval = (curval == l2)?l1:l2;
db_set_dw(NULL,section,key,(DWORD)curval);
break;
case 'w':
- curval=db_get_w(NULL,section,key,l2);
- curval=(curval==l2)?l1:l2;
+ curval = db_get_w(NULL,section,key,l2);
+ curval = (curval == l2)?l1:l2;
db_set_w(NULL,section,key,(WORD)curval);
break;
case 'b':
- curval=db_get_b(NULL,section,key,l2);
- curval=(curval==l2)?l1:l2;
+ curval = db_get_b(NULL,section,key,l2);
+ curval = (curval == l2)?l1:l2;
db_set_b(NULL,section,key,(BYTE)curval);
break;
}
@@ -278,13 +278,13 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDe static char *_skipblank(char * str) //str will be modified;
{
- char * endstr=str+strlen(str);
- while ((*str==' ' || *str=='\t') && *str!='\0') str++;
- while ((*endstr==' ' || *endstr=='\t') && *endstr!='\0' && endstr<str) endstr--;
- if (*endstr!='\0')
+ char * endstr = str+strlen(str);
+ while ((*str == ' ' || *str == '\t') && *str != '\0') str++;
+ while ((*endstr == ' ' || *endstr == '\t') && *endstr != '\0' && endstr < str) endstr--;
+ if (*endstr != '\0')
{
endstr++;
- *endstr='\0';
+ *endstr = '\0';
}
return str;
}
@@ -292,65 +292,65 @@ static char *_skipblank(char * str) //str will be modified; static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
{
char * pszService;
- char * param1=NULL;
- char * param2=NULL;
- int paramCount=0;
- int result=0;
- pszService=mir_strdup(toParce);
- param2=strrchr(pszService, '%');
+ char * param1 = NULL;
+ char * param2 = NULL;
+ int paramCount = 0;
+ int result = 0;
+ pszService = mir_strdup(toParce);
+ param2 = strrchr(pszService, '%');
if (param2)
{
paramCount++;
- *param2='\0'; param2++;
+ *param2 = '\0'; param2++;
_skipblank(param2);
- if (strlen(param2)==0) param2=NULL;
+ if (strlen(param2) == 0) param2 = NULL;
}
- param1=strrchr(pszService, '%');
+ param1 = strrchr(pszService, '%');
if (param1)
{
paramCount++;
- *param1='\0'; param1++;
+ *param1 = '\0'; param1++;
_skipblank(param1);
- if (strlen(param1)==0) param1=NULL;
+ if (strlen(param1) == 0) param1 = NULL;
}
if (!pszService) return 0;
- if (strlen(pszService)==0)
+ if (strlen(pszService) == 0)
{
mir_free(pszService);
return 0;
}
- if (param1 && *param1=='\"')
+ if (param1 && *param1 == '\"')
{
param1++;
- *(param1+strlen(param1))='\0';
+ *(param1+strlen(param1)) = '\0';
}
else if (param1)
{
- param1=(char*)atoi(param1);
+ param1 = (char*)atoi(param1);
}
- if (param2 && *param2=='\"')
+ if (param2 && *param2 == '\"')
{
param2++;
- *(param2+strlen(param2))='\0';
+ *(param2+strlen(param2)) = '\0';
}
else if (param2)
- param2=(char*)atoi(param2);
+ param2 = (char*)atoi(param2);
- if (paramCount==1)
+ if (paramCount == 1)
{
- param1=param2;
- param2=NULL;
+ param1 = param2;
+ param2 = NULL;
}
if (!ServiceExists(pszService))
{
- result=0;
+ result = 0;
}
else
{
- int ret=0;
- result=1;
- ret=CallService(pszService, (WPARAM)param1, (WPARAM)param2);
- if (Return) *Return=ret;
+ int ret = 0;
+ result = 1;
+ ret = CallService(pszService, (WPARAM)param1, (WPARAM)param2);
+ if (Return) *Return = ret;
}
mir_free(pszService);
return result;
@@ -359,21 +359,21 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return) static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- ModernSkinButtonCtrl* bct = (msg!=WM_NCCREATE)?(ModernSkinButtonCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA):0;
+ ModernSkinButtonCtrl* bct = (msg != WM_NCCREATE)?(ModernSkinButtonCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA):0;
if (bct && bct->HandleService && IsBadStringPtrA(bct->HandleService,255))
- bct->HandleService=NULL;
+ bct->HandleService = NULL;
if (bct)
if (bct->HandleService)
if (ServiceExists(bct->HandleService))
{
int t;
- HandleServiceParams MSG={0};
- MSG.hwnd=hwndDlg;
- MSG.msg=msg;
- MSG.wParam=wParam;
- MSG.lParam=lParam;
- t=CallService(bct->HandleService,(WPARAM)&MSG,0);
+ HandleServiceParams MSG = {0};
+ MSG.hwnd = hwndDlg;
+ MSG.msg = msg;
+ MSG.wParam = wParam;
+ MSG.lParam = lParam;
+ t = CallService(bct->HandleService,(WPARAM)&MSG,0);
if (MSG.handled) return t;
}
switch(msg)
@@ -399,7 +399,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM if (SendMessage(hwndToolTips, TTM_GETTOOLINFO, 0, (LPARAM)&ti)) {
SendMessage(hwndToolTips, TTM_DELTOOL, 0, (LPARAM)&ti);
}
- if (SendMessage(hwndToolTips, TTM_GETTOOLCOUNT, 0, (LPARAM)&ti)==0) {
+ if (SendMessage(hwndToolTips, TTM_GETTOOLCOUNT, 0, (LPARAM)&ti) == 0) {
DestroyWindow(hwndToolTips);
hwndToolTips = NULL;
}
@@ -436,7 +436,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM {
if (IsWindowVisible(hwndDlg) && !g_CluiData.fLayered)
{
- PAINTSTRUCT ps={0};
+ PAINTSTRUCT ps = {0};
BeginPaint(hwndDlg,&ps);
ModernSkinButtonPaintWorker(hwndDlg,(HDC)ps.hdc);
EndPaint(hwndDlg,&ps);
@@ -445,8 +445,8 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM }
case WM_CAPTURECHANGED:
{
- bct->hover=0;
- bct->down=0;
+ bct->hover = 0;
+ bct->down = 0;
ModernSkinButtonPaintWorker(bct->hwnd,0);
// KillTimer(bct->hwnd,1234);
break;
@@ -455,10 +455,10 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM // {
// POINT t;
// GetCursorPos(&t);
- // if (bct->hover && WindowFromPoint(t)!=bct->hwnd)
+ // if (bct->hover && WindowFromPoint(t) != bct->hwnd)
// {
// KillTimer(bct->hwnd,1234);
- // bct->hover=0;
+ // bct->hover = 0;
// ReleaseCapture();
// PaintWorker(bct->hwnd,0);
// }
@@ -469,7 +469,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM if (!bct->hover)
{
SetCapture(bct->hwnd);
- bct->hover=1;
+ bct->hover = 1;
//KillTimer(bct->hwnd,1234);
//CLUI_SafeSetTimer(bct->hwnd,1234,100,NULL);
ModernSkinButtonPaintWorker(bct->hwnd,0);
@@ -478,10 +478,10 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM else
{
POINT t;
- t.x=LOWORD(lParam);
- t.y=HIWORD(lParam);
+ t.x = LOWORD(lParam);
+ t.y = HIWORD(lParam);
ClientToScreen(bct->hwnd,&t);
- if (WindowFromPoint(t)!=bct->hwnd)
+ if (WindowFromPoint(t) != bct->hwnd)
ReleaseCapture();
return 0;
}
@@ -492,11 +492,11 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM {
//KillTimer(bct->hwnd,1234);
//CLUI_SafeSetTimer(bct->hwnd,1234,100,NULL);
- bct->down=1;
+ bct->down = 1;
SetForegroundWindow(GetParent(bct->hwnd));
ModernSkinButtonPaintWorker(bct->hwnd,0);
if (bct && bct->CommandService && IsBadStringPtrA(bct->CommandService,255))
- bct->CommandService=NULL;
+ bct->CommandService = NULL;
if (bct->fCallOnPress)
{
if (bct->CommandService)
@@ -505,7 +505,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM if (!_CallServiceStrParams(bct->CommandService, NULL)&& (bct->ValueDBSection && bct->ValueTypeDef))
ModernSkinButtonToggleDBValue(bct->ValueDBSection,bct->ValueTypeDef);
}
- bct->down=0;
+ bct->down = 0;
ModernSkinButtonPaintWorker(bct->hwnd,0);
}
@@ -518,11 +518,11 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM //KillTimer(bct->hwnd,1234);
//CLUI_SafeSetTimer(bct->hwnd,1234,100,NULL);
ReleaseCapture();
- bct->hover=0;
- bct->down=0;
+ bct->hover = 0;
+ bct->down = 0;
ModernSkinButtonPaintWorker(bct->hwnd,0);
if (bct && bct->CommandService && IsBadStringPtrA(bct->CommandService,255))
- bct->CommandService=NULL;
+ bct->CommandService = NULL;
if (bct->CommandService)
if (_CallServiceStrParams(bct->CommandService, NULL))
{}
@@ -565,7 +565,7 @@ HWND SetToolTip(HWND hwnd, TCHAR * tip) }
ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS;
ti.uId = (UINT_PTR)hwnd;
- ti.lpszText=(TCHAR*)tip;
+ ti.lpszText = (TCHAR*)tip;
SendMessage(hwndToolTips,TTM_ADDTOOL,0,(LPARAM)&ti);
LeaveCriticalSection(&csTips);
@@ -577,14 +577,14 @@ HWND SetToolTip(HWND hwnd, TCHAR * tip) typedef struct _MButton
{
HWND hwnd;
- BYTE ConstrainPositionFrom; //(BBRRTTLL) L=0 - from left, L=1 from right, L=2 from center
+ BYTE ConstrainPositionFrom; //(BBRRTTLL) L = 0 - from left, L = 1 from right, L = 2 from center
int OrL,OrR,OrT,OrB;
int minW,minH;
ModernSkinButtonCtrl * bct;
} MButton;
-MButton * Buttons=NULL;
-DWORD ButtonsCount=0;
+MButton * Buttons = NULL;
+DWORD ButtonsCount = 0;
#define _center_h( rc ) (( (rc)->right + (rc)->left ) >> 1)
#define _center_v( rc ) (( (rc)->bottom + (rc)->top ) >> 1)
@@ -607,53 +607,53 @@ int ModernSkinButton_AddButton(HWND parent, // if (!parent) return 0;
if (!ModernSkinButtonModuleIsLoaded) return 0;
if (!Buttons)
- Buttons=(MButton*)mir_alloc(sizeof(MButton));
+ Buttons = (MButton*)mir_alloc(sizeof(MButton));
else
- Buttons=(MButton*)mir_realloc(Buttons,sizeof(MButton)*(ButtonsCount+1));
+ Buttons = (MButton*)mir_realloc(Buttons,sizeof(MButton)*(ButtonsCount+1));
{
//HWND hwnd;
- RECT rc={0};
+ RECT rc = {0};
ModernSkinButtonCtrl* bct;
int l,r,b,t;
if (parent) GetClientRect(parent,&rc);
- l=( sbFlags & SBF_ALIGN_TL_RIGHT ) ? ( rc.right + Left ) :
+ l = ( sbFlags & SBF_ALIGN_TL_RIGHT ) ? ( rc.right + Left ) :
( sbFlags & SBF_ALIGN_TL_HCENTER ) ? ( _center_h( &rc ) + Left ) :
( rc.left + Left );
- t=( sbFlags & SBF_ALIGN_TL_BOTTOM ) ? ( rc.bottom + Top ) :
+ t = ( sbFlags & SBF_ALIGN_TL_BOTTOM ) ? ( rc.bottom + Top ) :
( sbFlags & SBF_ALIGN_TL_VCENTER ) ? ( _center_v( &rc ) + Top ) :
( rc.top+Top );
- r=( sbFlags & SBF_ALIGN_BR_RIGHT ) ? ( rc.right + Right ) :
+ r = ( sbFlags & SBF_ALIGN_BR_RIGHT ) ? ( rc.right + Right ) :
( sbFlags & SBF_ALIGN_BR_HCENTER ) ? ( _center_h( &rc) + Right ) :
( rc.left + Right );
- b=( sbFlags & SBF_ALIGN_BR_BOTTOM ) ? ( rc.bottom + Bottom ) :
+ b = ( sbFlags & SBF_ALIGN_BR_BOTTOM ) ? ( rc.bottom + Bottom ) :
( sbFlags & SBF_ALIGN_BR_VCENTER ) ? ( _center_v( &rc ) + Bottom ) :
( rc.top + Bottom );
- bct=(ModernSkinButtonCtrl *)mir_alloc(sizeof(ModernSkinButtonCtrl));
+ bct = (ModernSkinButtonCtrl *)mir_alloc(sizeof(ModernSkinButtonCtrl));
memset(bct,0,sizeof(ModernSkinButtonCtrl));
- bct->Left=l;
- bct->Right=r;
- bct->Top=t;
- bct->Bottom=b;
- bct->fCallOnPress=( sbFlags & SBF_CALL_ON_PRESS )!=0;
- bct->HandleService=mir_strdup(HandeService);
- bct->CommandService=mir_strdup(CommandService);
- bct->StateService=mir_strdup(StateDefService);
- if (DBkey && &DBkey!='\0') bct->ValueDBSection=mir_strdup(DBkey); else bct->ValueDBSection=NULL;
- if (TypeDef && &TypeDef!='\0') bct->ValueTypeDef=mir_strdup(TypeDef); else bct->ValueTypeDef=mir_strdup("sDefault");
- bct->ID=mir_strdup(ID);
- bct->Hint=mir_tstrdup(Hint);
- Buttons[ButtonsCount].bct=bct;
- Buttons[ButtonsCount].hwnd=NULL;
- Buttons[ButtonsCount].OrL=Left;
- Buttons[ButtonsCount].OrT=Top;
- Buttons[ButtonsCount].OrR=Right;
- Buttons[ButtonsCount].OrB=Bottom;
- Buttons[ButtonsCount].ConstrainPositionFrom=(BYTE)sbFlags;
- Buttons[ButtonsCount].minH=MinHeight;
- Buttons[ButtonsCount].minW=MinWidth;
+ bct->Left = l;
+ bct->Right = r;
+ bct->Top = t;
+ bct->Bottom = b;
+ bct->fCallOnPress = ( sbFlags & SBF_CALL_ON_PRESS ) != 0;
+ bct->HandleService = mir_strdup(HandeService);
+ bct->CommandService = mir_strdup(CommandService);
+ bct->StateService = mir_strdup(StateDefService);
+ if (DBkey && &DBkey != '\0') bct->ValueDBSection = mir_strdup(DBkey); else bct->ValueDBSection = NULL;
+ if (TypeDef && &TypeDef != '\0') bct->ValueTypeDef = mir_strdup(TypeDef); else bct->ValueTypeDef = mir_strdup("sDefault");
+ bct->ID = mir_strdup(ID);
+ bct->Hint = mir_tstrdup(Hint);
+ Buttons[ButtonsCount].bct = bct;
+ Buttons[ButtonsCount].hwnd = NULL;
+ Buttons[ButtonsCount].OrL = Left;
+ Buttons[ButtonsCount].OrT = Top;
+ Buttons[ButtonsCount].OrR = Right;
+ Buttons[ButtonsCount].OrB = Bottom;
+ Buttons[ButtonsCount].ConstrainPositionFrom = (BYTE)sbFlags;
+ Buttons[ButtonsCount].minH = MinHeight;
+ Buttons[ButtonsCount].minW = MinWidth;
ButtonsCount++;
// CLUI_ShowWindowMod(hwnd,SW_SHOW);
}
@@ -671,9 +671,9 @@ static int ModernSkinButtonErase(int l,int t,int r, int b) if (!g_pCachedWindow->hImageDC ||!g_pCachedWindow->hBackDC) return 0;
if (!(l||r||t||b))
{
- for(i=0; i<ButtonsCount; i++)
+ for(i = 0; i < ButtonsCount; i++)
{
- if (pcli->hwndContactList && Buttons[i].hwnd!=NULL)
+ if (pcli->hwndContactList && Buttons[i].hwnd != NULL)
{
//TODO: Erase button
BitBlt(g_pCachedWindow->hImageDC,Buttons[i].bct->Left,Buttons[i].bct->Top,Buttons[i].bct->Right-Buttons[i].bct->Left,Buttons[i].bct->Bottom-Buttons[i].bct->Top,
@@ -692,11 +692,11 @@ static HWND ModernSkinButtonCreateWindow(ModernSkinButtonCtrl * bct, HWND parent {
HWND hwnd;
- if (bct==NULL) return FALSE;
+ if (bct == NULL) return FALSE;
{
TCHAR *UnicodeID;
- UnicodeID=mir_a2u(bct->ID);
- hwnd=CreateWindow(_T(MODERNSKINBUTTONCLASS),UnicodeID,WS_VISIBLE|WS_CHILD,bct->Left,bct->Top,bct->Right-bct->Left,bct->Bottom-bct->Top,parent,NULL,g_hInst,NULL);
+ UnicodeID = mir_a2u(bct->ID);
+ hwnd = CreateWindow(_T(MODERNSKINBUTTONCLASS),UnicodeID,WS_VISIBLE|WS_CHILD,bct->Left,bct->Top,bct->Right-bct->Left,bct->Bottom-bct->Top,parent,NULL,g_hInst,NULL);
mir_free(UnicodeID);
}
@@ -711,10 +711,10 @@ int ModernSkinButtonRedrawAll(HDC hdc) DWORD i;
if (!ModernSkinButtonModuleIsLoaded) return 0;
g_mutex_bLockUpdating++;
- for(i=0; i<ButtonsCount; i++)
+ for(i = 0; i < ButtonsCount; i++)
{
- if (pcli->hwndContactList && Buttons[i].hwnd==NULL)
- Buttons[i].hwnd=ModernSkinButtonCreateWindow(Buttons[i].bct,pcli->hwndContactList);
+ if (pcli->hwndContactList && Buttons[i].hwnd == NULL)
+ Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct,pcli->hwndContactList);
ModernSkinButtonPaintWorker(Buttons[i].hwnd,0);
}
g_mutex_bLockUpdating--;
@@ -724,10 +724,10 @@ int ModernSkinButtonDeleteAll() {
DWORD i;
if (!ModernSkinButtonModuleIsLoaded) return 0;
- for(i=0; i<ButtonsCount; i++)
+ for(i = 0; i < ButtonsCount; i++)
if (Buttons[i].hwnd) DestroyWindow(Buttons[i].hwnd);
if (Buttons) mir_free_and_nill(Buttons);
- ButtonsCount=0;
+ ButtonsCount = 0;
return 0;
}
@@ -737,39 +737,39 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT * r) RECT rc;
RECT clr;
RECT rd;
- BOOL altDraw=FALSE;
- static SIZE oldWndSize={0};
+ BOOL altDraw = FALSE;
+ static SIZE oldWndSize = {0};
if (!ModernSkinButtonModuleIsLoaded) return 0;
GetWindowRect(parent,&rd);
GetClientRect(parent,&clr);
if (!r)
GetWindowRect(parent,&rc);
else
- rc=*r;
+ rc = *r;
if (g_CluiData.fLayered && ( draw & SBRF_DO_ALT_DRAW ))
{
int sx,sy;
- sx=rd.right-rd.left;
- sy=rd.bottom-rd.top;
- if (sx!=oldWndSize.cx || sy!=oldWndSize.cy)
- altDraw=TRUE;//EraseButtons();
- oldWndSize.cx=sx;
- oldWndSize.cy=sy;
+ sx = rd.right-rd.left;
+ sy = rd.bottom-rd.top;
+ if (sx != oldWndSize.cx || sy != oldWndSize.cy)
+ altDraw = TRUE;//EraseButtons();
+ oldWndSize.cx = sx;
+ oldWndSize.cy = sy;
}
OffsetRect(&rc,-rc.left,-rc.top);
- rc.right=rc.left+(clr.right-clr.left);
- rc.bottom=rc.top+(clr.bottom-clr.top);
- for(i=0; i<ButtonsCount; i++)
+ rc.right = rc.left+(clr.right-clr.left);
+ rc.bottom = rc.top+(clr.bottom-clr.top);
+ for(i = 0; i < ButtonsCount; i++)
{
int l,r,b,t;
- RECT oldRect={0};
- int sbFlags=Buttons[i].ConstrainPositionFrom;
- if (parent && Buttons[i].hwnd==NULL)
+ RECT oldRect = {0};
+ int sbFlags = Buttons[i].ConstrainPositionFrom;
+ if (parent && Buttons[i].hwnd == NULL)
{
- Buttons[i].hwnd=ModernSkinButtonCreateWindow(Buttons[i].bct,parent);
- altDraw=FALSE;
+ Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct,parent);
+ altDraw = FALSE;
}
l = ( sbFlags & SBF_ALIGN_TL_RIGHT ) ? ( rc.right + Buttons[i].OrL ) :
@@ -789,25 +789,25 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT * r) ( rc.top + Buttons[i].OrB );
SetWindowPos(Buttons[i].hwnd,HWND_TOP,l,t,r-l,b-t,0);
- if ( (rc.right-rc.left<Buttons[i].minW /*&& Buttons[i].minW!=0*/)
- ||(rc.bottom-rc.top<Buttons[i].minH /*&& Buttons[i].minH!=0*/))
+ if ( (rc.right-rc.left < Buttons[i].minW /*&& Buttons[i].minW != 0*/)
+ ||(rc.bottom-rc.top < Buttons[i].minH /*&& Buttons[i].minH != 0*/))
CLUI_ShowWindowMod(Buttons[i].hwnd,SW_HIDE);
else
CLUI_ShowWindowMod(Buttons[i].hwnd,SW_SHOW);
if ((1 || altDraw)&&
- (Buttons[i].bct->Left!=l ||
- Buttons[i].bct->Top!=t ||
- Buttons[i].bct->Right!=r||
- Buttons[i].bct->Bottom!=b))
+ (Buttons[i].bct->Left != l ||
+ Buttons[i].bct->Top != t ||
+ Buttons[i].bct->Right != r||
+ Buttons[i].bct->Bottom != b))
{
//Need to erase in old location
ModernSkinButtonErase(Buttons[i].bct->Left,Buttons[i].bct->Top,Buttons[i].bct->Right,Buttons[i].bct->Bottom);
}
- Buttons[i].bct->Left=l;
- Buttons[i].bct->Top=t;
- Buttons[i].bct->Right=r;
- Buttons[i].bct->Bottom=b;
+ Buttons[i].bct->Left = l;
+ Buttons[i].bct->Top = t;
+ Buttons[i].bct->Right = r;
+ Buttons[i].bct->Bottom = b;
}
diff --git a/plugins/Clist_modern/modern_skineditor.cpp b/plugins/Clist_modern/modern_skineditor.cpp index 595ed0a835..6f00aebf5a 100644 --- a/plugins/Clist_modern/modern_skineditor.cpp +++ b/plugins/Clist_modern/modern_skineditor.cpp @@ -36,90 +36,90 @@ typedef struct _OPT_OBJECT_DATA char * szTempValue;
} OPT_OBJECT_DATA;
-static char *gl_Mask=NULL;
-HWND gl_Dlg=NULL;
-int gl_controlID=0;
+static char *gl_Mask = NULL;
+HWND gl_Dlg = NULL;
+int gl_controlID = 0;
int EnableGroup(HWND hwndDlg, HWND first, BOOL bEnable);
int ShowGroup(HWND hwndDlg, HWND first, BOOL bEnable);
-BOOL glOtherSkinWasLoaded=FALSE;
-BYTE glSkinWasModified=0; //1- but not applied, 2-stored to DB
+BOOL glOtherSkinWasLoaded = FALSE;
+BYTE glSkinWasModified = 0; //1- but not applied, 2-stored to DB
HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, char * Caption)
{
- HTREEITEM res=NULL, tmp=NULL;
+ HTREEITEM res = NULL, tmp = NULL;
if (Parent)
- tmp=TreeView_GetChild(hTree,Parent);
+ tmp = TreeView_GetChild(hTree,Parent);
else
- tmp=TreeView_GetRoot(hTree);
+ tmp = TreeView_GetRoot(hTree);
while (tmp)
{
TVITEMA tvi;
char buf[255];
- tvi.hItem=tmp;
- tvi.mask=TVIF_TEXT|TVIF_HANDLE;
- tvi.pszText=(LPSTR)&buf;
- tvi.cchTextMax=254;
+ tvi.hItem = tmp;
+ tvi.mask = TVIF_TEXT|TVIF_HANDLE;
+ tvi.pszText = (LPSTR)&buf;
+ tvi.cchTextMax = 254;
TreeView_GetItemA(hTree,&tvi);
if (mir_bool_strcmpi(Caption,tvi.pszText))
return tmp;
- tmp=TreeView_GetNextSibling(hTree,tmp);
+ tmp = TreeView_GetNextSibling(hTree,tmp);
}
return tmp;
}
int TreeAddObject(HWND hwndDlg, int ID, OPT_OBJECT_DATA * data)
{
- HTREEITEM rootItem=NULL;
- HTREEITEM cItem=NULL;
+ HTREEITEM rootItem = NULL;
+ HTREEITEM cItem = NULL;
char * path;
char * ptr;
char * ptrE;
char buf[255];
- BOOL ext=FALSE;
- path=data->szPath?mir_strdup(data->szPath):(data->szName[1]=='$')?mir_strdup((data->szName)+2):NULL;
+ BOOL ext = FALSE;
+ path = data->szPath?mir_strdup(data->szPath):(data->szName[1] == '$')?mir_strdup((data->szName)+2):NULL;
if (!path)
{
mir_snprintf(buf,SIZEOF(buf),"$(other)/%s",(data->szName)+1);
- path=mir_strdup(buf);
+ path = mir_strdup(buf);
}
- ptr=path;
- ptrE=path;
+ ptr = path;
+ ptrE = path;
do
{
- while (*ptrE!='/' && *ptrE!='\0') ptrE++;
- if (*ptrE=='/')
+ while (*ptrE != '/' && *ptrE != '\0') ptrE++;
+ if (*ptrE == '/')
{
- *ptrE='\0';
+ *ptrE = '\0';
ptrE++;
// find item if not - create;
{
- cItem=FindChild(GetDlgItem(hwndDlg,ID),rootItem,ptr);
+ cItem = FindChild(GetDlgItem(hwndDlg,ID),rootItem,ptr);
if (!cItem) // not found - create node
{
TVINSERTSTRUCTA tvis;
- tvis.hParent=rootItem;
- tvis.hInsertAfter=TVI_SORT;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_PARAM;
- tvis.item.pszText=ptr;
- tvis.item.lParam=(LPARAM)NULL;
- cItem=TreeView_InsertItemA(GetDlgItem(hwndDlg,ID),&tvis);
+ tvis.hParent = rootItem;
+ tvis.hInsertAfter = TVI_SORT;
+ tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_PARAM;
+ tvis.item.pszText = ptr;
+ tvis.item.lParam = (LPARAM)NULL;
+ cItem = TreeView_InsertItemA(GetDlgItem(hwndDlg,ID),&tvis);
}
- rootItem=cItem;
+ rootItem = cItem;
}
- ptr=ptrE;
+ ptr = ptrE;
}
- else ext=TRUE;
+ else ext = TRUE;
}while (!ext);
//Insert item node
{
TVINSERTSTRUCTA tvis;
- tvis.hParent=rootItem;
- tvis.hInsertAfter=TVI_SORT;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_PARAM;
- tvis.item.pszText=ptr;
- tvis.item.lParam=(LPARAM)data;
+ tvis.hParent = rootItem;
+ tvis.hInsertAfter = TVI_SORT;
+ tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_PARAM;
+ tvis.item.pszText = ptr;
+ tvis.item.lParam = (LPARAM)data;
TreeView_InsertItemA(GetDlgItem(hwndDlg,ID),&tvis);
}
mir_free_and_nill(path);
@@ -133,17 +133,17 @@ int enumDB_SkinObjectsForEditorProc(const char *szSetting,LPARAM lParam) char * value;
char *desc;
char *descKey;
- descKey=mir_strdup(szSetting);
- descKey[0]='%';
- value= db_get_sa(NULL,SKIN,szSetting);
- desc= db_get_sa(NULL,SKIN,descKey);
+ descKey = mir_strdup(szSetting);
+ descKey[0] = '%';
+ value = db_get_sa(NULL,SKIN,szSetting);
+ desc = db_get_sa(NULL,SKIN,descKey);
if (wildcmp(value,"?lyph*",0))
{
- OPT_OBJECT_DATA * a=(OPT_OBJECT_DATA*)mir_alloc(sizeof(OPT_OBJECT_DATA));
- a->szPath=desc;
- a->szName=mir_strdup(szSetting);
- a->szValue=value;
- a->szTempValue=NULL;
+ OPT_OBJECT_DATA * a = (OPT_OBJECT_DATA*)mir_alloc(sizeof(OPT_OBJECT_DATA));
+ a->szPath = desc;
+ a->szName = mir_strdup(szSetting);
+ a->szValue = value;
+ a->szTempValue = NULL;
TreeAddObject(gl_Dlg,gl_controlID,a);
}
else
@@ -159,17 +159,17 @@ int enumDB_SkinObjectsForEditorProc(const char *szSetting,LPARAM lParam) int FillObjectTree(HWND hwndDlg, int ObjectTreeID, char * wildmask)
{
DBCONTACTENUMSETTINGS dbces;
- gl_Dlg=hwndDlg;
- gl_controlID=ObjectTreeID;
- gl_Mask=wildmask;
- dbces.pfnEnumProc=enumDB_SkinObjectsForEditorProc;
- dbces.szModule=SKIN;
- dbces.ofsSettings=0;
+ gl_Dlg = hwndDlg;
+ gl_controlID = ObjectTreeID;
+ gl_Mask = wildmask;
+ dbces.pfnEnumProc = enumDB_SkinObjectsForEditorProc;
+ dbces.szModule = SKIN;
+ dbces.ofsSettings = 0;
CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
return 0;
}
-TCHAR *TYPES[]={_T("- Empty - (do not draw this object)"),_T("Solid fill object"),_T("Image (draw image)"),_T("Fragment (draw portion of image)")};
-TCHAR *FITMODES[]={_T("Stretch Both directions"),_T("Stretch Vertical, Tile Horizontal"),_T("Tile Vertical, Stretch Horizontal"),_T("Tile Both directions")};
+TCHAR *TYPES[] = {_T("- Empty - (do not draw this object)"),_T("Solid fill object"),_T("Image (draw image)"),_T("Fragment (draw portion of image)")};
+TCHAR *FITMODES[] = {_T("Stretch Both directions"),_T("Stretch Vertical, Tile Horizontal"),_T("Tile Vertical, Stretch Horizontal"),_T("Tile Both directions")};
void SetAppropriateGroups(HWND hwndDlg, int Type)
//str contains default values
@@ -235,16 +235,16 @@ void SetAppropriateGroups(HWND hwndDlg, int Type) void SetControls(HWND hwndDlg, char * str)
{
char buf[250];
- int Type=0;
+ int Type = 0;
if (!str)
{
SetAppropriateGroups(hwndDlg,-1);
return;
}
GetParamN(str,buf,SIZEOF(buf),1,',',TRUE);
- if (mir_bool_strcmpi(buf,"Solid")) Type=1;
- else if (mir_bool_strcmpi(buf,"Image")) Type=2;
- else if (mir_bool_strcmpi(buf,"Fragment")) Type=3;
+ if (mir_bool_strcmpi(buf,"Solid")) Type = 1;
+ else if (mir_bool_strcmpi(buf,"Image")) Type = 2;
+ else if (mir_bool_strcmpi(buf,"Fragment")) Type = 3;
SendDlgItemMessage(hwndDlg,IDC_TYPE,CB_SETCURSEL,(WPARAM)Type,(LPARAM)0);
SetAppropriateGroups(hwndDlg,Type);
switch (Type)
@@ -252,12 +252,12 @@ void SetControls(HWND hwndDlg, char * str) case 1:
{
int r,g,b,a;
- r=g=b=200;
- a=255;
- r=atoi(GetParamN(str,buf,SIZEOF(buf),2,',',TRUE));
- g=atoi(GetParamN(str,buf,SIZEOF(buf),3,',',TRUE));
- b=atoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
- a=atoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
+ r = g = b = 200;
+ a = 255;
+ r = atoi(GetParamN(str,buf,SIZEOF(buf),2,',',TRUE));
+ g = atoi(GetParamN(str,buf,SIZEOF(buf),3,',',TRUE));
+ b = atoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
+ a = atoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
SendDlgItemMessage(hwndDlg,IDC_COLOR,CPM_SETCOLOUR,(WPARAM)0,(LPARAM)RGB(r,g,b));
SendDlgItemMessage(hwndDlg,IDC_COLOR,CPM_SETDEFAULTCOLOUR,(WPARAM)0,(LPARAM)RGB(r,g,b));
SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_SETPOS,0,MAKELONG(a,0));
@@ -267,15 +267,15 @@ void SetControls(HWND hwndDlg, char * str) {
int a;
int l,t,r,b;
- int fitmode=0;
- l=t=r=b=0;
- a=255;
+ int fitmode = 0;
+ l = t = r = b = 0;
+ a = 255;
- l=atoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
- t=atoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
- r=atoi(GetParamN(str,buf,SIZEOF(buf),6,',',TRUE));
- b=atoi(GetParamN(str,buf,SIZEOF(buf),7,',',TRUE));
- a=atoi(GetParamN(str,buf,SIZEOF(buf),8,',',TRUE));
+ l = atoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
+ t = atoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
+ r = atoi(GetParamN(str,buf,SIZEOF(buf),6,',',TRUE));
+ b = atoi(GetParamN(str,buf,SIZEOF(buf),7,',',TRUE));
+ a = atoi(GetParamN(str,buf,SIZEOF(buf),8,',',TRUE));
SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_SETPOS,0,MAKELONG(a,0));
SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_SETPOS,0,MAKELONG(l,0));
@@ -287,10 +287,10 @@ void SetControls(HWND hwndDlg, char * str) SendDlgItemMessageA(hwndDlg,IDC_FILE,WM_SETTEXT,0,(LPARAM)buf);
GetParamN(str,buf,SIZEOF(buf),3,',',TRUE);
- if (mir_bool_strcmpi(buf,"TileBoth")) fitmode=FM_TILE_BOTH;
- else if (mir_bool_strcmpi(buf,"TileVert")) fitmode=FM_TILE_VERT;
- else if (mir_bool_strcmpi(buf,"TileHorz")) fitmode=FM_TILE_HORZ;
- else fitmode=0;
+ if (mir_bool_strcmpi(buf,"TileBoth")) fitmode = FM_TILE_BOTH;
+ else if (mir_bool_strcmpi(buf,"TileVert")) fitmode = FM_TILE_VERT;
+ else if (mir_bool_strcmpi(buf,"TileHorz")) fitmode = FM_TILE_HORZ;
+ else fitmode = 0;
SendDlgItemMessage(hwndDlg,IDC_FIT,CB_SETCURSEL,(WPARAM)fitmode,(LPARAM)0);
}
@@ -300,21 +300,21 @@ void SetControls(HWND hwndDlg, char * str) int a;
int l,t,r,b;
int x,y,w,h;
- int fitmode=0;
- l=t=r=b=0;
- x=y=w=h=0;
- a=255;
+ int fitmode = 0;
+ l = t = r = b = 0;
+ x = y = w = h = 0;
+ a = 255;
- x=atoi(GetParamN(str,buf,SIZEOF(buf),3,',',TRUE));
- y=atoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
- w=atoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
- h=atoi(GetParamN(str,buf,SIZEOF(buf),6,',',TRUE));
-
- l=atoi(GetParamN(str,buf,SIZEOF(buf),8,',',TRUE));
- t=atoi(GetParamN(str,buf,SIZEOF(buf),9,',',TRUE));
- r=atoi(GetParamN(str,buf,SIZEOF(buf),10,',',TRUE));
- b=atoi(GetParamN(str,buf,SIZEOF(buf),11,',',TRUE));
- a=atoi(GetParamN(str,buf,SIZEOF(buf),12,',',TRUE));
+ x = atoi(GetParamN(str,buf,SIZEOF(buf),3,',',TRUE));
+ y = atoi(GetParamN(str,buf,SIZEOF(buf),4,',',TRUE));
+ w = atoi(GetParamN(str,buf,SIZEOF(buf),5,',',TRUE));
+ h = atoi(GetParamN(str,buf,SIZEOF(buf),6,',',TRUE));
+
+ l = atoi(GetParamN(str,buf,SIZEOF(buf),8,',',TRUE));
+ t = atoi(GetParamN(str,buf,SIZEOF(buf),9,',',TRUE));
+ r = atoi(GetParamN(str,buf,SIZEOF(buf),10,',',TRUE));
+ b = atoi(GetParamN(str,buf,SIZEOF(buf),11,',',TRUE));
+ a = atoi(GetParamN(str,buf,SIZEOF(buf),12,',',TRUE));
SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_SETPOS,0,MAKELONG(a,0));
SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_SETPOS,0,MAKELONG(l,0));
@@ -331,10 +331,10 @@ void SetControls(HWND hwndDlg, char * str) SendDlgItemMessageA(hwndDlg,IDC_FILE,WM_SETTEXT,0,(LPARAM)buf);
GetParamN(str,buf,SIZEOF(buf),7,',',TRUE);
- if (mir_bool_strcmpi(buf,"TileBoth")) fitmode=FM_TILE_BOTH;
- else if (mir_bool_strcmpi(buf,"TileVert")) fitmode=FM_TILE_VERT;
- else if (mir_bool_strcmpi(buf,"TileHorz")) fitmode=FM_TILE_HORZ;
- else fitmode=0;
+ if (mir_bool_strcmpi(buf,"TileBoth")) fitmode = FM_TILE_BOTH;
+ else if (mir_bool_strcmpi(buf,"TileVert")) fitmode = FM_TILE_VERT;
+ else if (mir_bool_strcmpi(buf,"TileHorz")) fitmode = FM_TILE_HORZ;
+ else fitmode = 0;
SendDlgItemMessage(hwndDlg,IDC_FIT,CB_SETCURSEL,(WPARAM)fitmode,(LPARAM)0);
}
@@ -346,9 +346,9 @@ void SetControls(HWND hwndDlg, char * str) int GetShortFileName(char * FullFile)
{
- char buf[MAX_PATH]={0};
- char * f=strrchr(FullFile,'\\');
- char * file=f?mir_strdup(f+1):0;
+ char buf[MAX_PATH] = {0};
+ char * f = strrchr(FullFile,'\\');
+ char * file = f?mir_strdup(f+1):0;
if (!file) return 0;
ske_GetFullFilename(buf,file,0,TRUE);
if (mir_bool_strcmpi(buf,FullFile))
@@ -360,7 +360,7 @@ int GetShortFileName(char * FullFile) else
{
CallService(MS_UTILS_PATHTORELATIVE,(WPARAM)FullFile,(LPARAM)buf);
- if (buf[0]!='\\' && buf[1]!=':')
+ if (buf[0] != '\\' && buf[1] != ':')
_snprintf(FullFile,MAX_PATH,"\\%s",buf);
else
_snprintf(FullFile,MAX_PATH,"%s",buf);
@@ -371,8 +371,8 @@ int GetShortFileName(char * FullFile) char * MadeString(HWND hwndDlg)
{
- char buf[MAX_PATH*2]={0};
- int i=SendDlgItemMessage(hwndDlg,IDC_TYPE,CB_GETCURSEL,(WPARAM)0,(LPARAM)0);
+ char buf[MAX_PATH*2] = {0};
+ int i = SendDlgItemMessage(hwndDlg,IDC_TYPE,CB_GETCURSEL,(WPARAM)0,(LPARAM)0);
switch (i)
{
case 0:
@@ -382,8 +382,8 @@ char * MadeString(HWND hwndDlg) {
BYTE a;
DWORD col;
- a=(BYTE)SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_GETPOS,0,0);
- col=(DWORD)SendDlgItemMessage(hwndDlg,IDC_COLOR,CPM_GETCOLOUR,(WPARAM)0,(LPARAM)0);
+ a = (BYTE)SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_GETPOS,0,0);
+ col = (DWORD)SendDlgItemMessage(hwndDlg,IDC_COLOR,CPM_GETCOLOUR,(WPARAM)0,(LPARAM)0);
mir_snprintf(buf,SIZEOF(buf),"Glyph,Solid,%d,%d,%d,%d",GetRValue(col),GetGValue(col),GetBValue(col),a);
}
break;
@@ -391,20 +391,20 @@ char * MadeString(HWND hwndDlg) {
BYTE a;
WORD l,t,b,r;
- char buf_name[MAX_PATH]={0};
- int i=0;
- a=(BYTE)SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_GETPOS,0,0);
- l=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_GETPOS,0,0);
- t=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_TOP,UDM_GETPOS,0,0);
- r=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_RIGHT,UDM_GETPOS,0,0);
- b=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_BOTTOM,UDM_GETPOS,0,0);
+ char buf_name[MAX_PATH] = {0};
+ int i = 0;
+ a = (BYTE)SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_GETPOS,0,0);
+ l = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_GETPOS,0,0);
+ t = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_TOP,UDM_GETPOS,0,0);
+ r = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_RIGHT,UDM_GETPOS,0,0);
+ b = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_BOTTOM,UDM_GETPOS,0,0);
SendDlgItemMessageA(hwndDlg,IDC_FILE,WM_GETTEXT,(WPARAM)MAX_PATH,(LPARAM)buf_name);
- i=SendDlgItemMessage(hwndDlg,IDC_FIT,CB_GETCURSEL,0,0);
+ i = SendDlgItemMessage(hwndDlg,IDC_FIT,CB_GETCURSEL,0,0);
mir_snprintf(buf,SIZEOF(buf),"Glyph,Image,%s,%s,%d,%d,%d,%d,%d",buf_name,
//fitmode
- (i==FM_TILE_BOTH)?"TileBoth":
- (i==FM_TILE_VERT)?"TileVert":
- (i==FM_TILE_HORZ)?"TileHorz":"StretchBoth",
+ (i == FM_TILE_BOTH)?"TileBoth":
+ (i == FM_TILE_VERT)?"TileVert":
+ (i == FM_TILE_HORZ)?"TileHorz":"StretchBoth",
l,t,r,b,a);
}
break;
@@ -413,37 +413,37 @@ char * MadeString(HWND hwndDlg) BYTE a;
WORD l,t,b,r;
WORD x,y,w,h;
- char buf_name[MAX_PATH]={0};
- int i=0;
- a=(BYTE)SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_GETPOS,0,0);
- l=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_GETPOS,0,0);
- t=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_TOP,UDM_GETPOS,0,0);
- r=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_RIGHT,UDM_GETPOS,0,0);
- b=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_BOTTOM,UDM_GETPOS,0,0);
+ char buf_name[MAX_PATH] = {0};
+ int i = 0;
+ a = (BYTE)SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_GETPOS,0,0);
+ l = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_GETPOS,0,0);
+ t = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_TOP,UDM_GETPOS,0,0);
+ r = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_RIGHT,UDM_GETPOS,0,0);
+ b = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_BOTTOM,UDM_GETPOS,0,0);
- x=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_POSLEFT,UDM_GETPOS,0,0);
- y=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_POSTOP,UDM_GETPOS,0,0);
+ x = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_POSLEFT,UDM_GETPOS,0,0);
+ y = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_POSTOP,UDM_GETPOS,0,0);
- w=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_WIDTH,UDM_GETPOS,0,0);
- h=(WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_HEIGHT,UDM_GETPOS,0,0);
+ w = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_WIDTH,UDM_GETPOS,0,0);
+ h = (WORD)SendDlgItemMessage(hwndDlg,IDC_SPIN_HEIGHT,UDM_GETPOS,0,0);
SendDlgItemMessageA(hwndDlg,IDC_FILE,WM_GETTEXT,(WPARAM)MAX_PATH,(LPARAM)buf_name);
- i=SendDlgItemMessage(hwndDlg,IDC_FIT,CB_GETCURSEL,0,0);
+ i = SendDlgItemMessage(hwndDlg,IDC_FIT,CB_GETCURSEL,0,0);
mir_snprintf(buf,SIZEOF(buf),"Glyph,Fragment,%s,%d,%d,%d,%d,%s,%d,%d,%d,%d,%d",buf_name,x,y,w,h,
//fitmode
- (i==FM_TILE_BOTH)?"TileBoth":
- (i==FM_TILE_VERT)?"TileVert":
- (i==FM_TILE_HORZ)?"TileHorz":"StretchBoth",
+ (i == FM_TILE_BOTH)?"TileBoth":
+ (i == FM_TILE_VERT)?"TileVert":
+ (i == FM_TILE_HORZ)?"TileHorz":"StretchBoth",
l,t,r,b,a);
}
break;
}
- if (buf[0]!='\0') return mir_strdup(buf);
+ if (buf[0] != '\0') return mir_strdup(buf);
return 0;
}
void UpdateInfo(HWND hwndDlg)
{
- char *b=MadeString(hwndDlg);
+ char *b = MadeString(hwndDlg);
if (!b)
{
SendDlgItemMessageA(hwndDlg,IDC_EDIT1,WM_SETTEXT,0,(LPARAM)"");
@@ -451,77 +451,77 @@ void UpdateInfo(HWND hwndDlg) }
SendDlgItemMessageA(hwndDlg,IDC_EDIT1,WM_SETTEXT,0,(LPARAM)b);
{
- OPT_OBJECT_DATA *sd=NULL;
- HTREEITEM hti=TreeView_GetSelection(GetDlgItem(hwndDlg,IDC_OBJECT_TREE));
+ OPT_OBJECT_DATA *sd = NULL;
+ HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg,IDC_OBJECT_TREE));
if (hti)
{
- TVITEMA tvi={0};
- tvi.hItem=hti;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
+ TVITEMA tvi = {0};
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_OBJECT_TREE),&tvi);
- sd=(OPT_OBJECT_DATA*)(tvi.lParam);
+ sd = (OPT_OBJECT_DATA*)(tvi.lParam);
if (sd)
{
if (sd->szValue) mir_free_and_nill(sd->szValue);
- sd->szValue=mir_strdup(b);
+ sd->szValue = mir_strdup(b);
}
}
}
mir_free_and_nill(b);
- glSkinWasModified=1;
+ glSkinWasModified = 1;
}
void StoreTreeNode(HWND hTree, HTREEITEM node, char * section)
{
HTREEITEM tmp;
- tmp=node;
+ tmp = node;
while (tmp)
{
- HTREEITEM tmp2=NULL;
+ HTREEITEM tmp2 = NULL;
TVITEMA tvi;
char buf[255];
- tvi.hItem=tmp;
- tvi.mask=TVIF_TEXT|TVIF_HANDLE;
- tvi.pszText=(LPSTR)&buf;
- tvi.cchTextMax=254;
+ tvi.hItem = tmp;
+ tvi.mask = TVIF_TEXT|TVIF_HANDLE;
+ tvi.pszText = (LPSTR)&buf;
+ tvi.cchTextMax = 254;
TreeView_GetItemA(hTree,&tvi);
if (tvi.lParam)
{
- OPT_OBJECT_DATA * dat =(OPT_OBJECT_DATA*)(tvi.lParam);
+ OPT_OBJECT_DATA * dat = (OPT_OBJECT_DATA*)(tvi.lParam);
if (dat->szName && dat->szValue)
db_set_s(NULL,section,dat->szName,dat->szValue);
}
- tmp2=TreeView_GetChild(hTree,tmp);
+ tmp2 = TreeView_GetChild(hTree,tmp);
if (tmp2) StoreTreeNode(hTree,tmp2,section);
- tmp=TreeView_GetNextSibling(hTree,tmp);
+ tmp = TreeView_GetNextSibling(hTree,tmp);
}
return;
}
void StoreTreeToDB(HWND hTree, char * section)
{
- HTREEITEM tmp=NULL;
- tmp=TreeView_GetRoot(hTree);
+ HTREEITEM tmp = NULL;
+ tmp = TreeView_GetRoot(hTree);
StoreTreeNode(hTree,tmp,section);
db_set_b(NULL,section,"Modified",1);
- glSkinWasModified=2;
+ glSkinWasModified = 2;
}
-static BOOL fileChanged=FALSE;
-static char * object_clipboard=NULL;
+static BOOL fileChanged = FALSE;
+static char * object_clipboard = NULL;
int GetFileSizes(HWND hwndDlg)
{
char buf[MAX_PATH];
- SIZE sz={0};
+ SIZE sz = {0};
SendDlgItemMessageA(hwndDlg,IDC_FILE,WM_GETTEXT,(WPARAM)MAX_PATH,(LPARAM)buf);
ske_GetFullFilename(buf,buf,0,TRUE);
{
- HBITMAP hbmp=ske_LoadGlyphImage(buf);
+ HBITMAP hbmp = ske_LoadGlyphImage(buf);
if (hbmp)
{
- BITMAP bm={0};
+ BITMAP bm = {0};
GetObject(hbmp,sizeof(BITMAP),&bm);
- sz.cx=bm.bmWidth;
- sz.cy=bm.bmHeight;
+ sz.cx = bm.bmWidth;
+ sz.cy = bm.bmHeight;
ske_UnloadGlyphImage(hbmp);
}
}
@@ -540,15 +540,15 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
case WM_WINDOWPOSCHANGED:
{
- WINDOWPOS * wp=(WINDOWPOS *)lParam;
+ WINDOWPOS * wp = (WINDOWPOS *)lParam;
if (lParam && wp->flags&SWP_SHOWWINDOW)
{
if (glOtherSkinWasLoaded)
{
TreeView_DeleteAllItems(GetDlgItem(hwndDlg,IDC_OBJECT_TREE));
FillObjectTree(hwndDlg,IDC_OBJECT_TREE,"$$*");
- glSkinWasModified=0;
- glOtherSkinWasLoaded=FALSE;
+ glSkinWasModified = 0;
+ glOtherSkinWasLoaded = FALSE;
}
}
break;
@@ -558,13 +558,13 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM TranslateDialogDefault(hwndDlg);
FillObjectTree(hwndDlg,IDC_OBJECT_TREE,"$$*");
{ //Fill types combo
- int i=0;
- for (i=0; i<SIZEOF(TYPES); i++)
+ int i = 0;
+ for (i = 0; i < SIZEOF(TYPES); i++)
SendDlgItemMessage(hwndDlg,IDC_TYPE,CB_ADDSTRING,0,(LPARAM)TranslateTS(TYPES[i]));
}
{ //Fill fit combo
- int i=0;
- for (i=0; i<SIZEOF(FITMODES); i++)
+ int i = 0;
+ for (i = 0; i < SIZEOF(FITMODES); i++)
SendDlgItemMessage(hwndDlg,IDC_FIT,CB_ADDSTRING,0,(LPARAM)TranslateTS(FITMODES[i]));
}
//SPIN Ranges
@@ -589,54 +589,54 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_3),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_COPY),FALSE);
- glSkinWasModified=0;
- glOtherSkinWasLoaded=FALSE;
+ glSkinWasModified = 0;
+ glOtherSkinWasLoaded = FALSE;
break;
}
case WM_COMMAND:
{
- if (LOWORD(wParam)==IDC_TYPE)
+ if (LOWORD(wParam) == IDC_TYPE)
{
- if (HIWORD(wParam)==CBN_SELCHANGE)
+ if (HIWORD(wParam) == CBN_SELCHANGE)
{
- int i=SendDlgItemMessage(hwndDlg,IDC_TYPE,CB_GETCURSEL,(WPARAM)0,(LPARAM)0);
+ int i = SendDlgItemMessage(hwndDlg,IDC_TYPE,CB_GETCURSEL,(WPARAM)0,(LPARAM)0);
//if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_TYPE)))
SetAppropriateGroups(hwndDlg,i);
- if (GetFocus()==GetDlgItem(hwndDlg,IDC_TYPE))
+ if (GetFocus() == GetDlgItem(hwndDlg,IDC_TYPE))
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
UpdateInfo(hwndDlg);
break;
}
}
- else if (LOWORD(wParam)==IDC_COPY)
+ else if (LOWORD(wParam) == IDC_COPY)
{
- if (HIWORD(wParam)==BN_CLICKED)
+ if (HIWORD(wParam) == BN_CLICKED)
{
if (object_clipboard) mir_free_and_nill(object_clipboard);
- object_clipboard=NULL;
+ object_clipboard = NULL;
{
- OPT_OBJECT_DATA *sd=NULL;
- HTREEITEM hti=TreeView_GetSelection(GetDlgItem(hwndDlg,IDC_OBJECT_TREE));
- if (hti!=0)
+ OPT_OBJECT_DATA *sd = NULL;
+ HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg,IDC_OBJECT_TREE));
+ if (hti != 0)
{
- TVITEM tvi={0};
- tvi.hItem=hti;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
+ TVITEM tvi = {0};
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_OBJECT_TREE),&tvi);
- sd=(OPT_OBJECT_DATA*)(tvi.lParam);
+ sd = (OPT_OBJECT_DATA*)(tvi.lParam);
}
if (sd && sd->szValue)
- object_clipboard=mir_strdup(sd->szValue);
+ object_clipboard = mir_strdup(sd->szValue);
}
- EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),object_clipboard!=NULL);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),object_clipboard != NULL);
return 0;
}
}
- else if (LOWORD(wParam)==IDC_PASTE)
+ else if (LOWORD(wParam) == IDC_PASTE)
{
- if (HIWORD(wParam)==BN_CLICKED)
+ if (HIWORD(wParam) == BN_CLICKED)
{
if (object_clipboard)
SetControls(hwndDlg, object_clipboard);
@@ -645,30 +645,30 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM return 0;
}
}
- else if (LOWORD(wParam)==IDC_COLOR)
+ else if (LOWORD(wParam) == IDC_COLOR)
{
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
UpdateInfo(hwndDlg);
}
- else if (LOWORD(wParam)==IDC_BROWSE)
+ else if (LOWORD(wParam) == IDC_BROWSE)
{
- if (HIWORD(wParam)==BN_CLICKED)
+ if (HIWORD(wParam) == BN_CLICKED)
{
{
- char str[MAX_PATH]={0};
- OPENFILENAMEA ofn={0};
- char filter[512]={0};
- int res=0;
+ char str[MAX_PATH] = {0};
+ OPENFILENAMEA ofn = {0};
+ char filter[512] = {0};
+ int res = 0;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
ofn.hInstance = NULL;
ofn.lpstrFilter = "Images (*.png,*.jpg,*.bmp,*.gif,*.tga)\0*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.tga\0All files (*.*)\0*.*\0\0";
ofn.Flags = (OFN_FILEMUSTEXIST | OFN_HIDEREADONLY);
SendDlgItemMessageA(hwndDlg,IDC_FILE,WM_GETTEXT,(WPARAM)SIZEOF(str),(LPARAM)str);
- if (str[0]=='\0' || strchr(str,'%'))
+ if (str[0] == '\0' || strchr(str,'%'))
{
- ofn.Flags|=OFN_NOVALIDATE;
- str[0]='\0';
+ ofn.Flags |= OFN_NOVALIDATE;
+ str[0] = '\0';
}
else
{
@@ -680,12 +680,12 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrDefExt = "*.*";
// {
-// DWORD tick=GetTickCount();
- res=GetOpenFileNameA(&ofn);
+// DWORD tick = GetTickCount();
+ res = GetOpenFileNameA(&ofn);
// if (!res)
-// if (GetTickCount()-tick<100)
+// if (GetTickCount()-tick < 100)
// {
-// res=GetOpenFileNameA(&ofn);
+// res = GetOpenFileNameA(&ofn);
// if (!res) break;
// }
// else break;
@@ -700,15 +700,15 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
}
}
- else if (LOWORD(wParam)==IDC_FILE)
+ else if (LOWORD(wParam) == IDC_FILE)
{
if (HIWORD(wParam) == EN_CHANGE)
{
- fileChanged=TRUE;
- if ((HWND)lParam != GetFocus())
+ fileChanged = TRUE;
+ if ((HWND)lParam !=GetFocus())
{
GetFileSizes(hwndDlg);
- fileChanged=FALSE;
+ fileChanged = FALSE;
}
}
else if (HIWORD(wParam) == EN_KILLFOCUS)
@@ -716,26 +716,26 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM if (fileChanged)
{
GetFileSizes(hwndDlg);
- fileChanged=FALSE;
+ fileChanged = FALSE;
}
}
}
else if ((
- (LOWORD(wParam)==IDC_E_TOP
- ||LOWORD(wParam)==IDC_E_BOTTOM
- ||LOWORD(wParam)==IDC_E_LEFT
- ||LOWORD(wParam)==IDC_E_RIGHT
- ||LOWORD(wParam)==IDC_E_X
- ||LOWORD(wParam)==IDC_E_Y
- ||LOWORD(wParam)==IDC_E_W
- ||LOWORD(wParam)==IDC_E_H
- ||LOWORD(wParam)==IDC_EDIT_ALPHA
+ (LOWORD(wParam) == IDC_E_TOP
+ ||LOWORD(wParam) == IDC_E_BOTTOM
+ ||LOWORD(wParam) == IDC_E_LEFT
+ ||LOWORD(wParam) == IDC_E_RIGHT
+ ||LOWORD(wParam) == IDC_E_X
+ ||LOWORD(wParam) == IDC_E_Y
+ ||LOWORD(wParam) == IDC_E_W
+ ||LOWORD(wParam) == IDC_E_H
+ ||LOWORD(wParam) == IDC_EDIT_ALPHA
)
- && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ && HIWORD(wParam) !=EN_CHANGE || (HWND)lParam !=GetFocus()))
{
return 0;
}
- else if (LOWORD(wParam)!=IDC_EDIT1)
+ else if (LOWORD(wParam) != IDC_EDIT1)
{
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
UpdateInfo(hwndDlg);
@@ -753,28 +753,28 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM //Change to new object
NMTREEVIEWA * nmtv = (NMTREEVIEWA *) lParam;
if (!nmtv) return 0;
- if (nmtv->hdr.code==TVN_SELCHANGEDA || nmtv->hdr.code==TVN_SELCHANGEDW)
+ if (nmtv->hdr.code == TVN_SELCHANGEDA || nmtv->hdr.code == TVN_SELCHANGEDW)
{
if (nmtv->itemOld.lParam)
{
- OPT_OBJECT_DATA * dataOld=(OPT_OBJECT_DATA*)nmtv->itemOld.lParam;
+ OPT_OBJECT_DATA * dataOld = (OPT_OBJECT_DATA*)nmtv->itemOld.lParam;
if (dataOld->szValue)
{
mir_free_and_nill(dataOld->szValue);
- dataOld->szValue=MadeString(hwndDlg);
+ dataOld->szValue = MadeString(hwndDlg);
}
}
if (nmtv->itemNew.lParam)
{
- OPT_OBJECT_DATA * data=(OPT_OBJECT_DATA*)nmtv->itemNew.lParam;
+ OPT_OBJECT_DATA * data = (OPT_OBJECT_DATA*)nmtv->itemNew.lParam;
char buf[255];
- mir_snprintf(buf,SIZEOF(buf),"%s=%s",data->szName, data->szValue);
+ mir_snprintf(buf,SIZEOF(buf),"%s = %s",data->szName, data->szValue);
SendDlgItemMessageA(hwndDlg,IDC_EDIT1,WM_SETTEXT,0,(LPARAM)buf);
SetControls(hwndDlg,data->szValue);
EnableWindow(GetDlgItem(hwndDlg,IDC_COPY),TRUE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),object_clipboard!=NULL);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),object_clipboard != NULL);
}
else
{
@@ -785,9 +785,9 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM }
}
- else if (nmtv->hdr.code==TVN_DELETEITEMA)
+ else if (nmtv->hdr.code == TVN_DELETEITEMA)
{
- OPT_OBJECT_DATA * dataOld=(OPT_OBJECT_DATA*)nmtv->itemOld.lParam;
+ OPT_OBJECT_DATA * dataOld = (OPT_OBJECT_DATA*)nmtv->itemOld.lParam;
if (dataOld)
{
if (dataOld->szName) mir_free_and_nill(dataOld->szName);
@@ -813,8 +813,8 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM ske_RedrawCompleteWindow();
Sync(CLUIFrames_OnClistResize_mod, (WPARAM)0, (LPARAM)0);
{
- HWND hwnd=pcli->hwndContactList;
- RECT rc={0};
+ HWND hwnd = pcli->hwndContactList;
+ RECT rc = {0};
GetWindowRect(hwnd, &rc);
Sync(CLUIFrames_OnMoving,hwnd,&rc);
}
@@ -831,28 +831,28 @@ INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM int EnableGroup(HWND hwndDlg, HWND first, BOOL bEnable)
{
- HWND hwnd=first;
- BOOL exit=FALSE;
+ HWND hwnd = first;
+ BOOL exit = FALSE;
if (!hwnd) return 0;
do
{
EnableWindow(hwnd,bEnable);
- hwnd=GetWindow(hwnd,GW_HWNDNEXT);
- if (!hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit=TRUE;
+ hwnd = GetWindow(hwnd,GW_HWNDNEXT);
+ if (!hwnd || GetWindowLongPtr(hwnd,GWL_STYLE)&WS_GROUP) exit = TRUE;
}while (!exit);
return 0;
}
int ShowGroup(HWND hwndDlg, HWND first, BOOL bEnable)
{
- HWND hwnd=first;
- BOOL exit=FALSE;
+ HWND hwnd = first;
+ BOOL exit = FALSE;
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;
+ hwnd = GetWindow(hwnd,GW_HWNDNEXT);
+ 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 ea99b3e76b..4ddbdcb982 100644 --- a/plugins/Clist_modern/modern_skinengine.cpp +++ b/plugins/Clist_modern/modern_skinengine.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //Include
#include "hdr/modern_commonheaders.h"
-#include <m_png.h>
+#include < m_png.h>
#include "m_api/m_skin_eng.h"
#include "hdr/modern_skinselector.h"
#include "hdr/modern_cluiframes.h"
@@ -34,48 +34,48 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_skinengine.h"
#include "hdr/modern_commonprototypes.h"
-#include <shlwapi.h>
+#include < shlwapi.h>
#include "hdr/modern_sync.h"
//Implementation
/* Global variables */
-SKINOBJECTSLIST g_SkinObjectList={0};
-CURRWNDIMAGEDATA * g_pCachedWindow=NULL;
+SKINOBJECTSLIST g_SkinObjectList = {0};
+CURRWNDIMAGEDATA * g_pCachedWindow = NULL;
BOOL (WINAPI *g_proc_UpdateLayeredWindow)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD);
-BOOL g_flag_bPostWasCanceled =FALSE;
-BOOL g_flag_bFullRepaint =FALSE;
-BOOL g_mutex_bLockUpdating =FALSE;
+BOOL g_flag_bPostWasCanceled = FALSE;
+BOOL g_flag_bFullRepaint = FALSE;
+BOOL g_mutex_bLockUpdating = FALSE;
-SortedList * gl_plGlyphTexts=NULL;
-SortedList * gl_plSkinFonts =NULL;
+SortedList * gl_plGlyphTexts = NULL;
+SortedList * gl_plSkinFonts = NULL;
/* Private module variables */
static HANDLE hSkinLoadedEvent;
-static GLYPHIMAGE * pLoadedImages=NULL;
-static DWORD dwLoadedImagesCount=0;
-static DWORD dwLoadedImagesAlocated=0;
+static GLYPHIMAGE * pLoadedImages = NULL;
+static DWORD dwLoadedImagesCount = 0;
+static DWORD dwLoadedImagesAlocated = 0;
-static BOOL flag_bUpdateQueued=FALSE;
-static BOOL flag_bJustDrawNonFramedObjects=FALSE;
-static BOOL mutex_bLockUpdate=FALSE;
+static BOOL flag_bUpdateQueued = FALSE;
+static BOOL flag_bJustDrawNonFramedObjects = FALSE;
+static BOOL mutex_bLockUpdate = FALSE;
-static SortedList * pEffectStack=NULL;
-static SKINOBJECTSLIST * pCurrentSkin=NULL;
-static char ** pszSettingName=NULL;
-static int nArrayLen=0;
-static char * iniCurrentSection=NULL;
-static char * szFileName=NULL;
+static SortedList * pEffectStack = NULL;
+static SKINOBJECTSLIST * pCurrentSkin = NULL;
+static char ** pszSettingName = NULL;
+static int nArrayLen = 0;
+static char * iniCurrentSection = NULL;
+static char * szFileName = NULL;
-static BYTE pbGammaWeight[256]={0};
-static BYTE pbGammaWeightAdv[256]={0};
-static BOOL bGammaWeightFilled=FALSE;
+static BYTE pbGammaWeight[256] = {0};
+static BYTE pbGammaWeightAdv[256] = {0};
+static BOOL bGammaWeightFilled = FALSE;
-static CRITICAL_SECTION cs_SkinChanging={0};
+static CRITICAL_SECTION cs_SkinChanging = {0};
/* Private module procedures */
@@ -115,7 +115,7 @@ static pfnImgDeleteDIBSection ImgDeleteDIBSection; typedef DWORD (__stdcall *pfnImgGetHandle)(LPVOID /*in*/pImg, HBITMAP /*out*/*pBitmap, LPVOID /*out*/*ppDIBBits);
static pfnImgGetHandle ImgGetHandle;
-static MODERNEFFECT meCurrentEffect={-1,{0},0,0};
+static MODERNEFFECT meCurrentEffect = {-1,{0},0,0};
//////////////////////////////////////////////////////////////////////////
@@ -135,7 +135,7 @@ IniParser::IniParser( TCHAR * tcsFileName, BYTE flags ) : _Flags( flags ) _hFile = _tfopen( tcsFileName, _T("r"));
- if ( _hFile != NULL )
+ if ( _hFile !=NULL )
{
_eType = IT_FILE;
_isValid = true;
@@ -194,29 +194,29 @@ HRESULT IniParser::WriteStrToDb( const char * szSection, const char * szName, co return S_OK; // skip not objects
-// if ( strlen(szValue)>0 && szValue[strlen(szValue)-1]=='\n' )
-// szValue[strlen(szValue)-1]='\0'; //kill linefeed at the end
+// if ( strlen(szValue)>0 && szValue[strlen(szValue)-1] == '\n' )
+// szValue[strlen(szValue)-1] = '\0'; //kill linefeed at the end
switch(szValue[0])
{
case 'b':
{
BYTE P;
- P=(BYTE)atoi(szValue+1);
+ P = (BYTE)atoi(szValue+1);
db_set_b(NULL,szSection,szName,P);
}
break;
case 'w':
{
WORD P;
- P=(WORD)atoi(szValue+1);
+ P = (WORD)atoi(szValue+1);
db_set_w(NULL,szSection,szName,P);
}
break;
case 'd':
{
DWORD P;
- P=(DWORD)atoi(szValue+1);
+ P = (DWORD)atoi(szValue+1);
db_set_dw(NULL,szSection,szName,P);
}
break;
@@ -226,14 +226,14 @@ HRESULT IniParser::WriteStrToDb( const char * szSection, const char * szName, co case 'f':
if (szFileName)
{
- char fn[MAX_PATH]={0};
- char bb[MAX_PATH*2]={0};
+ char fn[MAX_PATH] = {0};
+ char bb[MAX_PATH*2] = {0};
int pp, i;
- pp=-1;
+ pp = -1;
CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)szFileName, (LPARAM)fn);
{
- for (i=strlen(fn); i>=0; i--) if (fn[i]=='.') break;
- if (i>0) fn[i]='\0';
+ for (i = strlen(fn); i >= 0; i--) if (fn[i] == '.') break;
+ if (i>0) fn[i] = '\0';
}
_snprintf(bb,SIZEOF(bb),"%s\\%s",fn,szValue+1);
db_set_s(NULL,szSection,szName,bb);
@@ -249,17 +249,17 @@ int IniParser::GetSkinFolder( IN const TCHAR * szFileName, OUT TCHAR * pszFolder szBuff = mir_tstrdup( szFileName );
pszPos = szBuff + _tcslen( szBuff );
- while ( pszPos > szBuff && *pszPos!= _T('.')) { pszPos--; }
- *pszPos=_T('\0');
+ while ( pszPos > szBuff && *pszPos != _T('.')) { pszPos--; }
+ *pszPos = _T('\0');
_tcscpy( pszFolderName, szBuff );
TCHAR custom_folder[MAX_PATH];
TCHAR cus[MAX_PATH];
TCHAR *b3;
_tcscpy( custom_folder, pszFolderName );
- b3=custom_folder + _tcslen( custom_folder );
- while ( b3 > custom_folder && *b3!= _T('\\')) { b3--; }
- *b3=_T('\0');
+ b3 = custom_folder + _tcslen( custom_folder );
+ while ( b3 > custom_folder && *b3 != _T('\\')) { b3--; }
+ *b3 = _T('\0');
GetPrivateProfileString(_T("Skin_Description_Section"),_T("SkinFolder"),_T(""),cus,SIZEOF(custom_folder),szFileName);
if ( cus && _tcslen(cus)>0)
@@ -287,16 +287,16 @@ void IniParser::_DoInit() void IniParser::_LoadResourceIni( HINSTANCE hInst, const char * resourceName, const char * resourceType )
{
- if ( _eType != IT_UNKNOWN ) return;
+ if ( _eType !=IT_UNKNOWN ) return;
HRSRC hRSrc = FindResourceA( hInst, resourceName, resourceType );
if ( !hRSrc ) return;
- _hGlobalRes=LoadResource( hInst, hRSrc );
+ _hGlobalRes = LoadResource( hInst, hRSrc );
if ( !_hGlobalRes ) return;
_dwSizeOfRes = SizeofResource( hInst, hRSrc );
- _pPosition =(char*) LockResource( _hGlobalRes );
+ _pPosition = (char*) LockResource( _hGlobalRes );
_isValid = true;
_eType = IT_RESOURCE;
@@ -309,13 +309,13 @@ HRESULT IniParser::_DoParseFile() {
char szLine[MAX_LINE_LEN];
_nLine = 0;
- while ( fgets( szLine, SIZEOF(szLine), _hFile ) != NULL )
+ while ( fgets( szLine, SIZEOF(szLine), _hFile ) !=NULL )
{
size_t len = 0;
char * pLine = (char*)_RemoveTailings( szLine, len );
if ( len > 0 )
{
- pLine[len]='\0';
+ pLine[len] = '\0';
if ( !_DoParseLine( pLine )) return E_FAIL;
}
else
@@ -333,21 +333,21 @@ HRESULT IniParser::_DoParseResource() while ( pos < _pPosition + _dwSizeOfRes )
{
- int i=0;
- while ( pos < _pPosition + _dwSizeOfRes && *pos != '\n' && *pos!= '\0' && i < MAX_LINE_LEN - 1 )
+ int i = 0;
+ while ( pos < _pPosition + _dwSizeOfRes && *pos !='\n' && *pos != '\0' && i < MAX_LINE_LEN - 1 )
{
- if ( (*pos) != '\r' )
+ if ( (*pos) !='\r' )
szLine[ i++ ] = *pos;
pos++;
}
- szLine[ i ]='\0';
+ szLine[ i ] = '\0';
pos++;
size_t len = 0;
char * pLine = (char*) _RemoveTailings( szLine, len );
if ( len > 0 )
{
- pLine[len]='\0';
+ pLine[len] = '\0';
if ( !_DoParseLine( pLine )) return E_FAIL;
}
else
@@ -359,7 +359,7 @@ HRESULT IniParser::_DoParseResource() const char * IniParser::_RemoveTailings( const char * szLine, size_t& len )
{
const char * pStart = szLine;
- while( *pStart == ' ' || *pStart=='\t' ) pStart++; //skip spaces at begin
+ while( *pStart == ' ' || *pStart == '\t' ) pStart++; //skip spaces at begin
const char * pEnd = pStart + strlen( pStart );
while( pEnd > pStart && ( *pEnd == ' ' || *pEnd == '\t' || *pEnd == '\n' || *pEnd == '\r' )) pEnd--;
@@ -386,16 +386,16 @@ BOOL IniParser::_DoParseLine( char * szLine ) char *tbuf = szLine + 1; // skip [
- char *ebuf= tbuf;
+ char *ebuf = tbuf;
- while ( *ebuf != ']' && *ebuf !='\0' ) ebuf++;
+ while ( *ebuf !=']' && *ebuf !='\0' ) ebuf++;
if ( *ebuf == '\0' )
return FALSE; // no close bracket
DWORD sectionLen = ebuf - tbuf;
_szSection = (char*) mir_alloc( sectionLen + 1 );
strncpy( _szSection, tbuf, sectionLen );
- _szSection[sectionLen]='\0';
+ _szSection[sectionLen] = '\0';
}
return TRUE;
@@ -403,17 +403,17 @@ BOOL IniParser::_DoParseLine( char * szLine ) if ( !_szSection )
return TRUE; //param found out of section
- char *keyName=szLine;
- char *keyValue=szLine;
+ char *keyName = szLine;
+ char *keyValue = szLine;
- DWORD eqPlace=0;
- DWORD len2=strlen(keyName);
+ DWORD eqPlace = 0;
+ DWORD len2 = strlen(keyName);
- while ( eqPlace < len2 && keyName[ eqPlace ] != '=' )
- eqPlace++; //find '='
+ while ( eqPlace < len2 && keyName[ eqPlace ] !=' = ' )
+ eqPlace++; //find ' = '
- if (eqPlace==0 || eqPlace==len2)
- return TRUE; //= not found or no key name //say false
+ if (eqPlace == 0 || eqPlace == len2)
+ return TRUE; // = not found or no key name //say false
keyName[eqPlace] = '\0';
@@ -421,24 +421,24 @@ BOOL IniParser::_DoParseLine( char * szLine ) //remove tail spaces in Name
{
- DWORD len3=strlen(keyName);
- int j=len3-1;
- while (j>0 && (keyName[j]==' ' || keyName[j]=='\t')) j--;
- if (j>=0) keyName[j+1]='\0';
+ DWORD len3 = strlen(keyName);
+ int j = len3-1;
+ while (j>0 && (keyName[j] == ' ' || keyName[j] == '\t')) j--;
+ if (j >= 0) keyName[j+1] = '\0';
}
//remove start spaces in Value
{
- DWORD len3=strlen(keyValue);
- DWORD j=0;
- while (j<len3 && (keyValue[j]==' ' || keyValue[j]=='\t')) j++;
- if (j<len3) keyValue+=j;
+ DWORD len3 = strlen(keyValue);
+ DWORD j = 0;
+ while (j < len3 && (keyValue[j] == ' ' || keyValue[j] == '\t')) j++;
+ if (j < len3) keyValue += j;
}
//remove tail spaces in Value
{
- DWORD len3=strlen(keyValue);
- int j=len3-1;
- while (j>0 && (keyValue[j]==' ' || keyValue[j]=='\t' || keyValue[j]=='\n')) j--;
- if (j>=0) keyValue[j+1]='\0';
+ DWORD len3 = strlen(keyValue);
+ int j = len3-1;
+ while (j>0 && (keyValue[j] == ' ' || keyValue[j] == '\t' || keyValue[j] == '\n')) j--;
+ if (j >= 0) keyValue[j+1] = '\0';
}
_pLineCallBackProc( _szSection, keyName, keyValue, this );
}
@@ -452,26 +452,26 @@ HRESULT SkinEngineLoadModule() {
ModernSkinButtonLoadModule();
InitializeCriticalSection(&cs_SkinChanging);
- MainModernMaskList=(LISTMODERNMASK*)mir_calloc(sizeof(LISTMODERNMASK));
+ MainModernMaskList = (LISTMODERNMASK*)mir_calloc(sizeof(LISTMODERNMASK));
//init variables
- g_SkinObjectList.dwObjLPAlocated=0;
- g_SkinObjectList.dwObjLPReserved=0;
- g_SkinObjectList.pObjects=NULL;
+ g_SkinObjectList.dwObjLPAlocated = 0;
+ g_SkinObjectList.dwObjLPReserved = 0;
+ g_SkinObjectList.pObjects = NULL;
// Initialize GDI+
InitGdiPlus();
AniAva_InitModule();
//load decoder
- hImageDecoderModule=NULL;
+ hImageDecoderModule = NULL;
if (g_CluiData.fGDIPlusFail)
{
hImageDecoderModule = LoadLibrary(TEXT("ImgDecoder.dll"));
- if (hImageDecoderModule==NULL)
+ if (hImageDecoderModule == NULL)
{
char tDllPath[ MAX_PATH ];
GetModuleFileNameA( g_hInst, tDllPath, sizeof( tDllPath ));
{
char* p = strrchr( tDllPath, '\\' );
- if ( p != NULL )
+ if ( p !=NULL )
strcpy( p+1, "ImgDecoder.dll" );
else
{
@@ -481,13 +481,13 @@ HRESULT SkinEngineLoadModule() hImageDecoderModule = LoadLibraryA(tDllPath);
}
- if (hImageDecoderModule!=NULL)
+ if (hImageDecoderModule != NULL)
{
- ImgNewDecoder=(pfnImgNewDecoder )GetProcAddress( hImageDecoderModule, "ImgNewDecoder");
- ImgDeleteDecoder=(pfnImgDeleteDecoder )GetProcAddress( hImageDecoderModule, "ImgDeleteDecoder");
- ImgNewDIBFromFile=(pfnImgNewDIBFromFile)GetProcAddress( hImageDecoderModule, "ImgNewDIBFromFile");
- ImgDeleteDIBSection=(pfnImgDeleteDIBSection)GetProcAddress( hImageDecoderModule, "ImgDeleteDIBSection");
- ImgGetHandle=(pfnImgGetHandle)GetProcAddress( hImageDecoderModule, "ImgGetHandle");
+ ImgNewDecoder = (pfnImgNewDecoder )GetProcAddress( hImageDecoderModule, "ImgNewDecoder");
+ ImgDeleteDecoder = (pfnImgDeleteDecoder )GetProcAddress( hImageDecoderModule, "ImgDeleteDecoder");
+ ImgNewDIBFromFile = (pfnImgNewDIBFromFile)GetProcAddress( hImageDecoderModule, "ImgNewDIBFromFile");
+ ImgDeleteDIBSection = (pfnImgDeleteDIBSection)GetProcAddress( hImageDecoderModule, "ImgDeleteDIBSection");
+ ImgGetHandle = (pfnImgGetHandle)GetProcAddress( hImageDecoderModule, "ImgGetHandle");
}
}
//create services
@@ -500,7 +500,7 @@ HRESULT SkinEngineLoadModule() CreateServiceFunction(MS_DRAW_TEXT_WITH_EFFECT,ske_Service_DrawTextWithEffect);
//create event handle
- hSkinLoadedEvent=ModernHookEvent(ME_SKIN_SERVICESCREATED,CLUI_OnSkinLoad);
+ hSkinLoadedEvent = ModernHookEvent(ME_SKIN_SERVICESCREATED,CLUI_OnSkinLoad);
NotifyEventHooks(g_CluiData.hEventSkinServicesCreated,0,0);
return S_OK;
}
@@ -520,10 +520,10 @@ int SkinEngineUnloadModule() if (pEffectStack)
{
int i;
- for (i=0; i<pEffectStack->realCount; i++)
+ for (i = 0; i < pEffectStack->realCount; i++)
if (pEffectStack->items[i])
{
- EFFECTSSTACKITEM * effect=(EFFECTSSTACKITEM*)(pEffectStack->items[i]);
+ EFFECTSSTACKITEM * effect = (EFFECTSSTACKITEM*)(pEffectStack->items[i]);
mir_free_and_nill(effect);
}
List_Destroy(pEffectStack);
@@ -539,7 +539,7 @@ int SkinEngineUnloadModule() mod_DeleteDC(g_pCachedWindow->hImageDC);
ReleaseDC(NULL,g_pCachedWindow->hScreenDC);
mir_free_and_nill(g_pCachedWindow);
- g_pCachedWindow=NULL;
+ g_pCachedWindow = NULL;
}
DeleteCriticalSection(&cs_SkinChanging);
GdiFlush();
@@ -559,7 +559,7 @@ BOOL ske_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest {
if (g_CluiData.fDisableSkinEngine && !(!g_CluiData.fGDIPlusFail && blendFunction.BlendFlags&128))
{
- if (nWidthDest!=nWidthSrc || nHeightDest!=nHeightSrc)
+ if (nWidthDest != nWidthSrc || nHeightDest != nHeightSrc)
return StretchBlt(hdcDest,nXOriginDest,nYOriginDest,nWidthDest,nHeightDest,hdcSrc,nXOriginSrc,nYOriginSrc,nWidthSrc,nHeightSrc, SRCCOPY);
else
return BitBlt(hdcDest,nXOriginDest,nYOriginDest,nWidthDest,nHeightDest,hdcSrc,nXOriginSrc,nYOriginSrc, SRCCOPY);
@@ -571,7 +571,7 @@ BOOL ske_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest hdcSrc,nXOriginSrc,nYOriginSrc,nWidthSrc,nHeightSrc,
&blendFunction);
}
- blendFunction.BlendFlags&=~128;
+ blendFunction.BlendFlags &= ~128;
return AlphaBlend(hdcDest,nXOriginDest,nYOriginDest,nWidthDest,nHeightDest,hdcSrc,nXOriginSrc,nYOriginSrc,nWidthSrc,nHeightSrc,blendFunction);
}
@@ -599,21 +599,21 @@ typedef struct _tagDCBuffer HBITMAP hBitmap;
DWORD dwDestroyAfterTime;
}DCBUFFER;
-CRITICAL_SECTION BufferListCS={0};
+CRITICAL_SECTION BufferListCS = {0};
-SortedList * BufferList=NULL;
+SortedList * BufferList = NULL;
enum
{
- BUFFER_DRAWICON=0,
+ BUFFER_DRAWICON = 0,
BUFFER_DRAWIMAGE
};
int SortBufferList(void* it1, void * it2)
{
- DCBUFFER * buf1=(DCBUFFER *)it1;
- DCBUFFER * buf2=(DCBUFFER *)it2;
- if (buf1->hdcOwnedBy!=buf2->hdcOwnedBy) return (int)(buf1->hdcOwnedBy < buf2->hdcOwnedBy);
- else if (buf1->nUsageID!=buf2->nUsageID) return (int) (buf1->nUsageID < buf2->nUsageID);
+ DCBUFFER * buf1 = (DCBUFFER *)it1;
+ DCBUFFER * buf2 = (DCBUFFER *)it2;
+ if (buf1->hdcOwnedBy != buf2->hdcOwnedBy) return (int)(buf1->hdcOwnedBy < buf2->hdcOwnedBy);
+ else if (buf1->nUsageID != buf2->nUsageID) return (int) (buf1->nUsageID < buf2->nUsageID);
else return (int) (buf1->hDC < buf2->hDC);
}
@@ -621,70 +621,70 @@ HDC ske_RequestBufferDC(HDC hdcOwner, int dcID, int width, int height, BOOL fCle {
DCBUFFER buf;
DCBUFFER * pBuf;
- if (BufferList==NULL)
+ if (BufferList == NULL)
{
- BufferList=List_Create(0,2);
- BufferList->sortFunc=SortBufferList;
+ BufferList = List_Create(0,2);
+ BufferList->sortFunc = SortBufferList;
InitializeCriticalSection(&BufferListCS);
}
EnterCriticalSection(&BufferListCS);
//Try to find DC in buffer list
- buf.hdcOwnedBy=hdcOwner;
- buf.nUsageID=dcID;
- buf.hDC=NULL;
- pBuf=(DCBUFFER*)List_Find(BufferList,(void*)&buf);
+ buf.hdcOwnedBy = hdcOwner;
+ buf.nUsageID = dcID;
+ buf.hDC = NULL;
+ pBuf = (DCBUFFER*)List_Find(BufferList,(void*)&buf);
if (!pBuf)
{
//if not found - allocate it
- pBuf=(DCBUFFER *)mir_alloc(sizeof(DCBUFFER));
- *pBuf=buf;
- pBuf->width=width;
- pBuf->height=height;
- pBuf->hBitmap=ske_CreateDIB32Point(width,height,&(pBuf->pImage));
- pBuf->hDC=CreateCompatibleDC(hdcOwner);
- pBuf->oldBitmap=(HBITMAP)SelectObject(pBuf->hDC,pBuf->hBitmap);
- pBuf->dwDestroyAfterTime=0;
+ pBuf = (DCBUFFER *)mir_alloc(sizeof(DCBUFFER));
+ *pBuf = buf;
+ pBuf->width = width;
+ pBuf->height = height;
+ pBuf->hBitmap = ske_CreateDIB32Point(width,height,&(pBuf->pImage));
+ pBuf->hDC = CreateCompatibleDC(hdcOwner);
+ pBuf->oldBitmap = (HBITMAP)SelectObject(pBuf->hDC,pBuf->hBitmap);
+ pBuf->dwDestroyAfterTime = 0;
List_InsertPtr(BufferList,pBuf);
}
else
{
- if (pBuf->width!=width || pBuf->height!=height)
+ if (pBuf->width != width || pBuf->height != height)
{
//resize
SelectObject(pBuf->hDC,pBuf->oldBitmap);
DeleteObject(pBuf->hBitmap);
- pBuf->width=width;
- pBuf->height=height;
- pBuf->hBitmap=ske_CreateDIB32Point(width,height,&(pBuf->pImage));
- pBuf->oldBitmap=(HBITMAP)SelectObject(pBuf->hDC,pBuf->hBitmap);
+ pBuf->width = width;
+ pBuf->height = height;
+ pBuf->hBitmap = ske_CreateDIB32Point(width,height,&(pBuf->pImage));
+ pBuf->oldBitmap = (HBITMAP)SelectObject(pBuf->hDC,pBuf->hBitmap);
} else if (fClear)
memset(pBuf->pImage,0,width*height*sizeof(DWORD));
}
- pBuf->dwDestroyAfterTime=0;
+ pBuf->dwDestroyAfterTime = 0;
LeaveCriticalSection(&BufferListCS);
return pBuf->hDC;
}
int ske_ReleaseBufferDC(HDC hDC, int keepTime)
{
- DWORD dwCurrentTime=GetTickCount();
- DCBUFFER * pBuf=NULL;
+ DWORD dwCurrentTime = GetTickCount();
+ DCBUFFER * pBuf = NULL;
//Try to find DC in buffer list - set flag to be release after time;
- int i=0;
+ int i = 0;
EnterCriticalSection(&BufferListCS);
- for (i=0; i<BufferList->realCount; i++)
+ for (i = 0; i < BufferList->realCount; i++)
{
- pBuf=(DCBUFFER *)BufferList->items[i];
+ pBuf = (DCBUFFER *)BufferList->items[i];
if (pBuf)
{
- if (hDC!=NULL && pBuf->hDC==hDC)
+ if (hDC != NULL && pBuf->hDC == hDC)
{
- pBuf->dwDestroyAfterTime=dwCurrentTime+keepTime;
+ pBuf->dwDestroyAfterTime = dwCurrentTime+keepTime;
break;
}
else
{
- if ((pBuf->dwDestroyAfterTime && pBuf->dwDestroyAfterTime < dwCurrentTime) || keepTime==-1)
+ if ((pBuf->dwDestroyAfterTime && pBuf->dwDestroyAfterTime < dwCurrentTime) || keepTime == -1)
{
SelectObject(pBuf->hDC,pBuf->oldBitmap);
DeleteObject(pBuf->hBitmap);
@@ -707,11 +707,11 @@ BOOL ske_SetRgnOpaque(HDC memdc,HRGN hrgn, BOOL force) DWORD d;
RECT * rect;
if (g_CluiData.fDisableSkinEngine && !force) return TRUE;
- rgnsz=GetRegionData(hrgn,0,NULL);
- rdata=(RGNDATA *) mir_alloc(rgnsz);
+ rgnsz = GetRegionData(hrgn,0,NULL);
+ rdata = (RGNDATA *) mir_alloc(rgnsz);
GetRegionData(hrgn,rgnsz,rdata);
- rect=(RECT *)rdata->Buffer;
- for (d=0; d<rdata->rdh.nCount; d++)
+ rect = (RECT *)rdata->Buffer;
+ for (d = 0; d < rdata->rdh.nCount; d++)
{
ske_SetRectOpaque(memdc,&rect[d], force);
}
@@ -722,7 +722,7 @@ BOOL ske_SetRgnOpaque(HDC memdc,HRGN hrgn, BOOL force) BOOL ske_SetRectOpaque(HDC memdc,RECT *fr, BOOL force)
{
- int f=0;
+ int f = 0;
BYTE * bits;
BITMAP bmp;
HBITMAP hbmp;
@@ -730,27 +730,27 @@ BOOL ske_SetRectOpaque(HDC memdc,RECT *fr, BOOL force) if ( g_CluiData.fDisableSkinEngine && !force )
return TRUE;
- hbmp=(HBITMAP)GetCurrentObject( memdc,OBJ_BITMAP );
+ hbmp = (HBITMAP)GetCurrentObject( memdc,OBJ_BITMAP );
GetObject( hbmp, sizeof(bmp), &bmp );
- if ( bmp.bmPlanes != 1 )
+ if ( bmp.bmPlanes !=1 )
return FALSE;
if (!bmp.bmBits)
{
- f=1;
- bits=(BYTE*)malloc(bmp.bmWidthBytes*bmp.bmHeight);
+ f = 1;
+ bits = (BYTE*)malloc(bmp.bmWidthBytes*bmp.bmHeight);
GetBitmapBits(hbmp,bmp.bmWidthBytes*bmp.bmHeight,bits);
}
else
- bits=(BYTE*)bmp.bmBits;
+ bits = (BYTE*)bmp.bmBits;
- int sx =( fr->left > 0 ) ? fr->left : 0;
- int sy =( fr->top > 0 ) ? fr->top : 0;
- int ex =( fr->right < bmp.bmWidth ) ? fr->right : bmp.bmWidth;
- int ey =( fr->bottom<bmp.bmHeight) ? fr->bottom : bmp.bmHeight;
+ int sx = ( fr->left > 0 ) ? fr->left : 0;
+ int sy = ( fr->top > 0 ) ? fr->top : 0;
+ int ex = ( fr->right < bmp.bmWidth ) ? fr->right : bmp.bmWidth;
+ int ey = ( fr->bottom < bmp.bmHeight) ? fr->bottom : bmp.bmHeight;
- int width=ex-sx;
+ int width = ex-sx;
BYTE* pLine = ((BYTE*)bits) + (bmp.bmHeight-sy-1)*bmp.bmWidthBytes + (sx << 2) + 3;
for ( int y = 0; y < (ey - sy); y++ )
@@ -759,9 +759,9 @@ BOOL ske_SetRectOpaque(HDC memdc,RECT *fr, BOOL force) for ( int x = 0; x < width; x++ )
{
*pColumn = 255;
- pColumn += 4;
+ pColumn += 4;
}
- pLine -= bmp.bmWidthBytes;
+ pLine -= bmp.bmWidthBytes;
}
if (f)
{
@@ -774,31 +774,31 @@ BOOL ske_SetRectOpaque(HDC memdc,RECT *fr, BOOL force) static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * rGlyph, RECT * rClip, BYTE mode, BYTE drawMode, int depth)
{
- int destw=0, desth=0;
- int xstart=0, xmax=0;
- int ystart=0, ymax=0;
- BLENDFUNCTION bfa={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ int destw = 0, desth = 0;
+ int xstart = 0, xmax = 0;
+ int ystart = 0, ymax = 0;
+ BLENDFUNCTION bfa = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
//initializations
- if (mode==FM_STRETCH)
+ if (mode == FM_STRETCH)
{
HDC mem2dc;
HBITMAP mem2bmp, oldbmp;
RECT wr;
IntersectRect(&wr,rClip,rFill);
- if ((wr.bottom-wr.top)*(wr.right-wr.left)==0) return 0;
- if (drawMode!=2)
+ if ((wr.bottom-wr.top)*(wr.right-wr.left) == 0) return 0;
+ if (drawMode != 2)
{
- mem2dc=CreateCompatibleDC(hDest);
- mem2bmp=ske_CreateDIB32(wr.right-wr.left,wr.bottom-wr.top);
- oldbmp=(HBITMAP)SelectObject(mem2dc,mem2bmp);
+ mem2dc = CreateCompatibleDC(hDest);
+ mem2bmp = ske_CreateDIB32(wr.right-wr.left,wr.bottom-wr.top);
+ oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp);
}
- if (drawMode==0 || drawMode==2)
+ if (drawMode == 0 || drawMode == 2)
{
- if (drawMode==0)
+ if (drawMode == 0)
{
ske_AlphaBlend(mem2dc,rFill->left-wr.left,rFill->top-wr.top,rFill->right-rFill->left,rFill->bottom-rFill->top,
hSource,rGlyph->left,rGlyph->top,rGlyph->right-rGlyph->left,rGlyph->bottom-rGlyph->top,bf);
@@ -813,12 +813,12 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * }
else
{
- // BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, 0 };
+ // BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, 0 };
ske_AlphaBlend(mem2dc,rFill->left-wr.left,rFill->top-wr.top,rFill->right-rFill->left,rFill->bottom-rFill->top,
hSource,rGlyph->left,rGlyph->top,rGlyph->right-rGlyph->left,rGlyph->bottom-rGlyph->top,bf);
ske_AlphaBlend(hDest,wr.left,wr.top,wr.right-wr.left, wr.bottom -wr.top,mem2dc,0,0,wr.right-wr.left, wr.bottom -wr.top,bf);
}
- if (drawMode!=2)
+ if (drawMode != 2)
{
SelectObject(mem2dc,oldbmp);
DeleteObject(mem2bmp);
@@ -826,69 +826,69 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * }
return 1;
}
- else if (mode==FM_TILE_VERT && (rGlyph->bottom-rGlyph->top>0)&& (rGlyph->right-rGlyph->left>0))
+ else if (mode == FM_TILE_VERT && (rGlyph->bottom-rGlyph->top>0)&& (rGlyph->right-rGlyph->left>0))
{
HDC mem2dc;
HBITMAP mem2bmp,oldbmp;
RECT wr;
IntersectRect(&wr,rClip,rFill);
- if ((wr.bottom-wr.top)*(wr.right-wr.left)==0) return 0;
- mem2dc=CreateCompatibleDC(hDest);
+ if ((wr.bottom-wr.top)*(wr.right-wr.left) == 0) return 0;
+ mem2dc = CreateCompatibleDC(hDest);
//SetStretchBltMode(mem2dc, HALFTONE);
- mem2bmp=ske_CreateDIB32(wr.right-wr.left, rGlyph->bottom-rGlyph->top);
- oldbmp=(HBITMAP)SelectObject(mem2dc,mem2bmp);
+ mem2bmp = ske_CreateDIB32(wr.right-wr.left, rGlyph->bottom-rGlyph->top);
+ oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp);
if (!oldbmp)
return 0;
/// draw here
{
- int y=0, sy=0, maxy=0;
- int w=rFill->right-rFill->left;
- int h=rGlyph->bottom-rGlyph->top;
- if (h>0 && (wr.bottom-wr.top)*(wr.right-wr.left)!=0)
+ int y = 0, sy = 0, maxy = 0;
+ int w = rFill->right-rFill->left;
+ int h = rGlyph->bottom-rGlyph->top;
+ if (h>0 && (wr.bottom-wr.top)*(wr.right-wr.left) != 0)
{
- w=wr.right-wr.left;
+ w = wr.right-wr.left;
{
- // BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, 0 };
+ // BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, 0 };
ske_AlphaBlend(mem2dc,-(wr.left-rFill->left),0,rFill->right-rFill->left,h,hSource,rGlyph->left,rGlyph->top,rGlyph->right-rGlyph->left,h,bf);
//StretchBlt(mem2dc,-(wr.left-rFill->left),0,rFill->right-rFill->left,h,hSource,rGlyph->left,rGlyph->top,rGlyph->right-rGlyph->left,h,SRCCOPY);
}
- if (drawMode==0 || drawMode==2)
+ if (drawMode == 0 || drawMode == 2)
{
- if (drawMode==0 )
+ if (drawMode == 0 )
{
int dy;
- dy=(wr.top-rFill->top)%h;
- if (dy>=0)
+ dy = (wr.top-rFill->top)%h;
+ if (dy >= 0)
{
int ht;
- y=wr.top;
- ht=(y+h-dy<=wr.bottom)?(h-dy):(wr.bottom-wr.top);
+ y = wr.top;
+ ht = (y+h-dy <= wr.bottom)?(h-dy):(wr.bottom-wr.top);
BitBlt(hDest,wr.left,y,w,ht,mem2dc,0,dy,SRCCOPY);
}
- y=wr.top+h-dy;
- while (y<wr.bottom-h){
+ y = wr.top+h-dy;
+ while (y < wr.bottom-h){
BitBlt(hDest,wr.left,y,w,h,mem2dc,0,0,SRCCOPY);
- y+=h;
+ y += h;
}
- if (y<=wr.bottom)
+ if (y <= wr.bottom)
BitBlt(hDest,wr.left,y,w,wr.bottom-y, mem2dc,0,0,SRCCOPY);
}
else
{
- y=wr.top;
- while (y<wr.bottom-h)
+ y = wr.top;
+ while (y < wr.bottom-h)
{
- // BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, 0 };
+ // BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, 0 };
ske_AlphaBlend(hDest,wr.left,y,w,h, mem2dc,0,0,w,h,bf);
- y+=h;
+ y += h;
}
- if (y<=wr.bottom)
+ if (y <= wr.bottom)
{
- // BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, 0 };
+ // BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, 0 };
ske_AlphaBlend(hDest,wr.left,y,w,wr.bottom-y, mem2dc,0,0,w,wr.bottom-y,bf);
}
}
@@ -898,25 +898,25 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * {
int dy;
- BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- dy=(wr.top-rFill->top)%h;
+ dy = (wr.top-rFill->top)%h;
- if (dy>=0)
+ if (dy >= 0)
{
int ht;
- y=wr.top;
- ht=(y+h-dy<=wr.bottom)?(h-dy):(wr.bottom-wr.top);
+ y = wr.top;
+ ht = (y+h-dy <= wr.bottom)?(h-dy):(wr.bottom-wr.top);
ske_AlphaBlend(hDest,wr.left,y,w,ht,mem2dc,0,dy,w,ht,bf);
}
- y=wr.top+h-dy;
- while (y<wr.bottom-h)
+ y = wr.top+h-dy;
+ while (y < wr.bottom-h)
{
ske_AlphaBlend(hDest,wr.left,y,w,h,mem2dc,0,0,w,h,bf);
- y+=h;
+ y += h;
}
- if (y<=wr.bottom)
+ if (y <= wr.bottom)
ske_AlphaBlend(hDest,wr.left,y,w,wr.bottom-y, mem2dc,0,0,w,wr.bottom-y,bf);
}
}
@@ -925,86 +925,86 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * DeleteObject(mem2bmp);
mod_DeleteDC(mem2dc);
}
- else if (mode==FM_TILE_HORZ && (rGlyph->right-rGlyph->left>0)&& (rGlyph->bottom-rGlyph->top>0)&&(rFill->bottom-rFill->top)>0 && (rFill->right-rFill->left)>0)
+ else if (mode == FM_TILE_HORZ && (rGlyph->right-rGlyph->left>0)&& (rGlyph->bottom-rGlyph->top>0)&&(rFill->bottom-rFill->top)>0 && (rFill->right-rFill->left)>0)
{
HDC mem2dc;
RECT wr;
HBITMAP mem2bmp,oldbmp;
- int w=rGlyph->right-rGlyph->left;
- int h=rFill->bottom-rFill->top;
+ int w = rGlyph->right-rGlyph->left;
+ int h = rFill->bottom-rFill->top;
IntersectRect(&wr,rClip,rFill);
- if ((wr.bottom-wr.top)*(wr.right-wr.left)==0) return 0;
- h=wr.bottom-wr.top;
- mem2dc=CreateCompatibleDC(hDest);
+ if ((wr.bottom-wr.top)*(wr.right-wr.left) == 0) return 0;
+ h = wr.bottom-wr.top;
+ mem2dc = CreateCompatibleDC(hDest);
- mem2bmp=ske_CreateDIB32(w,h);
- oldbmp=(HBITMAP)SelectObject(mem2dc,mem2bmp);
+ mem2bmp = ske_CreateDIB32(w,h);
+ oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp);
if (!oldbmp)
return 0;
/// draw here
{
- int x=0, sy=0, maxy=0;
+ int x = 0, sy = 0, maxy = 0;
{
//SetStretchBltMode(mem2dc, HALFTONE);
//StretchBlt(mem2dc,0,0,w,h,hSource,rGlyph->left+(wr.left-rFill->left),rGlyph->top,w,h,SRCCOPY);
- // BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, 0 };
+ // BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, 0 };
ske_AlphaBlend(mem2dc,0,-(wr.top-rFill->top),w,rFill->bottom-rFill->top,hSource,rGlyph->left,rGlyph->top,w,rGlyph->bottom-rGlyph->top,bf);
- if (drawMode==0 || drawMode==2)
+ if (drawMode == 0 || drawMode == 2)
{
- if (drawMode==0)
+ if (drawMode == 0)
{
int dx;
- dx=(wr.left-rFill->left)%w;
- if (dx>=0)
+ dx = (wr.left-rFill->left)%w;
+ if (dx >= 0)
{
int wt;
- x=wr.left;
- wt=(x+w-dx<=wr.right)?(w-dx):(wr.right-wr.left);
+ x = wr.left;
+ wt = (x+w-dx <= wr.right)?(w-dx):(wr.right-wr.left);
BitBlt(hDest,x,wr.top,wt,h,mem2dc,dx,0,SRCCOPY);
}
- x=wr.left+w-dx;
- while (x<wr.right-w){
+ x = wr.left+w-dx;
+ while (x < wr.right-w){
BitBlt(hDest,x,wr.top,w,h,mem2dc,0,0,SRCCOPY);
- x+=w;
+ x += w;
}
- if (x<=wr.right)
+ if (x <= wr.right)
BitBlt(hDest,x,wr.top,wr.right-x,h, mem2dc,0,0,SRCCOPY);
}
else
{
int dx;
- dx=(wr.left-rFill->left)%w;
- x=wr.left-dx;
- while (x<wr.right-w){
+ dx = (wr.left-rFill->left)%w;
+ x = wr.left-dx;
+ while (x < wr.right-w){
ske_AlphaBlend(hDest,x,wr.top,w,h,mem2dc,0,0,w,h,bf);
- x+=w;
+ x += w;
}
- if (x<=wr.right)
+ if (x <= wr.right)
ske_AlphaBlend(hDest,x,wr.top,wr.right-x,h, mem2dc,0,0,wr.right-x,h,bf);
}
}
else
{
- BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
int dx;
- dx=(wr.left-rFill->left)%w;
- if (dx>=0)
+ dx = (wr.left-rFill->left)%w;
+ if (dx >= 0)
{
int wt;
- x=wr.left;
- wt=(x+w-dx<=wr.right)?(w-dx):(wr.right-wr.left);
+ x = wr.left;
+ wt = (x+w-dx <= wr.right)?(w-dx):(wr.right-wr.left);
ske_AlphaBlend(hDest,x,wr.top,wt,h,mem2dc,dx,0,wt,h,bf);
}
- x=wr.left+w-dx;
- while (x<wr.right-w){
+ x = wr.left+w-dx;
+ while (x < wr.right-w){
ske_AlphaBlend(hDest,x,wr.top,w,h,mem2dc,0,0,w,h,bf);
- x+=w;
+ x += w;
}
- if (x<=wr.right)
+ if (x <= wr.right)
ske_AlphaBlend(hDest,x,wr.top,wr.right-x,h, mem2dc,0,0,wr.right-x,h,bf);
}
@@ -1014,20 +1014,20 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * DeleteObject(mem2bmp);
mod_DeleteDC(mem2dc);
}
- else if (mode==FM_TILE_BOTH && (rGlyph->right-rGlyph->left>0) && (rGlyph->bottom-rGlyph->top>0))
+ else if (mode == FM_TILE_BOTH && (rGlyph->right-rGlyph->left>0) && (rGlyph->bottom-rGlyph->top>0))
{
HDC mem2dc;
- int w=rGlyph->right-rGlyph->left;
- int x=0, sy=0, maxy=0;
- int h=rFill->bottom-rFill->top;
+ int w = rGlyph->right-rGlyph->left;
+ int x = 0, sy = 0, maxy = 0;
+ int h = rFill->bottom-rFill->top;
HBITMAP mem2bmp,oldbmp;
RECT wr;
IntersectRect(&wr,rClip,rFill);
- if ((wr.bottom-wr.top)*(wr.right-wr.left)==0) return 0;
- mem2dc=CreateCompatibleDC(hDest);
- mem2bmp=ske_CreateDIB32(w,wr.bottom-wr.top);
- h=wr.bottom-wr.top;
- oldbmp=(HBITMAP)SelectObject(mem2dc,mem2bmp);
+ if ((wr.bottom-wr.top)*(wr.right-wr.left) == 0) return 0;
+ mem2dc = CreateCompatibleDC(hDest);
+ mem2bmp = ske_CreateDIB32(w,wr.bottom-wr.top);
+ h = wr.bottom-wr.top;
+ oldbmp = (HBITMAP)SelectObject(mem2dc,mem2bmp);
#ifdef _DEBUG
if (!oldbmp)
(NULL,"Tile bitmap not selected","ERROR", MB_OK);
@@ -1039,72 +1039,72 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT * rFill, RECT * {
int y;
int dy;
- dy=(wr.top-rFill->top)%(rGlyph->bottom-rGlyph->top);
- y=-dy;
- while (y<wr.bottom-wr.top)
+ dy = (wr.top-rFill->top)%(rGlyph->bottom-rGlyph->top);
+ y = -dy;
+ while (y < wr.bottom-wr.top)
{
ske_AlphaBlend(mem2dc,0,y,w,rGlyph->bottom-rGlyph->top, hSource,rGlyph->left,rGlyph->top,w,rGlyph->bottom-rGlyph->top,bf);
- y+=rGlyph->bottom-rGlyph->top;
+ y += rGlyph->bottom-rGlyph->top;
}
//--
//end temp bitmap
- if (drawMode==0 || drawMode==2)
+ if (drawMode == 0 || drawMode == 2)
{
- if (drawMode==0)
+ if (drawMode == 0)
{
int dx;
- dx=(wr.left-rFill->left)%w;
- if (dx>=0)
+ dx = (wr.left-rFill->left)%w;
+ if (dx >= 0)
{
int wt;
- x=wr.left;
- wt=(x+w-dx<=wr.right)?(w-dx):(wr.right-wr.left);
+ x = wr.left;
+ wt = (x+w-dx <= wr.right)?(w-dx):(wr.right-wr.left);
BitBlt(hDest,x,wr.top,wt,h,mem2dc,dx,0,SRCCOPY);
}
- x=wr.left+w-dx;
- while (x<wr.right-w){
+ x = wr.left+w-dx;
+ while (x < wr.right-w){
BitBlt(hDest,x,wr.top,w,h,mem2dc,0,0,SRCCOPY);
- x+=w;
+ x += w;
}
- if (x<=wr.right)
+ if (x <= wr.right)
BitBlt(hDest,x,wr.top,wr.right-x,h, mem2dc,0,0,SRCCOPY);
}
else
{
int dx;
- dx=(wr.left-rFill->left)%w;
- x=wr.left-dx;
- while (x<wr.right-w){
+ dx = (wr.left-rFill->left)%w;
+ x = wr.left-dx;
+ while (x < wr.right-w){
ske_AlphaBlend(hDest,x,wr.top,w,h,mem2dc,0,0,w,h,bf);
- x+=w;
+ x += w;
}
- if (x<=wr.right)
+ if (x <= wr.right)
ske_AlphaBlend(hDest,x,wr.top,wr.right-x,h, mem2dc,0,0,wr.right-x,h,bf);
}
}
else
{
- BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
int dx;
- dx=(wr.left-rFill->left)%w;
- if (dx>=0)
+ dx = (wr.left-rFill->left)%w;
+ if (dx >= 0)
{
int wt;
- x=wr.left;
- wt=(x+w-dx<=wr.right)?(w-dx):(wr.right-wr.left);
+ x = wr.left;
+ wt = (x+w-dx <= wr.right)?(w-dx):(wr.right-wr.left);
ske_AlphaBlend(hDest,x,wr.top,wt,h,mem2dc,dx,0,wt,h,bf);
}
- x=wr.left+w-dx;
- while (x<wr.right-w){
+ x = wr.left+w-dx;
+ while (x < wr.right-w){
ske_AlphaBlend(hDest,x,wr.top,w,h,mem2dc,0,0,w,h,bf);
- x+=w;
+ x += w;
}
- if (x<=wr.right)
+ if (x <= wr.right)
ske_AlphaBlend(hDest,x,wr.top,wr.right-x,h, mem2dc,0,0,wr.right-x,h,bf);
}
@@ -1138,11 +1138,11 @@ HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits) }
ZeroMemory(&RGB32BitsBITMAPINFO,sizeof(BITMAPINFO));
- RGB32BitsBITMAPINFO.bmiHeader.biSize=sizeof(BITMAPINFOHEADER);
- RGB32BitsBITMAPINFO.bmiHeader.biWidth=cx;//bm.bmWidth;
- RGB32BitsBITMAPINFO.bmiHeader.biHeight=cy;//bm.bmHeight;
- RGB32BitsBITMAPINFO.bmiHeader.biPlanes=1;
- RGB32BitsBITMAPINFO.bmiHeader.biBitCount=32;
+ RGB32BitsBITMAPINFO.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ RGB32BitsBITMAPINFO.bmiHeader.biWidth = cx;//bm.bmWidth;
+ RGB32BitsBITMAPINFO.bmiHeader.biHeight = cy;//bm.bmHeight;
+ RGB32BitsBITMAPINFO.bmiHeader.biPlanes = 1;
+ RGB32BitsBITMAPINFO.bmiHeader.biBitCount = 32;
// pointer used for direct Bitmap pixels access
@@ -1151,7 +1151,7 @@ HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits) DIB_RGB_COLORS,
(void **)&ptPixels,
NULL, 0);
- if ((DirectBitmap == NULL || ptPixels == NULL) && cx!= 0 && cy!=0)
+ if ((DirectBitmap == NULL || ptPixels == NULL) && cx != 0 && cy != 0)
{
#ifdef _DEBUG
MessageBoxA(NULL,"Object not allocated. Check GDI object count","ERROR",MB_OK|MB_ICONERROR);
@@ -1160,7 +1160,7 @@ HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits) ;
}
else memset(ptPixels,0,cx*cy*4);
- if (bits!=NULL) *bits=ptPixels;
+ if (bits != NULL) *bits = ptPixels;
return DirectBitmap;
}
@@ -1189,7 +1189,7 @@ HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque) inside = Opaque ? (buf->rgbReserved > Level) : (buf->rgbReserved < Level);
++buf;
- if (inside != lastin)
+ if (inside !=lastin)
{
if (inside)
{
@@ -1229,44 +1229,44 @@ HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque) static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
{
- HDC memdc=NULL, glyphdc=NULL;
- int k=0;
- //BITMAP bmp={0};
- HBITMAP membmp=0,oldbmp=0,oldglyph=0;
- BYTE Is32Bit=0;
+ HDC memdc = NULL, glyphdc = NULL;
+ int k = 0;
+ //BITMAP bmp = {0};
+ HBITMAP membmp = 0,oldbmp = 0,oldglyph = 0;
+ BYTE Is32Bit = 0;
RECT PRect;
- POINT mode2offset={0};
- int depth=0;
- int mode=0; //0-FastDraw, 1-DirectAlphaDraw, 2-BufferedAlphaDraw
+ POINT mode2offset = {0};
+ int depth = 0;
+ int mode = 0; //0-FastDraw, 1-DirectAlphaDraw, 2-BufferedAlphaDraw
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;
+ 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);
- depth=depth<16?16:depth;
- Is32Bit=pobj->bmBitsPixel==32;
- if ((!Is32Bit && pobj->dwAlpha==255)&& pobj->Style!=ST_BRUSH) mode=0;
- else if (pobj->dwAlpha==255 && pobj->Style!=ST_BRUSH) mode=1;
- else mode=2;
+ depth = GetDeviceCaps(preq->hDC,BITSPIXEL);
+ depth = depth < 16?16:depth;
+ Is32Bit = pobj->bmBitsPixel == 32;
+ if ((!Is32Bit && pobj->dwAlpha == 255)&& pobj->Style != ST_BRUSH) mode = 0;
+ else if (pobj->dwAlpha == 255 && pobj->Style != ST_BRUSH) mode = 1;
+ else mode = 2;
// End painting mode
//force mode
- if(preq->rcClipRect.bottom-preq->rcClipRect.top*preq->rcClipRect.right-preq->rcClipRect.left==0)
- preq->rcClipRect=preq->rcDestRect;
+ if (preq->rcClipRect.bottom-preq->rcClipRect.top*preq->rcClipRect.right-preq->rcClipRect.left == 0)
+ preq->rcClipRect = preq->rcDestRect;
IntersectRect(&PRect,&preq->rcDestRect,&preq->rcClipRect);
if (IsRectEmpty(&PRect))
{
return 0;
}
- if (mode==2)
+ if (mode == 2)
{
- memdc=CreateCompatibleDC(preq->hDC);
- membmp=ske_CreateDIB32(PRect.right-PRect.left,PRect.bottom-PRect.top);
- oldbmp=(HBITMAP)SelectObject(memdc,membmp);
- if (oldbmp==NULL)
+ memdc = CreateCompatibleDC(preq->hDC);
+ membmp = ske_CreateDIB32(PRect.right-PRect.left,PRect.bottom-PRect.top);
+ oldbmp = (HBITMAP)SelectObject(memdc,membmp);
+ if (oldbmp == NULL)
{
- if (mode==2)
+ if (mode == 2)
{
SelectObject(memdc,oldbmp);
mod_DeleteDC(memdc);
@@ -1276,24 +1276,24 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) }
}
- if (mode!=2) memdc=preq->hDC;
+ if (mode != 2) memdc = preq->hDC;
{
- if (pobj->hGlyph && pobj->hGlyph!=(HBITMAP)-1)
+ if (pobj->hGlyph && pobj->hGlyph != (HBITMAP)-1)
{
- glyphdc=CreateCompatibleDC(preq->hDC);
+ glyphdc = CreateCompatibleDC(preq->hDC);
if (!oldglyph)
- oldglyph=(HBITMAP)SelectObject(glyphdc,pobj->hGlyph);
+ oldglyph = (HBITMAP)SelectObject(glyphdc,pobj->hGlyph);
else
SelectObject(glyphdc,pobj->hGlyph);
}
// Drawing
{
RECT rFill, rGlyph, rClip;
- if ((pobj->Style&7) ==ST_BRUSH)
+ if ((pobj->Style&7) == ST_BRUSH)
{
- HBRUSH br=CreateSolidBrush(pobj->dwColor);
+ HBRUSH br = CreateSolidBrush(pobj->dwColor);
RECT fr;
- if (mode==2)
+ if (mode == 2)
{
SetRect(&fr,0,0,PRect.right-PRect.left,PRect.bottom-PRect.top);
FillRect(memdc,&fr,br);
@@ -1302,220 +1302,220 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) }
else
{
- fr=PRect;
+ fr = PRect;
// SetRect(&fr,0,0,PRect.right-PRect.left,PRect.bottom-PRect.top);
FillRect(preq->hDC,&fr,br);
}
DeleteObject(br);
- k=-1;
+ k = -1;
}
else
{
- if (mode==2)
+ if (mode == 2)
{
- mode2offset.x=PRect.left;
- mode2offset.y=PRect.top;
+ mode2offset.x = PRect.left;
+ mode2offset.y = PRect.top;
OffsetRect(&PRect,-mode2offset.x,-mode2offset.y);
}
- rClip=(preq->rcClipRect);
+ rClip = (preq->rcClipRect);
{
- int lft=0;
- int top=0;
- int rgh=pobj->bmWidth;
- int btm=pobj->bmHeight;
- if ((pobj->Style&7) ==ST_FRAGMENT)
+ int lft = 0;
+ int top = 0;
+ int rgh = pobj->bmWidth;
+ int btm = pobj->bmHeight;
+ if ((pobj->Style&7) == ST_FRAGMENT)
{
- lft=pobj->clipArea.x;
- top=pobj->clipArea.y;
- rgh=min(rgh,lft+pobj->szclipArea.cx);
- btm=min(btm,top+pobj->szclipArea.cy);
+ lft = pobj->clipArea.x;
+ top = pobj->clipArea.y;
+ rgh = min(rgh,lft+pobj->szclipArea.cx);
+ btm = min(btm,top+pobj->szclipArea.cy);
}
// Draw center...
if (1)
{
- rFill.top=preq->rcDestRect.top+pobj->dwTop;
- rFill.bottom=preq->rcDestRect.bottom-pobj->dwBottom;
- rFill.left=preq->rcDestRect.left+pobj->dwLeft;
- rFill.right=preq->rcDestRect.right-pobj->dwRight;
+ rFill.top = preq->rcDestRect.top+pobj->dwTop;
+ rFill.bottom = preq->rcDestRect.bottom-pobj->dwBottom;
+ rFill.left = preq->rcDestRect.left+pobj->dwLeft;
+ rFill.right = preq->rcDestRect.right-pobj->dwRight;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.top=top+pobj->dwTop;
- rGlyph.left=lft+pobj->dwLeft;
- rGlyph.right=rgh-pobj->dwRight;
- rGlyph.bottom=btm-pobj->dwBottom;
+ rGlyph.top = top+pobj->dwTop;
+ rGlyph.left = lft+pobj->dwLeft;
+ rGlyph.right = rgh-pobj->dwRight;
+ rGlyph.bottom = btm-pobj->dwBottom;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode,mode,depth);
}
// Draw top side...
- if(1)
+ if (1)
{
- rFill.top=preq->rcDestRect.top;
- rFill.bottom=preq->rcDestRect.top+pobj->dwTop;
- rFill.left=preq->rcDestRect.left+pobj->dwLeft;
- rFill.right=preq->rcDestRect.right-pobj->dwRight;
+ rFill.top = preq->rcDestRect.top;
+ rFill.bottom = preq->rcDestRect.top+pobj->dwTop;
+ rFill.left = preq->rcDestRect.left+pobj->dwLeft;
+ rFill.right = preq->rcDestRect.right-pobj->dwRight;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.top=top+0;
- rGlyph.left=lft+pobj->dwLeft;
- rGlyph.right=rgh-pobj->dwRight;
- rGlyph.bottom=top+pobj->dwTop;
+ rGlyph.top = top+0;
+ rGlyph.left = lft+pobj->dwLeft;
+ rGlyph.right = rgh-pobj->dwRight;
+ rGlyph.bottom = top+pobj->dwTop;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode&FM_TILE_HORZ,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode&FM_TILE_HORZ,mode,depth);
}
// Draw bottom side...
- if(1)
+ if (1)
{
- rFill.top=preq->rcDestRect.bottom-pobj->dwBottom;
- rFill.bottom=preq->rcDestRect.bottom;
- rFill.left=preq->rcDestRect.left+pobj->dwLeft;
- rFill.right=preq->rcDestRect.right-pobj->dwRight;
+ rFill.top = preq->rcDestRect.bottom-pobj->dwBottom;
+ rFill.bottom = preq->rcDestRect.bottom;
+ rFill.left = preq->rcDestRect.left+pobj->dwLeft;
+ rFill.right = preq->rcDestRect.right-pobj->dwRight;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.top=btm-pobj->dwBottom;
- rGlyph.left=lft+pobj->dwLeft;
- rGlyph.right=rgh-pobj->dwRight;
- rGlyph.bottom=btm;
+ rGlyph.top = btm-pobj->dwBottom;
+ rGlyph.left = lft+pobj->dwLeft;
+ rGlyph.right = rgh-pobj->dwRight;
+ rGlyph.bottom = btm;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode&FM_TILE_HORZ,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode&FM_TILE_HORZ,mode,depth);
}
// Draw left side...
- if(1)
+ if (1)
{
- rFill.top=preq->rcDestRect.top+pobj->dwTop;
- rFill.bottom=preq->rcDestRect.bottom-pobj->dwBottom;
- rFill.left=preq->rcDestRect.left;
- rFill.right=preq->rcDestRect.left+pobj->dwLeft;
+ rFill.top = preq->rcDestRect.top+pobj->dwTop;
+ rFill.bottom = preq->rcDestRect.bottom-pobj->dwBottom;
+ rFill.left = preq->rcDestRect.left;
+ rFill.right = preq->rcDestRect.left+pobj->dwLeft;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.top=top+pobj->dwTop;
- rGlyph.left=lft;
- rGlyph.right=lft+pobj->dwLeft;
- rGlyph.bottom=btm-pobj->dwBottom;
+ rGlyph.top = top+pobj->dwTop;
+ rGlyph.left = lft;
+ rGlyph.right = lft+pobj->dwLeft;
+ rGlyph.bottom = btm-pobj->dwBottom;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode&FM_TILE_VERT,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode&FM_TILE_VERT,mode,depth);
}
// Draw right side...
- if(1)
+ if (1)
{
- rFill.top=preq->rcDestRect.top+pobj->dwTop;
- rFill.bottom=preq->rcDestRect.bottom-pobj->dwBottom;
- rFill.left=preq->rcDestRect.right-pobj->dwRight;
- rFill.right=preq->rcDestRect.right;
+ rFill.top = preq->rcDestRect.top+pobj->dwTop;
+ rFill.bottom = preq->rcDestRect.bottom-pobj->dwBottom;
+ rFill.left = preq->rcDestRect.right-pobj->dwRight;
+ rFill.right = preq->rcDestRect.right;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.top=top+pobj->dwTop;
- rGlyph.left=rgh-pobj->dwRight;
- rGlyph.right=rgh;
- rGlyph.bottom=btm-pobj->dwBottom;
+ rGlyph.top = top+pobj->dwTop;
+ rGlyph.left = rgh-pobj->dwRight;
+ rGlyph.right = rgh;
+ rGlyph.bottom = btm-pobj->dwBottom;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode&FM_TILE_VERT,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,pobj->FitMode&FM_TILE_VERT,mode,depth);
}
// Draw Top-Left corner...
- if(1)
+ if (1)
{
- rFill.top=preq->rcDestRect.top;
- rFill.bottom=preq->rcDestRect.top+pobj->dwTop;
- rFill.left=preq->rcDestRect.left;
- rFill.right=preq->rcDestRect.left+pobj->dwLeft;
+ rFill.top = preq->rcDestRect.top;
+ rFill.bottom = preq->rcDestRect.top+pobj->dwTop;
+ rFill.left = preq->rcDestRect.left;
+ rFill.right = preq->rcDestRect.left+pobj->dwLeft;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.top=top;
- rGlyph.left=lft;
- rGlyph.right=lft+pobj->dwLeft;
- rGlyph.bottom=top+pobj->dwTop;
+ rGlyph.top = top;
+ rGlyph.left = lft;
+ rGlyph.right = lft+pobj->dwLeft;
+ rGlyph.bottom = top+pobj->dwTop;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,0,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,0,mode,depth);
}
// Draw Top-Right corner...
- if(1)
+ if (1)
{
- rFill.top=preq->rcDestRect.top;
- rFill.bottom=preq->rcDestRect.top+pobj->dwTop;
- rFill.left=preq->rcDestRect.right-pobj->dwRight;
- rFill.right=preq->rcDestRect.right;
+ rFill.top = preq->rcDestRect.top;
+ rFill.bottom = preq->rcDestRect.top+pobj->dwTop;
+ rFill.left = preq->rcDestRect.right-pobj->dwRight;
+ rFill.right = preq->rcDestRect.right;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.top=top;
- rGlyph.left=rgh-pobj->dwRight;
- rGlyph.right=rgh;
- rGlyph.bottom=top+pobj->dwTop;
+ rGlyph.top = top;
+ rGlyph.left = rgh-pobj->dwRight;
+ rGlyph.right = rgh;
+ rGlyph.bottom = top+pobj->dwTop;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,0,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,0,mode,depth);
}
// Draw Bottom-Left corner...
- if(1)
+ if (1)
{
- rFill.top=preq->rcDestRect.bottom-pobj->dwBottom;
- rFill.bottom=preq->rcDestRect.bottom;
- rFill.left=preq->rcDestRect.left;
- rFill.right=preq->rcDestRect.left+pobj->dwLeft;
+ rFill.top = preq->rcDestRect.bottom-pobj->dwBottom;
+ rFill.bottom = preq->rcDestRect.bottom;
+ rFill.left = preq->rcDestRect.left;
+ rFill.right = preq->rcDestRect.left+pobj->dwLeft;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.left=lft;
- rGlyph.right=lft+pobj->dwLeft;
- rGlyph.top=btm-pobj->dwBottom;
- rGlyph.bottom=btm;
+ rGlyph.left = lft;
+ rGlyph.right = lft+pobj->dwLeft;
+ rGlyph.top = btm-pobj->dwBottom;
+ rGlyph.bottom = btm;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,0,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,0,mode,depth);
}
// Draw Bottom-Right corner...
- if(1)
+ if (1)
{
- rFill.top=preq->rcDestRect.bottom-pobj->dwBottom;
- rFill.bottom=preq->rcDestRect.bottom;
- rFill.left=preq->rcDestRect.right-pobj->dwRight;
- rFill.right=preq->rcDestRect.right;
+ rFill.top = preq->rcDestRect.bottom-pobj->dwBottom;
+ rFill.bottom = preq->rcDestRect.bottom;
+ rFill.left = preq->rcDestRect.right-pobj->dwRight;
+ rFill.right = preq->rcDestRect.right;
- if (mode==2)
+ if (mode == 2)
OffsetRect(&rFill,-mode2offset.x,-mode2offset.y);
- rGlyph.left=rgh-pobj->dwRight;
- rGlyph.right=rgh;
- rGlyph.top=btm-pobj->dwBottom;
- rGlyph.bottom=btm;
+ rGlyph.left = rgh-pobj->dwRight;
+ rGlyph.right = rgh;
+ rGlyph.top = btm-pobj->dwBottom;
+ rGlyph.bottom = btm;
- k+=ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,0,mode,depth);
+ k += ske_SkinFillRectByGlyph(memdc,glyphdc,&rFill,&rGlyph,&PRect,0,mode,depth);
}
}
}
- if ((k>0 || k==-1) && mode==2)
+ if ((k>0 || k == -1) && mode == 2)
{
{
- BLENDFUNCTION bf={AC_SRC_OVER, 0, /*(bm.bmBitsPixel==32)?255:*/pobj->dwAlpha, (pobj->bmBitsPixel==32 && pobj->Style!=ST_BRUSH)?AC_SRC_ALPHA:0};
- if (mode==2)
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0, /*(bm.bmBitsPixel == 32)?255:*/pobj->dwAlpha, (pobj->bmBitsPixel == 32 && pobj->Style != ST_BRUSH)?AC_SRC_ALPHA:0};
+ if (mode == 2)
OffsetRect(&PRect,mode2offset.x,mode2offset.y);
ske_AlphaBlend( preq->hDC,PRect.left,PRect.top,PRect.right-PRect.left,PRect.bottom-PRect.top,
memdc,0,0,PRect.right-PRect.left,PRect.bottom-PRect.top,bf);
@@ -1531,7 +1531,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) if (oldglyph) SelectObject(glyphdc,oldglyph);
if (glyphdc) mod_DeleteDC(glyphdc);
}
- if (mode==2)
+ if (mode == 2)
{
SelectObject(memdc,oldbmp);
mod_DeleteDC(memdc);
@@ -1543,49 +1543,49 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) {
int i;
HFONT hOldFont;
- for (i=0; i<pobj->plTextList->realCount; i++)
+ for (i = 0; i < pobj->plTextList->realCount; i++)
{
- GLYPHTEXT * gt=(GLYPHTEXT *)pobj->plTextList->items[i];
+ GLYPHTEXT * gt = (GLYPHTEXT *)pobj->plTextList->items[i];
if (!gt->hFont)
{
if (gl_plSkinFonts && gl_plSkinFonts->realCount>0)
{
- int j=0;
- for (j=0; j<gl_plSkinFonts->realCount; j++)
+ int j = 0;
+ for (j = 0; j < gl_plSkinFonts->realCount; j++)
{
SKINFONT * sf;
- sf=(SKINFONT*)gl_plSkinFonts->items[j];
+ sf = (SKINFONT*)gl_plSkinFonts->items[j];
if (sf->szFontID && !strcmp(sf->szFontID,gt->szFontID))
{
- gt->hFont=sf->hFont;
+ gt->hFont = sf->hFont;
break;
}
}
}
- if (!gt->hFont) gt->hFont=(HFONT)-1;
+ if (!gt->hFont) gt->hFont = (HFONT)-1;
}
- if (gt->hFont!=(HFONT)-1)
+ if (gt->hFont != (HFONT)-1)
{
- RECT rc={0};
- hOldFont=(HFONT)SelectObject(preq->hDC,gt->hFont);
+ RECT rc = {0};
+ hOldFont = (HFONT)SelectObject(preq->hDC,gt->hFont);
- if (gt->RelativeFlags&2) rc.left=preq->rcDestRect.right+gt->iLeft;
- else if (gt->RelativeFlags&1) rc.left=((preq->rcDestRect.right-preq->rcDestRect.left)>>1)+gt->iLeft;
- else rc.left=preq->rcDestRect.left+gt->iLeft;
+ if (gt->RelativeFlags&2) rc.left = preq->rcDestRect.right+gt->iLeft;
+ else if (gt->RelativeFlags&1) rc.left = ((preq->rcDestRect.right-preq->rcDestRect.left)>>1)+gt->iLeft;
+ else rc.left = preq->rcDestRect.left+gt->iLeft;
- if (gt->RelativeFlags&8) rc.top=preq->rcDestRect.bottom+gt->iTop;
- else if (gt->RelativeFlags&4) rc.top=((preq->rcDestRect.bottom-preq->rcDestRect.top)>>1)+gt->iTop;
- else rc.top=preq->rcDestRect.top+gt->iTop;
+ if (gt->RelativeFlags&8) rc.top = preq->rcDestRect.bottom+gt->iTop;
+ else if (gt->RelativeFlags&4) rc.top = ((preq->rcDestRect.bottom-preq->rcDestRect.top)>>1)+gt->iTop;
+ else rc.top = preq->rcDestRect.top+gt->iTop;
- if (gt->RelativeFlags&32) rc.right=preq->rcDestRect.right+gt->iRight;
- else if (gt->RelativeFlags&16) rc.right=((preq->rcDestRect.right-preq->rcDestRect.left)>>1)+gt->iRight;
- else rc.right=preq->rcDestRect.left+gt->iRight;
+ if (gt->RelativeFlags&32) rc.right = preq->rcDestRect.right+gt->iRight;
+ else if (gt->RelativeFlags&16) rc.right = ((preq->rcDestRect.right-preq->rcDestRect.left)>>1)+gt->iRight;
+ else rc.right = preq->rcDestRect.left+gt->iRight;
- if (gt->RelativeFlags&128) rc.bottom=preq->rcDestRect.bottom+gt->iBottom;
- else if (gt->RelativeFlags&64) rc.bottom=((preq->rcDestRect.bottom-preq->rcDestRect.top)>>1)+gt->iBottom;
- else rc.bottom=preq->rcDestRect.top+gt->iBottom;
+ if (gt->RelativeFlags&128) rc.bottom = preq->rcDestRect.bottom+gt->iBottom;
+ else if (gt->RelativeFlags&64) rc.bottom = ((preq->rcDestRect.bottom-preq->rcDestRect.top)>>1)+gt->iBottom;
+ else rc.bottom = preq->rcDestRect.top+gt->iBottom;
ske_AlphaTextOut(preq->hDC, gt->stText, -1, &rc,gt->dwFlags, gt->dwColor);
SelectObject(preq->hDC,hOldFont);
@@ -1601,44 +1601,44 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) int ske_AddDescriptorToSkinObjectList (LPSKINOBJECTDESCRIPTOR lpDescr, SKINOBJECTSLIST* Skin)
{
SKINOBJECTSLIST *sk;
- if (Skin) sk=Skin; else sk=&g_SkinObjectList;
+ if (Skin) sk = Skin; else sk = &g_SkinObjectList;
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++)
+ DWORD i = 0;
+ for (i = 0; i < sk->dwObjLPAlocated;i++)
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
- sk->pObjects=(SKINOBJECTDESCRIPTOR*)mir_realloc(sk->pObjects,sizeof(SKINOBJECTDESCRIPTOR)*(sk->dwObjLPReserved+1)/*alloc step*/);
+ sk->pObjects = (SKINOBJECTDESCRIPTOR*)mir_realloc(sk->pObjects,sizeof(SKINOBJECTDESCRIPTOR)*(sk->dwObjLPReserved+1)/*alloc step*/);
sk->dwObjLPReserved++;
}
{ //filling new objects field
- sk->pObjects[sk->dwObjLPAlocated].bType=lpDescr->bType;
- sk->pObjects[sk->dwObjLPAlocated].Data=NULL;
- sk->pObjects[sk->dwObjLPAlocated].szObjectID=mir_strdup(lpDescr->szObjectID);
- // sk->Objects[sk->dwObjLPAlocated].szObjectName=mir_strdup(lpDescr->szObjectName);
- if (lpDescr->Data!=NULL)
+ sk->pObjects[sk->dwObjLPAlocated].bType = lpDescr->bType;
+ sk->pObjects[sk->dwObjLPAlocated].Data = NULL;
+ sk->pObjects[sk->dwObjLPAlocated].szObjectID = mir_strdup(lpDescr->szObjectID);
+ // sk->Objects[sk->dwObjLPAlocated].szObjectName = mir_strdup(lpDescr->szObjectName);
+ if (lpDescr->Data != NULL)
{ //Copy defaults values
switch (lpDescr->bType)
{
case OT_GLYPHOBJECT:
{
GLYPHOBJECT * obdat;
- GLYPHOBJECT * gl=(GLYPHOBJECT*)lpDescr->Data;
- sk->pObjects[sk->dwObjLPAlocated].Data=mir_alloc(sizeof(GLYPHOBJECT));
- obdat=(GLYPHOBJECT*)sk->pObjects[sk->dwObjLPAlocated].Data;
+ GLYPHOBJECT * gl = (GLYPHOBJECT*)lpDescr->Data;
+ sk->pObjects[sk->dwObjLPAlocated].Data = mir_alloc(sizeof(GLYPHOBJECT));
+ obdat = (GLYPHOBJECT*)sk->pObjects[sk->dwObjLPAlocated].Data;
memmove(obdat,gl,sizeof(GLYPHOBJECT));
- if (gl->szFileName!=NULL)
+ if (gl->szFileName != NULL)
{
- obdat->szFileName=mir_strdup(gl->szFileName);
+ obdat->szFileName = mir_strdup(gl->szFileName);
mir_free_and_nill(gl->szFileName);
}
else
- obdat->szFileName=NULL;
- obdat->hGlyph=NULL;
+ obdat->szFileName = NULL;
+ obdat->hGlyph = NULL;
break;
}
}
@@ -1653,7 +1653,7 @@ static LPSKINOBJECTDESCRIPTOR ske_FindObject(const char * szName, BYTE objType, {
// DWORD i;
SKINOBJECTSLIST* sk;
- sk=(Skin==NULL)?(&g_SkinObjectList):Skin;
+ sk = (Skin == NULL)?(&g_SkinObjectList):Skin;
return skin_FindObjectByRequest((char *)szName,sk->pMaskList);
}
@@ -1661,7 +1661,7 @@ static LPSKINOBJECTDESCRIPTOR ske_FindObjectByMask(MODERNMASK * pModernMask, BYT {
// DWORD i;
SKINOBJECTSLIST* sk;
- sk=(Skin==NULL)?(&g_SkinObjectList):Skin;
+ sk = (Skin == NULL)?(&g_SkinObjectList):Skin;
if (!sk->pMaskList) return NULL;
return skin_FindObjectByMask(pModernMask,sk->pMaskList);
}
@@ -1670,10 +1670,10 @@ LPSKINOBJECTDESCRIPTOR ske_FindObjectByName(const char * szName, BYTE objType, S {
DWORD i;
SKINOBJECTSLIST* sk;
- sk=(Skin==NULL)?(&g_SkinObjectList):Skin;
- for (i=0; i<sk->dwObjLPAlocated; i++)
+ sk = (Skin == NULL)?(&g_SkinObjectList):Skin;
+ for (i = 0; i < sk->dwObjLPAlocated; i++)
{
- if (sk->pObjects[i].bType==objType || objType==OT_ANY)
+ if (sk->pObjects[i].bType == objType || objType == OT_ANY)
{
if (!mir_strcmp(sk->pObjects[i].szObjectID,szName))
return &(sk->pObjects[i]);
@@ -1697,32 +1697,32 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam,LPARAM lParam) ske_LockSkin();
__try
{
- preq=(LPSKINDRAWREQUEST)wParam;
+ preq = (LPSKINDRAWREQUEST)wParam;
if (lParam)
- pgl=ske_FindObjectByMask((MODERNMASK*)lParam, OT_GLYPHOBJECT,NULL);
+ pgl = ske_FindObjectByMask((MODERNMASK*)lParam, OT_GLYPHOBJECT,NULL);
else
- pgl=ske_FindObject(preq->szObjectID, OT_GLYPHOBJECT,NULL);
- if (pgl==NULL) return -1;
- if (pgl->Data==NULL) return -1;
- gl= (LPGLYPHOBJECT)pgl->Data;
- if ((gl->Style&7) ==ST_SKIP) return ST_SKIP;
- if (gl->hGlyph==NULL && gl->hGlyph!=(HBITMAP)-1 &&
- ( (gl->Style&7)==ST_IMAGE
- ||(gl->Style&7)==ST_FRAGMENT
- ||(gl->Style&7)==ST_SOLARIZE ))
+ pgl = ske_FindObject(preq->szObjectID, OT_GLYPHOBJECT,NULL);
+ if (pgl == NULL) return -1;
+ if (pgl->Data == NULL) return -1;
+ gl = (LPGLYPHOBJECT)pgl->Data;
+ if ((gl->Style&7) == ST_SKIP) return ST_SKIP;
+ if (gl->hGlyph == NULL && gl->hGlyph != (HBITMAP)-1 &&
+ ( (gl->Style&7) == ST_IMAGE
+ ||(gl->Style&7) == ST_FRAGMENT
+ ||(gl->Style&7) == ST_SOLARIZE ))
if (gl->szFileName)
{
- gl->hGlyph=ske_LoadGlyphImage(gl->szFileName);
+ gl->hGlyph = ske_LoadGlyphImage(gl->szFileName);
if (gl->hGlyph)
{
- BITMAP bmp={0};
+ BITMAP bmp = {0};
GetObject(gl->hGlyph,sizeof(BITMAP),&bmp);
- gl->bmBitsPixel=(BYTE)bmp.bmBitsPixel;
- gl->bmHeight=bmp.bmHeight;
- gl->bmWidth=bmp.bmWidth;
+ gl->bmBitsPixel = (BYTE)bmp.bmBitsPixel;
+ gl->bmHeight = bmp.bmHeight;
+ gl->bmWidth = bmp.bmWidth;
}
else
- gl->hGlyph=(HBITMAP)-1; //invalid
+ gl->hGlyph = (HBITMAP)-1; //invalid
}
return ske_DrawSkinObject(preq,gl);
}
@@ -1737,45 +1737,45 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam,LPARAM lParam) void ske_PreMultiplyChanells(HBITMAP hbmp,BYTE Mult)
{
BITMAP bmp;
- BOOL flag=FALSE;
+ BOOL flag = FALSE;
BYTE * pBitmapBits;
DWORD Len;
int bh,bw,y,x;
GetObject(hbmp, sizeof(BITMAP), (LPSTR)&bmp);
- bh=bmp.bmHeight;
- bw=bmp.bmWidth;
- Len=bh*bw*4;
- flag=(bmp.bmBits==NULL);
+ bh = bmp.bmHeight;
+ bw = bmp.bmWidth;
+ Len = bh*bw*4;
+ flag = (bmp.bmBits == NULL);
if (flag)
{
- pBitmapBits=(LPBYTE)malloc(Len);
+ pBitmapBits = (LPBYTE)malloc(Len);
GetBitmapBits(hbmp,Len,pBitmapBits);
}
else
- pBitmapBits=(BYTE*)bmp.bmBits;
- for (y=0; y<bh; ++y)
+ pBitmapBits = (BYTE*)bmp.bmBits;
+ for (y = 0; y < bh; ++y)
{
- BYTE *pPixel= pBitmapBits + bw * 4 * y;
+ BYTE *pPixel = pBitmapBits + bw * 4 * y;
- for (x=0; x<bw ; ++x)
+ for (x = 0; x < bw ; ++x)
{
if (Mult)
{
- pPixel[0]= pPixel[0]*pPixel[3]/255;
- pPixel[1]= pPixel[1]*pPixel[3]/255;
- pPixel[2]= pPixel[2]*pPixel[3]/255;
+ pPixel[0] = pPixel[0]*pPixel[3]/255;
+ pPixel[1] = pPixel[1]*pPixel[3]/255;
+ pPixel[2] = pPixel[2]*pPixel[3]/255;
}
else
{
- pPixel[3]=255;
+ pPixel[3] = 255;
}
- pPixel+= 4;
+ pPixel += 4;
}
}
if (flag)
{
- Len=SetBitmapBits(hbmp,Len,pBitmapBits);
+ Len = SetBitmapBits(hbmp,Len,pBitmapBits);
free (pBitmapBits);
}
return;
@@ -1783,22 +1783,22 @@ void ske_PreMultiplyChanells(HBITMAP hbmp,BYTE Mult) int ske_GetFullFilename(char * buf, char *file, char * skinfolder,BOOL madeAbsolute)
{
- char b2[MAX_PATH]={0};
- char *SkinPlace= db_get_sa(NULL,SKIN,"SkinFolder");
- 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);
+ char b2[MAX_PATH] = {0};
+ char *SkinPlace = db_get_sa(NULL,SKIN,"SkinFolder");
+ 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
_snprintf(b2, MAX_PATH,"%s",file);
if (madeAbsolute)
- if (b2[0]=='\\' && b2[1]!='\\')
+ if (b2[0] == '\\' && b2[1] != '\\')
CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(b2+1), (LPARAM)buf);
else
CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM)(b2), (LPARAM)buf);
else
memcpy(buf,b2,MAX_PATH);
- if(SkinPlace) mir_free_and_nill(SkinPlace);
+ if (SkinPlace) mir_free_and_nill(SkinPlace);
return 0;
}
@@ -1818,34 +1818,34 @@ Major part of routines is from http://tfcduke.developpez.com/tutoriel/format/tga static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DWORD bufSize, BOOL RLE)
{
- BYTE * pos=destBuf;
- BYTE * from=fromSize?(BYTE*)From:NULL;
- FILE * fp=!fromSize?(FILE*)From:NULL;
- DWORD destCount=0;
- DWORD fromCount=0;
+ BYTE * pos = destBuf;
+ BYTE * from = fromSize?(BYTE*)From:NULL;
+ FILE * fp = !fromSize?(FILE*)From:NULL;
+ DWORD destCount = 0;
+ DWORD fromCount = 0;
if (!RLE)
{
- while (((from&&fromCount<fromSize) || (fp&& fromCount<bufSize))
- &&(destCount<bufSize))
+ while (((from&&fromCount < fromSize) || (fp&& fromCount < bufSize))
+ &&(destCount < bufSize))
{
- BYTE r=from?from[fromCount++]:(BYTE)fgetc(fp);
- BYTE g=from?from[fromCount++]:(BYTE)fgetc(fp);
- BYTE b=from?from[fromCount++]:(BYTE)fgetc(fp);
- BYTE a=from?from[fromCount++]:(BYTE)fgetc(fp);
- pos[destCount++]=r;
- pos[destCount++]=g;
- pos[destCount++]=b;
- pos[destCount++]=a;
+ BYTE r = from?from[fromCount++]:(BYTE)fgetc(fp);
+ BYTE g = from?from[fromCount++]:(BYTE)fgetc(fp);
+ BYTE b = from?from[fromCount++]:(BYTE)fgetc(fp);
+ BYTE a = from?from[fromCount++]:(BYTE)fgetc(fp);
+ pos[destCount++] = r;
+ pos[destCount++] = g;
+ pos[destCount++] = b;
+ pos[destCount++] = a;
if (destCount>bufSize) break;
- if (from) if (fromCount<fromSize) break;
+ if (from) if (fromCount < fromSize) break;
}
}
else
{
BYTE rgba[4];
BYTE packet_header;
- BYTE *ptr=pos;
+ BYTE *ptr = pos;
BYTE size;
int i;
while (ptr < pos + bufSize)
@@ -1859,11 +1859,11 @@ static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DW /* run-length packet */
if (from)
{
- *((DWORD*)rgba)=*((DWORD*)(from+fromCount));
- fromCount+=4;
+ *((DWORD*)rgba) = *((DWORD*)(from+fromCount));
+ fromCount += 4;
}
else fread (rgba, sizeof (BYTE), 4, fp);
- for (i = 0; i < size; ++i, ptr += 4)
+ for (i = 0; i < size; ++i, ptr += 4)
{
ptr[2] = rgba[2];
ptr[1] = rgba[1];
@@ -1873,7 +1873,7 @@ static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DW }
else
{ /* not run-length packet */
- for (i = 0; i < size; ++i, ptr += 4)
+ for (i = 0; i < size; ++i, ptr += 4)
{
ptr[0] = from? from[fromCount++]:(BYTE)fgetc (fp);
ptr[1] = from? from[fromCount++]:(BYTE)fgetc (fp);
@@ -1889,8 +1889,8 @@ static BOOL ske_ReadTGAImageData(void * From, DWORD fromSize, BYTE * destBuf, DW static HBITMAP ske_LoadGlyphImage_TGA(char * szFilename)
{
BYTE *colormap = NULL;
- int cx=0,cy=0;
- BOOL err=FALSE;
+ int cx = 0,cy = 0;
+ BOOL err = FALSE;
tga_header_t header;
if (!szFilename) return NULL;
if (!wildcmpi(szFilename,"*\\*%.tga"))
@@ -1905,8 +1905,8 @@ static HBITMAP ske_LoadGlyphImage_TGA(char * szFilename) }
/* read header */
fread (&header, sizeof (tga_header_t), 1, fp);
- if ( (header.pixel_depth!=32)
- ||((header.image_type!=10)&&(header.image_type!=2))
+ if ( (header.pixel_depth != 32)
+ ||((header.image_type != 10)&&(header.image_type != 2))
)
{
fclose(fp);
@@ -1914,12 +1914,12 @@ static HBITMAP ske_LoadGlyphImage_TGA(char * szFilename) }
/*memory allocation */
- colormap=(BYTE*)malloc(header.width*header.height*4);
- cx=header.width;
- cy=header.height;
+ colormap = (BYTE*)malloc(header.width*header.height*4);
+ cx = header.width;
+ cy = header.height;
fseek (fp, header.id_lenght, SEEK_CUR);
fseek (fp, header.cm_length, SEEK_CUR);
- err=!ske_ReadTGAImageData((void*)fp, 0, colormap, header.width*header.height*4,header.image_type==10);
+ err = !ske_ReadTGAImageData((void*)fp, 0, colormap, header.width*header.height*4,header.image_type == 10);
fclose(fp);
}
@@ -1927,24 +1927,24 @@ static HBITMAP ske_LoadGlyphImage_TGA(char * szFilename) else
{
/* reading from resources IDR_TGA_DEFAULT_SKIN */
- DWORD size=0;
+ DWORD size = 0;
BYTE * mem;
HGLOBAL hRes;
- HRSRC hRSrc=FindResourceA(g_hInst,MAKEINTRESOURCEA(IDR_TGA_DEFAULT_SKIN),"TGA");
+ HRSRC hRSrc = FindResourceA(g_hInst,MAKEINTRESOURCEA(IDR_TGA_DEFAULT_SKIN),"TGA");
if (!hRSrc) return NULL;
- hRes=LoadResource(g_hInst,hRSrc);
+ hRes = LoadResource(g_hInst,hRSrc);
if (!hRes) return NULL;
- size=SizeofResource(g_hInst,hRSrc);
- mem=(BYTE*) LockResource(hRes);
+ size = SizeofResource(g_hInst,hRSrc);
+ mem = (BYTE*) LockResource(hRes);
if (size>sizeof(header))
{
- tga_header_t * header=(tga_header_t *)mem;
- if (header->pixel_depth==32&& (header->image_type==2 ||header->image_type==10))
+ tga_header_t * header = (tga_header_t *)mem;
+ if (header->pixel_depth == 32&& (header->image_type == 2 ||header->image_type == 10))
{
- colormap=(BYTE*)malloc(header->width*header->height*4);
- cx=header->width;
- cy=header->height;
- ske_ReadTGAImageData((void*)(mem+sizeof(tga_header_t)+header->id_lenght+header->cm_length), size-(sizeof(tga_header_t)+header->id_lenght+header->cm_length), colormap, cx*cy*4,header->image_type==10);
+ colormap = (BYTE*)malloc(header->width*header->height*4);
+ cx = header->width;
+ cy = header->height;
+ ske_ReadTGAImageData((void*)(mem+sizeof(tga_header_t)+header->id_lenght+header->cm_length), size-(sizeof(tga_header_t)+header->id_lenght+header->cm_length), colormap, cx*cy*4,header->image_type == 10);
}
}
FreeResource(hRes);
@@ -1952,7 +1952,7 @@ static HBITMAP ske_LoadGlyphImage_TGA(char * szFilename) if (colormap) //create dib section
{
BYTE * pt;
- HBITMAP hbmp=ske_CreateDIB32Point(cx,cy,(void**)&pt);
+ HBITMAP hbmp = ske_CreateDIB32Point(cx,cy,(void**)&pt);
if (hbmp) memcpy(pt,colormap,cx*cy*4);
free(colormap);
return hbmp;
@@ -1977,12 +1977,12 @@ HBITMAP ske_LoadGlyphImage_Png2Dib(char * szFilename) return (HBITMAP)NULL;
}
- if (( hFile = CreateFileA( szFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL )) != INVALID_HANDLE_VALUE )
- if (( hMap = CreateFileMapping( hFile, NULL, PAGE_READONLY, 0, 0, NULL )) != NULL )
- if (( ppMap = ( BYTE* )MapViewOfFile( hMap, FILE_MAP_READ, 0, 0, 0 )) != NULL )
+ if (( hFile = CreateFileA( szFilename, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL )) !=INVALID_HANDLE_VALUE )
+ if (( hMap = CreateFileMapping( hFile, NULL, PAGE_READONLY, 0, 0, NULL )) !=NULL )
+ if (( ppMap = ( BYTE* )MapViewOfFile( hMap, FILE_MAP_READ, 0, 0, 0 )) !=NULL )
cbFileSize = GetFileSize( hFile, NULL );
- if ( cbFileSize != 0 ) {
+ if ( cbFileSize !=0 ) {
PNG2DIB param;
param.pSource = ppMap;
param.cbSourceSize = cbFileSize;
@@ -1993,18 +1993,18 @@ HBITMAP ske_LoadGlyphImage_Png2Dib(char * szFilename) cbFileSize = 0;
}
- if ( ppMap != NULL ) UnmapViewOfFile( ppMap );
- if ( hMap != NULL ) CloseHandle( hMap );
- if ( hFile != NULL ) CloseHandle( hFile );
+ if ( ppMap !=NULL ) UnmapViewOfFile( ppMap );
+ if ( hMap !=NULL ) CloseHandle( hMap );
+ if ( hFile !=NULL ) CloseHandle( hFile );
if ( cbFileSize == 0 )
return (HBITMAP)NULL;
{
- BITMAPINFO* bi=( BITMAPINFO* )pDib;
- BYTE *pt=(BYTE*)bi;
- pt+=bi->bmiHeader.biSize;
- if (bi->bmiHeader.biBitCount!=32)
+ BITMAPINFO* bi = ( BITMAPINFO* )pDib;
+ BYTE *pt = (BYTE*)bi;
+ pt += bi->bmiHeader.biSize;
+ if (bi->bmiHeader.biBitCount != 32)
{
HDC sDC = GetDC( NULL );
HBITMAP hBitmap = CreateDIBitmap( sDC, pDib, CBM_INIT, pDibBits, bi, DIB_PAL_COLORS );
@@ -2015,8 +2015,8 @@ HBITMAP ske_LoadGlyphImage_Png2Dib(char * szFilename) }
else
{
- BYTE * ptPixels=pt;
- HBITMAP hBitmap=CreateDIBSection(NULL,bi, DIB_RGB_COLORS, (void **)&ptPixels, NULL, 0);
+ BYTE * ptPixels = pt;
+ HBITMAP hBitmap = CreateDIBSection(NULL,bi, DIB_RGB_COLORS, (void **)&ptPixels, NULL, 0);
memcpy(ptPixels,pt,bi->bmiHeader.biSizeImage);
GlobalFree( pDib );
return hBitmap;
@@ -2028,39 +2028,39 @@ HBITMAP ske_LoadGlyphImage_Png2Dib(char * szFilename) static HBITMAP ske_LoadGlyphImageByDecoders(char * szFileName)
{
// Loading image from file by imgdecoder...
- HBITMAP hBitmap=NULL;
+ HBITMAP hBitmap = NULL;
char ext[5];
- BYTE f=0;
+ BYTE f = 0;
LPBYTE pBitmapBits;
- LPVOID pImg= NULL;
+ LPVOID pImg = NULL;
LPVOID m_pImgDecoder;
BITMAP bmpInfo;
{
int l;
- l=mir_strlen(szFileName);
+ l = mir_strlen(szFileName);
memmove(ext,szFileName +(l-4),5);
}
if (!strchr(szFileName,'%') && !PathFileExistsA(szFileName)) return NULL;
if (mir_bool_strcmpi(ext,".tga"))
{
- hBitmap=ske_LoadGlyphImage_TGA(szFileName);
- f=1;
+ hBitmap = ske_LoadGlyphImage_TGA(szFileName);
+ f = 1;
}
else if (ServiceExists("Image/Png2Dib") && mir_bool_strcmpi(ext,".png"))
{
- hBitmap=ske_LoadGlyphImage_Png2Dib(szFileName);
+ hBitmap = ske_LoadGlyphImage_Png2Dib(szFileName);
GetObject(hBitmap, sizeof(BITMAP), &bmpInfo);
- f=(bmpInfo.bmBits!=NULL);
- // hBitmap=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)szFileName);
- // f=1;
+ f = (bmpInfo.bmBits != NULL);
+ // hBitmap = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)szFileName);
+ // f = 1;
}
- else if (hImageDecoderModule==NULL || !mir_bool_strcmpi(ext,".png"))
- hBitmap=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)szFileName);
+ else if (hImageDecoderModule == NULL || !mir_bool_strcmpi(ext,".png"))
+ hBitmap = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)szFileName);
else
{
- f=1;
+ f = 1;
ImgNewDecoder(&m_pImgDecoder);
if (!ImgNewDIBFromFile(m_pImgDecoder, szFileName, &pImg))
{
@@ -2078,18 +2078,18 @@ static HBITMAP ske_LoadGlyphImageByDecoders(char * szFileName) {
HDC dc24,dc32;
HBITMAP hBitmap32,obmp24,obmp32;
- dc32=CreateCompatibleDC(NULL);
- dc24=CreateCompatibleDC(NULL);
- hBitmap32=ske_CreateDIB32(bmpInfo.bmWidth,bmpInfo.bmHeight);
- obmp24=(HBITMAP)SelectObject(dc24,hBitmap);
- obmp32=(HBITMAP)SelectObject(dc32,hBitmap32);
+ dc32 = CreateCompatibleDC(NULL);
+ dc24 = CreateCompatibleDC(NULL);
+ hBitmap32 = ske_CreateDIB32(bmpInfo.bmWidth,bmpInfo.bmHeight);
+ obmp24 = (HBITMAP)SelectObject(dc24,hBitmap);
+ obmp32 = (HBITMAP)SelectObject(dc32,hBitmap32);
BitBlt(dc32,0,0,bmpInfo.bmWidth,bmpInfo.bmHeight,dc24,0,0,SRCCOPY);
SelectObject(dc24,obmp24);
SelectObject(dc32,obmp32);
mod_DeleteDC(dc24);
mod_DeleteDC(dc32);
DeleteObject(hBitmap);
- hBitmap=hBitmap32;
+ hBitmap = hBitmap32;
ske_PreMultiplyChanells(hBitmap,0);
}
@@ -2102,12 +2102,12 @@ HBITMAP ske_LoadGlyphImage(char * szFileName) // try to find image in loaded
DWORD i;
HBITMAP hbmp;
- char szFile [MAX_PATH]={0};
+ char szFile [MAX_PATH] = {0};
ske_GetFullFilename(szFile,szFileName,g_SkinObjectList.szSkinPlace,TRUE);
ske_LockSkin();
if (pLoadedImages)
{
- for (i=0; i<dwLoadedImagesCount; i++)
+ for (i = 0; i < dwLoadedImagesCount; i++)
{
if (mir_bool_strcmpi(pLoadedImages[i].szFileName,szFile))
{
@@ -2118,8 +2118,8 @@ HBITMAP ske_LoadGlyphImage(char * szFileName) }
}
// load new image
- hbmp=ske_skinLoadGlyphImage(szFile);
- if (hbmp==NULL)
+ hbmp = ske_skinLoadGlyphImage(szFile);
+ if (hbmp == NULL)
{
ske_UnlockSkin();
return NULL;
@@ -2127,7 +2127,7 @@ HBITMAP ske_LoadGlyphImage(char * szFileName) // add to loaded list
if (dwLoadedImagesCount+1>dwLoadedImagesAlocated)
{
- pLoadedImages=(GLYPHIMAGE*)mir_realloc(pLoadedImages,sizeof(GLYPHIMAGE)*(dwLoadedImagesCount+1));
+ pLoadedImages = (GLYPHIMAGE*)mir_realloc(pLoadedImages,sizeof(GLYPHIMAGE)*(dwLoadedImagesCount+1));
if (pLoadedImages) dwLoadedImagesAlocated++;
else
{
@@ -2135,9 +2135,9 @@ HBITMAP ske_LoadGlyphImage(char * szFileName) return NULL;
}
}
- pLoadedImages[dwLoadedImagesCount].dwLoadedTimes=1;
- pLoadedImages[dwLoadedImagesCount].hGlyph=hbmp;
- pLoadedImages[dwLoadedImagesCount].szFileName=mir_strdup(szFile);
+ pLoadedImages[dwLoadedImagesCount].dwLoadedTimes = 1;
+ pLoadedImages[dwLoadedImagesCount].hGlyph = hbmp;
+ pLoadedImages[dwLoadedImagesCount].szFileName = mir_strdup(szFile);
dwLoadedImagesCount++;
ske_UnlockSkin();
return hbmp;
@@ -2145,21 +2145,21 @@ HBITMAP ske_LoadGlyphImage(char * szFileName) int ske_UnloadGlyphImage(HBITMAP hbmp)
{
DWORD i;
- for (i=0; i<dwLoadedImagesCount; i++)
+ for (i = 0; i < dwLoadedImagesCount; i++)
{
- if (hbmp==pLoadedImages[i].hGlyph)
+ if (hbmp == pLoadedImages[i].hGlyph)
{
pLoadedImages[i].dwLoadedTimes--;
- if (pLoadedImages[i].dwLoadedTimes==0)
+ if (pLoadedImages[i].dwLoadedTimes == 0)
{
- LPGLYPHIMAGE gl=&(pLoadedImages[i]);
+ LPGLYPHIMAGE gl = &(pLoadedImages[i]);
if (gl->szFileName) mir_free_and_nill(gl->szFileName);
memmove(&(pLoadedImages[i]),&(pLoadedImages[i+1]),sizeof(GLYPHIMAGE)*(dwLoadedImagesCount-i-1));
dwLoadedImagesCount--;
DeleteObject(hbmp);
- if (pLoadedImages && dwLoadedImagesCount==0)
+ if (pLoadedImages && dwLoadedImagesCount == 0)
{
- dwLoadedImagesAlocated=0;
+ dwLoadedImagesAlocated = 0;
mir_free_and_nill(pLoadedImages);
}
}
@@ -2181,9 +2181,9 @@ int ske_UnloadSkin(SKINOBJECTSLIST * Skin) int i;
if (gl_plSkinFonts && gl_plSkinFonts->realCount>0)
{
- for (i=0; i<gl_plSkinFonts->realCount; i++)
+ for (i = 0; i < gl_plSkinFonts->realCount; i++)
{
- SKINFONT * sf=(SKINFONT *)gl_plSkinFonts->items[i];
+ SKINFONT * sf = (SKINFONT *)gl_plSkinFonts->items[i];
if (sf)
{
if (sf->szFontID) mir_free_and_nill(sf->szFontID);
@@ -2200,26 +2200,26 @@ int ske_UnloadSkin(SKINOBJECTSLIST * Skin) if (Skin->pTextList) List_Destroy(Skin->pTextList);
mir_free_and_nill(Skin->pTextList);
ModernSkinButtonDeleteAll();
- if (Skin->dwObjLPAlocated==0) { ske_UnlockSkin(); return 0;}
- for (i=0; i<Skin->dwObjLPAlocated; i++)
+ if (Skin->dwObjLPAlocated == 0) { ske_UnlockSkin(); return 0;}
+ for (i = 0; i < Skin->dwObjLPAlocated; i++)
{
switch(Skin->pObjects[i].bType)
{
case OT_GLYPHOBJECT:
{
GLYPHOBJECT * dt;
- dt=(GLYPHOBJECT*)Skin->pObjects[i].Data;
- if (dt->hGlyph && dt->hGlyph!=(HBITMAP)-1)
+ dt = (GLYPHOBJECT*)Skin->pObjects[i].Data;
+ if (dt->hGlyph && dt->hGlyph != (HBITMAP)-1)
ske_UnloadGlyphImage(dt->hGlyph);
- dt->hGlyph=NULL;
+ dt->hGlyph = NULL;
if (dt->szFileName) mir_free_and_nill(dt->szFileName);
{// delete texts
int i;
if (dt->plTextList && dt->plTextList->realCount>0)
{
- for (i=0; i<dt->plTextList->realCount; i++)
+ for (i = 0; i < dt->plTextList->realCount; i++)
{
- GLYPHTEXT * gt=(GLYPHTEXT *)dt->plTextList->items[i];
+ GLYPHTEXT * gt = (GLYPHTEXT *)dt->plTextList->items[i];
if (gt)
{
if (gt->stText) mir_free_and_nill(gt->stText);
@@ -2241,9 +2241,9 @@ int ske_UnloadSkin(SKINOBJECTSLIST * Skin) }
mir_free_and_nill(Skin->pObjects);
- Skin->pTextList=NULL;
- Skin->dwObjLPAlocated=0;
- Skin->dwObjLPReserved=0;
+ Skin->pTextList = NULL;
+ Skin->dwObjLPAlocated = 0;
+ Skin->dwObjLPReserved = 0;
ske_UnlockSkin();
return 0;
}
@@ -2251,17 +2251,17 @@ int ske_UnloadSkin(SKINOBJECTSLIST * Skin) static void RegisterMaskByParce(const char * szSetting, char * szValue, SKINOBJECTSLIST * pSkin)
{
int i;
- DWORD ID=atoi(szSetting+1);
- for (i=0; i<mir_strlen(szValue); i++) if (szValue[i]==':') break;
- if (i<mir_strlen(szValue))
+ DWORD ID = atoi(szSetting+1);
+ for (i = 0; i < mir_strlen(szValue); i++) if (szValue[i] == ':') break;
+ if (i < mir_strlen(szValue))
{
char * Obj, *Mask;
int res;
- Mask=szValue+i+1;
- Obj=(char*)mir_alloc(i+1);
+ Mask = szValue+i+1;
+ Obj = (char*)mir_alloc(i+1);
strncpy(Obj,szValue,i);
- Obj[i]='\0';
- res=AddStrModernMaskToList(ID,Mask,Obj,pSkin->pMaskList,pSkin);
+ Obj[i] = '\0';
+ res = AddStrModernMaskToList(ID,Mask,Obj,pSkin->pMaskList,pSkin);
mir_free_and_nill(Obj);
}
}
@@ -2269,15 +2269,15 @@ static void RegisterMaskByParce(const char * szSetting, char * szValue, SKINOBJE static int ske_ProcessLoadindString(const char * szSetting, char *szValue)
{
if (!pCurrentSkin) return 0;
- if (szSetting[0]=='$')
+ if (szSetting[0] == '$')
RegisterObjectByParce((char *)szSetting, szValue);
- else if (szSetting[0]=='#')
+ else if (szSetting[0] == '#')
RegisterButtonByParce((char *)szSetting,szValue);
- else if (szSetting[0]=='@')
+ else if (szSetting[0] == '@')
RegisterMaskByParce((char *)szSetting, szValue, pCurrentSkin); ///
- else if (szSetting[0]=='t')
+ else if (szSetting[0] == 't')
ske_AddParseTextGlyphObject((char*)szSetting,szValue,pCurrentSkin);
- else if (szSetting[0]=='f')
+ else if (szSetting[0] == 'f')
ske_AddParseSkinFont((char*)szSetting,szValue,pCurrentSkin);
else return 0;
return 1;
@@ -2285,7 +2285,7 @@ static int ske_ProcessLoadindString(const char * szSetting, char *szValue) static int ske_enumdb_SkinObjectsProc (const char *szSetting,LPARAM lParam)
{
char *value;
- value= db_get_sa(NULL,SKIN,szSetting);
+ value = db_get_sa(NULL,SKIN,szSetting);
ske_ProcessLoadindString(szSetting,value);
mir_free_and_nill(value);
@@ -2301,43 +2301,43 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST * pObjectList) {
DWORD i;
// LINK Mask with objects
- for (i=0; i<pObjectList->pMaskList->dwMaskCnt; i++)
+ for (i = 0; i < pObjectList->pMaskList->dwMaskCnt; i++)
{
- MODERNMASK *mm=&(pObjectList->pMaskList->pl_Masks[i]);
- void * pObject=(void*) ske_FindObjectByName(mm->szObjectName, OT_ANY, (SKINOBJECTSLIST*) pObjectList);
+ MODERNMASK *mm = &(pObjectList->pMaskList->pl_Masks[i]);
+ void * pObject = (void*) ske_FindObjectByName(mm->szObjectName, OT_ANY, (SKINOBJECTSLIST*) pObjectList);
mir_free_and_nill(mm->szObjectName);
- mm->bObjectFound=TRUE;
- mm->pObject=pObject;
+ mm->bObjectFound = TRUE;
+ mm->pObject = pObject;
}
if (pObjectList->pTextList)
{
int i;
// LINK Text with objects
- for (i=0; i<pObjectList->pTextList->realCount; i++)
+ for (i = 0; i < pObjectList->pTextList->realCount; i++)
{
GLYPHTEXT * glText;
- GLYPHOBJECT *globj=NULL;
+ GLYPHOBJECT *globj = NULL;
SKINOBJECTDESCRIPTOR * lpobj;
- glText=(GLYPHTEXT *)pObjectList->pTextList->items[i];
- lpobj=ske_FindObjectByName(glText->szObjectName,OT_GLYPHOBJECT, pObjectList);
+ glText = (GLYPHTEXT *)pObjectList->pTextList->items[i];
+ lpobj = ske_FindObjectByName(glText->szObjectName,OT_GLYPHOBJECT, pObjectList);
mir_free_and_nill(glText->szObjectName);
if (lpobj)
- globj=(GLYPHOBJECT*)lpobj->Data;
+ globj = (GLYPHOBJECT*)lpobj->Data;
if (globj)
{
if (!globj->plTextList)
{
- globj->plTextList=List_Create(0,1);
- globj->plTextList->sortFunc=ske_SortTextGlyphObjectFunc;
+ globj->plTextList = List_Create(0,1);
+ globj->plTextList->sortFunc = ske_SortTextGlyphObjectFunc;
}
List_Insert(globj->plTextList,(void*)glText,globj->plTextList->realCount);
qsort(globj->plTextList->items,globj->plTextList->realCount,sizeof(void*),(int(*)(const void*, const void*))globj->plTextList->sortFunc);
- pObjectList->pTextList->items[i]=NULL;
+ pObjectList->pTextList->items[i] = NULL;
}
else
{
- GLYPHTEXT * gt=glText;
+ GLYPHTEXT * gt = glText;
if (gt)
{
if (gt->stText) mir_free_and_nill(gt->stText);
@@ -2355,44 +2355,44 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST * pObjectList) // Getting skin objects and masks from DB
static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin)
{
- if (Skin==NULL) return 0;
+ if (Skin == NULL) return 0;
ske_UnloadSkin(Skin);
- g_CluiData.fDisableSkinEngine=db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
+ g_CluiData.fDisableSkinEngine = db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
//window borders
if (g_CluiData.fDisableSkinEngine) {
- g_CluiData.LeftClientMargin=0;
- g_CluiData.RightClientMargin=0;
- g_CluiData.TopClientMargin=0;
- g_CluiData.BottomClientMargin=0;
+ g_CluiData.LeftClientMargin = 0;
+ g_CluiData.RightClientMargin = 0;
+ g_CluiData.TopClientMargin = 0;
+ g_CluiData.BottomClientMargin = 0;
} else {
//window borders
- g_CluiData.LeftClientMargin=(int)db_get_b(NULL,"CLUI","LeftClientMargin",SETTING_LEFTCLIENTMARIGN_DEFAULT);
- g_CluiData.RightClientMargin=(int)db_get_b(NULL,"CLUI","RightClientMargin",SETTING_RIGHTCLIENTMARIGN_DEFAULT);
- g_CluiData.TopClientMargin=(int)db_get_b(NULL,"CLUI","TopClientMargin",SETTING_TOPCLIENTMARIGN_DEFAULT);
- g_CluiData.BottomClientMargin=(int)db_get_b(NULL,"CLUI","BottomClientMargin",SETTING_BOTTOMCLIENTMARIGN_DEFAULT);
+ g_CluiData.LeftClientMargin = (int)db_get_b(NULL,"CLUI","LeftClientMargin",SETTING_LEFTCLIENTMARIGN_DEFAULT);
+ g_CluiData.RightClientMargin = (int)db_get_b(NULL,"CLUI","RightClientMargin",SETTING_RIGHTCLIENTMARIGN_DEFAULT);
+ g_CluiData.TopClientMargin = (int)db_get_b(NULL,"CLUI","TopClientMargin",SETTING_TOPCLIENTMARIGN_DEFAULT);
+ g_CluiData.BottomClientMargin = (int)db_get_b(NULL,"CLUI","BottomClientMargin",SETTING_BOTTOMCLIENTMARIGN_DEFAULT);
}
if (g_CluiData.fDisableSkinEngine) return 0;
- Skin->pMaskList=(LISTMODERNMASK*)mir_alloc(sizeof(LISTMODERNMASK));
+ Skin->pMaskList = (LISTMODERNMASK*)mir_alloc(sizeof(LISTMODERNMASK));
memset(Skin->pMaskList,0,sizeof(LISTMODERNMASK));
- Skin->szSkinPlace= db_get_sa(NULL,SKIN,"SkinFolder");
+ Skin->szSkinPlace = db_get_sa(NULL,SKIN,"SkinFolder");
if (!Skin->szSkinPlace || (strchr(Skin->szSkinPlace, '%') && !db_get_b(NULL,SKIN,"Modified",0)))
{
- BOOL bOnlyObjects=FALSE;
+ BOOL bOnlyObjects = FALSE;
if (Skin->szSkinPlace && strchr(Skin->szSkinPlace, '%'))
- bOnlyObjects=TRUE;
+ bOnlyObjects = TRUE;
mir_free(Skin->szSkinPlace);
- Skin->szSkinPlace=mir_strdup("%Default%");
+ Skin->szSkinPlace = mir_strdup("%Default%");
ske_LoadSkinFromResource( bOnlyObjects );
}
//Load objects
{
DBCONTACTENUMSETTINGS dbces;
- pCurrentSkin=Skin;
- dbces.pfnEnumProc=ske_enumdb_SkinObjectsProc;
- dbces.szModule=SKIN;
- dbces.ofsSettings=0;
+ pCurrentSkin = Skin;
+ dbces.pfnEnumProc = ske_enumdb_SkinObjectsProc;
+ dbces.szModule = SKIN;
+ dbces.ofsSettings = 0;
CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
SortMaskList(pCurrentSkin->pMaskList);
@@ -2406,7 +2406,7 @@ static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin) void ske_LoadSkinFromDB(void)
{
ske_GetSkinFromDB(SKIN,&g_SkinObjectList);
- g_CluiData.dwKeyColor=db_get_dw(NULL,"ModernSettings","KeyColor",(DWORD)SETTING_KEYCOLOR_DEFAULT);
+ g_CluiData.dwKeyColor = db_get_dw(NULL,"ModernSettings","KeyColor",(DWORD)SETTING_KEYCOLOR_DEFAULT);
}
@@ -2417,11 +2417,11 @@ void ske_LoadSkinFromDB(void) /*
static BOOL ske_ParseLineOfIniFile(char * Line, BOOL bOnlyObjects)
{
- DWORD i=0;
- DWORD len=strlen(Line);
- while (i<len && (Line[i]==' ' || Line[i]=='\t')) i++; //skip spaces&tabs
- if (i>=len) return FALSE; //only spaces (or tabs)
- if (len>0 && Line[len-1]==10) Line[len-1]='\0';
+ DWORD i = 0;
+ DWORD len = strlen(Line);
+ while (i < len && (Line[i] == ' ' || Line[i] == '\t')) i++; //skip spaces&tabs
+ if (i >= len) return FALSE; //only spaces (or tabs)
+ if (len>0 && Line[len-1] == 10) Line[len-1] = '\0';
switch(Line[i])
{
case ';':
@@ -2430,47 +2430,47 @@ static BOOL ske_ParseLineOfIniFile(char * Line, BOOL bOnlyObjects) //New section start here
if (iniCurrentSection) mir_free_and_nill(iniCurrentSection);
{
- char *tbuf=Line+i+1;
- DWORD len2=strlen(tbuf);
- DWORD k=len2;
- while (k>0 && tbuf[k]!=']') k--; //searching close bracket
- tbuf[k]='\0'; //closing string
- if (k==0) return FALSE;
- iniCurrentSection=mir_strdup(tbuf);
+ char *tbuf = Line+i+1;
+ DWORD len2 = strlen(tbuf);
+ DWORD k = len2;
+ while (k>0 && tbuf[k] != ']') k--; //searching close bracket
+ tbuf[k] = '\0'; //closing string
+ if (k == 0) return FALSE;
+ iniCurrentSection = mir_strdup(tbuf);
}
return TRUE;
default:
if (!iniCurrentSection) return FALSE; //param found out of section
{
- char *keyName=Line+i;
- char *keyValue=Line+i;
-
- DWORD eqPlace=0;
- DWORD len2=strlen(keyName);
- while (eqPlace<len2 && keyName[eqPlace]!='=') eqPlace++; //find '='
- if (eqPlace==0 || eqPlace==len2) return FALSE; //= not found or no key name
- keyName[eqPlace]='\0';
- keyValue=keyName+eqPlace+1;
+ char *keyName = Line+i;
+ char *keyValue = Line+i;
+
+ DWORD eqPlace = 0;
+ DWORD len2 = strlen(keyName);
+ while (eqPlace < len2 && keyName[eqPlace] != ' = ') eqPlace++; //find ' = '
+ if (eqPlace == 0 || eqPlace == len2) return FALSE; // = not found or no key name
+ keyName[eqPlace] = '\0';
+ keyValue = keyName+eqPlace+1;
//remove tail spaces in Name
{
- DWORD len3=strlen(keyName);
- int j=len3-1;
- while (j>0 && (keyName[j]==' ' || keyName[j]=='\t')) j--;
- if (j>=0) keyName[j+1]='\0';
+ DWORD len3 = strlen(keyName);
+ int j = len3-1;
+ while (j>0 && (keyName[j] == ' ' || keyName[j] == '\t')) j--;
+ if (j >= 0) keyName[j+1] = '\0';
}
//remove start spaces in Value
{
- DWORD len3=strlen(keyValue);
- DWORD j=0;
- while (j<len3 && (keyValue[j]==' ' || keyValue[j]=='\t')) j++;
- if (j<len3) keyValue+=j;
+ DWORD len3 = strlen(keyValue);
+ DWORD j = 0;
+ while (j < len3 && (keyValue[j] == ' ' || keyValue[j] == '\t')) j++;
+ if (j < len3) keyValue += j;
}
//remove tail spaces in Value
{
- DWORD len3=strlen(keyValue);
- int j=len3-1;
- while (j>0 && (keyValue[j]==' ' || keyValue[j]=='\t')) j--;
- if (j>=0) keyValue[j+1]='\0';
+ DWORD len3 = strlen(keyValue);
+ int j = len3-1;
+ while (j>0 && (keyValue[j] == ' ' || keyValue[j] == '\t')) j--;
+ if (j >= 0) keyValue[j+1] = '\0';
}
ske_WriteParamToDatabase(iniCurrentSection,keyName,keyValue,TRUE);
}
@@ -2487,63 +2487,63 @@ static BOOL ske_ParseLineOfIniFile(char * Line, BOOL bOnlyObjects) // char bsn[MAXSN_BUFF_SIZE];
// char * Buff;
//
-// int i=0;
-// int f=0;
-// int ReadingSection=0;
+// int i = 0;
+// int f = 0;
+// int ReadingSection = 0;
// char AllowedSection[260];
-// int AllowedAll=0;
+// int AllowedAll = 0;
// char t2[MAX_PATH];
// char t3[MAX_PATH];
//
-// DWORD retu=GetPrivateProfileSectionNamesA(bsn,MAXSN_BUFF_SIZE,szFileName);
+// DWORD retu = GetPrivateProfileSectionNamesA(bsn,MAXSN_BUFF_SIZE,szFileName);
// ske_DeleteAllSettingInSection("ModernSkin");
// ske_GetSkinFolder(szFileName,t2);
// db_set_s(NULL,SKIN,"SkinFolder",t2);
// CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)szFileName, (LPARAM)t3);
// db_set_s(NULL,SKIN,"SkinFile",t3);
-// Buff=bsn;
-// AllowedSection[0]=0;
+// Buff = bsn;
+// AllowedSection[0] = 0;
// do
// {
-// f=mir_strlen(Buff);
+// f = mir_strlen(Buff);
// if (f>0 && !mir_bool_strcmpi(Buff,"Skin_Description_Section"))
// {
// char b3[MAX_BUFF_SIZE];
-// DWORD ret=0;
-// ret=GetPrivateProfileSectionA(Buff,b3,MAX_BUFF_SIZE,szFileName);
+// DWORD ret = 0;
+// ret = GetPrivateProfileSectionA(Buff,b3,MAX_BUFF_SIZE,szFileName);
// if (ret>MAX_BUFF_SIZE-3) continue;
-// if (ret==0) continue;
+// if (ret == 0) continue;
// {
-// DWORD p=0;
+// DWORD p = 0;
// char *s1;
// char *s2;
// char *s3;
// {
// DWORD t;
-// BOOL LOCK=FALSE;
-// for (t=0; t<ret-1;t++)
+// BOOL LOCK = FALSE;
+// for (t = 0; t < ret-1;t++)
// {
-// if (b3[t]=='\0') LOCK=FALSE;
-// if (b3[t]=='=' && !LOCK)
+// if (b3[t] == '\0') LOCK = FALSE;
+// if (b3[t] == ' = ' && !LOCK)
// {
-// b3[t]='\0';
-// LOCK=TRUE;
+// b3[t] = '\0';
+// LOCK = TRUE;
// }
// }
// }
// do
// {
-// s1=b3+p;
+// s1 = b3+p;
//
-// s2=s1+mir_strlen(s1)+1;
+// s2 = s1+mir_strlen(s1)+1;
// switch (s2[0])
// {
// case 'b':
// {
// BYTE P;
// // char ba[255];
-// s3=s2+1;
-// P=(BYTE)atoi(s3);
+// s3 = s2+1;
+// P = (BYTE)atoi(s3);
// db_set_b(NULL,Buff,s1,P);
// }
// break;
@@ -2551,23 +2551,23 @@ static BOOL ske_ParseLineOfIniFile(char * Line, BOOL bOnlyObjects) // {
// WORD P;
// // char ba[255];
-// s3=s2+1;
-// P=(WORD)atoi(s3);
+// s3 = s2+1;
+// P = (WORD)atoi(s3);
// db_set_w(NULL,Buff,s1,P);
// }break;
// case 'd':
// {
// DWORD P;
//
-// s3=s2+1;
-// P=(DWORD)atoi(s3);
+// s3 = s2+1;
+// P = (DWORD)atoi(s3);
// db_set_dw(NULL,Buff,s1,P);
// }break;
// case 's':
// {
// // char ba[255];
// char bb[255];
-// s3=s2+1;
+// s3 = s2+1;
// strncpy(bb,s3,sizeof(bb));
// db_set_s(NULL,Buff,s1,s3);
// }break;
@@ -2576,17 +2576,17 @@ static BOOL ske_ParseLineOfIniFile(char * Line, BOOL bOnlyObjects) // // char ba[255];
// char bb[255];
//
-// s3=s2+1;
+// s3 = s2+1;
// {
// char fn[MAX_PATH];
// int pp, i;
-// pp=-1;
+// pp = -1;
// CallService(MS_UTILS_PATHTORELATIVE, (WPARAM)szFileName, (LPARAM)fn);
// {
-// for (i=0; i<mir_strlen(fn); i++) if (fn[i]=='.') pp=i;
-// if (pp!=-1)
+// for (i = 0; i < mir_strlen(fn); i++) if (fn[i] == '.') pp = i;
+// if (pp != -1)
// {
-// fn[pp]='\0';
+// fn[pp] = '\0';
// }
// }
// sprintf(bb,"%s\\%s",fn,s3);
@@ -2594,13 +2594,13 @@ static BOOL ske_ParseLineOfIniFile(char * Line, BOOL bOnlyObjects) // }
// }break;
// }
-// p=p+mir_strlen(s1)+mir_strlen(s2)+2;
-// } while (p<ret);
+// p = p+mir_strlen(s1)+mir_strlen(s2)+2;
+// } while (p < ret);
//
// }
// }
-// Buff+=mir_strlen(Buff)+1;
-// }while (((DWORD)Buff-(DWORD)bsn)<retu);
+// Buff += mir_strlen(Buff)+1;
+// }while (((DWORD)Buff-(DWORD)bsn) < retu);
// return 0;
//}
//
@@ -2623,8 +2623,8 @@ static int ske_LoadSkinFromResource(BOOL bOnlyObjects) //Load data from ini file
int ske_LoadSkinFromIniFile(TCHAR * szFileName, BOOL bOnlyObjects)
{
- TCHAR skinFolder[MAX_PATH]={0};
- TCHAR skinFile[MAX_PATH]={0};
+ TCHAR skinFolder[MAX_PATH] = {0};
+ TCHAR skinFile[MAX_PATH] = {0};
if (_tcschr(szFileName,_T('%')))
return ske_LoadSkinFromResource( bOnlyObjects );
@@ -2647,35 +2647,35 @@ int ske_LoadSkinFromIniFile(TCHAR * szFileName, BOOL bOnlyObjects) static int ske_enumdb_SkinSectionDeletionProc (const char *szSetting,LPARAM lParam)
{
- if (szSetting==NULL){return(0);};
+ if (szSetting == NULL){return(0);};
nArrayLen++;
- pszSettingName=(char **)realloc(pszSettingName,nArrayLen*sizeof(char *));
- pszSettingName[nArrayLen-1]=_strdup(szSetting);
+ pszSettingName = (char **)realloc(pszSettingName,nArrayLen*sizeof(char *));
+ pszSettingName[nArrayLen-1] = _strdup(szSetting);
return(0);
};
static int ske_DeleteAllSettingInSection(char * SectionName)
{
DBCONTACTENUMSETTINGS dbces;
- nArrayLen=0;
- pszSettingName=NULL;
- dbces.pfnEnumProc=ske_enumdb_SkinSectionDeletionProc;
- dbces.szModule=SectionName;
- dbces.ofsSettings=0;
+ nArrayLen = 0;
+ pszSettingName = NULL;
+ dbces.pfnEnumProc = ske_enumdb_SkinSectionDeletionProc;
+ dbces.szModule = SectionName;
+ dbces.ofsSettings = 0;
CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
//delete all settings
- if (nArrayLen==0){return(0);};
+ if (nArrayLen == 0){return(0);};
{
int i;
- for (i=0;i<nArrayLen;i++)
+ for (i = 0;i < nArrayLen;i++)
{
db_unset(0,SectionName,pszSettingName[i]);
free(pszSettingName[i]);
};
free(pszSettingName);
- pszSettingName=NULL;
- nArrayLen=0;
+ pszSettingName = NULL;
+ nArrayLen = 0;
};
return(0);
};
@@ -2683,10 +2683,10 @@ static int ske_DeleteAllSettingInSection(char * SectionName) BOOL ske_TextOutA(HDC hdc, int x, int y, char * lpString, int nCount)
{
- TCHAR *buf=(TCHAR *)mir_alloc((2+nCount)*sizeof(TCHAR));
+ TCHAR *buf = (TCHAR *)mir_alloc((2+nCount)*sizeof(TCHAR));
BOOL res;
MultiByteToWideChar(CallService( MS_LANGPACK_GETCODEPAGE, 0, 0 ), 0, lpString, -1, buf, (2+nCount)*sizeof(TCHAR));
- res=ske_TextOut(hdc,x,y,buf,nCount);
+ res = ske_TextOut(hdc,x,y,buf,nCount);
mir_free_and_nill(buf);
return res;
}
@@ -2695,7 +2695,7 @@ BOOL ske_TextOut(HDC hdc, int x, int y, LPCTSTR lpString, int nCount) {
int ta;
SIZE sz;
- RECT rc={0};
+ RECT rc = {0};
if (!g_CluiData.fGDIPlusFail &&0) ///text via gdi+
{
TextOutWithGDIp(hdc,x,y,lpString,nCount);
@@ -2706,7 +2706,7 @@ BOOL ske_TextOut(HDC hdc, int x, int y, LPCTSTR lpString, int nCount) {
// return TextOut(hdc, x,y,lpString,nCount);
GetTextExtentPoint32(hdc,lpString,nCount,&sz);
- ta=GetTextAlign(hdc);
+ ta = GetTextAlign(hdc);
SetRect(&rc,x,y,x+sz.cx,y+sz.cy);
ske_DrawText(hdc,lpString,nCount,&rc,DT_NOCLIP|DT_SINGLELINE|DT_LEFT);
}
@@ -2717,7 +2717,7 @@ static INT_PTR ske_Service_AlphaTextOut(WPARAM wParam,LPARAM lParam) {
if (!wParam) return 0;
{
- AlphaTextOutParams ap=*(AlphaTextOutParams*)wParam;
+ AlphaTextOutParams ap = *(AlphaTextOutParams*)wParam;
return ske_AlphaTextOut(ap.hDC,ap.lpString,ap.nCount,ap.lpRect,ap.format,ap.ARGBcolor);
}
}
@@ -2727,21 +2727,21 @@ static __inline void ske_SetMatrix( sbyte * matrix, sbyte d, sbyte e, sbyte f,
sbyte g, sbyte h, sbyte i)
{
- matrix[0]=a; matrix[1]=b; matrix[2]=c;
- matrix[3]=d; matrix[4]=e; matrix[5]=f;
- matrix[6]=g; matrix[7]=h; matrix[8]=i;
+ matrix[0] = a; matrix[1] = b; matrix[2] = c;
+ matrix[3] = d; matrix[4] = e; matrix[5] = f;
+ matrix[6] = g; matrix[7] = h; matrix[8] = i;
}
static void ske_SetTextEffect(BYTE EffectID, DWORD FirstColor, DWORD SecondColor)
{
if (EffectID>MAXPREDEFINEDEFFECTS) return;
- if (EffectID==-1) meCurrentEffect.EffectID=-1;
+ if (EffectID == -1) meCurrentEffect.EffectID = -1;
else
{
- meCurrentEffect.EffectID=EffectID;
- meCurrentEffect.EffectMatrix=ModernEffectsEnum[EffectID];
- meCurrentEffect.EffectColor1=FirstColor;
- meCurrentEffect.EffectColor2=SecondColor;
+ meCurrentEffect.EffectID = EffectID;
+ meCurrentEffect.EffectMatrix = ModernEffectsEnum[EffectID];
+ meCurrentEffect.EffectColor1 = FirstColor;
+ meCurrentEffect.EffectColor2 = SecondColor;
}
}
@@ -2749,10 +2749,10 @@ BOOL ske_ResetTextEffect(HDC hdc) {
int i;
if (!pEffectStack || !pEffectStack->realCount) return TRUE;
- for (i=0; i<pEffectStack->realCount; i++)
- if (pEffectStack->items[i] && ((EFFECTSSTACKITEM*)(pEffectStack->items[i]))->hdc==hdc)
+ for (i = 0; i < pEffectStack->realCount; i++)
+ if (pEffectStack->items[i] && ((EFFECTSSTACKITEM*)(pEffectStack->items[i]))->hdc == hdc)
{
- EFFECTSSTACKITEM * effect=(EFFECTSSTACKITEM*)(pEffectStack->items[i]);
+ EFFECTSSTACKITEM * effect = (EFFECTSSTACKITEM*)(pEffectStack->items[i]);
mir_free_and_nill(effect);
List_Remove(pEffectStack,i);
return TRUE;
@@ -2763,29 +2763,29 @@ BOOL ske_ResetTextEffect(HDC hdc) BOOL ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor)
{
if (EffectID>MAXPREDEFINEDEFFECTS) return 0;
- if (EffectID==-1) return ske_ResetTextEffect(hdc);
+ if (EffectID == -1) return ske_ResetTextEffect(hdc);
if (!pEffectStack)
{
- pEffectStack=List_Create(0,1);
+ pEffectStack = List_Create(0,1);
}
{
int i;
- for (i=0; i<pEffectStack->realCount; i++)
- if (pEffectStack->items[i] && ((EFFECTSSTACKITEM*)(pEffectStack->items[i]))->hdc==hdc)
+ for (i = 0; i < pEffectStack->realCount; i++)
+ if (pEffectStack->items[i] && ((EFFECTSSTACKITEM*)(pEffectStack->items[i]))->hdc == hdc)
{
- EFFECTSSTACKITEM * effect=(EFFECTSSTACKITEM*)(pEffectStack->items[i]);
- effect->EffectID=EffectID;
- effect->FirstColor=FirstColor;
- effect->SecondColor=SecondColor;
+ EFFECTSSTACKITEM * effect = (EFFECTSSTACKITEM*)(pEffectStack->items[i]);
+ effect->EffectID = EffectID;
+ effect->FirstColor = FirstColor;
+ effect->SecondColor = SecondColor;
return TRUE;
}
}
{
- EFFECTSSTACKITEM * effect=(EFFECTSSTACKITEM *) mir_alloc(sizeof(EFFECTSSTACKITEM));
- effect->hdc=hdc;
- effect->EffectID=EffectID;
- effect->FirstColor=FirstColor;
- effect->SecondColor=SecondColor;
+ EFFECTSSTACKITEM * effect = (EFFECTSSTACKITEM *) mir_alloc(sizeof(EFFECTSSTACKITEM));
+ effect->hdc = hdc;
+ effect->EffectID = EffectID;
+ effect->FirstColor = FirstColor;
+ effect->SecondColor = SecondColor;
List_Insert(pEffectStack, effect, 0);
return TRUE;
}
@@ -2794,17 +2794,17 @@ BOOL ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD Second static BOOL ske_GetTextEffect(HDC hdc, MODERNEFFECT * modernEffect)
{
- int i=0;
+ int i = 0;
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)
+ for (i = 0; i < pEffectStack->realCount; i++)
+ if (pEffectStack->items[i] && ((EFFECTSSTACKITEM*)(pEffectStack->items[i]))->hdc == hdc)
{
- EFFECTSSTACKITEM * effect=(EFFECTSSTACKITEM*)(pEffectStack->items[i]);
- modernEffect->EffectID=effect->EffectID;
- modernEffect->EffectColor1=effect->FirstColor;
- modernEffect->EffectColor2=effect->SecondColor;
- modernEffect->EffectMatrix=ModernEffectsEnum[effect->EffectID];
+ EFFECTSSTACKITEM * effect = (EFFECTSSTACKITEM*)(pEffectStack->items[i]);
+ modernEffect->EffectID = effect->EffectID;
+ modernEffect->EffectColor1 = effect->FirstColor;
+ modernEffect->EffectColor2 = effect->SecondColor;
+ modernEffect->EffectMatrix = ModernEffectsEnum[effect->EffectID];
return TRUE;
}
return FALSE;
@@ -2815,10 +2815,10 @@ static BOOL ske_DrawTextEffect(BYTE* destPt,BYTE* maskPt, DWORD width, DWORD hei sbyte *buf;
sbyte *outbuf;
sbyte *bufline, *buflineTop, *buflineMid;
- int sign=0;
+ int sign = 0;
BYTE *maskline,*destline;
BYTE al,rl,gl,bl,ad,rd,gd,bd;
- int k=0;
+ int k = 0;
DWORD x,y;
sbyte *matrix;
BYTE mcTopStart;
@@ -2826,129 +2826,129 @@ static BOOL ske_DrawTextEffect(BYTE* destPt,BYTE* maskPt, DWORD width, DWORD hei BYTE mcLeftStart;
BYTE mcRightEnd;
BYTE effectCount;
- int minX=width;
- int maxX=0;
- int minY=height;
- int maxY=0;
- if (effect->EffectID==0xFF) return FALSE;
+ int minX = width;
+ int maxX = 0;
+ int minY = height;
+ int maxY = 0;
+ if (effect->EffectID == 0xFF) return FALSE;
if (!width || ! height) return FALSE;
if (!destPt) return FALSE;
- buf=(sbyte*)malloc(width*height*sizeof(BYTE));
+ buf = (sbyte*)malloc(width*height*sizeof(BYTE));
{
- matrix=effect->EffectMatrix.matrix;
- mcTopStart=2-effect->EffectMatrix.topEffect;
- mcBottomEnd=3+effect->EffectMatrix.bottomEffect;
- mcLeftStart=2-effect->EffectMatrix.leftEffect;
- mcRightEnd=3+effect->EffectMatrix.rightEffect;
- effectCount=effect->EffectMatrix.cycleCount;
+ matrix = effect->EffectMatrix.matrix;
+ mcTopStart = 2-effect->EffectMatrix.topEffect;
+ mcBottomEnd = 3+effect->EffectMatrix.bottomEffect;
+ mcLeftStart = 2-effect->EffectMatrix.leftEffect;
+ mcRightEnd = 3+effect->EffectMatrix.rightEffect;
+ effectCount = effect->EffectMatrix.cycleCount;
}
- al=255-((BYTE)(effect->EffectColor1>>24));
- rl=GetRValue(effect->EffectColor1);
- gl=GetGValue(effect->EffectColor1);
- bl=GetBValue(effect->EffectColor1);
- rd=GetRValue(effect->EffectColor2);
- gd=GetGValue(effect->EffectColor2);
- bd=GetBValue(effect->EffectColor2);
- ad=255-((BYTE)(effect->EffectColor2>>24));
- rd=GetRValue(effect->EffectColor2);
- gd=GetGValue(effect->EffectColor2);
- bd=GetBValue(effect->EffectColor2);
+ al = 255-((BYTE)(effect->EffectColor1>>24));
+ rl = GetRValue(effect->EffectColor1);
+ gl = GetGValue(effect->EffectColor1);
+ bl = GetBValue(effect->EffectColor1);
+ rd = GetRValue(effect->EffectColor2);
+ gd = GetGValue(effect->EffectColor2);
+ bd = GetBValue(effect->EffectColor2);
+ ad = 255-((BYTE)(effect->EffectColor2>>24));
+ rd = GetRValue(effect->EffectColor2);
+ gd = GetGValue(effect->EffectColor2);
+ bd = GetBValue(effect->EffectColor2);
//Fill buffer by mid values of image
- for (y=0; y<height; y++)
+ for (y = 0; y < height; y++)
{
- bufline=buf+y*width;
- maskline=maskPt+((y*width)<<2);
- for (x=0; x<width; x++)
+ bufline = buf+y*width;
+ maskline = maskPt+((y*width) << 2);
+ for (x = 0; x < width; x++)
{
- BYTE a=(sbyte)(DWORD)((maskline[0]+maskline[2]+maskline[1]+maskline[1])>>4);
- *bufline=a;
- if (a!=0)
+ BYTE a = (sbyte)(DWORD)((maskline[0]+maskline[2]+maskline[1]+maskline[1])>>4);
+ *bufline = a;
+ if (a != 0)
{
- minX=min((int)x,minX);
- minY=min((int)y,minY);
- maxX=max((int)x,maxX);
- maxY=max((int)y,maxY);
+ minX = min((int)x,minX);
+ minY = min((int)y,minY);
+ maxX = max((int)x,maxX);
+ maxY = max((int)y,maxY);
}
bufline++;
- maskline+=4;
+ maskline += 4;
}
}
//Here perform effect on buffer and place results to outbuf
- for (k=0; k<(effectCount&0x7F); k++)
+ for (k = 0; k < (effectCount&0x7F); k++)
{
minX = max( 0, minX + mcLeftStart - 2 );
minY = max( 0, minY + mcTopStart - 2 );
maxX = min( (int)width, maxX + mcRightEnd - 1 );
maxY = min( (int)height, maxY + mcBottomEnd - 1 );
- outbuf=(sbyte*)malloc(width*height*sizeof(sbyte));
+ outbuf = (sbyte*)malloc(width*height*sizeof(sbyte));
memset(outbuf,0,width*height*sizeof(sbyte));
- for (y=(DWORD)minY; y<(DWORD)maxY; y++)
+ for (y = (DWORD)minY; y < (DWORD)maxY; y++)
{
int val;
- bufline=outbuf+y*width+minX;
- buflineMid=buf+y*width+minX;
- for (x=(DWORD)minX; x<(DWORD)maxX; x++)
+ bufline = outbuf+y*width+minX;
+ buflineMid = buf+y*width+minX;
+ for (x = (DWORD)minX; x < (DWORD)maxX; x++)
{
int matrixHor,matrixVer;
- val=0;
- for (matrixVer=mcTopStart; matrixVer<mcBottomEnd; matrixVer++)
+ val = 0;
+ for (matrixVer = mcTopStart; matrixVer < mcBottomEnd; matrixVer++)
{
int buflineStep = width*(matrixVer-2);
- int as=y+matrixVer-2;
- sbyte * buflineTopS=NULL;
- if (as>=0 && (DWORD)as<height) buflineTopS=buflineMid+buflineStep;
+ int as = y+matrixVer-2;
+ sbyte * buflineTopS = NULL;
+ if (as >= 0 && (DWORD)as < height) buflineTopS = buflineMid+buflineStep;
- for (matrixHor=mcLeftStart; matrixHor<mcRightEnd;matrixHor++)
+ for (matrixHor = mcLeftStart; matrixHor < mcRightEnd;matrixHor++)
{
- int a=as;
+ int a = as;
buflineTop = buflineTopS;
- a=x+matrixHor-2;
- if (buflineTop && a>=0 && (DWORD)a<width) buflineTop+=matrixHor-2;
- else buflineTop=NULL;
+ a = x+matrixHor-2;
+ if (buflineTop && a >= 0 && (DWORD)a < width) buflineTop += matrixHor-2;
+ else buflineTop = NULL;
if (buflineTop)
- val+=((*buflineTop)*matrix[matrixVer*5+matrixHor]);
+ val += ((*buflineTop)*matrix[matrixVer*5+matrixHor]);
}
}
- val=(val+1)>>5;
- *bufline=(sbyte)((val>127)?127:(val<-125)?-125:val);
+ val = (val+1)>>5;
+ *bufline = (sbyte)((val>127)?127:(val < -125)?-125:val);
bufline++;
buflineMid++;
}
}
free(buf);
- buf=outbuf;
+ buf = outbuf;
}
{
BYTE r1,b1,g1,a1;
- b1=bl; r1=rl; g1=gl; a1=al; sign=1;
+ b1 = bl; r1 = rl; g1 = gl; a1 = al; sign = 1;
//perform out to dest
- for (y=0; y<height; y++)
+ for (y = 0; y < height; y++)
{
- bufline=buf+y*width;
- destline=destPt+((y*width)<<2);
- for (x=0; x<width; x++)
+ bufline = buf+y*width;
+ destline = destPt+((y*width) << 2);
+ for (x = 0; x < width; x++)
{
- sbyte val=*bufline;
- BYTE absVal=((val<0)?-val:val);
+ sbyte val = *bufline;
+ BYTE absVal = ((val < 0)?-val:val);
- if (val!=0)
+ if (val != 0)
{
- if (val>0 && sign<0)
- { b1=bl; r1=rl; g1=gl; a1=al; sign=1;}
- else if (val<0 && sign>0)
- { b1=bd; r1=rd; g1=gd; a1=ad; sign=-1;}
+ if (val>0 && sign < 0)
+ { b1 = bl; r1 = rl; g1 = gl; a1 = al; sign = 1;}
+ else if (val < 0 && sign>0)
+ { b1 = bd; r1 = rd; g1 = gd; a1 = ad; sign = -1;}
- absVal=absVal*a1/255;
+ absVal = absVal*a1/255;
- destline[0]=((destline[0]*(128-absVal))+absVal*b1)>>7;
- destline[1]=((destline[1]*(128-absVal))+absVal*g1)>>7;
- destline[2]=((destline[2]*(128-absVal))+absVal*r1)>>7;
- destline[3]+=((255-destline[3])*(a1*absVal))/32640;
+ destline[0] = ((destline[0]*(128-absVal))+absVal*b1)>>7;
+ destline[1] = ((destline[1]*(128-absVal))+absVal*g1)>>7;
+ destline[2] = ((destline[2]*(128-absVal))+absVal*r1)>>7;
+ destline[3] += ((255-destline[3])*(a1*absVal))/32640;
}
bufline++;
- destline+=4;
+ destline += 4;
}
}
free(buf);
@@ -2980,7 +2980,7 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec for ( int i = 0; i < 256; i++ )
{
- gammaTbl[i]= (BYTE)( 255 * pow( (double)i / 255, gammaCfPw ));
+ gammaTbl[i] = (BYTE)( 255 * pow( (double)i / 255, gammaCfPw ));
blueMulTbl[i] = i * blueCf;
redMulTbl[i] = i * redCf;
greenMulTbl[i] = i * greenCf;
@@ -3004,9 +3004,9 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec GetBitmapBits( hDestBitmap, bmpDest.bmHeight*bmpDest.bmWidthBytes, pDestBits );
}
else
- pDestBits=(BYTE*)bmpDest.bmBits;
+ pDestBits = (BYTE*)bmpDest.bmBits;
- BOOL isDest16bit=( bmpDest.bmBitsPixel ) != 32;
+ BOOL isDest16bit = ( bmpDest.bmBitsPixel ) !=32;
// Creating offscreen buffer
@@ -3064,7 +3064,7 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec // Calc sizes and offsets
- textSize.cx += 2; // CORRECTION: for italic
+ textSize.cx += 2; // CORRECTION: for italic
int drx = 0; // x-axis offset of draw point
@@ -3102,8 +3102,8 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec textSize.cy = workRectHeight;
}
- textSize.cx += 4; // CORRECTION: for effects ???
- textSize.cy += 4; // CORRECTION: for effects ???
+ textSize.cx += 4; // CORRECTION: for effects ???
+ textSize.cy += 4; // CORRECTION: for effects ???
if ( textSize.cx > 0 && textSize.cy > 0 ) // Ok we need to paint
{
@@ -3112,14 +3112,14 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec //Create bitmap image for offscreen
BYTE * bits = NULL;
HBITMAP hbmp = ske_CreateDIB32Point( textSize.cx, textSize.cy, (void**)&bits );
- if ( bits != NULL )
+ if ( bits !=NULL )
{
HBITMAP holdbmp = (HBITMAP)SelectObject( hOffscreenDC, hbmp );
//Create buffer bitmap image for temp text
BYTE * bufbits = NULL;
HBITMAP bufbmp = ske_CreateDIB32Point( textSize.cx, textSize.cy, (void**)&bufbits );
- if ( bufbits != NULL )
+ if ( bufbits !=NULL )
{
HDC bufDC = CreateCompatibleDC( hDC );
HBITMAP bufoldbmp = (HBITMAP)SelectObject( bufDC, bufbmp );
@@ -3144,8 +3144,8 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec drawRect.bottom = textSize.cy;
DWORD x,y;
- DWORD width=textSize.cx;
- DWORD heigh=textSize.cy;
+ DWORD width = textSize.cx;
+ DWORD heigh = textSize.cy;
BYTE * pDestScanLine;
BYTE * pBufScanLine;
@@ -3159,26 +3159,26 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec for ( y = 2; y < heigh - 2; y++ )
{
- int lineBytes = y * (width<<2);
+ int lineBytes = y * (width << 2);
pDestScanLine = bits + lineBytes;
pBufScanLine = bufbits + lineBytes;
for ( x = 2; x < width - 2; x++)
{
- pix = pDestScanLine + ( x<<2 );
- bufpix = pBufScanLine + ( x<<2 );
+ pix = pDestScanLine + ( x << 2 );
+ bufpix = pBufScanLine + ( x << 2 );
// Monochromatic
BYTE bx = gammaTbl[ bufpix[0] ];
BYTE gx = gammaTbl[ bufpix[1] ];
BYTE rx = gammaTbl[ bufpix[2] ];
- if ( al != 255 )
+ if ( al !=255 )
{
- bx*=al/255;
- gx*=al/255;
- rx*=al/255;
+ bx *= al/255;
+ gx *= al/255;
+ rx *= al/255;
}
BYTE ax = (BYTE)( ( (DWORD)rx*77 + (DWORD)gx * 151 + (DWORD)bx *28 + 128 ) / 256 );
@@ -3187,19 +3187,19 @@ static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT * lpRec //Normalize components to gray
BYTE axx = 255 - ( ( r + g + b ) >> 2 ) ; // Coefficient of grayance, more white font - more gray edges
WORD atx = ax * (255 - axx);
- bx=( atx + bx * axx )/255;
- gx=( atx + gx * axx )/255;
- rx=( atx + rx * axx )/255;
+ bx = ( atx + bx * axx )/255;
+ gx = ( atx + gx * axx )/255;
+ rx = ( atx + rx * axx )/255;
short rrx, grx, brx;
- brx=(short)((b-pix[0])*bx/255);
- grx=(short)((g-pix[1])*gx/255);
- rrx=(short)((r-pix[2])*rx/255);
-
- pix[0]+=brx;
- pix[1]+=grx;
- pix[2]+=rrx;
- pix[3]=(BYTE)(ax+(BYTE)(255-ax)*pix[3]/255);
+ brx = (short)((b-pix[0])*bx/255);
+ grx = (short)((g-pix[1])*gx/255);
+ rrx = (short)((r-pix[2])*rx/255);
+
+ pix[0] += brx;
+ pix[1] += grx;
+ pix[2] += rrx;
+ pix[3] = (BYTE)(ax+(BYTE)(255-ax)*pix[3]/255);
}
}
}
@@ -3236,9 +3236,9 @@ static int ske_DrawTextWithEffectWorker( HDC hdc, LPCTSTR lpString, int nCount, if (format&DT_CALCRECT) return DrawText(hdc,lpString,nCount,lpRect,format);
if (format&DT_RTLREADING) SetTextAlign(hdc,TA_RTLREADING);
- DWORD color=GetTextColor(hdc);
+ DWORD color = GetTextColor(hdc);
- RECT r=*lpRect;
+ RECT r = *lpRect;
OffsetRect(&r,1,1);
DWORD form = format;
if ( effect && effect->effectIndex )
@@ -3255,16 +3255,16 @@ static int ske_DrawTextWithEffectWorker( HDC hdc, LPCTSTR lpString, int nCount, INT_PTR ske_Service_DrawTextWithEffect( WPARAM wParam, LPARAM lParam )
{
DrawTextWithEffectParam * p = ( DrawTextWithEffectParam * ) wParam;
- if ( p->cbSize != sizeof(DrawTextWithEffectParam))
+ if ( p->cbSize !=sizeof(DrawTextWithEffectParam))
return FALSE;
return ske_DrawTextWithEffectWorker( p->hdc, p->lpchText, p->cchText, p->lprc, p->dwDTFormat, p->pEffect );
}
BOOL ske_DrawTextA(HDC hdc, char * lpString, int nCount, RECT * lpRect, UINT format)
{
- TCHAR *buf=mir_a2u(lpString);
+ TCHAR *buf = mir_a2u(lpString);
BOOL res;
- res=ske_DrawText(hdc,buf,nCount,lpRect,format);
+ res = ske_DrawText(hdc,buf,nCount,lpRect,format);
mir_free(buf);
return res;
}
@@ -3272,15 +3272,15 @@ BOOL ske_DrawTextA(HDC hdc, char * lpString, int nCount, RECT * lpRect, UINT for BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT * lpRect, UINT format)
{
- DWORD form=0, color=0;
- RECT r=*lpRect;
+ DWORD form = 0, color = 0;
+ RECT r = *lpRect;
OffsetRect(&r,1,1);
if (format&DT_RTLREADING) SetTextAlign(hdc,TA_RTLREADING);
if (format&DT_CALCRECT) return DrawText(hdc,lpString,nCount,lpRect,format);
if (format&DT_FORCENATIVERENDER || g_CluiData.fDisableSkinEngine)
return DrawText(hdc,lpString,nCount,lpRect,format&~DT_FORCENATIVERENDER);
- form=format;
- color=GetTextColor(hdc);
+ form = format;
+ color = GetTextColor(hdc);
if (!g_CluiData.fGDIPlusFail &&0) ///text via gdi+
{
TextOutWithGDIp(hdc,lpRect->left,lpRect->top,lpString,nCount);
@@ -3291,13 +3291,13 @@ BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT * lpRect, UINT for HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i, UINT fStyle)
{
- IMAGEINFO imi={0};
- BITMAP bm={0};
- if ( IsWinVerXPPlus() && i!=-1 )
+ IMAGEINFO imi = {0};
+ BITMAP bm = {0};
+ if ( IsWinVerXPPlus() && i != -1 )
{
ImageList_GetImageInfo(himl,i,&imi);
GetObject(imi.hbmImage,sizeof(bm),&bm);
- if (bm.bmBitsPixel==32) //stupid bug of Microsoft
+ if (bm.bmBitsPixel == 32) //stupid bug of Microsoft
// Icons bitmaps are not premultiplied
// So Imagelist_AddIcon - premultiply alpha
// But incorrect - it is possible that alpha will
@@ -3306,45 +3306,45 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i, UINT fStyle) // TODO: Direct draw Icon from imagelist without
// extracting of icon
{
- BYTE * bits=NULL;
- bits=(BYTE*)bm.bmBits;
+ BYTE * bits = NULL;
+ bits = (BYTE*)bm.bmBits;
if (!bits)
{
- bits=(BYTE*)malloc(bm.bmWidthBytes*bm.bmHeight);
+ bits = (BYTE*)malloc(bm.bmWidthBytes*bm.bmHeight);
GetBitmapBits(imi.hbmImage,bm.bmWidthBytes*bm.bmHeight,bits);
}
{
int iy;
BYTE *bcbits;
- int wb=((imi.rcImage.right-imi.rcImage.left)*bm.bmBitsPixel>>3);
- bcbits=bits+(bm.bmHeight-imi.rcImage.bottom)*bm.bmWidthBytes+(imi.rcImage.left*bm.bmBitsPixel>>3);
- for (iy=0; iy<imi.rcImage.bottom-imi.rcImage.top; iy++)
+ int wb = ((imi.rcImage.right-imi.rcImage.left)*bm.bmBitsPixel>>3);
+ bcbits = bits+(bm.bmHeight-imi.rcImage.bottom)*bm.bmWidthBytes+(imi.rcImage.left*bm.bmBitsPixel>>3);
+ for (iy = 0; iy < imi.rcImage.bottom-imi.rcImage.top; iy++)
{
int x;
// Dummy microsoft fix - alpha can be less than r,g or b
// Looks like color channels in icons should be non-premultiplied with alpha
- // But AddIcon store it premultiplied (incorrectly cause can be Alpha==7F, but R,G or B==80
+ // But AddIcon store it premultiplied (incorrectly cause can be Alpha == 7F, but R,G or B == 80
// So i check that alpha is 0x7F and set it to 0x80
- DWORD *c=((DWORD*)bcbits);
- for (x=0;x<imi.rcImage.right-imi.rcImage.left; x++)
+ DWORD *c = ((DWORD*)bcbits);
+ for (x = 0;x < imi.rcImage.right-imi.rcImage.left; x++)
{
- DWORD val=*c;
- BYTE a= (BYTE)((val)>>24);
- if (a!=0)
+ DWORD val = *c;
+ BYTE a = (BYTE)((val)>>24);
+ if (a != 0)
{
- BYTE r= (BYTE)((val&0xFF0000)>>16);
- BYTE g= (BYTE)((val&0xFF00)>>8);
- BYTE b= (BYTE)(val&0xFF);
- if (a<r || a<g || a<b)
+ BYTE r = (BYTE)((val&0xFF0000)>>16);
+ BYTE g = (BYTE)((val&0xFF00)>>8);
+ BYTE b = (BYTE)(val&0xFF);
+ if (a < r || a < g || a < b)
{
- a=max(max(r,g),b);
- val=a<<24|r<<16|g<<8|b;
- *c=val;
+ a = max(max(r,g),b);
+ val = a << 24|r << 16|g << 8|b;
+ *c = val;
}
}
c++;
}
- bcbits+=bm.bmWidthBytes;
+ bcbits += bm.bmWidthBytes;
}
}
if (!bm.bmBits)
@@ -3369,20 +3369,20 @@ BOOL ske_ImageList_DrawEx( HIMAGELIST himl,int i,HDC hdcDst,int x,int y,int dx,i {
//the routine to directly draw icon from image list without creating icon from there - should be some faster
- if (i<0) return FALSE;
+ if (i < 0) return FALSE;
if (g_CluiData.fDisableSkinEngine)
return ImageList_DrawEx( himl, i, hdcDst, x, y, dx, dy, rgbBk, rgbFg, fStyle);
BYTE alpha;
- if (fStyle&ILD_BLEND25) alpha=64;
- else if (fStyle&ILD_BLEND50) alpha=128;
- else alpha=255;
+ if (fStyle&ILD_BLEND25) alpha = 64;
+ else if (fStyle&ILD_BLEND50) alpha = 128;
+ else alpha = 255;
- HICON hIcon=ske_ImageList_GetIcon(himl,i,ILD_NORMAL);
+ HICON hIcon = ske_ImageList_GetIcon(himl,i,ILD_NORMAL);
if (hIcon)
{
- ske_DrawIconEx(hdcDst,x,y,hIcon,dx?dx:GetSystemMetrics(SM_CXSMICON),dy?dy:GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL|(alpha<<24));
+ ske_DrawIconEx(hdcDst,x,y,hIcon,dx?dx:GetSystemMetrics(SM_CXSMICON),dy?dy:GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL|(alpha << 24));
DestroyIcon(hIcon);
return TRUE;
}
@@ -3392,7 +3392,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;
+ DrawIconFixParam *p = (DrawIconFixParam*)wParam;
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);
}
@@ -3402,7 +3402,7 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy {
ICONINFO ici;
- BYTE alpha=(BYTE)((diFlags&0xFF000000)>>24);
+ BYTE alpha = (BYTE)((diFlags&0xFF000000)>>24);
HDC imDC;
@@ -3414,13 +3414,13 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy DWORD cx,cy,icy;
BYTE *t1, *t2, *t3;
- BOOL NoDIBImage=FALSE;
+ BOOL NoDIBImage = FALSE;
//lockimagelist
- BYTE hasmask=FALSE;
- BYTE no32bit=FALSE;
- BYTE noMirrorMask=FALSE;
- BYTE hasalpha=FALSE;
- alpha=alpha?alpha:255;
+ BYTE hasmask = FALSE;
+ BYTE no32bit = FALSE;
+ BYTE noMirrorMask = FALSE;
+ BYTE hasalpha = FALSE;
+ alpha = alpha?alpha:255;
if ( g_CluiData.fDisableSkinEngine && !(diFlags&0x80))
return DrawIconEx(hdcDst,xLeft,yTop,hIcon,cxWidth,cyWidth,istepIfAniCur,hbrFlickerFreeDraw,diFlags&0xFFFF7F);
@@ -3428,115 +3428,115 @@ BOOL ske_DrawIconEx(HDC hdcDst,int xLeft,int yTop,HICON hIcon,int cxWidth,int cy if (!GetIconInfo(hIcon,&ici)) return 0;
GetObject(ici.hbmColor,sizeof(BITMAP),&imbt);
- if (imbt.bmWidth*imbt.bmHeight==0)
+ if (imbt.bmWidth*imbt.bmHeight == 0)
{
DeleteObject(ici.hbmColor);
DeleteObject(ici.hbmMask);
return 0;
}
GetObject(ici.hbmMask,sizeof(BITMAP),&immaskbt);
- cy=imbt.bmHeight;
+ cy = imbt.bmHeight;
- if (imbt.bmBitsPixel!=32)
+ if (imbt.bmBitsPixel != 32)
{
HDC tempDC1;
HBITMAP otBmp;
- no32bit=TRUE;
- tempDC1=CreateCompatibleDC(hdcDst);
- tBmp=ske_CreateDIB32(imbt.bmWidth,imbt.bmHeight);
+ no32bit = TRUE;
+ tempDC1 = CreateCompatibleDC(hdcDst);
+ tBmp = ske_CreateDIB32(imbt.bmWidth,imbt.bmHeight);
if (tBmp)
{
GetObject(tBmp,sizeof(BITMAP),&imbt);
- otBmp=(HBITMAP)SelectObject(tempDC1,tBmp);
+ otBmp = (HBITMAP)SelectObject(tempDC1,tBmp);
DrawIconEx(tempDC1,0,0,hIcon,imbt.bmWidth,imbt.bmHeight,istepIfAniCur,hbrFlickerFreeDraw,DI_IMAGE);
- noMirrorMask=TRUE;
+ noMirrorMask = TRUE;
}
SelectObject(tempDC1,otBmp);
mod_DeleteDC(tempDC1);
}
/*
- if (imbt.bmBitsPixel!=32)
+ if (imbt.bmBitsPixel != 32)
{
HDC tempDC1;
HBITMAP otBmp;
- no32bit=TRUE;
- tempDC1=ske_RequestBufferDC(hdcDst,BUFFER_DRAWICON,imbt.bmWidth,imbt.bmHeight);
+ no32bit = TRUE;
+ tempDC1 = ske_RequestBufferDC(hdcDst,BUFFER_DRAWICON,imbt.bmWidth,imbt.bmHeight);
if (tempDC1)
{
DrawIconEx(tempDC1,0,0,hIcon,imbt.bmWidth,imbt.bmHeight,istepIfAniCur,hbrFlickerFreeDraw,DI_IMAGE);
- noMirrorMask=TRUE;
+ noMirrorMask = TRUE;
ske_ReleaseBufferDC(tempDC1,2000); //keep buffer for 2 seconds
}
}
*/
- if (imbt.bmBits==NULL)
+ if (imbt.bmBits == NULL)
{
- NoDIBImage=TRUE;
- imimagbits=(BYTE*)malloc(cy*imbt.bmWidthBytes);
+ NoDIBImage = TRUE;
+ imimagbits = (BYTE*)malloc(cy*imbt.bmWidthBytes);
GetBitmapBits(ici.hbmColor,cy*imbt.bmWidthBytes,(void*)imimagbits);
}
- else imimagbits=(BYTE*)imbt.bmBits;
+ else imimagbits = (BYTE*)imbt.bmBits;
- if (immaskbt.bmBits==NULL)
+ if (immaskbt.bmBits == NULL)
{
- immaskbits=(BYTE*)malloc(cy*immaskbt.bmWidthBytes);
+ immaskbits = (BYTE*)malloc(cy*immaskbt.bmWidthBytes);
GetBitmapBits(ici.hbmMask,cy*immaskbt.bmWidthBytes,(void*)immaskbits);
}
else
- immaskbits=(BYTE*)immaskbt.bmBits;
- icy=imbt.bmHeight;
- cx=imbt.bmWidth;
- imDC=CreateCompatibleDC(hdcDst);
- imBmp=ske_CreateDIB32Point(cx,icy,(void**)&imbits);
- oldBmp=(HBITMAP)SelectObject(imDC,imBmp);
- if (imbits!=NULL && imimagbits!=NULL && immaskbits!=NULL)
+ immaskbits = (BYTE*)immaskbt.bmBits;
+ icy = imbt.bmHeight;
+ cx = imbt.bmWidth;
+ imDC = CreateCompatibleDC(hdcDst);
+ imBmp = ske_CreateDIB32Point(cx,icy,(void**)&imbits);
+ oldBmp = (HBITMAP)SelectObject(imDC,imBmp);
+ if (imbits != NULL && imimagbits != NULL && immaskbits != NULL)
{
int x; int y;
int bottom,right,top,h;
int mwb,mwb2;
- mwb=immaskbt.bmWidthBytes;
- mwb2=imbt.bmWidthBytes;
- bottom=icy;
- right=cx;
- top=0;
- h=icy;
- for (y=top;(y<bottom)&&!hasmask; y++)
+ mwb = immaskbt.bmWidthBytes;
+ mwb2 = imbt.bmWidthBytes;
+ bottom = icy;
+ right = cx;
+ top = 0;
+ h = icy;
+ for (y = top;(y < bottom)&&!hasmask; y++)
{
- t1=immaskbits+y*mwb;
- for (x=0; (x<mwb)&&!hasmask; x++)
- hasmask|=(*(t1+x)!=0);
+ t1 = immaskbits+y*mwb;
+ for (x = 0; (x < mwb)&&!hasmask; x++)
+ hasmask |= (*(t1+x) != 0);
}
- for (y=top;(y<bottom)&&!hasalpha; y++)
+ for (y = top;(y < bottom)&&!hasalpha; y++)
{
- t1=imimagbits+(cy-y-1)*mwb2;
- for (x=0; (x<right)&&!hasalpha; x++)
- hasalpha|=(*(t1+(x<<2)+3)!=0);
+ t1 = imimagbits+(cy-y-1)*mwb2;
+ for (x = 0; (x < right)&&!hasalpha; x++)
+ hasalpha |= (*(t1+(x << 2)+3) != 0);
}
- for (y=0; y<(int)icy; y++)
+ for (y = 0; y < (int)icy; y++)
{
- t1=imimagbits+(h-y-1-top)*mwb2;
- t2=imbits+(!no32bit?y:(icy-y-1))*mwb2;
- t3=immaskbits+(noMirrorMask?y:(h-y-1-top))*mwb;
- for (x=0; x<right; x++)
+ t1 = imimagbits+(h-y-1-top)*mwb2;
+ t2 = imbits+(!no32bit?y:(icy-y-1))*mwb2;
+ t3 = immaskbits+(noMirrorMask?y:(h-y-1-top))*mwb;
+ for (x = 0; x < right; x++)
{
DWORD * src, *dest;
- BYTE mask=0;
+ BYTE mask = 0;
BYTE a = 0;
- src=(DWORD*)(t1+(x<<2));
- dest=(DWORD*)(t2+(x<<2));
+ src = (DWORD*)(t1+(x << 2));
+ dest = (DWORD*)(t2+(x << 2));
if (hasalpha && !hasmask)
- a=((BYTE*)src)[3];
+ a = ((BYTE*)src)[3];
else
{
- mask=((1<<(7-x%8))&(*(t3+(x>>3))))!=0;
+ mask = ((1 << (7-x%8))&(*(t3+(x>>3)))) != 0;
if (mask)// && !hasalpha)
{
if (!hasalpha)
- { *dest=0; continue; }
+ { *dest = 0; continue; }
else
{
if (((BYTE*)src)[3]>0 )
@@ -3546,32 +3546,32 @@ 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);
+ a = (((BYTE*)src)[3]>0?((BYTE*)src)[3]:255);
else if (!hasalpha && !hasmask)
- a=255;
- else { *dest=0; continue; }
+ a = 255;
+ else { *dest = 0; continue; }
}
if (a>0)
{
- ((BYTE*)dest)[3]=a;
- ((BYTE*)dest)[0]=((BYTE*)src)[0]*a/255;
- ((BYTE*)dest)[1]=((BYTE*)src)[1]*a/255;
- ((BYTE*)dest)[2]=((BYTE*)src)[2]*a/255;
+ ((BYTE*)dest)[3] = a;
+ ((BYTE*)dest)[0] = ((BYTE*)src)[0]*a/255;
+ ((BYTE*)dest)[1] = ((BYTE*)src)[1]*a/255;
+ ((BYTE*)dest)[2] = ((BYTE*)src)[2]*a/255;
}
else
- *dest=0;
+ *dest = 0;
}
}
}
{
- BLENDFUNCTION bf={AC_SRC_OVER, diFlags&128, alpha, AC_SRC_ALPHA };
+ BLENDFUNCTION bf = {AC_SRC_OVER, diFlags&128, alpha, AC_SRC_ALPHA };
ske_AlphaBlend(hdcDst,xLeft,yTop,cxWidth, cyWidth, imDC,0,0, cx,icy,bf);
}
- if (immaskbt.bmBits==NULL) free(immaskbits);
- if (imbt.bmBits==NULL) free(imimagbits);
+ if (immaskbt.bmBits == NULL) free(immaskbits);
+ if (imbt.bmBits == NULL) free(imimagbits);
SelectObject(imDC,oldBmp);
DeleteObject(imBmp);
- if(no32bit)DeleteObject(tBmp);
+ if (no32bit)DeleteObject(tBmp);
DeleteObject(ici.hbmColor);
DeleteObject(ici.hbmMask);
SelectObject(imDC,GetStockObject(DEFAULT_GUI_FONT));
@@ -3585,10 +3585,10 @@ int ske_PrepeareImageButDontUpdateIt(RECT * r) {
if (g_CluiData.fLayered)
{
- mutex_bLockUpdate=1;
+ mutex_bLockUpdate = 1;
ske_DrawNonFramedObjects(TRUE,r);
ske_ValidateFrameImageProc(r);
- mutex_bLockUpdate=0;
+ mutex_bLockUpdate = 0;
return 0;
}
else
@@ -3622,50 +3622,50 @@ static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam) RECT wnd;
FRAMEWND *frm;
- BOOL NoCancelPost=0;
- BOOL IsAnyQueued=0;
+ BOOL NoCancelPost = 0;
+ BOOL IsAnyQueued = 0;
if (!g_CluiData.mutexOnEdgeSizing)
GetWindowRect(pcli->hwndContactList,&wnd);
else
- wnd=g_rcEdgeSizingRect;
+ wnd = g_rcEdgeSizingRect;
if (!g_CluiData.fLayered)
{
RedrawWindow((HWND)wParam,NULL,NULL,RDW_UPDATENOW|RDW_ERASE|RDW_INVALIDATE|RDW_FRAME);
return 0;
}
- if (g_pCachedWindow==NULL) ske_ValidateFrameImageProc(&wnd);
- else if (g_pCachedWindow->Width!=wnd.right-wnd.left || g_pCachedWindow->Height!=wnd.bottom-wnd.top) ske_ValidateFrameImageProc(&wnd);
- else if (wParam==0) ske_ValidateFrameImageProc(&wnd);
+ if (g_pCachedWindow == NULL) ske_ValidateFrameImageProc(&wnd);
+ else if (g_pCachedWindow->Width != wnd.right-wnd.left || g_pCachedWindow->Height != wnd.bottom-wnd.top) ske_ValidateFrameImageProc(&wnd);
+ else if (wParam == 0) ske_ValidateFrameImageProc(&wnd);
else // all Ok Update Single Frame
{
// TO BE LOCKED OR PROXIED
- frm=FindFrameByItsHWND((HWND)wParam);
+ frm = FindFrameByItsHWND((HWND)wParam);
if (!frm) ske_ValidateFrameImageProc(&wnd);
// Validate frame, update window image and remove it from queue
else
{
- if(frm->UpdateRgn)
+ if (frm->UpdateRgn)
{
DeleteObject(frm->UpdateRgn);
- frm->UpdateRgn=0;
+ frm->UpdateRgn = 0;
}
ske_ValidateSingleFrameImage(frm,0);
ske_UpdateWindowImage();
- NoCancelPost=1;
+ NoCancelPost = 1;
//-- Remove frame from queue
if (flag_bUpdateQueued)
{
int i;
- frm->bQueued=0;
- for(i=0;i<g_nFramesCount;i++)
- if(IsAnyQueued|=g_pfwFrames[i].bQueued) break;
+ frm->bQueued = 0;
+ for(i = 0;i < g_nFramesCount;i++)
+ if (IsAnyQueued |= g_pfwFrames[i].bQueued) break;
}
}
}
if ((!NoCancelPost || !IsAnyQueued) && flag_bUpdateQueued) // no any queued updating cancel post or need to cancel post
{
- flag_bUpdateQueued=0;
- g_flag_bPostWasCanceled=1;
+ flag_bUpdateQueued = 0;
+ g_flag_bPostWasCanceled = 1;
}
return 1;
}
@@ -3674,15 +3674,15 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) if ( MirandaLoading()) return 0;
if (wParam)
{
- FRAMEWND *frm=FindFrameByItsHWND((HWND)wParam);
- sPaintRequest * pr=(sPaintRequest*)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 (frm)
{
- if (frm->PaintCallbackProc!=NULL)
+ if (frm->PaintCallbackProc != NULL)
{
- frm->PaintData=(sPaintRequest *)pr;
- frm->bQueued=1;
+ frm->PaintData = (sPaintRequest *)pr;
+ frm->bQueued = 1;
if (pr)
{
HRGN r2;
@@ -3694,17 +3694,17 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) IntersectRect( &rcUpdate, &rcClient, &pr->rcUpdate );
if ( IsRectEmpty( &rcUpdate ))
return 0;
- r2=CreateRectRgn( rcUpdate.left, rcUpdate.top, rcUpdate.right, rcUpdate.bottom );
+ r2 = CreateRectRgn( rcUpdate.left, rcUpdate.top, rcUpdate.right, rcUpdate.bottom );
}
else
{
RECT r;
GetClientRect(frm->hWnd,&r);
- r2=CreateRectRgn(r.left,r.top,r.right,r.bottom);
+ r2 = CreateRectRgn(r.left,r.top,r.right,r.bottom);
}
if (!frm->UpdateRgn)
{
- frm->UpdateRgn=CreateRectRgn(0,0,1,1);
+ frm->UpdateRgn = CreateRectRgn(0,0,1,1);
CombineRgn(frm->UpdateRgn,r2,0,RGN_COPY);
}
else CombineRgn(frm->UpdateRgn,frm->UpdateRgn,r2,RGN_OR);
@@ -3723,8 +3723,8 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) if (!flag_bUpdateQueued||g_flag_bPostWasCanceled)
if (PostMessage(pcli->hwndContactList,UM_UPDATE,0,0))
{
- flag_bUpdateQueued=1;
- g_flag_bPostWasCanceled=0;
+ flag_bUpdateQueued = 1;
+ g_flag_bPostWasCanceled = 0;
}
return 1;
}
@@ -3733,45 +3733,45 @@ 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 (Frame->hWnd==(HWND)-1 && !Frame->PaintCallbackProc) { TRACE("ske_ValidateSingleFrameImage calling without FrameProc\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;
HBITMAP o,n;
RECT rcPaint,wnd;
- RECT ru={0};
+ RECT ru = {0};
int w,h,x,y;
int w1,h1,x1,y1;
CLUI_SizingGetWindowRect(pcli->hwndContactList,&wnd);
- rcPaint=Frame->wndSize;
+ rcPaint = Frame->wndSize;
{
int dx,dy,bx,by;
if (g_CluiData.mutexOnEdgeSizing)
{
- dx=rcPaint.left-wnd.left;
- dy=rcPaint.top-wnd.top;
- bx=rcPaint.right-wnd.right;
- by=rcPaint.bottom-wnd.bottom;
- wnd=g_rcEdgeSizingRect;
- rcPaint.left=wnd.left+dx;
- rcPaint.top=wnd.top+dy;
- rcPaint.right=wnd.right+bx;
- rcPaint.bottom=wnd.bottom+by;
+ dx = rcPaint.left-wnd.left;
+ dy = rcPaint.top-wnd.top;
+ bx = rcPaint.right-wnd.right;
+ by = rcPaint.bottom-wnd.bottom;
+ wnd = g_rcEdgeSizingRect;
+ rcPaint.left = wnd.left+dx;
+ rcPaint.top = wnd.top+dy;
+ rcPaint.right = wnd.right+bx;
+ rcPaint.bottom = wnd.bottom+by;
}
}
//OffsetRect(&rcPaint,-wnd.left,-wnd.top);
- w=rcPaint.right-rcPaint.left;
- h=rcPaint.bottom-rcPaint.top;
- if (w<=0 || h<=0)
+ w = rcPaint.right-rcPaint.left;
+ h = rcPaint.bottom-rcPaint.top;
+ if (w <= 0 || h <= 0)
{
TRACE("Frame size smaller than 0\n");
return 0;
}
- x=rcPaint.left;
- y=rcPaint.top;
- hdc=CreateCompatibleDC(g_pCachedWindow->hImageDC);
- n=ske_CreateDIB32(w,h);
- o=(HBITMAP)SelectObject(hdc,n);
+ x = rcPaint.left;
+ y = rcPaint.top;
+ hdc = CreateCompatibleDC(g_pCachedWindow->hImageDC);
+ n = ske_CreateDIB32(w,h);
+ o = (HBITMAP)SelectObject(hdc,n);
{
if (Frame->UpdateRgn && !SkipBkgBlitting)
{
@@ -3779,20 +3779,20 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) {
RECT rc;
GetClientRect(Frame->hWnd,&rc);
- if (ru.top<0) ru.top=0;
- if (ru.left<0) ru.left=0;
- if (ru.right>rc.right) ru.right=rc.right;
- if (ru.bottom>rc.bottom) ru.bottom=rc.bottom;
+ if (ru.top < 0) ru.top = 0;
+ if (ru.left < 0) ru.left = 0;
+ if (ru.right>rc.right) ru.right = rc.right;
+ if (ru.bottom>rc.bottom) ru.bottom = rc.bottom;
}
if (!IsRectEmpty(&ru))
{
- x1=ru.left;
- y1=ru.top;
- w1=ru.right-ru.left;
- h1=ru.bottom-ru.top;
+ x1 = ru.left;
+ y1 = ru.top;
+ w1 = ru.right-ru.left;
+ h1 = ru.bottom-ru.top;
}
else
- {x1=0; y1=0; w1=w; h1=h;}
+ {x1 = 0; y1 = 0; w1 = w; h1 = h;}
// copy image at hdc
if (SkipBkgBlitting) //image already at foreground
{
@@ -3809,17 +3809,17 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) HRGN rgnUpdate;
RECT r;
GetClientRect(Frame->hWnd,&r);
- rgnUpdate=CreateRectRgn(r.left,r.top,r.right,r.bottom);
- ru=r;
+ rgnUpdate = CreateRectRgn(r.left,r.top,r.right,r.bottom);
+ ru = r;
if (!IsRectEmpty(&ru))
{
- x1=ru.left;
- y1=ru.top;
- w1=ru.right-ru.left;
- h1=ru.bottom-ru.top;
+ x1 = ru.left;
+ y1 = ru.top;
+ w1 = ru.right-ru.left;
+ h1 = ru.bottom-ru.top;
}
else
- {x1=0; y1=0; w1=w; h1=h;}
+ {x1 = 0; y1 = 0; w1 = w; h1 = h;}
// copy image at hdc
if (SkipBkgBlitting) //image already at foreground
{
@@ -3830,21 +3830,21 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) BitBlt(hdc,x1,y1,w1,h1,g_pCachedWindow->hBackDC,x+x1,y+y1,SRCCOPY);
}
Frame->PaintCallbackProc(Frame->hWnd,hdc,&r,rgnUpdate, Frame->dwFlags,Frame->PaintData);
- ru=r;
+ ru = r;
DeleteObject(rgnUpdate);
}
DeleteObject(Frame->UpdateRgn);
- Frame->UpdateRgn=0;
+ Frame->UpdateRgn = 0;
}
if (!IsRectEmpty(&ru))
{
- x1=ru.left;
- y1=ru.top;
- w1=ru.right-ru.left;
- h1=ru.bottom-ru.top;
+ x1 = ru.left;
+ y1 = ru.top;
+ w1 = ru.right-ru.left;
+ h1 = ru.bottom-ru.top;
}
else
- {x1=0; y1=0; w1=w; h1=h;}
+ {x1 = 0; y1 = 0; w1 = w; h1 = h;}
/* if (!SkipBkgBlitting)
{
BitBlt(g_pCachedWindow->hImageDC,x+x1,y+y1,w1,h1,g_pCachedWindow->hBackDC,x+x1,y+y1,SRCCOPY);
@@ -3852,9 +3852,9 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) */
{
- //BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ //BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
BitBlt(g_pCachedWindow->hImageDC,x+x1,y+y1,w1,h1,hdc,x1,y1,SRCCOPY);
- //BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ //BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
//MyAlphaBlend(g_pCachedWindow->hImageDC,x+x1,y+y1,w1,h1,hdc,x1,y1,w1,h1,bf);
}
@@ -3867,21 +3867,21 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) RECT rDnBtn;
RECT rLine;
int dx,dy;
- SCROLLBARINFO si={0};
- si.cbSize=sizeof(SCROLLBARINFO);
+ SCROLLBARINFO si = {0};
+ si.cbSize = sizeof(SCROLLBARINFO);
fnGetScrollBarInfo(Frame->hWnd,OBJID_VSCROLL,&si);
- rLine=(si.rcScrollBar);
- rUpBtn=rLine;
- rDnBtn=rLine;
- rThumb=rLine;
-
- rUpBtn.bottom=rUpBtn.top+si.dxyLineButton;
- rDnBtn.top=rDnBtn.bottom-si.dxyLineButton;
- rThumb.top=rLine.top+si.xyThumbTop;
- rThumb.bottom=rLine.top+si.xyThumbBottom;
+ rLine = (si.rcScrollBar);
+ rUpBtn = rLine;
+ rDnBtn = rLine;
+ rThumb = rLine;
+
+ rUpBtn.bottom = rUpBtn.top+si.dxyLineButton;
+ rDnBtn.top = rDnBtn.bottom-si.dxyLineButton;
+ rThumb.top = rLine.top+si.xyThumbTop;
+ rThumb.bottom = rLine.top+si.xyThumbBottom;
{
- dx=Frame->wndSize.right-rLine.right;
- dy=-rLine.top+Frame->wndSize.top;
+ dx = Frame->wndSize.right-rLine.right;
+ dy = -rLine.top+Frame->wndSize.top;
}
OffsetRect(&rLine,dx,dy);
OffsetRect(&rUpBtn,dx,dy);
@@ -3890,13 +3890,13 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) BitBlt(g_pCachedWindow->hImageDC,rLine.left,rLine.top,rLine.right-rLine.left,rLine.bottom-rLine.top,g_pCachedWindow->hBackDC,rLine.left,rLine.top,SRCCOPY);
{
char req[255];
- _snprintf(req,sizeof(req),"Main,ID=ScrollBar,Frame=%s,Part=Back",Frame->szName);
+ _snprintf(req,sizeof(req),"Main,ID = ScrollBar,Frame = %s,Part = Back",Frame->szName);
SkinDrawGlyph(g_pCachedWindow->hImageDC,&rLine,&rLine,req);
- _snprintf(req,sizeof(req),"Main,ID=ScrollBar,Frame=%s,Part=Thumb",Frame->szName);
+ _snprintf(req,sizeof(req),"Main,ID = ScrollBar,Frame = %s,Part = Thumb",Frame->szName);
SkinDrawGlyph(g_pCachedWindow->hImageDC,&rThumb,&rThumb,req);
- _snprintf(req,sizeof(req),"Main,ID=ScrollBar,Frame=%s,Part=UpLineButton",Frame->szName);
+ _snprintf(req,sizeof(req),"Main,ID = ScrollBar,Frame = %s,Part = UpLineButton",Frame->szName);
SkinDrawGlyph(g_pCachedWindow->hImageDC,&rUpBtn,&rUpBtn,req);
- _snprintf(req,sizeof(req),"Main,ID=ScrollBar,Frame=%s,Part=DownLineButton",Frame->szName);
+ _snprintf(req,sizeof(req),"Main,ID = ScrollBar,Frame = %s,Part = DownLineButton",Frame->szName);
SkinDrawGlyph(g_pCachedWindow->hImageDC,&rDnBtn,&rDnBtn,req);
}
}
@@ -3910,20 +3910,20 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) int ske_BltBackImage (HWND destHWND, HDC destDC, RECT * BltClientRect)
{
- POINT ptMainWnd={0};
- POINT ptChildWnd={0};
- RECT from={0};
- RECT w={0};
+ POINT ptMainWnd = {0};
+ POINT ptChildWnd = {0};
+ RECT from = {0};
+ RECT w = {0};
if (g_CluiData.fDisableSkinEngine)
{
FillRect(destDC,BltClientRect,GetSysColorBrush(COLOR_3DFACE));
return 0;
}
ske_ReCreateBackImage(FALSE,NULL);
- if (BltClientRect) w=*BltClientRect;
+ if (BltClientRect) w = *BltClientRect;
else GetClientRect(destHWND,&w);
- ptChildWnd.x=w.left;
- ptChildWnd.y=w.top;
+ ptChildWnd.x = w.left;
+ ptChildWnd.y = w.top;
ClientToScreen(destHWND,&ptChildWnd);
ClientToScreen(pcli->hwndContactList,&ptMainWnd);
//TODO if main not relative to client area
@@ -3933,41 +3933,41 @@ int ske_BltBackImage (HWND destHWND, HDC destDC, RECT * BltClientRect) int ske_ReCreateBackImage(BOOL Erase,RECT *w)
{
HBITMAP hb2;
- RECT wnd={0};
- BOOL IsNewCache=0;
+ RECT wnd = {0};
+ BOOL IsNewCache = 0;
if (g_CluiData.fDisableSkinEngine) return 0;
GetClientRect(pcli->hwndContactList,&wnd);
- if (w) wnd=*w;
+ if (w) wnd = *w;
//-- Check cached.
- if (g_pCachedWindow==NULL)
+ if (g_pCachedWindow == NULL)
{
//-- Create New Cache
{
- g_pCachedWindow=(CURRWNDIMAGEDATA*)mir_calloc(sizeof(CURRWNDIMAGEDATA));
- g_pCachedWindow->hScreenDC=GetDC(NULL);
- g_pCachedWindow->hBackDC=CreateCompatibleDC(g_pCachedWindow->hScreenDC);
- g_pCachedWindow->hImageDC=CreateCompatibleDC(g_pCachedWindow->hScreenDC);
- g_pCachedWindow->Width=wnd.right-wnd.left;
- g_pCachedWindow->Height=wnd.bottom-wnd.top;
- if (g_pCachedWindow->Width!=0 && g_pCachedWindow->Height!=0)
+ g_pCachedWindow = (CURRWNDIMAGEDATA*)mir_calloc(sizeof(CURRWNDIMAGEDATA));
+ g_pCachedWindow->hScreenDC = GetDC(NULL);
+ g_pCachedWindow->hBackDC = CreateCompatibleDC(g_pCachedWindow->hScreenDC);
+ g_pCachedWindow->hImageDC = CreateCompatibleDC(g_pCachedWindow->hScreenDC);
+ g_pCachedWindow->Width = wnd.right-wnd.left;
+ g_pCachedWindow->Height = wnd.bottom-wnd.top;
+ if (g_pCachedWindow->Width != 0 && g_pCachedWindow->Height != 0)
{
- g_pCachedWindow->hImageDIB=ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hImageDIBByte));
- g_pCachedWindow->hBackDIB=ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hBackDIBByte));
- g_pCachedWindow->hImageOld=(HBITMAP)SelectObject(g_pCachedWindow->hImageDC,g_pCachedWindow->hImageDIB);
- g_pCachedWindow->hBackOld=(HBITMAP)SelectObject(g_pCachedWindow->hBackDC,g_pCachedWindow->hBackDIB);
+ g_pCachedWindow->hImageDIB = ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hImageDIBByte));
+ g_pCachedWindow->hBackDIB = ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hBackDIBByte));
+ g_pCachedWindow->hImageOld = (HBITMAP)SelectObject(g_pCachedWindow->hImageDC,g_pCachedWindow->hImageDIB);
+ g_pCachedWindow->hBackOld = (HBITMAP)SelectObject(g_pCachedWindow->hBackDC,g_pCachedWindow->hBackDIB);
}
}
- IsNewCache=1;
+ IsNewCache = 1;
}
- if (g_pCachedWindow->Width!=wnd.right-wnd.left || g_pCachedWindow->Height!=wnd.bottom-wnd.top)
+ if (g_pCachedWindow->Width != wnd.right-wnd.left || g_pCachedWindow->Height != wnd.bottom-wnd.top)
{
- HBITMAP hb1=NULL,hb2=NULL;
- g_pCachedWindow->Width=wnd.right-wnd.left;
- g_pCachedWindow->Height=wnd.bottom-wnd.top;
- if (g_pCachedWindow->Width!=0 && g_pCachedWindow->Height!=0)
+ HBITMAP hb1 = NULL,hb2 = NULL;
+ g_pCachedWindow->Width = wnd.right-wnd.left;
+ g_pCachedWindow->Height = wnd.bottom-wnd.top;
+ if (g_pCachedWindow->Width != 0 && g_pCachedWindow->Height != 0)
{
- hb1=ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hImageDIBByte));
- hb2=ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hBackDIBByte));
+ hb1 = ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hImageDIBByte));
+ hb2 = ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hBackDIBByte));
SelectObject(g_pCachedWindow->hImageDC,hb1);
SelectObject(g_pCachedWindow->hBackDC,hb2);
}
@@ -3978,19 +3978,19 @@ int ske_ReCreateBackImage(BOOL Erase,RECT *w) }
if (g_pCachedWindow->hImageDIB) DeleteObject(g_pCachedWindow->hImageDIB);
if (g_pCachedWindow->hBackDIB) DeleteObject(g_pCachedWindow->hBackDIB);
- g_pCachedWindow->hImageDIB=hb1;
- g_pCachedWindow->hBackDIB=hb2;
- IsNewCache=1;
+ g_pCachedWindow->hImageDIB = hb1;
+ g_pCachedWindow->hBackDIB = hb2;
+ IsNewCache = 1;
}
- if ((Erase || IsNewCache )&& (g_pCachedWindow->Width!=0 && g_pCachedWindow->Height!=0))
+ if ((Erase || IsNewCache )&& (g_pCachedWindow->Width != 0 && g_pCachedWindow->Height != 0))
{
- hb2=ske_CreateDIB32(g_pCachedWindow->Width,g_pCachedWindow->Height);
+ hb2 = ske_CreateDIB32(g_pCachedWindow->Width,g_pCachedWindow->Height);
SelectObject(g_pCachedWindow->hBackDC,hb2);
DeleteObject(g_pCachedWindow->hBackDIB);
- g_pCachedWindow->hBackDIB=hb2;
+ g_pCachedWindow->hBackDIB = hb2;
FillRect(g_pCachedWindow->hBackDC,&wnd,GetSysColorBrush(COLOR_BTNFACE));
- SkinDrawGlyph(g_pCachedWindow->hBackDC,&wnd,&wnd,"Main,ID=Background,Opt=Non-Layered");
+ SkinDrawGlyph(g_pCachedWindow->hBackDC,&wnd,&wnd,"Main,ID = Background,Opt = Non-Layered");
ske_SetRectOpaque(g_pCachedWindow->hBackDC,&wnd);
}
return 1;
@@ -3998,28 +3998,28 @@ int ske_ReCreateBackImage(BOOL Erase,RECT *w) int ske_DrawNonFramedObjects(BOOL Erase,RECT *r)
{
RECT w,wnd;
- if (r) w=*r;
+ if (r) w = *r;
else CLUI_SizingGetWindowRect(pcli->hwndContactList,&w);
if (!g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE,0);
- if (g_pCachedWindow==NULL)
+ if (g_pCachedWindow == NULL)
return ske_ValidateFrameImageProc(&w);
- wnd=w;
+ wnd = w;
OffsetRect(&w, -w.left, -w.top);
if (Erase)
{
HBITMAP hb2;
- hb2=ske_CreateDIB32(g_pCachedWindow->Width,g_pCachedWindow->Height);
+ hb2 = ske_CreateDIB32(g_pCachedWindow->Width,g_pCachedWindow->Height);
SelectObject(g_pCachedWindow->hBackDC,hb2);
DeleteObject(g_pCachedWindow->hBackDIB);
- g_pCachedWindow->hBackDIB=hb2;
+ g_pCachedWindow->hBackDIB = hb2;
}
- SkinDrawGlyph(g_pCachedWindow->hBackDC,&w,&w,"Main,ID=Background");
+ SkinDrawGlyph(g_pCachedWindow->hBackDC,&w,&w,"Main,ID = Background");
//--Draw frames captions
{
int i;
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
if (g_pfwFrames[i].TitleBar.ShowTitleBar && g_pfwFrames[i].visible && !g_pfwFrames[i].floating)
{
RECT rc;
@@ -4029,62 +4029,62 @@ int ske_DrawNonFramedObjects(BOOL Erase,RECT *r) Sync( DrawTitleBar, g_pCachedWindow->hBackDC, &rc, g_pfwFrames[i].id );
}
}
- g_mutex_bLockUpdating=1;
+ g_mutex_bLockUpdating = 1;
- flag_bJustDrawNonFramedObjects=1;
+ flag_bJustDrawNonFramedObjects = 1;
return 0;
}
int ske_ValidateFrameImageProc(RECT * r) // Calling queued frame paint procs and refresh image
{
- RECT wnd={0};
- BOOL IsNewCache=0;
- BOOL IsForceAllPainting=0;
- if (r) wnd=*r;
+ RECT wnd = {0};
+ BOOL IsNewCache = 0;
+ BOOL IsForceAllPainting = 0;
+ if (r) wnd = *r;
else GetWindowRect(pcli->hwndContactList,&wnd);
- if (wnd.right-wnd.left==0 || wnd.bottom-wnd.top==0) return 0;
- g_mutex_bLockUpdating=1;
+ if (wnd.right-wnd.left == 0 || wnd.bottom-wnd.top == 0) return 0;
+ g_mutex_bLockUpdating = 1;
//-- Check cached.
- if (g_pCachedWindow==NULL)
+ if (g_pCachedWindow == NULL)
{
//-- Create New Cache
{
- g_pCachedWindow=(CURRWNDIMAGEDATA*)mir_calloc(sizeof(CURRWNDIMAGEDATA));
- g_pCachedWindow->hScreenDC=GetDC(NULL);
- g_pCachedWindow->hBackDC=CreateCompatibleDC(g_pCachedWindow->hScreenDC);
- g_pCachedWindow->hImageDC=CreateCompatibleDC(g_pCachedWindow->hScreenDC);
- g_pCachedWindow->Width=wnd.right-wnd.left;
- g_pCachedWindow->Height=wnd.bottom-wnd.top;
- g_pCachedWindow->hImageDIB=ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hImageDIBByte));
- g_pCachedWindow->hBackDIB=ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hBackDIBByte));
- g_pCachedWindow->hImageOld=(HBITMAP)SelectObject(g_pCachedWindow->hImageDC,g_pCachedWindow->hImageDIB);
- g_pCachedWindow->hBackOld=(HBITMAP)SelectObject(g_pCachedWindow->hBackDC,g_pCachedWindow->hBackDIB);
+ g_pCachedWindow = (CURRWNDIMAGEDATA*)mir_calloc(sizeof(CURRWNDIMAGEDATA));
+ g_pCachedWindow->hScreenDC = GetDC(NULL);
+ g_pCachedWindow->hBackDC = CreateCompatibleDC(g_pCachedWindow->hScreenDC);
+ g_pCachedWindow->hImageDC = CreateCompatibleDC(g_pCachedWindow->hScreenDC);
+ g_pCachedWindow->Width = wnd.right-wnd.left;
+ g_pCachedWindow->Height = wnd.bottom-wnd.top;
+ g_pCachedWindow->hImageDIB = ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hImageDIBByte));
+ g_pCachedWindow->hBackDIB = ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hBackDIBByte));
+ g_pCachedWindow->hImageOld = (HBITMAP)SelectObject(g_pCachedWindow->hImageDC,g_pCachedWindow->hImageDIB);
+ g_pCachedWindow->hBackOld = (HBITMAP)SelectObject(g_pCachedWindow->hBackDC,g_pCachedWindow->hBackDIB);
}
- IsNewCache=1;
+ IsNewCache = 1;
}
- if (g_pCachedWindow->Width!=wnd.right-wnd.left || g_pCachedWindow->Height!=wnd.bottom-wnd.top)
+ if (g_pCachedWindow->Width != wnd.right-wnd.left || g_pCachedWindow->Height != wnd.bottom-wnd.top)
{
HBITMAP hb1,hb2;
- g_pCachedWindow->Width=wnd.right-wnd.left;
- g_pCachedWindow->Height=wnd.bottom-wnd.top;
- hb1=ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hImageDIBByte));
- hb2=ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hBackDIBByte));
+ g_pCachedWindow->Width = wnd.right-wnd.left;
+ g_pCachedWindow->Height = wnd.bottom-wnd.top;
+ hb1 = ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hImageDIBByte));
+ hb2 = ske_CreateDIB32Point(g_pCachedWindow->Width,g_pCachedWindow->Height,(void**)&(g_pCachedWindow->hBackDIBByte));
SelectObject(g_pCachedWindow->hImageDC,hb1);
SelectObject(g_pCachedWindow->hBackDC,hb2);
DeleteObject(g_pCachedWindow->hImageDIB);
DeleteObject(g_pCachedWindow->hBackDIB);
- g_pCachedWindow->hImageDIB=hb1;
- g_pCachedWindow->hBackDIB=hb2;
- IsNewCache=1;
+ g_pCachedWindow->hImageDIB = hb1;
+ g_pCachedWindow->hBackDIB = hb2;
+ IsNewCache = 1;
}
if (IsNewCache)
{
ske_DrawNonFramedObjects(0,&wnd);
- IsForceAllPainting=1;
+ IsForceAllPainting = 1;
}
if (flag_bJustDrawNonFramedObjects)
{
- IsForceAllPainting=1;
- flag_bJustDrawNonFramedObjects=0;
+ IsForceAllPainting = 1;
+ flag_bJustDrawNonFramedObjects = 0;
}
if (IsForceAllPainting)
{
@@ -4094,20 +4094,20 @@ int ske_ValidateFrameImageProc(RECT * r) // Calli //-- Validating frames
{
int i;
- for(i=0;i<g_nFramesCount;i++)
+ for(i = 0;i < g_nFramesCount;i++)
if (g_pfwFrames[i].PaintCallbackProc && g_pfwFrames[i].visible && !g_pfwFrames[i].floating )
if (g_pfwFrames[i].bQueued || IsForceAllPainting)
ske_ValidateSingleFrameImage(&g_pfwFrames[i],IsForceAllPainting);
}
- g_mutex_bLockUpdating=1;
+ g_mutex_bLockUpdating = 1;
ModernSkinButtonRedrawAll(0);
- g_mutex_bLockUpdating=0;
+ g_mutex_bLockUpdating = 0;
if (!mutex_bLockUpdate) ske_UpdateWindowImageRect(&wnd);
//-- Clear queue
{
Sync( QueueAllFramesUpdating, (BYTE)0 );
- flag_bUpdateQueued=0;
- g_flag_bPostWasCanceled=0;
+ flag_bUpdateQueued = 0;
+ g_flag_bPostWasCanceled = 0;
}
return 1;
}
@@ -4133,14 +4133,14 @@ int ske_UpdateWindowImageRect(RECT * r) // U {
//if not validity -> ValidateImageProc
//else Update using current alpha
- RECT wnd=*r;
+ RECT wnd = *r;
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_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)
{
- g_flag_bFullRepaint=0;
+ g_flag_bFullRepaint = 0;
return ske_ValidateFrameImageProc(&wnd);
}
ske_JustUpdateWindowImageRect(&wnd);
@@ -4150,13 +4150,13 @@ int ske_UpdateWindowImageRect(RECT * r) // U void ske_ApplyTransluency()
{
int IsTransparancy;
- HWND hwnd=pcli->hwndContactList;
- BOOL layered=(GetWindowLongPtr(hwnd, GWL_EXSTYLE) & WS_EX_LAYERED)?TRUE:FALSE;
+ HWND hwnd = pcli->hwndContactList;
+ 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)
- g_CluiData.bCurrentAlpha=255;
- if (!g_CluiData.fLayered && (/*(g_CluiData.bCurrentAlpha==255)||*/(g_proc_SetLayeredWindowAttributesNew && IsTransparancy)))
+ IsTransparancy = g_CluiData.fSmoothAnimation || g_bTransparentFlag;
+ 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 (!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);
@@ -4180,13 +4180,13 @@ int ske_JustUpdateWindowImage() int ske_JustUpdateWindowImageRect(RECT * rty)
//Update window image
{
- BLENDFUNCTION bf={AC_SRC_OVER, 0,g_CluiData.bCurrentAlpha, AC_SRC_ALPHA };
- POINT dest={0}, src={0};
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0,g_CluiData.bCurrentAlpha, AC_SRC_ALPHA };
+ POINT dest = {0}, src = {0};
int res;
- RECT wnd=*rty;
+ RECT wnd = *rty;
RECT rect;
- SIZE sz={0};
+ SIZE sz = {0};
if (!g_CluiData.fLayered)
{
@@ -4194,18 +4194,18 @@ int ske_JustUpdateWindowImageRect(RECT * rty) return 0;
}
if (!pcli->hwndContactList) return 0;
- rect=wnd;
- dest.x=rect.left;
- dest.y=rect.top;
- sz.cx=rect.right-rect.left;
- sz.cy=rect.bottom-rect.top;
+ rect = wnd;
+ dest.x = rect.left;
+ dest.y = rect.top;
+ sz.cx = rect.right-rect.left;
+ sz.cy = rect.bottom-rect.top;
if (g_proc_UpdateLayeredWindow && g_CluiData.fLayered)
{
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 );
- res=g_proc_UpdateLayeredWindow(pcli->hwndContactList,g_pCachedWindow->hScreenDC,&dest,&sz,g_pCachedWindow->hImageDC,&src,RGB(1,1,1),&bf,ULW_ALPHA);
+ res = g_proc_UpdateLayeredWindow(pcli->hwndContactList,g_pCachedWindow->hScreenDC,&dest,&sz,g_pCachedWindow->hImageDC,&src,RGB(1,1,1),&bf,ULW_ALPHA);
g_CluiData.fAeroGlass = false;
CLUI_UpdateAeroGlass();
}
@@ -4215,7 +4215,7 @@ int ske_JustUpdateWindowImageRect(RECT * rty) int ske_DrawImageAt(HDC hdc, RECT *rc)
{
- BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ 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)
@@ -4234,33 +4234,33 @@ HBITMAP ske_GetCurrentWindowImage() static DWORD ske_HexToARGB(char * Hex)
{
- char buf[10]={0};
- char buf2[11]={0};
+ char buf[10] = {0};
+ char buf2[11] = {0};
char * st;
BYTE alpha;
- DWORD AARRGGBB=0;
+ DWORD AARRGGBB = 0;
_snprintf(buf,10,"%s\n",Hex);
- if (buf[1]=='x' || buf[1]=='X')
+ if (buf[1] == 'x' || buf[1] == 'X')
_snprintf(buf2,11,"0x%s\n",buf+2);
else
_snprintf(buf2,11,"0x%s\n",buf);
- buf2[10]='\0';
- AARRGGBB=strtoul(buf2,&st,16);
- alpha=(BYTE)((AARRGGBB&0xFF000000)>>24);
- alpha=255-((alpha==0)?255:alpha);
- AARRGGBB=(alpha<<24)+((AARRGGBB&0x00FF0000)>>16)+((AARRGGBB&0x000000FF)<<16)+(AARRGGBB&0x0000FF00);
+ buf2[10] = '\0';
+ AARRGGBB = strtoul(buf2,&st,16);
+ alpha = (BYTE)((AARRGGBB&0xFF000000)>>24);
+ alpha = 255-((alpha == 0)?255:alpha);
+ AARRGGBB = (alpha << 24)+((AARRGGBB&0x00FF0000)>>16)+((AARRGGBB&0x000000FF) << 16)+(AARRGGBB&0x0000FF00);
return AARRGGBB;
}
static TCHAR *ske_ReAppend(TCHAR *lfirst, TCHAR * lsecond, int len)
{
- int l1=lfirst?lstrlen(lfirst):0;
- int l2=(len?len:(lstrlen(lsecond)+1));
- TCHAR *buf=(TCHAR *)mir_alloc((l1+l2+1)*sizeof(TCHAR));
+ int l1 = lfirst?lstrlen(lfirst):0;
+ int l2 = (len?len:(lstrlen(lsecond)+1));
+ TCHAR *buf = (TCHAR *)mir_alloc((l1+l2+1)*sizeof(TCHAR));
if (lfirst) memmove(buf,lfirst,l1*sizeof(TCHAR));
memmove(buf+l1,lsecond,l2*sizeof(TCHAR));
if (lfirst) mir_free(lfirst);
- if (len) buf[l1+l2]=_T('\0');
+ if (len) buf[l1+l2] = _T('\0');
return buf;
}
@@ -4269,12 +4269,12 @@ TCHAR* ske_ReplaceVar(TCHAR *var) if (!var) return mir_tstrdup(_T(""));
if (!lstrcmpi(var,TEXT("Profile")))
{
- char buf[MAX_PATH]={0};
+ char buf[MAX_PATH] = {0};
CallService(MS_DB_GETPROFILENAME,(WPARAM)MAX_PATH,(LPARAM)buf);
{
- int i=strlen(buf);
- while (buf[i]!='.' && i>0) i--;
- buf[i]='\0';
+ int i = strlen(buf);
+ while (buf[i] != '.' && i>0) i--;
+ buf[i] = '\0';
}
mir_free_and_nill(var);
return mir_a2u(buf);
@@ -4285,50 +4285,50 @@ TCHAR* ske_ReplaceVar(TCHAR *var) }
TCHAR *ske_ParseText(TCHAR *stzText)
{
- int len=lstrlen(stzText);
- TCHAR *result=NULL;
- int stpos=0;
- int curpos=0;
+ int len = lstrlen(stzText);
+ TCHAR *result = NULL;
+ int stpos = 0;
+ int curpos = 0;
- while(curpos<len)
+ while(curpos < len)
{
//1 find first %
- while(curpos<len && stzText[curpos]!=(TCHAR)'%') curpos++;
- if (curpos<len) //% found
+ while(curpos < len && stzText[curpos] != (TCHAR)'%') curpos++;
+ if (curpos < len) //% found
{
if (curpos-stpos>0)
- result=ske_ReAppend(result,stzText+stpos,curpos-stpos);
- stpos=curpos+1;
+ result = ske_ReAppend(result,stzText+stpos,curpos-stpos);
+ stpos = curpos+1;
curpos++;
//3 find second %
- while(curpos<len && stzText[curpos]!=(TCHAR)'%') curpos++;
- if (curpos<len)
+ while(curpos < len && stzText[curpos] != (TCHAR)'%') curpos++;
+ if (curpos < len)
{
if (curpos-stpos>0)
{
- TCHAR *var=(TCHAR *)mir_alloc((curpos-stpos+1)*sizeof(TCHAR));
+ TCHAR *var = (TCHAR *)mir_alloc((curpos-stpos+1)*sizeof(TCHAR));
memmove(var,stzText+stpos,(curpos-stpos)*sizeof(TCHAR));
- var[curpos-stpos]=(TCHAR)'\0';
- var=ske_ReplaceVar(var);
- result=ske_ReAppend(result,var,0);
+ var[curpos-stpos] = (TCHAR)'\0';
+ var = ske_ReplaceVar(var);
+ result = ske_ReAppend(result,var,0);
mir_free_and_nill(var);
}
else
- result=ske_ReAppend(result,_T("%"),0);
+ result = ske_ReAppend(result,_T("%"),0);
curpos++;
- stpos=curpos;
+ stpos = curpos;
}
else
{
// if (curpos-stpos>0)
- // result=ske_ReAppend(result,stzText+stpos,curpos-stpos);
+ // result = ske_ReAppend(result,stzText+stpos,curpos-stpos);
break;
}
}
else
{
if (curpos-stpos>0)
- result=ske_ReAppend(result,stzText+stpos,curpos-stpos);
+ result = ske_ReAppend(result,stzText+stpos,curpos-stpos);
break;
}
}
@@ -4337,21 +4337,21 @@ TCHAR *ske_ParseText(TCHAR *stzText) /*
* Parse text object string, find glyph object and add text to it.
* szGlyphTextID and Define string is:
-* t[szGlyphTextID]=s[HostObjectID],[Left],[Top],[Right],[Bottom],[LTRBHV],[FontID],[Color1],[reservedforColor2],[Text]
+* t[szGlyphTextID] = s[HostObjectID],[Left],[Top],[Right],[Bottom],[LTRBHV],[FontID],[Color1],[reservedforColor2],[Text]
*/
static void OLDske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineString,SKINOBJECTSLIST *Skin)
{
- GLYPHOBJECT *globj=NULL;
+ GLYPHOBJECT *globj = NULL;
{
- char buf[255]={0};
+ char buf[255] = {0};
GetParamN(szDefineString,buf,sizeof(buf),0,',',TRUE);
if (strlen(buf))
{
SKINOBJECTDESCRIPTOR * lpobj;
- lpobj=ske_FindObjectByName(buf,OT_GLYPHOBJECT,Skin);
+ lpobj = ske_FindObjectByName(buf,OT_GLYPHOBJECT,Skin);
if (lpobj)
- globj=(GLYPHOBJECT*)lpobj->Data;
+ globj = (GLYPHOBJECT*)lpobj->Data;
}
if (globj)
{
@@ -4359,34 +4359,34 @@ static void OLDske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineS if (!globj->plTextList)
{
- globj->plTextList=List_Create(0,1);
- globj->plTextList->sortFunc=ske_SortTextGlyphObjectFunc;
+ globj->plTextList = List_Create(0,1);
+ globj->plTextList->sortFunc = ske_SortTextGlyphObjectFunc;
}
- glText=(GLYPHTEXT*)mir_calloc(sizeof(GLYPHTEXT));
- glText->szGlyphTextID=mir_strdup(szGlyphTextID);
- glText->szObjectName=mir_strdup(buf);
- glText->iLeft=atoi(GetParamN(szDefineString,buf,sizeof(buf),1,',',TRUE));
- glText->iTop=atoi(GetParamN(szDefineString,buf,sizeof(buf),2,',',TRUE));
- glText->iRight=atoi(GetParamN(szDefineString,buf,sizeof(buf),3,',',TRUE));
- glText->iBottom=atoi(GetParamN(szDefineString,buf,sizeof(buf),4,',',TRUE));
+ glText = (GLYPHTEXT*)mir_calloc(sizeof(GLYPHTEXT));
+ glText->szGlyphTextID = mir_strdup(szGlyphTextID);
+ glText->szObjectName = mir_strdup(buf);
+ glText->iLeft = atoi(GetParamN(szDefineString,buf,sizeof(buf),1,',',TRUE));
+ glText->iTop = atoi(GetParamN(szDefineString,buf,sizeof(buf),2,',',TRUE));
+ glText->iRight = atoi(GetParamN(szDefineString,buf,sizeof(buf),3,',',TRUE));
+ glText->iBottom = atoi(GetParamN(szDefineString,buf,sizeof(buf),4,',',TRUE));
{
memset(buf,0,6);
GetParamN(szDefineString,buf,sizeof(buf),5,',',TRUE);
- buf[0]&=95; buf[1]&=95; buf[2]&=95; buf[3]&=95; buf[4]&=95; buf[5]&=95; //to uppercase: &01011111 (0-95)
- glText->RelativeFlags=
- (buf[0]=='C'?1:((buf[0]=='R')?2:0)) //[BC][RC][BC][RC] --- Left relative
- |(buf[1]=='C'?4:((buf[1]=='B')?8:0)) // | | |--------- Top relative
- |(buf[2]=='C'?16:((buf[2]=='R')?32:0)) // | |--------------Right relative
- |(buf[3]=='C'?64:((buf[3]=='B')?128:0)); // |------------------Bottom relative
- glText->dwFlags=(buf[4]=='C'?DT_CENTER:((buf[4]=='R')?DT_RIGHT:DT_LEFT))
- |(buf[5]=='C'?DT_VCENTER:((buf[5]=='B')?DT_BOTTOM:DT_TOP));
+ buf[0] &= 95; buf[1] &= 95; buf[2] &= 95; buf[3] &= 95; buf[4] &= 95; buf[5] &= 95; //to uppercase: &01011111 (0-95)
+ glText->RelativeFlags =
+ (buf[0] == 'C'?1:((buf[0] == 'R')?2:0)) //[BC][RC][BC][RC] --- Left relative
+ |(buf[1] == 'C'?4:((buf[1] == 'B')?8:0)) // | | |--------- Top relative
+ |(buf[2] == 'C'?16:((buf[2] == 'R')?32:0)) // | |--------------Right relative
+ |(buf[3] == 'C'?64:((buf[3] == 'B')?128:0)); // |------------------Bottom relative
+ glText->dwFlags = (buf[4] == 'C'?DT_CENTER:((buf[4] == 'R')?DT_RIGHT:DT_LEFT))
+ |(buf[5] == 'C'?DT_VCENTER:((buf[5] == 'B')?DT_BOTTOM:DT_TOP));
}
- glText->szFontID=mir_strdup(GetParamN(szDefineString,buf,sizeof(buf),6,',',TRUE));
+ glText->szFontID = mir_strdup(GetParamN(szDefineString,buf,sizeof(buf),6,',',TRUE));
- glText->dwColor=ske_HexToARGB(GetParamN(szDefineString,buf,sizeof(buf),7,',',TRUE));
- glText->dwShadow=ske_HexToARGB(GetParamN(szDefineString,buf,sizeof(buf),8,',',TRUE));
- glText->stValueText=mir_a2u(GetParamN(szDefineString,buf,sizeof(buf),9,',',TRUE));
- glText->stText=ske_ParseText(glText->stValueText);
+ glText->dwColor = ske_HexToARGB(GetParamN(szDefineString,buf,sizeof(buf),7,',',TRUE));
+ glText->dwShadow = ske_HexToARGB(GetParamN(szDefineString,buf,sizeof(buf),8,',',TRUE));
+ glText->stValueText = mir_a2u(GetParamN(szDefineString,buf,sizeof(buf),9,',',TRUE));
+ glText->stText = ske_ParseText(glText->stValueText);
List_Insert(globj->plTextList,(void*)glText,globj->plTextList->realCount);
qsort(globj->plTextList->items,globj->plTextList->realCount,sizeof(void*),(int(*)(const void*, const void*))globj->plTextList->sortFunc);
}
@@ -4396,39 +4396,39 @@ static void OLDske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineS static void ske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineString,SKINOBJECTSLIST *Skin)
{
- char buf[255]={0};
+ char buf[255] = {0};
GetParamN(szDefineString,buf,sizeof(buf),0,',',TRUE);
if (strlen(buf))
{
GLYPHTEXT * glText;
- glText=(GLYPHTEXT*)mir_calloc(sizeof(GLYPHTEXT));
- glText->szGlyphTextID=mir_strdup(szGlyphTextID);
- glText->szObjectName=mir_strdup(buf);
- glText->iLeft=atoi(GetParamN(szDefineString,buf,sizeof(buf),1,',',TRUE));
- glText->iTop=atoi(GetParamN(szDefineString,buf,sizeof(buf),2,',',TRUE));
- glText->iRight=atoi(GetParamN(szDefineString,buf,sizeof(buf),3,',',TRUE));
- glText->iBottom=atoi(GetParamN(szDefineString,buf,sizeof(buf),4,',',TRUE));
+ glText = (GLYPHTEXT*)mir_calloc(sizeof(GLYPHTEXT));
+ glText->szGlyphTextID = mir_strdup(szGlyphTextID);
+ glText->szObjectName = mir_strdup(buf);
+ glText->iLeft = atoi(GetParamN(szDefineString,buf,sizeof(buf),1,',',TRUE));
+ glText->iTop = atoi(GetParamN(szDefineString,buf,sizeof(buf),2,',',TRUE));
+ glText->iRight = atoi(GetParamN(szDefineString,buf,sizeof(buf),3,',',TRUE));
+ glText->iBottom = atoi(GetParamN(szDefineString,buf,sizeof(buf),4,',',TRUE));
{
memset(buf,0,6);
GetParamN(szDefineString,buf,sizeof(buf),5,',',TRUE);
- buf[0]&=95; buf[1]&=95; buf[2]&=95; buf[3]&=95; buf[4]&=95; buf[5]&=95; //to uppercase: &01011111 (0-95)
- glText->RelativeFlags=
- (buf[0]=='C'?1:((buf[0]=='R')?2:0)) //[BC][RC][BC][RC] --- Left relative
- |(buf[1]=='C'?4:((buf[1]=='B')?8:0)) // | | |--------- Top relative
- |(buf[2]=='C'?16:((buf[2]=='R')?32:0)) // | |--------------Right relative
- |(buf[3]=='C'?64:((buf[3]=='B')?128:0)); // |------------------Bottom relative
- glText->dwFlags=(buf[4]=='C'?DT_CENTER:((buf[4]=='R')?DT_RIGHT:DT_LEFT))
- |(buf[5]=='C'?DT_VCENTER:((buf[5]=='B')?DT_BOTTOM:DT_TOP));
+ buf[0] &= 95; buf[1] &= 95; buf[2] &= 95; buf[3] &= 95; buf[4] &= 95; buf[5] &= 95; //to uppercase: &01011111 (0-95)
+ glText->RelativeFlags =
+ (buf[0] == 'C'?1:((buf[0] == 'R')?2:0)) //[BC][RC][BC][RC] --- Left relative
+ |(buf[1] == 'C'?4:((buf[1] == 'B')?8:0)) // | | |--------- Top relative
+ |(buf[2] == 'C'?16:((buf[2] == 'R')?32:0)) // | |--------------Right relative
+ |(buf[3] == 'C'?64:((buf[3] == 'B')?128:0)); // |------------------Bottom relative
+ glText->dwFlags = (buf[4] == 'C'?DT_CENTER:((buf[4] == 'R')?DT_RIGHT:DT_LEFT))
+ |(buf[5] == 'C'?DT_VCENTER:((buf[5] == 'B')?DT_BOTTOM:DT_TOP));
}
- glText->szFontID=mir_strdup(GetParamN(szDefineString,buf,sizeof(buf),6,',',TRUE));
+ glText->szFontID = mir_strdup(GetParamN(szDefineString,buf,sizeof(buf),6,',',TRUE));
- glText->dwColor=ske_HexToARGB(GetParamN(szDefineString,buf,sizeof(buf),7,',',TRUE));
- glText->dwShadow=ske_HexToARGB(GetParamN(szDefineString,buf,sizeof(buf),8,',',TRUE));
- glText->stValueText=mir_a2u(GetParamN(szDefineString,buf,sizeof(buf),9,',',TRUE));
- glText->stText=ske_ParseText(glText->stValueText);
+ glText->dwColor = ske_HexToARGB(GetParamN(szDefineString,buf,sizeof(buf),7,',',TRUE));
+ glText->dwShadow = ske_HexToARGB(GetParamN(szDefineString,buf,sizeof(buf),8,',',TRUE));
+ glText->stValueText = mir_a2u(GetParamN(szDefineString,buf,sizeof(buf),9,',',TRUE));
+ glText->stText = ske_ParseText(glText->stValueText);
if (!Skin->pTextList)
- Skin->pTextList=List_Create(0,1);
+ Skin->pTextList = List_Create(0,1);
List_InsertPtr(Skin->pTextList,glText);
}
}
@@ -4437,47 +4437,47 @@ static void ske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineStri /*
* Parse font definition string.
* szGlyphTextID and Define string is:
-* f[szFontID]=s[FontTypefaceName],[size],[BIU]
+* f[szFontID] = s[FontTypefaceName],[size],[BIU]
*/
static void ske_AddParseSkinFont(char * szFontID,char * szDefineString,SKINOBJECTSLIST *Skin)
{
- //SortedList * gl_plSkinFonts=NULL;
- SKINFONT * sf =NULL;
- sf=(SKINFONT*)mir_calloc(sizeof(SKINFONT));
+ //SortedList * gl_plSkinFonts = NULL;
+ SKINFONT * sf = NULL;
+ sf = (SKINFONT*)mir_calloc(sizeof(SKINFONT));
if (sf)
{
{
char buf[255];
- int fntSize=0;
- BOOL fntBold=FALSE, fntItalic=FALSE, fntUnderline=FALSE;
- LOGFONTA logfont={0};
- logfont.lfCharSet=DEFAULT_CHARSET;
- logfont.lfOutPrecision=OUT_DEFAULT_PRECIS;
- logfont.lfClipPrecision=CLIP_DEFAULT_PRECIS;
- logfont.lfQuality=DEFAULT_QUALITY;
- logfont.lfPitchAndFamily=DEFAULT_PITCH|FF_DONTCARE;
+ int fntSize = 0;
+ BOOL fntBold = FALSE, fntItalic = FALSE, fntUnderline = FALSE;
+ LOGFONTA logfont = {0};
+ logfont.lfCharSet = DEFAULT_CHARSET;
+ logfont.lfOutPrecision = OUT_DEFAULT_PRECIS;
+ logfont.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+ logfont.lfQuality = DEFAULT_QUALITY;
+ logfont.lfPitchAndFamily = DEFAULT_PITCH|FF_DONTCARE;
strncpy(logfont.lfFaceName,GetParamN(szDefineString,buf,sizeof(buf),0,',',TRUE),32);
- logfont.lfHeight=atoi(GetParamN(szDefineString,buf,sizeof(buf),1,',',TRUE));
- if (logfont.lfHeight<0)
+ logfont.lfHeight = atoi(GetParamN(szDefineString,buf,sizeof(buf),1,',',TRUE));
+ if (logfont.lfHeight < 0)
{
- HDC hdc=CreateCompatibleDC(NULL);
- logfont.lfHeight=(long)-MulDiv(logfont.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ HDC hdc = CreateCompatibleDC(NULL);
+ logfont.lfHeight = (long)-MulDiv(logfont.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
mod_DeleteDC(hdc);
}
- logfont.lfHeight=-logfont.lfHeight;
+ logfont.lfHeight = -logfont.lfHeight;
GetParamN(szDefineString,buf,sizeof(buf),2,',',TRUE);
- buf[0]&=95; buf[1]&=95; buf[2]&=95;
- logfont.lfWeight=(buf[0]=='B')?FW_BOLD:FW_NORMAL;
- logfont.lfItalic=(buf[1]=='I')?1:0;
- logfont.lfUnderline=(buf[2]=='U')?1:0;
+ buf[0] &= 95; buf[1] &= 95; buf[2] &= 95;
+ logfont.lfWeight = (buf[0] == 'B')?FW_BOLD:FW_NORMAL;
+ logfont.lfItalic = (buf[1] == 'I')?1:0;
+ logfont.lfUnderline = (buf[2] == 'U')?1:0;
- sf->hFont=CreateFontIndirectA(&logfont);
+ sf->hFont = CreateFontIndirectA(&logfont);
if (sf->hFont)
{
- sf->szFontID=mir_strdup(szFontID);
+ sf->szFontID = mir_strdup(szFontID);
if (!gl_plSkinFonts)
- gl_plSkinFonts=List_Create(0,1);
+ gl_plSkinFonts = List_Create(0,1);
if (gl_plSkinFonts)
{
List_Insert(gl_plSkinFonts,(void*)sf,gl_plSkinFonts->realCount);
@@ -4493,36 +4493,36 @@ static void ske_AddParseSkinFont(char * szFontID,char * szDefineString,SKINOBJEC HICON ske_CreateJoinedIcon_Old(HICON hBottom, HICON hTop,BYTE alpha)
{
HDC tempDC;
-HICON res=NULL;
+HICON res = NULL;
HBITMAP oImage,nImage;
HBITMAP nMask;
-ICONINFO iNew={0};
-ICONINFO iciBottom={0};
-ICONINFO iciTop={0};
-BITMAP bmp={0};
-SIZE sz={0};
+ICONINFO iNew = {0};
+ICONINFO iciBottom = {0};
+ICONINFO iciTop = {0};
+BITMAP bmp = {0};
+SIZE sz = {0};
{
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);
-if(iciBottom.hbmMask) DeleteObject(iciBottom.hbmMask);
+sz.cx = bmp.bmWidth; sz.cy = bmp.bmHeight;
+if (iciBottom.hbmColor) DeleteObject(iciBottom.hbmColor);
+if (iciBottom.hbmMask) DeleteObject(iciBottom.hbmMask);
}
-if (sz.cx==0 || sz.cy==0) return NULL;
-tempDC=CreateCompatibleDC(NULL);
-nImage=ske_CreateDIB32(sz.cx,sz.cy);
-oImage=SelectObject(tempDC,nImage);
+if (sz.cx == 0 || sz.cy == 0) return NULL;
+tempDC = CreateCompatibleDC(NULL);
+nImage = ske_CreateDIB32(sz.cx,sz.cy);
+oImage = SelectObject(tempDC,nImage);
ske_DrawIconEx(tempDC,0,0,hBottom,sz.cx,sz.cy,0,NULL,DI_NORMAL);
-ske_DrawIconEx(tempDC,0,0,hTop,sz.cx,sz.cy,0,NULL,DI_NORMAL|(alpha<<24));
+ske_DrawIconEx(tempDC,0,0,hTop,sz.cx,sz.cy,0,NULL,DI_NORMAL|(alpha << 24));
SelectObject(tempDC,oImage);
DeleteDC(tempDC);
{
-BYTE * p=malloc(sz.cx*sz.cy/8+10);
-nMask=CreateBitmap(sz.cx,sz.cy,1,1,(void*)p);
-iNew.fIcon=TRUE;
-iNew.hbmColor=nImage;
-iNew.hbmMask=nMask;
-res=CreateIconIndirect(&iNew);
+BYTE * p = malloc(sz.cx*sz.cy/8+10);
+nMask = CreateBitmap(sz.cx,sz.cy,1,1,(void*)p);
+iNew.fIcon = TRUE;
+iNew.hbmColor = nImage;
+iNew.hbmMask = nMask;
+res = CreateIconIndirect(&iNew);
if (!res)
TRACE_ERROR();
DeleteObject(nImage);
@@ -4540,17 +4540,17 @@ return res; */
static BOOL ske_CheckHasAlfaChannel(BYTE * from, int widthByte, int height)
{
- int i=0,j=0;
- DWORD * pt=(DWORD*)from;
- while (j<height)
+ int i = 0,j = 0;
+ DWORD * pt = (DWORD*)from;
+ while (j < height)
{
- BYTE * add=(BYTE*)pt+widthByte;
- while (pt<(DWORD*)add)
+ BYTE * add = (BYTE*)pt+widthByte;
+ while (pt < (DWORD*)add)
{
- if ((*pt&0xFF000000)!=0) return TRUE;
+ if ((*pt&0xFF000000) != 0) return TRUE;
pt++;
}
- pt=(DWORD*)(from+widthByte*j);
+ pt = (DWORD*)(from+widthByte*j);
j++;
}
return FALSE;
@@ -4562,10 +4562,10 @@ static BOOL ske_CheckHasAlfaChannel(BYTE * from, int widthByte, int height) */
static BOOL ske_CheckIconHasMask(BYTE * from)
{
- int i=0;
- for (i=0; i<16*16/8; i++)
+ int i = 0;
+ for (i = 0; i < 16*16/8; i++)
{
- if (from[i]!=0) return TRUE;
+ if (from[i] != 0) return TRUE;
}
return FALSE;
}
@@ -4575,7 +4575,7 @@ static BOOL ske_CheckIconHasMask(BYTE * from) */
static BOOL ske_GetMaskBit(BYTE *line, int x)
{
- return ((*(line+(x>>3)))&(0x01<<(7-(x&0x07))))!=0;
+ return ((*(line+(x>>3)))&(0x01 << (7-(x&0x07)))) != 0;
}
/*
* ske_Blend - alpha ske_Blend ARGB values of 2 pixels. X1 - underlaying,
@@ -4584,38 +4584,38 @@ static BOOL ske_GetMaskBit(BYTE *line, int x) static DWORD ske_Blend(DWORD X1,DWORD X2, BYTE alpha)
{
- BYTE a1=(BYTE)(X1>>24);
- BYTE a2=(BYTE)(((X2>>24)*alpha)>>8);
- BYTE r1=(BYTE)(X1>>16);
- BYTE r2=(BYTE)(X2>>16);
- BYTE g1=(BYTE)(X1>>8);
- BYTE g2=(BYTE)(X2>>8);
- BYTE b1=(BYTE)(X1);
- BYTE b2=(BYTE)(X2);
-
- BYTE a_1=~a1;
- BYTE a_2=~a2;
- WORD am=(WORD)a1*a_2;
+ BYTE a1 = (BYTE)(X1>>24);
+ BYTE a2 = (BYTE)(((X2>>24)*alpha)>>8);
+ BYTE r1 = (BYTE)(X1>>16);
+ BYTE r2 = (BYTE)(X2>>16);
+ BYTE g1 = (BYTE)(X1>>8);
+ BYTE g2 = (BYTE)(X2>>8);
+ BYTE b1 = (BYTE)(X1);
+ BYTE b2 = (BYTE)(X2);
+
+ BYTE a_1 = ~a1;
+ BYTE a_2 = ~a2;
+ WORD am = (WORD)a1*a_2;
/* it is possible to use >>8 instead of /255 but it is require additional
* checking of alphavalues
*/
- WORD ar=a1+(((WORD)a_1*a2)/255);
+ WORD ar = a1+(((WORD)a_1*a2)/255);
// if a2 more than 0 than result should be more
- // or equal (if a1==0) to a2, else in combination
+ // or equal (if a1 == 0) to a2, else in combination
// with mask we can get here black points
- ar=(a2>ar)?a2:ar;
+ ar = (a2>ar)?a2:ar;
- if (ar==0) return 0;
+ if (ar == 0) return 0;
//else
{
- WORD arm=ar*255;
- WORD rr=(((WORD)r1*am+(WORD)r2*a2*255))/arm;
- WORD gr=(((WORD)g1*am+(WORD)g2*a2*255))/arm;
- WORD br=(((WORD)b1*am+(WORD)b2*a2*255))/arm;
- return (ar<<24)|(rr<<16)|(gr<<8)|br;
+ WORD arm = ar*255;
+ WORD rr = (((WORD)r1*am+(WORD)r2*a2*255))/arm;
+ WORD gr = (((WORD)g1*am+(WORD)g2*a2*255))/arm;
+ WORD br = (((WORD)b1*am+(WORD)b2*a2*255))/arm;
+ return (ar << 24)|(rr << 16)|(gr << 8)|br;
}
}
@@ -4625,24 +4625,24 @@ static DWORD ske_Blend(DWORD X1,DWORD X2, BYTE alpha) HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
{
HDC tempDC;
- HICON res=NULL;
+ HICON res = NULL;
HBITMAP oImage,nImage;
HBITMAP nMask;
- BITMAP bmp={0};
+ BITMAP bmp = {0};
BYTE *ptPixels;
- ICONINFO iNew={0};
- ICONINFO iciBottom={0};
- ICONINFO iciTop={0};
+ ICONINFO iNew = {0};
+ ICONINFO iciBottom = {0};
+ ICONINFO iciTop = {0};
- BITMAP bmp_top={0};
- BITMAP bmp_top_mask={0};
+ BITMAP bmp_top = {0};
+ BITMAP bmp_top_mask = {0};
- BITMAP bmp_bottom={0};
- BITMAP bmp_bottom_mask={0};
+ BITMAP bmp_bottom = {0};
+ BITMAP bmp_bottom_mask = {0};
- tempDC=CreateCompatibleDC(NULL);
- nImage=ske_CreateDIB32Point(16,16,(void**)&ptPixels);
- oImage=(HBITMAP)SelectObject(tempDC,nImage);
+ tempDC = CreateCompatibleDC(NULL);
+ nImage = ske_CreateDIB32Point(16,16,(void**)&ptPixels);
+ oImage = (HBITMAP)SelectObject(tempDC,nImage);
GetIconInfo(hBottom,&iciBottom);
GetObject(iciBottom.hbmColor,sizeof(BITMAP),&bmp_bottom);
@@ -4652,90 +4652,90 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) GetObject(iciTop.hbmColor,sizeof(BITMAP),&bmp_top);
GetObject(iciTop.hbmMask,sizeof(BITMAP),&bmp_top_mask);
- if (bmp_bottom.bmBitsPixel==32 &&bmp_top.bmBitsPixel==32 && IsWinVerXPPlus())
+ if (bmp_bottom.bmBitsPixel == 32 &&bmp_top.bmBitsPixel == 32 && IsWinVerXPPlus())
{
BYTE * BottomBuffer, * TopBuffer, * BottomMaskBuffer, * TopMaskBuffer;
BYTE * bb, * tb, * bmb, * tmb;
- BYTE * db=ptPixels;
- int vstep_d=16*4;
- int vstep_b=bmp_bottom.bmWidthBytes;
- int vstep_t=bmp_top.bmWidthBytes;
- int vstep_bm=bmp_bottom_mask.bmWidthBytes;
- int vstep_tm=bmp_top_mask.bmWidthBytes;
- alpha=alpha?alpha:255;
- if (bmp_bottom.bmBits) bb=BottomBuffer=(BYTE*)bmp_bottom.bmBits;
+ BYTE * db = ptPixels;
+ int vstep_d = 16*4;
+ int vstep_b = bmp_bottom.bmWidthBytes;
+ int vstep_t = bmp_top.bmWidthBytes;
+ int vstep_bm = bmp_bottom_mask.bmWidthBytes;
+ int vstep_tm = bmp_top_mask.bmWidthBytes;
+ alpha = alpha?alpha:255;
+ if (bmp_bottom.bmBits) bb = BottomBuffer = (BYTE*)bmp_bottom.bmBits;
else
{
- BottomBuffer=(BYTE*)malloc(bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes);
+ BottomBuffer = (BYTE*)malloc(bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes);
GetBitmapBits(iciBottom.hbmColor,bmp_bottom.bmHeight*bmp_bottom.bmWidthBytes,BottomBuffer);
- bb=BottomBuffer+vstep_b*(bmp_bottom.bmHeight-1);
- vstep_b=-vstep_b;
+ bb = BottomBuffer+vstep_b*(bmp_bottom.bmHeight-1);
+ vstep_b = -vstep_b;
}
- if (bmp_top.bmBits) tb=TopBuffer=(BYTE*)bmp_top.bmBits;
+ if (bmp_top.bmBits) tb = TopBuffer = (BYTE*)bmp_top.bmBits;
else
{
- TopBuffer=(BYTE*)malloc(bmp_top.bmHeight*bmp_top.bmWidthBytes);
+ TopBuffer = (BYTE*)malloc(bmp_top.bmHeight*bmp_top.bmWidthBytes);
GetBitmapBits(iciTop.hbmColor,bmp_top.bmHeight*bmp_top.bmWidthBytes,TopBuffer);
- tb=TopBuffer+vstep_t*(bmp_top.bmHeight-1);
- vstep_t=-vstep_t;
+ tb = TopBuffer+vstep_t*(bmp_top.bmHeight-1);
+ vstep_t = -vstep_t;
}
if (bmp_bottom_mask.bmBits)
{
- BottomMaskBuffer=(BYTE*)bmp_bottom_mask.bmBits;
- bmb=BottomMaskBuffer;
+ BottomMaskBuffer = (BYTE*)bmp_bottom_mask.bmBits;
+ bmb = BottomMaskBuffer;
}
else
{
- BottomMaskBuffer=(BYTE*)malloc(bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes);
+ BottomMaskBuffer = (BYTE*)malloc(bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes);
GetBitmapBits(iciBottom.hbmMask,bmp_bottom_mask.bmHeight*bmp_bottom_mask.bmWidthBytes,BottomMaskBuffer);
- bmb=BottomMaskBuffer+vstep_bm*(bmp_bottom_mask.bmHeight-1);
- vstep_bm=-vstep_bm;
+ bmb = BottomMaskBuffer+vstep_bm*(bmp_bottom_mask.bmHeight-1);
+ vstep_bm = -vstep_bm;
}
if (bmp_top_mask.bmBits)
{
- TopMaskBuffer=(BYTE*)bmp_top_mask.bmBits;
- tmb=TopMaskBuffer;
+ TopMaskBuffer = (BYTE*)bmp_top_mask.bmBits;
+ tmb = TopMaskBuffer;
}
else
{
- TopMaskBuffer=(BYTE*)malloc(bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes);
+ TopMaskBuffer = (BYTE*)malloc(bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes);
GetBitmapBits(iciTop.hbmMask,bmp_top_mask.bmHeight*bmp_top_mask.bmWidthBytes,TopMaskBuffer);
- tmb=TopMaskBuffer+vstep_tm*(bmp_top_mask.bmHeight-1);
- vstep_tm=-vstep_tm;
+ tmb = TopMaskBuffer+vstep_tm*(bmp_top_mask.bmHeight-1);
+ vstep_tm = -vstep_tm;
}
{
- int x=0; int y=0;
- BOOL topHasAlpha=ske_CheckHasAlfaChannel(TopBuffer,bmp_top.bmWidthBytes,bmp_top.bmHeight);
- BOOL bottomHasAlpha=ske_CheckHasAlfaChannel(BottomBuffer,bmp_bottom.bmWidthBytes,bmp_bottom.bmHeight);
- BOOL topHasMask=ske_CheckIconHasMask(TopMaskBuffer);
- BOOL bottomHasMask=ske_CheckIconHasMask(BottomMaskBuffer);
- for (y=0; y<16; y++)
+ int x = 0; int y = 0;
+ BOOL topHasAlpha = ske_CheckHasAlfaChannel(TopBuffer,bmp_top.bmWidthBytes,bmp_top.bmHeight);
+ BOOL bottomHasAlpha = ske_CheckHasAlfaChannel(BottomBuffer,bmp_bottom.bmWidthBytes,bmp_bottom.bmHeight);
+ BOOL topHasMask = ske_CheckIconHasMask(TopMaskBuffer);
+ BOOL bottomHasMask = ske_CheckIconHasMask(BottomMaskBuffer);
+ for (y = 0; y < 16; y++)
{
- for (x=0; x<16; x++)
+ for (x = 0; x < 16; x++)
{
- BOOL mask_b=ske_GetMaskBit(bmb,x);
- BOOL mask_t=ske_GetMaskBit(tmb,x);
- DWORD bottom_d=((DWORD*)bb)[x];
- DWORD top_d=((DWORD*)tb)[x];
+ BOOL mask_b = ske_GetMaskBit(bmb,x);
+ BOOL mask_t = ske_GetMaskBit(tmb,x);
+ DWORD bottom_d = ((DWORD*)bb)[x];
+ DWORD top_d = ((DWORD*)tb)[x];
if (topHasMask)
{
- if (mask_t==1 && !topHasAlpha ) top_d&=0xFFFFFF;
- else if (!topHasAlpha) top_d|=0xFF000000;
+ if (mask_t == 1 && !topHasAlpha ) top_d &= 0xFFFFFF;
+ else if (!topHasAlpha) top_d |= 0xFF000000;
}
if (bottomHasMask)
{
- if (mask_b==1 && !bottomHasAlpha) bottom_d&=0xFFFFFF;
- else if (!bottomHasAlpha) bottom_d|=0xFF000000;
+ if (mask_b == 1 && !bottomHasAlpha) bottom_d &= 0xFFFFFF;
+ else if (!bottomHasAlpha) bottom_d |= 0xFF000000;
}
- ((DWORD*)db)[x]=ske_Blend(bottom_d,top_d,alpha);
+ ((DWORD*)db)[x] = ske_Blend(bottom_d,top_d,alpha);
}
- bb+=vstep_b;
- tb+=vstep_t;
- bmb+=vstep_bm;
- tmb+=vstep_tm;
- db+=vstep_d;
+ bb += vstep_b;
+ tb += vstep_t;
+ bmb += vstep_bm;
+ tmb += vstep_tm;
+ db += vstep_d;
}
}
if (!bmp_bottom.bmBits) free(BottomBuffer);
@@ -4746,7 +4746,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) else
{
ske_DrawIconEx(tempDC,0,0,hBottom,16,16,0,NULL,DI_NORMAL);
- ske_DrawIconEx(tempDC,0,0,hTop,16,16,0,NULL,DI_NORMAL|(alpha<<24));
+ ske_DrawIconEx(tempDC,0,0,hTop,16,16,0,NULL,DI_NORMAL|(alpha << 24));
}
DeleteObject(iciBottom.hbmColor);
DeleteObject(iciTop.hbmColor);
@@ -4756,16 +4756,16 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) SelectObject(tempDC,oImage);
DeleteDC(tempDC);
{
- //BYTE *p=malloc(32);
+ //BYTE *p = malloc(32);
//memset(p,0,32);
BYTE p[32] = {0};
- nMask=CreateBitmap(16,16,1,1,(void*)&p);
+ nMask = CreateBitmap(16,16,1,1,(void*)&p);
{
- HDC tempDC2=CreateCompatibleDC(NULL);
- HDC tempDC3=CreateCompatibleDC(NULL);
- HBITMAP hbm=CreateCompatibleBitmap(tempDC3,16,16);
- HBITMAP obmp=(HBITMAP)SelectObject(tempDC2,nMask);
- HBITMAP obmp2=(HBITMAP)SelectObject(tempDC3,hbm);
+ HDC tempDC2 = CreateCompatibleDC(NULL);
+ HDC tempDC3 = CreateCompatibleDC(NULL);
+ HBITMAP hbm = CreateCompatibleBitmap(tempDC3,16,16);
+ HBITMAP obmp = (HBITMAP)SelectObject(tempDC2,nMask);
+ HBITMAP obmp2 = (HBITMAP)SelectObject(tempDC3,hbm);
DrawIconEx(tempDC2,0,0,hBottom,16,16,0,NULL,DI_MASK);
DrawIconEx(tempDC3,0,0,hTop,16,16,0,NULL,DI_MASK);
BitBlt(tempDC2,0,0,16,16,tempDC3,0,0,SRCAND);
@@ -4775,10 +4775,10 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) DeleteDC(tempDC2);
DeleteDC(tempDC3);
}
- iNew.fIcon=TRUE;
- iNew.hbmColor=nImage;
- iNew.hbmMask=nMask;
- res=CreateIconIndirect(&iNew);
+ iNew.fIcon = TRUE;
+ iNew.hbmColor = nImage;
+ iNew.hbmMask = nMask;
+ res = CreateIconIndirect(&iNew);
DeleteObject(nImage);
DeleteObject(nMask);
}
@@ -4786,9 +4786,9 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha) }
#define NEWJOINEDSTR( destination, first, separator, last) \
- destination=(char*)alloca(strlen(first)+strlen(separator)+strlen(last)+1); \
+ destination = (char*)alloca(strlen(first)+strlen(separator)+strlen(last)+1); \
if (destination) { \
- *destination='\0'; \
+ *destination = '\0'; \
strcat(destination,first); \
strcat(destination,separator); \
strcat(destination,last); \
@@ -4802,22 +4802,22 @@ BOOL SkinDBGetContactSetting(HANDLE hContact, const char* szSection, const char* char * szSkinKey;
NEWJOINEDSTR(szSkinKey,szSection,"@",szKey);
if ( !db_get(hContact, SKINSETSECTION, szSkinKey, retdbv)) {
- if (bSkined) *bSkined=TRUE;
+ if (bSkined) *bSkined = TRUE;
return FALSE;
} }
// not skinned
- if (bSkined) bSkined=FALSE;
+ if (bSkined) bSkined = FALSE;
return db_get(hContact, szSection, szKey, retdbv);
}
BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const char*szKey, BYTE bDefault)
{
- DBVARIANT dbv={0};
- BOOL bSkined=FALSE;
+ DBVARIANT dbv = {0};
+ BOOL bSkined = FALSE;
if ( !SkinDBGetContactSetting(hContact, szSection, szKey, &dbv, &bSkined)) {
- if (dbv.type==DBVT_BYTE)
+ if (dbv.type == DBVT_BYTE)
{
- BYTE retVal=dbv.bVal;
+ BYTE retVal = dbv.bVal;
db_free(&dbv);
return retVal;
} else {
@@ -4830,11 +4830,11 @@ BYTE SkinDBGetContactSettingByte(HANDLE hContact, const char* szSection, const c WORD SkinDBGetContactSettingWord(HANDLE hContact, const char* szSection, const char*szKey, WORD wDefault)
{
- BOOL bSkined=FALSE;
- DBVARIANT dbv={0};
+ BOOL bSkined = FALSE;
+ DBVARIANT dbv = {0};
if ( !SkinDBGetContactSetting(hContact, szSection, szKey, &dbv, &bSkined)) {
- if (dbv.type==DBVT_WORD) {
- WORD retVal=dbv.wVal;
+ if (dbv.type == DBVT_WORD) {
+ WORD retVal = dbv.wVal;
db_free(&dbv);
return retVal;
} else {
@@ -4847,11 +4847,11 @@ WORD SkinDBGetContactSettingWord(HANDLE hContact, const char* szSection, const c DWORD SkinDBGetContactSettingDword(HANDLE hContact, const char* szSection, const char*szKey, DWORD dwDefault)
{
- DBVARIANT dbv={0};
- BOOL bSkined=FALSE;
+ DBVARIANT dbv = {0};
+ BOOL bSkined = FALSE;
if ( !SkinDBGetContactSetting(hContact, szSection, szKey, &dbv, &bSkined)) {
- if (dbv.type==DBVT_DWORD) {
- DWORD retVal=dbv.dVal;
+ if (dbv.type == DBVT_DWORD) {
+ DWORD retVal = dbv.dVal;
db_free(&dbv);
return retVal;
} else {
diff --git a/plugins/Clist_modern/modern_skinopt.cpp b/plugins/Clist_modern/modern_skinopt.cpp index 1e02a24d33..da46cb5be6 100644 --- a/plugins/Clist_modern/modern_skinopt.cpp +++ b/plugins/Clist_modern/modern_skinopt.cpp @@ -27,9 +27,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "io.h"
#include "hdr/modern_commonprototypes.h"
#include "hdr/modern_sync.h"
-#include <m_utils.h>
-#include <m_database.h>
-#include <m_modernopt.h>
+#include < m_utils.h>
+#include < m_database.h>
+#include < m_modernopt.h>
/*******************************/
// Main skin selection routine //
@@ -185,7 +185,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara res = MessageBox( hwndDlg, TranslateT( "Skin editor contains not stored changes.\n\nAll changes will be lost.\n\n Continue to load new skin?" ), TranslateT( "Warning!" ), MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2|MB_TOPMOST );
else
res = MessageBox( hwndDlg, TranslateT( "Current skin was not saved to file.\n\nAll changes will be lost.\n\n Continue to load new skin?" ), TranslateT( "Warning!" ), MB_OKCANCEL|MB_ICONWARNING|MB_DEFBUTTON2|MB_TOPMOST );
- if ( res!= IDOK ) return 0;
+ if ( res != IDOK ) return 0;
}
ske_LoadSkinFromIniFile( sd->File, FALSE );
ske_LoadSkinFromDB( );
@@ -234,7 +234,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara DWORD tick = GetTickCount( );
res = GetOpenFileName( &ofn );
if ( !res )
- if ( GetTickCount( )-tick<100 )
+ if ( GetTickCount( )-tick < 100 )
{
res = GetOpenFileName( &ofn );
if ( !res ) break;
@@ -284,8 +284,8 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara GetObject( hPreviewBitmap, sizeof( BITMAP ), &bmp );
wWidth = workRect.right-workRect.left;
wHeight = workRect.bottom-workRect.top;
- if ( wWidth<bmp.bmWidth ) xScale = ( float )wWidth/bmp.bmWidth;
- if ( wHeight<bmp.bmHeight ) yScale = ( float )wHeight/bmp.bmHeight;
+ if ( wWidth < bmp.bmWidth ) xScale = ( float )wWidth/bmp.bmWidth;
+ if ( wHeight < bmp.bmHeight ) yScale = ( float )wHeight/bmp.bmHeight;
xScale = min( xScale, yScale );
yScale = xScale;
dWidth = ( int )( xScale*bmp.bmWidth );
@@ -447,7 +447,7 @@ int SearchSkinFiles( HWND hwndDlg, TCHAR * Folder ) _sntprintf( mask, SIZEOF( mask ), _T("%s\\*.msf"), Folder );
//fd.attrib = _A_SUBDIR;
hFile = _tfindfirst( mask, &fd );
- if ( hFile!= -1 )
+ if ( hFile != -1 )
{
do {
AddSkinToList( hwndDlg, Folder, fd.name );
@@ -458,7 +458,7 @@ int SearchSkinFiles( HWND hwndDlg, TCHAR * Folder ) hFile = _tfindfirst( mask, &fd );
{
do {
- if ( fd.attrib&_A_SUBDIR && !( _tcsicmp( fd.name, _T(".")) ==0 ||_tcsicmp( fd.name, _T(".."))==0 ))
+ if ( fd.attrib&_A_SUBDIR && !( _tcsicmp( fd.name, _T(".")) == 0 ||_tcsicmp( fd.name, _T("..")) == 0 ))
{//Next level of subfolders
TCHAR path[MAX_PATH];
_sntprintf( path, SIZEOF( path ), _T("%s\\%s"), Folder, fd.name );
@@ -484,7 +484,7 @@ HTREEITEM FillAvailableSkinList( HWND hwndDlg ) AddSkinToList( hwndDlg, TranslateT( "Default Skin" ), _T("%Default Skin%"));
attrib = GetFileAttributes( path );
- if ( attrib != INVALID_FILE_ATTRIBUTES && ( attrib & FILE_ATTRIBUTE_DIRECTORY ))
+ if ( attrib !=INVALID_FILE_ATTRIBUTES && ( attrib & FILE_ATTRIBUTE_DIRECTORY ))
SearchSkinFiles( hwndDlg, path );
{
TCHAR * skinfile;
@@ -573,7 +573,7 @@ HTREEITEM FindChild( HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data tvi.pszText = (LPTSTR)&buf;
tvi.cchTextMax = 254;
TreeView_GetItem( hTree, &tvi );
- if ( _tcsicmp( Caption, tvi.pszText )==0 )
+ if ( _tcsicmp( Caption, tvi.pszText ) == 0 )
{
if ( data )
{
@@ -606,7 +606,7 @@ HTREEITEM AddItemToTree( HWND hTree, TCHAR * folder, TCHAR * itemName, void * da BOOL ext = FALSE;
CallService( MS_UTILS_PATHTORELATIVET, ( WPARAM )folder, ( LPARAM )path );
ptrE = path;
- while ( *ptrE != _T('\\') && *ptrE != _T('\0') && *ptrE != _T(':')) ptrE++;
+ while ( *ptrE !=_T('\\') && *ptrE !=_T('\0') && *ptrE !=_T(':')) ptrE++;
if ( *ptrE == _T('\\'))
{
*ptrE = _T('\0');
@@ -617,7 +617,7 @@ HTREEITEM AddItemToTree( HWND hTree, TCHAR * folder, TCHAR * itemName, void * da do
{
- while ( *ptrE!= _T('\\') && *ptrE!= _T('\0')) ptrE++;
+ while ( *ptrE != _T('\\') && *ptrE != _T('\0')) ptrE++;
if ( *ptrE == _T('\\'))
{
*ptrE = _T('\0');
@@ -754,8 +754,8 @@ INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam) GetObject( hPreviewBitmap, sizeof( BITMAP ), &bmp );
wWidth = workRect.right-workRect.left;
wHeight = workRect.bottom-workRect.top;
- if ( wWidth<bmp.bmWidth ) xScale = ( float )wWidth/bmp.bmWidth;
- if ( wHeight<bmp.bmHeight ) yScale = ( float )wHeight/bmp.bmHeight;
+ if ( wWidth < bmp.bmWidth ) xScale = ( float )wWidth/bmp.bmWidth;
+ if ( wHeight < bmp.bmHeight ) yScale = ( float )wHeight/bmp.bmHeight;
xScale = min( xScale, yScale );
yScale = xScale;
dWidth = ( int )( xScale*bmp.bmWidth );
diff --git a/plugins/Clist_modern/modern_skinselector.cpp b/plugins/Clist_modern/modern_skinselector.cpp index fcd430fb56..ffb26eb700 100644 --- a/plugins/Clist_modern/modern_skinselector.cpp +++ b/plugins/Clist_modern/modern_skinselector.cpp @@ -30,20 +30,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "m_api/m_skin_eng.h"
#include "m_api/m_skinbutton.h"
#include "hdr/modern_commonprototypes.h"
-LISTMODERNMASK * MainModernMaskList=NULL;
+LISTMODERNMASK * MainModernMaskList = NULL;
/// IMPLEMENTATIONS
char * ModernMaskToString(MODERNMASK * mm, char * buf, UINT bufsize)
{
- int i=0;
- for (i=0; i<(int)mm->dwParamCnt;i++)
+ int i = 0;
+ for (i = 0; i < (int)mm->dwParamCnt;i++)
{
if (mm->pl_Params[i].bMaskParamFlag)
{
if (i>0) _snprintf(buf,bufsize,"%s%%",buf);
if (mm->pl_Params[i].bMaskParamFlag &MPF_DIFF)
- _snprintf(buf,bufsize,"%s=%s",mm->pl_Params[i].szName,mm->pl_Params[i].szValue);
+ _snprintf(buf,bufsize,"%s = %s",mm->pl_Params[i].szName,mm->pl_Params[i].szValue);
else
_snprintf(buf,bufsize,"%s^%s",mm->pl_Params[i].szName,mm->pl_Params[i].szValue);
}
@@ -55,7 +55,7 @@ int SkinSelector_DeleteMask(MODERNMASK * mm) {
int i;
if (!mm->pl_Params) return 0;
- for (i=0;i<(int)mm->dwParamCnt;i++)
+ for (i = 0;i < (int)mm->dwParamCnt;i++)
{
if (mm->pl_Params[i].szName) free(mm->pl_Params[i].szName);
if (mm->pl_Params[i].szValue) free(mm->pl_Params[i].szValue);
@@ -64,16 +64,16 @@ int SkinSelector_DeleteMask(MODERNMASK * mm) return 1;
}
-#define _qtoupper(_c) (((_c)>='a' && (_c)<='z')?((_c)-('a'+'A')):(_c))
+#define _qtoupper(_c) (((_c) >= 'a' && (_c) <= 'z')?((_c)-('a'+'A')):(_c))
BOOL wildcmpi(TCHAR* name, TCHAR* mask)
{
- TCHAR* last='\0';
+ TCHAR* last = '\0';
for (;; mask++, name++)
{
- if (*mask != '?' && _qtoupper(*mask) != _qtoupper(*name)) break;
+ if (*mask !='?' && _qtoupper(*mask) !=_qtoupper(*name)) break;
if (*name == '\0') return ((BOOL)!*mask);
}
- if (*mask != '*') return FALSE;
+ if (*mask !='*') return FALSE;
for (;; mask++, name++)
{
while(*mask == '*')
@@ -82,19 +82,19 @@ BOOL wildcmpi(TCHAR* name, TCHAR* mask) if (*mask == '\0') return ((BOOL)!*mask); /* true */
}
if (*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
- if (*mask != '?' && _qtoupper(*mask) != _qtoupper(*name)) name -= (size_t)(mask - last) - 1, mask = last;
+ if (*mask !='?' && _qtoupper(*mask) !=_qtoupper(*name)) name -= (size_t)(mask - last) - 1, mask = last;
}
}
BOOL wildcmpi(char * name, char * mask)
{
- char * last='\0';
+ char * last = '\0';
for (;; mask++, name++)
{
- if (*mask != '?' && _qtoupper(*mask) != _qtoupper(*name)) break;
+ if (*mask !='?' && _qtoupper(*mask) !=_qtoupper(*name)) break;
if (*name == '\0') return ((BOOL)!*mask);
}
- if (*mask != '*') return FALSE;
+ if (*mask !='*') return FALSE;
for (;; mask++, name++)
{
while(*mask == '*')
@@ -103,19 +103,19 @@ BOOL wildcmpi(char * name, char * mask) if (*mask == '\0') return ((BOOL)!*mask); /* true */
}
if (*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
- if (*mask != '?' && _qtoupper(*mask) != _qtoupper(*name)) name -= (size_t)(mask - last) - 1, mask = last;
+ if (*mask !='?' && _qtoupper(*mask) !=_qtoupper(*name)) name -= (size_t)(mask - last) - 1, mask = last;
}
}
BOOL __inline wildcmp(const char * name, const char * mask, BYTE option)
{
- const char * last='\0';
+ const char * last = '\0';
for (;; mask++, name++)
{
- if (*mask != '?' && *mask != *name) break;
+ if (*mask !='?' && *mask !=*name) break;
if (*name == '\0') return ((BOOL)!*mask);
}
- if (*mask != '*') return FALSE;
+ if (*mask !='*') return FALSE;
for (;; mask++, name++)
{
while(*mask == '*')
@@ -124,31 +124,31 @@ BOOL __inline wildcmp(const char * name, const char * mask, BYTE option) if (*mask == '\0') return ((BOOL)!*mask); /* true */
}
if (*name == '\0') return ((BOOL)!*mask); /* *mask == EOS */
- if (*mask != '?' && *mask != *name) name -= (size_t)(mask - last) - 1, mask = last;
+ if (*mask !='?' && *mask !=*name) name -= (size_t)(mask - last) - 1, mask = last;
}
}
BOOL MatchMask(char * name, char * mask)
{
- if (!mask || !name) return mask==name;
- if (*mask!='|') return wildcmpi(name,mask);
+ if (!mask || !name) return mask == name;
+ if (*mask != '|') return wildcmpi(name,mask);
{
- int s=1,e=1;
+ int s = 1,e = 1;
char * temp;
- while (mask[e]!='\0')
+ while (mask[e] != '\0')
{
- s=e;
- while(mask[e]!='\0' && mask[e]!='|') e++;
- temp=(char*)malloc(e-s+1);
+ s = e;
+ while(mask[e] != '\0' && mask[e] != '|') e++;
+ temp = (char*)malloc(e-s+1);
memcpy(temp,mask+s,e-s);
- temp[e-s]='\0';
+ temp[e-s] = '\0';
if (wildcmpi(name,temp))
{
free(temp);
return TRUE;
}
free(temp);
- if (mask[e]!='\0') e++;
+ if (mask[e] != '\0') e++;
else return FALSE;
}
return FALSE;
@@ -183,13 +183,13 @@ lph_top: //only 4 of 9 instructions in here don't use AL, so optimal pipe use i xor eax,edx
}
#else
- DWORD hash=0;
+ DWORD hash = 0;
int i;
- int shift=0;
- for(i=0;szStr[i];i++) {
- hash^=szStr[i]<<shift;
- if(shift>24) hash^=(szStr[i]>>(32-shift))&0x7F;
- shift=(shift+5)&0x1F;
+ int shift = 0;
+ for(i = 0;szStr[i];i++) {
+ hash ^= szStr[i] << shift;
+ if (shift>24) hash ^= (szStr[i]>>(32-shift))&0x7F;
+ shift = (shift+5)&0x1F;
}
return hash;
#endif
@@ -198,14 +198,14 @@ lph_top: //only 4 of 9 instructions in here don't use AL, so optimal pipe use i /*
DWORD mod_CalcHash(const char * a)
{
- DWORD Val=0;
+ DWORD Val = 0;
BYTE N;
- DWORD k=mir_strlen(a);
- if (k<23) N=(BYTE)k; else N=23;
+ DWORD k = mir_strlen(a);
+ if (k < 23) N = (BYTE)k; else N = 23;
while (N>0)
{
- Val=Val<<1;
- Val^=((DWORD)*a++)-31;
+ Val = Val << 1;
+ Val ^= ((DWORD)*a++)-31;
N--;
}
return Val;
@@ -214,7 +214,7 @@ DWORD mod_CalcHash(const char * a) int AddModernMaskToList(MODERNMASK * mm, LISTMODERNMASK * mmTemplateList)
{
if (!mmTemplateList || !mm) return -1;
- mmTemplateList->pl_Masks=(MODERNMASK *)mir_realloc(mmTemplateList->pl_Masks,sizeof(MODERNMASK)*(mmTemplateList->dwMaskCnt+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++;
return mmTemplateList->dwMaskCnt-1;
@@ -225,22 +225,22 @@ int ClearMaskList(LISTMODERNMASK * mmTemplateList) int i;
if (!mmTemplateList) return -1;
if (!mmTemplateList->pl_Masks) return -1;
- for(i=0; i<(int)mmTemplateList->dwMaskCnt; i++)
+ for(i = 0; i < (int)mmTemplateList->dwMaskCnt; i++)
SkinSelector_DeleteMask(&(mmTemplateList->pl_Masks[i]));
mir_free_and_nill(mmTemplateList->pl_Masks);
- mmTemplateList->pl_Masks=NULL;
- mmTemplateList->dwMaskCnt=0;
+ mmTemplateList->pl_Masks = NULL;
+ mmTemplateList->dwMaskCnt = 0;
return 0;
}
int DeleteMaskByItID(DWORD mID,LISTMODERNMASK * mmTemplateList)
{
if (!mmTemplateList) return -1;
- if (mID<0|| mID>=mmTemplateList->dwMaskCnt) return -1;
- if (mmTemplateList->dwMaskCnt==1)
+ if (mID < 0|| mID >= mmTemplateList->dwMaskCnt) return -1;
+ if (mmTemplateList->dwMaskCnt == 1)
{
SkinSelector_DeleteMask(&(mmTemplateList->pl_Masks[0]));
mir_free_and_nill(mmTemplateList->pl_Masks);
- mmTemplateList->pl_Masks=NULL;
+ mmTemplateList->pl_Masks = NULL;
mmTemplateList->dwMaskCnt;
}
else
@@ -248,15 +248,15 @@ int DeleteMaskByItID(DWORD mID,LISTMODERNMASK * mmTemplateList) MODERNMASK * newAlocation;
DWORD i;
SkinSelector_DeleteMask(&(mmTemplateList->pl_Masks[mID]));
- newAlocation=(MODERNMASK *)mir_alloc(sizeof(MODERNMASK)*mmTemplateList->dwMaskCnt-1);
+ newAlocation = (MODERNMASK *)mir_alloc(sizeof(MODERNMASK)*mmTemplateList->dwMaskCnt-1);
memmove(newAlocation,mmTemplateList->pl_Masks,sizeof(MODERNMASK)*(mID+1));
- for (i=mID; i<mmTemplateList->dwMaskCnt-1; i++)
+ for (i = mID; i < mmTemplateList->dwMaskCnt-1; i++)
{
- newAlocation[i]=mmTemplateList->pl_Masks[i+1];
- newAlocation[i].dwMaskId=i;
+ newAlocation[i] = mmTemplateList->pl_Masks[i+1];
+ newAlocation[i].dwMaskId = i;
}
mir_free_and_nill(mmTemplateList->pl_Masks);
- mmTemplateList->pl_Masks=newAlocation;
+ mmTemplateList->pl_Masks = newAlocation;
mmTemplateList->dwMaskCnt--;
}
return mmTemplateList->dwMaskCnt;
@@ -266,32 +266,32 @@ int DeleteMaskByItID(DWORD mID,LISTMODERNMASK * mmTemplateList) int ExchangeMasksByID(DWORD mID1, DWORD mID2, LISTMODERNMASK * mmTemplateList)
{
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;
+ if (mID1 < 0|| mID1 >= mmTemplateList->dwMaskCnt) return 0;
+ if (mID2 < 0|| mID2 >= mmTemplateList->dwMaskCnt) return 0;
+ if (mID1 == mID2) return 0;
{
MODERNMASK mm;
- mm=mmTemplateList->pl_Masks[mID1];
- mmTemplateList->pl_Masks[mID1]=mmTemplateList->pl_Masks[mID2];
- mmTemplateList->pl_Masks[mID2]=mm;
+ mm = mmTemplateList->pl_Masks[mID1];
+ mmTemplateList->pl_Masks[mID1] = mmTemplateList->pl_Masks[mID2];
+ mmTemplateList->pl_Masks[mID2] = mm;
}
return 1;
}
int SortMaskList(LISTMODERNMASK * mmList)
{
- DWORD pos=1;
- if (mmList->dwMaskCnt<2) return 0;
+ DWORD pos = 1;
+ if (mmList->dwMaskCnt < 2) return 0;
do {
- if(mmList->pl_Masks[pos].dwMaskId<mmList->pl_Masks[pos-1].dwMaskId)
+ if (mmList->pl_Masks[pos].dwMaskId < mmList->pl_Masks[pos-1].dwMaskId)
{
ExchangeMasksByID(pos, pos-1, mmList);
pos--;
- if (pos<1)
- pos=1;
+ if (pos < 1)
+ pos = 1;
}
else
pos++;
- } while(pos<mmList->dwMaskCnt);
+ } while(pos < mmList->dwMaskCnt);
return 1;
}
@@ -309,7 +309,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len enum { STATE_PARAM, STATE_VALUE };
int state = STATE_PARAM;
- if ( start >= length ) return FALSE;
+ if ( start >= length ) return FALSE;
paramlen = 0;
valuelen = 0;
@@ -320,7 +320,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len param = curChar;
- BOOL exitLoop=false;
+ BOOL exitLoop = false;
while ( !exitLoop )
{
switch ( *curChar )
@@ -331,7 +331,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len except |= EXCEPTION_NOT_EQUAL;
exitLoop = TRUE;
//fall trough
- case '=':
+ case ' = ':
if ( state == STATE_VALUE ) break;
//search value end
paramlen = curChar - param;
@@ -340,7 +340,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len case ',':
default:
- if ( *curChar!=',' && curChar < lastChar ) break;
+ if ( *curChar != ',' && curChar < lastChar ) break;
if ( state == STATE_PARAM )
{
// no parameter name only value
@@ -353,7 +353,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len break;
case '*': case '?':
if (state == STATE_PARAM ) break;
- except|=EXCEPTION_WILD;
+ except |= EXCEPTION_WILD;
break;
}
if ( exitLoop)
@@ -409,12 +409,12 @@ int ParseToModernMask(MODERNMASK * mm, char * szText) {
if (!mm || !szText) return -1;
- unsigned int textLen=mir_strlen(szText);
- BYTE curParam=0;
+ unsigned int textLen = mir_strlen(szText);
+ BYTE curParam = 0;
- MASKPARAM param={0};
+ MASKPARAM param = {0};
- unsigned int startPos=0;
+ unsigned int startPos = 0;
char * pszParam;
char * pszValue;
unsigned int paramlen;
@@ -431,26 +431,26 @@ int ParseToModernMask(MODERNMASK * mm, char * szText) //Get param name
if ( pszParam && paramlen )
{
- param.szName=strdupn( pszParam, paramlen);
- param.dwId=mod_CalcHash( param.szName );
+ param.szName = strdupn( pszParam, paramlen);
+ param.dwId = mod_CalcHash( param.szName );
}
- else //ParamName='Module'
+ else //ParamName = 'Module'
{
- param.szName=_strdup( "Module");
- param.dwId=mod_CalcHash( param.szName );
+ param.szName = _strdup( "Module");
+ param.dwId = mod_CalcHash( param.szName );
}
- param.szValue= strdupn( pszValue, valuelen );
+ param.szValue = strdupn( pszValue, valuelen );
if ( !(except & EXCEPTION_WILD))
{
param.dwValueHash = mod_CalcHash( param.szValue );
param.bMaskParamFlag |= MPF_HASHED;
}
- if (curParam>=mm->dwParamCnt)
+ if (curParam >= mm->dwParamCnt)
{
- mm->pl_Params=(MASKPARAM*)realloc(mm->pl_Params,(mm->dwParamCnt+1)*sizeof(MASKPARAM));
+ mm->pl_Params = (MASKPARAM*)realloc(mm->pl_Params,(mm->dwParamCnt+1)*sizeof(MASKPARAM));
mm->dwParamCnt++;
}
memmove(&(mm->pl_Params[curParam]),¶m,sizeof(MASKPARAM));
@@ -463,40 +463,40 @@ int ParseToModernMask(MODERNMASK * mm, char * szText) BOOL CompareModernMask(MODERNMASK * mmValue,MODERNMASK * mmTemplate)
{
//TODO
- BOOL res=TRUE;
- BOOL exit=FALSE;
- BYTE pVal=0, pTemp=0;
- while (pTemp<mmTemplate->dwParamCnt && pVal<mmValue->dwParamCnt && !exit)
+ BOOL res = TRUE;
+ BOOL exit = FALSE;
+ BYTE pVal = 0, pTemp = 0;
+ while (pTemp < mmTemplate->dwParamCnt && pVal < mmValue->dwParamCnt && !exit)
{
// find pTemp parameter in mValue
DWORD vh, ph;
- BOOL finded=0;
- MASKPARAM p=mmTemplate->pl_Params[pTemp];
- ph=p.dwId;
- vh=p.dwValueHash;
- pVal=0;
+ BOOL finded = 0;
+ MASKPARAM p = mmTemplate->pl_Params[pTemp];
+ ph = p.dwId;
+ vh = p.dwValueHash;
+ pVal = 0;
if ( p.bMaskParamFlag& MPF_HASHED ) //compare by hash
- while (pVal<mmValue->dwParamCnt && mmValue->pl_Params[pVal].bMaskParamFlag !=0)
+ while (pVal < mmValue->dwParamCnt && mmValue->pl_Params[pVal].bMaskParamFlag !=0)
{
- if (mmValue->pl_Params[pVal].dwId==ph)
+ if (mmValue->pl_Params[pVal].dwId == ph)
{
- if (mmValue->pl_Params[pVal].dwValueHash==vh){finded=1; break;}
- else {finded=0; break;}
+ if (mmValue->pl_Params[pVal].dwValueHash == vh){finded = 1; break;}
+ else {finded = 0; break;}
}
pVal++;
}
else
- while (mmValue->pl_Params[pVal].bMaskParamFlag!=0)
+ while (mmValue->pl_Params[pVal].bMaskParamFlag != 0)
{
- if (mmValue->pl_Params[pVal].dwId==ph)
+ if (mmValue->pl_Params[pVal].dwId == ph)
{
- if (wildcmp(mmValue->pl_Params[pVal].szValue,p.szValue,0)){finded=1; break;}
- else {finded=0; break;}
+ if (wildcmp(mmValue->pl_Params[pVal].szValue,p.szValue,0)){finded = 1; break;}
+ else {finded = 0; break;}
}
pVal++;
}
if (!((finded && !(p.bMaskParamFlag&MPF_DIFF)) || (!finded && (p.bMaskParamFlag&MPF_DIFF))))
- {res=FALSE; break;}
+ {res = FALSE; break;}
pTemp++;
}
return res;
@@ -504,11 +504,11 @@ BOOL CompareModernMask(MODERNMASK * mmValue,MODERNMASK * mmTemplate) BOOL CompareStrWithModernMask(char * szValue,MODERNMASK * mmTemplate)
{
- MODERNMASK mmValue={0};
+ MODERNMASK mmValue = {0};
int res;
if (!ParseToModernMask(&mmValue, szValue))
{
- res=CompareModernMask(&mmValue,mmTemplate);
+ res = CompareModernMask(&mmValue,mmTemplate);
SkinSelector_DeleteMask(&mmValue);
return res;
}
@@ -520,13 +520,13 @@ int AddStrModernMaskToList(DWORD maskID, char * szStr, char * objectName, LISTM {
if (!szStr || !mmTemplateList) return -1;
- MODERNMASK mm={0};
+ MODERNMASK mm = {0};
if (ParseToModernMask(&mm,szStr)) return -1;
- mm.bObjectFound=FALSE;
- mm.szObjectName=mir_strdup(objectName);
- //mm.pObject=(void*) ske_FindObjectByName(objectName, OT_ANY, (SKINOBJECTSLIST*) pObjectList);
- mm.dwMaskId=maskID;
+ mm.bObjectFound = FALSE;
+ mm.szObjectName = mir_strdup(objectName);
+ //mm.pObject = (void*) ske_FindObjectByName(objectName, OT_ANY, (SKINOBJECTSLIST*) pObjectList);
+ mm.dwMaskId = maskID;
return AddModernMaskToList(&mm,mmTemplateList);
}
@@ -539,13 +539,13 @@ MODERNMASK * FindMaskByStr(char * szValue,LISTMODERNMASK * mmTemplateList) SKINOBJECTDESCRIPTOR * skin_FindObjectByMask (MODERNMASK * mm,LISTMODERNMASK * mmTemplateList)
{
- SKINOBJECTDESCRIPTOR * res=NULL;
- DWORD i=0;
- while (i<mmTemplateList->dwMaskCnt)
+ SKINOBJECTDESCRIPTOR * res = NULL;
+ DWORD i = 0;
+ while (i < mmTemplateList->dwMaskCnt)
{
if (CompareModernMask(mm,&(mmTemplateList->pl_Masks[i])))
{
- res=(SKINOBJECTDESCRIPTOR*) mmTemplateList->pl_Masks[i].pObject;
+ res = (SKINOBJECTDESCRIPTOR*) mmTemplateList->pl_Masks[i].pObject;
return res;
}
i++;
@@ -555,24 +555,24 @@ SKINOBJECTDESCRIPTOR * skin_FindObjectByMask (MODERNMASK * mm,LISTMODERNMASK * SKINOBJECTDESCRIPTOR * skin_FindObjectByRequest(char * szValue,LISTMODERNMASK * mmTemplateList)
{
- MODERNMASK mm={0};
- SKINOBJECTDESCRIPTOR * res=NULL;
+ MODERNMASK mm = {0};
+ SKINOBJECTDESCRIPTOR * res = NULL;
if (!mmTemplateList)
if (g_SkinObjectList.pMaskList)
- mmTemplateList=g_SkinObjectList.pMaskList;
+ mmTemplateList = g_SkinObjectList.pMaskList;
else
return NULL;
if (!mmTemplateList) return NULL;
ParseToModernMask(&mm,szValue);
- res=skin_FindObjectByMask(&mm,mmTemplateList);
+ res = skin_FindObjectByMask(&mm,mmTemplateList);
SkinSelector_DeleteMask(&mm);
return res;
}
TCHAR * GetParamNT(char * string, TCHAR * buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
{
- char *ansibuf=(char*)mir_alloc(buflen/sizeof(TCHAR));
+ char *ansibuf = (char*)mir_alloc(buflen/sizeof(TCHAR));
GetParamN(string, ansibuf, buflen/sizeof(TCHAR), paramN, Delim, SkipSpaces);
MultiByteToWideChar(CP_UTF8,0,ansibuf,-1,buf,buflen);
mir_free_and_nill(ansibuf);
@@ -581,35 +581,35 @@ TCHAR * GetParamNT(char * string, TCHAR * buf, int buflen, BYTE paramN, char Del char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
{
- int i=0;
- DWORD start=0;
- DWORD end=0;
- DWORD CurentCount=0;
+ int i = 0;
+ DWORD start = 0;
+ DWORD end = 0;
+ DWORD CurentCount = 0;
DWORD len;
- while (i<mir_strlen(string))
+ while (i < mir_strlen(string))
{
- if (string[i]==Delim)
+ if (string[i] == Delim)
{
- if (CurentCount==paramN) break;
- start=i+1;
+ if (CurentCount == paramN) break;
+ start = i+1;
CurentCount++;
}
i++;
}
- if (CurentCount==paramN)
+ if (CurentCount == paramN)
{
if (SkipSpaces)
{ //remove spaces
- while (string[start]==' ' && (int)start<mir_strlen(string))
+ while (string[start] == ' ' && (int)start < mir_strlen(string))
start++;
- while (i>1 && string[i-1]==' ' && i>(int)start)
+ while (i>1 && string[i-1] == ' ' && i>(int)start)
i--;
}
- len=((int)(i-start)<buflen)?i-start:buflen;
+ len = ((int)(i-start) < buflen)?i-start:buflen;
strncpy(buf,string+start,len);
- buf[len]='\0';
+ buf[len] = '\0';
}
- else buf[0]='\0';
+ else buf[0] = '\0';
return buf;
}
@@ -621,46 +621,46 @@ int RegisterButtonByParce(char * ObjectName, char * Params) GetParamN(Params,buf, SIZEOF(buf),0,',',0);
// if (boolstrcmpi("Push",buf)
{ //Push type
- char buf2[20]={0};
- char pServiceName[255]={0};
- char pStatusServiceName[255]={0};
+ char buf2[20] = {0};
+ char pServiceName[255] = {0};
+ char pStatusServiceName[255] = {0};
int Left, Top,Right,Bottom;
int MinWidth, MinHeight;
- char TL[9]={0};
- TCHAR Hint[250]={0};
- char Section[250]={0};
- char Type[250]={0};
+ char TL[9] = {0};
+ TCHAR Hint[250] = {0};
+ char Section[250] = {0};
+ char Type[250] = {0};
DWORD alingnto;
- int a=((int)mir_bool_strcmpi(buf,"Switch"))*2;
+ int a = ((int)mir_bool_strcmpi(buf,"Switch"))*2;
GetParamN(Params,pServiceName, SIZEOF(pServiceName),1,',',0);
// if (a) GetParamN(Params,pStatusServiceName, sizeof(pStatusServiceName),a+1,',',0);
- Left=atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+2,',',0));
- Top=atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+3,',',0));
- Right=atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+4,',',0));
- Bottom=atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+5,',',0));
+ Left = atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+2,',',0));
+ Top = atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+3,',',0));
+ Right = atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+4,',',0));
+ Bottom = atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+5,',',0));
GetParamN(Params,TL, SIZEOF(TL),a+6,',',0);
- MinWidth=atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+7,',',0));
- MinHeight=atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+8,',',0));
+ MinWidth = atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+7,',',0));
+ MinHeight = atoi(GetParamN(Params,buf2, SIZEOF(buf2),a+8,',',0));
GetParamNT(Params,Hint, SIZEOF(Hint),a+9,',',0);
if (a)
{
GetParamN(Params,Section, SIZEOF(Section),2,',',0);
GetParamN(Params,Type, SIZEOF(Type),3,',',0);
}
- alingnto= ( (TL[0]=='R') ? SBF_ALIGN_TL_RIGHT : 0 )
- +( (TL[0]=='C') ? SBF_ALIGN_TL_HCENTER : 0 )
- +( (TL[1]=='B') ? SBF_ALIGN_TL_BOTTOM : 0 )
- +( (TL[1]=='C') ? SBF_ALIGN_TL_VCENTER : 0 )
- +( (TL[2]=='R') ? SBF_ALIGN_BR_RIGHT : 0 )
- +( (TL[2]=='C') ? SBF_ALIGN_BR_HCENTER : 0 )
- +( (TL[3]=='B') ? SBF_ALIGN_BR_BOTTOM : 0 )
- +( (TL[3]=='C') ? SBF_ALIGN_BR_VCENTER : 0 )
- +( (TL[4]=='I') ? SBF_CALL_ON_PRESS : 0 );
- if (a) res=ModernSkinButton_AddButton(pcli->hwndContactList,ObjectName+1,pServiceName,pStatusServiceName,"\0",Left,Top,Right,Bottom,alingnto,TranslateTS(Hint),Section,Type,MinWidth,MinHeight);
- else res=ModernSkinButton_AddButton(pcli->hwndContactList,ObjectName+1,pServiceName,pStatusServiceName,"\0",Left,Top,Right,Bottom,alingnto,TranslateTS(Hint),NULL,NULL,MinWidth,MinHeight);
+ alingnto = ( (TL[0] == 'R') ? SBF_ALIGN_TL_RIGHT : 0 )
+ +( (TL[0] == 'C') ? SBF_ALIGN_TL_HCENTER : 0 )
+ +( (TL[1] == 'B') ? SBF_ALIGN_TL_BOTTOM : 0 )
+ +( (TL[1] == 'C') ? SBF_ALIGN_TL_VCENTER : 0 )
+ +( (TL[2] == 'R') ? SBF_ALIGN_BR_RIGHT : 0 )
+ +( (TL[2] == 'C') ? SBF_ALIGN_BR_HCENTER : 0 )
+ +( (TL[3] == 'B') ? SBF_ALIGN_BR_BOTTOM : 0 )
+ +( (TL[3] == 'C') ? SBF_ALIGN_BR_VCENTER : 0 )
+ +( (TL[4] == 'I') ? SBF_CALL_ON_PRESS : 0 );
+ if (a) res = ModernSkinButton_AddButton(pcli->hwndContactList,ObjectName+1,pServiceName,pStatusServiceName,"\0",Left,Top,Right,Bottom,alingnto,TranslateTS(Hint),Section,Type,MinWidth,MinHeight);
+ else res = ModernSkinButton_AddButton(pcli->hwndContactList,ObjectName+1,pServiceName,pStatusServiceName,"\0",Left,Top,Right,Bottom,alingnto,TranslateTS(Hint),NULL,NULL,MinWidth,MinHeight);
}
return res;
}
@@ -668,84 +668,84 @@ int RegisterButtonByParce(char * ObjectName, char * Params) //Parse DB string and add object
// Params is:
// Glyph,None
-// Glyph,Solid,<ColorR>,<ColorG>,<ColorB>,<Alpha>
-// Glyph,Image,Filename,(TileBoth|TileVert|TileHor|StretchBoth),<MarginLeft>,<MarginTop>,<MarginRight>,<MarginBottom>,<Alpha>
+// Glyph,Solid, < ColorR>, < ColorG>, < ColorB>, < Alpha>
+// Glyph,Image,Filename,(TileBoth|TileVert|TileHor|StretchBoth), < MarginLeft>, < MarginTop>, < MarginRight>, < MarginBottom>, < Alpha>
int RegisterObjectByParce(char * ObjectName, char * Params)
{
if (!ObjectName || !Params) return 0;
{
- int res=0;
- SKINOBJECTDESCRIPTOR obj={0};
+ int res = 0;
+ SKINOBJECTDESCRIPTOR obj = {0};
char buf[250];
- obj.szObjectID=mir_strdup(ObjectName);
+ obj.szObjectID = mir_strdup(ObjectName);
GetParamN(Params,buf, SIZEOF(buf),0,',',0);
if (mir_bool_strcmpi(buf,"Glyph"))
- obj.bType=OT_GLYPHOBJECT;
+ obj.bType = OT_GLYPHOBJECT;
else if (mir_bool_strcmpi(buf,"Font"))
- obj.bType=OT_FONTOBJECT;
+ obj.bType = OT_FONTOBJECT;
switch (obj.bType)
{
case OT_GLYPHOBJECT:
{
- GLYPHOBJECT gl={0};
+ GLYPHOBJECT gl = {0};
GetParamN(Params,buf, SIZEOF(buf),1,',',0);
if (mir_bool_strcmpi(buf,"Solid"))
{
//Solid
int r,g,b;
- gl.Style=ST_BRUSH;
- r=atoi(GetParamN(Params,buf, SIZEOF(buf),2,',',0));
- g=atoi(GetParamN(Params,buf, SIZEOF(buf),3,',',0));
- b=atoi(GetParamN(Params,buf, SIZEOF(buf),4,',',0));
- gl.dwAlpha=atoi(GetParamN(Params,buf, SIZEOF(buf),5,',',0));
- gl.dwColor=RGB(r,g,b);
+ gl.Style = ST_BRUSH;
+ r = atoi(GetParamN(Params,buf, SIZEOF(buf),2,',',0));
+ g = atoi(GetParamN(Params,buf, SIZEOF(buf),3,',',0));
+ b = atoi(GetParamN(Params,buf, SIZEOF(buf),4,',',0));
+ gl.dwAlpha = atoi(GetParamN(Params,buf, SIZEOF(buf),5,',',0));
+ gl.dwColor = RGB(r,g,b);
}
else if (mir_bool_strcmpi(buf,"Image"))
{
//Image
- gl.Style=ST_IMAGE;
- gl.szFileName=mir_strdup(GetParamN(Params,buf, SIZEOF(buf),2,',',0));
- gl.dwLeft=atoi(GetParamN(Params,buf, SIZEOF(buf),4,',',0));
- gl.dwTop=atoi(GetParamN(Params,buf, SIZEOF(buf),5,',',0));
- gl.dwRight=atoi(GetParamN(Params,buf, SIZEOF(buf),6,',',0));
- gl.dwBottom=atoi(GetParamN(Params,buf, SIZEOF(buf),7,',',0));
- gl.dwAlpha =atoi(GetParamN(Params,buf, SIZEOF(buf),8,',',0));
+ gl.Style = ST_IMAGE;
+ gl.szFileName = mir_strdup(GetParamN(Params,buf, SIZEOF(buf),2,',',0));
+ gl.dwLeft = atoi(GetParamN(Params,buf, SIZEOF(buf),4,',',0));
+ gl.dwTop = atoi(GetParamN(Params,buf, SIZEOF(buf),5,',',0));
+ gl.dwRight = atoi(GetParamN(Params,buf, SIZEOF(buf),6,',',0));
+ gl.dwBottom = atoi(GetParamN(Params,buf, SIZEOF(buf),7,',',0));
+ gl.dwAlpha = atoi(GetParamN(Params,buf, SIZEOF(buf),8,',',0));
GetParamN(Params,buf, SIZEOF(buf),3,',',0);
- if (mir_bool_strcmpi(buf,"TileBoth")) gl.FitMode=FM_TILE_BOTH;
- else if (mir_bool_strcmpi(buf,"TileVert")) gl.FitMode=FM_TILE_VERT;
- else if (mir_bool_strcmpi(buf,"TileHorz")) gl.FitMode=FM_TILE_HORZ;
- else gl.FitMode=0;
+ if (mir_bool_strcmpi(buf,"TileBoth")) gl.FitMode = FM_TILE_BOTH;
+ else if (mir_bool_strcmpi(buf,"TileVert")) gl.FitMode = FM_TILE_VERT;
+ else if (mir_bool_strcmpi(buf,"TileHorz")) gl.FitMode = FM_TILE_HORZ;
+ else gl.FitMode = 0;
}
else if (mir_bool_strcmpi(buf,"Fragment"))
{
//Image
- gl.Style=ST_FRAGMENT;
- gl.szFileName=mir_strdup(GetParamN(Params,buf, SIZEOF(buf),2,',',0));
-
- gl.clipArea.x=atoi(GetParamN(Params,buf, SIZEOF(buf),3,',',0));
- gl.clipArea.y=atoi(GetParamN(Params,buf, SIZEOF(buf),4,',',0));
- gl.szclipArea.cx=atoi(GetParamN(Params,buf, SIZEOF(buf),5,',',0));
- gl.szclipArea.cy=atoi(GetParamN(Params,buf, SIZEOF(buf),6,',',0));
-
- gl.dwLeft=atoi(GetParamN(Params,buf, SIZEOF(buf),8,',',0));
- gl.dwTop=atoi(GetParamN(Params,buf, SIZEOF(buf),9,',',0));
- gl.dwRight=atoi(GetParamN(Params,buf, SIZEOF(buf),10,',',0));
- gl.dwBottom=atoi(GetParamN(Params,buf, SIZEOF(buf),11,',',0));
- gl.dwAlpha =atoi(GetParamN(Params,buf, SIZEOF(buf),12,',',0));
+ gl.Style = ST_FRAGMENT;
+ gl.szFileName = mir_strdup(GetParamN(Params,buf, SIZEOF(buf),2,',',0));
+
+ gl.clipArea.x = atoi(GetParamN(Params,buf, SIZEOF(buf),3,',',0));
+ gl.clipArea.y = atoi(GetParamN(Params,buf, SIZEOF(buf),4,',',0));
+ gl.szclipArea.cx = atoi(GetParamN(Params,buf, SIZEOF(buf),5,',',0));
+ gl.szclipArea.cy = atoi(GetParamN(Params,buf, SIZEOF(buf),6,',',0));
+
+ gl.dwLeft = atoi(GetParamN(Params,buf, SIZEOF(buf),8,',',0));
+ gl.dwTop = atoi(GetParamN(Params,buf, SIZEOF(buf),9,',',0));
+ gl.dwRight = atoi(GetParamN(Params,buf, SIZEOF(buf),10,',',0));
+ gl.dwBottom = atoi(GetParamN(Params,buf, SIZEOF(buf),11,',',0));
+ gl.dwAlpha = atoi(GetParamN(Params,buf, SIZEOF(buf),12,',',0));
GetParamN(Params,buf, SIZEOF(buf),7,',',0);
- if (mir_bool_strcmpi(buf,"TileBoth")) gl.FitMode=FM_TILE_BOTH;
- else if (mir_bool_strcmpi(buf,"TileVert")) gl.FitMode=FM_TILE_VERT;
- else if (mir_bool_strcmpi(buf,"TileHorz")) gl.FitMode=FM_TILE_HORZ;
- else gl.FitMode=0;
+ if (mir_bool_strcmpi(buf,"TileBoth")) gl.FitMode = FM_TILE_BOTH;
+ else if (mir_bool_strcmpi(buf,"TileVert")) gl.FitMode = FM_TILE_VERT;
+ else if (mir_bool_strcmpi(buf,"TileHorz")) gl.FitMode = FM_TILE_HORZ;
+ else gl.FitMode = 0;
}
else
{
//None
- gl.Style=ST_SKIP;
+ gl.Style = ST_SKIP;
}
- obj.Data=≷
- res=ske_AddDescriptorToSkinObjectList(&obj,NULL);
+ obj.Data = ≷
+ res = ske_AddDescriptorToSkinObjectList(&obj,NULL);
mir_free_and_nill(obj.szObjectID);
if (gl.szFileName) mir_free_and_nill(gl.szFileName);
return res;
@@ -762,9 +762,9 @@ int SkinDrawGlyphMask(HDC hdc, RECT * rcSize, RECT * rcClip, MODERNMASK * Modern if (!ModernMask) return 0;
SKINDRAWREQUEST rq;
- rq.hDC=hdc;
- rq.rcDestRect=*rcSize;
- rq.rcClipRect=*rcClip;
+ rq.hDC = hdc;
+ rq.rcDestRect = *rcSize;
+ rq.rcClipRect = *rcClip;
strncpy(rq.szObjectID,"Masked draw",SIZEOF("Masked draw"));
return ske_Service_DrawGlyph((WPARAM)&rq,(LPARAM)ModernMask);
}
@@ -773,20 +773,20 @@ int SkinDrawGlyphMask(HDC hdc, RECT * rcSize, RECT * rcClip, MODERNMASK * Modern int __inline SkinDrawWindowBack(HWND hwndIn, HDC hdc, RECT * rcClip, char * objectID)
{
SKINDRAWREQUEST rq;
- POINT pt={0};
+ POINT pt = {0};
RECT rc,r1;
- HWND hwnd=(HWND)CallService(MS_CLUI_GETHWND,0,0);
+ HWND hwnd = (HWND)CallService(MS_CLUI_GETHWND,0,0);
if (!objectID) return 0;
GetWindowRect(hwndIn,&r1);
- pt.x=r1.left;
- pt.y=r1.top;
+ pt.x = r1.left;
+ pt.y = r1.top;
//ClientToScreen(hwndIn,&pt);
GetWindowRect(hwnd,&rc);
OffsetRect(&rc,-pt.x ,-pt.y);
- rq.hDC=hdc;
- rq.rcDestRect=rc;
- rq.rcClipRect=*rcClip;
+ rq.hDC = hdc;
+ rq.rcDestRect = rc;
+ rq.rcClipRect = *rcClip;
strncpy(rq.szObjectID,objectID,SIZEOF(rq.szObjectID));
///ske_Service_DrawGlyph((WPARAM)&rq,0); //$$$
return CallService(MS_SKIN_DRAWGLYPH,(WPARAM)&rq,0);
diff --git a/plugins/Clist_modern/modern_statusbar.cpp b/plugins/Clist_modern/modern_statusbar.cpp index 487c5d6239..cf46a61696 100644 --- a/plugins/Clist_modern/modern_statusbar.cpp +++ b/plugins/Clist_modern/modern_statusbar.cpp @@ -11,8 +11,8 @@ POINT lastpnt; #define TM_STATUSBAR 23435234
#define TM_STATUSBARHIDE 23435235
-HWND hModernStatusBar=NULL;
-HANDLE hFramehModernStatusBar=NULL;
+HWND hModernStatusBar = NULL;
+HANDLE hFramehModernStatusBar = NULL;
extern void ApplyViewMode(const char *Name, bool onlySelector = false );
extern void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat);
@@ -54,9 +54,9 @@ typedef struct _ProtoItemData } ProtoItemData;
-ProtoItemData *ProtosData=NULL;
-int allocedItemData=0;
-STATUSBARDATA g_StatusBarData={0};
+ProtoItemData *ProtosData = NULL;
+int allocedItemData = 0;
+STATUSBARDATA g_StatusBarData = {0};
char * ApendSubSetting(char * buf, int size, char *first, char *second)
@@ -67,37 +67,37 @@ char * ApendSubSetting(char * buf, int size, char *first, char *second) int LoadStatusBarData()
{
- g_StatusBarData.perProtoConfig=db_get_b(NULL,"CLUI","SBarPerProto",SETTING_SBARPERPROTO_DEFAULT);
- g_StatusBarData.showProtoIcon=db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&1;
- g_StatusBarData.showProtoName=db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&2;
- g_StatusBarData.showStatusName=db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&4;
- g_StatusBarData.xStatusMode=(BYTE)(db_get_b(NULL,"CLUI","ShowXStatus",SETTING_SHOWXSTATUS_DEFAULT));
- g_StatusBarData.connectingIcon=db_get_b(NULL,"CLUI","UseConnectingIcon",SETTING_USECONNECTINGICON_DEFAULT);
- g_StatusBarData.showProtoEmails=db_get_b(NULL,"CLUI","ShowUnreadEmails",SETTING_SHOWUNREADEMAILS_DEFAULT);
- g_StatusBarData.SBarRightClk=db_get_b(NULL,"CLUI","SBarRightClk",SETTING_SBARRIGHTCLK_DEFAULT);
-
- g_StatusBarData.nProtosPerLine=db_get_b(NULL,"CLUI","StatusBarProtosPerLine",SETTING_PROTOSPERLINE_DEFAULT);
- g_StatusBarData.Align=db_get_b(NULL,"CLUI","Align",SETTING_ALIGN_DEFAULT);
- g_StatusBarData.VAlign=db_get_b(NULL,"CLUI","VAlign",SETTING_VALIGN_DEFAULT);
- g_StatusBarData.sameWidth=db_get_b(NULL,"CLUI","EqualSections",SETTING_EQUALSECTIONS_DEFAULT);
- g_StatusBarData.rectBorders.left=db_get_dw(NULL,"CLUI","LeftOffset",SETTING_LEFTOFFSET_DEFAULT);
- g_StatusBarData.rectBorders.right=db_get_dw(NULL,"CLUI","RightOffset",SETTING_RIGHTOFFSET_DEFAULT);
- g_StatusBarData.rectBorders.top=db_get_dw(NULL,"CLUI","TopOffset",SETTING_TOPOFFSET_DEFAULT);
- g_StatusBarData.rectBorders.bottom=db_get_dw(NULL,"CLUI","BottomOffset",SETTING_BOTTOMOFFSET_DEFAULT);
- g_StatusBarData.extraspace=(BYTE)db_get_dw(NULL,"CLUI","SpaceBetween",SETTING_SPACEBETWEEN_DEFAULT);
+ g_StatusBarData.perProtoConfig = db_get_b(NULL,"CLUI","SBarPerProto",SETTING_SBARPERPROTO_DEFAULT);
+ g_StatusBarData.showProtoIcon = db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&1;
+ g_StatusBarData.showProtoName = db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&2;
+ g_StatusBarData.showStatusName = db_get_b(NULL,"CLUI","SBarShow",SETTING_SBARSHOW_DEFAULT)&4;
+ g_StatusBarData.xStatusMode = (BYTE)(db_get_b(NULL,"CLUI","ShowXStatus",SETTING_SHOWXSTATUS_DEFAULT));
+ g_StatusBarData.connectingIcon = db_get_b(NULL,"CLUI","UseConnectingIcon",SETTING_USECONNECTINGICON_DEFAULT);
+ g_StatusBarData.showProtoEmails = db_get_b(NULL,"CLUI","ShowUnreadEmails",SETTING_SHOWUNREADEMAILS_DEFAULT);
+ g_StatusBarData.SBarRightClk = db_get_b(NULL,"CLUI","SBarRightClk",SETTING_SBARRIGHTCLK_DEFAULT);
+
+ g_StatusBarData.nProtosPerLine = db_get_b(NULL,"CLUI","StatusBarProtosPerLine",SETTING_PROTOSPERLINE_DEFAULT);
+ g_StatusBarData.Align = db_get_b(NULL,"CLUI","Align",SETTING_ALIGN_DEFAULT);
+ g_StatusBarData.VAlign = db_get_b(NULL,"CLUI","VAlign",SETTING_VALIGN_DEFAULT);
+ g_StatusBarData.sameWidth = db_get_b(NULL,"CLUI","EqualSections",SETTING_EQUALSECTIONS_DEFAULT);
+ g_StatusBarData.rectBorders.left = db_get_dw(NULL,"CLUI","LeftOffset",SETTING_LEFTOFFSET_DEFAULT);
+ g_StatusBarData.rectBorders.right = db_get_dw(NULL,"CLUI","RightOffset",SETTING_RIGHTOFFSET_DEFAULT);
+ g_StatusBarData.rectBorders.top = db_get_dw(NULL,"CLUI","TopOffset",SETTING_TOPOFFSET_DEFAULT);
+ g_StatusBarData.rectBorders.bottom = db_get_dw(NULL,"CLUI","BottomOffset",SETTING_BOTTOMOFFSET_DEFAULT);
+ g_StatusBarData.extraspace = (BYTE)db_get_dw(NULL,"CLUI","SpaceBetween",SETTING_SPACEBETWEEN_DEFAULT);
if (g_StatusBarData.BarFont) DeleteObject(g_StatusBarData.BarFont);
- g_StatusBarData.BarFont=NULL;//LoadFontFromDB("ModernData","StatusBar",&g_StatusBarData.fontColor);
+ g_StatusBarData.BarFont = NULL;//LoadFontFromDB("ModernData","StatusBar",&g_StatusBarData.fontColor);
{
- int vis=db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT);
+ int vis = db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT);
int frameopt;
- int frameID=Sync( FindFrameID, hModernStatusBar );
- frameopt=CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,frameID),0);
- frameopt=frameopt & (~F_VISIBLE);
- if(vis)
+ int frameID = Sync( FindFrameID, hModernStatusBar );
+ frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,frameID),0);
+ frameopt = frameopt & (~F_VISIBLE);
+ if (vis)
{
ShowWindow(hModernStatusBar,SW_SHOW);
- frameopt|=F_VISIBLE;
+ frameopt |= F_VISIBLE;
}
else
{
@@ -105,24 +105,24 @@ int LoadStatusBarData() };
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,frameID),frameopt);
}
- g_StatusBarData.TextEffectID=db_get_b(NULL,"StatusBar","TextEffectID",SETTING_TEXTEFFECTID_DEFAULT);
- g_StatusBarData.TextEffectColor1=db_get_dw(NULL,"StatusBar","TextEffectColor1",SETTING_TEXTEFFECTCOLOR1_DEFAULT);
- g_StatusBarData.TextEffectColor2=db_get_dw(NULL,"StatusBar","TextEffectColor2",SETTING_TEXTEFFECTCOLOR2_DEFAULT);
+ g_StatusBarData.TextEffectID = db_get_b(NULL,"StatusBar","TextEffectID",SETTING_TEXTEFFECTID_DEFAULT);
+ g_StatusBarData.TextEffectColor1 = db_get_dw(NULL,"StatusBar","TextEffectColor1",SETTING_TEXTEFFECTCOLOR1_DEFAULT);
+ g_StatusBarData.TextEffectColor2 = db_get_dw(NULL,"StatusBar","TextEffectColor2",SETTING_TEXTEFFECTCOLOR2_DEFAULT);
- if(g_StatusBarData.hBmpBackground) {DeleteObject(g_StatusBarData.hBmpBackground); g_StatusBarData.hBmpBackground=NULL;}
+ if (g_StatusBarData.hBmpBackground) {DeleteObject(g_StatusBarData.hBmpBackground); g_StatusBarData.hBmpBackground = NULL;}
if (g_CluiData.fDisableSkinEngine)
{
DBVARIANT dbv;
- g_StatusBarData.bkColour=sttGetColor("StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
- if(db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
+ g_StatusBarData.bkColour = sttGetColor("StatusBar","BkColour",CLCDEFAULT_BKCOLOUR);
+ if (db_get_b(NULL,"StatusBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
if (!DBGetContactSettingString(NULL,"StatusBar","BkBitmap",&dbv)) {
- g_StatusBarData.hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
+ g_StatusBarData.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
}
- g_StatusBarData.bkUseWinColors=db_get_b(NULL,"StatusBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
- g_StatusBarData.backgroundBmpUse=db_get_w(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
+ g_StatusBarData.bkUseWinColors = db_get_b(NULL,"StatusBar", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
+ g_StatusBarData.backgroundBmpUse = db_get_w(NULL,"StatusBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
}
SendMessage(pcli->hwndContactList,WM_SIZE,0,0);
@@ -144,8 +144,8 @@ int NewStatusPaintCallbackProc(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgn, DWO int ModernDrawStatusBar(HWND hwnd, HDC hDC)
{
- if (hwnd==(HWND)-1) return 0;
- if (GetParent(hwnd)==pcli->hwndContactList)
+ if (hwnd == (HWND)-1) return 0;
+ if (GetParent(hwnd) == pcli->hwndContactList)
return ModernDrawStatusBarWorker(hwnd,hDC);
else
CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
@@ -155,15 +155,15 @@ int ModernDrawStatusBar(HWND hwnd, HDC hDC) int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
{
int line;
- int iconHeight=GetSystemMetrics(SM_CYSMICON)+2;
- int protosperline=0;
- int visProtoCount=0;
+ int iconHeight = GetSystemMetrics(SM_CYSMICON)+2;
+ int protosperline = 0;
+ int visProtoCount = 0;
int protoCount;
- int SumWidth=0;
- int rectwidth=0;
- int aligndx=0;
- int * ProtoWidth=NULL;
- int i,j,po=0;
+ int SumWidth = 0;
+ int rectwidth = 0;
+ int aligndx = 0;
+ int * ProtoWidth = NULL;
+ int i,j,po = 0;
char servName[40];
char protoNameExt[40];
@@ -173,9 +173,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) HFONT hOldFont;
int iconY, textY;
int spaceWidth;
- int maxwidth=0;
- int xstatus=0;
- SIZE textSize={0};
+ int maxwidth = 0;
+ int xstatus = 0;
+ SIZE textSize = {0};
GetClientRect(hWnd,&rc);
if (g_CluiData.fDisableSkinEngine)
{
@@ -188,20 +188,20 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) }
else
{
- SkinDrawGlyph(hDC,&rc,&rc,"Main,ID=StatusBar"); //TBD
+ SkinDrawGlyph(hDC,&rc,&rc,"Main,ID = StatusBar"); //TBD
}
- g_StatusBarData.nProtosPerLine=db_get_b(NULL,"CLUI","StatusBarProtosPerLine",SETTING_PROTOSPERLINE_DEFAULT);
- hOldFont=g_clcPainter.ChangeToFont(hDC,NULL,FONTID_STATUSBAR_PROTONAME,NULL);
+ g_StatusBarData.nProtosPerLine = db_get_b(NULL,"CLUI","StatusBarProtosPerLine",SETTING_PROTOSPERLINE_DEFAULT);
+ hOldFont = g_clcPainter.ChangeToFont(hDC,NULL,FONTID_STATUSBAR_PROTONAME,NULL);
- // hOldFont=SelectObject(hDC,g_StatusBarData.BarFont);
+ // hOldFont = SelectObject(hDC,g_StatusBarData.BarFont);
// SetTextColor(hDC,g_StatusBarData.fontColor);
{
GetTextExtentPoint32A(hDC," ",1,&textSize);
- spaceWidth=textSize.cx;
- textY=rc.top+((rc.bottom-rc.top-textSize.cy)>>1);
+ spaceWidth = textSize.cx;
+ textY = rc.top+((rc.bottom-rc.top-textSize.cy)>>1);
}
- iconY=rc.top+((rc.bottom-rc.top-GetSystemMetrics(SM_CXSMICON))>>1);
+ iconY = rc.top+((rc.bottom-rc.top-GetSystemMetrics(SM_CXSMICON))>>1);
{
ProtoEnumAccounts( &protoCount, &accs );
@@ -209,34 +209,34 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) {
int k;
- for (k=0; k<allocedItemData; k++)
+ for (k = 0; k < allocedItemData; k++)
{
- if(ProtosData[k].ProtoXStatus) mir_free_and_nill (ProtosData[k].ProtoXStatus);
- if(ProtosData[k].ProtoName) mir_free_and_nill (ProtosData[k].ProtoName);
- if(ProtosData[k].AccountName) mir_free_and_nill (ProtosData[k].AccountName);
- if(ProtosData[k].ProtoHumanName) mir_free_and_nill (ProtosData[k].ProtoHumanName);
- if(ProtosData[k].ProtoEMailCount) mir_free_and_nill (ProtosData[k].ProtoEMailCount);
- if(ProtosData[k].ProtoStatusText) mir_free_and_nill (ProtosData[k].ProtoStatusText);
+ if (ProtosData[k].ProtoXStatus) mir_free_and_nill (ProtosData[k].ProtoXStatus);
+ if (ProtosData[k].ProtoName) mir_free_and_nill (ProtosData[k].ProtoName);
+ if (ProtosData[k].AccountName) mir_free_and_nill (ProtosData[k].AccountName);
+ if (ProtosData[k].ProtoHumanName) mir_free_and_nill (ProtosData[k].ProtoHumanName);
+ if (ProtosData[k].ProtoEMailCount) mir_free_and_nill (ProtosData[k].ProtoEMailCount);
+ if (ProtosData[k].ProtoStatusText) mir_free_and_nill (ProtosData[k].ProtoStatusText);
}
mir_free_and_nill(ProtosData);
- ProtosData=NULL;
- allocedItemData=0;
+ ProtosData = NULL;
+ allocedItemData = 0;
}
if ( protoCount == 0 )
return 0;
- ProtosData=(ProtoItemData*)mir_alloc(sizeof(ProtoItemData)*protoCount);
+ ProtosData = (ProtoItemData*)mir_alloc(sizeof(ProtoItemData)*protoCount);
memset(ProtosData,0,sizeof(ProtoItemData)*protoCount);
- for (j=0; j<protoCount; j++)
+ for (j = 0; j < protoCount; j++)
{
int vis;
char buf[256];
- i=pcli->pfnGetAccountIndexByPos(j);
- if (i==-1)
- vis=FALSE;
+ i = pcli->pfnGetAccountIndexByPos(j);
+ if (i == -1)
+ vis = FALSE;
else
- vis=pcli->pfnGetProtocolVisibility(accs[i]->szModuleName);
+ vis = pcli->pfnGetProtocolVisibility(accs[i]->szModuleName);
if (!vis) continue;
mir_snprintf(buf, SIZEOF(buf), "SBarAccountIsCustom_%s", accs[i]->szModuleName);
@@ -302,12 +302,12 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) ProtosData[visProtoCount].ProtoHumanName = mir_tstrdup(accs[i]->tszAccountName);
ProtosData[visProtoCount].AccountName = mir_strdup(accs[i]->szModuleName);
- ProtosData[visProtoCount].ProtoName = mir_strdup(accs[i]->szProtoName);
+ ProtosData[visProtoCount].ProtoName = mir_strdup(accs[i]->szProtoName);
ProtosData[visProtoCount].ProtoStatusText = mir_strdup((char*)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION,(WPARAM)ProtosData[visProtoCount].ProtoStatus,0));
ProtosData[visProtoCount].ProtoPos = visProtoCount;
ProtosData[visProtoCount].isDimmed = 0;
- if(g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS)
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_PROTOS)
{
char szTemp[2048];
mir_snprintf(szTemp, SIZEOF(szTemp), "%s|", ProtosData[visProtoCount].AccountName );
@@ -322,114 +322,114 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) //START MULTILINE HERE
{
- int orig_protoCount=protoCount;
- int orig_visProtoCount=visProtoCount;
- ProtoItemData * orig_ProtosData=ProtosData;
+ int orig_protoCount = protoCount;
+ int orig_visProtoCount = visProtoCount;
+ ProtoItemData * orig_ProtosData = ProtosData;
int linecount;
if (g_StatusBarData.nProtosPerLine)
- protosperline=g_StatusBarData.nProtosPerLine;
+ protosperline = g_StatusBarData.nProtosPerLine;
else if (orig_visProtoCount)
- protosperline=orig_visProtoCount;
+ protosperline = orig_visProtoCount;
else if (protoCount)
{
- protosperline=protoCount;
- orig_visProtoCount=protoCount;
+ protosperline = protoCount;
+ orig_visProtoCount = protoCount;
}
else
{
- protosperline=1;
- orig_visProtoCount=1;
+ protosperline = 1;
+ orig_visProtoCount = 1;
}
- protosperline=min(protosperline,orig_visProtoCount);
- linecount=protosperline ? (orig_visProtoCount+(protosperline-1))/protosperline : 1; //divide with rounding to up
- for (line=0; line<linecount; line++)
+ protosperline = min(protosperline,orig_visProtoCount);
+ linecount = protosperline ? (orig_visProtoCount+(protosperline-1))/protosperline : 1; //divide with rounding to up
+ for (line = 0; line < linecount; line++)
{
int height;
int rowsdy;
- int rowheight=max(textSize.cy+2,iconHeight);
- protoCount=min(protosperline,(orig_protoCount-line*protosperline));
- visProtoCount=min(protosperline,(orig_visProtoCount-line*protosperline));
- ProtosData+=line*protosperline;
+ int rowheight = max(textSize.cy+2,iconHeight);
+ protoCount = min(protosperline,(orig_protoCount-line*protosperline));
+ visProtoCount = min(protosperline,(orig_visProtoCount-line*protosperline));
+ ProtosData += line*protosperline;
GetClientRect(hWnd,&rc);
- rc.top += g_StatusBarData.rectBorders.top;
- rc.bottom -= g_StatusBarData.rectBorders.bottom;
+ rc.top += g_StatusBarData.rectBorders.top;
+ rc.bottom -= g_StatusBarData.rectBorders.bottom;
- aligndx=0;
- maxwidth=0;
- xstatus=0;
- SumWidth=0;
- height=(rowheight*linecount);
+ aligndx = 0;
+ maxwidth = 0;
+ xstatus = 0;
+ SumWidth = 0;
+ height = (rowheight*linecount);
if (height > (rc.bottom - rc.top))
{
rowheight = (rc.bottom - rc.top) / linecount;
- height=(rowheight*linecount);
+ height = (rowheight*linecount);
}
- rowsdy=((rc.bottom-rc.top)-height)/2;
- if (rowheight*(line)+rowsdy<rc.top-rowheight) continue;
+ rowsdy = ((rc.bottom-rc.top)-height)/2;
+ if (rowheight*(line)+rowsdy < rc.top-rowheight) continue;
if (rowheight*(line+1)+rowsdy>rc.bottom+rowheight)
{
- ProtosData=orig_ProtosData;
+ ProtosData = orig_ProtosData;
break;
}
if (g_StatusBarData.VAlign == 0) //top
{
- rc.bottom=rc.top+rowheight*(line+1);
- rc.top=rc.top+rowheight*line+1;
+ rc.bottom = rc.top+rowheight*(line+1);
+ rc.top = rc.top+rowheight*line+1;
}
else if (g_StatusBarData.VAlign == 1) //center
{
- rc.bottom=rc.top+rowsdy+rowheight*(line+1);
- rc.top=rc.top+rowsdy+rowheight*line+1;
+ rc.bottom = rc.top+rowsdy+rowheight*(line+1);
+ rc.top = rc.top+rowsdy+rowheight*line+1;
}
else if (g_StatusBarData.VAlign == 2) //bottom
{
- rc.top=rc.bottom - (rowheight*(linecount - line));
- rc.bottom=rc.bottom - (rowheight*(linecount - line - 1)+1);
+ rc.top = rc.bottom - (rowheight*(linecount - line));
+ rc.bottom = rc.bottom - (rowheight*(linecount - line - 1)+1);
}
- textY=rc.top+(((rc.bottom-rc.top)-textSize.cy)/2);
- iconY=rc.top+(((rc.bottom-rc.top)-iconHeight)/2);
+ textY = rc.top+(((rc.bottom-rc.top)-textSize.cy)/2);
+ iconY = rc.top+(((rc.bottom-rc.top)-iconHeight)/2);
{ //Code for each line
{
DWORD sw;
- rectwidth=rc.right-rc.left-g_StatusBarData.rectBorders.left-g_StatusBarData.rectBorders.right;
- if (visProtoCount>1) sw=(rectwidth-(g_StatusBarData.extraspace*(visProtoCount-1)))/visProtoCount;
- else sw=rectwidth;
+ rectwidth = rc.right-rc.left-g_StatusBarData.rectBorders.left-g_StatusBarData.rectBorders.right;
+ if (visProtoCount>1) sw = (rectwidth-(g_StatusBarData.extraspace*(visProtoCount-1)))/visProtoCount;
+ else sw = rectwidth;
if (ProtoWidth) mir_free_and_nill(ProtoWidth);
- ProtoWidth=(int*)mir_alloc(sizeof(int)*visProtoCount);
- for (i=0; i<visProtoCount; i++)
+ ProtoWidth = (int*)mir_alloc(sizeof(int)*visProtoCount);
+ for (i = 0; i < visProtoCount; i++)
{
SIZE textSize;
DWORD w = 0;
// FIXME strange error occurs here due to Dimon log
w = ProtosData[i].PaddingLeft;
- w += ProtosData[i].PaddingRight;
+ w += ProtosData[i].PaddingRight;
if ( ProtosData[i].showProtoIcon )
{
- w += GetSystemMetrics(SM_CXSMICON)+1;
+ w += GetSystemMetrics(SM_CXSMICON)+1;
- ProtosData[i].extraIcon=NULL;
+ ProtosData[i].extraIcon = NULL;
if ((ProtosData[i].xStatusMode&8) && ProtosData[i].ProtoStatus>ID_STATUS_OFFLINE)
{
char str[MAXMODULELABELLENGTH];
mir_snprintf(str, SIZEOF(str), "%s/GetXStatus", ProtosData[i].AccountName);
if (ServiceExists(str))
{
- char * dbTitle="XStatusName";
- char * dbTitle2=NULL;
- xstatus=CallProtoService(ProtosData[i].AccountName,"/GetXStatus",(WPARAM)&dbTitle,(LPARAM)&dbTitle2);
+ char * dbTitle = "XStatusName";
+ char * dbTitle2 = NULL;
+ xstatus = CallProtoService(ProtosData[i].AccountName,"/GetXStatus",(WPARAM)&dbTitle,(LPARAM)&dbTitle2);
if (dbTitle && xstatus)
{
- DBVARIANT dbv={0};
+ DBVARIANT dbv = {0};
if (!DBGetContactSettingTString(NULL,ProtosData[i].AccountName,dbTitle,&dbv))
{
- ProtosData[i].ProtoXStatus=mir_tstrdup(dbv.ptszVal);
+ ProtosData[i].ProtoXStatus = mir_tstrdup(dbv.ptszVal);
//mir_free_and_nill(dbv.ptszVal);
db_free(&dbv);
}
@@ -443,9 +443,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) char str[MAXMODULELABELLENGTH];
mir_snprintf(str, SIZEOF(str), "%s/GetXStatusIcon", ProtosData[i].AccountName);
if (ServiceExists(str))
- ProtosData[i].extraIcon=(HICON)CallService(str,0,0);
- if (ProtosData[i].extraIcon && (ProtosData[i].xStatusMode&3)==3)
- w+=GetSystemMetrics(SM_CXSMICON)+1;
+ ProtosData[i].extraIcon = (HICON)CallService(str,0,0);
+ if (ProtosData[i].extraIcon && (ProtosData[i].xStatusMode&3) == 3)
+ w += GetSystemMetrics(SM_CXSMICON)+1;
}
}
@@ -454,93 +454,93 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if (ProtosData[i].showProtoName)
{
GetTextExtentPoint32(hDC,ProtosData[i].ProtoHumanName,lstrlen(ProtosData[i].ProtoHumanName),&textSize);
- w += textSize.cx + 3 + spaceWidth;
+ w += textSize.cx + 3 + spaceWidth;
}
if (ProtosData[i].showProtoEmails && ProtosData[i].ProtoEMailCount )
{
GetTextExtentPoint32A(hDC,ProtosData[i].ProtoEMailCount,lstrlenA(ProtosData[i].ProtoEMailCount),&textSize);
- w+=textSize.cx+3+spaceWidth;
+ w += textSize.cx+3+spaceWidth;
}
if (ProtosData[i].showStatusName)
{
GetTextExtentPoint32A(hDC,ProtosData[i].ProtoStatusText,lstrlenA(ProtosData[i].ProtoStatusText),&textSize);
- w += textSize.cx + 3 + spaceWidth;
+ w += textSize.cx + 3 + spaceWidth;
}
if ((ProtosData[i].xStatusMode&8) && ProtosData[i].ProtoXStatus)
{
GetTextExtentPoint32(hDC,ProtosData[i].ProtoXStatus,lstrlen(ProtosData[i].ProtoXStatus),&textSize);
- w += textSize.cx + 3 + spaceWidth;
+ w += textSize.cx + 3 + spaceWidth;
}
if ( ( ProtosData[i].showProtoName) ||
(ProtosData[i].showProtoEmails && ProtosData[i].ProtoEMailCount ) ||
(ProtosData[i].showStatusName) ||
((ProtosData[i].xStatusMode&8) && ProtosData[i].ProtoXStatus))
- w -= spaceWidth;
+ w -= spaceWidth;
- ProtosData[i].fullWidth=w;
+ ProtosData[i].fullWidth = w;
if (g_StatusBarData.sameWidth)
{
- ProtoWidth[i]=sw;
- SumWidth+=w;
+ ProtoWidth[i] = sw;
+ SumWidth += w;
}
else
{
- ProtoWidth[i]=w;
- SumWidth+=w;
+ ProtoWidth[i] = w;
+ SumWidth += w;
}
}
// Reposition rects
- for(i=0; i<visProtoCount; i++)
- if (ProtoWidth[i]>maxwidth) maxwidth=ProtoWidth[i];
+ for(i = 0; i < visProtoCount; i++)
+ if (ProtoWidth[i]>maxwidth) maxwidth = ProtoWidth[i];
if (g_StatusBarData.sameWidth)
{
- for (i=0; i<visProtoCount; i++)
- ProtoWidth[i]=maxwidth;
- SumWidth=maxwidth*visProtoCount;
+ for (i = 0; i < visProtoCount; i++)
+ ProtoWidth[i] = maxwidth;
+ SumWidth = maxwidth*visProtoCount;
}
- SumWidth+=(visProtoCount-1)*(g_StatusBarData.extraspace+1);
+ SumWidth += (visProtoCount-1)*(g_StatusBarData.extraspace+1);
if (SumWidth>rectwidth)
{
- float f=(float)rectwidth/SumWidth;
- //dx=(int)(0.5+(float)dx/visProtoCount);
- //SumWidth-=dx*visProtoCount;
- SumWidth=0;
- for (i=0; i<visProtoCount; i++)
+ float f = (float)rectwidth/SumWidth;
+ //dx = (int)(0.5+(float)dx/visProtoCount);
+ //SumWidth -= dx*visProtoCount;
+ SumWidth = 0;
+ for (i = 0; i < visProtoCount; i++)
{
- ProtoWidth[i]=(int)((float)ProtoWidth[i]*f);
- SumWidth+=ProtoWidth[i];
+ ProtoWidth[i] = (int)((float)ProtoWidth[i]*f);
+ SumWidth += ProtoWidth[i];
}
- SumWidth+=(visProtoCount-1)*(g_StatusBarData.extraspace+1);
+ SumWidth += (visProtoCount-1)*(g_StatusBarData.extraspace+1);
}
}
- if (g_StatusBarData.Align==1) //center
- aligndx=(rectwidth-SumWidth)>>1;
- else if (g_StatusBarData.Align==2) //right
- aligndx=(rectwidth-SumWidth);
+ if (g_StatusBarData.Align == 1) //center
+ aligndx = (rectwidth-SumWidth)>>1;
+ else if (g_StatusBarData.Align == 2) //right
+ aligndx = (rectwidth-SumWidth);
// Draw in rects
//ske_SelectTextEffect(hDC,g_StatusBarData.TextEffectID,g_StatusBarData.TextEffectColor1,g_StatusBarData.TextEffectColor2);
{
- RECT r=rc;
-// r.top+=g_StatusBarData.rectBorders.top;
-// r.bottom-=g_StatusBarData.rectBorders.bottom;
- r.left+=g_StatusBarData.rectBorders.left+aligndx;
- for (i=0; i< visProtoCount; i++)
+ RECT r = rc;
+// r.top += g_StatusBarData.rectBorders.top;
+// r.bottom -= g_StatusBarData.rectBorders.bottom;
+ r.left += g_StatusBarData.rectBorders.left+aligndx;
+ for (i = 0; i < visProtoCount; i++)
{
HRGN rgn;
int x = r.left;
- HICON hIcon=NULL;
- HICON hxIcon=NULL;
- BOOL NeedDestroy=FALSE;
+ HICON hIcon = NULL;
+ HICON hxIcon = NULL;
+ BOOL NeedDestroy = FALSE;
x = r.left;
- x += ProtosData[i].PaddingLeft;
- r.right=r.left+ProtoWidth[i];
+ x += ProtosData[i].PaddingLeft;
+ r.right = r.left+ProtoWidth[i];
if ( ProtosData[i].showProtoIcon )
{
@@ -550,75 +550,75 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) mir_snprintf(str, SIZEOF(str), "%s/GetXStatusIcon", ProtosData[i].AccountName);
if (ServiceExists(str))
{
- hxIcon=ProtosData[i].extraIcon;
+ hxIcon = ProtosData[i].extraIcon;
if (hxIcon)
{
- if (((ProtosData[i].xStatusMode)&3)==2)
+ if (((ProtosData[i].xStatusMode)&3) == 2)
{
- hIcon=GetMainStatusOverlay(ProtosData[i].ProtoStatus);
- NeedDestroy=TRUE;
+ hIcon = GetMainStatusOverlay(ProtosData[i].ProtoStatus);
+ NeedDestroy = TRUE;
}
- else if (((ProtosData[i].xStatusMode)&3)==1)
+ else if (((ProtosData[i].xStatusMode)&3) == 1)
{
- hIcon=hxIcon;
- NeedDestroy=TRUE;
- hxIcon=NULL;
+ hIcon = hxIcon;
+ NeedDestroy = TRUE;
+ hxIcon = NULL;
}
}
}
}
- if (hIcon==NULL && (hxIcon==NULL || (((ProtosData[i].xStatusMode)&3)==3)))
+ if (hIcon == NULL && (hxIcon == NULL || (((ProtosData[i].xStatusMode)&3) == 3)))
{
- if (hIcon==NULL && (ProtosData[i].connectingIcon==1) && ProtosData[i].ProtoStatus>=ID_STATUS_CONNECTING&&ProtosData[i].ProtoStatus<=ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
+ if (hIcon == NULL && (ProtosData[i].connectingIcon == 1) && ProtosData[i].ProtoStatus >= ID_STATUS_CONNECTING&&ProtosData[i].ProtoStatus <= ID_STATUS_CONNECTING+MAX_CONNECT_RETRIES)
{
- hIcon=(HICON)CLUI_GetConnectingIconService((WPARAM)ProtosData[i].AccountName,0);
- if (hIcon) NeedDestroy=TRUE;
- else hIcon=LoadSkinnedProtoIcon(ProtosData[i].AccountName,ProtosData[i].ProtoStatus);
+ hIcon = (HICON)CLUI_GetConnectingIconService((WPARAM)ProtosData[i].AccountName,0);
+ if (hIcon) NeedDestroy = TRUE;
+ else hIcon = LoadSkinnedProtoIcon(ProtosData[i].AccountName,ProtosData[i].ProtoStatus);
}
- else hIcon=LoadSkinnedProtoIcon(ProtosData[i].AccountName,ProtosData[i].ProtoStatus);
+ else hIcon = LoadSkinnedProtoIcon(ProtosData[i].AccountName,ProtosData[i].ProtoStatus);
}
- rgn=CreateRectRgn(r.left,r.top,r.right,r.bottom);
+ rgn = CreateRectRgn(r.left,r.top,r.right,r.bottom);
//
{
if (g_StatusBarData.sameWidth)
{
- int fw=ProtosData[i].fullWidth;
- int rw=r.right-r.left;
- if (g_StatusBarData.Align==1)
+ int fw = ProtosData[i].fullWidth;
+ int rw = r.right-r.left;
+ if (g_StatusBarData.Align == 1)
{
- x=r.left+((rw-fw)/2);
+ x = r.left+((rw-fw)/2);
}
- else if (g_StatusBarData.Align==2)
+ else if (g_StatusBarData.Align == 2)
{
- x=r.left+((rw-fw));
+ x = r.left+((rw-fw));
}
- else x=r.left;
+ else x = r.left;
}
}
SelectClipRgn(hDC,rgn);
- ProtosData[i].DoubleIcons=FALSE;
+ ProtosData[i].DoubleIcons = FALSE;
- DWORD dim = ProtosData[i].isDimmed ? ( ( 64<<24 ) | 0x80 ) : 0;
+ DWORD dim = ProtosData[i].isDimmed ? ( ( 64 << 24 ) | 0x80 ) : 0;
- if ((ProtosData[i].xStatusMode&3)==3)
+ if ((ProtosData[i].xStatusMode&3) == 3)
{
if (hIcon) mod_DrawIconEx_helper(hDC,x,iconY,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL, DI_NORMAL|dim );
if (hxIcon)
{
mod_DrawIconEx_helper(hDC,x+GetSystemMetrics(SM_CXSMICON)+1,iconY,hxIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL|dim);
- x+=GetSystemMetrics(SM_CXSMICON)+1;
+ x += GetSystemMetrics(SM_CXSMICON)+1;
}
- ProtosData[i].DoubleIcons=hIcon&&hxIcon;
+ ProtosData[i].DoubleIcons = hIcon&&hxIcon;
}
else
{
if (hxIcon) mod_DrawIconEx_helper(hDC,x,iconY,hxIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL|dim);
- if (hIcon) mod_DrawIconEx_helper(hDC,x,iconY,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL| ((hxIcon&&(ProtosData[i].xStatusMode&4))?(192<<24):0 ) | dim );
+ if (hIcon) mod_DrawIconEx_helper(hDC,x,iconY,hIcon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL| ((hxIcon&&(ProtosData[i].xStatusMode&4))?(192 << 24):0 ) | dim );
}
if ( ( hxIcon || hIcon) && TRUE /* TODO g_StatusBarData.bDrawLockOverlay options to draw locked proto*/ )
@@ -626,7 +626,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if ( db_get_b( NULL,ProtosData[i].AccountName,"LockMainStatus",0 ))
{
HICON hLockOverlay = LoadSkinnedIcon(SKINICON_OTHER_STATUS_LOCKED);
- if (hLockOverlay != NULL)
+ if (hLockOverlay !=NULL)
{
mod_DrawIconEx_helper(hDC, x, iconY, hLockOverlay, GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL | dim);
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hLockOverlay, 0); }
@@ -635,65 +635,65 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if (hxIcon) DestroyIcon_protect(hxIcon);
if (NeedDestroy) DestroyIcon_protect(hIcon);
else CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- x+=GetSystemMetrics(SM_CXSMICON)+1;
+ x += GetSystemMetrics(SM_CXSMICON)+1;
}
if (ProtosData[i].showProtoName)
{
SIZE textSize;
- RECT rt=r;
- rt.left=x+(spaceWidth>>1);
- rt.top=textY;
+ RECT rt = r;
+ rt.left = x+(spaceWidth>>1);
+ rt.top = textY;
ske_DrawText(hDC,ProtosData[i].ProtoHumanName,lstrlen(ProtosData[i].ProtoHumanName),&rt,0);
- if ((ProtosData[i].showProtoEmails && ProtosData[i].ProtoEMailCount!=NULL) || ProtosData[i].showStatusName || ((ProtosData[i].xStatusMode&8) && ProtosData[i].ProtoXStatus))
+ if ((ProtosData[i].showProtoEmails && ProtosData[i].ProtoEMailCount != NULL) || ProtosData[i].showStatusName || ((ProtosData[i].xStatusMode&8) && ProtosData[i].ProtoXStatus))
{
GetTextExtentPoint32(hDC, ProtosData[i].ProtoHumanName, lstrlen(ProtosData[i].ProtoHumanName), &textSize);
- x += textSize.cx + 3;
+ x += textSize.cx + 3;
}
}
- if (ProtosData[i].showProtoEmails && ProtosData[i].ProtoEMailCount!=NULL)
+ if (ProtosData[i].showProtoEmails && ProtosData[i].ProtoEMailCount != NULL)
{
SIZE textSize;
- RECT rt=r;
- rt.left=x+(spaceWidth>>1);
- rt.top=textY;
+ RECT rt = r;
+ rt.left = x+(spaceWidth>>1);
+ rt.top = textY;
ske_DrawTextA(hDC,ProtosData[i].ProtoEMailCount,lstrlenA(ProtosData[i].ProtoEMailCount),&rt,0);
//TextOutS(hDC,x,textY,ProtosData[i].ProtoName,lstrlenA(ProtosData[i].ProtoName));
if (ProtosData[i].showStatusName || ((ProtosData[i].xStatusMode&8) && ProtosData[i].ProtoXStatus))
{
GetTextExtentPoint32A(hDC,ProtosData[i].ProtoEMailCount,lstrlenA(ProtosData[i].ProtoEMailCount),&textSize);
- x+=textSize.cx+3;
+ x += textSize.cx+3;
}
}
if (ProtosData[i].showStatusName)
{
SIZE textSize;
- RECT rt=r;
- rt.left=x+(spaceWidth>>1);
- rt.top=textY;
+ RECT rt = r;
+ rt.left = x+(spaceWidth>>1);
+ rt.top = textY;
ske_DrawTextA(hDC, ProtosData[i].ProtoStatusText, lstrlenA(ProtosData[i].ProtoStatusText),&rt,0);
if (((ProtosData[i].xStatusMode&8) && ProtosData[i].ProtoXStatus))
{
GetTextExtentPoint32A(hDC,ProtosData[i].ProtoStatusText,lstrlenA(ProtosData[i].ProtoStatusText),&textSize);
- x+=textSize.cx+3;
+ x += textSize.cx+3;
}
//TextOutS(hDC,x,textY,ProtosData[i].ProtoStatusText,lstrlenA(ProtosData[i].ProtoStatusText));
}
if ((ProtosData[i].xStatusMode&8) && ProtosData[i].ProtoXStatus)
{
- RECT rt=r;
- rt.left=x+(spaceWidth>>1);
- rt.top=textY;
+ RECT rt = r;
+ rt.left = x+(spaceWidth>>1);
+ rt.top = textY;
ske_DrawText(hDC,ProtosData[i].ProtoXStatus,lstrlen(ProtosData[i].ProtoXStatus),&rt,0);
//TextOutS(hDC,x,textY,ProtosData[i].ProtoStatusText,lstrlenA(ProtosData[i].ProtoStatusText));
}
- ProtosData[i].protoRect=r;
+ ProtosData[i].protoRect = r;
- r.left=r.right+g_StatusBarData.extraspace;
+ r.left = r.right+g_StatusBarData.extraspace;
//SelectClipRgn(hDC,NULL);
DeleteObject(rgn);
@@ -702,7 +702,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC) if (ProtoWidth) mir_free_and_nill(ProtoWidth);
} //code for each line
- ProtosData=orig_ProtosData;
+ ProtosData = orig_ProtosData;
}
}
}
@@ -758,11 +758,11 @@ static BOOL _ModernStatus_OnExtraIconClick( int protoIndex ) #define TOOLTIP_TOLERANCE 5
LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
- static POINT ptToolTipShow={0};
+ static POINT ptToolTipShow = {0};
switch (msg)
{
case WM_CREATE:
- g_StatusBarData.hTheme=xpt_AddThemeHandle(hwnd,L"STATUS");
+ g_StatusBarData.hTheme = xpt_AddThemeHandle(hwnd,L"STATUS");
break;
case WM_DESTROY:
xpt_FreeThemeForWindow(hwnd);
@@ -770,42 +770,42 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam {
int k;
- for (k=0; k<allocedItemData; k++)
+ for (k = 0; k < allocedItemData; k++)
{
- if(ProtosData[k].AccountName) mir_free_and_nill (ProtosData[k].AccountName);
- if(ProtosData[k].ProtoName) mir_free_and_nill (ProtosData[k].ProtoName);
- if(ProtosData[k].ProtoEMailCount) mir_free_and_nill (ProtosData[k].ProtoEMailCount);
- if(ProtosData[k].ProtoHumanName) mir_free_and_nill (ProtosData[k].ProtoHumanName);
- if(ProtosData[k].ProtoStatusText) mir_free_and_nill (ProtosData[k].ProtoStatusText);
- if(ProtosData[k].ProtoEMailCount) mir_free_and_nill (ProtosData[k].ProtoEMailCount);
- if(ProtosData[k].ProtoXStatus) mir_free_and_nill (ProtosData[k].ProtoXStatus);
+ if (ProtosData[k].AccountName) mir_free_and_nill (ProtosData[k].AccountName);
+ if (ProtosData[k].ProtoName) mir_free_and_nill (ProtosData[k].ProtoName);
+ if (ProtosData[k].ProtoEMailCount) mir_free_and_nill (ProtosData[k].ProtoEMailCount);
+ if (ProtosData[k].ProtoHumanName) mir_free_and_nill (ProtosData[k].ProtoHumanName);
+ if (ProtosData[k].ProtoStatusText) mir_free_and_nill (ProtosData[k].ProtoStatusText);
+ if (ProtosData[k].ProtoEMailCount) mir_free_and_nill (ProtosData[k].ProtoEMailCount);
+ if (ProtosData[k].ProtoXStatus) mir_free_and_nill (ProtosData[k].ProtoXStatus);
}
mir_free_and_nill(ProtosData);
- ProtosData=NULL;
- allocedItemData=0;
+ 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:
return 1;
case WM_PAINT:
- if (GetParent(hwnd)==pcli->hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)hwnd,0);
- else if (GetParent(hwnd)==pcli->hwndContactList && !g_CluiData.fLayered)
+ else if (GetParent(hwnd) == pcli->hwndContactList && !g_CluiData.fLayered)
{
HDC hdc, hdc2;
HBITMAP hbmp,hbmpo;
- RECT rc={0};
+ RECT rc = {0};
GetClientRect(hwnd,&rc);
rc.right++;
rc.bottom++;
hdc = GetDC(hwnd);
- hdc2=CreateCompatibleDC(hdc);
- hbmp=ske_CreateDIB32(rc.right,rc.bottom);
- hbmpo=(HBITMAP)SelectObject(hdc2,hbmp);
+ hdc2 = CreateCompatibleDC(hdc);
+ hbmp = ske_CreateDIB32(rc.right,rc.bottom);
+ hbmpo = (HBITMAP)SelectObject(hdc2,hbmp);
SetBkMode(hdc2,TRANSPARENT);
ske_BltBackImage(hwnd,hdc2,&rc);
ModernDrawStatusBarWorker(hwnd,hdc2);
@@ -825,12 +825,12 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam HBITMAP hbmp, hbmpo;
RECT rc;
PAINTSTRUCT ps;
- HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
+ HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
GetClientRect(hwnd,&rc);
- hdc=BeginPaint(hwnd,&ps);
- hdc2=CreateCompatibleDC(hdc);
- hbmp=ske_CreateDIB32(rc.right,rc.bottom);
- hbmpo=(HBITMAP) SelectObject(hdc2,hbmp);
+ hdc = BeginPaint(hwnd,&ps);
+ hdc2 = CreateCompatibleDC(hdc);
+ hbmp = ske_CreateDIB32(rc.right,rc.bottom);
+ hbmpo = (HBITMAP) SelectObject(hdc2,hbmp);
FillRect(hdc2,&ps.rcPaint,br);
ModernDrawStatusBarWorker(hwnd,hdc2);
//BitBlt(hdc,ps.rcPaint.left,ps.rcPaint.top,ps.rcPaint.right-ps.rcPaint.left,ps.rcPaint.bottom-ps.rcPaint.top,
@@ -840,7 +840,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam SelectObject(hdc2,hbmpo);
DeleteObject(hbmp);
mod_DeleteDC(hdc2);
- ps.fErase=FALSE;
+ ps.fErase = FALSE;
EndPaint(hwnd,&ps);
}
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -849,10 +849,10 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam RECT rct;
GetWindowRect(hwnd,&rct);
memset((LPMINMAXINFO)lParam,0,sizeof(MINMAXINFO));
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.x=16;
- ((LPMINMAXINFO)lParam)->ptMinTrackSize.y=16;
- ((LPMINMAXINFO)lParam)->ptMaxTrackSize.x=1600;
- ((LPMINMAXINFO)lParam)->ptMaxTrackSize.y=1600;
+ ((LPMINMAXINFO)lParam)->ptMinTrackSize.x = 16;
+ ((LPMINMAXINFO)lParam)->ptMinTrackSize.y = 16;
+ ((LPMINMAXINFO)lParam)->ptMaxTrackSize.x = 1600;
+ ((LPMINMAXINFO)lParam)->ptMaxTrackSize.y = 1600;
return(0);
}
@@ -862,48 +862,48 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam int ID;
if (tooltipshoing){
NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip,0,0);
- tooltipshoing=FALSE;
+ tooltipshoing = FALSE;
};
- ID=Sync( FindFrameID, hwnd );
+ ID = Sync( FindFrameID, hwnd );
if (ID)
{
- res=CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,ID),0);
- if (res>=0) db_set_b(0,"CLUI","ShowSBar",(BYTE)(wParam/*(res&F_VISIBLE)*/?1:0));
+ res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,ID),0);
+ if (res >= 0) db_set_b(0,"CLUI","ShowSBar",(BYTE)(wParam/*(res&F_VISIBLE)*/?1:0));
}
}
break;
case WM_TIMER:
{
- if (wParam==TM_STATUSBARHIDE)
+ if (wParam == TM_STATUSBARHIDE)
{
KillTimer(hwnd,TM_STATUSBARHIDE);
if (tooltipshoing)
{
NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip,0,0);
- tooltipshoing=FALSE;
+ tooltipshoing = FALSE;
ReleaseCapture();
};
}
- else if (wParam==TM_STATUSBAR)
+ else if (wParam == TM_STATUSBAR)
{
POINT pt;
KillTimer(hwnd,TM_STATUSBAR);
GetCursorPos(&pt);
- if (pt.x==lastpnt.x&&pt.y==lastpnt.y)
+ if (pt.x == lastpnt.x&&pt.y == lastpnt.y)
{
int i;
RECT rc;
ScreenToClient(hwnd,&pt);
- for (i=0; i<allocedItemData; i++)
+ for (i = 0; i < allocedItemData; i++)
{
- rc=ProtosData[i].protoRect;
- if(PtInRect(&rc,pt))
+ rc = ProtosData[i].protoRect;
+ if (PtInRect(&rc,pt))
{
NotifyEventHooks(g_CluiData.hEventStatusBarShowToolTip,(WPARAM)ProtosData[i].AccountName,0);
CLUI_SafeSetTimer(hwnd,TM_STATUSBARHIDE,db_get_w(NULL,"CLUIFrames","HideToolTipTime",SETTING_HIDETOOLTIPTIME_DEFAULT),0);
- tooltipshoing=TRUE;
+ tooltipshoing = TRUE;
ClientToScreen(hwnd,&pt);
- ptToolTipShow=pt;
+ ptToolTipShow = pt;
SetCapture(hwnd);
return 0;
}
@@ -922,7 +922,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam {
KillTimer(hwnd,TM_STATUSBARHIDE);
NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip,0,0);
- tooltipshoing=FALSE;
+ tooltipshoing = FALSE;
ReleaseCapture();
}
}
@@ -934,17 +934,17 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam POINT pt;
GetCursorPos(&pt);
SendMessage(GetParent(hwnd),msg,wParam,lParam);
- if (pt.x==lastpnt.x&&pt.y==lastpnt.y)
+ if (pt.x == lastpnt.x&&pt.y == lastpnt.y)
{
return(CLUI_TestCursorOnBorders());
};
- lastpnt=pt;
+ lastpnt = pt;
if (tooltipshoing)
if (abs(pt.x-ptToolTipShow.x)>TOOLTIP_TOLERANCE || abs(pt.y-ptToolTipShow.y)>TOOLTIP_TOLERANCE)
{
KillTimer(hwnd,TM_STATUSBARHIDE);
NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip,0,0);
- tooltipshoing=FALSE;
+ tooltipshoing = FALSE;
ReleaseCapture();
};
KillTimer(hwnd,TM_STATUSBAR);
@@ -960,40 +960,40 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam RECT rc;
POINT pt;
int i;
- pt.x=(short)LOWORD(lParam);
- pt.y=(short)HIWORD(lParam);
+ pt.x = (short)LOWORD(lParam);
+ pt.y = (short)HIWORD(lParam);
KillTimer(hwnd,TM_STATUSBARHIDE);
KillTimer(hwnd,TM_STATUSBAR);
if (tooltipshoing){
NotifyEventHooks(g_CluiData.hEventStatusBarHideToolTip,0,0);
};
- tooltipshoing=FALSE;
- for (i=0; i<allocedItemData; i++)
+ tooltipshoing = FALSE;
+ for (i = 0; i < allocedItemData; i++)
{
RECT rc1;
- BOOL isOnExtra=FALSE;
+ BOOL isOnExtra = FALSE;
- rc=ProtosData[i].protoRect;
- rc1=rc;
- rc1.left=rc.left+16;
- rc1.right=rc1.left+16;
+ rc = ProtosData[i].protoRect;
+ rc1 = rc;
+ rc1.left = rc.left+16;
+ rc1.right = rc1.left+16;
if (PtInRect(&rc,pt) && PtInRect(&rc1,pt)&&ProtosData[i].DoubleIcons)
- isOnExtra=TRUE;
- if(PtInRect(&rc,pt))
+ isOnExtra = TRUE;
+ if (PtInRect(&rc,pt))
{
- HMENU hMenu=NULL;
+ HMENU hMenu = NULL;
- BOOL bShift =( GetKeyState( VK_SHIFT )&0x8000 );
- BOOL bCtrl =( GetKeyState( VK_CONTROL )&0x8000 );
+ BOOL bShift = ( GetKeyState( VK_SHIFT )&0x8000 );
+ BOOL bCtrl = ( GetKeyState( VK_CONTROL )&0x8000 );
- if ( ( msg==WM_MBUTTONDOWN || ( msg==WM_RBUTTONDOWN && bCtrl ) || isOnExtra) && _ModernStatus_OnExtraIconClick( i ))
+ if ( ( msg == WM_MBUTTONDOWN || ( msg == WM_RBUTTONDOWN && bCtrl ) || isOnExtra) && _ModernStatus_OnExtraIconClick( i ))
{
return TRUE;
}
if ( msg == WM_LBUTTONDOWN && bCtrl )
{
- if ( g_CluiData.bFilterEffective != CLVM_FILTER_PROTOS || !bShift )
+ if ( g_CluiData.bFilterEffective !=CLVM_FILTER_PROTOS || !bShift )
{
ApplyViewMode( "" );
mir_snprintf( g_CluiData.protoFilter, SIZEOF(g_CluiData.protoFilter), "%s|", ProtosData[i].AccountName );
@@ -1032,11 +1032,11 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam ProtoEnumAccounts( &protoCount, &accs );
bool first = true;
- for ( int pos = 0; pos<protoCount; pos++ )
+ for ( int pos = 0; pos < protoCount; pos++ )
{
int i = pcli->pfnGetAccountIndexByPos( pos );
- if ( i < 0 && i >= protoCount )
+ if ( i < 0 && i >= protoCount )
continue;
char protoF[ sizeof(g_CluiData.protoFilter) ];
@@ -1063,20 +1063,20 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam }
if (!hMenu)
{
- if (msg==WM_RBUTTONDOWN)
+ if (msg == WM_RBUTTONDOWN)
{
BOOL a = ( (g_StatusBarData.perProtoConfig && ProtosData[i].SBarRightClk) || g_StatusBarData.SBarRightClk );
if ( a ^ bShift )
- hMenu=(HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN,0,0);
else
- hMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
}
else
{
- hMenu=(HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
+ hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS,0,0);
unsigned int cpnl = 0;
int mcnt = GetMenuItemCount(hMenu);
- for (int j=0; j<mcnt; ++j) {
+ for (int j = 0; j < mcnt; ++j) {
HMENU hMenus = GetSubMenu(hMenu, j);
if (hMenus && cpnl++ == i) {
hMenu = hMenus;
@@ -1087,8 +1087,8 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam }
ClientToScreen(hwnd,&pt);
{
- HWND parent=GetParent(hwnd);
- if (parent!=pcli->hwndContactList) parent=GetParent(parent);
+ HWND parent = GetParent(hwnd);
+ if (parent != pcli->hwndContactList) parent = GetParent(parent);
TrackPopupMenu(hMenu,TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON,pt.x,pt.y,0,parent,NULL);
}
return 0;
@@ -1110,10 +1110,10 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam HWND StatusBar_Create(HWND parent)
{
- WNDCLASS wndclass={0};
- TCHAR pluginname[]=TEXT("ModernStatusBar");
- int h=GetSystemMetrics(SM_CYSMICON)+2;
- if (GetClassInfo(g_hInst,pluginname,&wndclass) ==0)
+ WNDCLASS wndclass = {0};
+ TCHAR pluginname[] = TEXT("ModernStatusBar");
+ int h = GetSystemMetrics(SM_CYSMICON)+2;
+ if (GetClassInfo(g_hInst,pluginname,&wndclass) == 0)
{
wndclass.style = 0;
wndclass.lpfnWndProc = ModernStatusProc;
@@ -1127,21 +1127,21 @@ HWND StatusBar_Create(HWND parent) wndclass.lpszClassName = pluginname;
RegisterClass(&wndclass);
}
- hModernStatusBar=CreateWindow(pluginname,pluginname,WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,
+ hModernStatusBar = CreateWindow(pluginname,pluginname,WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,
0,0,0,h,parent,NULL,g_hInst,NULL);
// register frame
{
CLISTFrame Frame;
memset(&Frame,0,sizeof(Frame));
- Frame.cbSize=sizeof(CLISTFrame);
- Frame.hWnd=hModernStatusBar;
- Frame.align=alBottom;
- Frame.hIcon=LoadSkinnedIcon (SKINICON_OTHER_MIRANDA);
- Frame.Flags=(db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
- Frame.height=h;
- Frame.tname=_T("Status Bar");
- Frame.TBtname=TranslateT("Status Bar");
- hFramehModernStatusBar=(HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,(LPARAM)0);
+ Frame.cbSize = sizeof(CLISTFrame);
+ Frame.hWnd = hModernStatusBar;
+ Frame.align = alBottom;
+ Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_MIRANDA);
+ Frame.Flags = (db_get_b(NULL,"CLUI","ShowSBar",SETTING_SHOWSBAR_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
+ Frame.height = h;
+ Frame.tname = _T("Status Bar");
+ Frame.TBtname = TranslateT("Status Bar");
+ hFramehModernStatusBar = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,(LPARAM)0);
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)NewStatusPaintCallbackProc); //$$$$$ register sub for frame
}
diff --git a/plugins/Clist_modern/modern_statusbar_options.cpp b/plugins/Clist_modern/modern_statusbar_options.cpp index 9a84dda5bb..f9703da9b6 100644 --- a/plugins/Clist_modern/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/modern_statusbar_options.cpp @@ -45,7 +45,7 @@ static StatusBarProtocolOptions _GlobalOptions = {0}; static void UpdateXStatusIconOptions(HWND hwndDlg, BOOL perProto, StatusBarProtocolOptions* dat, int curSelProto)
{
- int en=IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR) && IsDlgButtonChecked(hwndDlg,IDC_SHOWICON );
+ int en = IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR) && IsDlgButtonChecked(hwndDlg,IDC_SHOWICON );
if (IsDlgButtonChecked(hwndDlg,IDC_SHOWBOTH)) CheckDlgButton(hwndDlg,IDC_SHOWNORMAL,FALSE);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWBOTH),en && IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS) && !IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL));
@@ -59,12 +59,12 @@ static void UpdateXStatusIconOptions(HWND hwndDlg, BOOL perProto, StatusBarProto BYTE val = 0;
if (IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS))
{
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWBOTH)) val=3;
- else if (IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL)) val=2;
- else val=1;
- val+=IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENTOVERLAY)?4:0;
+ if (IsDlgButtonChecked(hwndDlg,IDC_SHOWBOTH)) val = 3;
+ else if (IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL)) val = 2;
+ else val = 1;
+ val += IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENTOVERLAY)?4:0;
}
- val+=IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUSNAME)?8:0;
+ val += IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUSNAME)?8:0;
if (perProto)
{
dat[curSelProto].ShowXStatus = val;
@@ -109,12 +109,12 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) CheckDlgButton(hwndDlg, IDC_USECONNECTINGICON, sbpo.UseConnectingIcon ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWXSTATUSNAME, ((sbpo.ShowXStatus&8)>0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWXSTATUS, ((sbpo.ShowXStatus&3)>0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWNORMAL, ((sbpo.ShowXStatus&3)==2) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWBOTH, ((sbpo.ShowXStatus&3)==3) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWUNREADEMAIL, (sbpo.ShowUnreadEmails==1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWNORMAL, ((sbpo.ShowXStatus&3) == 2) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWBOTH, ((sbpo.ShowXStatus&3) == 3) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWUNREADEMAIL, (sbpo.ShowUnreadEmails == 1) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_TRANSPARENTOVERLAY, ((sbpo.ShowXStatus&4)) ? BST_CHECKED : BST_UNCHECKED);
{
- BYTE showOpts=sbpo.SBarShow;
+ BYTE showOpts = sbpo.SBarShow;
CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts&1 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts&2 ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts&4 ? BST_CHECKED : BST_UNCHECKED);
@@ -200,7 +200,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) dat = (StatusBarProtocolOptions*)mir_alloc(sizeof(StatusBarProtocolOptions)*count);
SetWindowLongPtr(GetDlgItem(hwndDlg,IDC_STATUSBAR_PROTO_LIST),GWLP_USERDATA,(LONG_PTR)dat);
- SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)TranslateT( "<<Global>>" ));
+ SendMessage(hwndComboBox, CB_ADDSTRING, 0, (LPARAM)TranslateT( " << Global>>" ));
SendMessage(hwndComboBox, CB_SETITEMDATA, 0, (LPARAM)0);
for ( i = 0; i < count; i++ )
@@ -274,9 +274,9 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) {
int i, item;
- TCHAR *align[]={_T("Left"), _T("Center"), _T("Right")};
- for (i=0; i<SIZEOF(align); i++) {
- item=SendDlgItemMessage(hwndDlg,IDC_SBAR_HORIZ_ALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(align[i]));
+ TCHAR *align[] = {_T("Left"), _T("Center"), _T("Right")};
+ for (i = 0; i < SIZEOF(align); i++) {
+ item = SendDlgItemMessage(hwndDlg,IDC_SBAR_HORIZ_ALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(align[i]));
}
SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_SETCURSEL, db_get_b(NULL, "CLUI", "Align", SETTING_ALIGN_DEFAULT), 0);
@@ -284,16 +284,16 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) {
int i, item;
- TCHAR *align[]={_T("Top"), _T("Center"), _T("Bottom")};
- for (i=0; i<SIZEOF(align); i++) {
- item=SendDlgItemMessage(hwndDlg,IDC_SBAR_VERT_ALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(align[i]));
+ TCHAR *align[] = {_T("Top"), _T("Center"), _T("Bottom")};
+ for (i = 0; i < SIZEOF(align); i++) {
+ item = SendDlgItemMessage(hwndDlg,IDC_SBAR_VERT_ALIGN,CB_ADDSTRING,0,(LPARAM)TranslateTS(align[i]));
}
SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_SETCURSEL, db_get_b(NULL, "CLUI", "VAlign", SETTING_VALIGN_DEFAULT), 0);
}
{
- int en=IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR);
+ int en = IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR);
int en_icons = IsDlgButtonChecked(hwndDlg,IDC_SHOWICON );
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),en);
@@ -340,24 +340,24 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) return TRUE;
}
case WM_COMMAND:
- if(LOWORD(wParam)==IDC_BUTTON1)
+ if (LOWORD(wParam) == IDC_BUTTON1)
{
- if (HIWORD(wParam)==BN_CLICKED)
+ if (HIWORD(wParam) == BN_CLICKED)
{
CHOOSEFONTA fnt;
memset(&fnt,0,sizeof(CHOOSEFONTA));
- fnt.lStructSize=sizeof(CHOOSEFONTA);
- fnt.hwndOwner=hwndDlg;
- fnt.Flags=CF_SCREENFONTS|CF_INITTOLOGFONTSTRUCT;
- fnt.lpLogFont=&lf;
+ fnt.lStructSize = sizeof(CHOOSEFONTA);
+ fnt.hwndOwner = hwndDlg;
+ fnt.Flags = CF_SCREENFONTS|CF_INITTOLOGFONTSTRUCT;
+ fnt.lpLogFont = &lf;
ChooseFontA(&fnt);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
return 0;
}
}
- else if (LOWORD(wParam)==IDC_COLOUR ||(LOWORD(wParam)==IDC_SBAR_HORIZ_ALIGN && HIWORD(wParam)==CBN_SELCHANGE)) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- else if (LOWORD(wParam)==IDC_SHOWSBAR) {
- int en=IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR);
+ else if (LOWORD(wParam) == IDC_COLOUR ||(LOWORD(wParam) == IDC_SBAR_HORIZ_ALIGN && HIWORD(wParam) == CBN_SELCHANGE)) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
+ else if (LOWORD(wParam) == IDC_SHOWSBAR) {
+ int en = IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR);
int en_icons = IsDlgButtonChecked(hwndDlg,IDC_SHOWICON );
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),en);
EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWPROTO),en);
@@ -406,9 +406,9 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
}
- else if (LOWORD(wParam)==IDC_STATUSBAR_PER_PROTO)
+ else if (LOWORD(wParam) == IDC_STATUSBAR_PER_PROTO)
{
- int en=IsDlgButtonChecked(hwndDlg,IDC_STATUSBAR_PER_PROTO);
+ int en = IsDlgButtonChecked(hwndDlg,IDC_STATUSBAR_PER_PROTO);
EnableWindow(GetDlgItem(hwndDlg,IDC_STATUSBAR_PROTO_LIST),en);
EnableWindow(GetDlgItem(hwndDlg,IDC_SBAR_HIDE_ACCOUNT_COMPLETELY), en && perProto);
EnableWindow(GetDlgItem(hwndDlg,IDC_SBAR_USE_ACCOUNT_SETTINGS), en);
@@ -524,8 +524,8 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg) LOWORD(wParam) == IDC_SBAR_BORDER_BOTTOM ||
LOWORD(wParam) == IDC_SBAR_BORDER_TOP
) && (
- HIWORD(wParam) != EN_CHANGE ||
- (HWND)lParam != GetFocus()
+ HIWORD(wParam) !=EN_CHANGE ||
+ (HWND)lParam !=GetFocus()
))
return 0; // dont make apply enabled during buddy set crap
else if ( LOWORD(wParam) == IDC_STATUSBAR_PROTO_LIST )
diff --git a/plugins/Clist_modern/modern_sync.cpp b/plugins/Clist_modern/modern_sync.cpp index 1941b376f2..85e7c1fab6 100644 --- a/plugins/Clist_modern/modern_sync.cpp +++ b/plugins/Clist_modern/modern_sync.cpp @@ -23,33 +23,33 @@ static INT_PTR SyncCaller(WPARAM proc, LPARAM lParam) typedef int (*P3PARAMFUNC)(WPARAM, LPARAM, LPARAM);
typedef int (*P4PARAMFUNC)(WPARAM, LPARAM, LPARAM, LPARAM);
- LPARAM * params=(LPARAM *)lParam;
- int count=params[0];
+ LPARAM * params = (LPARAM *)lParam;
+ int count = params[0];
switch (count)
{
case 0:
{
- P0PARAMFUNC pfnProc=(P0PARAMFUNC)proc;
+ P0PARAMFUNC pfnProc = (P0PARAMFUNC)proc;
return pfnProc();
}
case 1:
{
- P1PARAMFUNC pfnProc=(P1PARAMFUNC)proc;
+ P1PARAMFUNC pfnProc = (P1PARAMFUNC)proc;
return pfnProc((WPARAM)params[1]);
}
case 2:
{
- P2PARAMFUNC pfnProc=(P2PARAMFUNC)proc;
+ P2PARAMFUNC pfnProc = (P2PARAMFUNC)proc;
return pfnProc((WPARAM)params[1],(LPARAM)params[2]);
}
case 3:
{
- P3PARAMFUNC pfnProc=(P3PARAMFUNC)proc;
+ P3PARAMFUNC pfnProc = (P3PARAMFUNC)proc;
return pfnProc((WPARAM)params[1],(LPARAM)params[2], (LPARAM)params[3]);
}
case 4:
{
- P4PARAMFUNC pfnProc=(P4PARAMFUNC)proc;
+ P4PARAMFUNC pfnProc = (P4PARAMFUNC)proc;
return pfnProc((WPARAM)params[1],(LPARAM)params[2], (LPARAM)params[3], (LPARAM)params[4]);
}
}
@@ -62,23 +62,23 @@ int SyncCall(void * vproc, int count, ... ) LPARAM params[5];
va_list va;
int i;
- params[0]=(LPARAM)count;
+ params[0] = (LPARAM)count;
va_start(va, count);
- for (i=0; i<count && i<SIZEOF(params)-1; i++)
+ for (i = 0; i < count && i < SIZEOF(params)-1; i++)
{
- params[i+1]=va_arg(va,LPARAM);
+ params[i+1] = va_arg(va,LPARAM);
}
va_end(va);
return SyncCallProxy(SyncCaller, (WPARAM)vproc, (LPARAM) params);
}
-int SyncCallProxy(PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lParam, CRITICAL_SECTION * cs /* = NULL */)
+int SyncCallProxy(PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lParam, CRITICAL_SECTION * cs /*= NULL */)
{
- SYNCCALLITEM item={0};
+ SYNCCALLITEM item = {0};
int nReturn = 0;
- if ( cs != NULL )
+ if ( cs !=NULL )
{
if ( !fnTryEnterCriticalSection ) // for poor OSes like Win98
{
@@ -90,7 +90,7 @@ int SyncCallProxy(PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lParam, CRITI if ( fnTryEnterCriticalSection( cs ))
{ //simple call (Fastest)
- int result=pfnProc(wParam,lParam);
+ int result = pfnProc(wParam,lParam);
LeaveCriticalSection( cs );
return result;
}
@@ -112,7 +112,7 @@ HRESULT SyncCallWinProcProxy( PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM l if (pcli->hwndContactList == NULL )
return E_FAIL;
- SYNCCALLITEM item={0};
+ SYNCCALLITEM item = {0};
item.wParam = wParam;
item.lParam = lParam;
item.pfnProc = pfnProc;
@@ -125,12 +125,12 @@ HRESULT SyncCallAPCProxy( PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lPara {
hReturn = 0;
- if (g_hMainThread==NULL || pfnProc==NULL)
+ if (g_hMainThread == NULL || pfnProc == NULL)
return E_FAIL;
- SYNCCALLITEM item={0};
+ SYNCCALLITEM item = {0};
- if (GetCurrentThreadId()!=g_dwMainThreadID)
+ if (GetCurrentThreadId() != g_dwMainThreadID)
{
item.wParam = wParam;
item.lParam = lParam;
@@ -159,7 +159,7 @@ HRESULT SyncCallAPCProxy( PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lPara LRESULT SyncOnWndProcCall( WPARAM wParam )
{
- SYNCCALLITEM *psci=(SYNCCALLITEM *)wParam;
+ SYNCCALLITEM *psci = (SYNCCALLITEM *)wParam;
if (psci)
return psci->pfnProc( psci->wParam, psci->lParam );
return 0;
diff --git a/plugins/Clist_modern/modern_tbbutton.cpp b/plugins/Clist_modern/modern_tbbutton.cpp index 15bf49604e..5d465927ba 100644 --- a/plugins/Clist_modern/modern_tbbutton.cpp +++ b/plugins/Clist_modern/modern_tbbutton.cpp @@ -3,7 +3,7 @@ #include "m_api/m_skinbutton.h"
#include "hdr/modern_clcpaint.h"
#ifdef __MINGW32__
-#include <ctype.h>
+#include < ctype.h>
#endif
#define BUTTON_POLLID 100
@@ -42,10 +42,10 @@ static CRITICAL_SECTION csTips; static HWND hwndToolTips = NULL;
static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset);
-static BOOL bThemed=FALSE;
+static BOOL bThemed = FALSE;
-static HANDLE hButtonWindowList=NULL;
-static HANDLE hBkgChangedHook=NULL;
+static HANDLE hButtonWindowList = NULL;
+static HANDLE hBkgChangedHook = NULL;
static int OnIconLibIconChanged(WPARAM wParam, LPARAM lParam)
@@ -56,13 +56,13 @@ static int OnIconLibIconChanged(WPARAM wParam, LPARAM lParam) static void InvalidateParentRect(HWND hwndChild, RECT * lpRect, BOOL fErase)
{
- LONG lExStyle=GetWindowLongPtr(hwndChild,GWL_EXSTYLE);
+ LONG lExStyle = GetWindowLongPtr(hwndChild,GWL_EXSTYLE);
if (lExStyle&WS_EX_TRANSPARENT)
{
NMHDR hdr;
- hdr.hwndFrom=hwndChild;
- hdr.idFrom=0;
- hdr.code=BUTTONNEEDREDRAW;
+ hdr.hwndFrom = hwndChild;
+ hdr.idFrom = 0;
+ hdr.code = BUTTONNEEDREDRAW;
SendMessage(GetParent(hwndChild),WM_NOTIFY,(WPARAM)hwndChild,(LPARAM)&hdr);
}
else
@@ -163,7 +163,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam break;
}
case WM_SYSKEYUP:
- if (lpSBData->nStateId != PBS_DISABLED && lpSBData->cHot && lpSBData->cHot == tolower((int) wParam))
+ if (lpSBData->nStateId !=PBS_DISABLED && lpSBData->cHot && lpSBData->cHot == tolower((int) wParam))
{
if (lpSBData->pushBtn)
{
@@ -193,11 +193,11 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam }
case BUTTONSETMARGINS:
{
- if (lParam) lpSBData->rcMargins=*(RECT*)lParam;
+ if (lParam) lpSBData->rcMargins = *(RECT*)lParam;
else
{
- RECT nillRect={0};
- lpSBData->rcMargins=nillRect;
+ RECT nillRect = {0};
+ lpSBData->rcMargins = nillRect;
}
return 0;
}
@@ -258,8 +258,8 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam }
case BUTTONSETASPUSHBTN:
- lpSBData->pushBtn = (wParam != 0);
- lpSBData->pbState = (lParam & 2) != 0;
+ lpSBData->pushBtn = (wParam !=0);
+ lpSBData->pbState = (lParam & 2) !=0;
return 0;
case WM_SETFOCUS:
@@ -288,7 +288,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam /*case WM_MOUSELEAVE:
{
// faked by the WM_TIMER
- if (lpSBData->nStateId != PBS_DISABLED)
+ if (lpSBData->nStateId !=PBS_DISABLED)
{
// don't change states if disabled
lpSBData->nStateId = PBS_NORMAL;
@@ -299,7 +299,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam */
case WM_CAPTURECHANGED:
{
- if ( (HWND)lParam != lpSBData->hWnd && lpSBData->nStateId != PBS_DISABLED)
+ if ( (HWND)lParam !=lpSBData->hWnd && lpSBData->nStateId !=PBS_DISABLED)
{
// don't change states if disabled
lpSBData->nStateId = PBS_NORMAL;
@@ -309,8 +309,8 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam }
case WM_LBUTTONDOWN:
{
- int xPos=( ( int )( short ) LOWORD( lParam ));
- int yPos=( ( int )( short ) HIWORD( lParam ));
+ int xPos = ( ( int )( short ) LOWORD( lParam ));
+ int yPos = ( ( int )( short ) HIWORD( lParam ));
POINT ptMouse = { xPos, yPos };
RECT rcClient;
@@ -323,12 +323,12 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam break;
}
- if (lpSBData->nStateId != PBS_DISABLED && lpSBData->nStateId != PBS_PRESSED)
+ if (lpSBData->nStateId !=PBS_DISABLED && lpSBData->nStateId !=PBS_PRESSED)
{
lpSBData->nStateId = PBS_PRESSED;
lpSBData->fHotMark = TRUE;
InvalidateParentRect(lpSBData->hWnd, NULL, TRUE);
- if(lpSBData->fSendOnDown)
+ if (lpSBData->fSendOnDown)
{
SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM) hwndDlg);
lpSBData->nStateId = PBS_NORMAL;
@@ -342,8 +342,8 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam if ( GetCapture() == lpSBData->hWnd )
{
- int xPos=( ( int )( short ) LOWORD( lParam ));
- int yPos=( ( int )( short ) HIWORD( lParam ));
+ int xPos = ( ( int )( short ) LOWORD( lParam ));
+ int yPos = ( ( int )( short ) HIWORD( lParam ));
POINT ptMouse = { xPos, yPos };
RECT rcClient;
@@ -364,7 +364,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam lpSBData->pbState = TRUE;
}
- if (lpSBData->nStateId != PBS_DISABLED)
+ if (lpSBData->nStateId !=PBS_DISABLED)
{
// don't change states if disabled
if (msg == WM_LBUTTONUP)
@@ -382,7 +382,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam {
RECT rc;
POINT pt;
- BOOL bPressed = (wParam & MK_LBUTTON) != 0;
+ BOOL bPressed = (wParam & MK_LBUTTON) !=0;
if ( bPressed && !lpSBData->fHotMark )
break;
GetWindowRect(hwndDlg, &rc);
@@ -430,7 +430,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam case WM_NCHITTEST:
{
LRESULT lr = SendMessage(GetParent(hwndDlg), WM_NCHITTEST, wParam, lParam);
- if(lr == HTLEFT || lr == HTRIGHT || lr == HTBOTTOM || lr == HTTOP || lr == HTTOPLEFT || lr == HTTOPRIGHT
+ if (lr == HTLEFT || lr == HTRIGHT || lr == HTBOTTOM || lr == HTTOP || lr == HTTOPLEFT || lr == HTTOPRIGHT
|| lr == HTBOTTOMLEFT || lr == HTBOTTOMRIGHT)
return HTTRANSPARENT;
break;
@@ -439,7 +439,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam {
if (wParam == BUTTON_POLLID)
{
- HWND hwnd=GetCapture();
+ HWND hwnd = GetCapture();
if ( hwnd == lpSBData->hWnd )
{
//KillTimer(hwndDlg, BUTTON_POLLID);
@@ -472,11 +472,11 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam lpSBData->hIconPrivate = 0;
}
- lpSBData->hIcolibHandle=(HANDLE)lParam;
+ lpSBData->hIcolibHandle = (HANDLE)lParam;
if (lpSBData->hIcolibHandle)
- lpSBData->hIcon=(HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0 , (LPARAM) lpSBData->hIcolibHandle);
+ lpSBData->hIcon = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0 , (LPARAM) lpSBData->hIcolibHandle);
else
- lpSBData->hIcon=NULL;
+ lpSBData->hIcon = NULL;
return 1;
}
case MBM_REFRESHICOLIBICON:
@@ -487,22 +487,22 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam lpSBData->hIconPrivate = 0;
}
if (lpSBData->hIcolibHandle)
- lpSBData->hIcon=(HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0 , (LPARAM) lpSBData->hIcolibHandle);
+ lpSBData->hIcon = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0 , (LPARAM) lpSBData->hIcolibHandle);
else
- lpSBData->hIcon=NULL;
+ lpSBData->hIcon = NULL;
InvalidateRect(hwndDlg,NULL,TRUE);
pcli->pfnInvalidateRect(GetParent(GetParent(hwndDlg)),NULL,TRUE);
return 1;
}
case MBM_UPDATETRANSPARENTFLAG:
{
- LONG flag=GetWindowLongPtr(hwndDlg,GWL_EXSTYLE);
- LONG oldFlag=flag;
- if (lParam==2)
- lParam=(g_CluiData.fDisableSkinEngine)?0:1;
- flag&=~WS_EX_TRANSPARENT;
- if (lParam) flag|=WS_EX_TRANSPARENT;
- if (flag!=oldFlag)
+ LONG flag = GetWindowLongPtr(hwndDlg,GWL_EXSTYLE);
+ LONG oldFlag = flag;
+ if (lParam == 2)
+ lParam = (g_CluiData.fDisableSkinEngine)?0:1;
+ flag &= ~WS_EX_TRANSPARENT;
+ if (lParam) flag |= WS_EX_TRANSPARENT;
+ if (flag != oldFlag)
{
SetWindowLongPtr(hwndDlg,GWL_EXSTYLE,flag);
RedrawWindow(hwndDlg,NULL,NULL,RDW_INVALIDATE|RDW_UPDATENOW);
@@ -511,7 +511,7 @@ static LRESULT CALLBACK TollbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam }
case BM_GETIMAGE:
{
- if(wParam == IMAGE_ICON)
+ if (wParam == IMAGE_ICON)
return (LRESULT)(lpSBData->hIconPrivate ? lpSBData->hIconPrivate : lpSBData->hIcon);
break;
}
@@ -592,15 +592,15 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) int height;
HBITMAP hbmOld = NULL;
HFONT hOldFont = NULL;
- BLENDFUNCTION bf={AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- POINT offset={0};
- if (pOffset) offset=*pOffset;
+ BLENDFUNCTION bf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ POINT offset = {0};
+ if (pOffset) offset = *pOffset;
if (!hdcPaint) return; //early exit
GetClientRect(lpSBData->hWnd, &rcClient);
- width =rcClient.right - rcClient.left;
- height =rcClient.bottom - rcClient.top;
+ width = rcClient.right - rcClient.left;
+ height = rcClient.bottom - rcClient.top;
hdcMem = pOffset?hdcPaint:CreateCompatibleDC(hdcPaint);
hOldFont = (HFONT)SelectObject(hdcMem, lpSBData->hFont);
@@ -618,10 +618,10 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) {
char szRequest[128];
/* painting */
- mir_snprintf(szRequest,SIZEOF(szRequest),"Button,ID=%s,Hovered=%s,Pressed=%s,Focused=%s",
+ mir_snprintf(szRequest,SIZEOF(szRequest),"Button,ID = %s,Hovered = %s,Pressed = %s,Focused = %s",
lpSBData->szButtonID, // ID
- b2str(lpSBData->nStateId==PBS_HOT), // Hovered
- b2str(lpSBData->nStateId==PBS_PRESSED || lpSBData->pbState == TRUE), // Pressed
+ b2str(lpSBData->nStateId == PBS_HOT), // Hovered
+ b2str(lpSBData->nStateId == PBS_PRESSED || lpSBData->pbState == TRUE), // Pressed
b2str(lpSBData->fFocused)); // Focused
SkinDrawGlyph(hdcMem,&rcClient,&rcClient,szRequest);
@@ -631,18 +631,18 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) if (xpt_IsThemed(lpSBData->hThemeToolbar))
{
RECT *rc = &rcClient;
- int state = IsWindowEnabled(lpSBData->hWnd) ? /*(lpSBData->nStateId==PBS_PRESSED || lpSBData->pbState == TRUE) ? PBS_PRESSED :*/ (lpSBData->nStateId == PBS_NORMAL && lpSBData->defbutton ? PBS_DEFAULTED : lpSBData->nStateId) : PBS_DISABLED;
+ int state = IsWindowEnabled(lpSBData->hWnd) ? /*(lpSBData->nStateId == PBS_PRESSED || lpSBData->pbState == TRUE) ? PBS_PRESSED :*/ (lpSBData->nStateId == PBS_NORMAL && lpSBData->defbutton ? PBS_DEFAULTED : lpSBData->nStateId) : PBS_DISABLED;
xpt_DrawTheme(lpSBData->hThemeToolbar,lpSBData->hWnd,hdcMem,TP_BUTTON, TBStateConvert2Flat(state), rc, rc);
}
else
{
- HBRUSH hbr=NULL;
+ HBRUSH hbr = NULL;
- if (lpSBData->nStateId==PBS_PRESSED||lpSBData->nStateId==PBS_HOT)
+ if (lpSBData->nStateId == PBS_PRESSED||lpSBData->nStateId == PBS_HOT)
hbr = GetSysColorBrush(COLOR_3DLIGHT);
else {
RECT btnRect;
- POINT pt={0};
+ POINT pt = {0};
int ret;
HWND hwndParent = GetParent(lpSBData->hWnd);
HDC dc = CreateCompatibleDC(NULL);
@@ -673,12 +673,12 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) FillRect(hdcMem, &rcClient, hbr);
DeleteObject(hbr);
}
- if (lpSBData->nStateId==PBS_HOT||lpSBData->fFocused) {
+ if (lpSBData->nStateId == PBS_HOT||lpSBData->fFocused) {
if (lpSBData->pbState)
DrawEdge(hdcMem,&rcClient, EDGE_ETCHED,BF_RECT|BF_SOFT);
else DrawEdge(hdcMem,&rcClient, BDR_RAISEDOUTER,BF_RECT|BF_SOFT|BF_FLAT);
}
- else if (lpSBData->nStateId==PBS_PRESSED)
+ else if (lpSBData->nStateId == PBS_PRESSED)
DrawEdge(hdcMem, &rcClient, BDR_SUNKENOUTER,BF_RECT|BF_SOFT);
}
}
@@ -686,10 +686,10 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) }
{
- RECT rcTemp = rcClient; //content rect
- BYTE bPressed = (lpSBData->nStateId==PBS_PRESSED || lpSBData->pbState == TRUE)?1:0;
+ RECT rcTemp = rcClient; //content rect
+ BYTE bPressed = (lpSBData->nStateId == PBS_PRESSED || lpSBData->pbState == TRUE)?1:0;
HICON hHasIcon = lpSBData->hIcon?lpSBData->hIcon:lpSBData->hIconPrivate?lpSBData->hIconPrivate:NULL;
- BOOL fHasText = (lpSBData->szText[0]!='\0');
+ BOOL fHasText = (lpSBData->szText[0] != '\0');
/* formatter */
RECT rcIcon;
@@ -700,10 +700,10 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) {
/* correct rect according to rcMargins */
- rcTemp.left += lpSBData->rcMargins.left;
- rcTemp.top += lpSBData->rcMargins.top;
- rcTemp.bottom -= lpSBData->rcMargins.bottom;
- rcTemp.right -= lpSBData->rcMargins.right;
+ rcTemp.left += lpSBData->rcMargins.left;
+ rcTemp.top += lpSBData->rcMargins.top;
+ rcTemp.bottom -= lpSBData->rcMargins.bottom;
+ rcTemp.right -= lpSBData->rcMargins.right;
}
rcIcon = rcTemp;
@@ -713,13 +713,13 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) /* reposition button items */
if (hHasIcon && fHasText )
{
- rcIcon.right=rcIcon.left+16; /* CXSM_ICON */
- rcText.left=rcIcon.right+2;
+ rcIcon.right = rcIcon.left+16; /* CXSM_ICON */
+ rcText.left = rcIcon.right+2;
}
else if (hHasIcon)
{
- rcIcon.left+=(rcIcon.right-rcIcon.left)/2-8;
- rcIcon.right=rcIcon.left+16;
+ rcIcon.left += (rcIcon.right-rcIcon.left)/2-8;
+ rcIcon.right = rcIcon.left+16;
}
{
@@ -727,36 +727,36 @@ static void PaintWorker(TBBUTTONDATA *lpSBData, HDC hdcPaint , POINT * pOffset) if (hHasIcon &&
(rcIcon.right>rcTemp.right ||
rcIcon.bottom>rcTemp.bottom ||
- rcIcon.left<rcTemp.left ||
- rcIcon.top<rcTemp.top)) hHasIcon=NULL;
+ rcIcon.left < rcTemp.left ||
+ rcIcon.top < rcTemp.top)) hHasIcon = NULL;
if (fHasText &&
(rcText.right>rcTemp.right ||
rcText.bottom>rcTemp.bottom ||
- rcText.left<rcTemp.left ||
- rcText.top<rcTemp.top)) fHasText=FALSE;
+ rcText.left < rcTemp.left ||
+ rcText.top < rcTemp.top)) fHasText = FALSE;
}
if (hHasIcon)
{
/* center icon vertically */
- rcIcon.top+=(rcClient.bottom-rcClient.top)/2 - 8; /* CYSM_ICON/2 */
- rcIcon.bottom=rcIcon.top + 16; /* CYSM_ICON */
+ rcIcon.top += (rcClient.bottom-rcClient.top)/2 - 8; /* CYSM_ICON/2 */
+ rcIcon.bottom = rcIcon.top + 16; /* CYSM_ICON */
/* draw it */
ske_DrawIconEx(hdcMem, rcIcon.left+bPressed, rcIcon.top+bPressed, hHasIcon,
16, 16, 0, NULL, DI_NORMAL);
}
if (fHasText)
{
- BOOL bCentered=TRUE;
+ BOOL bCentered = TRUE;
SetBkMode(hdcMem,TRANSPARENT);
- if (lpSBData->nFontID>=0)
+ if (lpSBData->nFontID >= 0)
g_clcPainter.ChangeToFont(hdcMem,NULL,lpSBData->nFontID,NULL);
{
- RECT TextRequiredRect=rcText;
+ RECT TextRequiredRect = rcText;
ske_DrawText(hdcMem, lpSBData->szText, -1, &TextRequiredRect, DT_CENTER | DT_VCENTER | DT_CALCRECT | DT_SINGLELINE);
if (TextRequiredRect.right-TextRequiredRect.left>rcText.right-rcText.left)
- bCentered=FALSE;
+ bCentered = FALSE;
}
ske_DrawText(hdcMem, lpSBData->szText, -1, &rcText, (bCentered ? DT_CENTER: 0) | DT_VCENTER | DT_SINGLELINE);
@@ -789,16 +789,16 @@ HRESULT ToolbarButtonLoadModule() WNDCLASSEX wc;
ZeroMemory(&wc, sizeof(wc));
wc.cbSize = sizeof(wc);
- wc.lpszClassName =SKINBUTTONCLASS;
+ wc.lpszClassName = SKINBUTTONCLASS;
wc.lpfnWndProc = TollbarButtonProc;
wc.hCursor = LoadCursor(NULL, IDC_ARROW);
wc.cbWndExtra = sizeof(TBBUTTONDATA *);
wc.hbrBackground = 0;
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);
+ hButtonWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ hIconChangedHook = ModernHookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
+ hBkgChangedHook = ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,Buttons_OnSkinModeSettingsChanged);
return S_OK;
}
diff --git a/plugins/Clist_modern/modern_toolbar.cpp b/plugins/Clist_modern/modern_toolbar.cpp index 60bc90e704..94bc917f1c 100644 --- a/plugins/Clist_modern/modern_toolbar.cpp +++ b/plugins/Clist_modern/modern_toolbar.cpp @@ -58,7 +58,7 @@ enum { };
enum {
- SEPARATOR_NOT=0,
+ SEPARATOR_NOT = 0,
SEPARATOR_FIXED,
SEPARATOR_FLEX
};
@@ -154,12 +154,12 @@ static void sttTBButton2MTBBUTTONINFO(TBButton * bi, MTB_BUTTONINFO * mtbi); static int sttSortButtons(const void * vmtbi1, const void * vmtbi2);
-static MTB_GLOBALDAT tbdat ={0};
+static MTB_GLOBALDAT tbdat = {0};
//destructor for MTB_BUTTONINFO
static void delete_MTB_BUTTONINFO(void * input)
{
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO *)input;
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)input;
if (mtbi->hWindow && IsWindow(mtbi->hWindow)) DestroyWindow(mtbi->hWindow);
mir_safe_free(mtbi->szButtonID);
mir_safe_free(mtbi->szButtonName);
@@ -172,12 +172,12 @@ 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 = ModernHookEvent(ME_SYSTEM_MODULESLOADED, ehhToolbarModulesLoaded);
+ tbdat.hehSystemShutdown = ModernHookEvent(ME_SYSTEM_SHUTDOWN, ehhToolBarSystemShutdown);
{ //create window class
- WNDCLASS wndclass={0};
- if (GetClassInfo(g_hInst,_T(MIRANDATOOLBARCLASSNAME),&wndclass) ==0)
+ WNDCLASS wndclass = {0};
+ if (GetClassInfo(g_hInst,_T(MIRANDATOOLBARCLASSNAME),&wndclass) == 0)
{
wndclass.style = 0;
wndclass.lpfnWndProc = ToolBar_WndProc;
@@ -192,7 +192,7 @@ HRESULT ToolbarLoadModule() RegisterClass(&wndclass);
}
}
- tbdat.listOfButtons=List_Create(0,1);
+ tbdat.listOfButtons = List_Create(0,1);
InitializeCriticalSection(&tbdat.cs);
return S_OK;
}
@@ -201,11 +201,11 @@ 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);
+ tbdat.hehOptInit = ModernHookEvent(ME_OPT_INITIALISE,ehhToolbarOptInit);
ehhToolBarBackgroundSettingsChanged(0,0);
- tbdat.hehSettingsChanged=ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED, ehhToolBarSettingsChanged );
+ tbdat.hehSettingsChanged = ModernHookEvent(ME_DB_CONTACT_SETTINGCHANGED, ehhToolBarSettingsChanged );
- tbdat.hToolBarWindowList=(HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
+ tbdat.hToolBarWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
CreateServiceFunction(MS_TB_ADDBUTTON,svcToolBarAddButton);
CreateServiceFunction(MS_TB_REMOVEBUTTON, svcToolBarRemoveButton);
@@ -216,7 +216,7 @@ static int ehhToolbarModulesLoaded(WPARAM wParam, LPARAM lParam) CreateServiceFunction(MS_TB_GETBUTTONSTATE, svcToolBarGetButtonState);
CreateServiceFunction(MS_TB_GETBUTTONSTATEBYID, svcToolBarGetButtonStateById);
- HWND hwndClist=(HWND) CallService(MS_CLUI_GETHWND,0,0);
+ HWND hwndClist = (HWND) CallService(MS_CLUI_GETHWND,0,0);
sttCreateToolBarFrame( hwndClist, ("ToolBar"), 24);
NotifyEventHooks(g_CluiData.hEventToolBarModuleLoaded, 0, 0);
@@ -232,7 +232,7 @@ static int ehhToolBarSystemShutdown(WPARAM wParam, LPARAM lParam) ModernUnhookEvent(tbdat.hehSystemShutdown);
ModernUnhookEvent(tbdat.hehOptInit);
EnterCriticalSection(&tbdat.cs);
- g_CluiData.hEventToolBarModuleLoaded=NULL;
+ g_CluiData.hEventToolBarModuleLoaded = NULL;
li_ListDestruct(tbdat.listOfButtons,delete_MTB_BUTTONINFO);
@@ -245,8 +245,8 @@ static int ehhToolBarSystemShutdown(WPARAM wParam, LPARAM lParam) static int ehhToolBarSettingsChanged( WPARAM wParam, LPARAM lParam )
{
- DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- if ((HANDLE)wParam!=NULL) return 0;
+ DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING*)lParam;
+ if ((HANDLE)wParam != NULL) return 0;
if (!mir_strcmp(cws->szModule,"CList"))
{
if (!mir_strcmp(cws->szSetting,"HideOffline"))
@@ -264,18 +264,18 @@ static int ehhToolBarSettingsChanged( WPARAM wParam, LPARAM lParam ) }
static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
{
- if(tbdat.mtb_hBmpBackground)
+ if (tbdat.mtb_hBmpBackground)
{
DeleteObject(tbdat.mtb_hBmpBackground);
- tbdat.mtb_hBmpBackground=NULL;
+ tbdat.mtb_hBmpBackground = NULL;
}
if (g_CluiData.fDisableSkinEngine)
{
DBVARIANT dbv;
- tbdat.mtb_bkColour=sttGetColor("ToolBar","BkColour",CLCDEFAULT_BKCOLOUR);
- if(db_get_b(NULL,"ToolBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
+ tbdat.mtb_bkColour = sttGetColor("ToolBar","BkColour",CLCDEFAULT_BKCOLOUR);
+ if (db_get_b(NULL,"ToolBar","UseBitmap",CLCDEFAULT_USEBITMAP)) {
if (!DBGetContactSettingString(NULL,"ToolBar","BkBitmap",&dbv)) {
- tbdat.mtb_hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
+ tbdat.mtb_hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
}
@@ -302,19 +302,19 @@ static int ehhToolbarOptInit(WPARAM wParam, LPARAM lParam) }
static INT_PTR svcToolBarAddButton(WPARAM wParam, LPARAM lParam)
{
- INT_PTR result=0;
+ INT_PTR result = 0;
BYTE bVisible;
BYTE bPanel;
DWORD dwOrder;
- TBButton * bi=(TBButton *)lParam;
- bVisible=(bi->tbbFlags&TBBF_VISIBLE ? TRUE : FALSE);
+ TBButton * bi = (TBButton *)lParam;
+ bVisible = (bi->tbbFlags&TBBF_VISIBLE ? TRUE : FALSE);
if (!ServiceExists(bi->pszServiceName))
return 0;
tbcheck 0;
tblock;
{
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO *)mir_calloc(sizeof(MTB_BUTTONINFO));
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)mir_calloc(sizeof(MTB_BUTTONINFO));
sttTBButton2MTBBUTTONINFO(bi,mtbi);
sttGetButtonSettings(mtbi->szButtonID, &bVisible, &dwOrder, &bPanel);
@@ -325,14 +325,14 @@ static INT_PTR svcToolBarAddButton(WPARAM wParam, LPARAM lParam) List_InsertPtr(tbdat.listOfButtons,mtbi);
if (mtbi->bVisible)
- result=(INT_PTR)ToolBar_AddButtonToBars(mtbi);
+ result = (INT_PTR)ToolBar_AddButtonToBars(mtbi);
}
tbunlock;
return result;
}
static INT_PTR svcToolBarRemoveButton(WPARAM wParam, LPARAM lParam)
{
- HANDLE hButton=(HANDLE)wParam;
+ HANDLE hButton = (HANDLE)wParam;
tbcheck 0;
tblock;
WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_REMOVEBUTTON, wParam, lParam);
@@ -341,13 +341,13 @@ static INT_PTR svcToolBarRemoveButton(WPARAM wParam, LPARAM lParam) }
static INT_PTR svcToolBarGetButtonState(WPARAM wParam, LPARAM lParam)
{
- int res=-1;
+ int res = -1;
WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_GETBUTTONSTATE, wParam, (LPARAM) &res);
return res;
}
static INT_PTR svcToolBarGetButtonStateById(WPARAM wParam, LPARAM lParam)
{
- int res=-1;
+ int res = -1;
WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_GETBUTTONSTATEBYID, wParam, (LPARAM) &res);
return res;
}
@@ -369,38 +369,38 @@ static void sttTBButton2MTBBUTTONINFO(TBButton * bi, MTB_BUTTONINFO * mtbi) if (!bi || !mtbi) return;
if (!(bi->tbbFlags&TBBF_ISSEPARATOR))
{
- mtbi->szButtonName=mir_strdup(bi->pszButtonName);
- mtbi->szService=mir_strdup(bi->pszServiceName);
- mtbi->szButtonID=mir_strdup(bi->pszButtonID);
- mtbi->bPushButton=(bi->tbbFlags&TBBF_PUSHED)?TRUE:FALSE;
- mtbi->szTooltip=mir_a2t(Translate(bi->pszTooltipUp));
- mtbi->szTooltipPressed=mir_a2t(Translate(bi->pszTooltipDn));
- mtbi->bSeparator=SEPARATOR_NOT;
- mtbi->hPrimaryIconHandle=bi->hPrimaryIconHandle;
- mtbi->hSecondaryIconHandle=bi->hSecondaryIconHandle;
- mtbi->lParam=bi->lParam;
+ mtbi->szButtonName = mir_strdup(bi->pszButtonName);
+ mtbi->szService = mir_strdup(bi->pszServiceName);
+ mtbi->szButtonID = mir_strdup(bi->pszButtonID);
+ mtbi->bPushButton = (bi->tbbFlags&TBBF_PUSHED)?TRUE:FALSE;
+ mtbi->szTooltip = mir_a2t(Translate(bi->pszTooltipUp));
+ mtbi->szTooltipPressed = mir_a2t(Translate(bi->pszTooltipDn));
+ mtbi->bSeparator = SEPARATOR_NOT;
+ mtbi->hPrimaryIconHandle = bi->hPrimaryIconHandle;
+ mtbi->hSecondaryIconHandle = bi->hSecondaryIconHandle;
+ mtbi->lParam = bi->lParam;
}
else
{
- mtbi->nOrderValue=bi->defPos;
- mtbi->bSeparator= (((bi->tbbFlags & TBBF_FLEXSIZESEPARATOR) == TBBF_FLEXSIZESEPARATOR)? SEPARATOR_FLEX :
+ mtbi->nOrderValue = bi->defPos;
+ mtbi->bSeparator = (((bi->tbbFlags & TBBF_FLEXSIZESEPARATOR) == TBBF_FLEXSIZESEPARATOR)? SEPARATOR_FLEX :
((bi->tbbFlags & TBBF_ISSEPARATOR) == TBBF_ISSEPARATOR)? SEPARATOR_FIXED : SEPARATOR_NOT);
}
- mtbi->bVisible = ((bi->tbbFlags&TBBF_VISIBLE)!=0);
+ mtbi->bVisible = ((bi->tbbFlags&TBBF_VISIBLE) != 0);
}
static void sttUpdateButtonState(MTB_BUTTONINFO * mtbi)
{
HANDLE ilIcon;
- ilIcon=(mtbi->bPushButton)?mtbi->hSecondaryIconHandle:mtbi->hPrimaryIconHandle;
+ ilIcon = (mtbi->bPushButton)?mtbi->hSecondaryIconHandle:mtbi->hPrimaryIconHandle;
SendMessage(mtbi->hWindow, MBM_SETICOLIBHANDLE, 0, (LPARAM) ilIcon );
SendMessage(mtbi->hWindow, BUTTONADDTOOLTIP, (WPARAM)((mtbi->bPushButton) ? mtbi->szTooltipPressed : mtbi->szTooltip), 0);
}
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);
- if (mtbi1==NULL || mtbi2==NULL) return (mtbi1-mtbi2);
+ MTB_BUTTONINFO * mtbi1 = (MTB_BUTTONINFO *)*((MTB_BUTTONINFO ** )vmtbi1);
+ MTB_BUTTONINFO * mtbi2 = (MTB_BUTTONINFO *)*((MTB_BUTTONINFO ** )vmtbi2);
+ if (mtbi1 == NULL || mtbi2 == NULL) return (mtbi1-mtbi2);
return mtbi1->nOrderValue-mtbi2->nOrderValue;
}
@@ -409,69 +409,69 @@ static int sttReposButtons(MTBINFO * mti) RECT rcClient;
HDWP hdwp;
int nBarSize;
- int nFlexSeparatorsCount=0;
- int nUsedWidth=0;
- int i=0;
- int nextX=0;
+ int nFlexSeparatorsCount = 0;
+ int nUsedWidth = 0;
+ int i = 0;
+ int nextX = 0;
int nFreeSpace;
- BOOL bWasButttonBefore=FALSE;
- int iFirstButtonId=0;
- int iLastButtonId=0;
- int y=0;
+ BOOL bWasButttonBefore = FALSE;
+ int iFirstButtonId = 0;
+ int iLastButtonId = 0;
+ int y = 0;
// firstly let sort it by order
qsort(mti->pButtonList->items,mti->pButtonList->realCount,sizeof(MTB_BUTTONINFO *),sttSortButtons);
GetClientRect(mti->hWnd, &rcClient);
- nBarSize=rcClient.right-rcClient.left;
+ nBarSize = rcClient.right-rcClient.left;
if (nBarSize == 0) return 0;
- mti->nLineCount=0;
- hdwp=BeginDeferWindowPos( mti->pButtonList->realCount );
+ mti->nLineCount = 0;
+ hdwp = BeginDeferWindowPos( mti->pButtonList->realCount );
do
{
++mti->nLineCount;
- bWasButttonBefore=FALSE;
- nUsedWidth=0;
+ bWasButttonBefore = FALSE;
+ nUsedWidth = 0;
//calculating count of visible buttons and separators in line
- for (i=iFirstButtonId; i<mti->pButtonList->realCount; i++)
+ for (i = iFirstButtonId; i < mti->pButtonList->realCount; i++)
{
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO *)mti->pButtonList->items[i];
- if ( mtbi->bSeparator==2 )
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)mti->pButtonList->items[i];
+ if ( mtbi->bSeparator == 2 )
nFlexSeparatorsCount++;
else
{
- int width=(mtbi->bSeparator==1)? 4 : mti->nButtonWidth+(bWasButttonBefore ? mti->nButtonSpace : 0);
+ int width = (mtbi->bSeparator == 1)? 4 : mti->nButtonWidth+(bWasButttonBefore ? mti->nButtonSpace : 0);
if (nUsedWidth+width>nBarSize) break;
- nUsedWidth+=width;
+ nUsedWidth += width;
}
- iLastButtonId=i+1;
- bWasButttonBefore= (mtbi->bSeparator == 0) ? TRUE : FALSE;
+ iLastButtonId = i+1;
+ bWasButttonBefore = (mtbi->bSeparator == 0) ? TRUE : FALSE;
}
- nFreeSpace=nBarSize-nUsedWidth;
+ nFreeSpace = nBarSize-nUsedWidth;
- for (i=iFirstButtonId; i<iLastButtonId; i++)
+ for (i = iFirstButtonId; i < iLastButtonId; i++)
{
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO *)mti->pButtonList->items[i];
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)mti->pButtonList->items[i];
if (mtbi->hWindow)
{
if (hdwp)
{
//if (nextX+mti->nButtonWidth +mti->nButtonSpace <= nBarSize)
- hdwp=DeferWindowPos(hdwp, mtbi->hWindow, NULL, nextX, y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_SHOWWINDOW/*|SWP_NOREDRAW*/);
+ hdwp = DeferWindowPos(hdwp, mtbi->hWindow, NULL, nextX, y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_SHOWWINDOW/*|SWP_NOREDRAW*/);
//else break;
-// hdwp=DeferWindowPos(hdwp, mtbi->hWindow, NULL, nextX, y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_HIDEWINDOW|SWP_NOREDRAW);
+// hdwp = DeferWindowPos(hdwp, mtbi->hWindow, NULL, nextX, y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_HIDEWINDOW|SWP_NOREDRAW);
}
- nextX+=mti->nButtonWidth+mti->nButtonSpace;
+ nextX += mti->nButtonWidth+mti->nButtonSpace;
}
- else if ( mtbi->bSeparator==1 )
+ else if ( mtbi->bSeparator == 1 )
{
- nextX+=4;
+ nextX += 4;
}
else if (nFlexSeparatorsCount>0)
{
- nextX+=nFreeSpace/nFlexSeparatorsCount;
- nFreeSpace-=nFreeSpace/nFlexSeparatorsCount;
+ nextX += nFreeSpace/nFlexSeparatorsCount;
+ nFreeSpace -= nFreeSpace/nFlexSeparatorsCount;
nFlexSeparatorsCount--;
}
}
@@ -479,16 +479,16 @@ static int sttReposButtons(MTBINFO * mti) break;
iFirstButtonId = iLastButtonId;
- y+=mti->nButtonHeight+mti->nButtonSpace;
- nextX=0;
+ y += mti->nButtonHeight+mti->nButtonSpace;
+ nextX = 0;
if (mti->fSingleLine) break;
- } while (iFirstButtonId<mti->pButtonList->realCount && y >= 0 &&(mti->fAutoSize || (y+mti->nButtonHeight <= rcClient.bottom-rcClient.top)));
- for (i=iFirstButtonId; i< mti->pButtonList->realCount; i++)
+ } while (iFirstButtonId < mti->pButtonList->realCount && y >= 0 &&(mti->fAutoSize || (y+mti->nButtonHeight <= rcClient.bottom-rcClient.top)));
+ for (i = iFirstButtonId; i < mti->pButtonList->realCount; i++)
{
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO *)mti->pButtonList->items[i];
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)mti->pButtonList->items[i];
if (mtbi->hWindow && hdwp)
{
- hdwp=DeferWindowPos(hdwp, mtbi->hWindow, NULL, nextX, y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_HIDEWINDOW/*|SWP_NOREDRAW*/);
+ hdwp = DeferWindowPos(hdwp, mtbi->hWindow, NULL, nextX, y, 0, 0, SWP_NOSIZE|SWP_NOZORDER|SWP_HIDEWINDOW/*|SWP_NOREDRAW*/);
}
}
if (hdwp) EndDeferWindowPos(hdwp);
@@ -498,15 +498,15 @@ static int sttReposButtons(MTBINFO * mti) static HWND sttCreateToolBarFrame( HWND hwndParent, char * szCaption, int nHeight )
{
- TCHAR * Caption=mir_a2t(szCaption);
- HWND hwnd=CreateWindow(_T(MIRANDATOOLBARCLASSNAME), TranslateTS(Caption), WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,0,0,0,nHeight,hwndParent,NULL,g_hInst, (void*) szCaption);
+ TCHAR * Caption = mir_a2t(szCaption);
+ HWND hwnd = CreateWindow(_T(MIRANDATOOLBARCLASSNAME), TranslateTS(Caption), WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,0,0,0,nHeight,hwndParent,NULL,g_hInst, (void*) szCaption);
mir_free(Caption);
return hwnd;
}
static int sttButtonPressed(MTBINFO * pMTBInfo, HWND hwndbutton)
{
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO *)GetWindowLongPtr(hwndbutton, GWLP_USERDATA);
- if (mtbi && mtbi->hWindow==hwndbutton && mtbi->hwndToolBar==pMTBInfo->hWnd)
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)GetWindowLongPtr(hwndbutton, GWLP_USERDATA);
+ if (mtbi && mtbi->hWindow == hwndbutton && mtbi->hwndToolBar == pMTBInfo->hWnd)
{
if (mtbi->szService && ServiceExists(mtbi->szService))
return CallService(mtbi->szService, 0, mtbi->lParam);
@@ -515,14 +515,14 @@ static int sttButtonPressed(MTBINFO * pMTBInfo, HWND hwndbutton) }
static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT * rect, MTBINFO * pMTBInfo)
{
- BOOL bFloat = (GetParent(hwnd)!=pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat)
{
RECT rc;
HBRUSH hbr;
if (rect)
- rc=*rect;
+ rc = *rect;
else
GetClientRect(hwnd,&rc);
@@ -534,13 +534,13 @@ static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT * rect, MTBINFO }
else
{
- hbr=GetSysColorBrush(COLOR_3DFACE);
+ hbr = GetSysColorBrush(COLOR_3DFACE);
FillRect(hdc, &rc, hbr);
}
}
else if (!tbdat.mtb_hBmpBackground && !tbdat.mtb_useWinColors)
{
- hbr=CreateSolidBrush(tbdat.mtb_bkColour);
+ hbr = CreateSolidBrush(tbdat.mtb_bkColour);
FillRect(hdc, &rc, hbr);
DeleteObject(hbr);
}
@@ -555,36 +555,36 @@ static void sttRegisterToolBarButton(char * pszButtonID, char * pszButtonName, char * pszTooltipUp, char * pszTooltipDn, int icoDefIdx, int defResource, int defResource2, BOOL bVisByDefault)
{
TBButton tbb;
- static int defPos=0;
- defPos+=100;
+ static int defPos = 0;
+ defPos += 100;
memset(&tbb,0, sizeof(TBButton));
- tbb.cbSize=sizeof(TBButton);
+ tbb.cbSize = sizeof(TBButton);
if (pszButtonID)
{
- tbb.defPos=defPos;
- tbb.pszButtonID=pszButtonID;
- tbb.pszButtonName=pszButtonName;
- tbb.pszServiceName=pszServiceName;
- tbb.pszTooltipUp=pszTooltipUp;
- tbb.pszTooltipDn=pszTooltipDn;
+ tbb.defPos = defPos;
+ tbb.pszButtonID = pszButtonID;
+ tbb.pszButtonName = pszButtonName;
+ tbb.pszServiceName = pszServiceName;
+ tbb.pszTooltipUp = pszTooltipUp;
+ tbb.pszTooltipDn = pszTooltipDn;
{
char buf[255];
mir_snprintf(buf,SIZEOF(buf),"%s%s%s",TOOLBARBUTTON_ICONIDPREFIX, pszButtonID, TOOLBARBUTTON_ICONIDPRIMARYSUFFIX);
- tbb.hPrimaryIconHandle=RegisterIcolibIconHandle( buf, "ToolBar", pszButtonName , _T("icons\\toolbar_icons.dll"),-icoDefIdx, g_hInst, defResource );
+ tbb.hPrimaryIconHandle = RegisterIcolibIconHandle( buf, "ToolBar", pszButtonName , _T("icons\\toolbar_icons.dll"),-icoDefIdx, g_hInst, defResource );
}
if (pszTooltipDn)
{
char buf[255];
mir_snprintf(buf,SIZEOF(buf),"%s%s%s",TOOLBARBUTTON_ICONIDPREFIX, pszButtonID, TOOLBARBUTTON_ICONIDSECONDARYSUFFIX);
- tbb.hSecondaryIconHandle=RegisterIcolibIconHandle( buf, "ToolBar", pszTooltipDn , _T("icons\\toolbar_icons.dll"),-(icoDefIdx+1), g_hInst, defResource2 );
+ tbb.hSecondaryIconHandle = RegisterIcolibIconHandle( buf, "ToolBar", pszTooltipDn , _T("icons\\toolbar_icons.dll"),-(icoDefIdx+1), g_hInst, defResource2 );
}
}
else
{
- if ( pszButtonName[0] == 'D' ) tbb.tbbFlags=TBBF_FLEXSIZESEPARATOR;
- else tbb.tbbFlags=TBBF_ISSEPARATOR;
+ if ( pszButtonName[0] == 'D' ) tbb.tbbFlags = TBBF_FLEXSIZESEPARATOR;
+ else tbb.tbbFlags = TBBF_ISSEPARATOR;
}
- tbb.tbbFlags|=(bVisByDefault ? TBBF_VISIBLE :0 );
+ tbb.tbbFlags |= (bVisByDefault ? TBBF_VISIBLE :0 );
CallService(MS_TB_ADDBUTTON,0, (LPARAM)&tbb);
}
@@ -602,38 +602,38 @@ static void sttAddDynamicSeparator( BOOL bVisibleByDefault ) }
static void sttGetButtonSettings(char * ID, BYTE * pbVisible, DWORD * pdwOrder, BYTE * pbPanelID)
{
- char key[255]={0};
- BYTE vis=1;
+ char key[255] = {0};
+ BYTE vis = 1;
DWORD ord;
BYTE panel;
- if (pbVisible) vis=*pbVisible;
+ if (pbVisible) vis = *pbVisible;
mir_snprintf(key, SIZEOF(key), "visible_%s", ID);
- vis=db_get_b(NULL,"ModernToolBar", key, vis);
+ vis = db_get_b(NULL,"ModernToolBar", key, vis);
mir_snprintf(key, SIZEOF(key), "order_%s", ID);
- ord=db_get_dw(NULL,"ModernToolBar", key, 0);
+ ord = db_get_dw(NULL,"ModernToolBar", key, 0);
mir_snprintf(key, SIZEOF(key), "panel_%s", ID);
- panel=db_get_b(NULL,"ModernToolBar", key, 0);
+ panel = db_get_b(NULL,"ModernToolBar", key, 0);
- if (pbVisible) *pbVisible=vis;
- if (pdwOrder) *pdwOrder=ord;
- if (pbPanelID) *pbPanelID=panel;
+ if (pbVisible) *pbVisible = vis;
+ if (pdwOrder) *pdwOrder = ord;
+ if (pbPanelID) *pbPanelID = panel;
}
static void sttReloadButtons()
{
- int i=0;
+ int i = 0;
tbcheck ;
tblock;
{
- int vis=db_get_b(NULL,"CLUI","ShowButtonBar",SETTINGS_SHOWBUTTONBAR_DEFAULT);
+ int vis = db_get_b(NULL,"CLUI","ShowButtonBar",SETTINGS_SHOWBUTTONBAR_DEFAULT);
WindowList_Broadcast(tbdat.hToolBarWindowList,MTBM_UPDATEFRAMEVISIBILITY,(WPARAM)db_get_b(NULL,"CLUI","ShowButtonBar",SETTINGS_SHOWBUTTONBAR_DEFAULT),0);
}
WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_REMOVE_ALL_BUTTONS, 0,0);
- for (i=0; i<tbdat.listOfButtons->realCount; i++)
+ for (i = 0; i < tbdat.listOfButtons->realCount; i++)
{
BYTE bVisible;
BYTE bPanel;
@@ -641,7 +641,7 @@ static void sttReloadButtons() MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)tbdat.listOfButtons->items[i];
- bVisible=mtbi->bVisible;
+ bVisible = mtbi->bVisible;
sttGetButtonSettings(mtbi->szButtonID, &bVisible, &dwOrder, &bPanel);
mtbi->nOrderValue = dwOrder ? dwOrder : mtbi->nOrderValue;
@@ -660,7 +660,7 @@ static void sttReloadButtons() static int sttDBEnumProc (const char *szSetting,LPARAM lParam)
{
- if (szSetting==NULL) return 0;
+ if (szSetting == NULL) return 0;
if (!strncmp(szSetting,"order_",6))
db_unset(NULL, "ModernToolBar", szSetting);
return 0;
@@ -668,14 +668,14 @@ static int sttDBEnumProc (const char *szSetting,LPARAM lParam) static void sttDeleteOrderSettings()
{
DBCONTACTENUMSETTINGS dbces;
- dbces.pfnEnumProc=sttDBEnumProc;
- dbces.szModule="ToolBar";
- dbces.ofsSettings=0;
+ dbces.pfnEnumProc = sttDBEnumProc;
+ dbces.szModule = "ToolBar";
+ dbces.ofsSettings = 0;
CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
}
static MTB_BUTTONINFO * ToolBar_AddButtonToBars(MTB_BUTTONINFO * mtbi)
{
- int result=0;
+ int result = 0;
if (!mtbi->bVisible) return 0;
WindowList_Broadcast(tbdat.hToolBarWindowList, MTBM_ADDBUTTON, (WPARAM)mtbi, 0);
if (mtbi->hWindow)
@@ -740,16 +740,16 @@ static void sttDrawNonLayeredSkinedBar(HWND hwnd, HDC hdc) {
HDC hdc2;
HBITMAP hbmp,hbmpo;
- RECT rc={0};
+ RECT rc = {0};
GetClientRect(hwnd,&rc);
rc.right++;
rc.bottom++;
- hdc2=CreateCompatibleDC(hdc);
- hbmp=ske_CreateDIB32(rc.right,rc.bottom);
- hbmpo=(HBITMAP)SelectObject(hdc2,hbmp);
- if (GetParent(hwnd)!=pcli->hwndContactList)
+ hdc2 = CreateCompatibleDC(hdc);
+ hbmp = ske_CreateDIB32(rc.right,rc.bottom);
+ hbmpo = (HBITMAP)SelectObject(hdc2,hbmp);
+ if (GetParent(hwnd) != pcli->hwndContactList)
{
- HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
+ HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
FillRect(hdc2,&rc,br);
}
else
@@ -767,14 +767,14 @@ static void sttDrawNonLayeredSkinedBar(HWND hwnd, HDC hdc) }
static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
- static BOOL supressRepos=FALSE;
- MTBINFO * pMTBInfo=(MTBINFO *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ static BOOL supressRepos = FALSE;
+ MTBINFO * pMTBInfo = (MTBINFO *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch (msg)
{
case WM_CREATE:
{
- HANDLE hFrame=NULL;
- CLISTFrame Frame={0};
+ HANDLE hFrame = NULL;
+ CLISTFrame Frame = {0};
CREATESTRUCT * lpcs = (CREATESTRUCT *) lParam;
//create internal info
MTBINFO * pMTBInfo = (MTBINFO *) mir_calloc( sizeof(MTBINFO));
@@ -782,26 +782,26 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM SetWindowLongPtr( hwnd, GWLP_USERDATA, (LONG_PTR) pMTBInfo );
pMTBInfo->nButtonWidth = db_get_b(NULL, "ModernToolBar", "option_Bar0_BtnWidth", SETTINGS_BARBTNWIDTH_DEFAULT);
- pMTBInfo->nButtonHeight= db_get_b(NULL, "ModernToolBar", "option_Bar0_BtnHeight", SETTINGS_BARBTNHEIGHT_DEFAULT);
+ pMTBInfo->nButtonHeight = db_get_b(NULL, "ModernToolBar", "option_Bar0_BtnHeight", SETTINGS_BARBTNHEIGHT_DEFAULT);
pMTBInfo->nButtonSpace = db_get_b(NULL, "ModernToolBar", "option_Bar0_BtnSpace", SETTINGS_BARBTNSPACE_DEFAULT);
pMTBInfo->fAutoSize = db_get_b(NULL, "ModernToolBar", "option_Bar0_Autosize", SETTINGS_BARAUTOSIZE_DEFAULT);
- pMTBInfo->fSingleLine = db_get_b(NULL, "ModernToolBar", "option_Bar0_Multiline", SETTINGS_BARMULTILINE_DEFAULT)==0;
+ pMTBInfo->fSingleLine = db_get_b(NULL, "ModernToolBar", "option_Bar0_Multiline", SETTINGS_BARMULTILINE_DEFAULT) == 0;
//register self frame
- Frame.cbSize=sizeof(CLISTFrame);
- Frame.hWnd=hwnd;
- Frame.align=alTop;
- Frame.hIcon=LoadSkinnedIcon (SKINICON_OTHER_MIRANDA);
- Frame.Flags=(db_get_b(NULL,"CLUI","ShowButtonBar",SETTINGS_SHOWBUTTONBAR_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER;
+ Frame.cbSize = sizeof(CLISTFrame);
+ Frame.hWnd = hwnd;
+ Frame.align = alTop;
+ Frame.hIcon = LoadSkinnedIcon (SKINICON_OTHER_MIRANDA);
+ Frame.Flags = (db_get_b(NULL,"CLUI","ShowButtonBar",SETTINGS_SHOWBUTTONBAR_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER;
- Frame.height=db_get_dw(NULL, "ModernToolBar", "option_Bar0_OldHeight", pMTBInfo->nButtonHeight);
- pMTBInfo->wLastHeight=Frame.height;
+ Frame.height = db_get_dw(NULL, "ModernToolBar", "option_Bar0_OldHeight", pMTBInfo->nButtonHeight);
+ pMTBInfo->wLastHeight = Frame.height;
pMTBInfo->nLineCount = 1;
- pMTBInfo->pButtonList=List_Create(0,1);
+ pMTBInfo->pButtonList = List_Create(0,1);
- Frame.name=(char*) lpcs->lpCreateParams;
- hFrame=(HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,(LPARAM)0);
+ Frame.name = (char*) lpcs->lpCreateParams;
+ hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&Frame,(LPARAM)0);
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)ToolBar_LayeredPaintProc); //$$$$$ register sub for frame
pMTBInfo->hFrame = hFrame;
pMTBInfo->hWnd = hwnd;
@@ -810,7 +810,7 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM //add self to window list
WindowList_Add(tbdat.hToolBarWindowList, hwnd, NULL);
- pMTBInfo->mtbXPTheme=xpt_AddThemeHandle(hwnd,L"TOOLBAR");
+ pMTBInfo->mtbXPTheme = xpt_AddThemeHandle(hwnd,L"TOOLBAR");
ToolBar_DefaultButtonRegistration();
//SetTimer(hwnd,123,1000,NULL);
return 0;
@@ -827,11 +827,11 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM {
int res;
int ID;
- ID= Sync( FindFrameID, hwnd );
+ ID = Sync( FindFrameID, hwnd );
if (ID)
{
- res=CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,ID),0);
- if (res>=0) db_set_b(0,"CLUI","ShowButtonBar",(BYTE)(wParam/*(res&F_VISIBLE)*/?1:0));
+ res = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,ID),0);
+ if (res >= 0) db_set_b(0,"CLUI","ShowButtonBar",(BYTE)(wParam/*(res&F_VISIBLE)*/?1:0));
if (wParam) SendMessage(hwnd, MTBM_REPOSBUTTONS, 0, 0);
}
}
@@ -839,37 +839,37 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM }
case MTBM_UPDATEFRAMEVISIBILITY:
{
- BOOL vis=(BOOL)wParam;
+ BOOL vis = (BOOL)wParam;
INT_PTR frameopt;
- BOOL curvis=IsWindowVisible(hwnd);
- BOOL bResize=FALSE;
- int frameID=Sync( FindFrameID, hwnd );
+ BOOL curvis = IsWindowVisible(hwnd);
+ BOOL bResize = FALSE;
+ int frameID = Sync( FindFrameID, hwnd );
int Height;
pMTBInfo->nButtonWidth = db_get_b(NULL, "ModernToolBar", "option_Bar0_BtnWidth", SETTINGS_BARBTNWIDTH_DEFAULT);
- pMTBInfo->nButtonHeight= db_get_b(NULL, "ModernToolBar", "option_Bar0_BtnHeight", SETTINGS_BARBTNHEIGHT_DEFAULT);
+ pMTBInfo->nButtonHeight = db_get_b(NULL, "ModernToolBar", "option_Bar0_BtnHeight", SETTINGS_BARBTNHEIGHT_DEFAULT);
pMTBInfo->nButtonSpace = db_get_b(NULL, "ModernToolBar", "option_Bar0_BtnSpace", SETTINGS_BARBTNSPACE_DEFAULT);
pMTBInfo->fAutoSize = db_get_b(NULL, "ModernToolBar", "option_Bar0_Autosize", SETTINGS_BARAUTOSIZE_DEFAULT);
- pMTBInfo->fSingleLine = db_get_b(NULL, "ModernToolBar", "option_Bar0_Multiline", SETTINGS_BARMULTILINE_DEFAULT)==0;
+ pMTBInfo->fSingleLine = db_get_b(NULL, "ModernToolBar", "option_Bar0_Multiline", SETTINGS_BARMULTILINE_DEFAULT) == 0;
- Height=sttReposButtons( pMTBInfo );
+ Height = sttReposButtons( pMTBInfo );
if (pMTBInfo->fAutoSize)
{
- frameopt=CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT,frameID),0);
- if (Height!=frameopt)
+ frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_HEIGHT,frameID),0);
+ if (Height != frameopt)
{
- frameopt=Height;
+ frameopt = Height;
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_HEIGHT,frameID),frameopt);
- bResize=TRUE;
+ bResize = TRUE;
}
}
- if ((curvis!=vis || bResize) && vis !=-1)
+ if ((curvis != vis || bResize) && vis !=-1)
{
- frameopt=CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,frameID),0);
- frameopt&=~F_VISIBLE;
- frameopt|=vis ? F_VISIBLE : 0;
+ frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS,frameID),0);
+ frameopt &= ~F_VISIBLE;
+ frameopt |= vis ? F_VISIBLE : 0;
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,frameID),frameopt);
}
break;
@@ -887,25 +887,25 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM }
case WM_COMMAND:
{
- if (HIWORD(wParam)==BN_CLICKED && lParam!=0 )
+ if (HIWORD(wParam) == BN_CLICKED && lParam != 0 )
sttButtonPressed(pMTBInfo, (HWND) lParam );
return TRUE;
}
case MTBM_ADDBUTTON:
{
//Adding button
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO * )wParam;
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO * )wParam;
HWND hwndButton = NULL;
if (!(mtbi->bSeparator))
- hwndButton= CreateWindow(SKINBUTTONCLASS /*MIRANDABUTTONCLASS*/, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP , 0, 0, pMTBInfo->nButtonWidth, pMTBInfo->nButtonHeight,
+ 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;
- mtbi->hwndToolBar=hwnd;
+ mtbi->hWindow = hwndButton;
+ mtbi->hwndToolBar = hwnd;
List_Insert(pMTBInfo->pButtonList, mtbi, pMTBInfo->pButtonList->realCount); //just insert pointer. such object are managed in global tbbutton list
if (hwndButton)
{
- char * buttonId=(char *)_alloca(sizeof("ToolBar.")+strlen(mtbi->szButtonID)+2);
+ char * buttonId = (char *)_alloca(sizeof("ToolBar.")+strlen(mtbi->szButtonID)+2);
strcpy(buttonId,"ToolBar.");
strcat(buttonId,mtbi->szButtonID);
SendMessage(hwndButton, BUTTONSETID, 0 ,(LPARAM) buttonId );
@@ -920,10 +920,10 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case MTBM_REMOVE_ALL_BUTTONS:
{
int i;
- for (i=0; i<pMTBInfo->pButtonList->realCount; i++ )
+ for (i = 0; i < pMTBInfo->pButtonList->realCount; i++ )
{
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO *)pMTBInfo->pButtonList->items[i];
- if (mtbi->hWindow && mtbi->hwndToolBar==hwnd)
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)pMTBInfo->pButtonList->items[i];
+ if (mtbi->hWindow && mtbi->hwndToolBar == hwnd)
{
DestroyWindow(mtbi->hWindow);
mtbi->hWindow = NULL;
@@ -932,18 +932,18 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM }
List_Destroy( pMTBInfo->pButtonList );
mir_free( pMTBInfo->pButtonList );
- pMTBInfo->pButtonList=List_Create(0,1);
+ pMTBInfo->pButtonList = List_Create(0,1);
break;
}
case WM_SIZE:
- if (pMTBInfo->wLastHeight!=HIWORD(lParam))
+ if (pMTBInfo->wLastHeight != HIWORD(lParam))
{
db_set_dw(NULL, "ModernToolBar", "option_Bar0_OldHeight", HIWORD(lParam));
- pMTBInfo->wLastHeight=HIWORD(lParam);
+ pMTBInfo->wLastHeight = HIWORD(lParam);
}
if (supressRepos)
{
- supressRepos=FALSE;
+ supressRepos = FALSE;
break;
}
//fall through
@@ -951,14 +951,14 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM {
if (pMTBInfo && pMTBInfo->hWnd == hwnd)
{
- int Height=sttReposButtons(pMTBInfo);
+ int Height = sttReposButtons(pMTBInfo);
if ( pMTBInfo->fAutoSize)
{
RECT rcClient;
GetClientRect(pMTBInfo->hWnd, &rcClient);
- if (rcClient.bottom-rcClient.top != Height && Height)
+ if (rcClient.bottom-rcClient.top !=Height && Height)
{
- supressRepos=TRUE;
+ supressRepos = TRUE;
PostMessage(pMTBInfo->hWnd,MTBM_UPDATEFRAMEVISIBILITY, -1, 0);
}
}
@@ -976,9 +976,9 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case WM_NCPAINT:
case WM_PAINT:
{
- BOOL ret=FALSE;
+ BOOL ret = FALSE;
PAINTSTRUCT ps;
- BOOL bFloat = (GetParent(hwnd)!=pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
if (g_CluiData.fDisableSkinEngine|| !g_CluiData.fLayered || bFloat )
{
BeginPaint(hwnd,&ps);
@@ -987,7 +987,7 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM sttDrawNonLayeredSkinedBar(hwnd, ps.hdc);
}
else
- ret=sttDrawToolBarBackground(hwnd, ps.hdc, &ps.rcPaint, pMTBInfo);
+ ret = sttDrawToolBarBackground(hwnd, ps.hdc, &ps.rcPaint, pMTBInfo);
EndPaint(hwnd,&ps);
}
@@ -995,29 +995,29 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM }
case WM_NOTIFY:
{
- if (((LPNMHDR) lParam)->code==BUTTONNEEDREDRAW)
+ if (((LPNMHDR) lParam)->code == BUTTONNEEDREDRAW)
pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
return 0;
}
case MTBM_LAYEREDPAINT:
{
int i;
- RECT MyRect={0};
- HDC hDC=(HDC)wParam;
+ RECT MyRect = {0};
+ HDC hDC = (HDC)wParam;
GetWindowRect(hwnd,&MyRect);
{
RECT rcClient;
GetClientRect(hwnd, &rcClient);
- SkinDrawGlyph(hDC,&rcClient,&rcClient,"Bar,ID=ToolBar,Part=Background");
+ SkinDrawGlyph(hDC,&rcClient,&rcClient,"Bar,ID = ToolBar,Part = Background");
}
- for (i=0; i<pMTBInfo->pButtonList->realCount; i++)
+ for (i = 0; i < pMTBInfo->pButtonList->realCount; i++)
{
RECT childRect;
POINT Offset;
- MTB_BUTTONINFO * mtbi=(MTB_BUTTONINFO *)pMTBInfo->pButtonList->items[i];
+ MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO *)pMTBInfo->pButtonList->items[i];
GetWindowRect(mtbi->hWindow,&childRect);
- Offset.x=childRect.left-MyRect.left;;
- Offset.y=childRect.top-MyRect.top;
+ Offset.x = childRect.left-MyRect.left;;
+ Offset.y = childRect.top-MyRect.top;
SendMessage(mtbi->hWindow, BUTTONDRAWINPARENT, (WPARAM)hDC,(LPARAM)&Offset);
}
return 0;
@@ -1025,16 +1025,16 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case MTBM_SETBUTTONSTATEBYID:
case MTBM_SETBUTTONSTATE:
{
- char * hButtonId=(msg==MTBM_SETBUTTONSTATEBYID) ? (char *) wParam : NULL;
- void * hButton=(msg==MTBM_SETBUTTONSTATE) ? (void *)wParam : NULL;
- MTB_BUTTONINFO *mtbi=NULL;
+ char * hButtonId = (msg == MTBM_SETBUTTONSTATEBYID) ? (char *) wParam : NULL;
+ void * hButton = (msg == MTBM_SETBUTTONSTATE) ? (void *)wParam : NULL;
+ MTB_BUTTONINFO *mtbi = NULL;
int i;
- for (i=0; i<pMTBInfo->pButtonList->realCount; i++)
+ for (i = 0; i < pMTBInfo->pButtonList->realCount; i++)
{
- mtbi=(MTB_BUTTONINFO*)pMTBInfo->pButtonList->items[i];
+ mtbi = (MTB_BUTTONINFO*)pMTBInfo->pButtonList->items[i];
if ((hButtonId && !strcmp(mtbi->szButtonID, hButtonId)) || (hButton == mtbi))
{
- mtbi->bPushButton=(BOOL)lParam;
+ mtbi->bPushButton = (BOOL)lParam;
sttUpdateButtonState(mtbi);
pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
break;
@@ -1045,18 +1045,18 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case MTBM_GETBUTTONSTATEBYID:
case MTBM_GETBUTTONSTATE:
{
- int * res= (int*)lParam;
- if (res==NULL) break;
- char * hButtonId=(msg==MTBM_GETBUTTONSTATEBYID) ? (char *) wParam : NULL;
- void * hButton=(msg==MTBM_GETBUTTONSTATE) ? (void *)wParam : NULL;
- MTB_BUTTONINFO *mtbi=NULL;
+ int * res = (int*)lParam;
+ if (res == NULL) break;
+ char * hButtonId = (msg == MTBM_GETBUTTONSTATEBYID) ? (char *) wParam : NULL;
+ void * hButton = (msg == MTBM_GETBUTTONSTATE) ? (void *)wParam : NULL;
+ MTB_BUTTONINFO *mtbi = NULL;
int i;
- for (i=0; i<pMTBInfo->pButtonList->realCount; i++)
+ for (i = 0; i < pMTBInfo->pButtonList->realCount; i++)
{
- mtbi=(MTB_BUTTONINFO*)pMTBInfo->pButtonList->items[i];
+ mtbi = (MTB_BUTTONINFO*)pMTBInfo->pButtonList->items[i];
if ((hButtonId && !strcmp(mtbi->szButtonID, hButtonId)) || (hButton == mtbi))
{
- *res=0;
+ *res = 0;
*res |= mtbi->bPushButton ? TBST_PUSHED : TBST_RELEASED;
break;
}
@@ -1066,22 +1066,22 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM case MTBM_REMOVEBUTTON:
{
- MTB_BUTTONINFO *mtbi=NULL;
- for (int i=0; i<pMTBInfo->pButtonList->realCount; i++)
+ MTB_BUTTONINFO *mtbi = NULL;
+ for (int i = 0; i < pMTBInfo->pButtonList->realCount; i++)
{
- mtbi=(MTB_BUTTONINFO*)pMTBInfo->pButtonList->items[i];
- if (mtbi==(MTB_BUTTONINFO*)wParam)
+ mtbi = (MTB_BUTTONINFO*)pMTBInfo->pButtonList->items[i];
+ if (mtbi == (MTB_BUTTONINFO*)wParam)
{
List_Remove(pMTBInfo->pButtonList,i);
- for (int j=0; j<tbdat.listOfButtons->realCount; j++)
- if (mtbi==(MTB_BUTTONINFO*)tbdat.listOfButtons->items[j])
+ for (int j = 0; j < tbdat.listOfButtons->realCount; j++)
+ if (mtbi == (MTB_BUTTONINFO*)tbdat.listOfButtons->items[j])
{
List_Remove(tbdat.listOfButtons,j);
break;
}
List_RemovePtr(tbdat.listOfButtons,mtbi);
delete_MTB_BUTTONINFO((void*)mtbi);
- mtbi=NULL;
+ mtbi = NULL;
pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
break;
}
@@ -1093,15 +1093,15 @@ static LRESULT CALLBACK ToolBar_WndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM }
return TRUE;
}
-static int ControlIDS[]={IDC_TEXT_W, IDC_SPIN_W, IDC_STATIC_W, IDC_TEXT_H,
+static int ControlIDS[] = {IDC_TEXT_W, IDC_SPIN_W, IDC_STATIC_W, IDC_TEXT_H,
IDC_SPIN_H, IDC_STATIC_H,IDC_TEXT_S, IDC_SPIN_S,
IDC_STATIC_S, IDC_BTNORDER, IDC_CHECK_MULTILINE, IDC_CHECK_AUTOSIZE };
static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
{
- static HIMAGELIST himlButtonIcons=NULL;
- static BOOL dragging=FALSE;
- static HANDLE hDragItem=NULL;
+ static HIMAGELIST himlButtonIcons = NULL;
+ static BOOL dragging = FALSE;
+ static HANDLE hDragItem = NULL;
switch (msg)
{
case WM_DESTROY:
@@ -1109,11 +1109,11 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L break;
case WM_INITDIALOG:
{
- HWND hTree=GetDlgItem(hwndDlg,IDC_BTNORDER);
+ HWND hTree = GetDlgItem(hwndDlg,IDC_BTNORDER);
TranslateDialogDefault(hwndDlg);
SetWindowLongPtr(hTree,GWL_STYLE,GetWindowLongPtr(hTree,GWL_STYLE)|TVS_NOHSCROLL);
{
- himlButtonIcons=ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
+ himlButtonIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,2,2);
TreeView_SetImageList(hTree,himlButtonIcons,TVSIL_NORMAL);
}
TreeView_DeleteAllItems(hTree);
@@ -1121,23 +1121,23 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L qsort(tbdat.listOfButtons->items,tbdat.listOfButtons->realCount,sizeof(MTB_BUTTONINFO *),sttSortButtons);
{
- int i=0;
- for (i=0; i<tbdat.listOfButtons->realCount; i++)
+ int i = 0;
+ for (i = 0; i < tbdat.listOfButtons->realCount; i++)
{
- TVINSERTSTRUCT tvis={0};
+ TVINSERTSTRUCT tvis = {0};
HTREEITEM hti;
MTB_BUTTONINFO * mtbi = (MTB_BUTTONINFO*) tbdat.listOfButtons->items[i];
- TCHAR * szTempName=mir_a2t(mtbi->szButtonName);
+ TCHAR * szTempName = mir_a2t(mtbi->szButtonName);
HICON hIcon = (HICON)CallService(MS_SKIN2_GETICONBYHANDLE, 0, (LPARAM)mtbi->hPrimaryIconHandle);
int index = ImageList_AddIcon(himlButtonIcons, hIcon);
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- tvis.hParent=NULL;
- tvis.hInsertAfter=TVI_LAST;
- tvis.item.mask=TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_STATE;
- tvis.item.lParam=(LPARAM)(mtbi);
- tvis.item.pszText=TranslateTS(szTempName);
- tvis.item.iImage=tvis.item.iSelectedImage=index;
- hti=TreeView_InsertItem(hTree,&tvis);
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_STATE;
+ tvis.item.lParam = (LPARAM)(mtbi);
+ tvis.item.pszText = TranslateTS(szTempName);
+ tvis.item.iImage = tvis.item.iSelectedImage = index;
+ hti = TreeView_InsertItem(hTree,&tvis);
TreeView_SetCheckState(hTree, hti, mtbi->bVisible );
mir_free(szTempName);
}
@@ -1159,8 +1159,8 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L CheckDlgButton(hwndDlg, IDC_TBSHOW, db_get_b(NULL,"CLUI","ShowButtonBar",SETTINGS_SHOWBUTTONBAR_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
{
int i;
- BOOL en=IsDlgButtonChecked(hwndDlg,IDC_TBSHOW);
- for (i=0; i<SIZEOF(ControlIDS); i++)
+ BOOL en = IsDlgButtonChecked(hwndDlg,IDC_TBSHOW);
+ for (i = 0; i < SIZEOF(ControlIDS); i++)
EnableWindow(GetDlgItem(hwndDlg,ControlIDS[i]), en);
}
return TRUE;
@@ -1176,31 +1176,31 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L {
case PSN_APPLY:
{
- int order=100;
- HWND hTree=GetDlgItem(hwndDlg,IDC_BTNORDER);
- int count=TreeView_GetCount(hTree);
+ int order = 100;
+ HWND hTree = GetDlgItem(hwndDlg,IDC_BTNORDER);
+ int count = TreeView_GetCount(hTree);
HTREEITEM hItem;
sttDeleteOrderSettings();
- hItem=TreeView_GetRoot(hTree);
+ hItem = TreeView_GetRoot(hTree);
do
{
- TVITEM tvi={0};
+ TVITEM tvi = {0};
MTB_BUTTONINFO *mtbi;
- tvi.mask=TBIF_LPARAM|TVIF_HANDLE;
- tvi.hItem=hItem;
+ tvi.mask = TBIF_LPARAM|TVIF_HANDLE;
+ tvi.hItem = hItem;
TreeView_GetItem(hTree, &tvi);
- mtbi=(MTB_BUTTONINFO *)tvi.lParam;
+ mtbi = (MTB_BUTTONINFO *)tvi.lParam;
if (mtbi)
{
char szTempSetting[200];
mir_snprintf(szTempSetting, SIZEOF(szTempSetting), "order_%s", mtbi->szButtonID);
db_set_dw(NULL, "ModernToolBar", szTempSetting, order);
- order+=10;
+ order += 10;
mir_snprintf(szTempSetting, SIZEOF(szTempSetting), "visible_%s", mtbi->szButtonID);
db_set_b(NULL, "ModernToolBar", szTempSetting, TreeView_GetCheckState(hTree,hItem));
}
- hItem=TreeView_GetNextSibling(hTree,hItem);
- } while (hItem!=NULL);
+ hItem = TreeView_GetNextSibling(hTree,hItem);
+ } while (hItem != NULL);
db_set_b(NULL,"CLUI","ShowButtonBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TBSHOW));
db_set_b(NULL,"ModernToolBar","option_Bar0_BtnWidth", (BYTE)SendDlgItemMessage(hwndDlg,IDC_SPIN_W,UDM_GETPOS,0,0));
db_set_b(NULL,"ModernToolBar","option_Bar0_BtnHeight",(BYTE)SendDlgItemMessage(hwndDlg,IDC_SPIN_H,UDM_GETPOS,0,0));
@@ -1221,18 +1221,18 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L case TVN_BEGINDRAGA:
case TVN_BEGINDRAGW:
SetCapture(hwndDlg);
- dragging=TRUE;
- hDragItem=((LPNMTREEVIEWA)lParam)->itemNew.hItem;
+ dragging = TRUE;
+ hDragItem = ((LPNMTREEVIEWA)lParam)->itemNew.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_BTNORDER),hDragItem);
break;
case NM_CLICK:
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(GetMessagePos());
- hti.pt.y=(short)HIWORD(GetMessagePos());
+ hti.pt.x = (short)LOWORD(GetMessagePos());
+ hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom,&hti.pt);
- if(TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
- if(hti.flags&TVHT_ONITEMSTATEICON)
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom,&hti))
+ if (hti.flags&TVHT_ONITEMSTATEICON)
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
};
}
@@ -1246,15 +1246,15 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L if (!dragging) break;
{
TVHITTESTINFO hti;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg,&hti.pt);
ScreenToClient(GetDlgItem(hwndDlg,IDC_BTNORDER),&hti.pt);
TreeView_HitTest(GetDlgItem(hwndDlg,IDC_BTNORDER),&hti);
- if(hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT))
+ if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT))
{
- HTREEITEM it=hti.hItem;
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_BTNORDER))/2;
+ 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))
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_BTNORDER),hti.hItem,1);
@@ -1263,8 +1263,8 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L }
else
{
- if(hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_BTNORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEUP,0),0);
- if(hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg,IDC_BTNORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEDOWN,0),0);
+ if (hti.flags&TVHT_ABOVE) SendDlgItemMessage(hwndDlg,IDC_BTNORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEUP,0),0);
+ if (hti.flags&TVHT_BELOW) SendDlgItemMessage(hwndDlg,IDC_BTNORDER,WM_VSCROLL,MAKEWPARAM(SB_LINEDOWN,0),0);
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_BTNORDER),NULL,0);
}
}
@@ -1274,36 +1274,36 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L {
if (!dragging) break;
TreeView_SetInsertMark(GetDlgItem(hwndDlg,IDC_BTNORDER),NULL,0);
- dragging=0;
+ dragging = 0;
ReleaseCapture();
{
TVHITTESTINFO hti;
TVITEM tvi;
- hti.pt.x=(short)LOWORD(lParam);
- hti.pt.y=(short)HIWORD(lParam);
+ hti.pt.x = (short)LOWORD(lParam);
+ hti.pt.y = (short)HIWORD(lParam);
ClientToScreen(hwndDlg,&hti.pt);
ScreenToClient(GetDlgItem(hwndDlg,IDC_BTNORDER),&hti.pt);
- hti.pt.y-=TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_BTNORDER))/2;
+ hti.pt.y -= TreeView_GetItemHeight(GetDlgItem(hwndDlg,IDC_BTNORDER))/2;
TreeView_HitTest(GetDlgItem(hwndDlg,IDC_BTNORDER),&hti);
- if(hDragItem==hti.hItem) break;
- if (hti.flags&TVHT_ABOVE) hti.hItem=TVI_FIRST;
- tvi.mask=TVIF_HANDLE|TVIF_PARAM;
- tvi.hItem=(HTREEITEM)hDragItem;
+ if (hDragItem == hti.hItem) break;
+ if (hti.flags&TVHT_ABOVE) hti.hItem = TVI_FIRST;
+ tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.hItem = (HTREEITEM)hDragItem;
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_BTNORDER),&tvi);
- if(hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)||(hti.hItem==TVI_FIRST))
+ if (hti.flags&(TVHT_ONITEM|TVHT_ONITEMRIGHT)||(hti.hItem == TVI_FIRST))
{
TVINSERTSTRUCT tvis;
TCHAR name[128];
- tvis.item.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_STATE;
- tvis.item.stateMask=0xFFFFFFFF;
- tvis.item.pszText=name;
- tvis.item.cchTextMax=sizeof(name);
- tvis.item.hItem=(HTREEITEM)hDragItem;
- //tvis.item.iImage=tvis.item.iSelectedImage=((MTB_BUTTONINFO *)tvi.lParam)->bVisible;
+ tvis.item.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE|TVIF_STATE;
+ tvis.item.stateMask = 0xFFFFFFFF;
+ tvis.item.pszText = name;
+ tvis.item.cchTextMax = sizeof(name);
+ tvis.item.hItem = (HTREEITEM)hDragItem;
+ //tvis.item.iImage = tvis.item.iSelectedImage = ((MTB_BUTTONINFO *)tvi.lParam)->bVisible;
TreeView_GetItem(GetDlgItem(hwndDlg,IDC_BTNORDER),&tvis.item);
TreeView_DeleteItem(GetDlgItem(hwndDlg,IDC_BTNORDER),hDragItem);
- tvis.hParent=NULL;
- tvis.hInsertAfter=hti.hItem;
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = hti.hItem;
TreeView_SelectItem(GetDlgItem(hwndDlg,IDC_BTNORDER),TreeView_InsertItem(GetDlgItem(hwndDlg,IDC_BTNORDER),&tvis));
SendMessage((GetParent(hwndDlg)), PSM_CHANGED, (WPARAM)hwndDlg, 0);
}
@@ -1311,18 +1311,18 @@ static LRESULT CALLBACK ToolBar_OptDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,L }
break;
case WM_COMMAND:
- if (LOWORD(wParam)==IDC_TBSHOW) {
+ if (LOWORD(wParam) == IDC_TBSHOW) {
{
int i;
- BOOL en=IsDlgButtonChecked(hwndDlg,IDC_TBSHOW);
- for (i=0; i<SIZEOF(ControlIDS); i++)
+ BOOL en = IsDlgButtonChecked(hwndDlg,IDC_TBSHOW);
+ for (i = 0; i < SIZEOF(ControlIDS); i++)
EnableWindow(GetDlgItem(hwndDlg,ControlIDS[i]), en);
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- } else if ( (LOWORD(wParam)==IDC_TEXT_W ||
- LOWORD(wParam)==IDC_TEXT_H ||
- LOWORD(wParam)==IDC_TEXT_S )
- && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()) return 0; // dont make apply enabled during buddy set crap
+ } else if ( (LOWORD(wParam) == IDC_TEXT_W ||
+ LOWORD(wParam) == IDC_TEXT_H ||
+ LOWORD(wParam) == IDC_TEXT_S )
+ && 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;
}
diff --git a/plugins/Clist_modern/modern_viewmodebar.cpp b/plugins/Clist_modern/modern_viewmodebar.cpp index d47059d560..0895e45636 100644 --- a/plugins/Clist_modern/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/modern_viewmodebar.cpp @@ -64,23 +64,23 @@ static int DrawViewModeBar(HWND hWnd, HDC hDC) {
RECT rc;
GetClientRect(hWnd, &rc);
- SkinDrawGlyph(hDC,&rc,&rc,"ViewMode,ID=Background");
+ SkinDrawGlyph(hDC,&rc,&rc,"ViewMode,ID = Background");
return 0;
}
static int ViewModePaintCallbackProc(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData)
{
int i;
- RECT MyRect={0};
+ RECT MyRect = {0};
GetWindowRect(hWnd,&MyRect);
DrawViewModeBar(hWnd,hDC);
- for (i=0; _buttons[i]!=0; i++)
+ for (i = 0; _buttons[i] != 0; i++)
{
RECT childRect;
POINT Offset;
GetWindowRect(GetDlgItem(hWnd, _buttons[i]),&childRect);
- Offset.x=childRect.left-MyRect.left;;
- Offset.y=childRect.top-MyRect.top;
+ Offset.x = childRect.left-MyRect.left;;
+ Offset.y = childRect.top-MyRect.top;
SendMessage(GetDlgItem(hWnd, _buttons[i]),BUTTONDRAWINPARENT,(WPARAM)hDC,(LPARAM)&Offset);
}
@@ -95,132 +95,121 @@ static int ViewModePaintCallbackProc(HWND hWnd, HDC hDC, RECT * rcPaint, HRGN rg int CLVM_EnumProc(const char *szSetting, LPARAM lParam)
{
pfnEnumCallback EnumCallback = (pfnEnumCallback)lParam;
- if (szSetting != NULL)
+ if (szSetting !=NULL)
EnumCallback((char *)szSetting);
return(0);
}
void CLVM_EnumModes(pfnEnumCallback EnumCallback)
{
- DBCONTACTENUMSETTINGS dbces;
-
- dbces.pfnEnumProc = CLVM_EnumProc;
- dbces.szModule = CLVM_MODULE;
- dbces.ofsSettings=0;
- dbces.lParam = (LPARAM)EnumCallback;
- CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
+ DBCONTACTENUMSETTINGS dbces;
+ dbces.pfnEnumProc = CLVM_EnumProc;
+ dbces.szModule = CLVM_MODULE;
+ dbces.ofsSettings = 0;
+ dbces.lParam = (LPARAM)EnumCallback;
+ CallService(MS_DB_CONTACT_ENUMSETTINGS,0,(LPARAM)&dbces);
}
int FillModes(char *szsetting)
{
- if(szsetting[0] == (char)246)
- return 1;
- if(szsetting[0] == (char)13)
- return 1;
+ if (szsetting[0] == (char)246)
+ return 1;
+ if (szsetting[0] == (char)13)
+ return 1;
- {
- TCHAR * temp;
- //temp=alloca((strlen(szSetting)+1)*sizeof(TCHAR));
- mir_utf8decode(szsetting,&temp);
- if(temp)
- {
- SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)temp);
- mir_free(temp);
- }
+ TCHAR * temp;
+ mir_utf8decode(szsetting,&temp);
+ if (temp) {
+ SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)temp);
+ mir_free(temp);
}
+
return 1;
}
static void ShowPage(HWND hwnd, int page)
{
- int i = 0;
- int pageChange = 0;
-
- if(page == 0 && IsWindowVisible(GetDlgItem(hwnd, _page2Controls[0])))
- pageChange = 1;
-
- if(page == 1 && IsWindowVisible(GetDlgItem(hwnd, _page1Controls[0])))
- pageChange = 1;
-
- if(pageChange)
- SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
-
- switch(page) {
- case 0:
- while(_page1Controls[i] != 0)
- ShowWindow(GetDlgItem(hwnd, _page1Controls[i++]), SW_SHOW);
- i = 0;
- while(_page2Controls[i] != 0)
- ShowWindow(GetDlgItem(hwnd, _page2Controls[i++]), SW_HIDE);
- break;
- case 1:
- while(_page1Controls[i] != 0)
- ShowWindow(GetDlgItem(hwnd, _page1Controls[i++]), SW_HIDE);
- i = 0;
- while(_page2Controls[i] != 0)
- ShowWindow(GetDlgItem(hwnd, _page2Controls[i++]), SW_SHOW);
- break;
- }
- if(pageChange) {
- SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
- RedrawWindow(hwnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
- }
+ int i = 0;
+ int pageChange = 0;
+
+ if (page == 0 && IsWindowVisible(GetDlgItem(hwnd, _page2Controls[0])))
+ pageChange = 1;
+
+ if (page == 1 && IsWindowVisible(GetDlgItem(hwnd, _page1Controls[0])))
+ pageChange = 1;
+
+ if (pageChange)
+ SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
+
+ switch(page) {
+ case 0:
+ while(_page1Controls[i] !=0)
+ ShowWindow(GetDlgItem(hwnd, _page1Controls[i++]), SW_SHOW);
+ i = 0;
+ while(_page2Controls[i] !=0)
+ ShowWindow(GetDlgItem(hwnd, _page2Controls[i++]), SW_HIDE);
+ break;
+ case 1:
+ while(_page1Controls[i] !=0)
+ ShowWindow(GetDlgItem(hwnd, _page1Controls[i++]), SW_HIDE);
+ i = 0;
+ while(_page2Controls[i] !=0)
+ ShowWindow(GetDlgItem(hwnd, _page2Controls[i++]), SW_SHOW);
+ break;
+ }
+ if (pageChange) {
+ SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
+ RedrawWindow(hwnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
+ }
}
static int UpdateClistItem(HANDLE hContact, DWORD mask)
{
- int i;
-
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hContact, MAKELONG(i - ID_STATUS_OFFLINE,
- (1 << (i - ID_STATUS_OFFLINE)) & mask ? i - ID_STATUS_OFFLINE : nullImage));
+ for(int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hContact, MAKELONG(i - ID_STATUS_OFFLINE,
+ (1 << (i - ID_STATUS_OFFLINE)) & mask ? i - ID_STATUS_OFFLINE : nullImage));
- return 0;
+ return 0;
}
static DWORD GetMaskForItem(HANDLE hItem)
{
- int i;
- DWORD dwMask = 0;
-
- for(i = 0; i <= ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE; i++)
- dwMask |= (SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == nullImage ? 0 : 1 << i);
+ DWORD dwMask = 0;
- return dwMask;
+ for(int i = 0; i <= ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE; i++)
+ dwMask |= (SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, i) == nullImage ? 0 : 1 << i);
+
+ return dwMask;
}
static void UpdateStickies()
{
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- HANDLE hItem;
- DWORD localMask;
- int i;
-
- while(hContact)
+ DWORD localMask;
+ int i;
+ HANDLE hItem;
+
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while(hContact)
{
- hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
- if(hItem)
- SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, (BYTE)db_get_dw(hContact, CLVM_MODULE, g_szModename, 0) ? 1 : 0);
- localMask = HIWORD(db_get_dw(hContact, CLVM_MODULE, g_szModename, 0));
- UpdateClistItem(hItem, (localMask == 0 || localMask == stickyStatusMask) ? stickyStatusMask : localMask);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
- }
-
- {
- HANDLE hItem;
-
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hInfoItem, MAKELONG(i - ID_STATUS_OFFLINE, (1 << (i - ID_STATUS_OFFLINE)) & stickyStatusMask ? i - ID_STATUS_OFFLINE : ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1));
-
- hItem=(HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETNEXTITEM,CLGN_ROOT,0);
- hItem=(HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST,CLM_GETNEXTITEM,CLGN_NEXTGROUP, (LPARAM)hItem);
- while(hItem) {
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELONG(i - ID_STATUS_OFFLINE, nullImage));
- hItem=(HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
- }
- ShowPage(clvmHwnd, 0);
- }
+ hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ if (hItem)
+ SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, (BYTE)db_get_dw(hContact, CLVM_MODULE, g_szModename, 0) ? 1 : 0);
+ localMask = HIWORD(db_get_dw(hContact, CLVM_MODULE, g_szModename, 0));
+ UpdateClistItem(hItem, (localMask == 0 || localMask == stickyStatusMask) ? stickyStatusMask : localMask);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ }
+
+ for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hInfoItem, MAKELONG(i - ID_STATUS_OFFLINE, (1 << (i - ID_STATUS_OFFLINE)) & stickyStatusMask ? i - ID_STATUS_OFFLINE : ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1));
+
+ hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETNEXTITEM,CLGN_ROOT,0);
+ hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST,CLM_GETNEXTITEM,CLGN_NEXTGROUP, (LPARAM)hItem);
+ while(hItem) {
+ for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELONG(i - ID_STATUS_OFFLINE, nullImage));
+ hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
+ }
+ ShowPage(clvmHwnd, 0);
}
static int FillDialog(HWND hwnd)
@@ -273,7 +262,7 @@ static int FillDialog(HWND hwnd) for(i = 0;;i++)
{
mir_snprintf(buf, 20, "%d", i);
- if(DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv))
+ if (DBGetContactSettingTString(NULL, "CListGroups", buf, &dbv))
break;
item.pszText = &dbv.ptszVal[1];
@@ -321,24 +310,24 @@ static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iIm int typeOfFirst,iOldIcon;
HANDLE hItem,hChildItem;
- typeOfFirst=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
+ typeOfFirst = SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hFirstItem,0);
//check groups
- if(typeOfFirst==CLCIT_GROUP) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_GROUP) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hFirstItem);
while(hItem)
{
- hChildItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
- if(hChildItem)
+ hChildItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
+ if (hChildItem)
SetAllChildIcons(hwndList,hChildItem,iColumn,iImage);
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
+ hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTGROUP,(LPARAM)hItem);
}
//check contacts
- if(typeOfFirst==CLCIT_CONTACT) hItem=hFirstItem;
- else hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
+ if (typeOfFirst == CLCIT_CONTACT) hItem = hFirstItem;
+ else hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hFirstItem);
while(hItem) {
- iOldIcon=SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if(iOldIcon!=0xFF && iOldIcon!=iImage) SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
+ iOldIcon = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
+ if (iOldIcon != 0xFF && iOldIcon != iImage) SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
+ hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
}
}
@@ -346,27 +335,27 @@ static void SetIconsForColumn(HWND hwndList,HANDLE hItem,HANDLE hItemAll,int iCo {
int itemType;
- itemType=SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hItem,0);
- if(itemType==CLCIT_CONTACT) {
+ itemType = SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hItem,0);
+ if (itemType == CLCIT_CONTACT) {
int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (oldiImage!=0xFF&&oldiImage!=iImage)
+ if (oldiImage != 0xFF&&oldiImage != iImage)
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
}
- else if(itemType==CLCIT_INFO) {
+ else if (itemType == CLCIT_INFO) {
int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (oldiImage!=0xFF&&oldiImage!=iImage)
+ if (oldiImage != 0xFF&&oldiImage != iImage)
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- if(hItem == hItemAll)
+ if (hItem == hItemAll)
SetAllChildIcons(hwndList,hItem,iColumn,iImage);
else
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage)); //hItemUnknown
}
- else if(itemType==CLCIT_GROUP) {
+ else if (itemType == CLCIT_GROUP) {
int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (oldiImage!=0xFF&&oldiImage!=iImage)
+ if (oldiImage != 0xFF&&oldiImage != iImage)
SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- hItem=(HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
- if(hItem)
+ hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
+ if (hItem)
SetAllChildIcons(hwndList,hItem,iColumn,iImage);
}
}
@@ -382,25 +371,22 @@ static int DeleteAutoModesCallback(char *szsetting) void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options,
unsigned int stickies, unsigned int operators, unsigned int lmdat)
{
-
CLVM_EnumModes( DeleteAutoModesCallback );
-
-
- char szSetting[512];
-
- mir_snprintf(szSetting, 512, "%c%s_PF", 246, name);
- db_set_s(NULL, CLVM_MODULE, szSetting, szProtoFilter);
- mir_snprintf(szSetting, 512, "%c%s_GF", 246, name);
- db_set_ws(NULL, CLVM_MODULE, szSetting, szGroupFilter);
- mir_snprintf(szSetting, 512, "%c%s_SM", 246, name);
- db_set_dw(NULL, CLVM_MODULE, szSetting, statusMask);
- mir_snprintf(szSetting, 512, "%c%s_SSM", 246, name);
- db_set_dw(NULL, CLVM_MODULE, szSetting, stickyStatusMask);
- mir_snprintf(szSetting, 512, "%c%s_OPT", 246, name);
- db_set_dw(NULL, CLVM_MODULE, szSetting, options);
- mir_snprintf(szSetting, 512, "%c%s_LM", 246, name);
- db_set_dw(NULL, CLVM_MODULE, szSetting, lmdat);
-
+
+ char szSetting[512];
+ mir_snprintf(szSetting, 512, "%c%s_PF", 246, name);
+ db_set_s(NULL, CLVM_MODULE, szSetting, szProtoFilter);
+ mir_snprintf(szSetting, 512, "%c%s_GF", 246, name);
+ db_set_ws(NULL, CLVM_MODULE, szSetting, szGroupFilter);
+ mir_snprintf(szSetting, 512, "%c%s_SM", 246, name);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, statusMask);
+ mir_snprintf(szSetting, 512, "%c%s_SSM", 246, name);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, stickyStatusMask);
+ mir_snprintf(szSetting, 512, "%c%s_OPT", 246, name);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, options);
+ mir_snprintf(szSetting, 512, "%c%s_LM", 246, name);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, lmdat);
+
db_set_dw(NULL, CLVM_MODULE, name, MAKELONG((unsigned short)operators, (unsigned short)stickies));
}
@@ -410,133 +396,133 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr void SaveState()
{
- TCHAR newGroupFilter[2048] = _T("|");
- char newProtoFilter[2048] = "|";
- int i, iLen;
- HWND hwndList;
- TCHAR *szTempModeName = NULL;
+ TCHAR newGroupFilter[2048] = _T("|");
+ char newProtoFilter[2048] = "|";
+ int i, iLen;
+ HWND hwndList;
+ TCHAR *szTempModeName = NULL;
char *szModeName = NULL;
- DWORD statusMask = 0;
- HANDLE hContact, hItem;
- DWORD operators = 0;
-
- if(clvm_curItem == -1)
- return;
-
- {
- LVITEMA item = {0};
- char szTemp[256];
-
- hwndList = GetDlgItem(clvmHwnd, IDC_PROTOCOLS);
- for(i = 0; i < ListView_GetItemCount(hwndList); i++) {
- if(ListView_GetCheckState(hwndList, i)) {
- item.mask = LVIF_TEXT;
- item.pszText = szTemp;
- item.cchTextMax = 255;
- item.iItem = i;
- SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- strncat(newProtoFilter, szTemp, 2048);
- strncat(newProtoFilter, "|", 2048);
- newProtoFilter[2047] = 0;
- }
- }
- }
-
- {
- LVITEM item = {0};
- TCHAR szTemp[256];
-
- hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
-
- operators |= ListView_GetCheckState(hwndList, 0) ? CLVM_INCLUDED_UNGROUPED : 0;
-
- for(i = 0; i < ListView_GetItemCount(hwndList); i++) {
- if(ListView_GetCheckState(hwndList, i)) {
- item.mask = LVIF_TEXT;
- item.pszText = szTemp;
- item.cchTextMax = 255;
- item.iItem = i;
- SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- _tcsncat(newGroupFilter, szTemp, 2048);
- _tcsncat(newGroupFilter, _T("|"), 2048);
- newGroupFilter[2047] = 0;
- }
- }
- }
- hwndList = GetDlgItem(clvmHwnd, IDC_STATUSMODES);
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- if(ListView_GetCheckState(hwndList, i - ID_STATUS_OFFLINE))
- statusMask |= (1 << (i - ID_STATUS_OFFLINE));
- }
- iLen = SendMessage(GetDlgItem(clvmHwnd, IDC_VIEWMODES), LB_GETTEXTLEN, clvm_curItem, 0);
- if(iLen) {
- unsigned int stickies = 0;
- DWORD dwGlobalMask, dwLocalMask;
+ DWORD statusMask = 0;
+ HANDLE hContact, hItem;
+ DWORD operators = 0;
+
+ if (clvm_curItem == -1)
+ return;
+
+ {
+ LVITEMA item = {0};
+ char szTemp[256];
+
+ hwndList = GetDlgItem(clvmHwnd, IDC_PROTOCOLS);
+ for(i = 0; i < ListView_GetItemCount(hwndList); i++) {
+ if (ListView_GetCheckState(hwndList, i)) {
+ item.mask = LVIF_TEXT;
+ item.pszText = szTemp;
+ item.cchTextMax = 255;
+ item.iItem = i;
+ SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
+ strncat(newProtoFilter, szTemp, 2048);
+ strncat(newProtoFilter, "|", 2048);
+ newProtoFilter[2047] = 0;
+ }
+ }
+ }
+
+ {
+ LVITEM item = {0};
+ TCHAR szTemp[256];
+
+ hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
+
+ operators |= ListView_GetCheckState(hwndList, 0) ? CLVM_INCLUDED_UNGROUPED : 0;
+
+ for(i = 0; i < ListView_GetItemCount(hwndList); i++) {
+ if (ListView_GetCheckState(hwndList, i)) {
+ item.mask = LVIF_TEXT;
+ item.pszText = szTemp;
+ item.cchTextMax = 255;
+ item.iItem = i;
+ SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
+ _tcsncat(newGroupFilter, szTemp, 2048);
+ _tcsncat(newGroupFilter, _T("|"), 2048);
+ newGroupFilter[2047] = 0;
+ }
+ }
+ }
+ hwndList = GetDlgItem(clvmHwnd, IDC_STATUSMODES);
+ for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ if (ListView_GetCheckState(hwndList, i - ID_STATUS_OFFLINE))
+ statusMask |= (1 << (i - ID_STATUS_OFFLINE));
+ }
+ iLen = SendMessage(GetDlgItem(clvmHwnd, IDC_VIEWMODES), LB_GETTEXTLEN, clvm_curItem, 0);
+ if (iLen) {
+ unsigned int stickies = 0;
+ DWORD dwGlobalMask, dwLocalMask;
BOOL translated;
- szTempModeName = ( TCHAR* )mir_alloc((iLen + 1)*sizeof(TCHAR));
- if(szTempModeName)
+ szTempModeName = ( TCHAR* )mir_alloc((iLen + 1)*sizeof(TCHAR));
+ if (szTempModeName)
{
- DWORD options, lmdat;
- //char *vastring = NULL;
- //int len = GetWindowTextLengthA(GetDlgItem(clvmHwnd, IDC_VARIABLES)) + 1;
-
- //vastring = (char *)malloc(len);
- //if(vastring)
- // GetDlgItemTextA(clvmHwnd, IDC_VARIABLES, vastring, len);
- SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempModeName);
+ DWORD options, lmdat;
+ //char *vastring = NULL;
+ //int len = GetWindowTextLengthA(GetDlgItem(clvmHwnd, IDC_VARIABLES)) + 1;
+
+ //vastring = (char *)malloc(len);
+ //if (vastring)
+ // GetDlgItemTextA(clvmHwnd, IDC_VARIABLES, vastring, len);
+ SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempModeName);
{
- szModeName=mir_utf8encodeT(szTempModeName);
+ szModeName = mir_utf8encodeT(szTempModeName);
}
- dwGlobalMask = GetMaskForItem(hInfoItem);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- while(hContact)
+ dwGlobalMask = GetMaskForItem(hInfoItem);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ while(hContact)
{
- hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
- if(hItem)
+ hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ if (hItem)
{
- if(SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
+ if (SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0))
{
- dwLocalMask = GetMaskForItem(hItem);
- db_set_dw(hContact, CLVM_MODULE, szModeName, MAKELONG(1, (unsigned short)dwLocalMask));
- stickies++;
- }
- else
+ dwLocalMask = GetMaskForItem(hItem);
+ db_set_dw(hContact, CLVM_MODULE, szModeName, MAKELONG(1, (unsigned short)dwLocalMask));
+ stickies++;
+ }
+ else
{
- if(db_get_dw(hContact, CLVM_MODULE, szModeName, 0))
- db_set_dw(hContact, CLVM_MODULE, szModeName, 0);
- }
- }
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
- }
- operators |= ((SendDlgItemMessage(clvmHwnd, IDC_PROTOGROUPOP, CB_GETCURSEL, 0, 0) == 1 ? CLVM_PROTOGROUP_OP : 0) |
- (SendDlgItemMessage(clvmHwnd, IDC_GROUPSTATUSOP, CB_GETCURSEL, 0, 0) == 1 ? CLVM_GROUPSTATUS_OP : 0) |
- (IsDlgButtonChecked(clvmHwnd, IDC_AUTOCLEAR) ? CLVM_AUTOCLEAR : 0) |
- (IsDlgButtonChecked(clvmHwnd, IDC_LASTMSG) ? CLVM_USELASTMSG : 0)|
- (IsDlgButtonChecked(clvmHwnd, IDC_USEGROUPS)==BST_CHECKED ? CLVM_USEGROUPS : 0)|
- (IsDlgButtonChecked(clvmHwnd, IDC_USEGROUPS)==BST_UNCHECKED ? CLVM_DONOTUSEGROUPS : 0)
- );
-
- options = SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_GETPOS, 0, 0);
+ if (db_get_dw(hContact, CLVM_MODULE, szModeName, 0))
+ db_set_dw(hContact, CLVM_MODULE, szModeName, 0);
+ }
+ }
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ }
+ operators |= ((SendDlgItemMessage(clvmHwnd, IDC_PROTOGROUPOP, CB_GETCURSEL, 0, 0) == 1 ? CLVM_PROTOGROUP_OP : 0) |
+ (SendDlgItemMessage(clvmHwnd, IDC_GROUPSTATUSOP, CB_GETCURSEL, 0, 0) == 1 ? CLVM_GROUPSTATUS_OP : 0) |
+ (IsDlgButtonChecked(clvmHwnd, IDC_AUTOCLEAR) ? CLVM_AUTOCLEAR : 0) |
+ (IsDlgButtonChecked(clvmHwnd, IDC_LASTMSG) ? CLVM_USELASTMSG : 0)|
+ (IsDlgButtonChecked(clvmHwnd, IDC_USEGROUPS) == BST_CHECKED ? CLVM_USEGROUPS : 0)|
+ (IsDlgButtonChecked(clvmHwnd, IDC_USEGROUPS) == BST_UNCHECKED ? CLVM_DONOTUSEGROUPS : 0)
+ );
+
+ options = SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_GETPOS, 0, 0);
lmdat = MAKELONG(GetDlgItemInt(clvmHwnd, IDC_LASTMSGVALUE, &translated, FALSE),
- MAKEWORD(SendDlgItemMessage(clvmHwnd, IDC_LASTMESSAGEOP, CB_GETCURSEL, 0, 0),
- SendDlgItemMessage(clvmHwnd, IDC_LASTMESSAGEUNIT, CB_GETCURSEL, 0, 0)));
+ MAKEWORD(SendDlgItemMessage(clvmHwnd, IDC_LASTMESSAGEOP, CB_GETCURSEL, 0, 0),
+ SendDlgItemMessage(clvmHwnd, IDC_LASTMESSAGEUNIT, CB_GETCURSEL, 0, 0)));
- SaveViewMode(szModeName, newGroupFilter, newProtoFilter, statusMask, dwGlobalMask, options,
- stickies, operators, lmdat);
- //free(vastring);
- if (szModeName && szModeName!=(char*)szTempModeName)
+ SaveViewMode(szModeName, newGroupFilter, newProtoFilter, statusMask, dwGlobalMask, options,
+ stickies, operators, lmdat);
+ //free(vastring);
+ if (szModeName && szModeName != (char*)szTempModeName)
mir_free(szModeName);
if (szTempModeName)
mir_free(szTempModeName);
- szTempModeName=NULL;
- szModeName=NULL;
- }
- }
- EnableWindow(GetDlgItem(clvmHwnd, IDC_APPLY), FALSE);
+ szTempModeName = NULL;
+ szModeName = NULL;
+ }
+ }
+ EnableWindow(GetDlgItem(clvmHwnd, IDC_APPLY), FALSE);
}
@@ -546,110 +532,109 @@ void SaveState() static void UpdateFilters()
{
- DBVARIANT dbv_pf = {0};
- DBVARIANT dbv_gf = {0};
- char szSetting[128];
- TCHAR *szTempBuf=NULL;
- char *szBuf = NULL;
- int iLen;
- DWORD statusMask = 0, localMask = 0;
- DWORD dwFlags;
- DWORD opt;
- TCHAR szTemp[100];
-
- if(clvm_curItem == LB_ERR)
- return;
-
- iLen = SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXTLEN, clvm_curItem, 0);
-
- if ( iLen == 0 )
- return;
-
- szTempBuf= (TCHAR *)mir_alloc((iLen + 1)*sizeof(TCHAR));
- SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempBuf);
-
- szBuf=mir_utf8encodeT(szTempBuf);
+ DBVARIANT dbv_pf = {0};
+ DBVARIANT dbv_gf = {0};
+ char szSetting[128];
+ TCHAR *szTempBuf = NULL;
+ char *szBuf = NULL;
+ int iLen;
+ DWORD statusMask = 0, localMask = 0;
+ DWORD dwFlags;
+ DWORD opt;
+ TCHAR szTemp[100];
+
+ if (clvm_curItem == LB_ERR)
+ return;
+
+ iLen = SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXTLEN, clvm_curItem, 0);
+
+ if ( iLen == 0 )
+ return;
+
+ szTempBuf = (TCHAR *)mir_alloc((iLen + 1)*sizeof(TCHAR));
+ SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_GETTEXT, clvm_curItem, (LPARAM)szTempBuf);
+
+ szBuf = mir_utf8encodeT(szTempBuf);
strncpy(g_szModename, szBuf, SIZEOF(g_szModename));
- g_szModename[SIZEOF(g_szModename) - 1] = 0;
- mir_sntprintf(szTemp, 100, TranslateT("Configuring view mode: %s"), szTempBuf);
- SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
- mir_snprintf(szSetting, 128, "%c%s_PF", 246, szBuf);
- if(DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv_pf))
- goto cleanup;
- mir_snprintf(szSetting, 128, "%c%s_GF", 246, szBuf);
- if(DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
- goto cleanup;
- mir_snprintf(szSetting, 128, "%c%s_OPT", 246, szBuf);
- if ((opt = db_get_dw(NULL, CLVM_MODULE, szSetting, -1)) != -1)
+ g_szModename[SIZEOF(g_szModename) - 1] = 0;
+ mir_sntprintf(szTemp, 100, TranslateT("Configuring view mode: %s"), szTempBuf);
+ SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
+ mir_snprintf(szSetting, 128, "%c%s_PF", 246, szBuf);
+ if (DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv_pf))
+ goto cleanup;
+ mir_snprintf(szSetting, 128, "%c%s_GF", 246, szBuf);
+ if (DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv_gf))
+ goto cleanup;
+ mir_snprintf(szSetting, 128, "%c%s_OPT", 246, szBuf);
+ if ((opt = db_get_dw(NULL, CLVM_MODULE, szSetting, -1)) !=-1)
+ {
+ SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0));
+ }
+ mir_snprintf(szSetting, 128, "%c%s_SM", 246, szBuf);
+ statusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
+ mir_snprintf(szSetting, 128, "%c%s_SSM", 246, szBuf);
+ stickyStatusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
+ dwFlags = db_get_dw(NULL, CLVM_MODULE, szBuf, 0);
{
- SendDlgItemMessage(clvmHwnd, IDC_AUTOCLEARSPIN, UDM_SETPOS, 0, MAKELONG(LOWORD(opt), 0));
- }
- mir_snprintf(szSetting, 128, "%c%s_SM", 246, szBuf);
- statusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
- mir_snprintf(szSetting, 128, "%c%s_SSM", 246, szBuf);
- stickyStatusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
- dwFlags = db_get_dw(NULL, CLVM_MODULE, szBuf, 0);
- {
- LVITEMA item = {0};
- char szTemp[256];
- char szMask[256];
- int i;
- HWND hwndList = GetDlgItem(clvmHwnd, IDC_PROTOCOLS);
-
- item.mask = LVIF_TEXT;
- item.pszText = szTemp;
- item.cchTextMax = 255;
-
- for(i = 0; i < ListView_GetItemCount(hwndList); i++)
+ LVITEMA item = {0};
+ char szTemp[256];
+ char szMask[256];
+ int i;
+ HWND hwndList = GetDlgItem(clvmHwnd, IDC_PROTOCOLS);
+
+ item.mask = LVIF_TEXT;
+ item.pszText = szTemp;
+ item.cchTextMax = 255;
+
+ for(i = 0; i < ListView_GetItemCount(hwndList); i++)
{
- item.iItem = i;
- SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
- mir_snprintf(szMask, 256, "%s|", szTemp);
- if(dbv_pf.pszVal && strstr(dbv_pf.pszVal, szMask))
- ListView_SetCheckState(hwndList, i, TRUE)
- else
- ListView_SetCheckState(hwndList, i, FALSE);
- }
- }
- {
- LVITEM item = {0};
- TCHAR szTemp[256];
- TCHAR szMask[256];
- int i;
- HWND hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
-
- item.mask = LVIF_TEXT;
- item.pszText = szTemp;
- item.cchTextMax = 255;
-
- ListView_SetCheckState(hwndList, 0, dwFlags & CLVM_INCLUDED_UNGROUPED ? TRUE : FALSE);
-
- for(i = 1; i < ListView_GetItemCount(hwndList); i++)
+ item.iItem = i;
+ SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
+ mir_snprintf(szMask, 256, "%s|", szTemp);
+ if (dbv_pf.pszVal && strstr(dbv_pf.pszVal, szMask))
+ ListView_SetCheckState(hwndList, i, TRUE)
+ else
+ ListView_SetCheckState(hwndList, i, FALSE);
+ }
+ }
+ {
+ LVITEM item = {0};
+ TCHAR szTemp[256];
+ TCHAR szMask[256];
+ int i;
+ HWND hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
+
+ item.mask = LVIF_TEXT;
+ item.pszText = szTemp;
+ item.cchTextMax = 255;
+
+ ListView_SetCheckState(hwndList, 0, dwFlags & CLVM_INCLUDED_UNGROUPED ? TRUE : FALSE);
+
+ for(i = 1; i < ListView_GetItemCount(hwndList); i++)
{
- item.iItem = i;
- SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
- _sntprintf(szMask, 256, _T("%s|"), szTemp);
- if(dbv_gf.ptszVal && _tcsstr(dbv_gf.ptszVal, szMask))
- ListView_SetCheckState(hwndList, i, TRUE)
- else
- ListView_SetCheckState(hwndList, i, FALSE);
- }
- }
- {
- HWND hwndList = GetDlgItem(clvmHwnd, IDC_STATUSMODES);
- int i;
-
- for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- if ((1 << (i - ID_STATUS_OFFLINE)) & statusMask)
- ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, TRUE)
- else
- ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, FALSE);
- }
- }
- SendDlgItemMessage(clvmHwnd, IDC_PROTOGROUPOP, CB_SETCURSEL, dwFlags & CLVM_PROTOGROUP_OP ? 1 : 0, 0);
- SendDlgItemMessage(clvmHwnd, IDC_GROUPSTATUSOP, CB_SETCURSEL, dwFlags & CLVM_GROUPSTATUS_OP ? 1 : 0, 0);
- CheckDlgButton(clvmHwnd, IDC_AUTOCLEAR, dwFlags & CLVM_AUTOCLEAR ? 1 : 0);
- UpdateStickies();
+ item.iItem = i;
+ SendMessage(hwndList, LVM_GETITEM, 0, (LPARAM)&item);
+ _sntprintf(szMask, 256, _T("%s|"), szTemp);
+ if (dbv_gf.ptszVal && _tcsstr(dbv_gf.ptszVal, szMask))
+ ListView_SetCheckState(hwndList, i, TRUE)
+ else
+ ListView_SetCheckState(hwndList, i, FALSE);
+ }
+ }
+ {
+ HWND hwndList = GetDlgItem(clvmHwnd, IDC_STATUSMODES);
+
+ for(int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ if ((1 << (i - ID_STATUS_OFFLINE)) & statusMask)
+ ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, TRUE)
+ else
+ ListView_SetCheckState(hwndList, i - ID_STATUS_OFFLINE, FALSE);
+ }
+ }
+ SendDlgItemMessage(clvmHwnd, IDC_PROTOGROUPOP, CB_SETCURSEL, dwFlags & CLVM_PROTOGROUP_OP ? 1 : 0, 0);
+ SendDlgItemMessage(clvmHwnd, IDC_GROUPSTATUSOP, CB_SETCURSEL, dwFlags & CLVM_GROUPSTATUS_OP ? 1 : 0, 0);
+ CheckDlgButton(clvmHwnd, IDC_AUTOCLEAR, dwFlags & CLVM_AUTOCLEAR ? 1 : 0);
+ UpdateStickies();
{
int useLastMsg = dwFlags & CLVM_USELASTMSG;
@@ -666,7 +651,7 @@ static void UpdateFilters() EnableWindow(GetDlgItem(clvmHwnd, IDC_LASTMSGVALUE), useLastMsg);
EnableWindow(GetDlgItem(clvmHwnd, IDC_LASTMESSAGEUNIT), useLastMsg);
- mir_snprintf(szSetting, 128, "%c%s_LM", 246, szBuf);
+ mir_snprintf(szSetting, 128, "%c%s_LM", 246, szBuf);
lmdat = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
SetDlgItemInt(clvmHwnd, IDC_LASTMSGVALUE, LOWORD(lmdat), FALSE);
@@ -678,9 +663,9 @@ static void UpdateFilters() ShowPage(clvmHwnd, 0);
cleanup:
- db_free(&dbv_pf);
- db_free(&dbv_gf);
- mir_free(szBuf);
+ db_free(&dbv_pf);
+ db_free(&dbv_gf);
+ mir_free(szBuf);
mir_free(szTempBuf);
}
@@ -708,7 +693,7 @@ void DeleteViewMode( char * szName ) HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
while(hContact)
{
- if(db_get_dw(hContact, CLVM_MODULE, szName, -1) != -1)
+ if (db_get_dw(hContact, CLVM_MODULE, szName, -1) !=-1)
db_set_dw(hContact, CLVM_MODULE, szName, 0);
hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
}
@@ -717,327 +702,327 @@ void DeleteViewMode( char * szName ) #define IDI_SMALLDOT 211 //from miranda.exe
INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- clvmHwnd = hwndDlg;
-
- switch(msg) {
- case WM_INITDIALOG:
- {
- int i = 0;
- TCITEM tci;
- RECT rcClient;
- CLCINFOITEM cii = {0};
- HICON hIcon;
-
- xpt_EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
-
- himlViewModes = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 12, 0);
+ clvmHwnd = hwndDlg;
+
+ switch(msg) {
+ case WM_INITDIALOG:
+ {
+ int i = 0;
+ TCITEM tci;
+ RECT rcClient;
+ CLCINFOITEM cii = {0};
+ HICON hIcon;
+
+ xpt_EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
+
+ himlViewModes = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus() ? ILC_COLOR32 : ILC_COLOR16), 12, 0);
for(i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
hIcon = LoadSkinnedProtoIcon(NULL, i);
ImageList_AddIcon(himlViewModes, hIcon);
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
}
- hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SMALLDOT), IMAGE_ICON, 16, 16, 0);
- nullImage = ImageList_AddIcon(himlViewModes, hIcon);
- DestroyIcon(hIcon);
- GetClientRect(hwndDlg, &rcClient);
-
- tci.mask = TCIF_PARAM|TCIF_TEXT;
- tci.lParam = 0;
- tci.pszText = TranslateT("Sticky contacts");
- SendMessage(GetDlgItem(hwndDlg, IDC_TAB), TCM_INSERTITEM, (WPARAM)0, (LPARAM)&tci);
-
- tci.pszText = TranslateT("Filtering");
- SendMessage(GetDlgItem(hwndDlg, IDC_TAB), TCM_INSERTITEM, (WPARAM)0, (LPARAM)&tci);
-
- TabCtrl_SetCurSel(GetDlgItem(hwndDlg, IDC_TAB), 0);
-
- TranslateDialogDefault(hwndDlg);
- FillDialog(hwndDlg);
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), FALSE);
+ hIcon = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_SMALLDOT), IMAGE_ICON, 16, 16, 0);
+ nullImage = ImageList_AddIcon(himlViewModes, hIcon);
+ DestroyIcon(hIcon);
+ GetClientRect(hwndDlg, &rcClient);
+
+ tci.mask = TCIF_PARAM|TCIF_TEXT;
+ tci.lParam = 0;
+ tci.pszText = TranslateT("Sticky contacts");
+ SendMessage(GetDlgItem(hwndDlg, IDC_TAB), TCM_INSERTITEM, (WPARAM)0, (LPARAM)&tci);
+
+ tci.pszText = TranslateT("Filtering");
+ SendMessage(GetDlgItem(hwndDlg, IDC_TAB), TCM_INSERTITEM, (WPARAM)0, (LPARAM)&tci);
+
+ TabCtrl_SetCurSel(GetDlgItem(hwndDlg, IDC_TAB), 0);
+
+ TranslateDialogDefault(hwndDlg);
+ FillDialog(hwndDlg);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), FALSE);
{
- LONG style=GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST),GWL_STYLE);
- style&=(~CLS_SHOWHIDDEN);
+ LONG style = GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST),GWL_STYLE);
+ style &= (~CLS_SHOWHIDDEN);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST),GWL_STYLE,style);
}
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)himlViewModes);
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETEXTRACOLUMNS, ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE, 0);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)himlViewModes);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETEXTRACOLUMNS, ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE, 0);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETBKBITMAP,0,(LPARAM)(HBITMAP)NULL);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETBKCOLOR,GetSysColor(COLOR_WINDOW),0);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETGREYOUTFLAGS,0,0);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETLEFTMARGIN,2,0);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETINDENT,10,0);
- for(i=0;i<=FONTID_MAX;i++)
+ for(i = 0;i <= FONTID_MAX;i++)
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETTEXTCOLOR,i,GetSysColor(COLOR_WINDOWTEXT));
- cii.cbSize = sizeof(cii);
- cii.hParentGroup = 0;
- cii.pszText = TranslateT("*** All contacts ***");
- hInfoItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETHIDEEMPTYGROUPS, 1, 0);
-
- int index = 0;
-
- if ( g_CluiData.current_viewmode[0]!='\0' )
- {
- TCHAR * temp=
- mir_utf8decodeW( g_CluiData.current_viewmode );
-
- if(temp)
- {
- index = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_FINDSTRING, -1, (LPARAM)temp );
- mir_free(temp);
- }
- if ( index==-1 )
- index = 0;
- }
-
- if(SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, index, 0) != LB_ERR)
- {
- clvm_curItem = index;
- UpdateFilters();
- }
- else
- clvm_curItem = -1;
- g_ViewModeOptDlg = TRUE;
- i = 0;
- while(_page2Controls[i] != 0)
- ShowWindow(GetDlgItem(hwndDlg, _page2Controls[i++]), SW_HIDE);
- ShowWindow(hwndDlg, SW_SHOWNORMAL);
- EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), FALSE);
- //EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLES), FALSE);
- //EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLES), ServiceExists(MS_VARS_FORMATSTRING));
- SendDlgItemMessage(hwndDlg, IDC_AUTOCLEARSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 0));
- SetWindowText(hwndDlg, TranslateT("Configure view modes"));
- return TRUE;
- }
- case WM_COMMAND:
- switch(LOWORD(wParam)) {
- case IDC_PROTOGROUPOP:
- case IDC_GROUPSTATUSOP:
- case IDC_LASTMESSAGEUNIT:
- case IDC_LASTMESSAGEOP:
- if (HIWORD(wParam) == CBN_SELCHANGE)
- EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- break;
- case IDC_USEGROUPS:
- EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- break;
- case IDC_AUTOCLEAR:
- EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- break;
- case IDC_LASTMSG:
- {
- int bUseLastMsg = IsDlgButtonChecked(hwndDlg, IDC_LASTMSG);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LASTMESSAGEOP), bUseLastMsg);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LASTMESSAGEUNIT), bUseLastMsg);
- EnableWindow(GetDlgItem(hwndDlg, IDC_LASTMSGVALUE), bUseLastMsg);
- EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- break;
- }
- case IDC_AUTOCLEARVAL:
- case IDC_LASTMSGVALUE:
- if(HIWORD(wParam) == EN_CHANGE && GetFocus() == (HWND)lParam)
- EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- break;
- case IDC_DELETEVIEWMODE:
- {
- if(MessageBox(0, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES)
+ cii.cbSize = sizeof(cii);
+ cii.hParentGroup = 0;
+ cii.pszText = TranslateT("*** All contacts ***");
+ hInfoItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETHIDEEMPTYGROUPS, 1, 0);
+
+ int index = 0;
+
+ if ( g_CluiData.current_viewmode[0] != '\0' )
+ {
+ TCHAR * temp =
+ mir_utf8decodeW( g_CluiData.current_viewmode );
+
+ if (temp)
+ {
+ index = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_FINDSTRING, -1, (LPARAM)temp );
+ mir_free(temp);
+ }
+ if ( index == -1 )
+ index = 0;
+ }
+
+ if (SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, index, 0) !=LB_ERR)
+ {
+ clvm_curItem = index;
+ UpdateFilters();
+ }
+ else
+ clvm_curItem = -1;
+ g_ViewModeOptDlg = TRUE;
+ i = 0;
+ while(_page2Controls[i] !=0)
+ ShowWindow(GetDlgItem(hwndDlg, _page2Controls[i++]), SW_HIDE);
+ ShowWindow(hwndDlg, SW_SHOWNORMAL);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), FALSE);
+ //EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLES), FALSE);
+ //EnableWindow(GetDlgItem(hwndDlg, IDC_VARIABLES), ServiceExists(MS_VARS_FORMATSTRING));
+ SendDlgItemMessage(hwndDlg, IDC_AUTOCLEARSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 0));
+ SetWindowText(hwndDlg, TranslateT("Configure view modes"));
+ return TRUE;
+ }
+ case WM_COMMAND:
+ switch(LOWORD(wParam)) {
+ case IDC_PROTOGROUPOP:
+ case IDC_GROUPSTATUSOP:
+ case IDC_LASTMESSAGEUNIT:
+ case IDC_LASTMESSAGEOP:
+ if (HIWORD(wParam) == CBN_SELCHANGE)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
+ break;
+ case IDC_USEGROUPS:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
+ break;
+ case IDC_AUTOCLEAR:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
+ break;
+ case IDC_LASTMSG:
+ {
+ int bUseLastMsg = IsDlgButtonChecked(hwndDlg, IDC_LASTMSG);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LASTMESSAGEOP), bUseLastMsg);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LASTMESSAGEUNIT), bUseLastMsg);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LASTMSGVALUE), bUseLastMsg);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
+ break;
+ }
+ case IDC_AUTOCLEARVAL:
+ case IDC_LASTMSGVALUE:
+ if (HIWORD(wParam) == EN_CHANGE && GetFocus() == (HWND)lParam)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
+ break;
+ case IDC_DELETEVIEWMODE:
+ {
+ if (MessageBox(0, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES)
+ {
+
+ int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
+ if (iLen)
{
-
- int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
- if(iLen)
+ //TODO: UNICODE
+ TCHAR *szTempBuf = ( TCHAR* )malloc((iLen + 1)*sizeof(TCHAR));
+ char *szBuf = NULL;
+ if (szTempBuf)
{
- //TODO: UNICODE
- TCHAR *szTempBuf = ( TCHAR* )malloc((iLen + 1)*sizeof(TCHAR));
- char *szBuf = NULL;
- if(szTempBuf)
+
+
+ SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szTempBuf);
+ szBuf = mir_utf8encodeT(szTempBuf);
+ DeleteViewMode( szBuf );
+
+ SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_DELETESTRING, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
+ if (SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, 0, 0) !=LB_ERR)
{
-
-
- SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXT, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), (LPARAM)szTempBuf);
- szBuf=mir_utf8encodeT(szTempBuf);
- DeleteViewMode( szBuf );
-
- SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_DELETESTRING, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
- if(SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, 0, 0) != LB_ERR)
- {
- clvm_curItem = 0;
- UpdateFilters();
- }
- else
- clvm_curItem = -1;
-
-
- if (szBuf && szBuf!=(char*)szTempBuf) mir_free(szBuf);
- if (szTempBuf) free(szTempBuf);
- szTempBuf = NULL;
- szBuf = NULL;
- }
- }
- }
- break;
- }
- case IDC_ADDVIEWMODE:
- {
- TCHAR szBuf[256];
-
-
- szBuf[0] = 0;
- GetDlgItemText(hwndDlg, IDC_NEWVIEMODE, szBuf, 256);
- szBuf[255] = 0;
-
- if(lstrlen(szBuf) > 0)
+ clvm_curItem = 0;
+ UpdateFilters();
+ }
+ else
+ clvm_curItem = -1;
+
+
+ if (szBuf && szBuf != (char*)szTempBuf) mir_free(szBuf);
+ if (szTempBuf) free(szTempBuf);
+ szTempBuf = NULL;
+ szBuf = NULL;
+ }
+ }
+ }
+ break;
+ }
+ case IDC_ADDVIEWMODE:
+ {
+ TCHAR szBuf[256];
+
+
+ szBuf[0] = 0;
+ GetDlgItemText(hwndDlg, IDC_NEWVIEMODE, szBuf, 256);
+ szBuf[255] = 0;
+
+ if (lstrlen(szBuf) > 0)
+ {
+ char *szUTF8Buf = NULL;
+ szUTF8Buf = mir_utf8encodeT(szBuf);
+
+ if (db_get_dw(NULL, CLVM_MODULE, szUTF8Buf, -1) !=-1)
+ MessageBox(0, TranslateT("A view mode with this name does alredy exist"), TranslateT("Duplicate name"), MB_OK);
+ else
{
- char *szUTF8Buf=NULL;
- szUTF8Buf=mir_utf8encodeT(szBuf);
-
- if(db_get_dw(NULL, CLVM_MODULE, szUTF8Buf, -1) != -1)
- MessageBox(0, TranslateT("A view mode with this name does alredy exist"), TranslateT("Duplicate name"), MB_OK);
- else
+ int iNewItem = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)szBuf);
+ if (iNewItem !=LB_ERR)
{
- int iNewItem = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)szBuf);
- if(iNewItem != LB_ERR)
- {
- SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, (WPARAM)iNewItem, 0);
- SaveViewMode(szUTF8Buf, _T(""), "", 0, -1, 0, 0, 0, 0);
- clvm_curItem = iNewItem;
- UpdateStickies();
- SendDlgItemMessage(hwndDlg, IDC_PROTOGROUPOP, CB_SETCURSEL, 0, 0);
- SendDlgItemMessage(hwndDlg, IDC_GROUPSTATUSOP, CB_SETCURSEL, 0, 0);
- }
- }
- SetDlgItemText(hwndDlg, IDC_NEWVIEMODE, _T(""));
- mir_free(szUTF8Buf);
- }
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), FALSE);
- UpdateFilters();
- break;
- }
- case IDC_CLEARALL:
- {
- HANDLE hItem;
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
-
- while(hContact)
- {
- hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
- if(hItem)
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
- }
- }
- case IDOK:
- case IDC_APPLY:
- SaveState();
- if(g_CluiData.bFilterEffective)
- ApplyViewMode(g_CluiData.current_viewmode);
- if(LOWORD(wParam) == IDOK)
- DestroyWindow(hwndDlg);
- break;
- case IDCANCEL:
- DestroyWindow(hwndDlg);
- break;
- }
- if(LOWORD(wParam) == IDC_NEWVIEMODE && HIWORD(wParam) == EN_CHANGE)
- EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), TRUE);
- if(LOWORD(wParam) == IDC_VIEWMODES && HIWORD(wParam) == LBN_SELCHANGE)
+ SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_SETCURSEL, (WPARAM)iNewItem, 0);
+ SaveViewMode(szUTF8Buf, _T(""), "", 0, -1, 0, 0, 0, 0);
+ clvm_curItem = iNewItem;
+ UpdateStickies();
+ SendDlgItemMessage(hwndDlg, IDC_PROTOGROUPOP, CB_SETCURSEL, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_GROUPSTATUSOP, CB_SETCURSEL, 0, 0);
+ }
+ }
+ SetDlgItemText(hwndDlg, IDC_NEWVIEMODE, _T(""));
+ mir_free(szUTF8Buf);
+ }
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), FALSE);
+ UpdateFilters();
+ break;
+ }
+ case IDC_CLEARALL:
{
- SaveState();
- clvm_curItem = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0);
- UpdateFilters();
- //EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- //SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
- break;
- case WM_NOTIFY:
- {
- switch (((LPNMHDR) lParam)->idFrom) {
- case IDC_GROUPS:
- case IDC_STATUSMODES:
- case IDC_PROTOCOLS:
- case IDC_CLIST:
- if (((LPNMHDR) lParam)->code == NM_CLICK || ((LPNMHDR) lParam)->code == CLN_CHECKCHANGED)
- EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
- switch (((LPNMHDR)lParam)->code)
- {
- case CLN_NEWCONTACT:
- case CLN_LISTREBUILT:
- //SetAllContactIcons(GetDlgItem(hwndDlg,IDC_CLIST));
- //fall through
- /*
- case CLN_CONTACTMOVED:
- SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL);
- break;
- case CLN_OPTIONSCHANGED:
- ResetListOptions(GetDlgItem(hwndDlg,IDC_LIST));
- break;
- case CLN_CHECKCHANGED:
- {
- HANDLE hItem;
- NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
- int typeOfItem = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETITEMTYPE,(WPARAM)nm->hItem, 0);
- break;
- }*/
- case NM_CLICK:
- {
- HANDLE hItem;
- NMCLISTCONTROL *nm=(NMCLISTCONTROL*)lParam;
- DWORD hitFlags;
- int iImage;
-
- if(nm->iColumn==-1)
- 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))
- break;
- iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
- if(iImage == nullImage)
- iImage = nm->iColumn;
- else if(iImage!=0xFF)
- iImage = nullImage;
- SetIconsForColumn(GetDlgItem(hwndDlg,IDC_CLIST),hItem,hInfoItem,nm->iColumn,iImage);
- //SetListGroupIcons(GetDlgItem(hwndDlg,IDC_CLIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hInfoItem,NULL);
- break;
- }
- }
- break;
- case IDC_TAB:
- if (((LPNMHDR) lParam)->code == TCN_SELCHANGE) {
- int id = TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TAB));
- if(id == 0)
- ShowPage(hwndDlg, 0);
- else
- ShowPage(hwndDlg, 1);
- break;
- }
-
- }
- break;
- }
- case WM_DESTROY:
- ImageList_RemoveAll(himlViewModes);
- ImageList_Destroy(himlViewModes);
- g_ViewModeOptDlg = FALSE;
- break;
- }
- return FALSE;
+ HANDLE hItem;
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+
+ while(hContact)
+ {
+ hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
+ if (hItem)
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ }
+ }
+ case IDOK:
+ case IDC_APPLY:
+ SaveState();
+ if (g_CluiData.bFilterEffective)
+ ApplyViewMode(g_CluiData.current_viewmode);
+ if (LOWORD(wParam) == IDOK)
+ DestroyWindow(hwndDlg);
+ break;
+ case IDCANCEL:
+ DestroyWindow(hwndDlg);
+ break;
+ }
+ if (LOWORD(wParam) == IDC_NEWVIEMODE && HIWORD(wParam) == EN_CHANGE)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), TRUE);
+ if (LOWORD(wParam) == IDC_VIEWMODES && HIWORD(wParam) == LBN_SELCHANGE)
+ {
+ SaveState();
+ clvm_curItem = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0);
+ UpdateFilters();
+ //EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
+ //SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ break;
+ case WM_NOTIFY:
+ {
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case IDC_GROUPS:
+ case IDC_STATUSMODES:
+ case IDC_PROTOCOLS:
+ case IDC_CLIST:
+ if (((LPNMHDR) lParam)->code == NM_CLICK || ((LPNMHDR) lParam)->code == CLN_CHECKCHANGED)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case CLN_NEWCONTACT:
+ case CLN_LISTREBUILT:
+ //SetAllContactIcons(GetDlgItem(hwndDlg,IDC_CLIST));
+ //fall through
+ /*
+ case CLN_CONTACTMOVED:
+ SetListGroupIcons(GetDlgItem(hwndDlg,IDC_LIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hItemAll,NULL);
+ break;
+ case CLN_OPTIONSCHANGED:
+ ResetListOptions(GetDlgItem(hwndDlg,IDC_LIST));
+ break;
+ case CLN_CHECKCHANGED:
+ {
+ HANDLE hItem;
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
+ int typeOfItem = SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_GETITEMTYPE,(WPARAM)nm->hItem, 0);
+ break;
+ }*/
+ case NM_CLICK:
+ {
+ HANDLE hItem;
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL*)lParam;
+ DWORD hitFlags;
+ int iImage;
+
+ if (nm->iColumn == -1)
+ 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))
+ break;
+ iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
+ if (iImage == nullImage)
+ iImage = nm->iColumn;
+ else if (iImage != 0xFF)
+ iImage = nullImage;
+ SetIconsForColumn(GetDlgItem(hwndDlg,IDC_CLIST),hItem,hInfoItem,nm->iColumn,iImage);
+ //SetListGroupIcons(GetDlgItem(hwndDlg,IDC_CLIST),(HANDLE)SendDlgItemMessage(hwndDlg,IDC_LIST,CLM_GETNEXTITEM,CLGN_ROOT,0),hInfoItem,NULL);
+ break;
+ }
+ }
+ break;
+ case IDC_TAB:
+ if (((LPNMHDR) lParam)->code == TCN_SELCHANGE) {
+ int id = TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TAB));
+ if (id == 0)
+ ShowPage(hwndDlg, 0);
+ else
+ ShowPage(hwndDlg, 1);
+ break;
+ }
+
+ }
+ break;
+ }
+ case WM_DESTROY:
+ ImageList_RemoveAll(himlViewModes);
+ ImageList_Destroy(himlViewModes);
+ g_ViewModeOptDlg = FALSE;
+ break;
+ }
+ return FALSE;
}
static int menuCounter = 0;
static int FillMenuCallback(char *szSetting)
{
- if(szSetting[0] == (char)246)
- return 1;
- if(szSetting[0] == (char)13)
+ if (szSetting[0] == (char)246)
return 1;
-
+ if (szSetting[0] == (char)13)
+ return 1;
+
{
TCHAR * temp;
- //temp=alloca((strlen(szSetting)+1)*sizeof(TCHAR));
+ //temp = alloca((strlen(szSetting)+1)*sizeof(TCHAR));
mir_utf8decode(szSetting,&temp);
- if(temp)
+ if (temp)
{
AppendMenu(hViewModeMenu, MFT_STRING, menuCounter++, temp);
mir_free(temp);
@@ -1048,33 +1033,30 @@ static int FillMenuCallback(char *szSetting) void BuildViewModeMenu()
{
- if(hViewModeMenu)
- DestroyMenu(hViewModeMenu);
+ if (hViewModeMenu)
+ DestroyMenu(hViewModeMenu);
- menuCounter = 100;
- hViewModeMenu = CreatePopupMenu();
+ menuCounter = 100;
+ hViewModeMenu = CreatePopupMenu();
AppendMenu(hViewModeMenu, MFT_STRING, 10002, TranslateT("All Contacts"));
AppendMenu(hViewModeMenu, MF_SEPARATOR, 0, NULL);
-
+
CLVM_EnumModes(FillMenuCallback);
if (GetMenuItemCount(hViewModeMenu) > 2)
AppendMenu(hViewModeMenu, MF_SEPARATOR, 0, NULL);
AppendMenu(hViewModeMenu, MFT_STRING, 10001, TranslateT("Setup View Modes..."));
-
-
}
LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg)
- {
+ switch(msg) {
case WM_CREATE:
{
HWND hwndButton;
- RECT rcMargins={12,0,2,0};
+ RECT rcMargins = {12,0,2,0};
hwndSelector = CreateWindow( SKINBUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP , 0, 0, 20, 20,
hwnd, (HMENU) IDC_SELECTMODE, g_hInst, NULL);
SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), 0);
@@ -1129,9 +1111,9 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int bSkinned = db_get_b(NULL, "CLCExt", "bskinned", 0);
int i = 0;
- while(_buttons[i] != 0) {
+ while(_buttons[i] !=0) {
//SendMessage(GetDlgItem(hwnd, _buttons[i]), BM_SETSKINNED, 0, bSkinned);
- if(1&&bSkinned) {
+ if (1&&bSkinned) {
SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN + 10, 0, 0);
}
@@ -1143,20 +1125,16 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
}
- if(g_CluiData.bFilterEffective)
+ if (g_CluiData.bFilterEffective)
{
- {
- TCHAR * temp;
- //temp=alloca((strlen(szSetting)+1)*sizeof(TCHAR));
- mir_utf8decode(g_CluiData.current_viewmode,&temp);
- if(temp)
- {
- SetWindowText(GetDlgItem(hwnd, IDC_SELECTMODE), temp );
- mir_free(temp);
- }
+ TCHAR * temp;
+ //temp = alloca((strlen(szSetting)+1)*sizeof(TCHAR));
+ mir_utf8decode(g_CluiData.current_viewmode,&temp);
+ if (temp) {
+ SetWindowText(GetDlgItem(hwnd, IDC_SELECTMODE), temp );
+ mir_free(temp);
}
-
}
else
SetWindowText(GetDlgItem(hwnd, IDC_SELECTMODE), TranslateT("All contacts"));
@@ -1171,32 +1149,32 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM /*if ( g_CluiData.fDisableSkinEngine )
{
PAINTSTRUCT ps;
- HDC hdc=BeginPaint(hwnd,&ps);
+ HDC hdc = BeginPaint(hwnd,&ps);
if (hdc)
{
- HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
+ HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
FillRect(hdc,&ps.rcPaint,br);
}
EndPaint(hwnd,&ps);
}
else
*/
- if (GetParent(hwnd)==pcli->hwndContactList && g_CluiData.fLayered)
+ if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
{
ValidateRect(hwnd,NULL);
}
- else if (GetParent(hwnd)!=pcli->hwndContactList || !g_CluiData.fLayered)
+ else if (GetParent(hwnd) != pcli->hwndContactList || !g_CluiData.fLayered)
{
HDC hdc, hdc2;
HBITMAP hbmp,hbmpo;
- RECT rc={0};
+ RECT rc = {0};
GetClientRect(hwnd,&rc);
rc.right++;
rc.bottom++;
hdc = GetDC(hwnd);
- hdc2=CreateCompatibleDC(hdc);
- hbmp=ske_CreateDIB32(rc.right,rc.bottom);
- hbmpo=(HBITMAP)SelectObject(hdc2,hbmp);
+ hdc2 = CreateCompatibleDC(hdc);
+ hbmp = ske_CreateDIB32(rc.right,rc.bottom);
+ hbmpo = (HBITMAP)SelectObject(hdc2,hbmp);
if ( g_CluiData.fDisableSkinEngine )
{
@@ -1204,9 +1182,9 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM }
else
{
- if (GetParent(hwnd)!=pcli->hwndContactList)
+ if (GetParent(hwnd) != pcli->hwndContactList)
{
- HBRUSH br=GetSysColorBrush(COLOR_3DFACE);
+ HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
FillRect(hdc2,&rc,br);
}
else
@@ -1217,15 +1195,15 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
int i;
- for (i=0; _buttons[i]!=0; i++)
+ for (i = 0; _buttons[i] != 0; i++)
{
RECT childRect;
RECT MyRect;
POINT Offset;
GetWindowRect(hwnd,&MyRect);
GetWindowRect(GetDlgItem(hwnd, _buttons[i]),&childRect);
- Offset.x=childRect.left-MyRect.left;;
- Offset.y=childRect.top-MyRect.top;
+ Offset.x = childRect.left-MyRect.left;;
+ Offset.y = childRect.top-MyRect.top;
SendMessage(GetDlgItem(hwnd, _buttons[i]),BUTTONDRAWINPARENT,(WPARAM)hdc2,(LPARAM)&Offset);
}
@@ -1244,7 +1222,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM return 0;
case WM_NOTIFY:
- if (((LPNMHDR) lParam)->code==BUTTONNEEDREDRAW)
+ if (((LPNMHDR) lParam)->code == BUTTONNEEDREDRAW)
pcli->pfnInvalidateRect(hwnd, NULL, FALSE);
return 0;
@@ -1257,7 +1235,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(pcli->hwndContactList, &rcCLUI);
GetCursorPos(&pt);
- if(PtInRect(&rcCLUI, pt))
+ if (PtInRect(&rcCLUI, pt))
break;
KillTimer(hwnd, wParam);
@@ -1288,12 +1266,12 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM pt.y = rc.bottom;
selection = TrackPopupMenu(hViewModeMenu,TPM_RETURNCMD|TPM_TOPALIGN|TPM_LEFTALIGN|TPM_LEFTBUTTON, pt.x, pt.y, 0, GetParent(hwnd), NULL);
PostMessage(hwnd, WM_NULL, 0, 0);
- if(selection)
+ if (selection)
{
- if(selection == 10001)
+ if (selection == 10001)
goto clvm_config_command;
- else if(selection == 10002)
+ else if (selection == 10002)
goto clvm_reset_command;
mii.cbSize = sizeof(mii);
@@ -1302,12 +1280,10 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM mii.cch = 256;
GetMenuItemInfo(hViewModeMenu, selection, FALSE, &mii);
- {
- char * temp=mir_utf8encodeT(szTemp);
- ApplyViewMode(temp);
- if (temp) mir_free(temp);
- }
-
+ char * temp = mir_utf8encodeT(szTemp);
+ ApplyViewMode(temp);
+ if (temp)
+ mir_free(temp);
}
break;
}
@@ -1354,17 +1330,17 @@ static view_mode_t view_mode; static BOOL sttDrawViewModeBackground(HWND hwnd, HDC hdc, RECT * rect)
{
- BOOL bFloat = (GetParent(hwnd)!=pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat)
{
RECT rc;
- if (rect) rc=*rect;
+ if (rect) rc = *rect;
else GetClientRect(hwnd,&rc);
if (!view_mode.hBmpBackground && !view_mode.useWinColors)
{
- HBRUSH hbr=CreateSolidBrush(view_mode.bkColour);
+ HBRUSH hbr = CreateSolidBrush(view_mode.bkColour);
FillRect(hdc, &rc, hbr);
DeleteObject(hbr);
}
@@ -1380,18 +1356,18 @@ COLORREF sttGetColor(char * module, char * color, COLORREF defColor); //clcutils static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
{
- if(view_mode.hBmpBackground)
+ if (view_mode.hBmpBackground)
{
DeleteObject(view_mode.hBmpBackground);
- view_mode.hBmpBackground=NULL;
+ view_mode.hBmpBackground = NULL;
}
if (g_CluiData.fDisableSkinEngine)
{
DBVARIANT dbv;
- view_mode.bkColour=sttGetColor("ViewMode","BkColour",CLCDEFAULT_BKCOLOUR);
- if(db_get_b(NULL,"ViewMode","UseBitmap",CLCDEFAULT_USEBITMAP)) {
+ view_mode.bkColour = sttGetColor("ViewMode","BkColour",CLCDEFAULT_BKCOLOUR);
+ if (db_get_b(NULL,"ViewMode","UseBitmap",CLCDEFAULT_USEBITMAP)) {
if (!DBGetContactSettingString(NULL,"ViewMode","BkBitmap",&dbv)) {
- view_mode.hBmpBackground=(HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
+ view_mode.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP,0,(LPARAM)dbv.pszVal);
db_free(&dbv);
}
}
@@ -1404,70 +1380,69 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam) void CreateViewModeFrame()
{
-
CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)"View Mode Background/ViewMode",0);
ModernHookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhViewModeBackgroundSettingsChanged);
ehhViewModeBackgroundSettingsChanged(0,0);
- CLISTFrame frame = {0};
- WNDCLASS wndclass = {0};
-
- wndclass.style = 0;
- wndclass.lpfnWndProc = ViewModeFrameWndProc;
- wndclass.cbClsExtra = 0;
- wndclass.cbWndExtra = 0;
- wndclass.hInstance = g_hInst;
- //wndclass.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
- wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
- wndclass.hbrBackground = (HBRUSH) GetSysColorBrush(COLOR_3DFACE);
- wndclass.lpszMenuName = 0;
- wndclass.lpszClassName = _T("CLVMFrameWindow");
-
- RegisterClass(&wndclass);
-
- ZeroMemory(&frame, sizeof(frame));
- frame.cbSize = sizeof(frame);
- frame.tname = _T("View modes");
- frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);/*0;*/
- frame.height = 18;
- frame.TBtname = TranslateT("View Modes");
- frame.Flags=F_VISIBLE|F_SHOWTBTIP|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
- frame.align = alBottom;
- frame.hWnd = CreateWindowEx(0, _T("CLVMFrameWindow"), _T(CLVM_MODULE), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU) 0, g_hInst, NULL);
- g_hwndViewModeFrame = frame.hWnd;
- hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&frame,(LPARAM)0);
- CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
+ CLISTFrame frame = {0};
+ WNDCLASS wndclass = {0};
+
+ wndclass.style = 0;
+ wndclass.lpfnWndProc = ViewModeFrameWndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = g_hInst;
+ //wndclass.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hbrBackground = (HBRUSH) GetSysColorBrush(COLOR_3DFACE);
+ wndclass.lpszMenuName = 0;
+ wndclass.lpszClassName = _T("CLVMFrameWindow");
+
+ RegisterClass(&wndclass);
+
+ ZeroMemory(&frame, sizeof(frame));
+ frame.cbSize = sizeof(frame);
+ frame.tname = _T("View modes");
+ frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);/*0;*/
+ frame.height = 18;
+ frame.TBtname = TranslateT("View Modes");
+ frame.Flags = F_VISIBLE|F_SHOWTBTIP|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
+ frame.align = alBottom;
+ frame.hWnd = CreateWindowEx(0, _T("CLVMFrameWindow"), _T(CLVM_MODULE), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU) 0, g_hInst, NULL);
+ g_hwndViewModeFrame = frame.hWnd;
+ hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME,(WPARAM)&frame,(LPARAM)0);
+ CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)frame.hWnd,(LPARAM)ViewModePaintCallbackProc); //$$$$$ register sub for frame
-
- ApplyViewMode(NULL); //Apply last selected view mode
+
+ ApplyViewMode(NULL); //Apply last selected view mode
}
const char *MakeVariablesString(const char *src, const char *UIN);
void ApplyViewMode(const char *Name, bool onlySelector )
{
- char szSetting[256];
- char * name=(char*)Name;
- DBVARIANT dbv = {0};
-
- BOOL wasNotViewMode = ( Name!=NULL && g_CluiData.current_viewmode[0]=='\0' );
-
- g_CluiData.bFilterEffective = 0;
-
- mir_snprintf(szSetting, 256, "%c_LastMode", 246);
-
- if (!name) // Name is null - apply last stored view mode
- {
- if (!DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv))
- {
- name=(char*)_alloca(strlen(dbv.pszVal)+1);
- strcpy(name,dbv.pszVal);
- mir_free(dbv.pszVal);
- }
- else return;
- }
-
+ char szSetting[256];
+ char * name = (char*)Name;
+ DBVARIANT dbv = {0};
+
+ BOOL wasNotViewMode = ( Name != NULL && g_CluiData.current_viewmode[0] == '\0' );
+
+ g_CluiData.bFilterEffective = 0;
+
+ mir_snprintf(szSetting, 256, "%c_LastMode", 246);
+
+ if (!name) // Name is null - apply last stored view mode
+ {
+ if (!DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv))
+ {
+ name = (char*)_alloca(strlen(dbv.pszVal)+1);
+ strcpy(name,dbv.pszVal);
+ mir_free(dbv.pszVal);
+ }
+ else return;
+ }
+
if ( name[0] == '\0' )
{
// Reset View Mode
@@ -1478,14 +1453,14 @@ void ApplyViewMode(const char *Name, bool onlySelector ) mir_snprintf(szSetting, 256, "%c_LastMode", 246);
db_unset(NULL,CLVM_MODULE,szSetting);
}
- if ( g_CluiData.bOldUseGroups != (BYTE) -1 )
+ if ( g_CluiData.bOldUseGroups !=(BYTE) -1 )
CallService( MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0 );
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
- KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
+ KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
SetWindowText(GetDlgItem(g_hwndViewModeFrame, IDC_SELECTMODE), TranslateT("All contacts"));
- if (g_CluiData.boldHideOffline!=(BYTE)-1) CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)g_CluiData.boldHideOffline, 0);
- if (g_CluiData.bOldUseGroups!=(BYTE)-1) CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0);
+ if (g_CluiData.boldHideOffline != (BYTE)-1) CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)g_CluiData.boldHideOffline, 0);
+ if (g_CluiData.bOldUseGroups != (BYTE)-1) CallService(MS_CLIST_SETUSEGROUPS, (WPARAM)g_CluiData.bOldUseGroups, 0);
g_CluiData.boldHideOffline = (BYTE)-1;
g_CluiData.bOldUseGroups = (BYTE) -1;
g_CluiData.current_viewmode[0] = 0;
@@ -1495,193 +1470,190 @@ 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(lstrlenA(dbv.pszVal) >= 2)
- {
- strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
- g_CluiData.protoFilter[SIZEOF(g_CluiData.protoFilter) - 1] = 0;
- g_CluiData.bFilterEffective |= CLVM_FILTER_PROTOS;
- }
- mir_free(dbv.pszVal);
- }
- mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
- if (!DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv))
- {
- if(lstrlen(dbv.ptszVal) >= 2)
- {
- _tcsncpy(g_CluiData.groupFilter, dbv.ptszVal, SIZEOF(g_CluiData.groupFilter));
- g_CluiData.groupFilter[SIZEOF(g_CluiData.groupFilter) - 1] = 0;
- g_CluiData.bFilterEffective |= CLVM_FILTER_GROUPS;
- }
- mir_free(dbv.ptszVal);
- }
- mir_snprintf(szSetting, 256, "%c%s_SM", 246, name);
- g_CluiData.statusMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
- if(g_CluiData.statusMaskFilter >= 1)
- g_CluiData.bFilterEffective |= CLVM_FILTER_STATUS;
-
- mir_snprintf(szSetting, 256, "%c%s_SSM", 246, name);
- g_CluiData.stickyMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
- if(g_CluiData.stickyMaskFilter != -1)
- g_CluiData.bFilterEffective |= CLVM_FILTER_STICKYSTATUS;
-
- /*
- mir_snprintf(szSetting, 256, "%c%s_VA", 246, name);
- if (!DBGetContactSetting(NULL, CLVM_MODULE, szSetting, &dbv)) {
- strncpy(g_CluiData.varFilter, dbv.pszVal, sizeof(g_CluiData.varFilter));
- g_CluiData.varFilter[sizeof(g_CluiData.varFilter) - 1] = 0;
- if(lstrlenA(g_CluiData.varFilter) > 10 && ServiceExists(MS_VARS_FORMATSTRING))
- g_CluiData.bFilterEffective |= CLVM_FILTER_VARIABLES;
- mir_free(dbv.ptszVal);
- if(g_CluiData.bFilterEffective & CLVM_FILTER_VARIABLES) {
- HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- char UIN[256];
- char *id, *szProto;
- const char *varstring;
- char *temp;
- FORMATINFO fi;
-
- while(hContact) {
- szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
- if(szProto) {
- id = (char*) CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if(id) {
- if (!DBGetContactSetting(hContact, szProto, id, &dbv)) {
- if(dbv.type == DBVT_ASCIIZ) {
- mir_snprintf(UIN, 256, "<%s:%s>", szProto, dbv.pszVal);
- }
- else {
- mir_snprintf(UIN, 256, "<%s:%d>", szProto, dbv.dVal);
- }
- varstring = MakeVariablesString(g_CluiData.varFilter, UIN);
- ZeroMemory(&fi, sizeof(fi));
- fi.cbSize = sizeof(fi);
- fi.szFormat = varstring;
- fi.szSource = "";
- fi.hContact = 0;
- temp = (char *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
- if(temp && atol(temp) > 0)
- _DebugPopup(hContact, "%s, %d, %d, %d", temp, temp, fi.pCount, fi.eCount);
- variables_free(temp);
- DBFreeVariant(&dbv);
- }
- }
- }
- hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
- }
- }
- }*/
-
- g_CluiData.filterFlags = db_get_dw(NULL, CLVM_MODULE, name, 0);
-
- KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
-
- if(g_CluiData.filterFlags & CLVM_AUTOCLEAR)
- {
- DWORD timerexpire;
- mir_snprintf(szSetting, 256, "%c%s_OPT", 246, name);
- timerexpire = LOWORD(db_get_dw(NULL, CLVM_MODULE, szSetting, 0));
- strncpy(g_CluiData.old_viewmode, g_CluiData.current_viewmode, 256);
- g_CluiData.old_viewmode[255] = 0;
- CLUI_SafeSetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, NULL);
- }
- else //store last selected view mode only if it is not autoclear
- {
- mir_snprintf(szSetting, 256, "%c_LastMode", 246);
- db_set_s(NULL, CLVM_MODULE, szSetting, name);
- }
- strncpy(g_CluiData.current_viewmode, name, 256);
- g_CluiData.current_viewmode[255] = 0;
-
- if(g_CluiData.filterFlags & CLVM_USELASTMSG)
- {
- DWORD unit;
- int i;
- BYTE bSaved = g_CluiData.bSortByOrder[0];
-
- g_CluiData.bSortByOrder[0] = SORTBY_LASTMSG;
- for (i=0; i<clistCache->realCount; i++)
- {
- PDNCE pdnce=(PDNCE)clistCache->items[i];
- pdnce->dwLastMsgTime=CompareContacts2_getLMTime(pdnce->m_cache_hContact);
- }
- g_CluiData.bSortByOrder[0] = bSaved;
-
- g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG;
- mir_snprintf(szSetting, 256, "%c%s_LM", 246, name);
- g_CluiData.lastMsgFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
- if(LOBYTE(HIWORD(g_CluiData.lastMsgFilter)))
- g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN;
- else
- g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_OLDERTHAN;
- unit = LOWORD(g_CluiData.lastMsgFilter);
- switch(HIBYTE(HIWORD(g_CluiData.lastMsgFilter))) {
- case 0:
- unit *= 60;
- break;
- case 1:
- unit *= 3600;
- break;
- case 2:
- unit *= 86400;
- break;
- }
- g_CluiData.lastMsgFilter = unit;
- }
-
- if(HIWORD(g_CluiData.filterFlags) > 0)
- g_CluiData.bFilterEffective |= CLVM_STICKY_CONTACTS;
-
- if ( g_CluiData.bFilterEffective & CLVM_FILTER_STATUS )
- {
- if(g_CluiData.boldHideOffline == (BYTE)-1)
- g_CluiData.boldHideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
-
- CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
- }
- else if ( g_CluiData.boldHideOffline != (BYTE)-1 )
- {
- CallService(MS_CLIST_SETHIDEOFFLINE, g_CluiData.boldHideOffline, 0);
- g_CluiData.boldHideOffline = -1;
- }
-
- int bUseGroups = -1;
-
- if ( g_CluiData.filterFlags & CLVM_USEGROUPS )
- bUseGroups = 1;
- else if ( g_CluiData.filterFlags & CLVM_DONOTUSEGROUPS )
- bUseGroups = 0;
-
- if ( bUseGroups != -1 )
- {
- if(g_CluiData.bOldUseGroups == (BYTE)-1 )
- g_CluiData.bOldUseGroups = db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT );
-
- CallService(MS_CLIST_SETUSEGROUPS, bUseGroups, 0);
- }
- else if ( g_CluiData.bOldUseGroups != (BYTE)-1 )
- {
- CallService(MS_CLIST_SETUSEGROUPS, g_CluiData.bOldUseGroups, 0);
- g_CluiData.bOldUseGroups = -1;
- }
-
- }
+ mir_snprintf(szSetting, 256, "%c%s_PF", 246, name);
+ if (!DBGetContactSettingString(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ if (lstrlenA(dbv.pszVal) >= 2)
+ {
+ strncpy(g_CluiData.protoFilter, dbv.pszVal, SIZEOF(g_CluiData.protoFilter));
+ g_CluiData.protoFilter[SIZEOF(g_CluiData.protoFilter) - 1] = 0;
+ g_CluiData.bFilterEffective |= CLVM_FILTER_PROTOS;
+ }
+ mir_free(dbv.pszVal);
+ }
+ mir_snprintf(szSetting, 256, "%c%s_GF", 246, name);
+ if (!DBGetContactSettingTString(NULL, CLVM_MODULE, szSetting, &dbv))
+ {
+ if (lstrlen(dbv.ptszVal) >= 2)
+ {
+ _tcsncpy(g_CluiData.groupFilter, dbv.ptszVal, SIZEOF(g_CluiData.groupFilter));
+ g_CluiData.groupFilter[SIZEOF(g_CluiData.groupFilter) - 1] = 0;
+ g_CluiData.bFilterEffective |= CLVM_FILTER_GROUPS;
+ }
+ mir_free(dbv.ptszVal);
+ }
+ mir_snprintf(szSetting, 256, "%c%s_SM", 246, name);
+ g_CluiData.statusMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
+ if (g_CluiData.statusMaskFilter >= 1)
+ g_CluiData.bFilterEffective |= CLVM_FILTER_STATUS;
+
+ mir_snprintf(szSetting, 256, "%c%s_SSM", 246, name);
+ g_CluiData.stickyMaskFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
+ if (g_CluiData.stickyMaskFilter !=-1)
+ g_CluiData.bFilterEffective |= CLVM_FILTER_STICKYSTATUS;
+
+ /*
+ mir_snprintf(szSetting, 256, "%c%s_VA", 246, name);
+ if (!DBGetContactSetting(NULL, CLVM_MODULE, szSetting, &dbv)) {
+ strncpy(g_CluiData.varFilter, dbv.pszVal, sizeof(g_CluiData.varFilter));
+ g_CluiData.varFilter[sizeof(g_CluiData.varFilter) - 1] = 0;
+ if (lstrlenA(g_CluiData.varFilter) > 10 && ServiceExists(MS_VARS_FORMATSTRING))
+ g_CluiData.bFilterEffective |= CLVM_FILTER_VARIABLES;
+ mir_free(dbv.ptszVal);
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_VARIABLES) {
+ HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
+ char UIN[256];
+ char *id, *szProto;
+ const char *varstring;
+ char *temp;
+ FORMATINFO fi;
+
+ while(hContact) {
+ szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
+ if (szProto) {
+ id = (char*) CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
+ if (id) {
+ if (!DBGetContactSetting(hContact, szProto, id, &dbv)) {
+ if (dbv.type == DBVT_ASCIIZ) {
+ mir_snprintf(UIN, 256, " < %s:%s>", szProto, dbv.pszVal);
+ }
+ else {
+ mir_snprintf(UIN, 256, " < %s:%d>", szProto, dbv.dVal);
+ }
+ varstring = MakeVariablesString(g_CluiData.varFilter, UIN);
+ ZeroMemory(&fi, sizeof(fi));
+ fi.cbSize = sizeof(fi);
+ fi.szFormat = varstring;
+ fi.szSource = "";
+ fi.hContact = 0;
+ temp = (char *)CallService(MS_VARS_FORMATSTRING, (WPARAM)&fi, 0);
+ if (temp && atol(temp) > 0)
+ _DebugPopup(hContact, "%s, %d, %d, %d", temp, temp, fi.pCount, fi.eCount);
+ variables_free(temp);
+ DBFreeVariant(&dbv);
+ }
+ }
+ }
+ hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM)hContact, 0);
+ }
+ }
+ }*/
- {
- TCHAR * temp = mir_utf8decodeW( ( name[0] == (char)13 ) ? name + 1 : name );
- SetWindowText(hwndSelector, temp);
- mir_free(temp);
- }
+ g_CluiData.filterFlags = db_get_dw(NULL, CLVM_MODULE, name, 0);
+
+ KillTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE);
+
+ if (g_CluiData.filterFlags & CLVM_AUTOCLEAR)
+ {
+ DWORD timerexpire;
+ mir_snprintf(szSetting, 256, "%c%s_OPT", 246, name);
+ timerexpire = LOWORD(db_get_dw(NULL, CLVM_MODULE, szSetting, 0));
+ strncpy(g_CluiData.old_viewmode, g_CluiData.current_viewmode, 256);
+ g_CluiData.old_viewmode[255] = 0;
+ CLUI_SafeSetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, NULL);
+ }
+ else //store last selected view mode only if it is not autoclear
+ {
+ mir_snprintf(szSetting, 256, "%c_LastMode", 246);
+ db_set_s(NULL, CLVM_MODULE, szSetting, name);
+ }
+ strncpy(g_CluiData.current_viewmode, name, 256);
+ g_CluiData.current_viewmode[255] = 0;
+
+ if (g_CluiData.filterFlags & CLVM_USELASTMSG)
+ {
+ DWORD unit;
+ int i;
+ BYTE bSaved = g_CluiData.bSortByOrder[0];
+
+ g_CluiData.bSortByOrder[0] = SORTBY_LASTMSG;
+ for (i = 0; i < clistCache->realCount; i++)
+ {
+ PDNCE pdnce = (PDNCE)clistCache->items[i];
+ pdnce->dwLastMsgTime = CompareContacts2_getLMTime(pdnce->m_cache_hContact);
+ }
+ g_CluiData.bSortByOrder[0] = bSaved;
+
+ g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG;
+ mir_snprintf(szSetting, 256, "%c%s_LM", 246, name);
+ g_CluiData.lastMsgFilter = db_get_dw(NULL, CLVM_MODULE, szSetting, 0);
+ if (LOBYTE(HIWORD(g_CluiData.lastMsgFilter)))
+ g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN;
+ else
+ g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_OLDERTHAN;
+ unit = LOWORD(g_CluiData.lastMsgFilter);
+ switch(HIBYTE(HIWORD(g_CluiData.lastMsgFilter))) {
+ case 0:
+ unit *= 60;
+ break;
+ case 1:
+ unit *= 3600;
+ break;
+ case 2:
+ unit *= 86400;
+ break;
+ }
+ g_CluiData.lastMsgFilter = unit;
+ }
+
+ if (HIWORD(g_CluiData.filterFlags) > 0)
+ g_CluiData.bFilterEffective |= CLVM_STICKY_CONTACTS;
+
+ if ( g_CluiData.bFilterEffective & CLVM_FILTER_STATUS )
+ {
+ if (g_CluiData.boldHideOffline == (BYTE)-1)
+ g_CluiData.boldHideOffline = db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT);
+
+ CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
+ }
+ else if ( g_CluiData.boldHideOffline !=(BYTE)-1 )
+ {
+ CallService(MS_CLIST_SETHIDEOFFLINE, g_CluiData.boldHideOffline, 0);
+ g_CluiData.boldHideOffline = -1;
+ }
+
+ int bUseGroups = -1;
+
+ if ( g_CluiData.filterFlags & CLVM_USEGROUPS )
+ bUseGroups = 1;
+ else if ( g_CluiData.filterFlags & CLVM_DONOTUSEGROUPS )
+ bUseGroups = 0;
+
+ if ( bUseGroups !=-1 )
+ {
+ if (g_CluiData.bOldUseGroups == (BYTE)-1 )
+ g_CluiData.bOldUseGroups = db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT );
+
+ CallService(MS_CLIST_SETUSEGROUPS, bUseGroups, 0);
+ }
+ else if ( g_CluiData.bOldUseGroups !=(BYTE)-1 )
+ {
+ CallService(MS_CLIST_SETUSEGROUPS, g_CluiData.bOldUseGroups, 0);
+ g_CluiData.bOldUseGroups = -1;
+ }
+ }
+
+ TCHAR * temp = mir_utf8decodeW( ( name[0] == (char)13 ) ? name + 1 : name );
+ SetWindowText(hwndSelector, temp);
+ mir_free(temp);
- pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
- CLUI__cliInvalidateRect( pcli->hwndStatus, NULL, FALSE );
-// SetButtonStates(pcli->hwndContactList);
+ pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
+ CLUI__cliInvalidateRect( pcli->hwndStatus, NULL, FALSE );
+ // SetButtonStates(pcli->hwndContactList);
}
static int SkinSetViewMode(WPARAM wParam /*char * name*/, LPARAM lParam /*int index*/)
{
- if (wParam==0 && lParam==0)
+ if (wParam == 0 && lParam == 0)
{
ApplyViewMode( NULL );
}
diff --git a/plugins/Clist_modern/modern_xptheme.cpp b/plugins/Clist_modern/modern_xptheme.cpp index 53b9b7541e..fa09a4d16d 100644 --- a/plugins/Clist_modern/modern_xptheme.cpp +++ b/plugins/Clist_modern/modern_xptheme.cpp @@ -12,20 +12,20 @@ typedef struct _tagXPTObject LPCWSTR lpcwClassObject;
} XPTObject;
-static SortedList * xptObjectList=NULL;
+static SortedList * xptObjectList = NULL;
static CRITICAL_SECTION xptCS;
-static BOOL xptModuleLoaded=FALSE;
+static BOOL xptModuleLoaded = FALSE;
static HMODULE _xpt_ThemeAPIHandle = NULL; // handle to uxtheme.dll
static HANDLE (WINAPI *_xpt_OpenThemeData)(HWND, LPCWSTR) = NULL;
-static HRESULT (WINAPI *_xpt_CloseThemeData)(HANDLE)= NULL;
-static BOOL (WINAPI *_xpt_IsThemeBackgroundPartiallyTransparent)(HANDLE, int,int)= NULL;
-static BOOL (WINAPI *_xpt_EnableThemeDialogTexture)(HANDLE, DWORD)=NULL;
-static HRESULT (WINAPI *_xpt_GetThemePartSize)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, int eSize, SIZE *psz )= NULL;
-static HRESULT (WINAPI *_xpt_DrawThemeParentBackground)(HWND, HDC, const RECT *)= NULL;
-static HRESULT (WINAPI *_xpt_DrawThemeBackground)(HANDLE, HDC, int, int,const RECT *, const RECT *)= NULL;
-static HRESULT (WINAPI *_xpt_DrawThemeText)(HANDLE, HDC, int, int, LPCWSTR, int,DWORD, DWORD, const RECT *)= NULL;
+static HRESULT (WINAPI *_xpt_CloseThemeData)(HANDLE) = NULL;
+static BOOL (WINAPI *_xpt_IsThemeBackgroundPartiallyTransparent)(HANDLE, int,int) = NULL;
+static BOOL (WINAPI *_xpt_EnableThemeDialogTexture)(HANDLE, DWORD) = NULL;
+static HRESULT (WINAPI *_xpt_GetThemePartSize)(HTHEME hTheme, HDC hdc, int iPartId, int iStateId, RECT *prc, int eSize, SIZE *psz ) = NULL;
+static HRESULT (WINAPI *_xpt_DrawThemeParentBackground)(HWND, HDC, const RECT *) = NULL;
+static HRESULT (WINAPI *_xpt_DrawThemeBackground)(HANDLE, HDC, int, int,const RECT *, const RECT *) = NULL;
+static HRESULT (WINAPI *_xpt_DrawThemeText)(HANDLE, HDC, int, int, LPCWSTR, int,DWORD, DWORD, const RECT *) = NULL;
#undef MGPROC
@@ -73,12 +73,12 @@ static int _xpt_ThemeSupport() static void _sttXptCloseThemeData(XPTObject * xptObject)
{
_xpt_CloseThemeData(xptObject->hThemeHandle);
- xptObject->hThemeHandle=NULL;
+ xptObject->hThemeHandle = NULL;
}
static void _sttXptReloadThemeData(XPTObject * xptObject)
{
_xpt_CloseThemeData(xptObject->hThemeHandle);
- xptObject->hThemeHandle=_xpt_OpenThemeData(xptObject->hOwnerWindow, xptObject->lpcwClassObject);
+ xptObject->hThemeHandle = _xpt_OpenThemeData(xptObject->hOwnerWindow, xptObject->lpcwClassObject);
}
@@ -87,8 +87,8 @@ HRESULT XPThemesLoadModule() if (_xpt_ThemeSupport())
{
InitializeCriticalSection(&xptCS);
- xptObjectList=List_Create(0,1);
- xptModuleLoaded=TRUE;
+ xptObjectList = List_Create(0,1);
+ xptModuleLoaded = TRUE;
}
return S_OK;
}
@@ -97,7 +97,7 @@ void XPThemesUnloadModule() {
xptcheck;
xptlock();
- xptModuleLoaded=FALSE;
+ xptModuleLoaded = FALSE;
xptunlock();
li_ListDestruct(xptObjectList,_sttXptObjectDestructor);
DeleteCriticalSection(&xptCS);
@@ -107,13 +107,13 @@ void XPThemesUnloadModule() BOOL xpt_IsThemed(XPTHANDLE xptHandle)
{
- BOOL res=FALSE;
+ BOOL res = FALSE;
xptcheck FALSE;
if (!xptHandle) return FALSE;
xptlock();
{
if (xpt_IsValidHandle(xptHandle) && ((XPTObject*) xptHandle)->hThemeHandle)
- res=TRUE;
+ res = TRUE;
}
xptunlock();
return res;
@@ -121,13 +121,13 @@ BOOL xpt_IsThemed(XPTHANDLE xptHandle) BOOL xpt_IsValidHandle(XPTHANDLE xptHandle)
{
- BOOL res=FALSE;
+ BOOL res = FALSE;
xptcheck FALSE;
if (!xptHandle) return FALSE;
xptlock();
{
- if (List_IndexOf(xptObjectList, (void*)xptHandle)!=-1)
- res=TRUE;
+ if (List_IndexOf(xptObjectList, (void*)xptHandle) != -1)
+ res = TRUE;
}
xptunlock();
return res;
@@ -139,12 +139,12 @@ XPTHANDLE xpt_AddThemeHandle(HWND hwnd, LPCWSTR className) xptcheck NULL;
xptlock();
{
- XPTObject* xptObject=(XPTObject*)mir_calloc(sizeof(XPTObject));
- xptObject->lpcwClassObject=className;
- xptObject->hOwnerWindow=hwnd;
+ XPTObject* xptObject = (XPTObject*)mir_calloc(sizeof(XPTObject));
+ xptObject->lpcwClassObject = className;
+ xptObject->hOwnerWindow = hwnd;
_sttXptReloadThemeData(xptObject);
List_InsertPtr(xptObjectList, (void*)xptObject);
- res=(XPTHANDLE)xptObject;
+ res = (XPTHANDLE)xptObject;
}
xptunlock();
return res;
@@ -156,7 +156,7 @@ void xpt_FreeThemeHandle(XPTHANDLE xptHandle) xptlock();
if (xpt_IsValidHandle(xptHandle))
{
- XPTObject* xptObject=(XPTObject*)xptHandle;
+ XPTObject* xptObject = (XPTObject*)xptHandle;
_sttXptCloseThemeData(xptObject);
_sttXptObjectDestructor((void *) xptHandle);
List_Remove(xptObjectList, List_IndexOf(xptObjectList,(void *) xptHandle));
@@ -168,11 +168,11 @@ void xpt_FreeThemeForWindow(HWND hwnd) xptcheck;
xptlock();
{
- int i=0;
- while (i<xptObjectList->realCount)
+ int i = 0;
+ while (i < xptObjectList->realCount)
{
- XPTObject* xptObject=(XPTObject*)xptObjectList->items[i];
- if (xptObject->hOwnerWindow==hwnd)
+ XPTObject* xptObject = (XPTObject*)xptObjectList->items[i];
+ if (xptObject->hOwnerWindow == hwnd)
{
_sttXptCloseThemeData(xptObject);
_sttXptObjectDestructor((void *) xptObject);
@@ -191,18 +191,18 @@ void xpt_OnWM_THEMECHANGED() xptlock();
{
int i;
- for (i=0; i<xptObjectList->realCount; i++)
+ for (i = 0; i < xptObjectList->realCount; i++)
_sttXptReloadThemeData((XPTObject*)xptObjectList->items[i]);
}
xptunlock();
}
HRESULT xpt_DrawThemeBackground(XPTHANDLE xptHandle, HDC hdc, int type, int state, const RECT * sizeRect, const RECT * clipRect)
{
- HRESULT res=S_FALSE;
+ HRESULT res = S_FALSE;
xptcheck S_FALSE;
xptlock();
if (xpt_IsThemed(xptHandle))
- res=_xpt_DrawThemeBackground(((XPTObject*)xptHandle)->hThemeHandle, hdc, type, state, sizeRect, clipRect);
+ res = _xpt_DrawThemeBackground(((XPTObject*)xptHandle)->hThemeHandle, hdc, type, state, sizeRect, clipRect);
xptunlock();
return res;
}
@@ -213,24 +213,24 @@ HRESULT xpt_DrawThemeParentBackground(HWND hWnd, HDC hdc, const RECT * sizeRect) }
BOOL xpt_IsThemeBackgroundPartiallyTransparent(XPTHANDLE xptHandle, int type, int state)
{
- BOOL res=FALSE;
+ BOOL res = FALSE;
xptcheck FALSE;
xptlock();
if (xpt_IsThemed(xptHandle))
- res=_xpt_IsThemeBackgroundPartiallyTransparent(((XPTObject*)xptHandle)->hThemeHandle, type, state);
+ res = _xpt_IsThemeBackgroundPartiallyTransparent(((XPTObject*)xptHandle)->hThemeHandle, type, state);
xptunlock();
return res;
}
HRESULT xpt_DrawTheme(XPTHANDLE xptHandle, HWND hwnd, HDC hdc, int type, int state, const RECT *sizeRect, const RECT * clipRect)
{
- HRESULT res=S_FALSE;
+ HRESULT res = S_FALSE;
xptcheck S_FALSE;
xptlock();
if (xpt_IsThemed(xptHandle))
{
if (_xpt_IsThemeBackgroundPartiallyTransparent(((XPTObject*)xptHandle)->hThemeHandle, type, state))
- res=_xpt_DrawThemeParentBackground(hwnd,hdc,sizeRect);
- res=_xpt_DrawThemeBackground(((XPTObject*)xptHandle)->hThemeHandle, hdc, type, state, sizeRect, clipRect);
+ res = _xpt_DrawThemeParentBackground(hwnd,hdc,sizeRect);
+ res = _xpt_DrawThemeBackground(((XPTObject*)xptHandle)->hThemeHandle, hdc, type, state, sizeRect, clipRect);
}
xptunlock();
return res;
@@ -238,7 +238,7 @@ HRESULT xpt_DrawTheme(XPTHANDLE xptHandle, HWND hwnd, HDC hdc, int type, int sta HRESULT xpt_DrawThemeText(XPTHANDLE xptHandle, HDC hdc, int type, int state, LPCTSTR lpStr, int len, DWORD flag1, DWORD flag2, const RECT * textRect)
{
- HRESULT res=S_FALSE;
+ HRESULT res = S_FALSE;
xptcheck S_FALSE;
xptlock();
if (xpt_IsThemed(xptHandle))
@@ -250,10 +250,10 @@ HRESULT xpt_DrawThemeText(XPTHANDLE xptHandle, HDC hdc, int type, int state, LPC }
BOOL xpt_EnableThemeDialogTexture(HWND hwnd, DWORD flags)
{
- BOOL res=FALSE;
+ BOOL res = FALSE;
xptcheck res;
xptlock();
- res=_xpt_EnableThemeDialogTexture(hwnd, flags);
+ res = _xpt_EnableThemeDialogTexture(hwnd, flags);
xptunlock();
return res;
}
diff --git a/plugins/Clist_modern/res/skin.msf b/plugins/Clist_modern/res/skin.msf index d7efd37eff..4f8c1a5b58 100644 --- a/plugins/Clist_modern/res/skin.msf +++ b/plugins/Clist_modern/res/skin.msf @@ -1,155 +1,155 @@ [Skin_Description_Section]
- Name=reVista Remixed v0.5
- SubStyle=Normal
- Author=Fyr(basic skin)&Angeli-Ka(images, layout, size tuning)
- Contact=angil@nm.ru
- URL=http://angeli-ka.my1.ru/
- Preview=
- Description=Skin for clist_modern layered
- SkinFolder=
-;==================================================================================================
+ Name = reVista Remixed v0.5
+ SubStyle = Normal
+ Author = Fyr(basic skin)&Angeli-Ka(images, layout, size tuning)
+ Contact = angil@nm.ru
+ URL = http://angeli-ka.my1.ru/
+ Preview =
+ Description = Skin for clist_modern layered
+ SkinFolder =
+; == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
; Don't use any of files from this archive for other than personal purposes without my permission.
-;==================================================================================================
+; == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == == ==
[ModernSkin]
-fProfFont=sVerdana,12,---
-
-
-tProfile0=s$$Window,26,4,-32,19,LTRTCC,fProfFont,0x80535666,0,Miranda IM
-tProfile1=s$$Window,28,6,-30,21,LTRTCC,fProfFont,0x80FFFFFF,0,Miranda IM
-tProfile2=s$$Window,27,5,-31,20,LTRTCC,fProfFont,0x395C7E,0,Miranda IM
-
-$$Window=sGlyph,Fragment,back%.tga,0,0,100,50,StretchBoth,11,24,12,12,255
-
-$$Group/Open=sGlyph,Fragment,back%.tga,0,50,7,20,StretchBoth,3,2,3,2,255
-$$Group/Open/Hot=sGlyph,Fragment,back%.tga,7,50,7,20,StretchBoth,3,2,3,2,255
-$$Group/Open/Selected=sGlyph,Fragment,back%.tga,7,50,7,20,StretchBoth,3,2,3,2,255
-
-$$Group/Closed=sGlyph,Fragment,back%.tga,66,66,4,4,StretchBoth,0,0,0,0,255
-$$Group/Closed/Hot=sGlyph,Fragment,back%.tga,38,50,4,20,StretchBoth,1,3,1,3,255
-$$Group/Closed/Selected=sGlyph,Fragment,back%.tga,38,50,4,20,StretchBoth,1,3,1,3,150
-
-$$SubGroup/Open=sGlyph,Fragment,back%.tga,0,50,7,20,StretchBoth,3,2,3,2,255
-$$SubGroup/Open/Hot=sGlyph,Fragment,back%.tga,7,50,7,20,StretchBoth,3,2,3,2,255
-$$SubGroup/Open/Selected=sGlyph,Fragment,back%.tga,7,50,7,20,StretchBoth,3,2,3,2,255
-
-$$SubGroup/Closed=sGlyph,Fragment,back%.tga,66,66,4,4,StretchBoth,0,0,0,0,255
-$$SubGroup/Closed/Hot=sGlyph,Fragment,back%.tga,38,50,4,20,StretchBoth,1,3,1,3,255
-$$SubGroup/Closed/Selected=sGlyph,Fragment,back%.tga,38,50,4,20,StretchBoth,1,3,1,3,150
-
-$$Contact/Hot=sGlyph,Fragment,back%.tga,42,50,4,20,StretchBoth,1,6,1,6,255
-$$Contact/Selected=sGlyph,Fragment,back%.tga,42,50,4,20,StretchBoth,1,3,1,3,250
-$$Contact/Normal=sGlyph,Fragment,back%.tga,46,68,2,2,StretchBoth,0,0,0,2,255
-$$Contact/Last=sGlyph,Fragment,back%.tga,46,68,2,2,StretchBoth,0,0,0,2,255
-$$Contact/First=sGlyph,Fragment,back%.tga,46,68,2,2,StretchBoth,0,0,0,2,255
-
-$$Scroll/BtnUp=sGlyph,Fragment,back%.tga,62,50,16,16,StretchBoth,0,0,0,0,255
-$$Scroll/BtnDn=sGlyph,Fragment,back%.tga,46,50,16,16,StretchBoth,0,0,0,0,255
-$$Scroll/Thumb=sGlyph,Fragment,back%.tga,24,50,7,22,StretchBoth,3,4,2,5,150
-$$Scroll/Back=sGlyph,Fragment,back%.tga,48,66,16,4,StretchBoth,2,0,2,0,255
-
-$$FrameTitleBar=sGlyph,Fragment,back%.tga,14,50,4,20,StretchBoth,1,2,1,2,255
-
-$$StatusBar=sGlyph,Fragment,back%.tga,18,50,6,20,StretchBoth,2,2,2,2,255
-
-$$ViewMode/CurrentMode=sGlyph,Fragment,back%.tga,32,50,6,20,StretchBoth,3,4,2,5,255
-$$ViewMode/CurrentMode/Hot=sGlyph,Fragment,back%.tga,25,50,6,20,StretchBoth,3,4,2,5,255
-$$ViewMode/CurrentMode/Pressed=sGlyph,Fragment,back%.tga,24,49,7,20,StretchBoth,3,4,2,5,255
-$$ViewMode/SetupMode=sGlyph,Fragment,back%.tga,31,50,7,20,StretchBoth,3,4,2,5,255
-$$ViewMode/SetupMode/Hot=sGlyph,Fragment,back%.tga,24,50,7,20,StretchBoth,3,4,2,5,255
-$$ViewMode/SetupMode/Pressed=sGlyph,Fragment,back%.tga,24,49,7,20,StretchBoth,3,4,2,5,255
-$$ViewMode/ResetMode=sGlyph,Fragment,back%.tga,31,50,7,20,StretchBoth,3,4,2,5,255
-$$ViewMode/ResetMode/Hot=sGlyph,Fragment,back%.tga,24,50,7,20,StretchBoth,3,4,2,5,255
-$$ViewMode/ResetMode/Pressed=sGlyph,Fragment,back%.tga,24,49,7,20,StretchBoth,3,4,2,5,255
-
-$$Button/Minimize/Normal=sGlyph,Fragment,back%.tga,100,0,26,15,StretchBoth,0,3,0,3,255
-$$Button/Minimize/Hovered=sGlyph,Fragment,back%.tga,100,15,26,15,StretchBoth,0,3,0,3,255
-$$Button/Minimize/Down=sGlyph,Fragment,back%.tga,100,30,26,15,StretchBoth,0,3,0,3,255
-$$Button/Menu/Normal=sGlyph,Fragment,back%.tga,101,50,24,16,StretchBoth,0,0,0,0,180
-$$Button/Menu/Hovered=sGlyph,Fragment,back%.tga,101,50,24,16,StretchBoth,0,0,0,0,255
-$$Button/Menu/Down=sGlyph,Fragment,back%.tga,77,50,24,16,StretchBoth,0,0,0,0,255
-
-$$Background=sGlyph,Skip
-
-
-$$BarButton=sGlyph,Fragment,back%.tga,31,50,7,20,StretchBoth,3,4,2,5,150
-$$BarButton/Hot=sGlyph,Fragment,back%.tga,24,50,7,20,StretchBoth,3,4,2,5,200
-$$BarButton/Pressed=sGlyph,Fragment,back%.tga,24,49,7,20,StretchBoth,3,4,2,5,255
-
-@0=s$$Window:Main,ID=Background
-@1=s$$Background:CL,ID=Background
-@10=s$$SubGroup/Closed/Hot:CL,ID=Row,Type=Group,Open=False,Hot=True,Indent^0
-@11=s$$SubGroup/Closed/Selected:CL,ID=Row,Type=Group,Open=False,Selected=True,Indent^0
-@12=s$$SubGroup/Closed:CL,ID=Row,Type=Group,Open=False,Indent^0
-@13=s$$SubGroup/Open/Hot:CL,ID=Row,Type=Group,Open=True,Hot=True,Indent^0
-@14=s$$SubGroup/Open/Selected:CL,ID=Row,Type=Group,Open=True,Selected=True,Indent^0
-@15=s$$SubGroup/Open:CL,ID=Row,Type=Group,Open=True,Indent^0
-@20=s$$Group/Closed/Hot:CL,ID=Row,Type=Group,Open=False,Hot=True
-@21=s$$Group/Closed/Selected:CL,ID=Row,Type=Group,Open=False,Selected=True
-@22=s$$Group/Closed:CL,ID=Row,Type=Group,Open=False
-@23=s$$Group/Open/Hot:CL,ID=Row,Type=Group,Open=True,Hot=True
-@24=s$$Group/Open/Selected:CL,ID=Row,Type=Group,Open=True,Selected=True
-@25=s$$Group/Open:CL,ID=Row,Type=Group,Open=True
-@50=s$$Contact/Selected:CL,ID=Row,Type=*Contact,Selected=True
-@51=s$$Contact/Hot:CL,ID=Row,Type=*Contact,Hot=True
-@62=s$$Contact/Last:CL,ID=Row,Type=SubContact,SubPos=Last,GroupPos=Last
-@63=s$$Contact/Normal:CL,ID=Row,Type=SubContact,SubPos=First
-@64=s$$Contact/Last:CL,ID=Row,Type=SubContact,SubPos=First-Single,GroupPos=Last
-@65=s$$Contact/Normal:CL,ID=Row,Type=SubContact,SubPos=Last,GroupPos=First
-@66=s$$Contact/Last:CL,ID=Row,Type=SubContact,SubPos=First-Single,GroupPos=First-Single
-@67=s$$Contact/Last:CL,ID=Row,Type=MetaContact,GroupPos=Last,Open=False
-@68=s$$Contact/First:CL,ID=Row,Type=MetaContact,GroupPos=First,Open=False
-@69=s$$Contact/First:CL,ID=Row,Type=MetaContact,GroupPos=First
-@70=s$$Contact/Last:CL,ID=Row,Type=MetaContact,GroupPos=First-Single,Open=False
-@71=s$$Contact/Normal:CL,ID=Row,Type=Contact,GroupPos=Last,Indent=2
-@72=s$$Contact/Normal:CL,ID=Row,Type=Contact,GroupPos=First,Indent=2
-@73=s$$Contact/Last:CL,ID=Row,Type=Contact,GroupPos=Last
-@74=s$$Contact/Last:CL,ID=Row,Type=Contact,GroupPos=First-Single
-;@75=s$$Group/Open:CL,ID=Row,Type=*Contact,Index=0 ; Fix of first contact is group liked then groups are disabled fix
-@75=s$$Contact/First:CL,ID=Row,Type=*Contact,Index=0
-@76=s$$Contact/First:CL,ID=Row,Type=*Contact,Index=1
-@77=s$$Contact/First:CL,ID=Row,Type=*Contact,GroupPos=First
-@78=s$$Contact/Normal:CL,ID=Row,Type=*Contact
-@80=s$$Scroll/Back:Main,ID=ScrollBar,Part=Back
-@90=s$$Scroll/BtnUp:Main,ID=ScrollBar,Part=UpLineButton
-@100=s$$Scroll/BtnDn:Main,ID=ScrollBar,Part=DownLineButton
-@110=s$$Scroll/Thumb:Main,ID=ScrollBar,Part=Thumb
-@120=s$$FrameTitleBar:Main,ID=FrameCaption
-@130=s$$StatusBar:Main,ID=StatusBar
-@131=s$$EventArea:Main,ID=EventArea
-@140=s$$Button/Close/Down:MButton,ID=close,Down=1
-@150=s$$Button/Close/Hovered:MButton,ID=close,Hovered=1
-@160=s$$Button/Close/Normal:MButton,ID=close
-@170=s$$Button/Minimize/Down:MButton,ID=minimize,Down=1
-@180=s$$Button/Minimize/Hovered:MButton,ID=minimize,Hovered=1
-@190=s$$Button/Minimize/Normal:MButton,ID=minimize
-@200=s$$Button/Menu/Down:MButton,ID=mainmenu,Down=1
-@210=s$$Button/Menu/Hovered:MButton,ID=mainmenu,Hovered=1
-@220=s$$Button/Menu/Normal:MButton,ID=mainmenu
-
-@300=s$$ViewMode:ViewMode,ID=Background
-@301=s$$ViewMode/CurrentMode/Pressed:Button,ID=ViewMode.Select,Pressed=True
-@302=s$$ViewMode/CurrentMode/Hot:Button,ID=ViewMode.Select,Hovered=True
-@303=s$$ViewMode/CurrentMode:Button,ID=ViewMode.Select
-@304=s$$ViewMode/SetupMode/Pressed:Button,ID=ViewMode.Setup,Pressed=True
-@305=s$$ViewMode/SetupMode/Hot:Button,ID=ViewMode.Setup,Hovered=True
-@306=s$$ViewMode/SetupMode:Button,ID=ViewMode.Setup
-@307=s$$ViewMode/ResetMode/Pressed:Button,ID=ViewMode.Clear,Pressed=True
-@308=s$$ViewMode/ResetMode/Hot:Button,ID=ViewMode.Clear,Hovered=True
-@309=s$$ViewMode/ResetMode:Button,ID=ViewMode.Clear
-@1610=s$$BarButton/Pressed:Button,Pressed=True
-@1620=s$$BarButton/Hot:Button,Hovered=True
-@1630=s$$BarButton:Button
-
-#mainmenu=sPush,CList/ShowMainMenu,10,5,34,21,-----,0,0,Show Main Menu
-#minimize=sPush,CList/ShowHide,-36,3,-10,18,R-R--,0,0,Minimize Miranda
+fProfFont = sVerdana,12,---
+
+
+tProfile0 = s$$Window,26,4,-32,19,LTRTCC,fProfFont,0x80535666,0,Miranda IM
+tProfile1 = s$$Window,28,6,-30,21,LTRTCC,fProfFont,0x80FFFFFF,0,Miranda IM
+tProfile2 = s$$Window,27,5,-31,20,LTRTCC,fProfFont,0x395C7E,0,Miranda IM
+
+$$Window = sGlyph,Fragment,back%.tga,0,0,100,50,StretchBoth,11,24,12,12,255
+
+$$Group/Open = sGlyph,Fragment,back%.tga,0,50,7,20,StretchBoth,3,2,3,2,255
+$$Group/Open/Hot = sGlyph,Fragment,back%.tga,7,50,7,20,StretchBoth,3,2,3,2,255
+$$Group/Open/Selected = sGlyph,Fragment,back%.tga,7,50,7,20,StretchBoth,3,2,3,2,255
+
+$$Group/Closed = sGlyph,Fragment,back%.tga,66,66,4,4,StretchBoth,0,0,0,0,255
+$$Group/Closed/Hot = sGlyph,Fragment,back%.tga,38,50,4,20,StretchBoth,1,3,1,3,255
+$$Group/Closed/Selected = sGlyph,Fragment,back%.tga,38,50,4,20,StretchBoth,1,3,1,3,150
+
+$$SubGroup/Open = sGlyph,Fragment,back%.tga,0,50,7,20,StretchBoth,3,2,3,2,255
+$$SubGroup/Open/Hot = sGlyph,Fragment,back%.tga,7,50,7,20,StretchBoth,3,2,3,2,255
+$$SubGroup/Open/Selected = sGlyph,Fragment,back%.tga,7,50,7,20,StretchBoth,3,2,3,2,255
+
+$$SubGroup/Closed = sGlyph,Fragment,back%.tga,66,66,4,4,StretchBoth,0,0,0,0,255
+$$SubGroup/Closed/Hot = sGlyph,Fragment,back%.tga,38,50,4,20,StretchBoth,1,3,1,3,255
+$$SubGroup/Closed/Selected = sGlyph,Fragment,back%.tga,38,50,4,20,StretchBoth,1,3,1,3,150
+
+$$Contact/Hot = sGlyph,Fragment,back%.tga,42,50,4,20,StretchBoth,1,6,1,6,255
+$$Contact/Selected = sGlyph,Fragment,back%.tga,42,50,4,20,StretchBoth,1,3,1,3,250
+$$Contact/Normal = sGlyph,Fragment,back%.tga,46,68,2,2,StretchBoth,0,0,0,2,255
+$$Contact/Last = sGlyph,Fragment,back%.tga,46,68,2,2,StretchBoth,0,0,0,2,255
+$$Contact/First = sGlyph,Fragment,back%.tga,46,68,2,2,StretchBoth,0,0,0,2,255
+
+$$Scroll/BtnUp = sGlyph,Fragment,back%.tga,62,50,16,16,StretchBoth,0,0,0,0,255
+$$Scroll/BtnDn = sGlyph,Fragment,back%.tga,46,50,16,16,StretchBoth,0,0,0,0,255
+$$Scroll/Thumb = sGlyph,Fragment,back%.tga,24,50,7,22,StretchBoth,3,4,2,5,150
+$$Scroll/Back = sGlyph,Fragment,back%.tga,48,66,16,4,StretchBoth,2,0,2,0,255
+
+$$FrameTitleBar = sGlyph,Fragment,back%.tga,14,50,4,20,StretchBoth,1,2,1,2,255
+
+$$StatusBar = sGlyph,Fragment,back%.tga,18,50,6,20,StretchBoth,2,2,2,2,255
+
+$$ViewMode/CurrentMode = sGlyph,Fragment,back%.tga,32,50,6,20,StretchBoth,3,4,2,5,255
+$$ViewMode/CurrentMode/Hot = sGlyph,Fragment,back%.tga,25,50,6,20,StretchBoth,3,4,2,5,255
+$$ViewMode/CurrentMode/Pressed = sGlyph,Fragment,back%.tga,24,49,7,20,StretchBoth,3,4,2,5,255
+$$ViewMode/SetupMode = sGlyph,Fragment,back%.tga,31,50,7,20,StretchBoth,3,4,2,5,255
+$$ViewMode/SetupMode/Hot = sGlyph,Fragment,back%.tga,24,50,7,20,StretchBoth,3,4,2,5,255
+$$ViewMode/SetupMode/Pressed = sGlyph,Fragment,back%.tga,24,49,7,20,StretchBoth,3,4,2,5,255
+$$ViewMode/ResetMode = sGlyph,Fragment,back%.tga,31,50,7,20,StretchBoth,3,4,2,5,255
+$$ViewMode/ResetMode/Hot = sGlyph,Fragment,back%.tga,24,50,7,20,StretchBoth,3,4,2,5,255
+$$ViewMode/ResetMode/Pressed = sGlyph,Fragment,back%.tga,24,49,7,20,StretchBoth,3,4,2,5,255
+
+$$Button/Minimize/Normal = sGlyph,Fragment,back%.tga,100,0,26,15,StretchBoth,0,3,0,3,255
+$$Button/Minimize/Hovered = sGlyph,Fragment,back%.tga,100,15,26,15,StretchBoth,0,3,0,3,255
+$$Button/Minimize/Down = sGlyph,Fragment,back%.tga,100,30,26,15,StretchBoth,0,3,0,3,255
+$$Button/Menu/Normal = sGlyph,Fragment,back%.tga,101,50,24,16,StretchBoth,0,0,0,0,180
+$$Button/Menu/Hovered = sGlyph,Fragment,back%.tga,101,50,24,16,StretchBoth,0,0,0,0,255
+$$Button/Menu/Down = sGlyph,Fragment,back%.tga,77,50,24,16,StretchBoth,0,0,0,0,255
+
+$$Background = sGlyph,Skip
+
+
+$$BarButton = sGlyph,Fragment,back%.tga,31,50,7,20,StretchBoth,3,4,2,5,150
+$$BarButton/Hot = sGlyph,Fragment,back%.tga,24,50,7,20,StretchBoth,3,4,2,5,200
+$$BarButton/Pressed = sGlyph,Fragment,back%.tga,24,49,7,20,StretchBoth,3,4,2,5,255
+
+@0 = s$$Window:Main,ID = Background
+@1 = s$$Background:CL,ID = Background
+@10 = s$$SubGroup/Closed/Hot:CL,ID = Row,Type = Group,Open = False,Hot = True,Indent^0
+@11 = s$$SubGroup/Closed/Selected:CL,ID = Row,Type = Group,Open = False,Selected = True,Indent^0
+@12 = s$$SubGroup/Closed:CL,ID = Row,Type = Group,Open = False,Indent^0
+@13 = s$$SubGroup/Open/Hot:CL,ID = Row,Type = Group,Open = True,Hot = True,Indent^0
+@14 = s$$SubGroup/Open/Selected:CL,ID = Row,Type = Group,Open = True,Selected = True,Indent^0
+@15 = s$$SubGroup/Open:CL,ID = Row,Type = Group,Open = True,Indent^0
+@20 = s$$Group/Closed/Hot:CL,ID = Row,Type = Group,Open = False,Hot = True
+@21 = s$$Group/Closed/Selected:CL,ID = Row,Type = Group,Open = False,Selected = True
+@22 = s$$Group/Closed:CL,ID = Row,Type = Group,Open = False
+@23 = s$$Group/Open/Hot:CL,ID = Row,Type = Group,Open = True,Hot = True
+@24 = s$$Group/Open/Selected:CL,ID = Row,Type = Group,Open = True,Selected = True
+@25 = s$$Group/Open:CL,ID = Row,Type = Group,Open = True
+@50 = s$$Contact/Selected:CL,ID = Row,Type = *Contact,Selected = True
+@51 = s$$Contact/Hot:CL,ID = Row,Type = *Contact,Hot = True
+@62 = s$$Contact/Last:CL,ID = Row,Type = SubContact,SubPos = Last,GroupPos = Last
+@63 = s$$Contact/Normal:CL,ID = Row,Type = SubContact,SubPos = First
+@64 = s$$Contact/Last:CL,ID = Row,Type = SubContact,SubPos = First-Single,GroupPos = Last
+@65 = s$$Contact/Normal:CL,ID = Row,Type = SubContact,SubPos = Last,GroupPos = First
+@66 = s$$Contact/Last:CL,ID = Row,Type = SubContact,SubPos = First-Single,GroupPos = First-Single
+@67 = s$$Contact/Last:CL,ID = Row,Type = MetaContact,GroupPos = Last,Open = False
+@68 = s$$Contact/First:CL,ID = Row,Type = MetaContact,GroupPos = First,Open = False
+@69 = s$$Contact/First:CL,ID = Row,Type = MetaContact,GroupPos = First
+@70 = s$$Contact/Last:CL,ID = Row,Type = MetaContact,GroupPos = First-Single,Open = False
+@71 = s$$Contact/Normal:CL,ID = Row,Type = Contact,GroupPos = Last,Indent = 2
+@72 = s$$Contact/Normal:CL,ID = Row,Type = Contact,GroupPos = First,Indent = 2
+@73 = s$$Contact/Last:CL,ID = Row,Type = Contact,GroupPos = Last
+@74 = s$$Contact/Last:CL,ID = Row,Type = Contact,GroupPos = First-Single
+;@75 = s$$Group/Open:CL,ID = Row,Type = *Contact,Index = 0 ; Fix of first contact is group liked then groups are disabled fix
+@75 = s$$Contact/First:CL,ID = Row,Type = *Contact,Index = 0
+@76 = s$$Contact/First:CL,ID = Row,Type = *Contact,Index = 1
+@77 = s$$Contact/First:CL,ID = Row,Type = *Contact,GroupPos = First
+@78 = s$$Contact/Normal:CL,ID = Row,Type = *Contact
+@80 = s$$Scroll/Back:Main,ID = ScrollBar,Part = Back
+@90 = s$$Scroll/BtnUp:Main,ID = ScrollBar,Part = UpLineButton
+@100 = s$$Scroll/BtnDn:Main,ID = ScrollBar,Part = DownLineButton
+@110 = s$$Scroll/Thumb:Main,ID = ScrollBar,Part = Thumb
+@120 = s$$FrameTitleBar:Main,ID = FrameCaption
+@130 = s$$StatusBar:Main,ID = StatusBar
+@131 = s$$EventArea:Main,ID = EventArea
+@140 = s$$Button/Close/Down:MButton,ID = close,Down = 1
+@150 = s$$Button/Close/Hovered:MButton,ID = close,Hovered = 1
+@160 = s$$Button/Close/Normal:MButton,ID = close
+@170 = s$$Button/Minimize/Down:MButton,ID = minimize,Down = 1
+@180 = s$$Button/Minimize/Hovered:MButton,ID = minimize,Hovered = 1
+@190 = s$$Button/Minimize/Normal:MButton,ID = minimize
+@200 = s$$Button/Menu/Down:MButton,ID = mainmenu,Down = 1
+@210 = s$$Button/Menu/Hovered:MButton,ID = mainmenu,Hovered = 1
+@220 = s$$Button/Menu/Normal:MButton,ID = mainmenu
+
+@300 = s$$ViewMode:ViewMode,ID = Background
+@301 = s$$ViewMode/CurrentMode/Pressed:Button,ID = ViewMode.Select,Pressed = True
+@302 = s$$ViewMode/CurrentMode/Hot:Button,ID = ViewMode.Select,Hovered = True
+@303 = s$$ViewMode/CurrentMode:Button,ID = ViewMode.Select
+@304 = s$$ViewMode/SetupMode/Pressed:Button,ID = ViewMode.Setup,Pressed = True
+@305 = s$$ViewMode/SetupMode/Hot:Button,ID = ViewMode.Setup,Hovered = True
+@306 = s$$ViewMode/SetupMode:Button,ID = ViewMode.Setup
+@307 = s$$ViewMode/ResetMode/Pressed:Button,ID = ViewMode.Clear,Pressed = True
+@308 = s$$ViewMode/ResetMode/Hot:Button,ID = ViewMode.Clear,Hovered = True
+@309 = s$$ViewMode/ResetMode:Button,ID = ViewMode.Clear
+@1610 = s$$BarButton/Pressed:Button,Pressed = True
+@1620 = s$$BarButton/Hot:Button,Hovered = True
+@1630 = s$$BarButton:Button
+
+#mainmenu = sPush,CList/ShowMainMenu,10,5,34,21,-----,0,0,Show Main Menu
+#minimize = sPush,CList/ShowHide,-36,3,-10,18,R-R--,0,0,Minimize Miranda
[CLUI]
;Another setting for CLUI section
- LeftClientMargin=b11
- TopClientMargin=b25
- RightClientMargin=b12
- BottomClientMargin=b12
+ LeftClientMargin = b11
+ TopClientMargin = b25
+ RightClientMargin = b12
+ BottomClientMargin = b12
;-----------
diff --git a/plugins/Clist_modern/resource.rc b/plugins/Clist_modern/resource.rc index 9bdb0e174e..790256e5d9 100644 --- a/plugins/Clist_modern/resource.rc +++ b/plugins/Clist_modern/resource.rc @@ -7,7 +7,7 @@ //
// Generated from the TEXTINCLUDE 2 resource.
//
-#include <winresrc.h>
+#include < winresrc.h>
#include "hdr/modern_statusmodes.h"
/////////////////////////////////////////////////////////////////////////////
@@ -1218,7 +1218,7 @@ END 2 TEXTINCLUDE
BEGIN
- "#include <winresrc.h>\r\n"
+ "#include < winresrc.h>\r\n"
"#include ""hdr/modern_statusmodes.h""\r\n"
"\0"
END
diff --git a/plugins/Clist_modern/version.rc b/plugins/Clist_modern/version.rc index cd673b369d..e41c4fcb99 100644 --- a/plugins/Clist_modern/version.rc +++ b/plugins/Clist_modern/version.rc @@ -1,5 +1,5 @@ -#include <winresrc.h>
+#include < winresrc.h>
#include "version.h"
VS_VERSION_INFO VERSIONINFO
|