summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2014-12-14 21:30:16 +0000
committerKirill Volinsky <mataes2007@gmail.com>2014-12-14 21:30:16 +0000
commitc730f12da81f636ecf65aa656a46b9337daaa37a (patch)
tree0b069d59b6366447e0a0d40982ac610fbe86d9a7 /plugins
parent91867c03b57bbf85eae500475683c16da4ec3a9c (diff)
Clist_modern: changed warning lavel to w4
git-svn-id: http://svn.miranda-ng.org/main/trunk@11425 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Clist_modern/clist_modern_12.vcxproj8
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp67
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/cluiframes.h4
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp10
-rw-r--r--plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp126
-rw-r--r--plugins/Clist_modern/src/hdr/modern_cache_funcs.h4
-rw-r--r--plugins/Clist_modern/src/hdr/modern_callproc.h256
-rw-r--r--plugins/Clist_modern/src/hdr/modern_clc.h50
-rw-r--r--plugins/Clist_modern/src/hdr/modern_clcpaint.h98
-rw-r--r--plugins/Clist_modern/src/hdr/modern_clist.h18
-rw-r--r--plugins/Clist_modern/src/hdr/modern_clui.h107
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonheaders.h66
-rw-r--r--plugins/Clist_modern/src/hdr/modern_commonprototypes.h79
-rw-r--r--plugins/Clist_modern/src/hdr/modern_effectenum.h102
-rw-r--r--plugins/Clist_modern/src/hdr/modern_gettextasync.h2
-rw-r--r--plugins/Clist_modern/src/hdr/modern_global_structure.h142
-rw-r--r--plugins/Clist_modern/src/hdr/modern_layered_window_engine.h14
-rw-r--r--plugins/Clist_modern/src/hdr/modern_row.h22
-rw-r--r--plugins/Clist_modern/src/hdr/modern_skinengine.h20
-rw-r--r--plugins/Clist_modern/src/hdr/modern_skinned_profile.h128
-rw-r--r--plugins/Clist_modern/src/hdr/modern_skinselector.h14
-rw-r--r--plugins/Clist_modern/src/hdr/modern_static_clui.h6
-rw-r--r--plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h198
-rw-r--r--plugins/Clist_modern/src/hdr/modern_statusbar.h56
-rw-r--r--plugins/Clist_modern/src/hdr/modern_sync.h58
-rw-r--r--plugins/Clist_modern/src/hdr/modern_tstring.h40
-rw-r--r--plugins/Clist_modern/src/init.cpp132
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp402
-rw-r--r--plugins/Clist_modern/src/modern_awaymsg.cpp21
-rw-r--r--plugins/Clist_modern/src/modern_cachefuncs.cpp219
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp145
-rw-r--r--plugins/Clist_modern/src/modern_clcidents.cpp82
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp18
-rw-r--r--plugins/Clist_modern/src/modern_clcmsgs.cpp233
-rw-r--r--plugins/Clist_modern/src/modern_clcopts.cpp219
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp3129
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp228
-rw-r--r--plugins/Clist_modern/src/modern_clistevents.cpp234
-rw-r--r--plugins/Clist_modern/src/modern_clistmenus.cpp12
-rw-r--r--plugins/Clist_modern/src/modern_clistmod.cpp23
-rw-r--r--plugins/Clist_modern/src/modern_clistopts.cpp4
-rw-r--r--plugins/Clist_modern/src/modern_clistsettings.cpp17
-rw-r--r--plugins/Clist_modern/src/modern_clisttray.cpp40
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp247
-rw-r--r--plugins/Clist_modern/src/modern_cluiservices.cpp16
-rw-r--r--plugins/Clist_modern/src/modern_contact.cpp54
-rw-r--r--plugins/Clist_modern/src/modern_docking.cpp457
-rw-r--r--plugins/Clist_modern/src/modern_gdiplus.cpp118
-rw-r--r--plugins/Clist_modern/src/modern_gettextasync.cpp39
-rw-r--r--plugins/Clist_modern/src/modern_image_array.cpp48
-rw-r--r--plugins/Clist_modern/src/modern_keyboard.cpp10
-rw-r--r--plugins/Clist_modern/src/modern_log.cpp42
-rw-r--r--plugins/Clist_modern/src/modern_newrowopts.cpp105
-rw-r--r--plugins/Clist_modern/src/modern_row.cpp183
-rw-r--r--plugins/Clist_modern/src/modern_rowheight_funcs.cpp282
-rw-r--r--plugins/Clist_modern/src/modern_rowtemplateopt.cpp361
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp361
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp139
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp589
-rw-r--r--plugins/Clist_modern/src/modern_skinselector.cpp461
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp44
-rw-r--r--plugins/Clist_modern/src/modern_statusbar_options.cpp194
-rw-r--r--plugins/Clist_modern/src/modern_sync.cpp34
-rw-r--r--plugins/Clist_modern/src/modern_tbbutton.cpp214
-rw-r--r--plugins/Clist_modern/src/modern_toolbar.cpp144
-rw-r--r--plugins/Clist_modern/src/modern_utils.cpp76
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp420
-rw-r--r--plugins/Clist_modern/src/modern_xptheme.cpp6
68 files changed, 5726 insertions, 5771 deletions
diff --git a/plugins/Clist_modern/clist_modern_12.vcxproj b/plugins/Clist_modern/clist_modern_12.vcxproj
index 7647dcb8ec..d0899f4a17 100644
--- a/plugins/Clist_modern/clist_modern_12.vcxproj
+++ b/plugins/Clist_modern/clist_modern_12.vcxproj
@@ -84,7 +84,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>hdr/modern_commonheaders.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat>
</ClCompile>
<ResourceCompile>
@@ -113,7 +113,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>hdr/modern_commonheaders.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -143,7 +143,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>hdr/modern_commonheaders.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -174,7 +174,7 @@
<FloatingPointModel>Fast</FloatingPointModel>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>hdr/modern_commonheaders.h</PrecompiledHeaderFile>
- <WarningLevel>Level3</WarningLevel>
+ <WarningLevel>Level4</WarningLevel>
<ExceptionHandling>false</ExceptionHandling>
</ClCompile>
<ResourceCompile>
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
index 0fc080fbac..e43d540057 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.cpp
@@ -31,12 +31,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
@@ -205,7 +205,7 @@ int CLUIFrames_SetParentForContainers(HWND parent)
return 0;
}
-int CLUIFrames_OnShowHide(HWND hwnd, int mode)
+int CLUIFrames_OnShowHide(int mode)
{
int i;
int prevFrameCount;
@@ -316,7 +316,7 @@ FRAMEWND * FindFrameByItsHWND(HWND FrameHwnd)
return NULL;
}
-static void DockThumbs(FRAMEWND *pThumbLeft, FRAMEWND *pThumbRight, BOOL bMoveLeft)
+static void DockThumbs(FRAMEWND *pThumbLeft, FRAMEWND *pThumbRight)
{
if ((pThumbRight->dockOpt.hwndLeft == NULL) && (pThumbLeft->dockOpt.hwndRight == NULL)) {
pThumbRight->dockOpt.hwndLeft = pThumbLeft->ContainerWnd;
@@ -494,11 +494,11 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY)
if (bMoveTogether) {
if (bDockedRight) {
- DockThumbs(pThumb, pCurThumb, TRUE);
+ DockThumbs(pThumb, pCurThumb);
}
if (bDockedLeft) {
- DockThumbs(pCurThumb, pThumb, FALSE);
+ DockThumbs(pCurThumb, pThumb);
}
}
@@ -941,7 +941,7 @@ static int ModifyMItem(WPARAM wParam, LPARAM lParam)
};
-static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM lParam)
+static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM)
{
/* HOOK */
if (MirandaExiting()) return 0;
@@ -991,7 +991,7 @@ static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int CLUIFramesModifyMainMenuItems(WPARAM wParam, LPARAM lParam)
+static int CLUIFramesModifyMainMenuItems(WPARAM wParam, LPARAM)
{
//hiword(wParam) = frameid,loword(wParam) = flag
if (_fCluiFramesModuleNotStarted) return -1;
@@ -1045,7 +1045,7 @@ static int CLUIFramesModifyMainMenuItems(WPARAM wParam, LPARAM lParam)
}
-static INT_PTR _us_DoGetFrameOptions(WPARAM wParam, LPARAM lParam)
+static INT_PTR _us_DoGetFrameOptions(WPARAM wParam, LPARAM)
{
INT_PTR retval;
BOOL bUnicodeText = (LOWORD(wParam) & FO_UNICODETEXT) != 0;
@@ -1299,7 +1299,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam)
}
//wparam = lparam = 0
-static int _us_DoShowAllFrames(WPARAM wParam, LPARAM lParam)
+static int _us_DoShowAllFrames(WPARAM, LPARAM)
{
int i;
@@ -1312,7 +1312,7 @@ static int _us_DoShowAllFrames(WPARAM wParam, LPARAM lParam)
}
//wparam = lparam = 0
-static int _us_DoShowTitles(WPARAM wParam, LPARAM lParam)
+static int _us_DoShowTitles(WPARAM, LPARAM)
{
int i;
@@ -1325,13 +1325,11 @@ static int _us_DoShowTitles(WPARAM wParam, LPARAM lParam)
}
//wparam = lparam = 0
-static int _us_DoHideTitles(WPARAM wParam, LPARAM lParam)
+static int _us_DoHideTitles(WPARAM, LPARAM)
{
- int i;
-
if (_fCluiFramesModuleNotStarted) return -1;
- for (i = 0; i < g_nFramesCount; i++)
+ for (int i = 0; i < g_nFramesCount; i++)
g_pfwFrames[i].TitleBar.ShowTitleBar = FALSE;
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
return 0;
@@ -1435,12 +1433,12 @@ static int _us_DoMoveFrame(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int _us_DoMoveFrameUp(WPARAM wParam, LPARAM lParam)
+static int _us_DoMoveFrameUp(WPARAM wParam, LPARAM)
{
return CLUIFrames_MoveFrame(wParam, (LPARAM)+1);
}
-static int _us_DoMoveFrameDown(WPARAM wParam, LPARAM lParam)
+static int _us_DoMoveFrameDown(WPARAM wParam, LPARAM)
{
return CLUIFrames_MoveFrame(wParam, (LPARAM)-1);
}
@@ -1456,21 +1454,21 @@ static int _us_DoSetFrameAlign(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int _us_DoAlignFrameTop(WPARAM wParam, LPARAM lParam)
+static int _us_DoAlignFrameTop(WPARAM wParam, LPARAM)
{
if (_fCluiFramesModuleNotStarted) return -1;
return CLUIFrames_SetFrameAlign(wParam, alTop);
}
-static int _us_DoAlignFrameBottom(WPARAM wParam, LPARAM lParam)
+static int _us_DoAlignFrameBottom(WPARAM wParam, LPARAM)
{
if (_fCluiFramesModuleNotStarted) return -1;
return CLUIFrames_SetFrameAlign(wParam, alBottom);
}
-static int _us_DoAlignFrameClient(WPARAM wParam, LPARAM lParam)
+static int _us_DoAlignFrameClient(WPARAM wParam, LPARAM)
{
if (_fCluiFramesModuleNotStarted) return -1;
@@ -1495,7 +1493,6 @@ static int _us_DoLockFrame(WPARAM wParam, LPARAM lParam)
static int _us_DoSetFrameBorder(WPARAM wParam, LPARAM lParam)
{
RECT rc;
- int oldflags;
if (_fCluiFramesModuleNotStarted) return -1;
@@ -1503,7 +1500,7 @@ static int _us_DoSetFrameBorder(WPARAM wParam, LPARAM lParam)
if (FrameId == -1)
return -1;
- int flt = oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, wParam), 0);
+ int oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, wParam), 0);
if (oldflags & F_NOBORDER)
oldflags &= ~F_NOBORDER;
else
@@ -1716,7 +1713,7 @@ static HFONT CLUILoadTitleBarFont()
//wparam = (CLISTFrame*)clfrm
-static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam)
+static int _us_DoAddFrame(WPARAM wParam, LPARAM)
{
int retval;
LONG_PTR style;
@@ -1869,7 +1866,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam)
return retval;
}
-static int _us_DoRemoveFrame(WPARAM wParam, LPARAM lParam)
+static int _us_DoRemoveFrame(WPARAM wParam, LPARAM)
{
int pos;
if (_fCluiFramesModuleNotStarted) return -1;
@@ -2102,7 +2099,6 @@ static int CLUIFramesResizeFrames(const RECT newsize)
int i, j;
int sepw = GapBetweenFrames;
int topBorder = newsize.top;
- int minHeight = CLUIFrames_GetTotalHeight();
SortData *sdarray;
@@ -2287,7 +2283,7 @@ static int _us_DoUpdateFrame(WPARAM wParam, LPARAM lParam)
return 0;
}
-int CLUIFrames_OnClistResize_mod(WPARAM wParam, LPARAM mode)
+int CLUIFrames_OnClistResize_mod(WPARAM, LPARAM mode)
{
RECT nRect;
int tick;
@@ -2526,7 +2522,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam)
return 0;
}
-int OnFrameTitleBarBackgroundChange(WPARAM wParam, LPARAM lParam)
+int OnFrameTitleBarBackgroundChange(WPARAM, LPARAM)
{
if (MirandaExiting()) return 0;
{
@@ -2565,10 +2561,7 @@ void DrawBackGround(HWND hwnd, HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColo
int y;
PAINTSTRUCT paintst = { 0 };
HBITMAP hBmpOsb, hOldBmp;
- LONG_PTR style = GetWindowLongPtr(hwnd, GWL_STYLE);
- int grey = 0;
HFONT oFont;
- HBRUSH hBrushAlternateGrey = NULL;
HFONT hFont;
@@ -2767,7 +2760,6 @@ int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid)
mod_DrawIconEx_helper(hdcMem, rc.left, rc.top + ((g_nTitleBarHeight >> 1) - (GetSystemMetrics(SM_CXSMICON) >> 1)), g_pfwFrames[pos].collapsed ? LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN) : LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT), GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, NULL, DI_NORMAL);
}
{
- 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);
SelectClipRgn(hdcMem2, rgn);
@@ -3243,7 +3235,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos)
return 0;
};
-static int CLUIFrameOnMainMenuBuild(WPARAM wParam, LPARAM lParam)
+static int CLUIFrameOnMainMenuBuild(WPARAM, LPARAM)
{
if (MirandaExiting()) return 0;
CLUIFramesLoadMainMenu();
@@ -3253,9 +3245,6 @@ static int CLUIFrameOnMainMenuBuild(WPARAM wParam, LPARAM lParam)
static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- RECT rect = { 0 };
- int Frameid = (GetWindowLongPtr(hwnd, GWLP_USERDATA));
-
switch (msg) {
case WM_ACTIVATE:
if (g_bTransparentFlag) {
@@ -3626,7 +3615,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam)
return 0;
}
-int CLUIFrameOnModulesLoad(WPARAM wParam, LPARAM lParam)
+int CLUIFrameOnModulesLoad(WPARAM, LPARAM)
{
/* HOOK */
CLUIFramesLoadMainMenu();
@@ -3634,7 +3623,7 @@ int CLUIFrameOnModulesLoad(WPARAM wParam, LPARAM lParam)
return 0;
}
-int CLUIFrameOnModulesUnload(WPARAM wParam, LPARAM lParam)
+int CLUIFrameOnModulesUnload(WPARAM, LPARAM)
{
g_CluiData.bSTATE = STATE_PREPEARETOEXIT;
diff --git a/plugins/Clist_modern/src/CLUIFrames/cluiframes.h b/plugins/Clist_modern/src/CLUIFrames/cluiframes.h
index d437c8ae03..03149f2250 100644
--- a/plugins/Clist_modern/src/CLUIFrames/cluiframes.h
+++ b/plugins/Clist_modern/src/CLUIFrames/cluiframes.h
@@ -1,5 +1,5 @@
/*
-Miranda ICQ: the free icq client for MS Windows
+Miranda ICQ: the free icq client for MS Windows
Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
This program is free software; you can redistribute it and/or
@@ -36,7 +36,7 @@ typedef struct tagProtocolData {
boolean show;
} ProtocolData;
-typedef struct
+typedef struct
{
int order;
int realpos;
diff --git a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
index 8b1bf6af9e..4f11a5d83d 100644
--- a/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/framesmenu.cpp
@@ -11,9 +11,9 @@ typedef struct{
char *szServiceName;
int Frameid;
INT_PTR param1;
-}FrameMenuExecParam,*lpFrameMenuExecParam;
+}FrameMenuExecParam, *lpFrameMenuExecParam;
-INT_PTR FreeOwnerDataFrameMenu(WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataFrameMenu(WPARAM, LPARAM lParam)
{
lpFrameMenuExecParam cmep = (lpFrameMenuExecParam)lParam;
if (cmep != NULL){
@@ -23,7 +23,7 @@ INT_PTR FreeOwnerDataFrameMenu(WPARAM wParam, LPARAM lParam)
return 0;
}
-static INT_PTR AddContextFrameMenuItem(WPARAM wParam, LPARAM lParam)
+static INT_PTR AddContextFrameMenuItem(WPARAM, LPARAM lParam)
{
CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
@@ -59,7 +59,7 @@ INT_PTR FrameMenuExecService(WPARAM wParam, LPARAM lParam)
}
//true - ok,false ignore
-INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM lParam)
+INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM)
{
PCheckProcParam pcpp = (PCheckProcParam)wParam;
if (pcpp == NULL)
@@ -79,7 +79,7 @@ INT_PTR FrameMenuCheckService(WPARAM wParam, LPARAM lParam)
static INT_PTR ContextFrameMenuNotify(WPARAM wParam, LPARAM lParam)
{
- NotifyEventHooks(hPreBuildFrameMenuEvent,wParam,lParam);
+ NotifyEventHooks(hPreBuildFrameMenuEvent, wParam, lParam);
return 0;
}
diff --git a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
index 64108e57ac..f0ebc98199 100644
--- a/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
+++ b/plugins/Clist_modern/src/CLUIFrames/groupmenu.cpp
@@ -47,11 +47,11 @@ void InitSubGroupMenus(void);
typedef struct
{
char *szServiceName;
- int Param1,Param2;
+ int Param1, Param2;
}
- GroupMenuExecParam,*lpGroupMenuExecParam;
+GroupMenuExecParam, *lpGroupMenuExecParam;
-INT_PTR BuildGroupMenu(WPARAM wParam, LPARAM lParam)
+INT_PTR BuildGroupMenu(WPARAM, LPARAM)
{
NotifyEventHooks(g_CluiData.hEventPreBuildGroupMenu, 0, 0);
@@ -88,21 +88,23 @@ static INT_PTR AddGroupMenuItem(WPARAM wParam, LPARAM lParam)
mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
OptParam op;
- op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hGroupMenuObject,(LPARAM)&tmi);
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hGroupMenuObject, (LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
op.Value = (INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
return (INT_PTR)op.Handle;
}
-int GroupMenuCheckService(WPARAM wParam, LPARAM lParam) {
-//not used
+int GroupMenuCheckService(WPARAM, LPARAM)
+{
+ //not used
return 0;
};
-INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam) {
+INT_PTR GroupMenuonAddService(WPARAM wParam, LPARAM lParam)
+{
- MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
if (mii == NULL)
return 0;
@@ -131,17 +133,17 @@ INT_PTR GroupMenuExecService(WPARAM wParam, LPARAM lParam)
{
if (wParam != 0) {
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)wParam;
- if (!mir_strcmp(mmep->szServiceName,"Help/AboutCommand")) {
+ if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) {
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
- CallService(mmep->szServiceName,mmep->Param1,lParam);
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
- else CallService(mmep->szServiceName,mmep->Param1,mmep->Param2);
+ else CallService(mmep->szServiceName, mmep->Param1, mmep->Param2);
}
return 1;
}
-INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataGroupMenu(WPARAM, LPARAM lParam)
{
lpGroupMenuExecParam mmep = (lpGroupMenuExecParam)lParam;
if (mmep != NULL) {
@@ -152,33 +154,33 @@ INT_PTR FreeOwnerDataGroupMenu (WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR HideGroupsHelper(WPARAM wParam, LPARAM lParam)
+INT_PTR HideGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS);
- db_set_b(NULL,"CList","HideEmptyGroups",(BYTE)newVal);
- SendMessage(pcli->hwndContactTree,CLM_SETHIDEEMPTYGROUPS,newVal,0);
+ 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;
}
-INT_PTR UseGroupsHelper(WPARAM wParam, LPARAM lParam)
+INT_PTR UseGroupsHelper(WPARAM, LPARAM)
{
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS);
- db_set_b(NULL,"CList","UseGroups",(BYTE)newVal);
- SendMessage(pcli->hwndContactTree,CLM_SETUSEGROUPS,newVal,0);
+ 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;
}
-INT_PTR HideOfflineRootHelper(WPARAM wParam, LPARAM lParam)
+INT_PTR HideOfflineRootHelper(WPARAM, LPARAM)
{
SendMessage(
(HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0),
CLM_SETHIDEOFFLINEROOT,
- !SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0),CLM_GETHIDEOFFLINEROOT, 0, 0),
+ !SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_GETHIDEOFFLINEROOT, 0, 0),
0);
return 0;
}
-INT_PTR CreateGroupHelper(WPARAM wParam, LPARAM lParam)
+INT_PTR CreateGroupHelper(WPARAM, LPARAM)
{
SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_SETHIDEEMPTYGROUPS, 0, 0);
SendMessage((HWND)CallService(MS_CLUI_GETHWNDTREE, 0, 0), CLM_SETUSEGROUPS, 1, 0);
@@ -186,21 +188,21 @@ INT_PTR CreateGroupHelper(WPARAM wParam, LPARAM lParam)
return 0;
};
-static int OnBuildGroupMenu(WPARAM wParam, LPARAM lParam)
+static int OnBuildGroupMenu(WPARAM, LPARAM)
{
if (MirandaExiting()) return 0;
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | ( db_get_b(NULL,"CList","HideOffline",SETTING_HIDEOFFLINE_DEFAULT)?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree,CLM_GETHIDEOFFLINEROOT, 0, 0)?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0) ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideOfflineUsersOutHereMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_HIDEEMPTYGROUPS?CMIF_CHECKED:0);
+ mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_HIDEEMPTYGROUPS ? CMIF_CHECKED : 0);
Menu_ModifyItem(hHideEmptyGroupsMenuItem, &mi);
- mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE)&CLS_USEGROUPS?0:CMIF_CHECKED);
+ mi.flags = CMIM_FLAGS | (GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE)&CLS_USEGROUPS ? 0 : CMIF_CHECKED);
Menu_ModifyItem(hDisableGroupsMenuItem, &mi);
return 0;
}
@@ -211,18 +213,18 @@ void GroupMenus_Init(void)
{
Icon_RegisterT(g_hInst, LPGENT("Contact list"), &iconItem, 1);
- CreateServiceFunction("CLISTMENUSGroup/ExecService",GroupMenuExecService);
- CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu",FreeOwnerDataGroupMenu);
- CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService",GroupMenuonAddService);
- CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper",HideGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper",UseGroupsHelper);
- CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper",HideOfflineRootHelper);
- CreateServiceFunction("CLISTMENUSGroup/CreateGroupHelper",CreateGroupHelper);
+ CreateServiceFunction("CLISTMENUSGroup/ExecService", GroupMenuExecService);
+ CreateServiceFunction("CLISTMENUSGroup/FreeOwnerDataGroupMenu", FreeOwnerDataGroupMenu);
+ CreateServiceFunction("CLISTMENUSGroup/GroupMenuonAddService", GroupMenuonAddService);
+ CreateServiceFunction("CLISTMENUSGroup/HideGroupsHelper", HideGroupsHelper);
+ CreateServiceFunction("CLISTMENUSGroup/UseGroupsHelper", UseGroupsHelper);
+ CreateServiceFunction("CLISTMENUSGroup/HideOfflineRootHelper", HideOfflineRootHelper);
+ CreateServiceFunction("CLISTMENUSGroup/CreateGroupHelper", CreateGroupHelper);
- CreateServiceFunction("CList/AddGroupMenuItem",AddGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDGROUP,BuildGroupMenu);
+ CreateServiceFunction("CList/AddGroupMenuItem", AddGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDGROUP, BuildGroupMenu);
- HookEvent(ME_CLIST_PREBUILDGROUPMENU,OnBuildGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu);
InitSubGroupMenus();
@@ -291,7 +293,7 @@ void GroupMenus_Init(void)
mi.icolibItem = NULL;
mi.pszService = MS_CLIST_SETHIDEOFFLINE;
mi.pszName = LPGEN("&Hide offline users");
- gmp.lParam = 0;gmp.wParam = -1;
+ gmp.lParam = 0; gmp.wParam = -1;
hHideOfflineUsersMenuItem = (HGENMENU)AddGroupMenuItem((WPARAM)&gmp, (LPARAM)&mi);
mi.position = 100002;
@@ -326,9 +328,9 @@ typedef struct
char *szServiceName;
int Param1, Param2;
}
-SubGroupMenuExecParam,*lpSubGroupMenuExecParam;
+SubGroupMenuExecParam, *lpSubGroupMenuExecParam;
-static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
+static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM)
{
BOOL gray1 = FALSE;
BOOL gray2 = FALSE;
@@ -347,10 +349,10 @@ static int OnBuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
if (gray1 && gray2) gray1 = FALSE; //should not be cause CLCItems_IsShowOfflineGroup return false if group->hideOffline
CLISTMENUITEM mi = { sizeof(mi) };
- mi.flags = CMIM_FLAGS | ((group->hideOffline && !gray1)?CMIF_CHECKED:0)| (gray1?CMIF_GRAYED:0);
+ mi.flags = CMIM_FLAGS | ((group->hideOffline && !gray1) ? CMIF_CHECKED : 0) | (gray1 ? CMIF_GRAYED : 0);
Menu_ModifyItem(hHideOfflineUsersHereMenuItem, &mi);
- mi.flags = CMIM_FLAGS | ((showOfflineinGroup && !gray2) ? CMIF_CHECKED:0)| (gray2?CMIF_GRAYED:0);
+ mi.flags = CMIM_FLAGS | ((showOfflineinGroup && !gray2) ? CMIF_CHECKED : 0) | (gray2 ? CMIF_GRAYED : 0);
Menu_ModifyItem(hShowOfflineUsersHereMenuItem, &mi);
return 0;
}
@@ -365,13 +367,13 @@ INT_PTR BuildSubGroupMenu(WPARAM wParam, LPARAM lParam)
param.lParam = lParam;
HMENU hMenu = CreatePopupMenu();
- CallService(MO_BUILDMENU,(WPARAM)hMenu,(LPARAM)&param);
+ CallService(MO_BUILDMENU, (WPARAM)hMenu, (LPARAM)&param);
return (INT_PTR)hMenu;
}
HMENU cliBuildGroupPopupMenu(ClcGroup *group)
{
- return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP,(WPARAM)group,0);
+ return (HMENU)CallService(MS_CLIST_MENUBUILDSUBGROUP, (WPARAM)group, 0);
}
static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
@@ -382,7 +384,7 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
return NULL;
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)mir_calloc(sizeof(SubGroupMenuExecParam));
- if ( mmep == NULL)
+ if (mmep == NULL)
return 0;
//we need just one parametr.
@@ -399,14 +401,14 @@ static INT_PTR AddSubGroupMenuItem(WPARAM wParam, LPARAM lParam)
mir_snprintf(buf, SIZEOF(buf), "%s/%s", mi->pszService, mi->pszName);
OptParam op;
- op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM,(WPARAM)hSubGroupMenuObject,(LPARAM)&tmi);
+ op.Handle = (HANDLE)CallService(MO_ADDNEWMENUITEM, (WPARAM)hSubGroupMenuObject, (LPARAM)&tmi);
op.Setting = OPT_MENUITEMSETUNIQNAME;
op.Value = (INT_PTR)buf;
CallService(MO_SETOPTIONSMENUITEM, 0, (LPARAM)&op);
return (INT_PTR)op.Handle;
}
-INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM lParam)
+INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM)
{
TCheckProcParam * CParam = (TCheckProcParam*)wParam;
if (CParam) {
@@ -417,9 +419,9 @@ INT_PTR SubGroupMenuCheckService(WPARAM wParam, LPARAM lParam)
return 1;
}
-INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM lParam)
+INT_PTR SubGroupMenuonAddService(WPARAM wParam, LPARAM)
{
- MENUITEMINFO *mii = (MENUITEMINFO* )wParam;
+ MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
if (mii == NULL)
return 0;
@@ -436,14 +438,14 @@ INT_PTR SubGroupMenuExecService(WPARAM wParam, LPARAM lParam)
if (!mir_strcmp(mmep->szServiceName, "Help/AboutCommand")) {
//bug in help.c,it used wparam as parent window handle without reason.
mmep->Param1 = 0;
- CallService(mmep->szServiceName,mmep->Param1,lParam);
+ CallService(mmep->szServiceName, mmep->Param1, lParam);
}
- else CallService(mmep->szServiceName,mmep->Param1,lParam);
+ else CallService(mmep->szServiceName, mmep->Param1, lParam);
}
return 1;
}
-INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataSubGroupMenu(WPARAM, LPARAM lParam)
{
lpSubGroupMenuExecParam mmep = (lpSubGroupMenuExecParam)lParam;
if (mmep != NULL){
@@ -458,22 +460,22 @@ INT_PTR FreeOwnerDataSubGroupMenu (WPARAM wParam, LPARAM lParam)
//lparam WM_COMMAND HWND
INT_PTR GroupMenuExecProxy(WPARAM wParam, LPARAM lParam)
{
- SendMessage(lParam?(HWND)lParam:(HWND)pcli->hwndContactTree,WM_COMMAND,wParam,0);
+ SendMessage(lParam ? (HWND)lParam : (HWND)pcli->hwndContactTree, WM_COMMAND, wParam, 0);
return 0;
}
void InitSubGroupMenus(void)
{
- CreateServiceFunction("CLISTMENUSSubGroup/ExecService",SubGroupMenuExecService);
- CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu",FreeOwnerDataSubGroupMenu);
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService",SubGroupMenuonAddService);
- CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService",SubGroupMenuCheckService);
- CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy",GroupMenuExecProxy);
+ CreateServiceFunction("CLISTMENUSSubGroup/ExecService", SubGroupMenuExecService);
+ CreateServiceFunction("CLISTMENUSSubGroup/FreeOwnerDataSubGroupMenu", FreeOwnerDataSubGroupMenu);
+ CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuonAddService", SubGroupMenuonAddService);
+ CreateServiceFunction("CLISTMENUSSubGroup/SubGroupMenuCheckService", SubGroupMenuCheckService);
+ CreateServiceFunction("CLISTMENUSSubGroup/GroupMenuExecProxy", GroupMenuExecProxy);
- CreateServiceFunction("CList/AddSubGroupMenuItem",AddSubGroupMenuItem);
- CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP,BuildSubGroupMenu);
+ CreateServiceFunction("CList/AddSubGroupMenuItem", AddSubGroupMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDSUBGROUP, BuildSubGroupMenu);
- HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU,OnBuildSubGroupMenu);
+ HookEvent(ME_CLIST_PREBUILDSUBGROUPMENU, OnBuildSubGroupMenu);
// SubGroup menu
hSubGroupMenuObject = MO_CreateMenuObject("SubGroupMenu", LPGEN("Subgroup menu"), 0, "CLISTMENUSSubGroup/ExecService");
diff --git a/plugins/Clist_modern/src/hdr/modern_cache_funcs.h b/plugins/Clist_modern/src/hdr/modern_cache_funcs.h
index 24dc9db73d..b3fc754b88 100644
--- a/plugins/Clist_modern/src/hdr/modern_cache_funcs.h
+++ b/plugins/Clist_modern/src/hdr/modern_cache_funcs.h
@@ -39,8 +39,8 @@ void Cache_GetThirdLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce);
void Cache_GetAvatar(ClcData *dat, ClcContact *contact);
void Cache_GetTimezone(ClcData *dat, MCONTACT hContact);
int Cache_GetLineText(ClcCacheEntry *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);
+ 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(MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_callproc.h b/plugins/Clist_modern/src/hdr/modern_callproc.h
index 4e3df47257..824d10e6d9 100644
--- a/plugins/Clist_modern/src/hdr/modern_callproc.h
+++ b/plugins/Clist_modern/src/hdr/modern_callproc.h
@@ -4,125 +4,141 @@
namespace call {
#include <windows.h>
-//////////////////////////////////////////////////////////////////////////
-// USE AS
-// ret = call::sync( proc, param1, param2 ... etc)
-//////////////////////////////////////////////////////////////////////////
-// internal realization
-enum ASYNC_T { ASYNC = 0, SYNC };
-int __ProcessCall( class __baseCall * pStorage, ASYNC_T async );
-
-class __baseCall { public: virtual int __DoCallStorageProc() =0; virtual ~__baseCall() {}; };
-template< class R > class _callParams0 : public __baseCall
-{
-public:
- R(*_proc)();
- _callParams0( R (*proc)()) : _proc(proc){};
- int __DoCallStorageProc() { return (int)_proc(); }
-};
-
-template<> class _callParams0<void> : public __baseCall
-{
-public:
- void(*_proc)();
- _callParams0( void (*proc)()) : _proc(proc){};
- int __DoCallStorageProc() { _proc(); return 0; }
-};
-
-template< class R, class A> class _callParams1 : public __baseCall
-{
-public:
- R(*_proc)(A); A _a;
- _callParams1( R(*proc)(A), A a) : _proc(proc), _a(a) {};
- int __DoCallStorageProc() { return (int)_proc(_a); }
-};
-
-template<class A> class _callParams1<void, A> : public __baseCall
-{
-public:
- void(*_proc)(A); A _a;
- _callParams1( void(*proc)(A), A a) : _proc(proc), _a(a) {};
- int __DoCallStorageProc() { _proc(_a); return 0; }
-};
-
-template< class R, class A, class B> class _callParams2 : public __baseCall
-{
-public:
- R (*_proc)(A, B); A _a; B _b;
- _callParams2( R (*proc)(A, B), A a, B b) : _proc(proc), _a(a), _b(b) {};
- int __DoCallStorageProc() { return (int)_proc(_a, _b); }
-};
-
-template< class A, class B> class _callParams2<void, A, B> : public __baseCall
-{
-public:
- void (*_proc)(A, B); A _a; B _b;
- _callParams2( void (*proc)(A, B), A a, B b) : _proc(proc), _a(a), _b(b) {};
- int __DoCallStorageProc() { _proc(_a, _b); return 0; }
-};
-
-template< class R, class A, class B, class C> class _callParams3 : public __baseCall
-{
-public:
- R (*_proc)(A, B, C); A _a; B _b; C _c;
- _callParams3( R (*proc)(A, B, C), A a, B b, C c ) : _proc(proc), _a(a), _b(b), _c(c) {};
- int __DoCallStorageProc() { return (int)_proc(_a,_b,_c); }
-};
-
-template< class A, class B, class C> class _callParams3<void, A, B, C> : public __baseCall
-{
-public:
- void (*_proc)(A, B, C); A _a; B _b; C _c;
- _callParams3( void (*proc)(A, B, C), A a, B b, C c ) : _proc(proc), _a(a), _b(b), _c(c) {};
- int __DoCallStorageProc() { _proc(_a,_b,_c); return 0;}
-};
-
-template < class R > R __DoCall( R(*__proc)(), ASYNC_T sync_mode )
-{
- typedef _callParams0< R > callClass;
- callClass * storage = new callClass( __proc );
- return (R) call::__ProcessCall( storage, sync_mode );
-};
-
-template < class R, class A > R __DoCall( R(*__proc)( A ), A a, ASYNC_T sync_mode )
-{
- typedef _callParams1< R, A > callClass;
- callClass * storage = new callClass( __proc, a );
- return (R)__ProcessCall( storage, sync_mode );
-};
-
-
-template < class R, class A, class B > R __DoCall( R(*__proc)( A, B ), A a, B b, ASYNC_T sync_mode )
-{
- typedef _callParams2< R, A, B > callClass;
- callClass * storage = new callClass( __proc, a, b);
- return (R)__ProcessCall( storage, sync_mode );
-};
-
-
-template < class R, class A, class B, class C > R __DoCall( R(*__proc)( A, B, C ), A a, B b, C c, ASYNC_T sync_mode )
-{
- typedef _callParams3< R, A, B, C > callClass;
- callClass * storage = new callClass( __proc, a, b, c);
- return (R)__ProcessCall( storage, sync_mode );
-};
-
-
-template < class R > R sync( R(*_proc)())
-{ return __DoCall(_proc, SYNC); };
-template < class R, class A > R sync( R(*_proc)( A ), A a )
-{ return __DoCall(_proc, a, SYNC); };
-template < class R, class A, class B > R sync( R(*_proc)( A,B), A a, B b )
-{ return __DoCall(_proc, a, b, SYNC); };
-template < class R, class A, class B, class C > R sync( R(*_proc)( A,B,C ), A a, B b, C c)
-{ return __DoCall(_proc, a, b, c, SYNC); };
-template < class R > int async( R(*_proc)())
-{ return __DoCall(_proc, ASYNC); };
-template < class R, class A > R async( R(*_proc)( A ), A a )
-{ return __DoCall(_proc, a, ASYNC); };
-template < class R, class A, class B > R async( R(*_proc)( A,B), A a, B b )
-{ return __DoCall(_proc, a, b, ASYNC); };
-template < class R, class A, class B, class C > R async( R(*_proc)( A,B,C ), A a, B b, C c)
-{ return __DoCall(_proc, a, b, c, ASYNC); };
+ //////////////////////////////////////////////////////////////////////////
+ // USE AS
+ // ret = call::sync( proc, param1, param2 ... etc)
+ //////////////////////////////////////////////////////////////////////////
+ // internal realization
+ enum ASYNC_T { ASYNC = 0, SYNC };
+ int __ProcessCall(class __baseCall * pStorage, ASYNC_T async);
+
+ class __baseCall { public: virtual int __DoCallStorageProc() = 0; virtual ~__baseCall() {}; };
+ template< class R > class _callParams0 : public __baseCall
+ {
+ public:
+ R(*_proc)();
+ _callParams0(R(*proc)()) : _proc(proc){};
+ int __DoCallStorageProc() { return (int)_proc(); }
+ };
+
+ template<> class _callParams0<void> : public __baseCall
+ {
+ public:
+ void(*_proc)();
+ _callParams0(void(*proc)()) : _proc(proc){};
+ int __DoCallStorageProc() { _proc(); return 0; }
+ };
+
+ template< class R, class A> class _callParams1 : public __baseCall
+ {
+ public:
+ R(*_proc)(A); A _a;
+ _callParams1(R(*proc)(A), A a) : _proc(proc), _a(a) {};
+ int __DoCallStorageProc() { return (int)_proc(_a); }
+ };
+
+ template<class A> class _callParams1<void, A> : public __baseCall
+ {
+ public:
+ void(*_proc)(A); A _a;
+ _callParams1(void(*proc)(A), A a) : _proc(proc), _a(a) {};
+ int __DoCallStorageProc() { _proc(_a); return 0; }
+ };
+
+ template< class R, class A, class B> class _callParams2 : public __baseCall
+ {
+ public:
+ R(*_proc)(A, B); A _a; B _b;
+ _callParams2(R(*proc)(A, B), A a, B b) : _proc(proc), _a(a), _b(b) {};
+ int __DoCallStorageProc() { return (int)_proc(_a, _b); }
+ };
+
+ template< class A, class B> class _callParams2<void, A, B> : public __baseCall
+ {
+ public:
+ void(*_proc)(A, B); A _a; B _b;
+ _callParams2(void(*proc)(A, B), A a, B b) : _proc(proc), _a(a), _b(b) {};
+ int __DoCallStorageProc() { _proc(_a, _b); return 0; }
+ };
+
+ template< class R, class A, class B, class C> class _callParams3 : public __baseCall
+ {
+ public:
+ R(*_proc)(A, B, C); A _a; B _b; C _c;
+ _callParams3(R(*proc)(A, B, C), A a, B b, C c) : _proc(proc), _a(a), _b(b), _c(c) {};
+ int __DoCallStorageProc() { return (int)_proc(_a, _b, _c); }
+ };
+
+ template< class A, class B, class C> class _callParams3<void, A, B, C> : public __baseCall
+ {
+ public:
+ void(*_proc)(A, B, C); A _a; B _b; C _c;
+ _callParams3(void(*proc)(A, B, C), A a, B b, C c) : _proc(proc), _a(a), _b(b), _c(c) {};
+ int __DoCallStorageProc() { _proc(_a, _b, _c); return 0; }
+ };
+
+ template < class R > R __DoCall(R(*__proc)(), ASYNC_T sync_mode)
+ {
+ typedef _callParams0< R > callClass;
+ callClass * storage = new callClass(__proc);
+ return (R)call::__ProcessCall(storage, sync_mode);
+ };
+
+ template < class R, class A > R __DoCall(R(*__proc)(A), A a, ASYNC_T sync_mode)
+ {
+ typedef _callParams1< R, A > callClass;
+ callClass * storage = new callClass(__proc, a);
+ return (R)__ProcessCall(storage, sync_mode);
+ };
+
+
+ template < class R, class A, class B > R __DoCall(R(*__proc)(A, B), A a, B b, ASYNC_T sync_mode)
+ {
+ typedef _callParams2< R, A, B > callClass;
+ callClass * storage = new callClass(__proc, a, b);
+ return (R)__ProcessCall(storage, sync_mode);
+ };
+
+
+ template < class R, class A, class B, class C > R __DoCall(R(*__proc)(A, B, C), A a, B b, C c, ASYNC_T sync_mode)
+ {
+ typedef _callParams3< R, A, B, C > callClass;
+ callClass * storage = new callClass(__proc, a, b, c);
+ return (R)__ProcessCall(storage, sync_mode);
+ };
+
+
+ template < class R > R sync(R(*_proc)())
+ {
+ return __DoCall(_proc, SYNC);
+ };
+ template < class R, class A > R sync(R(*_proc)(A), A a)
+ {
+ return __DoCall(_proc, a, SYNC);
+ };
+ template < class R, class A, class B > R sync(R(*_proc)(A, B), A a, B b)
+ {
+ return __DoCall(_proc, a, b, SYNC);
+ };
+ template < class R, class A, class B, class C > R sync(R(*_proc)(A, B, C), A a, B b, C c)
+ {
+ return __DoCall(_proc, a, b, c, SYNC);
+ };
+ template < class R > int async(R(*_proc)())
+ {
+ return __DoCall(_proc, ASYNC);
+ };
+ template < class R, class A > R async(R(*_proc)(A), A a)
+ {
+ return __DoCall(_proc, a, ASYNC);
+ };
+ template < class R, class A, class B > R async(R(*_proc)(A, B), A a, B b)
+ {
+ return __DoCall(_proc, a, b, ASYNC);
+ };
+ template < class R, class A, class B, class C > R async(R(*_proc)(A, B, C), A a, B b, C c)
+ {
+ return __DoCall(_proc, a, b, c, ASYNC);
+ };
}; // namespace call
#endif // modern_callproc_h__
diff --git a/plugins/Clist_modern/src/hdr/modern_clc.h b/plugins/Clist_modern/src/hdr/modern_clc.h
index 1ec9a4dc44..ef47a3dc21 100644
--- a/plugins/Clist_modern/src/hdr/modern_clc.h
+++ b/plugins/Clist_modern/src/hdr/modern_clc.h
@@ -89,7 +89,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TIMERID_FIRST TIMERID_RENAME
#define TIMERID_LAST TIMERID_RECALCSCROLLBAR
-void clcSetDelayTimer( UINT_PTR uIDEvent, HWND hwnd, int nDelay = -1);
+void clcSetDelayTimer(UINT_PTR uIDEvent, HWND hwnd, int nDelay = -1);
#define FONTID_CONTACTS 0
#define FONTID_INVIS 1
@@ -186,7 +186,7 @@ typedef struct tagClcContactTextPiece
} ClcContactTextPiece;
enum {
- CIT_PAINT_END=0, //next items are invalids
+ CIT_PAINT_END = 0, //next items are invalids
CIT_AVATAR, // 1
CIT_ICON, // 2
CIT_TEXT, // 3 //the contact name or group name
@@ -195,7 +195,7 @@ enum {
CIT_TIME, // 6
CIT_CHECKBOX, // 7
CIT_SELECTION, // 8
- CIT_EXTRA=64 //use bit compare for extra icon, the mask &0x3F will return number of extra icon
+ CIT_EXTRA = 64 //use bit compare for extra icon, the mask &0x3F will return number of extra icon
};
struct tContactItems
@@ -232,7 +232,7 @@ struct ClcContact : public ClcContactBase
// For extended layout
BYTE ext_nItemsNum;
BOOL ext_fItemsValid;
- tContactItems ext_mpItemsDesc[EXTRA_ICON_COUNT+10]; //up to 10 items
+ tContactItems ext_mpItemsDesc[EXTRA_ICON_COUNT + 10]; //up to 10 items
__forceinline bool isChat() const
{
@@ -242,7 +242,7 @@ struct ClcContact : public ClcContactBase
struct ClcModernFontInfo {
HFONT hFont;
- int fontHeight,changed;
+ int fontHeight, changed;
COLORREF colour;
BYTE effect;
COLORREF effectColour1;
@@ -342,7 +342,7 @@ struct ClcData : public ClcDataBase
BOOL third_line_show_status_if_no_away;
BOOL third_line_show_listening_if_no_away;
BOOL third_line_use_name_and_message_for_xstatus;
- struct ClcModernFontInfo fontModernInfo[FONTID_MODERN_MAX+1];
+ struct ClcModernFontInfo fontModernInfo[FONTID_MODERN_MAX + 1];
HWND hWnd;
BYTE menuOwnerType;
int menuOwnerID;
@@ -400,48 +400,48 @@ typedef struct tagOVERLAYICONINFO
void ClcOptionsChanged(void);
//clcidents.c
-int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex);
+int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex);
int FindItem(HWND hwnd, ClcData *dat, DWORD hItem, ClcContact **contact, ClcGroup **subgroup, int *isVisible, BOOL isIgnoreSubcontacts);
-int cliGetRowByIndex(ClcData *dat,int testindex,ClcContact **contact,ClcGroup **subgroup);
+int cliGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup);
HANDLE ContactToHItem(ClcContact *contact);
-HANDLE ContactToItemHandle(ClcContact *contact,DWORD *nmFlags);
+HANDLE ContactToItemHandle(ClcContact *contact, DWORD *nmFlags);
void ClearRowByIndexCache();
//clcitems.c
-ClcGroup *cli_AddGroup(HWND hwnd,ClcData *dat,const TCHAR *szName,DWORD flags,int groupId,int calcTotalMembers);
+ClcGroup *cli_AddGroup(HWND hwnd, ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers);
void cli_FreeGroup(ClcGroup *group);
-int cli_AddInfoItemToGroup(ClcGroup *group,int flags,const TCHAR *pszText);
+int cli_AddInfoItemToGroup(ClcGroup *group, int flags, const TCHAR *pszText);
void cliRebuildEntireList(HWND hwnd, ClcData *dat);
void cli_DeleteItemFromTree(HWND hwnd, MCONTACT hItem);
-void cli_AddContactToTree(HWND hwnd,ClcData *dat,MCONTACT hContact,int updateTotalCount,int checkHideOffline);
-void cli_SortCLC(HWND hwnd,ClcData *dat,int useInsertionSort);
-int GetNewSelection(ClcGroup *group,int selection, int direction);
+void cli_AddContactToTree(HWND hwnd, ClcData *dat, MCONTACT hContact, int updateTotalCount, int checkHideOffline);
+void cli_SortCLC(HWND hwnd, ClcData *dat, int useInsertionSort);
+int GetNewSelection(ClcGroup *group, int selection, int direction);
//clcmsgs.c
-LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wParam, LPARAM lParam);
+LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam);
//clcutils.c
-void cliRecalcScrollBar(HWND hwnd,ClcData *dat);
-void cliBeginRenameSelection(HWND hwnd,ClcData *dat);
-int cliHitTest(HWND hwnd,ClcData *dat,int testx,int testy,ClcContact **contact,ClcGroup **group,DWORD *flags);
-void cliScrollTo(HWND hwnd,ClcData *dat,int desty,int noSmooth);
-int GetDropTargetInformation(HWND hwnd,ClcData *dat,POINT pt);
-void LoadCLCOptions(HWND hwnd,ClcData *dat, BOOL bFirst);
+void cliRecalcScrollBar(HWND hwnd, ClcData *dat);
+void cliBeginRenameSelection(HWND hwnd, ClcData *dat);
+int cliHitTest(HWND hwnd, ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD *flags);
+void cliScrollTo(HWND hwnd, ClcData *dat, int desty, int noSmooth);
+int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt);
+void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst);
//clcpaint.c
-void CLCPaint_cliPaintClc(HWND hwnd,ClcData *dat,HDC hdc,RECT *rcPaint);
+void CLCPaint_cliPaintClc(HWND hwnd, ClcData *dat, HDC hdc, RECT *rcPaint);
//clcopts.c
int ClcOptInit(WPARAM wParam, LPARAM lParam);
DWORD GetDefaultExStyle(void);
-void GetFontSetting(int i,LOGFONT *lf,COLORREF *colour,BYTE *effect, COLORREF *eColour1,COLORREF *eColour2);
+void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *eColour1, COLORREF *eColour2);
//clistsettings.c
-TCHAR * GetContactDisplayNameW(MCONTACT hContact, int mode );
+TCHAR * GetContactDisplayNameW(MCONTACT hContact, int mode);
//groups.c
-TCHAR* GetGroupNameTS( int idx, DWORD* pdwFlags );
+TCHAR* GetGroupNameTS(int idx, DWORD* pdwFlags);
int RenameGroupT(WPARAM groupID, LPARAM newName);
int GetContactCachedStatus(MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_clcpaint.h b/plugins/Clist_modern/src/hdr/modern_clcpaint.h
index 97c299fdbe..879452125f 100644
--- a/plugins/Clist_modern/src/hdr/modern_clcpaint.h
+++ b/plugins/Clist_modern/src/hdr/modern_clcpaint.h
@@ -9,15 +9,15 @@ public:
CLCPaint();
~CLCPaint() {};
- CLINTERFACE void cliPaintClc(HWND hwnd, ClcData *dat, HDC hdc, RECT *rcPaint);
- CLINTERFACE tPaintCallbackProc PaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData);
+ CLINTERFACE void cliPaintClc(HWND hwnd, ClcData *dat, HDC hdc, RECT *rcPaint);
+ CLINTERFACE tPaintCallbackProc PaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData);
- BOOL IsForegroundWindow(HWND hWnd);
- HFONT ChangeToFont(HDC hdc, ClcData *dat, int id, int *fontHeight);
- int GetBasicFontID(ClcContact *contact);
- void GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height);
- void AddParam(MODERNMASK *mpModernMask, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
- BOOL CheckMiniMode(ClcData *dat, BOOL selected, BOOL hot);
+ BOOL IsForegroundWindow(HWND hWnd);
+ HFONT ChangeToFont(HDC hdc, ClcData *dat, int id, int *fontHeight);
+ int GetBasicFontID(ClcContact *contact);
+ void GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height);
+ void AddParam(MODERNMASK *mpModernMask, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
+ BOOL CheckMiniMode(ClcData *dat, BOOL selected);
private:
static const int HORIZONTAL_SPACE;
@@ -37,7 +37,7 @@ private:
enum tagenumHASHINDEX
{
- hi_Module=0,
+ hi_Module = 0,
hi_ID,
hi_Type,
hi_Open,
@@ -106,52 +106,52 @@ private:
void _AddParamShort(MODERNMASK *mpModernMask, DWORD dwParamIndex, DWORD dwValueIndex);
void _FillParam(MASKPARAM * lpParam, DWORD dwParamHash, const char* szValue, DWORD dwValueHash);
MODERNMASK* _GetCLCContactRowBackModernMask(ClcGroup *group, ClcContact *Drawing, int indent, int index, BOOL selected, BOOL hottrack, ClcData *dat);
- void _RTLRect(RECT *rect, int width, int offset);
- void _PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint);
+ void _RTLRect(RECT *rect, int width);
+ void _PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int selected, int hottrack);
void _DrawStatusIcon(ClcContact *Drawing, ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode);
- BOOL _DrawNonEnginedBackground(HWND hwnd, HDC hdcMem, RECT *rcPaint, RECT clRect, ClcData *dat);
+ BOOL _DrawNonEnginedBackground(HDC hdcMem, RECT *rcPaint, RECT clRect, ClcData *dat);
void _PaintClc(HWND hwnd, ClcData *dat, HDC hdc, RECT *rcPaint);
void _StoreItemPos(ClcContact *contact, int ItemType, RECT *rc);
- void _CalcItemsPos(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected, int hottrack);
+ void _CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected);
BOOL __IsVisible(RECT *firtRect, RECT *secondRect);
void _GetBlendMode(IN ClcData *dat, IN ClcContact *Drawing, IN BOOL selected, IN BOOL hottrack, IN BOOL bFlag, OUT COLORREF * OutColourFg, OUT int * OutMode);
- void _DrawContactItems(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint);
- void _PaintRowItems (HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint);
+ void _DrawContactItems(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int selected, int hottrack, RECT *rcPaint);
+ void _PaintRowItems(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint);
- void _DrawContactAvatar (HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem);
- void _DrawContactIcon (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem);
- void _DrawContactText (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat);
- void _DrawContactSubText (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType);
- void _DrawContactTime (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem);
- void _DrawContactExtraIcon (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *rc, int iImage);
- void _DrawContactSelection (HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT *prcItem);
- void _DrawContactLine (HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc);
+ void _DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT *prcItem);
+ void _DrawContactIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *prcItem);
+ void _DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat);
+ void _DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType);
+ void _DrawContactTime(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *prcItem);
+ void _DrawContactExtraIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rc, int iImage);
+ void _DrawContactSelection(HDC hdcMem, ClcData *dat, int& selected, int& hottrack, RECT *rcPaint, RECT *prcItem);
+ void _DrawContactLine(HDC hdcMem, ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc);
- int _rcWidth(RECT *rc) { return rc->right-rc->left; }
- int _rcHeight(RECT *rc) { return rc->bottom-rc->top; }
+ int _rcWidth(RECT *rc) { return rc->right - rc->left; }
+ int _rcHeight(RECT *rc) { return rc->bottom - rc->top; }
private:
- enum enDrawMode
- {
- DM_LAYERED = 1, // Draw normal skin on 32 bit with alpha layer
- DM_NON_LAYERED = 2, // Draw skinnable, but does not take care about alpha
- DM_CLASSIC = 4, // Old style draw for classic
- DM_CONTROL = 8, // Draw as control according to windows color scheme
- DM_FLOAT = 16, // Float mode
- DM_GRAY = 32, // Grayed mode
- DM_GREYALTERNATE = 64, // Gray odd lines
- DM_DRAW_OFFSCREEN = DM_FLOAT | DM_CONTROL | DM_NON_LAYERED | DM_CLASSIC,
+ enum enDrawMode
+ {
+ DM_LAYERED = 1, // Draw normal skin on 32 bit with alpha layer
+ DM_NON_LAYERED = 2, // Draw skinnable, but does not take care about alpha
+ DM_CLASSIC = 4, // Old style draw for classic
+ DM_CONTROL = 8, // Draw as control according to windows color scheme
+ DM_FLOAT = 16, // Float mode
+ DM_GRAY = 32, // Grayed mode
+ DM_GREYALTERNATE = 64, // Gray odd lines
+ DM_DRAW_OFFSCREEN = DM_FLOAT | DM_CONTROL | DM_NON_LAYERED | DM_CLASSIC,
};
inline int _DetermineDrawMode(HWND hWnd, ClcData *dat);
struct _PaintContext
{
- enum
+ enum
{
- release_none = 0,
- release_hdcmem2 = 1,
- release_hdcmem = 2
+ release_none = 0,
+ release_hdcmem2 = 1,
+ release_hdcmem = 2
};
HDC hdcMem;
HDC hdcMem2;
@@ -168,19 +168,19 @@ private:
DWORD fRelease;
_PaintContext(HDC _hdcMem = NULL) :
- hdcMem (_hdcMem ), hdcMem2(NULL ),
- hBmpOsb2(NULL ), oldbmp2(NULL ),
- hBmpOsb(NULL ), oldbmp(NULL ),
- hBrushAlternateGrey (NULL ),
- tmpbkcolour(0 ), tmpforecolour(0 ),
- fRelease (release_none) {};
+ hdcMem(_hdcMem), hdcMem2(NULL),
+ hBmpOsb2(NULL), oldbmp2(NULL),
+ hBmpOsb(NULL), oldbmp(NULL),
+ hBrushAlternateGrey(NULL),
+ tmpbkcolour(0), tmpforecolour(0),
+ fRelease(release_none) {};
};
- inline void _PreparePaintContext(HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT& clRect, _PaintContext& pc);
- inline void _DrawBackground(HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc);
- inline void _DrawLines(HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc);
+ inline void _PreparePaintContext(ClcData *dat, HDC hdc, int paintMode, RECT& clRect, _PaintContext& pc);
+ inline void _DrawBackground(HWND hWnd, ClcData *dat, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc);
+ inline void _DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc);
inline void _DrawInsertionMark(ClcData *dat, RECT& clRect, _PaintContext& pc);
- inline void _CopyPaintToDest(HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc);
+ inline void _CopyPaintToDest(HDC hdc, int paintMode, RECT* rcPaint, _PaintContext& pc);
inline void _FreePaintContext(_PaintContext& pc);
};
diff --git a/plugins/Clist_modern/src/hdr/modern_clist.h b/plugins/Clist_modern/src/hdr/modern_clist.h
index ef89b2b92b..2884c731cd 100644
--- a/plugins/Clist_modern/src/hdr/modern_clist.h
+++ b/plugins/Clist_modern/src/hdr/modern_clist.h
@@ -29,8 +29,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void LoadContactTree(void);
HTREEITEM GetTreeItemByHContact(MCONTACT hContact);
-void cli_ChangeContactIcon(MCONTACT hContact,int iIcon,int add);
-int GetContactInfosForSort(MCONTACT hContact,char **Proto,TCHAR **Name,int *Status);
+void cli_ChangeContactIcon(MCONTACT hContact, int iIcon, int add);
+int GetContactInfosForSort(MCONTACT hContact, char **Proto, TCHAR **Name, int *Status);
///////////////////////////////////////////////////////////////////////////////
@@ -40,17 +40,17 @@ public:
SortedList* plText;
int iMaxSmileyHeight;
- CSmileyString() : plText( NULL ), iMaxSmileyHeight( 0 ) {};
- CSmileyString( const CSmileyString& ssIn )
+ CSmileyString() : plText(NULL), iMaxSmileyHeight(0) {};
+ CSmileyString(const CSmileyString& ssIn)
{
- _CopySmileyList( ssIn.plText );
+ _CopySmileyList(ssIn.plText);
iMaxSmileyHeight = ssIn.iMaxSmileyHeight;
}
- CSmileyString& operator= ( const CSmileyString& ssIn )
+ CSmileyString& operator= (const CSmileyString& ssIn)
{
DestroySmileyList();
- _CopySmileyList( ssIn.plText );
+ _CopySmileyList(ssIn.plText);
iMaxSmileyHeight = ssIn.iMaxSmileyHeight;
return *this;
}
@@ -65,8 +65,8 @@ public:
/** Destroy smiley list */
void DestroySmileyList();
/** Copy Smiley List */
- void _CopySmileyList( SortedList *plInput );
- void AddListeningToIcon(struct SHORTDATA *dat, struct ClcCacheEntry *pdnce, TCHAR *szText, BOOL replace_smileys);
+ void _CopySmileyList(SortedList *plInput);
+ void AddListeningToIcon(struct SHORTDATA *dat, TCHAR *szText);
};
diff --git a/plugins/Clist_modern/src/hdr/modern_clui.h b/plugins/Clist_modern/src/hdr/modern_clui.h
index f67a575d6a..09d27c011d 100644
--- a/plugins/Clist_modern/src/hdr/modern_clui.h
+++ b/plugins/Clist_modern/src/hdr/modern_clui.h
@@ -50,69 +50,68 @@ public:
CLINTERFACE void cliOnCreateClc();
- EVENTHOOK( OnEvent_ModulesLoaded );
- EVENTHOOK( OnEvent_ContactMenuPreBuild );
- EVENTHOOK( OnEvent_FontReload );
+ EVENTHOOK(OnEvent_ModulesLoaded);
+ EVENTHOOK(OnEvent_ContactMenuPreBuild);
+ EVENTHOOK(OnEvent_FontReload);
- SERVICE( Service_ShowMainMenu );
- SERVICE( Service_ShowStatusMenu );
- SERVICE( Service_Menu_ShowContactAvatar );
- SERVICE( Service_Menu_HideContactAvatar );
+ SERVICE(Service_ShowMainMenu);
+ SERVICE(Service_ShowStatusMenu);
+ SERVICE(Service_Menu_ShowContactAvatar);
+ SERVICE(Service_Menu_HideContactAvatar);
static LRESULT CALLBACK cli_ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
CLUI * This = m_pCLUI;
- if (!m_hWnd ) m_hWnd = hwnd;
+ if (!m_hWnd) m_hWnd = hwnd;
BOOL bHandled = FALSE;
- LRESULT lRes= This->PreProcessWndProc( msg, wParam, lParam, bHandled );
- if ( bHandled ) return lRes;
+ LRESULT lRes = This->PreProcessWndProc(msg, wParam, lParam, bHandled);
+ if (bHandled) return lRes;
- switch ( msg )
+ switch (msg)
{
- HANDLE_MESSAGE(WM_NCCREATE, OnNcCreate);
- HANDLE_MESSAGE(WM_CREATE, OnCreate);
- HANDLE_MESSAGE(UM_CREATECLC, OnCreateClc);
- HANDLE_MESSAGE(UM_SETALLEXTRAICONS, OnSetAllExtraIcons);
- HANDLE_MESSAGE(WM_INITMENU, OnInitMenu);
- HANDLE_MESSAGE(WM_SIZE, OnSizingMoving);
- HANDLE_MESSAGE(WM_SIZING, OnSizingMoving);
- HANDLE_MESSAGE(WM_MOVE, OnSizingMoving);
- HANDLE_MESSAGE(WM_EXITSIZEMOVE, OnSizingMoving);
- HANDLE_MESSAGE(WM_WINDOWPOSCHANGING, OnSizingMoving);
- HANDLE_MESSAGE(WM_DISPLAYCHANGE, OnSizingMoving);
- HANDLE_MESSAGE(WM_THEMECHANGED, OnThemeChanged);
+ HANDLE_MESSAGE(WM_NCCREATE, OnNcCreate);
+ HANDLE_MESSAGE(WM_CREATE, OnCreate);
+ HANDLE_MESSAGE(UM_CREATECLC, OnCreateClc);
+ HANDLE_MESSAGE(UM_SETALLEXTRAICONS, OnSetAllExtraIcons);
+ HANDLE_MESSAGE(WM_INITMENU, OnInitMenu);
+ HANDLE_MESSAGE(WM_SIZE, OnSizingMoving);
+ HANDLE_MESSAGE(WM_SIZING, OnSizingMoving);
+ HANDLE_MESSAGE(WM_MOVE, OnSizingMoving);
+ HANDLE_MESSAGE(WM_EXITSIZEMOVE, OnSizingMoving);
+ HANDLE_MESSAGE(WM_WINDOWPOSCHANGING, OnSizingMoving);
+ HANDLE_MESSAGE(WM_DISPLAYCHANGE, OnSizingMoving);
+ HANDLE_MESSAGE(WM_THEMECHANGED, OnThemeChanged);
HANDLE_MESSAGE(WM_DWMCOMPOSITIONCHANGED, OnDwmCompositionChanged);
- HANDLE_MESSAGE(UM_UPDATE, OnUpdate);
- HANDLE_MESSAGE(WM_NCACTIVATE, OnNcPaint);
- HANDLE_MESSAGE(WM_PRINT, OnNcPaint);
- HANDLE_MESSAGE(WM_NCPAINT, OnNcPaint);
- HANDLE_MESSAGE(WM_ERASEBKGND, OnEraseBkgnd);
- HANDLE_MESSAGE(WM_PAINT, OnPaint);
- HANDLE_MESSAGE(WM_LBUTTONDOWN, OnLButtonDown);
- HANDLE_MESSAGE(WM_PARENTNOTIFY, OnParentNotify);
- HANDLE_MESSAGE(WM_SETFOCUS, OnSetFocus);
- HANDLE_MESSAGE(WM_TIMER, OnTimer);
- HANDLE_MESSAGE(WM_ACTIVATE, OnActivate);
- HANDLE_MESSAGE(WM_SETCURSOR, OnSetCursor);
- HANDLE_MESSAGE(WM_MOUSEACTIVATE, OnMouseActivate);
- HANDLE_MESSAGE(WM_NCLBUTTONDOWN, OnNcLButtonDown);
- HANDLE_MESSAGE(WM_NCLBUTTONDBLCLK, OnNcLButtonDblClk);
- HANDLE_MESSAGE(WM_NCHITTEST, OnNcHitTest);
- HANDLE_MESSAGE(WM_SHOWWINDOW, OnShowWindow);
- HANDLE_MESSAGE(WM_SYSCOMMAND, OnSysCommand);
- HANDLE_MESSAGE(WM_KEYDOWN, OnKeyDown);
- HANDLE_MESSAGE(WM_GETMINMAXINFO, OnGetMinMaxInfo);
- HANDLE_MESSAGE(WM_MOVING, OnMoving);
- HANDLE_MESSAGE(WM_NOTIFY, OnNotify);
- HANDLE_MESSAGE(WM_CONTEXTMENU, OnContextMenu);
- HANDLE_MESSAGE(WM_MEASUREITEM, OnMeasureItem);
- HANDLE_MESSAGE(WM_DRAWITEM, OnDrawItem);
- HANDLE_MESSAGE(WM_DESTROY, OnDestroy);
+ HANDLE_MESSAGE(UM_UPDATE, OnUpdate);
+ HANDLE_MESSAGE(WM_NCACTIVATE, OnNcPaint);
+ HANDLE_MESSAGE(WM_PRINT, OnNcPaint);
+ HANDLE_MESSAGE(WM_NCPAINT, OnNcPaint);
+ HANDLE_MESSAGE(WM_ERASEBKGND, OnEraseBkgnd);
+ HANDLE_MESSAGE(WM_PAINT, OnPaint);
+ HANDLE_MESSAGE(WM_LBUTTONDOWN, OnLButtonDown);
+ HANDLE_MESSAGE(WM_PARENTNOTIFY, OnParentNotify);
+ HANDLE_MESSAGE(WM_SETFOCUS, OnSetFocus);
+ HANDLE_MESSAGE(WM_TIMER, OnTimer);
+ HANDLE_MESSAGE(WM_ACTIVATE, OnActivate);
+ HANDLE_MESSAGE(WM_SETCURSOR, OnSetCursor);
+ HANDLE_MESSAGE(WM_MOUSEACTIVATE, OnMouseActivate);
+ HANDLE_MESSAGE(WM_NCLBUTTONDOWN, OnNcLButtonDown);
+ HANDLE_MESSAGE(WM_NCLBUTTONDBLCLK, OnNcLButtonDblClk);
+ HANDLE_MESSAGE(WM_NCHITTEST, OnNcHitTest);
+ HANDLE_MESSAGE(WM_SHOWWINDOW, OnShowWindow);
+ HANDLE_MESSAGE(WM_SYSCOMMAND, OnSysCommand);
+ HANDLE_MESSAGE(WM_KEYDOWN, OnKeyDown);
+ HANDLE_MESSAGE(WM_GETMINMAXINFO, OnGetMinMaxInfo);
+ HANDLE_MESSAGE(WM_MOVING, OnMoving);
+ HANDLE_MESSAGE(WM_NOTIFY, OnNotify);
+ HANDLE_MESSAGE(WM_CONTEXTMENU, OnContextMenu);
+ HANDLE_MESSAGE(WM_MEASUREITEM, OnMeasureItem);
+ HANDLE_MESSAGE(WM_DRAWITEM, OnDrawItem);
+ HANDLE_MESSAGE(WM_DESTROY, OnDestroy);
default:
return This->DefCluiWndProc(msg, wParam, lParam);
}
- return FALSE;
}
@@ -121,8 +120,8 @@ public:
//
private:
HRESULT CreateCLC();
- HRESULT FillAlphaChannel( HDC hDC, RECT* prcParent, BYTE bAlpha);
- HRESULT SnappingToEdge( WINDOWPOS * lpWindowPos );
+ HRESULT FillAlphaChannel(HDC hDC, RECT* prcParent);
+ HRESULT SnappingToEdge(WINDOWPOS * lpWindowPos);
HRESULT LoadDllsRuntime();
HRESULT RegisterAvatarMenu(); // TODO move to CLC class
HRESULT CreateCluiFrames();
@@ -131,11 +130,11 @@ private:
LRESULT DefCluiWndProc(UINT msg, WPARAM wParam, LPARAM lParam)
{
- return corecli.pfnContactListWndProc( m_hWnd, msg, wParam, lParam);
+ return corecli.pfnContactListWndProc(m_hWnd, msg, wParam, lParam);
}
// MessageMap
- LRESULT PreProcessWndProc(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled );
+ LRESULT PreProcessWndProc(UINT msg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT OnThemeChanged(UINT msg, WPARAM wParam, LPARAM lParam);
LRESULT OnDwmCompositionChanged(UINT msg, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
index d8723914e8..fddccd50ef 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h
@@ -47,13 +47,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#if defined (_DEBUG)
#define TRACE(str) { log0(str); }
#else
- #define TRACE(str)
+#define TRACE(str)
#endif
#if defined (_DEBUG)
- #define TRACEVAR(str,n) { log1(str,n); }
+#define TRACEVAR(str,n) { log1(str,n); }
#else
- #define TRACEVAR(str,n)
+#define TRACEVAR(str,n)
#endif
#if defined (_DEBUG)
@@ -143,7 +143,7 @@ extern TCHAR SkinsFolder[MAX_PATH];
#define SCF_TOP 3
#define SCF_BOTTOM 6
-char* __cdecl strstri( char *a, const char *b);
+char* __cdecl strstri(char *a, const char *b);
BOOL __cdecl mir_bool_strcmpi(const char *a, const char *b);
BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b);
DWORD exceptFunction(LPEXCEPTION_POINTERS EP);
@@ -237,7 +237,7 @@ int AniAva_RemoveInvalidatedAvatars(); // all avatars without validated p
int AniAva_RemoveAvatar(MCONTACT hContact); // remove avatar
int AniAva_RedrawAllAvatars(BOOL updateZOrder); // request to repaint all
void AniAva_UpdateParent();
-int AniAva_RenderAvatar(MCONTACT hContact, HDC hdcMem, RECT *rc );
+int AniAva_RenderAvatar(MCONTACT hContact, HDC hdcMem, RECT *rc);
#define CCI_NAME 1
#define CCI_GROUP (1<<1)
@@ -264,12 +264,12 @@ int CLUI_SyncGetPDNCE(WPARAM wParam, LPARAM lParam);
WORD pdnce___GetStatus(ClcCacheEntry *pdnce);
/* move to list module */
-typedef void (*ItemDestuctor)(void*);
+typedef void(*ItemDestuctor)(void*);
#ifdef __cplusplus
-const ROWCELL * rowAddCell(ROWCELL* &, int );
+const ROWCELL * rowAddCell(ROWCELL* &, int);
void rowDeleteTree(ROWCELL *cell);
-BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &sequence, ROWCELL** RowTabAccess );
+BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &sequence, ROWCELL** RowTabAccess);
void rowSizeWithReposition(ROWCELL* &root, int width);
#endif
@@ -294,34 +294,34 @@ class HashStringKeyNoCase
{
public:
- HashStringKeyNoCase( const char* szKey )
+ HashStringKeyNoCase(const char* szKey)
{
- _strKey=_strdup( szKey );
+ _strKey = _strdup(szKey);
_CreateHashKey();
}
- HashStringKeyNoCase( const HashStringKeyNoCase& hsKey )
+ HashStringKeyNoCase(const HashStringKeyNoCase& hsKey)
{
- _strKey = _strdup( hsKey._strKey );
- _dwKey = hsKey._dwKey;
+ _strKey = _strdup(hsKey._strKey);
+ _dwKey = hsKey._dwKey;
}
- HashStringKeyNoCase& operator= ( const HashStringKeyNoCase& hsKey )
+ HashStringKeyNoCase& operator= (const HashStringKeyNoCase& hsKey)
{
- _strKey = _strdup( hsKey._strKey );
- _dwKey = hsKey._dwKey;
+ _strKey = _strdup(hsKey._strKey);
+ _dwKey = hsKey._dwKey;
}
#ifdef _UNICODE
- HashStringKeyNoCase( const wchar_t* szKey )
+ HashStringKeyNoCase(const wchar_t* szKey)
{
- int codepage=0;
- int cbLen = WideCharToMultiByte( codepage, 0, szKey, -1, NULL, 0, NULL, NULL );
- char* result = ( char* )malloc( cbLen+1 );
- WideCharToMultiByte( codepage, 0, szKey, -1, result, cbLen, NULL, NULL );
- result[ cbLen ] = 0;
+ int codepage = 0;
+ int cbLen = WideCharToMultiByte(codepage, 0, szKey, -1, NULL, 0, NULL, NULL);
+ char* result = (char*)malloc(cbLen + 1);
+ WideCharToMultiByte(codepage, 0, szKey, -1, result, cbLen, NULL, NULL);
+ result[cbLen] = 0;
- _strKey=result;
+ _strKey = result;
_CreateHashKey();
}
#endif
@@ -330,7 +330,7 @@ public:
{
free(_strKey);
_strKey = NULL;
- _dwKey=0;
+ _dwKey = 0;
}
private:
@@ -339,23 +339,25 @@ private:
void _CreateHashKey()
{
- _strKey=_strupr( _strKey );
- _dwKey = mod_CalcHash( _strKey );
+ _strKey = _strupr(_strKey);
+ _dwKey = mod_CalcHash(_strKey);
}
public:
- bool operator< ( const HashStringKeyNoCase& second ) const
+ bool operator< (const HashStringKeyNoCase& second) const
{
- if ( this->_dwKey != second._dwKey )
- return ( this->_dwKey < second._dwKey );
+ if (this->_dwKey != second._dwKey)
+ return (this->_dwKey < second._dwKey);
else
- return ( mir_strcmp( this->_strKey, second._strKey ) < 0 ); // already maked upper so in any case - will be case insensitive
+ return (mir_strcmp(this->_strKey, second._strKey) < 0); // already maked upper so in any case - will be case insensitive
}
struct HashKeyLess
{
- bool operator() ( const HashStringKeyNoCase& first, const HashStringKeyNoCase& second ) const
- { return ( first < second ); }
+ bool operator() (const HashStringKeyNoCase& first, const HashStringKeyNoCase& second) const
+ {
+ return (first < second);
+ }
};
};
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
index b0dc2bc203..528ecf6d82 100644
--- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
+++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h
@@ -76,7 +76,7 @@ public:
__forceinline ~thread_catcher() { m_ptr = 0; }
};
-typedef INT_PTR (*PSYNCCALLBACKPROC)(WPARAM,LPARAM);
+typedef INT_PTR(*PSYNCCALLBACKPROC)(WPARAM, LPARAM);
/************************************************************************/
/* PROTOTYPES */
@@ -87,25 +87,25 @@ typedef INT_PTR (*PSYNCCALLBACKPROC)(WPARAM,LPARAM);
BOOL CLCItems_IsShowOfflineGroup(ClcGroup* group);
/* CListMod */
-int CListMod_HideWindow(HWND hwndContactList, int mode);
+int CListMod_HideWindow();
/* CLUI */
-HANDLE RegisterIcolibIconHandle(char * szIcoID, char *szSectionName, char * szDescription, TCHAR * tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModule, int iDefaultResource );
+HANDLE RegisterIcolibIconHandle(char * szIcoID, char *szSectionName, char * szDescription, TCHAR * tszDefaultFile, int iDefaultIndex, HINSTANCE hDefaultModule, int iDefaultResource);
void CLUI_UpdateAeroGlass();
void CLUI_ChangeWindowMode();
BOOL CLUI_CheckOwnedByClui(HWND hwnd);
INT_PTR CLUI_GetConnectingIconService(WPARAM wParam, LPARAM lParam);
int CLUI_HideBehindEdge();
-int CLUI_IconsChanged(WPARAM,LPARAM);
+int CLUI_IconsChanged(WPARAM, LPARAM);
int CLUI_IsInMainWindow(HWND hwnd);
int CLUI_OnSkinLoad(WPARAM wParam, LPARAM lParam);
int CLUI_ReloadCLUIOptions();
int CLUI_ShowFromBehindEdge();
-int CLUI_SizingGetWindowRect(HWND hwnd,RECT *rc);
-int CLUI_SizingOnBorder(POINT ,int);
+int CLUI_SizingGetWindowRect(HWND hwnd, RECT *rc);
+int CLUI_SizingOnBorder(POINT, int);
int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam);
int CLUI_TestCursorOnBorders();
-int CLUI_UpdateTimer(BYTE BringIn);
+int CLUI_UpdateTimer();
void CLUI_UpdateLayeredMode();
UINT_PTR CLUI_SafeSetTimer(HWND hwnd, int ID, int Timeout, TIMERPROC proc);
@@ -113,39 +113,39 @@ UINT_PTR CLUI_SafeSetTimer(HWND hwnd, int ID, int Timeout, TIMERPROC proc);
int CLUIUnreadEmailCountChanged(WPARAM wParam, LPARAM lParam);
/* GDIPlus */
-BOOL GDIPlus_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest,int nHeightDest,HDC hdcSrc,int nXOriginSrc,int nYOriginSrc,int nWidthSrc,int nHeightSrc, BLENDFUNCTION * blendFunction);
+BOOL GDIPlus_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION * blendFunction);
HBITMAP GDIPlus_LoadGlyphImage(const TCHAR *szFileName);
/* EventArea */
void EventArea_ConfigureEventArea();
/* ModernSkinButton */
-int ModernSkinButton_AddButton(HWND parent,char * ID,char * CommandService,char * StateDefService,char * HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo,TCHAR * Hint,char * DBkey,char * TypeDef,int MinWidth, int MinHeight);
+int ModernSkinButton_AddButton(HWND parent, char * ID, char * CommandService, char * StateDefService, char * HandeService, int Left, int Top, int Right, int Bottom, DWORD AlignedTo, TCHAR * Hint, char * DBkey, char * TypeDef, int MinWidth, int MinHeight);
int ModernSkinButtonLoadModule();
int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r);
-int ModernSkinButtonUnloadModule(WPARAM,LPARAM);
+int ModernSkinButtonUnloadModule(WPARAM, LPARAM);
/* RowHeight */
int RowHeight_CalcRowHeight(ClcData *dat, HWND hwnd, ClcContact *contact, int item);
/* SkinEngine */
-BOOL ske_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest,int nHeightDest,HDC hdcSrc,int nXOriginSrc,int nYOriginSrc,int nWidthSrc,int nHeightSrc,BLENDFUNCTION blendFunction);
+BOOL ske_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION blendFunction);
void ske_ApplyTranslucency(void);
-int ske_BltBackImage (HWND destHWND, HDC destDC, RECT *BltClientRect);
+int ske_BltBackImage(HWND destHWND, HDC destDC, RECT *BltClientRect);
HBITMAP ske_CreateDIB32(int cx, int cy);
HBITMAP ske_CreateDIB32Point(int cx, int cy, void ** bits);
HRGN ske_CreateOpaqueRgn(BYTE Level, bool Opaque);
-HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop,BYTE alpha);
+HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha);
int ske_DrawImageAt(HDC hdc, RECT *rc);
-BOOL ske_DrawIconEx(HDC hdc,int xLeft,int yTop,HICON hIcon,int cxWidth,int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
-int ske_DrawNonFramedObjects(BOOL Erase,RECT *r);
+BOOL ske_DrawIconEx(HDC hdc, int xLeft, int yTop, HICON hIcon, int cxWidth, int cyWidth, UINT istepIfAniCur, HBRUSH hbrFlickerFreeDraw, UINT diFlags);
+int ske_DrawNonFramedObjects(BOOL Erase, RECT *r);
BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT *lpRect, UINT format);
LPSKINOBJECTDESCRIPTOR ske_FindObjectByName(const char * szName, BYTE objType, SKINOBJECTSLIST* Skin);
HBITMAP ske_GetCurrentWindowImage();
-int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder,BOOL madeAbsolute);
+int ske_GetFullFilename(TCHAR *buf, const TCHAR *file, TCHAR *skinfolder, BOOL madeAbsolute);
int ske_GetSkinFolder(TCHAR *szFileName, char * t2);
-BOOL ske_ImageList_DrawEx( HIMAGELIST himl,int i,HDC hdcDst,int x,int y,int dx,int dy,COLORREF rgbBk,COLORREF rgbFg,UINT fStyle);
-HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i, UINT fStyle);
+BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle);
+HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i);
int ske_JustUpdateWindowImageRect(RECT *rty);
HBITMAP ske_LoadGlyphImage(const TCHAR *szFileName);
HRESULT SkinEngineLoadModule();
@@ -153,13 +153,13 @@ void ske_LoadSkinFromDB(void);
int ske_LoadSkinFromIniFile(TCHAR*, BOOL);
TCHAR* ske_ParseText(TCHAR *stzText);
int ske_PrepareImageButDontUpdateIt(RECT *r);
-int ske_ReCreateBackImage(BOOL Erase,RECT *w);
+int ske_ReCreateBackImage(BOOL Erase, RECT *w);
int ske_RedrawCompleteWindow();
bool ske_ResetTextEffect(HDC);
bool ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor);
INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam);
-BOOL ske_SetRectOpaque(HDC memdc,RECT *fr, BOOL force = FALSE );
-BOOL ske_SetRgnOpaque(HDC memdc,HRGN hrgn, BOOL force = FALSE );
+BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force = FALSE);
+BOOL ske_SetRgnOpaque(HDC memdc, HRGN hrgn, BOOL force = FALSE);
BOOL ske_TextOut(HDC hdc, int x, int y, LPCTSTR lpString, int nCount);
int ske_UnloadGlyphImage(HBITMAP hbmp);
int SkinEngineUnloadModule();
@@ -168,23 +168,24 @@ int ske_UpdateWindowImageRect(RECT *lpRect);
int ske_ValidateFrameImageProc(RECT *r);
__forceinline BOOL ske_DrawTextA(HDC hdc, char *lpString, int nCount, RECT *lpRect, UINT format)
-{ return ske_DrawText(hdc, _A2T(lpString), nCount, lpRect, format);
+{
+ return ske_DrawText(hdc, _A2T(lpString), nCount, lpRect, format);
}
/* CLUIFrames.c PROXIED */
int CLUIFrames_ActivateSubContainers(BOOL wParam);
int CLUIFrames_OnClistResize_mod(WPARAM wParam, LPARAM lParam);
-int CLUIFrames_OnMoving( HWND, RECT *);
-int CLUIFrames_OnShowHide( HWND hwnd, int mode );
-int CLUIFrames_SetLayeredMode( BOOL fLayeredMode, HWND hwnd );
-int CLUIFrames_SetParentForContainers( HWND parent );
+int CLUIFrames_OnMoving(HWND, RECT *);
+int CLUIFrames_OnShowHide(int mode);
+int CLUIFrames_SetLayeredMode(BOOL fLayeredMode, HWND hwnd);
+int CLUIFrames_SetParentForContainers(HWND parent);
int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam);
FRAMEWND * FindFrameByItsHWND(HWND FrameHwnd); //cluiframes.c
//int callProxied_DrawTitleBar(HDC hdcMem2,RECT *rect,int Frameid);
-int DrawTitleBar(HDC hdcMem2,RECT *rect,int Frameid);
+int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid);
int FindFrameID(HWND FrameHwnd);
int SetAlpha(BYTE Alpha);
@@ -192,7 +193,7 @@ int SetAlpha(BYTE Alpha);
/* others TODO: move above */
int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam);
-void DrawBackGround(HWND hwnd,HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColour, DWORD backgroundBmpUse );
+void DrawBackGround(HWND hwnd, HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColour, DWORD backgroundBmpUse);
HRESULT BackgroundsLoadModule();
int BackgroundsUnloadModule();
INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); //RowTemplate.c
@@ -203,7 +204,7 @@ char* GetParamN(char *string, char *buf, int buflen, BYTE paramN, char Delim,
WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim, BOOL SkipSpaces);
DWORD CompareContacts2_getLMTime(MCONTACT u); //contact.c
DWORD mod_CalcHash(const char * a); //mod_skin_selector.c
-HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto,int status); //clistmod.c
+HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int status); //clistmod.c
HICON GetMainStatusOverlay(int STATUS); //clc.c
int __fastcall CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szStatus, ClcData *dat); //clcitems.c
int BgStatusBarChange(WPARAM wParam, LPARAM lParam); //clcopts.c
@@ -211,8 +212,8 @@ int ClcDoProtoAck(MCONTACT wParam, ACKDATA *ack);
int ModernSkinButtonDeleteAll(); //modernbutton.c
int GetContactCachedStatus(MCONTACT hContact); //clistsettings.c
int GetContactIconC(ClcCacheEntry *cacheEntry); //clistmod.c
-int GetContactIndex(ClcGroup *group,ClcContact *contact); //clcidents.c
-int GetStatusForContact(MCONTACT hContact,char *szProto); //clistsettings.c
+int GetContactIndex(ClcGroup *group, ClcContact *contact); //clcidents.c
+int GetStatusForContact(MCONTACT hContact, char *szProto); //clistsettings.c
int InitCustomMenus(void); //clistmenus.c
int InitFramesMenus(void); //framesmenus.c
int LoadMoveToGroup(); //movetogroup.c
@@ -221,9 +222,9 @@ int MenuModulesLoaded(WPARAM wParam, LPARAM lParam);
int MenuModulesShutdown(WPARAM wParam, LPARAM lParam); //clistmenu.c
int MenuProcessCommand(WPARAM wParam, LPARAM lParam); //clistmenu.c
int OnFrameTitleBarBackgroundChange(WPARAM wParam, LPARAM lParam); //cluiframes.c
-int QueueAllFramesUpdating (BYTE); //cluiframes.c
+int QueueAllFramesUpdating(BYTE); //cluiframes.c
int RecursiveDeleteMenu(HMENU hMenu); //clistmenus.c
-int ModernSkinButtonRedrawAll(HDC hdc); //modern_button.c
+int ModernSkinButtonRedrawAll(); //modern_button.c
int RegisterButtonByParce(char * ObjectName, char * Params); //mod_skin_selector.c
int RestoreAllContactData(ClcData *dat); //cache_funcs.c
@@ -234,11 +235,11 @@ INT_PTR ToggleGroups(WPARAM wParam, LPARAM lParam);
INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam); //contact.c
INT_PTR ToggleSounds(WPARAM wParam, LPARAM lParam); //contact.c
void ClcOptionsChanged(); //clc.c
-void Docking_GetMonitorRectFromWindow(HWND hWnd,RECT *rc); //Docking.c
-void DrawAvatarImageWithGDIp(HDC hDestDC,int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1,DWORD flag,BYTE alpha); //gdiplus.cpp
+void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc); //Docking.c
+void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, BYTE alpha); //gdiplus.cpp
void FreeRowCell(); //RowHeight
void InitGdiPlus(); //gdiplus.cpp
-void InvalidateDNCEbyPointer(MCONTACT hContact,ClcCacheEntry *pdnce,int SettingType); //clistsettings.c
+void InvalidateDNCEbyPointer(MCONTACT hContact, ClcCacheEntry *pdnce, int SettingType); //clistsettings.c
void ShutdownGdiPlus(); //gdiplus.cpp
void UninitCustomMenus(); //clistmenus.c
void UnloadAvatarOverlayIcon(); //clc.c
@@ -251,7 +252,7 @@ int ExtraImage_ExtraIDToColumnNum(int extra);
int LoadSkinButtonModule();
void UninitSkinHotKeys();
-void GetDefaultFontSetting(int i,LOGFONTA *lf,COLORREF *colour);
+void GetDefaultFontSetting(int i, LOGFONTA *lf, COLORREF *colour);
int CLUI_OnSkinLoad(WPARAM wParam, LPARAM lParam);
HRESULT CluiLoadModule();
HRESULT PreLoadContactListModule();
@@ -301,7 +302,7 @@ void CLUI_cli_LoadCluiGlobalOpts(void);
INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam);
BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect, BOOL bErase);
-ClcContact* cliCreateClcContact( void );
+ClcContact* cliCreateClcContact(void);
ClcCacheEntry* cliCreateCacheItem(MCONTACT hContact);
ClcCacheEntry* cliGetCacheEntry(MCONTACT hContact);
@@ -317,7 +318,7 @@ struct DWM_BLURBEHIND
HRGN hRgnBlur;
BOOL fTransitionOnMaximized;
};
-extern HRESULT (WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
+extern HRESULT(WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
extern tPaintCallbackProc CLCPaint_PaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData);
diff --git a/plugins/Clist_modern/src/hdr/modern_effectenum.h b/plugins/Clist_modern/src/hdr/modern_effectenum.h
index e3c5600dc6..0a63ffbdce 100644
--- a/plugins/Clist_modern/src/hdr/modern_effectenum.h
+++ b/plugins/Clist_modern/src/hdr/modern_effectenum.h
@@ -20,74 +20,74 @@ typedef struct _MODERNEFFECT
}MODERNEFFECT;
#ifdef _EFFECTENUM_FULL_H
- TCHAR * ModernEffectNames[]=
+TCHAR * ModernEffectNames[]=
#else
- TCHAR * _ModernEffectNames[]=
+TCHAR * _ModernEffectNames[] =
#endif
{
- _T("Shadow at left"),
- _T("Shadow at right"),
- _T("Outline"),
- _T("Outline smooth"),
- _T("Smooth bump"),
- _T("Contour thin"),
- _T("Contour heavy"),
+ _T("Shadow at left"),
+ _T("Shadow at right"),
+ _T("Outline"),
+ _T("Outline smooth"),
+ _T("Smooth bump"),
+ _T("Contour thin"),
+ _T("Contour heavy"),
};
#ifdef _EFFECTENUM_FULL_H
MODERNEFFECTMATRIX ModernEffectsEnum[]={
{ //Shadow at Left
{ 0, 0, 0, 0, 0,
- 0, 4, 16, 4, 4,
- 0, 16, 64, 32, 16,
- 0, 4, 32, 32, 16,
- 0, 4, 16, 16, 16 }, 2,2,2,2,1},
- { //Shadow at Right
- { 0, 0, 0, 0, 0,
+ 0, 4, 16, 4, 4,
+ 0, 16, 64, 32, 16,
+ 0, 4, 32, 32, 16,
+ 0, 4, 16, 16, 16 }, 2,2,2,2,1},
+ { //Shadow at Right
+ { 0, 0, 0, 0, 0,
4, 4, 16, 4, 0,
- 16, 32, 64, 16, 0,
+ 16, 32, 64, 16, 0,
16, 32, 32, 4, 0,
16, 16, 16, 4, 0 }, 2,2,2,2,1},
- { //Outline
- { 0, 0, 0, 0, 0,
- 0, 16, 16, 16, 0,
- 0, 16, 32, 16, 0,
- 0, 16, 16, 16, 0,
- 0, 0, 0, 0, 0 }, 1,1,1,1,1},
-
- { //Outline smooth
- { 4, 4, 4, 4, 4,
- 4, 8, 8, 8, 4,
- 4, 8, 32, 8, 4,
- 4, 8, 8, 8, 4,
- 4, 4, 4, 4, 4 }, 2,2,2,2,1},
-
- { //Smooth bump
- { -2, 2, 2, 2, 2,
- -2, -16, 16, 16, 2,
- -2, -16, 48, 16, 2,
- -2, -16,-16, 16, 2,
- -2, -2, -2, -2, -2 }, 2,2,2,2,1+0x80},
- { //Contour thin
- { 0, 0, 0, 0, 0,
- 0, 48, 64, 48, 0,
- 0, 64, 64, 64, 0,
- 0, 48, 64, 48, 0,
- 0, 0, 0, 0, 0 }, 1,1,1,1,1},
- { //Contour heavy
- { 8, 16, 16, 16, 8,
- 16, 64, 64, 64, 16,
- 16, 64, 64, 64, 16,
- 16, 64, 64, 64, 16,
- 8, 16, 16, 16, 8 }, 2,2,2,2,1},
+ { //Outline
+ { 0, 0, 0, 0, 0,
+ 0, 16, 16, 16, 0,
+ 0, 16, 32, 16, 0,
+ 0, 16, 16, 16, 0,
+ 0, 0, 0, 0, 0 }, 1,1,1,1,1},
+
+ { //Outline smooth
+ { 4, 4, 4, 4, 4,
+ 4, 8, 8, 8, 4,
+ 4, 8, 32, 8, 4,
+ 4, 8, 8, 8, 4,
+ 4, 4, 4, 4, 4 }, 2,2,2,2,1},
+
+ { //Smooth bump
+ { -2, 2, 2, 2, 2,
+ -2, -16, 16, 16, 2,
+ -2, -16, 48, 16, 2,
+ -2, -16,-16, 16, 2,
+ -2, -2, -2, -2, -2 }, 2,2,2,2,1+0x80},
+ { //Contour thin
+ { 0, 0, 0, 0, 0,
+ 0, 48, 64, 48, 0,
+ 0, 64, 64, 64, 0,
+ 0, 48, 64, 48, 0,
+ 0, 0, 0, 0, 0 }, 1,1,1,1,1},
+ { //Contour heavy
+ { 8, 16, 16, 16, 8,
+ 16, 64, 64, 64, 16,
+ 16, 64, 64, 64, 16,
+ 16, 64, 64, 64, 16,
+ 8, 16, 16, 16, 8 }, 2,2,2,2,1},
};
#endif
#ifdef _EFFECTENUM_FULL_H
- #define MAXPREDEFINEDEFFECTS sizeof(ModernEffectNames)/sizeof(ModernEffectNames[0])
+#define MAXPREDEFINEDEFFECTS sizeof(ModernEffectNames)/sizeof(ModernEffectNames[0])
#else
- #define MAXPREDEFINEDEFFECTS sizeof(_ModernEffectNames)/sizeof(_ModernEffectNames[0])
- extern TCHAR * ModernEffectNames[];
+#define MAXPREDEFINEDEFFECTS sizeof(_ModernEffectNames)/sizeof(_ModernEffectNames[0])
+extern TCHAR * ModernEffectNames[];
#endif
extern BOOL SkinEngine_ResetTextEffect(HDC);
extern BOOL SkinEngine_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor); \ No newline at end of file
diff --git a/plugins/Clist_modern/src/hdr/modern_gettextasync.h b/plugins/Clist_modern/src/hdr/modern_gettextasync.h
index 386b721b19..2a8c63296d 100644
--- a/plugins/Clist_modern/src/hdr/modern_gettextasync.h
+++ b/plugins/Clist_modern/src/hdr/modern_gettextasync.h
@@ -2,4 +2,4 @@
void InitCacheAsync();
void UninitCacheAsync();
void gtaRenewText(MCONTACT hContact);
-int gtaAddRequest(ClcData *dat,ClcContact *contact,MCONTACT hContact);
+int gtaAddRequest(ClcData *dat, MCONTACT hContact);
diff --git a/plugins/Clist_modern/src/hdr/modern_global_structure.h b/plugins/Clist_modern/src/hdr/modern_global_structure.h
index 6572e96290..fd23199eaa 100644
--- a/plugins/Clist_modern/src/hdr/modern_global_structure.h
+++ b/plugins/Clist_modern/src/hdr/modern_global_structure.h
@@ -5,79 +5,79 @@
typedef struct tagCLUIDATA
{
- /************************************
- ** Global variables **
- ************************************/
-
- /* NotifyArea menu */
- HMENU hMenuNotify;
- WORD wNextMenuID;
- int iIconNotify;
- BOOL bEventAreaEnabled;
- BOOL bNotifyActive;
- DWORD dwFlags;
- int hIconNotify;
+ /************************************
+ ** Global variables **
+ ************************************/
+
+ /* NotifyArea menu */
+ HMENU hMenuNotify;
+ WORD wNextMenuID;
+ int iIconNotify;
+ BOOL bEventAreaEnabled;
+ BOOL bNotifyActive;
+ DWORD dwFlags;
+ int hIconNotify;
MCONTACT hUpdateContact;
- /* Contact List View Mode */
- TCHAR groupFilter[2048];
- char protoFilter[2048];
- char varFilter[2048];
- DWORD lastMsgFilter;
- char current_viewmode[256], old_viewmode[256];
- BYTE boldHideOffline;
- BYTE bOldUseGroups;
- DWORD statusMaskFilter;
- DWORD stickyMaskFilter;
- DWORD filterFlags;
- DWORD bFilterEffective;
- DWORD t_now;
-
- // Modern Global Variables
- BOOL fDisableSkinEngine;
- BOOL fOnDesktop;
- BOOL fSmoothAnimation;
- BOOL fLayered;
- BOOL fDocked;
- BOOL fSortNoOfflineBottom;
- BOOL fAutoSize;
- BOOL fAeroGlass;
- HRGN hAeroGlassRgn;
-
- BOOL mutexPreventDockMoving;
- BOOL mutexOnEdgeSizing;
- BOOL mutexPaintLock;
-
- BYTE bCurrentAlpha;
- BYTE bSTATE;
- BYTE bBehindEdgeSettings;
- BYTE bSortByOrder[3];
-
- signed char nBehindEdgeState;
-
- DWORD dwKeyColor;
-
- HWND hwndEventFrame;
-
- int LeftClientMargin;
- int RightClientMargin;
- int TopClientMargin;
- int BottomClientMargin;
-
- BOOL bInternalAwayMsgDiscovery;
- BOOL bRemoveAwayMessageForOffline;
-
- //hEventHandles
-
- HANDLE hEventBkgrChanged;
- HANDLE hEventPreBuildTrayMenu;
- HANDLE hEventPreBuildGroupMenu;
- HANDLE hEventPreBuildSubGroupMenu;
- HANDLE hEventStatusBarShowToolTip;
- HANDLE hEventStatusBarHideToolTip;
- HANDLE hEventSkinServicesCreated;
-
- int nGapBetweenTitlebar;
+ /* Contact List View Mode */
+ TCHAR groupFilter[2048];
+ char protoFilter[2048];
+ char varFilter[2048];
+ DWORD lastMsgFilter;
+ char current_viewmode[256], old_viewmode[256];
+ BYTE boldHideOffline;
+ BYTE bOldUseGroups;
+ DWORD statusMaskFilter;
+ DWORD stickyMaskFilter;
+ DWORD filterFlags;
+ DWORD bFilterEffective;
+ DWORD t_now;
+
+ // Modern Global Variables
+ BOOL fDisableSkinEngine;
+ BOOL fOnDesktop;
+ BOOL fSmoothAnimation;
+ BOOL fLayered;
+ BOOL fDocked;
+ BOOL fSortNoOfflineBottom;
+ BOOL fAutoSize;
+ BOOL fAeroGlass;
+ HRGN hAeroGlassRgn;
+
+ BOOL mutexPreventDockMoving;
+ BOOL mutexOnEdgeSizing;
+ BOOL mutexPaintLock;
+
+ BYTE bCurrentAlpha;
+ BYTE bSTATE;
+ BYTE bBehindEdgeSettings;
+ BYTE bSortByOrder[3];
+
+ signed char nBehindEdgeState;
+
+ DWORD dwKeyColor;
+
+ HWND hwndEventFrame;
+
+ int LeftClientMargin;
+ int RightClientMargin;
+ int TopClientMargin;
+ int BottomClientMargin;
+
+ BOOL bInternalAwayMsgDiscovery;
+ BOOL bRemoveAwayMessageForOffline;
+
+ //hEventHandles
+
+ HANDLE hEventBkgrChanged;
+ HANDLE hEventPreBuildTrayMenu;
+ HANDLE hEventPreBuildGroupMenu;
+ HANDLE hEventPreBuildSubGroupMenu;
+ HANDLE hEventStatusBarShowToolTip;
+ HANDLE hEventStatusBarHideToolTip;
+ HANDLE hEventSkinServicesCreated;
+
+ int nGapBetweenTitlebar;
} CLUIDATA;
EXTERN_C CLUIDATA g_CluiData;
diff --git a/plugins/Clist_modern/src/hdr/modern_layered_window_engine.h b/plugins/Clist_modern/src/hdr/modern_layered_window_engine.h
index 5116828af5..0b9b3c685c 100644
--- a/plugins/Clist_modern/src/hdr/modern_layered_window_engine.h
+++ b/plugins/Clist_modern/src/hdr/modern_layered_window_engine.h
@@ -8,10 +8,10 @@ class CLayeredWindowEngine
private:
/*class CLweInfo
{
- HWND hWnd;
- HRGN hInvalidRgn;
+ HWND hWnd;
+ HRGN hInvalidRgn;
};
- */
+ */
//typedef std::map<HWND, CLweInfo> WndInfos;
enum { state_invalid, state_normal };
@@ -29,18 +29,18 @@ public:
void _init();
void _deinit();
- void lock() { EnterCriticalSection( &m_cs ); }
- void unlock() { LeaveCriticalSection( &m_cs ); }
+ void lock() { EnterCriticalSection(&m_cs); }
+ void unlock() { LeaveCriticalSection(&m_cs); }
int get_state();
public:
static void __cdecl LweValidatorProc();
-
+
void LweValidatorProcWorker();
void LweValidatorWorker();
- int LweInvalidateRect( HWND hWnd, const RECT *rect, BOOL bErase );
+ int LweInvalidateRect(HWND hWnd, const RECT *rect, BOOL bErase);
// int LweValidateWindowRect( HWND hWnd, RECT *rect );
// int RegisterWindow( HWND hwnd, tPaintCallbackProc pPaintCallBackProc );
diff --git a/plugins/Clist_modern/src/hdr/modern_row.h b/plugins/Clist_modern/src/hdr/modern_row.h
index 4148a692a5..ad84c94071 100644
--- a/plugins/Clist_modern/src/hdr/modern_row.h
+++ b/plugins/Clist_modern/src/hdr/modern_row.h
@@ -65,23 +65,23 @@ typedef struct tagRowCell
BOOL hasfixed; // Ïàðàìåòð ïîêàçûâàþùèé ÷òî åñòü âëîæåííûå ôèêñèðîâàííûå ýëåìåíòû
BOOL fitwidth; // Ïàðàìåòð óêàçûâàþùèé ÷òî ïîñëåäíèé ýëåìåíò çàïîëíÿåò âñå îñòàâøååñÿ
- // Ïðîñòðàíñòâî (ðàññòÿãèâàåò ðîäèòåëÿ.îâåðëåé)
+ // Ïðîñòðàíñòâî (ðàññòÿãèâàåò ðîäèòåëÿ.îâåðëåé)
- int fixed_width;
- int full_width;
+ int fixed_width;
+ int full_width;
- RECT r; // Ïðÿìîóãîëüíèê äëÿ ðèñîâàíèÿ ýëåìåíòà
- struct tagRowCell * next; // Ïîëå ñâÿçè
- struct tagRowCell * child; // Ïîëå ñâÿçè ñì. ôàéë îïèñàíèÿ
+ RECT r; // Ïðÿìîóãîëüíèê äëÿ ðèñîâàíèÿ ýëåìåíòà
+ struct tagRowCell * next; // Ïîëå ñâÿçè
+ struct tagRowCell * child; // Ïîëå ñâÿçè ñì. ôàéë îïèñàíèÿ
}
- ROWCELL, *pROWCELL;
+ROWCELL, *pROWCELL;
// Ñòðóêòóðà äëÿ äîñòóïà ê êîíòåéíåðàì ýëåìåíòà êîíòàêòà âíóòðè äåðåâà îïèâàíèÿ
#ifndef _CPPCODE
- int cppCalculateRowHeight(ROWCELL *RowRoot);
- void cppCalculateRowItemsPos(ROWCELL *RowRoot, int width);
- ROWCELL *cppInitModernRow(ROWCELL ** tabAccess);
- void cppDeleteTree(ROWCELL * RowRoot);
+int cppCalculateRowHeight(ROWCELL *RowRoot);
+void cppCalculateRowItemsPos(ROWCELL *RowRoot, int width);
+ROWCELL *cppInitModernRow(ROWCELL ** tabAccess);
+void cppDeleteTree(ROWCELL * RowRoot);
#endif
#endif // modern_row_h__ \ No newline at end of file
diff --git a/plugins/Clist_modern/src/hdr/modern_skinengine.h b/plugins/Clist_modern/src/hdr/modern_skinengine.h
index f920ba6072..581787b5a5 100644
--- a/plugins/Clist_modern/src/hdr/modern_skinengine.h
+++ b/plugins/Clist_modern/src/hdr/modern_skinengine.h
@@ -49,10 +49,10 @@ struct CURRWNDIMAGEDATA
HBITMAP hBackDIB, hBackOld;
BYTE * hImageDIBByte;
BYTE * hBackDIBByte;
- int Width,Height;
+ int Width, Height;
};
-struct EFFECTSSTACKITEM
+struct EFFECTSSTACKITEM
{
HDC hdc;
BYTE EffectID;
@@ -93,7 +93,7 @@ public:
enum { IT_UNKNOWN, IT_FILE, IT_RESOURCE };
- typedef HRESULT (*ParserCallback_t)( const char * szSection, const char * szKey, const char * szValue, IniParser * This );
+ typedef HRESULT(*ParserCallback_t)(const char * szSection, const char * szKey, const char * szValue, IniParser * This);
IniParser(TCHAR * szFileName, BYTE flags = FLAG_WITH_SETTINGS);
IniParser(HINSTANCE hInst, const char *resourceName, const char *resourceType, BYTE flags = FLAG_ONLY_OBJECTS);
@@ -102,12 +102,12 @@ public:
bool CheckOK() { return _isValid; }
HRESULT Parse(ParserCallback_t pLineCallBackProc, LPARAM lParam);
- static HRESULT WriteStrToDb( const char * szSection, const char * szKey, const char * szValue, IniParser * This);
- static int GetSkinFolder( IN const TCHAR * szFileName, OUT TCHAR * pszFolderName );
+ static HRESULT WriteStrToDb(const char * szSection, const char * szKey, const char * szValue, IniParser * This);
+ static int GetSkinFolder(IN const TCHAR * szFileName, OUT TCHAR * pszFolderName);
private:
// common
- enum { MAX_LINE_LEN = 512 };
+ enum { MAX_LINE_LEN = 512 };
int _eType;
bool _isValid;
char * _szSection;
@@ -116,16 +116,16 @@ private:
int _nLine;
void _DoInit();
- BOOL _DoParseLine( char * szLine );
+ BOOL _DoParseLine(char * szLine);
// Processing File
HRESULT _DoParseFile();
FILE * _hFile;
// Processing resource
- void _LoadResourceIni( HINSTANCE hInst, const char * resourceName, const char * resourceType );
+ void _LoadResourceIni(HINSTANCE hInst, const char * resourceName, const char * resourceType);
HRESULT _DoParseResource();
- const char * _RemoveTailings( const char * szLine, size_t& len );
+ const char * _RemoveTailings(const char * szLine, size_t& len);
HGLOBAL _hGlobalRes;
DWORD _dwSizeOfRes;
@@ -138,7 +138,7 @@ private:
int ske_UnloadSkin(SKINOBJECTSLIST * Skin);
-int ske_AddDescriptorToSkinObjectList (SKINOBJECTDESCRIPTOR *lpDescr, SKINOBJECTSLIST* Skin);
+int ske_AddDescriptorToSkinObjectList(SKINOBJECTDESCRIPTOR *lpDescr, SKINOBJECTSLIST* Skin);
INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam);
diff --git a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h
index 20d662aee7..6da6e33821 100644
--- a/plugins/Clist_modern/src/hdr/modern_skinned_profile.h
+++ b/plugins/Clist_modern/src/hdr/modern_skinned_profile.h
@@ -10,38 +10,38 @@
class MString
{
-private:
+private:
TCHAR * _buffer;
public:
- MString() : _buffer( NULL ) {};
- MString( const TCHAR * str ) { _buffer = str ? _tcsdup( str ) : NULL; }
- MString( const MString& str ) { _buffer = str._buffer ? _tcsdup( str._buffer ) : NULL; }
- MString& operator=( const MString& str )
+ MString() : _buffer(NULL) {};
+ MString(const TCHAR * str) { _buffer = str ? _tcsdup(str) : NULL; }
+ MString(const MString& str) { _buffer = str._buffer ? _tcsdup(str._buffer) : NULL; }
+ MString& operator=(const MString& str)
{
- if ( _buffer ) free( _buffer );
- _buffer = str._buffer ? _tcsdup( str._buffer ) : NULL;
+ if (_buffer) free(_buffer);
+ _buffer = str._buffer ? _tcsdup(str._buffer) : NULL;
}
- TCHAR* operator()( const MString& str ) { return _buffer; }
+ TCHAR* operator()(const MString& str) { return _buffer; }
~MString()
{
- if ( _buffer )
- free( _buffer );
+ if (_buffer)
+ free(_buffer);
_buffer = NULL;
}
#ifdef _UNICODE
- MString( const char * str)
- {
- if (!str )
+ MString(const char * str)
+ {
+ if (!str)
_buffer = NULL;
else
{
- int cbLen = MultiByteToWideChar( 0, 0, str, -1, NULL, 0 );
- wchar_t* _buffer = ( wchar_t* )malloc( sizeof( wchar_t )*(cbLen+1));
- if ( _buffer == NULL ) return;
- MultiByteToWideChar( 0, 0, str, -1, _buffer, cbLen );
- _buffer[ cbLen ] = 0;
- }
+ int cbLen = MultiByteToWideChar(0, 0, str, -1, NULL, 0);
+ wchar_t* _buffer = (wchar_t*)malloc(sizeof(wchar_t)*(cbLen + 1));
+ if (_buffer == NULL) return;
+ MultiByteToWideChar(0, 0, str, -1, _buffer, cbLen);
+ _buffer[cbLen] = 0;
+ }
}
#endif
@@ -51,40 +51,40 @@ class CAutoCriticalSection
{
public:
CAutoCriticalSection() //Init critical section here
- : _pLinkedCS( NULL )
+ : _pLinkedCS(NULL)
{
- InitializeCriticalSection( &_CS );
+ InitializeCriticalSection(&_CS);
_ifCSOwner = true;
- _ifLocked = false;
+ _ifLocked = false;
}
- CAutoCriticalSection( CAutoCriticalSection& Locker, bool doLock = true )
- : _pLinkedCS ( &Locker )
+ CAutoCriticalSection(CAutoCriticalSection& Locker, bool doLock = true)
+ : _pLinkedCS(&Locker)
{
_ifCSOwner = false;
- _ifLocked = false;
- if ( doLock )
+ _ifLocked = false;
+ if (doLock)
Lock();
}
~CAutoCriticalSection() // Leave if auto locker, and destroy if not
{
- if ( _ifLocked )
+ if (_ifLocked)
Unlock();
- if ( _ifCSOwner )
- DeleteCriticalSection( &_CS );
+ if (_ifCSOwner)
+ DeleteCriticalSection(&_CS);
}
void Lock() // Enter Section
{
- if ( _ifLocked ) return;
- if ( _ifCSOwner ) EnterCriticalSection( &_CS );
+ if (_ifLocked) return;
+ if (_ifCSOwner) EnterCriticalSection(&_CS);
else _pLinkedCS->Lock();
_ifLocked = true;
return;
- }
+ }
void Unlock() // Leave Section
{
- if (!_ifLocked ) return;
- if ( _ifCSOwner ) LeaveCriticalSection( &_CS );
+ if (!_ifLocked) return;
+ if (_ifCSOwner) LeaveCriticalSection(&_CS);
else _pLinkedCS->Unlock();
_ifLocked = false;
}
@@ -99,26 +99,26 @@ private:
class ValueVariant
{
public:
- ValueVariant() : _type( VVT_EMPTY ) {};
- ValueVariant( BYTE bValue ) : _type( VVT_BYTE ), _bValue( bValue ) {};
- ValueVariant( WORD wValue ) : _type( VVT_WORD ), _wValue( wValue ) {};
- ValueVariant( DWORD dwValue ) : _type( VVT_DWORD ), _dwValue( dwValue ) {};
- ValueVariant( const MString& strValue ) : _type( VVT_STRING ), _strValue( strValue ) {};
- ValueVariant( const char * szValue ) : _type( VVT_STRING ), _strValue( szValue ) {};
+ ValueVariant() : _type(VVT_EMPTY) {};
+ ValueVariant(BYTE bValue) : _type(VVT_BYTE), _bValue(bValue) {};
+ ValueVariant(WORD wValue) : _type(VVT_WORD), _wValue(wValue) {};
+ ValueVariant(DWORD dwValue) : _type(VVT_DWORD), _dwValue(dwValue) {};
+ ValueVariant(const MString& strValue) : _type(VVT_STRING), _strValue(strValue) {};
+ ValueVariant(const char * szValue) : _type(VVT_STRING), _strValue(szValue) {};
#ifdef _UNICODE
- ValueVariant( const wchar_t * szValue ) : _type( VVT_STRING ), _strValue( szValue ) {};
+ ValueVariant(const wchar_t * szValue) : _type(VVT_STRING), _strValue(szValue) {};
#endif
-
+
BYTE GetByte()
{
- switch ( _type )
+ switch (_type)
{
case VVT_BYTE:
- return ( BYTE ) _bValue;
+ return (BYTE)_bValue;
case VVT_WORD:
case VVT_DWORD:
DebugBreak();
- return ( BYTE ) _bValue;
+ return (BYTE)_bValue;
default:
DebugBreak();
}
@@ -127,15 +127,15 @@ public:
WORD GetWord()
{
- switch ( _type )
- {
+ switch (_type)
+ {
case VVT_WORD:
- return ( WORD ) _wValue;
+ return (WORD)_wValue;
case VVT_BYTE:
case VVT_DWORD:
DebugBreak();
- return ( WORD ) _wValue;
+ return (WORD)_wValue;
default:
DebugBreak();
}
@@ -144,15 +144,15 @@ public:
DWORD GetDword()
{
- switch ( _type )
- {
+ switch (_type)
+ {
case VVT_DWORD:
- return ( DWORD ) _dwValue;
+ return (DWORD)_dwValue;
case VVT_BYTE:
case VVT_WORD:
DebugBreak();
- return ( DWORD ) _dwValue;
+ return (DWORD)_dwValue;
default:
DebugBreak();
}
@@ -160,8 +160,8 @@ public:
}
MString GetString()
{
- switch ( _type )
- {
+ switch (_type)
+ {
case VVT_STRING:
return _strValue;
@@ -172,8 +172,8 @@ public:
}
const MString& GetStringStatic()
{
- switch ( _type )
- {
+ switch (_type)
+ {
case VVT_STRING:
return _strValue;
@@ -182,10 +182,10 @@ public:
}
return _strValue;
}
- bool IsEmpty() { return _type==VVT_EMPTY; }
+ bool IsEmpty() { return _type == VVT_EMPTY; }
private:
- enum
+ enum
{
VVT_EMPTY = 0,
VVT_BYTE,
@@ -223,7 +223,7 @@ private:
KeyList_t SkinnedProfile;
- ValueVariant* _GetValue( const char * szSection, const char * szKey );
+ ValueVariant* _GetValue(const char * szSection, const char * szKey);
CAutoCriticalSection _Lock; // critical section to matable skinned profile access
@@ -233,10 +233,10 @@ public:
HRESULT Init();
HRESULT Clear();
- static BYTE SpiGetSkinByte (MCONTACT hContact, const char * szSection, const char * szKey, const BYTE defValue );
- static WORD SpiGetSkinWord (MCONTACT hContact, const char * szSection, const char * szKey, const WORD defValue );
- static DWORD SpiGetSkinDword(MCONTACT hContact, const char * szSection, const char * szKey, const DWORD defValue );
- static BOOL SpiCheckSkinned(MCONTACT hContact, const char * szSection, const char * szKey );
+ static BYTE SpiGetSkinByte(MCONTACT hContact, const char * szSection, const char * szKey, const BYTE defValue);
+ static WORD SpiGetSkinWord(MCONTACT hContact, const char * szSection, const char * szKey, const WORD defValue);
+ static DWORD SpiGetSkinDword(MCONTACT hContact, const char * szSection, const char * szKey, const DWORD defValue);
+ static BOOL SpiCheckSkinned(MCONTACT hContact, const char * szSection, const char * szKey);
};
diff --git a/plugins/Clist_modern/src/hdr/modern_skinselector.h b/plugins/Clist_modern/src/hdr/modern_skinselector.h
index 09576c054d..48c6ecdfde 100644
--- a/plugins/Clist_modern/src/hdr/modern_skinselector.h
+++ b/plugins/Clist_modern/src/hdr/modern_skinselector.h
@@ -66,22 +66,22 @@ struct LISTMODERNMASK
/// PROTOTYPES
int AddModernMaskToList(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList);
-int AddStrModernMaskToList(DWORD maskID, char *szStr, char *objectName, LISTMODERNMASK *mmTemplateList, void *pObjectList);
+int AddStrModernMaskToList(DWORD maskID, char *szStr, char *objectName, LISTMODERNMASK *mmTemplateList);
int SortMaskList(LISTMODERNMASK *mmList);
-int DeleteMaskByItID(DWORD mID,LISTMODERNMASK *mmTemplateList);
+int DeleteMaskByItID(DWORD mID, LISTMODERNMASK *mmTemplateList);
int ClearMaskList(LISTMODERNMASK *mmTemplateList);
int ExchangeMasksByID(DWORD mID1, DWORD mID2, LISTMODERNMASK *mmTemplateList);
int ParseToModernMask(MODERNMASK *mm, char *szText);
-BOOL CompareModernMask(MODERNMASK *mmValue,MODERNMASK *mmTemplate);
-BOOL CompareStrWithModernMask(char * szValue,MODERNMASK *mmTemplate);
-MODERNMASK * FindMaskByStr(char * szValue,LISTMODERNMASK * mmTemplateList);
+BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate);
+BOOL CompareStrWithModernMask(char * szValue, MODERNMASK *mmTemplate);
+MODERNMASK * FindMaskByStr(char * szValue, LISTMODERNMASK * mmTemplateList);
DWORD mod_CalcHash(const char * a);
char * ModernMaskToString(MODERNMASK *mm, char *buf, UINT bufsize);
int RegisterObjectByParce(char * ObjectName, char *Params);
-SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue,LISTMODERNMASK *mmTemplateList);
-SKINOBJECTDESCRIPTOR* skin_FindObjectByMask (MODERNMASK *mm,LISTMODERNMASK *mmTemplateList);
+SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mmTemplateList);
+SKINOBJECTDESCRIPTOR* skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK *mmTemplateList);
TCHAR * GetParamNT(char * string, TCHAR * buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces);
int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMask);
#endif
diff --git a/plugins/Clist_modern/src/hdr/modern_static_clui.h b/plugins/Clist_modern/src/hdr/modern_static_clui.h
index 552337cb65..7d19d6dd92 100644
--- a/plugins/Clist_modern/src/hdr/modern_static_clui.h
+++ b/plugins/Clist_modern/src/hdr/modern_static_clui.h
@@ -67,7 +67,7 @@ int CListSettings_SetToCache(ClcCacheEntry *pSrc, DWORD flag);
int CLUIServices_LoadModule(void);
INT_PTR CLUIServices_SortList(WPARAM wParam, LPARAM lParam);
-void Docking_GetMonitorRectFromWindow(HWND hWnd,RECT *rc);
+void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc);
int EventArea_Create(HWND hCluiWnd);
@@ -76,7 +76,7 @@ int ExtraImage_ExtraIDToColumnNum(int extra);
void GroupMenus_Init();
int ModernSkinButtonLoadModule();
-int ModernSkinButton_ReposButtons(HWND parent, BYTE draw,RECT *r);
+int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r);
void ske_ApplyTranslucency();
HBITMAP ske_CreateDIB32(int cx, int cy);
@@ -100,7 +100,7 @@ int CLUI_SizingOnBorder(POINT pt, int size);
int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam);
int CLUI_TestCursorOnBorders();
-static int CLUI_SmoothAlphaThreadTransition(HWND hwnd);
+static int CLUI_SmoothAlphaThreadTransition();
/* structs */
diff --git a/plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h b/plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h
index fdcbe3192b..7a4ce4007a 100644
--- a/plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h
+++ b/plugins/Clist_modern/src/hdr/modern_static_cluiframes_service.h
@@ -27,8 +27,8 @@ static int _us_DoAlignFrameClient(WPARAM wParam, LPARAM lParam);
static int _us_DoAlignFrameBottom(WPARAM wParam, LPARAM lParam);
static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam);
-enum {
- CFM_FIRST_MGS= WM_USER + 0x2FF,
+enum {
+ CFM_FIRST_MGS = WM_USER + 0x2FF,
CFM_SETFRAMEPAINTPROC,
CFM_ADDFRAME,
@@ -58,34 +58,34 @@ enum {
#define CLM_PROCESS( msg, proc ) case msg: result = proc( wParam, lParam); break;
-BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT& result )
+BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT& result)
{
- if ( msg <= CFM_FIRST_MGS || msg >= CFM_LAST_MSG )
+ if (msg <= CFM_FIRST_MGS || msg >= CFM_LAST_MSG)
return FALSE;
- switch ( msg ) {
- CLM_PROCESS( CFM_SETFRAMEPAINTPROC, _us_DoSetFramePaintProc );
- CLM_PROCESS( CFM_ADDFRAME, _us_DoAddFrame );
- CLM_PROCESS( CFM_REMOVEFRAME, _us_DoRemoveFrame );
- CLM_PROCESS( CFM_SETFRAMEOPTIONS, _us_DoSetFrameOptions );
- CLM_PROCESS( CFM_GETFRAMEOPTIONS, _us_DoGetFrameOptions );
- CLM_PROCESS( CFM_UPDATEFRAME, _us_DoUpdateFrame );
- CLM_PROCESS( CFM_SHOWHIDEFRAMETITLE, _us_DoShowHideFrameTitle );
- CLM_PROCESS( CFM_SHOWTITLES, _us_DoShowTitles );
- CLM_PROCESS( CFM_HIDETITLES, _us_DoHideTitles );
- CLM_PROCESS( CFM_SHOWHIDEFRAME, _us_DoShowHideFrame );
- CLM_PROCESS( CFM_SHOWALL, _us_DoShowAllFrames );
- CLM_PROCESS( CFM_LOCKFRAME, _us_DoLockFrame );
- CLM_PROCESS( CFM_COLLAPSEFRAME, _us_DoCollapseFrame );
- CLM_PROCESS( CFM_SETFRAMEBORDER, _us_DoSetFrameBorder );
- CLM_PROCESS( CFM_SETFRAMEALIGN, _us_DoSetFrameAlign );
- CLM_PROCESS( CFM_MOVEFRAME, _us_DoMoveFrame );
- CLM_PROCESS( CFM_MOVEFRAMEUP, _us_DoMoveFrameUp );
- CLM_PROCESS( CFM_MOVEFRAMEDOWN, _us_DoMoveFrameDown );
- CLM_PROCESS( CFM_ALIGNFRAMETOP, _us_DoAlignFrameTop );
- CLM_PROCESS( CFM_ALIGNFRAMEBOTTOM, _us_DoAlignFrameClient );
- CLM_PROCESS( CFM_ALIGNFRAMECLIENT, _us_DoAlignFrameBottom );
- CLM_PROCESS( CFM_SETFRAMEFLOAT, _us_DoSetFrameFloat );
+ switch (msg) {
+ CLM_PROCESS(CFM_SETFRAMEPAINTPROC, _us_DoSetFramePaintProc);
+ CLM_PROCESS(CFM_ADDFRAME, _us_DoAddFrame);
+ CLM_PROCESS(CFM_REMOVEFRAME, _us_DoRemoveFrame);
+ CLM_PROCESS(CFM_SETFRAMEOPTIONS, _us_DoSetFrameOptions);
+ CLM_PROCESS(CFM_GETFRAMEOPTIONS, _us_DoGetFrameOptions);
+ CLM_PROCESS(CFM_UPDATEFRAME, _us_DoUpdateFrame);
+ CLM_PROCESS(CFM_SHOWHIDEFRAMETITLE, _us_DoShowHideFrameTitle);
+ CLM_PROCESS(CFM_SHOWTITLES, _us_DoShowTitles);
+ CLM_PROCESS(CFM_HIDETITLES, _us_DoHideTitles);
+ CLM_PROCESS(CFM_SHOWHIDEFRAME, _us_DoShowHideFrame);
+ CLM_PROCESS(CFM_SHOWALL, _us_DoShowAllFrames);
+ CLM_PROCESS(CFM_LOCKFRAME, _us_DoLockFrame);
+ CLM_PROCESS(CFM_COLLAPSEFRAME, _us_DoCollapseFrame);
+ CLM_PROCESS(CFM_SETFRAMEBORDER, _us_DoSetFrameBorder);
+ CLM_PROCESS(CFM_SETFRAMEALIGN, _us_DoSetFrameAlign);
+ CLM_PROCESS(CFM_MOVEFRAME, _us_DoMoveFrame);
+ CLM_PROCESS(CFM_MOVEFRAMEUP, _us_DoMoveFrameUp);
+ CLM_PROCESS(CFM_MOVEFRAMEDOWN, _us_DoMoveFrameDown);
+ CLM_PROCESS(CFM_ALIGNFRAMETOP, _us_DoAlignFrameTop);
+ CLM_PROCESS(CFM_ALIGNFRAMEBOTTOM, _us_DoAlignFrameClient);
+ CLM_PROCESS(CFM_ALIGNFRAMECLIENT, _us_DoAlignFrameBottom);
+ CLM_PROCESS(CFM_SETFRAMEFLOAT, _us_DoSetFrameFloat);
default:
return FALSE; // Not Handled
}
@@ -93,99 +93,143 @@ BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LP
}
static INT_PTR CLUIFrames_SetFramePaintProc(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SETFRAMEPAINTPROC, wParam,lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEPAINTPROC, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_AddFrame(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_ADDFRAME, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_ADDFRAME, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_RemoveFrame(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_REMOVEFRAME, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_REMOVEFRAME, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_SetFrameOptions(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SETFRAMEOPTIONS, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEOPTIONS, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_GetFrameOptions(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_GETFRAMEOPTIONS, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_GETFRAMEOPTIONS, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_UpdateFrame(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_UPDATEFRAME, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_UPDATEFRAME, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_ShowHideFrameTitle(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SHOWHIDEFRAMETITLE, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SHOWHIDEFRAMETITLE, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_ShowTitles(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SHOWTITLES, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SHOWTITLES, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_HideTitles(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_HIDETITLES, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_HIDETITLES, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_ShowHideFrame(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SHOWHIDEFRAME, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SHOWHIDEFRAME, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_ShowAllFrames(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SHOWALL, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SHOWALL, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_LockFrame(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_LOCKFRAME, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_LOCKFRAME, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_CollapseFrame(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_COLLAPSEFRAME, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_COLLAPSEFRAME, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_SetFrameBorder(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SETFRAMEBORDER, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEBORDER, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_SetFrameAlign(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SETFRAMEALIGN, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEALIGN, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_MoveFrame(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_MOVEFRAME, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_MOVEFRAME, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_MoveFrameUp(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_MOVEFRAMEUP, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_MOVEFRAMEUP, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_MoveFrameDown(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_MOVEFRAMEDOWN, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_MOVEFRAMEDOWN, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_AlignFrameTop(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_ALIGNFRAMETOP, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_ALIGNFRAMETOP, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_AlignFrameClient(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_ALIGNFRAMEBOTTOM, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_ALIGNFRAMEBOTTOM, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_AlignFrameBottom(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_ALIGNFRAMECLIENT, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_ALIGNFRAMECLIENT, wParam, lParam) : 0;
+}
static INT_PTR CLUIFrames_SetFrameFloat(WPARAM wParam, LPARAM lParam)
-{ return ( pcli->hwndContactList ) ? SendMessage( pcli->hwndContactList, CFM_SETFRAMEFLOAT, wParam, lParam) : 0; }
+{
+ return (pcli->hwndContactList) ? SendMessage(pcli->hwndContactList, CFM_SETFRAMEFLOAT, wParam, lParam) : 0;
+}
static void CreateCluiFramesServices()
{
- CreateServiceFunction( MS_SKINENG_REGISTERPAINTSUB, CLUIFrames_SetFramePaintProc );
- CreateServiceFunction( MS_CLIST_FRAMES_ADDFRAME, CLUIFrames_AddFrame );
- CreateServiceFunction( MS_CLIST_FRAMES_REMOVEFRAME, CLUIFrames_RemoveFrame );
-
- CreateServiceFunction( MS_CLIST_FRAMES_SETFRAMEOPTIONS, CLUIFrames_SetFrameOptions );
- CreateServiceFunction( MS_CLIST_FRAMES_GETFRAMEOPTIONS, CLUIFrames_GetFrameOptions );
- CreateServiceFunction( MS_CLIST_FRAMES_UPDATEFRAME, CLUIFrames_UpdateFrame );
-
- CreateServiceFunction( MS_CLIST_FRAMES_SHFRAMETITLEBAR, CLUIFrames_ShowHideFrameTitle );
- CreateServiceFunction( MS_CLIST_FRAMES_SHOWALLFRAMESTB, CLUIFrames_ShowTitles );
- CreateServiceFunction( MS_CLIST_FRAMES_HIDEALLFRAMESTB, CLUIFrames_HideTitles );
- CreateServiceFunction( MS_CLIST_FRAMES_SHFRAME, CLUIFrames_ShowHideFrame );
- CreateServiceFunction( MS_CLIST_FRAMES_SHOWALLFRAMES, CLUIFrames_ShowAllFrames );
-
- CreateServiceFunction( MS_CLIST_FRAMES_ULFRAME, CLUIFrames_LockFrame );
- CreateServiceFunction( MS_CLIST_FRAMES_UCOLLFRAME, CLUIFrames_CollapseFrame );
- CreateServiceFunction( MS_CLIST_FRAMES_SETUNBORDER, CLUIFrames_SetFrameBorder );
-
- CreateServiceFunction( CLUIFRAMESSETALIGN, CLUIFrames_SetFrameAlign );
- CreateServiceFunction( CLUIFRAMESMOVEUPDOWN, CLUIFrames_MoveFrame );
- CreateServiceFunction( CLUIFRAMESMOVEUP, CLUIFrames_MoveFrameUp );
- CreateServiceFunction( CLUIFRAMESMOVEDOWN, CLUIFrames_MoveFrameDown );
-
- CreateServiceFunction( CLUIFRAMESSETALIGNALTOP, CLUIFrames_AlignFrameTop );
- CreateServiceFunction( CLUIFRAMESSETALIGNALCLIENT, CLUIFrames_AlignFrameClient );
- CreateServiceFunction( CLUIFRAMESSETALIGNALBOTTOM, CLUIFrames_AlignFrameBottom );
-
- CreateServiceFunction( CLUIFRAMESSETFLOATING, CLUIFrames_SetFrameFloat );
+ CreateServiceFunction(MS_SKINENG_REGISTERPAINTSUB, CLUIFrames_SetFramePaintProc);
+ CreateServiceFunction(MS_CLIST_FRAMES_ADDFRAME, CLUIFrames_AddFrame);
+ CreateServiceFunction(MS_CLIST_FRAMES_REMOVEFRAME, CLUIFrames_RemoveFrame);
+
+ CreateServiceFunction(MS_CLIST_FRAMES_SETFRAMEOPTIONS, CLUIFrames_SetFrameOptions);
+ CreateServiceFunction(MS_CLIST_FRAMES_GETFRAMEOPTIONS, CLUIFrames_GetFrameOptions);
+ CreateServiceFunction(MS_CLIST_FRAMES_UPDATEFRAME, CLUIFrames_UpdateFrame);
+
+ CreateServiceFunction(MS_CLIST_FRAMES_SHFRAMETITLEBAR, CLUIFrames_ShowHideFrameTitle);
+ CreateServiceFunction(MS_CLIST_FRAMES_SHOWALLFRAMESTB, CLUIFrames_ShowTitles);
+ CreateServiceFunction(MS_CLIST_FRAMES_HIDEALLFRAMESTB, CLUIFrames_HideTitles);
+ CreateServiceFunction(MS_CLIST_FRAMES_SHFRAME, CLUIFrames_ShowHideFrame);
+ CreateServiceFunction(MS_CLIST_FRAMES_SHOWALLFRAMES, CLUIFrames_ShowAllFrames);
+
+ CreateServiceFunction(MS_CLIST_FRAMES_ULFRAME, CLUIFrames_LockFrame);
+ CreateServiceFunction(MS_CLIST_FRAMES_UCOLLFRAME, CLUIFrames_CollapseFrame);
+ CreateServiceFunction(MS_CLIST_FRAMES_SETUNBORDER, CLUIFrames_SetFrameBorder);
+
+ CreateServiceFunction(CLUIFRAMESSETALIGN, CLUIFrames_SetFrameAlign);
+ CreateServiceFunction(CLUIFRAMESMOVEUPDOWN, CLUIFrames_MoveFrame);
+ CreateServiceFunction(CLUIFRAMESMOVEUP, CLUIFrames_MoveFrameUp);
+ CreateServiceFunction(CLUIFRAMESMOVEDOWN, CLUIFrames_MoveFrameDown);
+
+ CreateServiceFunction(CLUIFRAMESSETALIGNALTOP, CLUIFrames_AlignFrameTop);
+ CreateServiceFunction(CLUIFRAMESSETALIGNALCLIENT, CLUIFrames_AlignFrameClient);
+ CreateServiceFunction(CLUIFRAMESSETALIGNALBOTTOM, CLUIFrames_AlignFrameBottom);
+
+ CreateServiceFunction(CLUIFRAMESSETFLOATING, CLUIFrames_SetFrameFloat);
}
diff --git a/plugins/Clist_modern/src/hdr/modern_statusbar.h b/plugins/Clist_modern/src/hdr/modern_statusbar.h
index 9291f2d2c3..2339ed2c51 100644
--- a/plugins/Clist_modern/src/hdr/modern_statusbar.h
+++ b/plugins/Clist_modern/src/hdr/modern_statusbar.h
@@ -9,35 +9,35 @@
int ModernDrawStatusBar(HWND hwnd, HDC hDC);
int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC);
-typedef struct tagSTATUSBARDATA
+typedef struct tagSTATUSBARDATA
{
- BOOL sameWidth;
- RECT rectBorders;
- BYTE extraspace;
- BYTE Align;
- BYTE VAlign;
- bool bShowProtoIcon;
- bool bShowProtoName;
- bool bShowStatusName;
- bool bConnectingIcon;
- HFONT BarFont;
- DWORD fontColor;
- BYTE TextEffectID;
- DWORD TextEffectColor1;
- DWORD TextEffectColor2;
- BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
- BYTE nProtosPerLine;
- bool bShowProtoEmails;
-
- HBITMAP hBmpBackground;
- COLORREF bkColour;
- DWORD backgroundBmpUse;
- BOOL bkUseWinColors;
-
- XPTHANDLE hTheme;
-
- BOOL perProtoConfig;
- BYTE SBarRightClk;
+ BOOL sameWidth;
+ RECT rectBorders;
+ BYTE extraspace;
+ BYTE Align;
+ BYTE VAlign;
+ bool bShowProtoIcon;
+ bool bShowProtoName;
+ bool bShowStatusName;
+ bool bConnectingIcon;
+ HFONT BarFont;
+ DWORD fontColor;
+ BYTE TextEffectID;
+ DWORD TextEffectColor1;
+ DWORD TextEffectColor2;
+ BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
+ BYTE nProtosPerLine;
+ bool bShowProtoEmails;
+
+ HBITMAP hBmpBackground;
+ COLORREF bkColour;
+ DWORD backgroundBmpUse;
+ BOOL bkUseWinColors;
+
+ XPTHANDLE hTheme;
+
+ BOOL perProtoConfig;
+ BYTE SBarRightClk;
} STATUSBARDATA;
diff --git a/plugins/Clist_modern/src/hdr/modern_sync.h b/plugins/Clist_modern/src/hdr/modern_sync.h
index afa11a1002..0b5a827f11 100644
--- a/plugins/Clist_modern/src/hdr/modern_sync.h
+++ b/plugins/Clist_modern/src/hdr/modern_sync.h
@@ -1,38 +1,38 @@
#ifndef modern_sync_h__
#define modern_sync_h__
-typedef INT_PTR (*PSYNCCALLBACKPROC)(WPARAM,LPARAM);
+typedef INT_PTR(*PSYNCCALLBACKPROC)(WPARAM, LPARAM);
-int SyncCall(void * vproc, int count, ... );
+int SyncCall(void * vproc, int count, ...);
// Experimental sync caller
-int DoCall( PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lParam);
+int DoCall(PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lParam);
// Have to be here due to MS Visual C++ does not support 'export' keyword
// 3 params
template<class RET, class A, class B, class C> class PARAMS3
-{
+{
typedef RET(*proc_t)(A, B, C);
- proc_t _proc; A _a; B _b; C _c; RET _ret;
+ proc_t _proc; A _a; B _b; C _c; RET _ret;
public:
- PARAMS3( proc_t __proc, A __a, B __b, C __c ): _proc( __proc), _a (__a), _b(__b), _c(__c){};
- static int DoSyncCall(WPARAM wParam, LPARAM lParam)
+ PARAMS3(proc_t __proc, A __a, B __b, C __c) : _proc(__proc), _a(__a), _b(__b), _c(__c){};
+ static int DoSyncCall(WPARAM, LPARAM lParam)
{
- PARAMS3 * params = (PARAMS3 *) lParam;
- params->_ret = params->_proc( params->_a, params->_b, params->_c );
+ PARAMS3 * params = (PARAMS3 *)lParam;
+ params->_ret = params->_proc(params->_a, params->_b, params->_c);
return 0;
};
RET GetResult() { return _ret; }
};
-template< class RET, class Ap, class Bp, class Cp, class A, class B, class C> RET Sync( RET(*proc)(Ap, Bp, Cp), A a, B b, C c )
+template< class RET, class Ap, class Bp, class Cp, class A, class B, class C> RET Sync(RET(*proc)(Ap, Bp, Cp), A a, B b, C c)
{
- PARAMS3<RET, Ap, Bp, Cp> params( proc, a, b, c );
- DoCall((PSYNCCALLBACKPROC) PARAMS3<RET, Ap, Bp, Cp>::DoSyncCall, 0, (LPARAM) &params );
+ PARAMS3<RET, Ap, Bp, Cp> params(proc, a, b, c);
+ DoCall((PSYNCCALLBACKPROC)PARAMS3<RET, Ap, Bp, Cp>::DoSyncCall, 0, (LPARAM)&params);
return params.GetResult();
};
@@ -40,50 +40,50 @@ template< class RET, class Ap, class Bp, class Cp, class A, class B, class C> RE
// 2 params
template<class RET, class A, class B> class PARAMS2
-{
+{
typedef RET(*proc_t)(A, B);
- proc_t _proc; A _a; B _b; RET _ret;
+ proc_t _proc; A _a; B _b; RET _ret;
public:
- PARAMS2( proc_t __proc, A __a, B __b ): _proc( __proc), _a (__a), _b(__b){};
- static int DoSyncCall(WPARAM wParam, LPARAM lParam)
+ PARAMS2(proc_t __proc, A __a, B __b) : _proc(__proc), _a(__a), _b(__b){};
+ static int DoSyncCall(WPARAM, LPARAM lParam)
{
- PARAMS2 * params = (PARAMS2 *) lParam;
- params->_ret = params->_proc( params->_a, params->_b );
+ PARAMS2 * params = (PARAMS2 *)lParam;
+ params->_ret = params->_proc(params->_a, params->_b);
return 0;
};
RET GetResult() { return _ret; }
};
-template< class RET, class Ap, class Bp, class A, class B> RET Sync( RET(*proc)(Ap, Bp), A a, B b )
+template< class RET, class Ap, class Bp, class A, class B> RET Sync(RET(*proc)(Ap, Bp), A a, B b)
{
- PARAMS2<RET, Ap, Bp> params( proc, a, b );
- DoCall((PSYNCCALLBACKPROC) PARAMS2<RET, Ap, Bp>::DoSyncCall, 0, (LPARAM) &params );
+ PARAMS2<RET, Ap, Bp> params(proc, a, b);
+ DoCall((PSYNCCALLBACKPROC)PARAMS2<RET, Ap, Bp>::DoSyncCall, 0, (LPARAM)&params);
return params.GetResult();
};
// 1 param
template<class RET, class A> class PARAMS1
-{
+{
typedef RET(*proc_t)(A);
- proc_t _proc; A _a; RET _ret;
+ proc_t _proc; A _a; RET _ret;
public:
- PARAMS1( proc_t __proc, A __a): _proc( __proc), _a (__a){};
+ PARAMS1(proc_t __proc, A __a) : _proc(__proc), _a(__a){};
static int DoSyncCall(WPARAM, LPARAM lParam)
{
- PARAMS1 * params = (PARAMS1 *) lParam;
- params->_ret = params->_proc( params->_a );
+ PARAMS1 * params = (PARAMS1 *)lParam;
+ params->_ret = params->_proc(params->_a);
return 0;
};
RET GetResult() { return _ret; }
};
-template< class RET, class Ap, class A> RET Sync( RET(*proc)(Ap), A a )
+template< class RET, class Ap, class A> RET Sync(RET(*proc)(Ap), A a)
{
- PARAMS1<RET, Ap> params( proc, a );
- DoCall((PSYNCCALLBACKPROC) PARAMS1<RET, Ap>::DoSyncCall, 0, (LPARAM) &params );
+ PARAMS1<RET, Ap> params(proc, a);
+ DoCall((PSYNCCALLBACKPROC)PARAMS1<RET, Ap>::DoSyncCall, 0, (LPARAM)&params);
return params.GetResult();
};
diff --git a/plugins/Clist_modern/src/hdr/modern_tstring.h b/plugins/Clist_modern/src/hdr/modern_tstring.h
index 00948179d8..36d7e30ad3 100644
--- a/plugins/Clist_modern/src/hdr/modern_tstring.h
+++ b/plugins/Clist_modern/src/hdr/modern_tstring.h
@@ -11,20 +11,20 @@ class mbstring : public astring
{
// It is prohibited to initialize by char* outside, use L"xxx"
private:
- mbstring( const char * pChar ) : astring( pChar ) {};
- mbstring& operator=( const char * pChar ) { this->operator =( pChar ); return *this; }
+ mbstring(const char * pChar) : astring(pChar) {};
+ mbstring& operator=(const char * pChar) { this->operator =(pChar); return *this; }
public:
- mbstring() : astring() {};
- mbstring( const mbstring& uStr ) : astring( uStr ) {};
+ mbstring() : astring() {};
+ mbstring(const mbstring& uStr) : astring(uStr) {};
-
- mbstring( const wstring& tStr ) { *this = tStr.c_str(); }
- mbstring& operator=( const wstring& tStr ) { this->operator =( tStr.c_str()); return *this; }
- mbstring( const wchar_t * wChar );
- mbstring& operator=( const astring& aStr );
- mbstring& operator=( const wchar_t * wChar );
+ mbstring(const wstring& tStr) { *this = tStr.c_str(); }
+ mbstring& operator=(const wstring& tStr) { this->operator =(tStr.c_str()); return *this; }
+
+ mbstring(const wchar_t * wChar);
+ mbstring& operator=(const astring& aStr);
+ mbstring& operator=(const wchar_t * wChar);
operator wstring();
operator astring();
};
@@ -33,18 +33,18 @@ public:
class tstring : public wstring
{
public:
- tstring() : wstring() {};
- tstring(const wchar_t * pwChar) : wstring( pwChar ) {};
-
-
- tstring(const astring& aStr) { *this = aStr.c_str(); }
- tstring(const mbstring& utfStr) { *this = utfStr; }
+ tstring() : wstring() {};
+ tstring(const wchar_t * pwChar) : wstring(pwChar) {};
+
+
+ tstring(const astring& aStr) { *this = aStr.c_str(); }
+ tstring(const mbstring& utfStr) { *this = utfStr; }
tstring(const char * pChar);
- tstring& operator=( const char * pChar );
- tstring& operator=( const astring& aStr );
- tstring& operator=( const mbstring& uStr );
+ tstring& operator=(const char * pChar);
+ tstring& operator=(const astring& aStr);
+ tstring& operator=(const mbstring& uStr);
operator astring();
- operator mbstring() { return mbstring( this->c_str()); }
+ operator mbstring() { return mbstring(this->c_str()); }
};
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp
index 45f7a81d1c..78b44d12b1 100644
--- a/plugins/Clist_modern/src/init.cpp
+++ b/plugins/Clist_modern/src/init.cpp
@@ -36,8 +36,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
HINSTANCE g_hInst = 0;
CLIST_INTERFACE *pcli = NULL;
-CLIST_INTERFACE corecli = {0};
-CLUIDATA g_CluiData = {0};
+CLIST_INTERFACE corecli = { 0 };
+CLUIDATA g_CluiData = { 0 };
int hLangpack;
TIME_API tmi;
@@ -57,39 +57,39 @@ PLUGININFOEX pluginInfo = {
__AUTHORWEB,
UNICODE_AWARE,
// {043909B6-AAD8-4D82-8EB5-9F64CFE867CD}
- {0x43909b6, 0xaad8, 0x4d82, {0x8e, 0xb5, 0x9f, 0x64, 0xcf, 0xe8, 0x67, 0xcd}}
+ { 0x43909b6, 0xaad8, 0x4d82, { 0x8e, 0xb5, 0x9f, 0x64, 0xcf, 0xe8, 0x67, 0xcd } }
};
-extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_CLIST, MIID_LAST};
+extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_CLIST, MIID_LAST };
-BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved)
+BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD, LPVOID)
{
g_hInst = hInstDLL;
DisableThreadLibraryCalls(g_hInst);
return TRUE;
}
-extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
extern "C" __declspec(dllexport) int CListInitialise()
{
- mir_getLP( &pluginInfo );
+ mir_getLP(&pluginInfo);
mir_getTMI(&tmi);
g_dwMainThreadID = GetCurrentThreadId();
- CHECKRES ( PreLoadContactListModule ( ) );
- CHECKRES ( SubclassClistInterface ( ) );
- CHECKRES ( CreateHookableEvents ( ) );
- CHECKRES ( SkinEngineLoadModule ( ) );
- CHECKRES ( BackgroundsLoadModule ( ) );
- CHECKRES ( CluiLoadModule ( ) );
- CHECKRES ( ClcLoadModule ( ) );
- CHECKRES ( ToolbarButtonLoadModule( ) );
- CHECKRES ( ToolbarLoadModule() );
+ CHECKRES(PreLoadContactListModule());
+ CHECKRES(SubclassClistInterface());
+ CHECKRES(CreateHookableEvents());
+ CHECKRES(SkinEngineLoadModule());
+ CHECKRES(BackgroundsLoadModule());
+ CHECKRES(CluiLoadModule());
+ CHECKRES(ClcLoadModule());
+ CHECKRES(ToolbarButtonLoadModule());
+ CHECKRES(ToolbarLoadModule());
TRACE("CListInitialise Modern Contact List ... Done\r\n");
@@ -139,75 +139,75 @@ static HRESULT SubclassClistInterface()
pcli->hInst = g_hInst;
pcli->bDisplayLocked = TRUE;
- pcli->pfnCheckCacheItem = cliCheckCacheItem;
+ pcli->pfnCheckCacheItem = cliCheckCacheItem;
pcli->pfnFreeCacheItem = cliFreeCacheItem;
pcli->pfnInvalidateDisplayNameCacheEntry = cliInvalidateDisplayNameCacheEntry;
pcli->pfnTrayIconPauseAutoHide = cliTrayIconPauseAutoHide;
- pcli->pfnTrayCalcChanged = cliTrayCalcChanged;
+ pcli->pfnTrayCalcChanged = cliTrayCalcChanged;
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->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->pfnFindItem = cliFindItem;
+ pcli->pfnGetRowByIndex = cliGetRowByIndex;
+ pcli->pfnGetRowsPriorTo = cliGetRowsPriorTo;
pcli->pfnGetGroupContentsCount = cliGetGroupContentsCount;
- pcli->pfnCreateEvent = cliCreateEvent;
- pcli->pfnFindRowByText = cliFindRowByText;
+ pcli->pfnCreateEvent = cliCreateEvent;
+ pcli->pfnFindRowByText = cliFindRowByText;
//partialy overloaded - call default handlers from inside
- pcli->pfnGetContactIcon = cli_GetContactIcon;
- 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->pfnAddInfoItemToGroup = cli_AddInfoItemToGroup;
- 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->pfnSetContactCheckboxes = cli_SetContactCheckboxes;
+ pcli->pfnGetContactIcon = cli_GetContactIcon;
+ 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->pfnAddInfoItemToGroup = cli_AddInfoItemToGroup;
+ 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->pfnSetContactCheckboxes = cli_SetContactCheckboxes;
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->pfnAddEvent = cli_AddEvent;
+ pcli->pfnRemoveEvent = cli_RemoveEvent;
pcli->pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
return S_OK;
}
static HRESULT CreateHookableEvents()
{
- g_CluiData.hEventBkgrChanged = CreateHookableEvent(ME_BACKGROUNDCONFIG_CHANGED);
- g_CluiData.hEventPreBuildTrayMenu = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU);
- 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.hEventSkinServicesCreated = CreateHookableEvent(ME_SKIN_SERVICESCREATED);
+ g_CluiData.hEventBkgrChanged = CreateHookableEvent(ME_BACKGROUNDCONFIG_CHANGED);
+ g_CluiData.hEventPreBuildTrayMenu = CreateHookableEvent(ME_CLIST_PREBUILDTRAYMENU);
+ 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.hEventSkinServicesCreated = CreateHookableEvent(ME_SKIN_SERVICESCREATED);
return S_OK;
}
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index b1a2b7052a..2fcc3731bd 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -24,14 +24,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
// File contains implementation of animated avatars in contact list
-***************************************************************************/
+*************************************************************************** /
#include "hdr/modern_commonheaders.h"
#define IMMEDIATE_DRAW (!s_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")
@@ -45,7 +45,7 @@ BOOL GDIPlus_IsAnimatedGif (TCHAR * szName);
//messages
enum {
AAM_FIRST = WM_USER,
- AAM_SETAVATAR , //sync WPARAM: TCHAR * filename, LPARAM: SIZE * size, RESULT: actual size
+ AAM_SETAVATAR, //sync WPARAM: TCHAR * filename, LPARAM: SIZE * size, RESULT: actual size
AAM_SETPOSITION, //async LPARAM: pointer to set pos info - the handler will empty it, RESULT: 0
AAM_REDRAW, //async
AAM_STOP, //async stops animation, timer, hide window - prepeare for deleting
@@ -170,7 +170,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
/// IMPLEMENTATION
-int _AniAva_OnModulesUnload(WPARAM wParam, LPARAM lParam)
+int _AniAva_OnModulesUnload(WPARAM, LPARAM)
{
SetEvent(s_hExitEvent);
return 0;
@@ -189,8 +189,8 @@ static void _AniAva_AnimationTreadProc(void*)
ResetEvent(s_hExitEvent);
if (rc == WAIT_OBJECT_0 + 1) {
MSG msg;
- while ( PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
- if ( IsDialogMessage(msg.hwnd, &msg)) continue;
+ while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
+ if (IsDialogMessage(msg.hwnd, &msg)) continue;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
@@ -206,8 +206,8 @@ static void _AniAva_AnimationTreadProc(void*)
int AniAva_InitModule()
{
if (!(db_get_b(NULL, "CList", "AvatarsAnimated", ServiceExists(MS_AV_GETAVATARBITMAP)) &&
- db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT)))
- return 0;
+ db_get_b(NULL, "CList", "AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT)))
+ return 0;
WNDCLASSEX wc = { sizeof(wc) };
wc.lpszClassName = ANIAVAWINDOWCLASS;
@@ -221,7 +221,7 @@ int AniAva_InitModule()
s_bModuleStarted = TRUE;
s_hExitEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
mir_forkthread(_AniAva_AnimationTreadProc, NULL);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, _AniAva_OnModulesUnload);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, _AniAva_OnModulesUnload);
_AniAva_LoadOptions();
return 1;
@@ -235,12 +235,12 @@ int AniAva_UnloadModule()
mir_cslock lck(s_CS);
int i;
s_bModuleStarted = FALSE;
- for (i=0; i < s_Objects.getCount(); i++) {
+ for (i = 0; i < s_Objects.getCount(); i++) {
_AniAva_DestroyAvatarWindow(s_Objects[i]->hWindow);
mir_free(s_Objects[i]);
}
- for (i=0; i < s_AniAvatarList.getCount(); i++) {
+ for (i = 0; i < s_AniAvatarList.getCount(); i++) {
ANIAVA_INFO *aai = s_AniAvatarList[i];
mir_free(aai->tcsFilename);
free(aai->pFrameDelays);
@@ -259,7 +259,7 @@ int AniAva_UpdateOptions()
{
BOOL bReloadAvatars = FALSE;
BOOL bBeEnabled = (db_get_b(NULL, "CList", "AvatarsAnimated", ServiceExists(MS_AV_GETAVATARBITMAP)) &&
- db_get_b(NULL,"CList","AvatarsShow",SETTINGS_SHOWAVATARS_DEFAULT));
+ db_get_b(NULL, "CList", "AvatarsShow", SETTINGS_SHOWAVATARS_DEFAULT));
if (bBeEnabled && !s_bModuleStarted) {
AniAva_InitModule();
bReloadAvatars = TRUE;
@@ -287,17 +287,16 @@ int AniAva_UpdateOptions()
int AniAva_AddAvatar(MCONTACT hContact, TCHAR * szFilename, int width, int heigth)
{
aacheck 0;
- if (!GDIPlus_IsAnimatedGif (szFilename))
+ if (!GDIPlus_IsAnimatedGif(szFilename))
return 0;
mir_cslock lck(s_CS);
//first try to find window for contact avatar
HWND hwnd = NULL;
int i;
- ANIAVA_OBJECT * pavi;
- ANIAVATARIMAGEINFO avii = {0};
- SIZE szAva = { width, heigth };
- for (i=0; i < s_Objects.getCount(); i++) {
+ ANIAVA_OBJECT * pavi = NULL;
+ ANIAVATARIMAGEINFO avii = { 0 };
+ for (i = 0; i < s_Objects.getCount(); i++) {
pavi = s_Objects[i];
if (pavi->hContact == hContact) {
if (pavi->ObjectSize.cx == width && pavi->ObjectSize.cy == heigth) {
@@ -314,20 +313,20 @@ int AniAva_AddAvatar(MCONTACT hContact, TCHAR * szFilename, int width, int heigt
}
}
if (i == s_Objects.getCount()) {
- pavi = (ANIAVA_OBJECT*) mir_calloc( sizeof(ANIAVA_OBJECT));
+ pavi = (ANIAVA_OBJECT*)mir_calloc(sizeof(ANIAVA_OBJECT));
pavi->hContact = hContact;
s_Objects.insert(pavi);
}
//change avatar
pavi->bToBeDeleted = FALSE;
- pavi->bInvalidPos = 0;
+ pavi->bInvalidPos = 0;
// now CreateAvatar
if (pavi->dwAvatarUniqId)
- _AniAva_GetAvatarImageInfo(pavi->dwAvatarUniqId,&avii);
+ _AniAva_GetAvatarImageInfo(pavi->dwAvatarUniqId, &avii);
else
pavi->dwAvatarUniqId = _AniAva_LoadAvatarFromImage(szFilename, width, heigth, &avii);
if (hwnd)
- SendMessage(hwnd, AAM_SETAVATAR, (WPARAM)&avii, (LPARAM) 0);
+ SendMessage(hwnd, AAM_SETAVATAR, (WPARAM)&avii, (LPARAM)0);
pavi->ObjectSize = avii.szSize;
return MAKELONG(avii.szSize.cx, avii.szSize.cy);
}
@@ -338,15 +337,15 @@ void AniAva_UpdateParent()
aacheck;
mir_cslock lck(s_CS);
HWND parent = GetAncestor(pcli->hwndContactList, GA_PARENT);
- for (int i=0; i < s_Objects.getCount(); i++) {
+ for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)s_Objects[i];
- SendMessage(pai->hWindow, AAM_SETPARENT, (WPARAM)parent,0);
+ SendMessage(pai->hWindow, AAM_SETPARENT, (WPARAM)parent, 0);
}
}
-ANIAVA_OBJECT * FindAvatarByContact(MCONTACT hContact )
+ANIAVA_OBJECT * FindAvatarByContact(MCONTACT hContact)
{
- for ( int i=0; i < s_Objects.getCount(); i++) {
+ for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = ((ANIAVA_OBJECT *)s_Objects[i]);
if (pai->hContact == hContact)
return pai;
@@ -354,13 +353,13 @@ ANIAVA_OBJECT * FindAvatarByContact(MCONTACT hContact )
return NULL;
}
-int AniAva_RenderAvatar(MCONTACT hContact, HDC hdcMem, RECT *rc )
+int AniAva_RenderAvatar(MCONTACT hContact, HDC hdcMem, RECT *rc)
{
aacheck 0;
mir_cslock lck(s_CS);
- ANIAVA_OBJECT *pai = FindAvatarByContact( hContact );
+ ANIAVA_OBJECT *pai = FindAvatarByContact(hContact);
if (pai)
- SendMessage(pai->hWindow, AAM_RENDER, (WPARAM)hdcMem, (LPARAM) rc);
+ SendMessage(pai->hWindow, AAM_RENDER, (WPARAM)hdcMem, (LPARAM)rc);
return 0;
}
@@ -372,31 +371,31 @@ int AniAva_SetAvatarPos(MCONTACT hContact, RECT *rc, int overlayIdx, BYTE bAlpha
if (s_CS.LockCount > 0)
return 0;
- ANIAVA_OBJECT *pai = FindAvatarByContact( hContact );
+ ANIAVA_OBJECT *pai = FindAvatarByContact(hContact);
if (pai) {
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);
+ _itoa((int)hContact, szName + 10, 16);
- tszName = mir_a2t( szName );
+ tszName = mir_a2t(szName);
hwnd = _AniAva_CreateAvatarWindowSync(tszName);
- mir_free( tszName );
+ mir_free(tszName);
parent = GetAncestor(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);
+ 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;
- SendNotifyMessage(pai->hWindow, AAM_SETPOSITION, 0, (LPARAM) api);
+ SendNotifyMessage(pai->hWindow, AAM_SETPOSITION, 0, (LPARAM)api);
// the AAM_SETPOSITION is responsible to destroy memory under api
pai->bInvalidPos = FALSE;
pai->bToBeDeleted = FALSE;
@@ -409,7 +408,7 @@ int AniAva_RemoveAvatar(MCONTACT hContact)
aacheck 0;
mir_cslock lck(s_CS);
- for (int i=0; i < s_Objects.getCount(); i++) {
+ for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = s_Objects[i];
if (pai->hContact == hContact) {
pai->bToBeDeleted = TRUE;
@@ -423,7 +422,7 @@ int AniAva_InvalidateAvatarPositions(MCONTACT hContact)
{
aacheck 0;
mir_cslock lck(s_CS);
- for (int i=0; i < s_Objects.getCount(); i++) {
+ for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = s_Objects[i];
if (pai->hContact == hContact || !hContact) {
pai->bInvalidPos++;
@@ -439,10 +438,10 @@ int AniAva_RemoveInvalidatedAvatars()
aacheck 0;
mir_cslock lck(s_CS);
- for (int i=0; i < s_Objects.getCount(); i++) {
+ for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = (ANIAVA_OBJECT *)s_Objects[i];
if (pai->hWindow && (pai->bInvalidPos)) {
- SendMessage(pai->hWindow,AAM_STOP, 0, 0);
+ SendMessage(pai->hWindow, AAM_STOP, 0, 0);
if (pai->bInvalidPos) {
pai->bInvalidPos = 0;
_AniAva_DestroyAvatarWindow(pai->hWindow);
@@ -469,12 +468,12 @@ int AniAva_RedrawAllAvatars(BOOL updateZOrder)
aacheck 0;
mir_cslock lck(s_CS);
updateZOrder = 1;
- for (int i=0; i < s_Objects.getCount(); i++) {
+ for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = (ANIAVA_OBJECT *)s_Objects[i];
if (updateZOrder)
- SendMessage(pai->hWindow,AAM_REDRAW,(WPARAM)updateZOrder,0);
+ SendMessage(pai->hWindow, AAM_REDRAW, (WPARAM)updateZOrder, 0);
else
- SendNotifyMessage(pai->hWindow,AAM_REDRAW,(WPARAM)updateZOrder,0);
+ SendNotifyMessage(pai->hWindow, AAM_REDRAW, (WPARAM)updateZOrder, 0);
}
return 1;
}
@@ -482,14 +481,14 @@ int AniAva_RedrawAllAvatars(BOOL updateZOrder)
//Static procedures
static void CALLBACK _AniAva_SyncCallerUserAPCProc(DWORD_PTR dwParam)
{
- ANIAVA_SYNCCALLITEM* item = (ANIAVA_SYNCCALLITEM*) dwParam;
+ ANIAVA_SYNCCALLITEM* item = (ANIAVA_SYNCCALLITEM*)dwParam;
item->nResult = item->pfnProc(item->wParam, item->lParam);
SetEvent(item->hDoneEvent);
}
-static INT_PTR _AniAva_CreateAvatarWindowSync_Worker(WPARAM tszName, LPARAM lParam)
+static INT_PTR _AniAva_CreateAvatarWindowSync_Worker(WPARAM tszName, LPARAM)
{
- 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 );
+ 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;
}
@@ -498,14 +497,14 @@ static HWND _AniAva_CreateAvatarWindowSync(TCHAR *szFileName)
if (s_AnimationThreadHandle == 0 || s_AnimationThreadID == 0)
return NULL;
- ANIAVA_SYNCCALLITEM item = {0};
+ ANIAVA_SYNCCALLITEM item = { 0 };
item.wParam = (WPARAM)szFileName;
item.pfnProc = _AniAva_CreateAvatarWindowSync_Worker;
item.hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
if (GetCurrentThreadId() != s_AnimationThreadID)
- QueueUserAPC(_AniAva_SyncCallerUserAPCProc, s_AnimationThreadHandle, (DWORD_PTR) &item);
+ QueueUserAPC(_AniAva_SyncCallerUserAPCProc, s_AnimationThreadHandle, (DWORD_PTR)&item);
else
- _AniAva_SyncCallerUserAPCProc((DWORD_PTR) &item);
+ _AniAva_SyncCallerUserAPCProc((DWORD_PTR)&item);
WaitForSingleObject(item.hDoneEvent, INFINITE);
CloseHandle(item.hDoneEvent);
return (HWND)item.nResult;
@@ -514,7 +513,7 @@ static HWND _AniAva_CreateAvatarWindowSync(TCHAR *szFileName)
static void _AniAva_RealRemoveAvatar(DWORD UniqueID)
{
for (int j = 0; j < s_AniAvatarList.getCount(); j++) {
- ANIAVA_INFO * aai = (ANIAVA_INFO *) s_AniAvatarList[j];
+ ANIAVA_INFO * aai = (ANIAVA_INFO *)s_AniAvatarList[j];
if (aai->dwAvatarUniqId == UniqueID) {
aai->nRefCount--;
if (aai->nRefCount == 0) {
@@ -522,31 +521,31 @@ static void _AniAva_RealRemoveAvatar(DWORD UniqueID)
mir_free(aai->tcsFilename);
free(aai->pFrameDelays);
- _AniAva_ReduceAvatarImages(aai->nStripTop,aai->FrameSize.cx*aai->nFrameCount, FALSE);
+ _AniAva_ReduceAvatarImages(aai->nStripTop, aai->FrameSize.cx*aai->nFrameCount, FALSE);
for (int k = 0; k < s_AniAvatarList.getCount(); k++)
if (k != j) {
- ANIAVA_INFO * taai = (ANIAVA_INFO *) s_AniAvatarList[k];
+ ANIAVA_INFO * taai = (ANIAVA_INFO *)s_AniAvatarList[k];
if (taai->nStripTop>aai->nStripTop)
taai->nStripTop -= aai->FrameSize.cx*aai->nFrameCount;
}
if (s_AniAvatarList.getCount() > 0) {
- int newWidth = s_width-aai->FrameSize.cx*aai->nFrameCount;
+ int newWidth = s_width - aai->FrameSize.cx*aai->nFrameCount;
int newHeight = 0;
int i;
- for (i=0; i < s_AniAvatarList.getCount(); i++)
+ for (i = 0; i < s_AniAvatarList.getCount(); i++)
if (i != j)
{
- newHeight = max(newHeight,((ANIAVA_INFO *) s_AniAvatarList[i])->FrameSize.cy);
+ newHeight = max(newHeight, ((ANIAVA_INFO *)s_AniAvatarList[i])->FrameSize.cy);
}
HDC hNewDC = CreateCompatibleDC(NULL);
- HBITMAP hNewBmp = ske_CreateDIB32(newWidth,newHeight);
- HBITMAP hNewOldBmp = (HBITMAP)SelectObject(hNewDC,hNewBmp);
+ HBITMAP hNewBmp = ske_CreateDIB32(newWidth, newHeight);
+ HBITMAP hNewOldBmp = (HBITMAP)SelectObject(hNewDC, hNewBmp);
// copy from old and from new strip
if (aai->nStripTop>0)
- BitBlt(hNewDC, 0, 0, aai->nStripTop,newHeight,s_hAniAvaDC, 0, 0, SRCCOPY);
- if (aai->nStripTop+aai->FrameSize.cx*aai->nFrameCount < s_width)
- BitBlt(hNewDC,aai->nStripTop, 0, s_width-(aai->nStripTop+aai->FrameSize.cx*aai->nFrameCount),newHeight,s_hAniAvaDC,aai->nStripTop+aai->FrameSize.cx*aai->nFrameCount, 0, SRCCOPY);
+ BitBlt(hNewDC, 0, 0, aai->nStripTop, newHeight, s_hAniAvaDC, 0, 0, SRCCOPY);
+ if (aai->nStripTop + aai->FrameSize.cx*aai->nFrameCount < s_width)
+ BitBlt(hNewDC, aai->nStripTop, 0, s_width - (aai->nStripTop + aai->FrameSize.cx*aai->nFrameCount), newHeight, s_hAniAvaDC, aai->nStripTop + aai->FrameSize.cx*aai->nFrameCount, 0, SRCCOPY);
_AniAva_RemoveAniAvaDC();
s_width = newWidth;
@@ -579,15 +578,15 @@ static void _AniAva_RemoveAniAvaDC()
}
}
-static void _AniAva_DestroyAvatarWindow( HWND hwnd)
+static void _AniAva_DestroyAvatarWindow(HWND hwnd)
{
- SendMessage(hwnd,AAM_SELFDESTROY, 0, 0);
+ SendMessage(hwnd, AAM_SELFDESTROY, 0, 0);
}
static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height, ANIAVATARIMAGEINFO *pRetAII)
{
ANIAVA_INFO * paai = NULL;
- ANIAVA_INFO aai = {0};
+ ANIAVA_INFO aai = { 0 };
aai.tcsFilename = szFileName;
aai.FrameSize.cx = width;
aai.FrameSize.cy = height;
@@ -600,31 +599,31 @@ static int _AniAva_LoadAvatarFromImage(TCHAR * szFileName, int width, int height
//get image strip
HBITMAP hBitmap = NULL;
- 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
HDC hTempDC = CreateCompatibleDC(NULL);
- HBITMAP hOldBitmap = (HBITMAP)SelectObject(hTempDC,hBitmap);
+ HBITMAP hOldBitmap = (HBITMAP)SelectObject(hTempDC, hBitmap);
- int newWidth = s_width+paai->FrameSize.cx*paai->nFrameCount;
- int newHeight = max(paai->FrameSize.cy,s_height);
+ int newWidth = s_width + paai->FrameSize.cx*paai->nFrameCount;
+ int newHeight = max(paai->FrameSize.cy, s_height);
HDC hNewDC = CreateCompatibleDC(NULL);
- HBITMAP hNewBmp = ske_CreateDIB32(newWidth,newHeight);
- HBITMAP hNewOldBmp = (HBITMAP)SelectObject(hNewDC,hNewBmp);
+ HBITMAP hNewBmp = ske_CreateDIB32(newWidth, newHeight);
+ HBITMAP hNewOldBmp = (HBITMAP)SelectObject(hNewDC, hNewBmp);
_AniAva_PausePainting();
GdiFlush();
// copy from old and from new strip
- BitBlt(hNewDC, 0, 0, s_width,s_height,s_hAniAvaDC, 0, 0, SRCCOPY);
- BitBlt(hNewDC,s_width, 0, paai->FrameSize.cx*paai->nFrameCount,paai->FrameSize.cy,hTempDC, 0, 0, SRCCOPY);
+ BitBlt(hNewDC, 0, 0, s_width, s_height, s_hAniAvaDC, 0, 0, SRCCOPY);
+ BitBlt(hNewDC, s_width, 0, paai->FrameSize.cx*paai->nFrameCount, paai->FrameSize.cy, hTempDC, 0, 0, SRCCOPY);
paai->nStripTop = s_width;
s_AniAvatarList.insert(paai);
GdiFlush();
//remove temp DC
- SelectObject(hTempDC,hOldBitmap);
+ SelectObject(hTempDC, hOldBitmap);
DeleteObject(hNewBmp);
DeleteDC(hTempDC);
DeleteObject(hBitmap);
@@ -659,7 +658,7 @@ static BOOL _AniAva_GetAvatarImageInfo(DWORD dwAvatarUniqId, ANIAVATARIMAGEINFO
{
BOOL res = FALSE;
for (int j = 0; j < s_AniAvatarList.getCount(); j++) {
- ANIAVA_INFO * aai = (ANIAVA_INFO *) s_AniAvatarList[j];
+ ANIAVA_INFO * aai = (ANIAVA_INFO *)s_AniAvatarList[j];
if (aai->dwAvatarUniqId == dwAvatarUniqId) {
avii->nFramesCount = aai->nFrameCount;
avii->pFrameDelays = aai->pFrameDelays;
@@ -677,30 +676,30 @@ static void _AniAva_Clear_ANIAVA_WINDOWINFO(ANIAVA_WINDOWINFO *pavwi)
{
pavwi->delaysInterval = NULL;
pavwi->nFramesCount = 0;
- KillTimer(pavwi->hWindow,2);
- pavwi->bPlaying = FALSE;
+ KillTimer(pavwi->hWindow, 2);
+ pavwi->bPlaying = FALSE;
pavwi->TimerId = 0;
}
-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; }
+ if (dat->bPaused > 0) { dat->bPended = TRUE; return; }
else dat->bPended = FALSE;
- if ( IMMEDIATE_DRAW && hdcParent == NULL ) return;
+ if (IMMEDIATE_DRAW && hdcParent == NULL) return;
GdiFlush();
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};
+ 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;
- HBITMAP hBmp;
- HBITMAP hOldBmp;
+ HBITMAP hBmp = NULL;
+ HBITMAP hOldBmp = NULL;
/*
int x = bf.SourceConstantAlpha;
@@ -708,8 +707,8 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL
x = min(x,255); x = max(x,0);
bf.SourceConstantAlpha = x;
*/
- if ( s_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;
+ if (s_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 = s_hAniAvaDC;
}
@@ -717,49 +716,48 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL
// ... need to create additional hDC_animation
HRGN hRgn = NULL;
int cornerRadius = s_cornerRadius;
- tempDC = CreateCompatibleDC( NULL );
- hBmp = ske_CreateDIB32( szWnd.cx, szWnd.cy );
- hOldBmp = (HBITMAP)SelectObject(tempDC,hBmp);
+ tempDC = CreateCompatibleDC(NULL);
+ hBmp = ske_CreateDIB32(szWnd.cx, szWnd.cy);
+ hOldBmp = (HBITMAP)SelectObject(tempDC, hBmp);
if (s_bFlags & AAO_ROUND_CORNERS)
if (!cornerRadius) //auto radius
- cornerRadius = min(szWnd.cx, szWnd.cy )/5;
+ cornerRadius = min(szWnd.cx, szWnd.cy) / 5;
if (s_bFlags & AAO_HAS_BORDER) {
// if has borders - create region (round corners) and fill it, remember internal as clipping
- HBRUSH hBrush = CreateSolidBrush( s_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);
- CombineRgn( rgnOutside,rgnOutside,hRgn,RGN_DIFF);
- FillRgn( tempDC, rgnOutside, hBrush);
- ske_SetRgnOpaque( tempDC, rgnOutside, TRUE);
+ HBRUSH hBrush = CreateSolidBrush(s_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);
+ CombineRgn(rgnOutside, rgnOutside, hRgn, RGN_DIFF);
+ FillRgn(tempDC, rgnOutside, hBrush);
+ ske_SetRgnOpaque(tempDC, rgnOutside, TRUE);
SelectObject(tempDC, hOldBrush);
DeleteObject(hBrush);
DeleteObject(rgnOutside);
}
- else if ( cornerRadius > 0 )
+ 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 )
+ if (hRgn)
ExtSelectClipRgn(tempDC, hRgn, RGN_AND);
if (s_bFlags & AAO_OPAQUE) {
// if back color - fill clipping area
- HBRUSH hBrush = CreateSolidBrush( s_bkgColor );
- HBRUSH hOldBrush = (HBRUSH)SelectObject( tempDC, hBrush );
- FillRgn( tempDC, hRgn, hBrush );
- ske_SetRgnOpaque( tempDC, hRgn, TRUE );
+ HBRUSH hBrush = CreateSolidBrush(s_bkgColor);
+ FillRgn(tempDC, hRgn, hBrush);
+ ske_SetRgnOpaque(tempDC, hRgn, TRUE);
}
// draw avatar
if (!(s_bFlags & AAO_OPAQUE))
- BitBlt(tempDC, 0, 0, szWnd.cx, szWnd.cy , s_hAniAvaDC , dat->ptFromPoint.x+dat->sizeAvatar.cx*dat->currentFrame, dat->ptFromPoint.y, SRCCOPY);
+ BitBlt(tempDC, 0, 0, szWnd.cx, szWnd.cy, s_hAniAvaDC, dat->ptFromPoint.x + dat->sizeAvatar.cx*dat->currentFrame, dat->ptFromPoint.y, SRCCOPY);
else {
- BLENDFUNCTION abf = {AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- ske_AlphaBlend(tempDC, 0, 0, szWnd.cx, szWnd.cy , s_hAniAvaDC, dat->ptFromPoint.x+dat->sizeAvatar.cx*dat->currentFrame, dat->ptFromPoint.y, szWnd.cx, szWnd.cy, abf);
+ BLENDFUNCTION abf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ ske_AlphaBlend(tempDC, 0, 0, szWnd.cx, szWnd.cy, s_hAniAvaDC, dat->ptFromPoint.x + dat->sizeAvatar.cx*dat->currentFrame, dat->ptFromPoint.y, szWnd.cx, szWnd.cy, abf);
}
// reset clip area
if (hRgn) {
@@ -769,7 +767,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL
DeleteObject(hRgn);
}
- if ((s_bFlags & AAO_HAS_OVERLAY ) && dat->overlayIconIdx != -1 && s_overlayIconImageList) {
+ if ((s_bFlags & AAO_HAS_OVERLAY) && dat->overlayIconIdx != -1 && s_overlayIconImageList) {
// if overlay - draw overlay icon
// position - on avatar
int x = szWnd.cx - ICON_WIDTH;
@@ -788,28 +786,28 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL
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));
+ 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;
+ 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) {
- if ( s_bFlags & AAO_OPAQUE )
- BitBlt( hdcParent, rcInParent->left, rcInParent->top, szWnd.cx, szWnd.cy, copyFromDC, pt_from.x, pt_from.y, SRCCOPY);
+ if (s_bFlags & AAO_OPAQUE)
+ 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 };
- ske_AlphaBlend( hdcParent, rcInParent->left, rcInParent->top, szWnd.cx, szWnd.cy, copyFromDC, pt_from.x, pt_from.y, szWnd.cx, szWnd.cy, abf);
+ 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 (!UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA )) {
+ else if (!UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA)) {
LONG_PTR exStyle;
- exStyle = GetWindowLongPtr(dat->hWindow,GWL_EXSTYLE);
+ 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 );
- UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA );
+ 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);
+ UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA);
}
g_CluiData.fAeroGlass = false;
@@ -817,7 +815,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL
}
else dat->bPlaying = FALSE;
- ReleaseDC(NULL,hDC_animation);
+ ReleaseDC(NULL, hDC_animation);
if (tempDC) {
SelectObject(tempDC, hOldBmp);
DeleteObject(hBmp);
@@ -826,21 +824,21 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL
}
if (!dat->bPlaying) {
ShowWindow(dat->hWindow, SW_HIDE);
- KillTimer(dat->hWindow,2); //stop animation till set pos will be called
+ KillTimer(dat->hWindow, 2); //stop animation till set pos will be called
}
GdiFlush();
}
static void _AniAva_PausePainting()
{
- for (int i=0; i < s_Objects.getCount(); i++) {
+ for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = s_Objects[i];
SendMessage(pai->hWindow, AAM_PAUSE, 0, 0);
}
}
static void _AniAva_ResumePainting()
{
- for (int i=0; i < s_Objects.getCount(); i++) {
+ for (int i = 0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT *pai = s_Objects[i];
SendNotifyMessage(pai->hWindow, AAM_RESUME, 0, 0);
}
@@ -848,9 +846,9 @@ static void _AniAva_ResumePainting()
static void _AniAva_ReduceAvatarImages(int startY, int dY, BOOL bDestroyWindow)
{
- for (int i=s_Objects.getCount()-1; i >= 0; i--) {
+ for (int i = s_Objects.getCount() - 1; i >= 0; i--) {
ANIAVA_OBJECT *pai = s_Objects[i];
- int res = SendMessage(pai->hWindow,AAM_REMOVEAVATAR,(WPARAM)startY,(LPARAM)dY);
+ int res = SendMessage(pai->hWindow, AAM_REMOVEAVATAR, (WPARAM)startY, (LPARAM)dY);
if (res == 0xDEAD && bDestroyWindow) {
_AniAva_DestroyAvatarWindow(pai->hWindow);
mir_free(pai);
@@ -864,19 +862,19 @@ static void _AniAva_LoadOptions()
aacheck;
mir_cslock lck(s_CS);
- s_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);
+ s_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 (s_bFlags & AAO_HAS_BORDER)
- s_borderColor = (COLORREF)db_get_dw(NULL,"CList","AvatarsBorderColor",SETTINGS_AVATARBORDERCOLOR_DEFAULT);
+ s_borderColor = (COLORREF)db_get_dw(NULL, "CList", "AvatarsBorderColor", SETTINGS_AVATARBORDERCOLOR_DEFAULT);
if (s_bFlags & AAO_ROUND_CORNERS)
- s_cornerRadius = db_get_b(NULL,"CList","AvatarsUseCustomCornerSize",SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT)? db_get_w(NULL,"CList","AvatarsCustomCornerSize",SETTINGS_AVATARCORNERSIZE_DEFAULT) : 0;
+ s_cornerRadius = db_get_b(NULL, "CList", "AvatarsUseCustomCornerSize", SETTINGS_AVATARUSECUTOMCORNERSIZE_DEFAULT) ? db_get_w(NULL, "CList", "AvatarsCustomCornerSize", SETTINGS_AVATARCORNERSIZE_DEFAULT) : 0;
if (s_bFlags & AAO_HAS_OVERLAY) {
//check image list
- BYTE type = db_get_b(NULL,"CList","AvatarsOverlayType",SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
- switch(type) {
+ BYTE type = db_get_b(NULL, "CList", "AvatarsOverlayType", SETTINGS_AVATAROVERLAYTYPE_DEFAULT);
+ switch (type) {
case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
s_overlayIconImageList = hAvatarOverlays;
break;
@@ -890,7 +888,7 @@ static void _AniAva_LoadOptions()
}
if (s_bFlags & AAO_OPAQUE)
s_bkgColor = 0;
- s_bSeparateWindow = db_get_b(NULL,"CList","AvatarsInSeparateWnd",SETTINGS_AVATARINSEPARATE_DEFAULT);
+ s_bSeparateWindow = db_get_b(NULL, "CList", "AvatarsInSeparateWnd", SETTINGS_AVATARINSEPARATE_DEFAULT);
}
static int _AniAva_SortAvatarInfo(const ANIAVA_INFO *aai1, const ANIAVA_INFO *aai2)
@@ -901,7 +899,7 @@ static int _AniAva_SortAvatarInfo(const ANIAVA_INFO *aai1, const ANIAVA_INFO *aa
else {
int a1 = (aai1 != NULL && aai1->tcsFilename != NULL);
int a2 = (aai2 != NULL && aai2->tcsFilename != NULL);
- res = a1-a2;
+ res = a1 - a2;
}
if (res)
return res;
@@ -911,16 +909,16 @@ static int _AniAva_SortAvatarInfo(const ANIAVA_INFO *aai1, const ANIAVA_INFO *aa
void _AniAva_InvalidateParent(ANIAVA_WINDOWINFO * dat)
{
- if (!IMMEDIATE_DRAW ) return;
+ if (!IMMEDIATE_DRAW) return;
HWND hwndParent = pcli->hwndContactTree;
RECT rcPos = dat->rcPos;
- pcli->pfnInvalidateRect( hwndParent, &rcPos, FALSE );
+ pcli->pfnInvalidateRect(hwndParent, &rcPos, FALSE);
}
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))
+ if (msg == WM_TIMER || msg == WM_DESTROY || (msg > AAM_FIRST && msg < AAM_LAST))
dat = (ANIAVA_WINDOWINFO *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
switch (msg) {
@@ -937,7 +935,7 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
dat->bPaused--;
if (dat->bPaused) return 0;
if (dat->bPended)
- if (!IMMEDIATE_DRAW )
+ if (!IMMEDIATE_DRAW)
_AniAva_RenderAvatar(dat);
dat->bPended = FALSE;
return 0;
@@ -945,71 +943,71 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
case AAM_STOP:
if (dat->bPlaying) {
dat->bPlaying = FALSE;
- KillTimer(hwnd,2);
+ KillTimer(hwnd, 2);
ShowWindow(hwnd, SW_HIDE);
}
return 0;
case AAM_SETAVATAR:
- {
- 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;
- return MAKELONG(dat->sizeAvatar.cx,dat->sizeAvatar.cy);
- }
+ {
+ 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;
+ return MAKELONG(dat->sizeAvatar.cx, dat->sizeAvatar.cy);
+ }
case AAM_SETPOSITION:
- {
- 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;
- free(papi);
- if (!dat->bPlaying) {
- dat->bPlaying = TRUE;
- ShowWindow(hwnd,SW_SHOWNA);
- dat->currentFrame = 0;
- KillTimer(hwnd,2);
- SetTimer(hwnd,2,dat->delaysInterval[0],NULL);
- }
- if (!IMMEDIATE_DRAW )
- _AniAva_RenderAvatar(dat);
+ {
+ 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;
+ free(papi);
+ if (!dat->bPlaying) {
+ dat->bPlaying = TRUE;
+ ShowWindow(hwnd, SW_SHOWNA);
+ dat->currentFrame = 0;
+ KillTimer(hwnd, 2);
+ SetTimer(hwnd, 2, dat->delaysInterval[0], NULL);
}
- return 0;
+ if (!IMMEDIATE_DRAW)
+ _AniAva_RenderAvatar(dat);
+ }
+ return 0;
case AAM_SETPARENT:
- if ( IMMEDIATE_DRAW ) return 0;
+ if (IMMEDIATE_DRAW) return 0;
dat->bOrderTop = ((HWND)wParam != GetDesktopWindow());
- SetParent(hwnd,(HWND)wParam);
+ SetParent(hwnd, (HWND)wParam);
if (dat->bOrderTop)
- SetWindowPos(hwnd,HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_ASYNCWINDOWPOS);
+ SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS);
else {
LONG exStyle = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
- SetWindowPos(pcli->hwndContactList,hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
+ 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*/);
+ SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
}
return 0;
case AAM_REDRAW:
- if ( IMMEDIATE_DRAW )
+ if (IMMEDIATE_DRAW)
return 0;
if (wParam) {
if (dat->bOrderTop)
- SetWindowPos(hwnd,HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE|SWP_ASYNCWINDOWPOS);
+ SetWindowPos(hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_ASYNCWINDOWPOS);
else {
- LONG exStyle = GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE);
- SetWindowPos(pcli->hwndContactList,hwnd, 0, 0, 0, 0, SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
+ LONG 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*/);
+ SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE/*|SWP_ASYNCWINDOWPOS*/);
}
}
@@ -1024,20 +1022,20 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
return DestroyWindow(hwnd);
case WM_CREATE:
- {
- ANIAVA_WINDOWINFO *dat = (ANIAVA_WINDOWINFO *) mir_calloc(sizeof (ANIAVA_WINDOWINFO));
- SetWindowLongPtr(hwnd,GWLP_USERDATA,(LONG_PTR)dat);
- dat->hWindow = hwnd;
- //change layered mode
- LONG_PTR 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;
- SetWindowLongPtr(dat->hWindow, GWL_STYLE, exStyle);
- }
- break;
+ {
+ ANIAVA_WINDOWINFO *dat = (ANIAVA_WINDOWINFO *)mir_calloc(sizeof(ANIAVA_WINDOWINFO));
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)dat);
+ dat->hWindow = hwnd;
+ //change layered mode
+ LONG_PTR 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;
+ SetWindowLongPtr(dat->hWindow, GWL_STYLE, exStyle);
+ }
+ break;
case WM_TIMER:
if (!IsWindowVisible(hwnd)) {
@@ -1054,13 +1052,13 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
_AniAva_InvalidateParent(dat);
KillTimer(hwnd, 2);
- SetTimer(hwnd, 2, dat->delaysInterval[dat->currentFrame]+1, NULL);
+ SetTimer(hwnd, 2, dat->delaysInterval[dat->currentFrame] + 1, NULL);
return 0;
case WM_DESTROY:
_AniAva_Clear_ANIAVA_WINDOWINFO(dat);
mir_free(dat);
- SetWindowLongPtr(hwnd,GWLP_USERDATA,0);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
break;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp
index 75cc325e06..adba1130a3 100644
--- a/plugins/Clist_modern/src/modern_awaymsg.cpp
+++ b/plugins/Clist_modern/src/modern_awaymsg.cpp
@@ -85,18 +85,18 @@ static void amThreadProc(void *)
MCONTACT hContact = amGetCurrentChain();
while (hContact) {
DWORD time = GetTickCount();
- if ((time-amRequestTick) < AMASKPERIOD) {
- SleepEx(AMASKPERIOD-(time-amRequestTick)+10, TRUE);
- if ( MirandaExiting())
+ if ((time - amRequestTick) < AMASKPERIOD) {
+ SleepEx(AMASKPERIOD - (time - amRequestTick) + 10, TRUE);
+ if (MirandaExiting())
return;
}
CListSettings_FreeCacheItemData(&dnce);
dnce.hContact = hContact;
- Sync(CLUI_SyncGetPDNCE, (WPARAM) 0, (LPARAM)&dnce);
+ Sync(CLUI_SyncGetPDNCE, (WPARAM)0, (LPARAM)&dnce);
HANDLE ACK = 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);
+ ACK = (HANDLE)CallContactService(hContact, PSS_GETAWAYMSG, 0, 0);
if (!ACK) {
ACKDATA ack;
ack.hContact = hContact;
@@ -112,20 +112,19 @@ static void amThreadProc(void *)
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())
+ if (MirandaExiting())
return;
}
WaitForSingleObjectEx(hamProcessEvent, INFINITE, TRUE);
ResetEvent(hamProcessEvent);
- if ( MirandaExiting())
+ if (MirandaExiting())
break;
}
}
@@ -157,7 +156,7 @@ void amRequestAwayMsg(MCONTACT hContact)
void InitAwayMsgModule()
{
InitializeCriticalSection(&amCS);
- hamProcessEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
+ hamProcessEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
g_hAwayMsgThread = mir_forkthread(amThreadProc, 0);
}
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp
index 1b6fa8b40a..4b808d886a 100644
--- a/plugins/Clist_modern/src/modern_cachefuncs.cpp
+++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp
@@ -35,7 +35,7 @@ Modified by FYR
#include "./hdr/modern_gettextasync.h"
#include "hdr/modern_sync.h"
-typedef BOOL (* ExecuteOnAllContactsFuncPtr) (ClcContact *contact, BOOL subcontact, void *param);
+typedef BOOL(*ExecuteOnAllContactsFuncPtr) (ClcContact *contact, BOOL subcontact, void *param);
/***********************************/
@@ -50,7 +50,7 @@ static BOOL ExecuteOnAllContacts(ClcData *dat, ExecuteOnAllContactsFuncPtr func,
static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFuncPtr func, void *param);
int CLUI_SyncGetShortData(WPARAM wParam, LPARAM lParam);
void CListSettings_FreeCacheItemData(ClcCacheEntry *pDst);
-void CListSettings_FreeCacheItemDataOption( ClcCacheEntry *pDst, DWORD flag );
+void CListSettings_FreeCacheItemDataOption(ClcCacheEntry *pDst, DWORD flag);
/*
* Get time zone for contact
*/
@@ -58,7 +58,7 @@ void Cache_GetTimezone(ClcData *dat, MCONTACT hContact)
{
ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact);
if (dat == NULL && pcli->hwndContactTree)
- dat = (ClcData *)GetWindowLongPtr(pcli->hwndContactTree,0);
+ dat = (ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0);
if (dat && dat->hWnd == pcli->hwndContactTree) {
DWORD flags = dat->contact_time_show_only_if_different ? TZF_DIFONLY : 0;
@@ -76,24 +76,24 @@ void Cache_GetText(ClcData *dat, ClcContact *contact, BOOL forceRenew)
if (!dat->force_in_dialog) {
ClcCacheEntry *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);
+ gtaAddRequest(dat, contact->hContact);
}
}
-void CSmileyString::AddListeningToIcon(struct SHORTDATA *dat, ClcCacheEntry *pdnce, TCHAR *szText, BOOL replace_smileys)
+void CSmileyString::AddListeningToIcon(struct SHORTDATA *dat, TCHAR *szText)
{
iMaxSmileyHeight = 0;
DestroySmileyList();
if (szText == NULL) return;
- int text_size = (int)_tcslen( szText );
+ int text_size = (int)_tcslen(szText);
- plText = List_Create( 0, 1 );
+ plText = List_Create(0, 1);
// Add Icon
{
- ClcContactTextPiece *piece = (ClcContactTextPiece *) mir_alloc(sizeof(ClcContactTextPiece));
+ ClcContactTextPiece *piece = (ClcContactTextPiece *)mir_alloc(sizeof(ClcContactTextPiece));
piece->type = TEXT_PIECE_TYPE_SMILEY;
piece->len = 0;
piece->smiley = g_hListeningToIcon;
@@ -101,7 +101,7 @@ void CSmileyString::AddListeningToIcon(struct SHORTDATA *dat, ClcCacheEntry *pdn
piece->smiley_height = 16;
ICONINFO icon;
- if ( GetIconInfo(piece->smiley, &icon)) {
+ if (GetIconInfo(piece->smiley, &icon)) {
BITMAP bm;
if (GetObject(icon.hbmColor, sizeof(BITMAP), &bm)) {
piece->smiley_width = bm.bmWidth;
@@ -115,36 +115,36 @@ void CSmileyString::AddListeningToIcon(struct SHORTDATA *dat, ClcCacheEntry *pdn
dat->text_smiley_height = max(piece->smiley_height, dat->text_smiley_height);
iMaxSmileyHeight = max(piece->smiley_height, iMaxSmileyHeight);
- List_Insert( plText, piece, plText->realCount);
+ List_Insert(plText, piece, plText->realCount);
}
// Add text
{
- ClcContactTextPiece *piece = (ClcContactTextPiece *) mir_alloc(sizeof(ClcContactTextPiece));
+ ClcContactTextPiece *piece = (ClcContactTextPiece *)mir_alloc(sizeof(ClcContactTextPiece));
piece->type = TEXT_PIECE_TYPE_TEXT;
piece->start_pos = 0;
piece->len = text_size;
- List_Insert( plText, piece, plText->realCount);
+ List_Insert(plText, piece, plText->realCount);
}
}
-void CSmileyString::_CopySmileyList( SortedList *plInput )
+void CSmileyString::_CopySmileyList(SortedList *plInput)
{
// ASSERT( plText == NULL );
- if (!plInput || plInput->realCount == 0 ) return;
- plText = List_Create( 0, 1 );
- for ( int i=0; i < plInput->realCount; i++ )
+ if (!plInput || plInput->realCount == 0) return;
+ 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));
+ ClcContactTextPiece *piece = (ClcContactTextPiece *)mir_alloc(sizeof(ClcContactTextPiece));
*piece = *pieceFrom;
- if ( pieceFrom->type == TEXT_PIECE_TYPE_SMILEY)
- piece->smiley = CopyIcon( pieceFrom->smiley );
- List_Insert( plText, piece, plText->realCount );
+ if (pieceFrom->type == TEXT_PIECE_TYPE_SMILEY)
+ piece->smiley = CopyIcon(pieceFrom->smiley);
+ List_Insert(plText, piece, plText->realCount);
}
}
}
@@ -153,17 +153,17 @@ void CSmileyString::DestroySmileyList()
{
//ASSERT( plText == NULL );
- if ( plText == NULL ) return;
+ if (plText == NULL) return;
- if ( IsBadReadPtr( plText, sizeof(SortedList))) {
+ if (IsBadReadPtr(plText, sizeof(SortedList))) {
plText = NULL;
return;
}
- if ( plText->realCount != 0 ) {
- for ( int i=0 ; i < plText->realCount ; i++ ) {
- if ( plText->items[i] != NULL ) {
- ClcContactTextPiece *piece = (ClcContactTextPiece *) plText->items[i];
+ if (plText->realCount != 0) {
+ for (int i = 0; i < plText->realCount; i++) {
+ 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)
@@ -172,7 +172,7 @@ void CSmileyString::DestroySmileyList()
}
}
}
- List_Destroy( plText );
+ List_Destroy(plText);
}
mir_free(plText);
@@ -185,7 +185,7 @@ void CSmileyString::DestroySmileyList()
void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce, TCHAR * szText, BOOL replace_smileys)
{
- SMADD_BATCHPARSE2 sp = {0};
+ SMADD_BATCHPARSE2 sp = { 0 };
SMADD_BATCHPARSERES *spr;
int last_pos = 0;
@@ -196,7 +196,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce,
if (!dat->text_replace_smileys || !replace_smileys || szText == NULL)
return;
- int text_size = (int)_tcslen( szText );
+ int text_size = (int)_tcslen(szText);
// Call service for the first time to see if needs to be used...
sp.cbSize = sizeof(sp);
@@ -204,7 +204,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce,
if (dat->text_use_protocol_smileys) {
sp.Protocolname = pdnce->m_cache_cszProto;
- if (db_get_b(NULL,"CLC","Meta",SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->m_cache_cszProto != NULL && mir_strcmp(pdnce->m_cache_cszProto, META_PROTO) == 0) {
+ if (db_get_b(NULL, "CLC", "Meta", SETTING_USEMETAICON_DEFAULT) != 1 && pdnce->m_cache_cszProto != NULL && mir_strcmp(pdnce->m_cache_cszProto, META_PROTO) == 0) {
MCONTACT hContact = db_mc_getMostOnline(pdnce->hContact);
if (hContact != 0)
sp.Protocolname = GetContactProto(hContact);
@@ -222,16 +222,16 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce,
return;
// Lets add smileys
- plText = List_Create( 0, 1 );
+ plText = List_Create(0, 1);
- for (unsigned i=0; i < sp.numSmileys; ++i) {
+ for (unsigned i = 0; i < sp.numSmileys; ++i) {
if (spr[i].hIcon != NULL) { // For deffective smileypacks
// Add text
if (spr[i].startChar - last_pos > 0) {
- ClcContactTextPiece *piece = (ClcContactTextPiece *) mir_alloc(sizeof(ClcContactTextPiece));
+ ClcContactTextPiece *piece = (ClcContactTextPiece *)mir_alloc(sizeof(ClcContactTextPiece));
piece->type = TEXT_PIECE_TYPE_TEXT;
- piece->start_pos = last_pos ;//sp.str - text;
+ piece->start_pos = last_pos;//sp.str - text;
piece->len = spr[i].startChar - last_pos;
List_Insert(plText, piece, plText->realCount);
}
@@ -240,7 +240,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce,
{
BITMAP bm;
ICONINFO icon;
- ClcContactTextPiece *piece = (ClcContactTextPiece *) mir_alloc(sizeof(ClcContactTextPiece));
+ ClcContactTextPiece *piece = (ClcContactTextPiece *)mir_alloc(sizeof(ClcContactTextPiece));
piece->type = TEXT_PIECE_TYPE_SMILEY;
piece->len = spr[i].size;
@@ -249,7 +249,7 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce,
piece->smiley_width = 16;
piece->smiley_height = 16;
if (GetIconInfo(piece->smiley, &icon)) {
- if (GetObject(icon.hbmColor,sizeof(BITMAP),&bm)) {
+ if (GetObject(icon.hbmColor, sizeof(BITMAP), &bm)) {
piece->smiley_width = bm.bmWidth;
piece->smiley_height = bm.bmHeight;
}
@@ -258,8 +258,8 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce,
DeleteObject(icon.hbmColor);
}
- dat->text_smiley_height = max( piece->smiley_height, dat->text_smiley_height );
- iMaxSmileyHeight = max( piece->smiley_height, iMaxSmileyHeight );
+ dat->text_smiley_height = max(piece->smiley_height, dat->text_smiley_height);
+ iMaxSmileyHeight = max(piece->smiley_height, iMaxSmileyHeight);
List_Insert(plText, piece, plText->realCount);
}
@@ -271,11 +271,11 @@ void CSmileyString::ReplaceSmileys(struct SHORTDATA *dat, ClcCacheEntry *pdnce,
// Add rest of text
if (last_pos < text_size) {
- ClcContactTextPiece *piece = (ClcContactTextPiece *) mir_alloc(sizeof(ClcContactTextPiece));
+ ClcContactTextPiece *piece = (ClcContactTextPiece *)mir_alloc(sizeof(ClcContactTextPiece));
piece->type = TEXT_PIECE_TYPE_TEXT;
piece->start_pos = last_pos;
- piece->len = text_size-last_pos;
+ piece->len = text_size - last_pos;
List_Insert(plText, piece, plText->realCount);
}
@@ -417,17 +417,17 @@ int Cache_GetLineText(
return TEXT_EMPTY;
text[0] = '\0';
- switch(type) {
+ 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 (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusMsg", &dbv)) {
if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0) {
TCHAR *tmp = NEWTSTR_ALLOCA(text);
mir_sntprintf(text, text_size, _T("%s: %s"), tmp, dbv.ptszVal);
- CopySkipUnprintableChars(text, text, text_size-1);
+ CopySkipUnprintableChars(text, text, text_size - 1);
}
db_free(&dbv);
}
@@ -437,11 +437,11 @@ int Cache_GetLineText(
case TEXT_NICKNAME:
if (pdnce->hContact && pdnce->m_cache_cszProto) {
- DBVARIANT dbv = {0};
+ DBVARIANT dbv = { 0 };
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "Nick", &dbv)) {
mir_tstrncpy(text, dbv.ptszVal, text_size);
db_free(&dbv);
- CopySkipUnprintableChars(text, text, text_size-1);
+ CopySkipUnprintableChars(text, text, text_size - 1);
}
}
@@ -449,7 +449,7 @@ int Cache_GetLineText(
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 (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
@@ -457,17 +457,17 @@ int Cache_GetLineText(
TCHAR *tmp = NEWTSTR_ALLOCA(text);
mir_sntprintf(text, text_size, _T("%s: %s"), dbv.pszVal, tmp);
}
- CopySkipUnprintableChars(text, text, text_size-1);
+ CopySkipUnprintableChars(text, text, text_size - 1);
db_free(&dbv);
}
}
else if (use_name_and_message_for_xstatus && xstatus_has_priority) {
- DBVARIANT dbv = {0};
+ DBVARIANT dbv = { 0 };
// Try to get XStatusName
if (!db_get_ts(pdnce->hContact, pdnce->m_cache_cszProto, "XStatusName", &dbv)) {
if (dbv.ptszVal != NULL && dbv.ptszVal[0] != 0)
_tcsncpy_s(text, text_size, dbv.ptszVal, _TRUNCATE);
- CopySkipUnprintableChars(text, text, text_size-1);
+ CopySkipUnprintableChars(text, text, text_size - 1);
db_free(&dbv);
}
}
@@ -491,19 +491,19 @@ int Cache_GetLineText(
return TEXT_LISTENING_TO;
case TEXT_TEXT:
- {
- TCHAR *tmp = variables_parsedup(variable_text, pdnce->tszName, pdnce->hContact);
- mir_tstrncpy(text, tmp, text_size);
- mir_free(tmp);
- CopySkipUnprintableChars(text, text, text_size-1);
- }
- return TEXT_TEXT;
+ {
+ TCHAR *tmp = variables_parsedup(variable_text, pdnce->tszName, pdnce->hContact);
+ mir_tstrncpy(text, tmp, text_size);
+ mir_free(tmp);
+ CopySkipUnprintableChars(text, text, text_size - 1);
+ }
+ return TEXT_TEXT;
case TEXT_CONTACT_TIME:
if (pdnce->hTimeZone) {
// Get pdnce time
text[0] = 0;
- tmi.printDateTime( pdnce->hTimeZone, _T("t"), text, text_size, 0);
+ tmi.printDateTime(pdnce->hTimeZone, _T("t"), text, text_size, 0);
}
return TEXT_CONTACT_TIME;
@@ -553,14 +553,14 @@ void Cache_GetFirstLineText(ClcData *dat, ClcContact *contact)
void Cache_GetSecondLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce)
{
- TCHAR Text[240-EXTRA_ICON_COUNT] = {0};
+ TCHAR Text[240 - EXTRA_ICON_COUNT] = { 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_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] = 0; //to be sure that it is null terminated string
+ Text[SIZEOF(Text) - 1] = 0; //to be sure that it is null terminated string
mir_free(pdnce->szSecondLineText);
@@ -571,7 +571,7 @@ void Cache_GetSecondLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce)
if (pdnce->szSecondLineText) {
if (type == TEXT_LISTENING_TO && pdnce->szSecondLineText[0] != _T('\0'))
- pdnce->ssSecondLine.AddListeningToIcon(dat, pdnce, pdnce->szSecondLineText, dat->second_line_draw_smileys);
+ pdnce->ssSecondLine.AddListeningToIcon(dat, pdnce->szSecondLineText);
else
pdnce->ssSecondLine.ReplaceSmileys(dat, pdnce, pdnce->szSecondLineText, dat->second_line_draw_smileys);
}
@@ -582,14 +582,14 @@ void Cache_GetSecondLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce)
*/
void Cache_GetThirdLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce)
{
- TCHAR Text[240-EXTRA_ICON_COUNT] = {0};
+ TCHAR Text[240 - EXTRA_ICON_COUNT] = { 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,
- dat->third_line_xstatus_has_priority,dat->third_line_show_status_if_no_away,dat->third_line_show_listening_if_no_away,
+ type = Cache_GetLineText(pdnce, dat->third_line_type, (TCHAR*)Text, SIZEOF(Text), dat->third_line_text,
+ dat->third_line_xstatus_has_priority, dat->third_line_show_status_if_no_away, dat->third_line_show_listening_if_no_away,
dat->third_line_use_name_and_message_for_xstatus, dat->contact_time_show_only_if_different);
- Text[SIZEOF(Text)-1] = 0; //to be sure that it is null terminated string
+ Text[SIZEOF(Text) - 1] = 0; //to be sure that it is null terminated string
mir_free(pdnce->szThirdLineText);
@@ -600,7 +600,7 @@ void Cache_GetThirdLineText(struct SHORTDATA *dat, ClcCacheEntry *pdnce)
if (pdnce->szThirdLineText) {
if (type == TEXT_LISTENING_TO && pdnce->szThirdLineText[0] != _T('\0'))
- pdnce->ssThirdLine.AddListeningToIcon(dat, pdnce, pdnce->szThirdLineText, dat->third_line_draw_smileys);
+ pdnce->ssThirdLine.AddListeningToIcon(dat, pdnce->szThirdLineText);
else
pdnce->ssThirdLine.ReplaceSmileys(dat, pdnce, pdnce->szThirdLineText, dat->third_line_draw_smileys);
}
@@ -610,10 +610,10 @@ 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)) {
+ int lastsize = (int)_tcslen(to) + 1;
+ while (st = _tcsstr(st, tag)) {
lastsize -= len;
- memmove((void*)st,(void*)(st+len),(lastsize)*sizeof(TCHAR));
+ memmove((void*)st, (void*)(st + len), (lastsize)*sizeof(TCHAR));
}
}
@@ -632,7 +632,7 @@ static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size)
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] < ' ') {
*cp = ' ';
@@ -648,21 +648,21 @@ static int CopySkipUnprintableChars(TCHAR *to, TCHAR * buf, DWORD size)
*cp = 0;
//remove bbcodes: [b] [i] [u] <b> <i> <u>
- RemoveTag(to,_T("[b]")); RemoveTag(to,_T("[/b]"));
- RemoveTag(to,_T("[u]")); RemoveTag(to,_T("[/u]"));
- RemoveTag(to,_T("[i]")); RemoveTag(to,_T("[/i]"));
+ RemoveTag(to, _T("[b]")); RemoveTag(to, _T("[/b]"));
+ RemoveTag(to, _T("[u]")); RemoveTag(to, _T("[/u]"));
+ RemoveTag(to, _T("[i]")); RemoveTag(to, _T("[/i]"));
- RemoveTag(to,_T("<b>")); RemoveTag(to,_T("</b>"));
- RemoveTag(to,_T("<u>")); RemoveTag(to,_T("</u>"));
- RemoveTag(to,_T("<i>")); RemoveTag(to,_T("</i>"));
+ RemoveTag(to, _T("<b>")); RemoveTag(to, _T("</b>"));
+ RemoveTag(to, _T("<u>")); RemoveTag(to, _T("</u>"));
+ RemoveTag(to, _T("<i>")); RemoveTag(to, _T("</i>"));
- 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;
}
@@ -680,16 +680,16 @@ static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFun
if (!group)
return TRUE;
- for (int scanIndex = 0 ; scanIndex < group->cl.count ; scanIndex++) {
+ for (int scanIndex = 0; scanIndex < group->cl.count; scanIndex++) {
if (group->cl.items[scanIndex]->type == CLCIT_CONTACT) {
if (!func(group->cl.items[scanIndex], FALSE, param))
return FALSE;
if (group->cl.items[scanIndex]->SubAllocated > 0) {
- for (int i=0 ; i < group->cl.items[scanIndex]->SubAllocated ; i++)
+ for (int i = 0; i < group->cl.items[scanIndex]->SubAllocated; i++)
if (!func(&group->cl.items[scanIndex]->subcontacts[i], TRUE, param))
return FALSE;
- }
+ }
}
else if (group->cl.items[scanIndex]->type == CLCIT_GROUP)
if (!ExecuteOnAllContactsOfGroup(group->cl.items[scanIndex]->group, func, param))
@@ -703,7 +703,7 @@ static BOOL ExecuteOnAllContactsOfGroup(ClcGroup *group, ExecuteOnAllContactsFun
/*
* Avatar working routines
*/
-BOOL UpdateAllAvatarsProxy(ClcContact *contact, BOOL subcontact, void *param)
+BOOL UpdateAllAvatarsProxy(ClcContact *contact, BOOL, void *param)
{
Cache_GetAvatar((ClcData *)param, contact);
return TRUE;
@@ -711,10 +711,10 @@ BOOL UpdateAllAvatarsProxy(ClcContact *contact, BOOL subcontact, void *param)
void UpdateAllAvatars(ClcData *dat)
{
- ExecuteOnAllContacts(dat,UpdateAllAvatarsProxy,dat);
+ ExecuteOnAllContacts(dat, UpdateAllAvatarsProxy, dat);
}
-BOOL ReduceAvatarPosition(ClcContact *contact, BOOL subcontact, void *param)
+BOOL ReduceAvatarPosition(ClcContact *contact, BOOL, void *param)
{
if (contact->avatar_pos >= *((int *)param))
contact->avatar_pos--;
@@ -742,10 +742,9 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact)
// Make bounds -> keep aspect radio
LONG width_clip;
LONG height_clip;
- RECT rc = {0};
// Clipping width and height
- width_clip = dat->avatars_maxwidth_size?dat->avatars_maxwidth_size:dat->avatars_maxheight_size;
+ width_clip = dat->avatars_maxwidth_size ? dat->avatars_maxwidth_size : dat->avatars_maxheight_size;
height_clip = dat->avatars_maxheight_size;
if (height_clip * ace->bmWidth / ace->bmHeight <= width_clip)
@@ -753,7 +752,7 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact)
else
height_clip = width_clip * ace->bmHeight / ace->bmWidth;
- if (wildcmpit(contact->avatar_data->szFilename,_T("*.gif"))) {
+ if (wildcmpit(contact->avatar_data->szFilename, _T("*.gif"))) {
if (old_pos == AVATAR_POS_ANIMATED)
AniAva_RemoveAvatar(contact->hContact);
@@ -769,17 +768,15 @@ void Cache_ProceedAvatarInList(ClcData *dat, ClcContact *contact)
// Create objs
void * pt;
HDC hdc = CreateCompatibleDC(dat->avatar_cache.hdc);
- HBITMAP hDrawBmp = ske_CreateDIB32Point(width_clip, height_clip,&pt);
+ HBITMAP hDrawBmp = ske_CreateDIB32Point(width_clip, height_clip, &pt);
HBITMAP oldBmp = (HBITMAP)SelectObject(hdc, hDrawBmp);
//need to draw avatar bitmap here
{
- RECT real_rc = {0, 0, width_clip, height_clip};
-
int w = width_clip;
int h = height_clip;
- DrawAvatarImageWithGDIp(hdc, 0, 0, w, h,ace->hbmPic, 0, 0, ace->bmWidth,ace->bmHeight,ace->dwFlags,255);
+ DrawAvatarImageWithGDIp(hdc, 0, 0, w, h, ace->hbmPic, 0, 0, ace->bmWidth, ace->bmHeight, ace->dwFlags, 255);
}
- SelectObject(hdc,oldBmp);
+ SelectObject(hdc, oldBmp);
DeleteDC(hdc);
// Add to list
if (old_pos >= 0) {
@@ -823,19 +820,19 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact)
if (dat->avatars_show && !db_get_b(contact->hContact, "CList", "HideContactAvatar", 0)) {
DBVARIANT dbv;
if (!db_get_ts(contact->hContact, "ContactPhoto", "File", &dbv)) {
- HBITMAP hBmp = (HBITMAP) CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
+ HBITMAP hBmp = (HBITMAP)CallService(MS_UTILS_LOADBITMAPT, 0, (LPARAM)dbv.ptszVal);
if (hBmp != NULL) {
// Make bounds
BITMAP bm;
- if (GetObject(hBmp,sizeof(BITMAP),&bm)) {
+ if (GetObject(hBmp, sizeof(BITMAP), &bm)) {
// Create data...
HDC hdc;
- HBITMAP hDrawBmp,oldBmp;
+ HBITMAP hDrawBmp, oldBmp;
// Make bounds -> keep aspect radio
LONG width_clip;
LONG height_clip;
- RECT rc = {0};
+ RECT rc = { 0 };
// Clipping width and height
width_clip = dat->avatars_maxheight_size;
@@ -850,7 +847,7 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact)
hdc = CreateCompatibleDC(dat->avatar_cache.hdc);
hDrawBmp = ske_CreateDIB32(width_clip, height_clip);
oldBmp = (HBITMAP)SelectObject(hdc, hDrawBmp);
- SetBkMode(hdc,TRANSPARENT);
+ SetBkMode(hdc, TRANSPARENT);
POINT org;
GetBrushOrgEx(hdc, &org);
@@ -863,17 +860,17 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact)
// Draw bitmap 8//8
HDC dcMem = CreateCompatibleDC(hdc);
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);
+ StretchBlt(hdc, 0, 0, width_clip, height_clip, dcMem, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
+ SelectObject(dcMem, obmp);
DeleteDC(dcMem);
- RECT rtr = {0};
- rtr.right = width_clip+1;
- rtr.bottom = height_clip+1;
- ske_SetRectOpaque(hdc,&rtr);
+ RECT rtr = { 0 };
+ rtr.right = width_clip + 1;
+ rtr.bottom = height_clip + 1;
+ ske_SetRectOpaque(hdc, &rtr);
hDrawBmp = (HBITMAP)GetCurrentObject(hdc, OBJ_BITMAP);
- SelectObject(hdc,oldBmp);
+ SelectObject(hdc, oldBmp);
DeleteDC(hdc);
// Add to list
@@ -899,6 +896,6 @@ void Cache_GetAvatar(ClcData *dat, ClcContact *contact)
}
if (old_pos == AVATAR_POS_ANIMATED && contact->avatar_pos != AVATAR_POS_ANIMATED)
- AniAva_RemoveAvatar( contact->hContact );
+ AniAva_RemoveAvatar(contact->hContact);
}
}
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index 873020a36c..aaee2ee62f 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -62,13 +62,13 @@ static int clcProceedDragToScroll(HWND hwnd, int Y);
static int clcExitDragToScroll();
-int ReloadSkinFolder(WPARAM wParam, LPARAM lParam)
+int ReloadSkinFolder(WPARAM, LPARAM)
{
FoldersGetCustomPathT(hSkinFolder, SkinsFolder, SIZEOF(SkinsFolder), _T(DEFAULT_SKIN_FOLDER));
return 0;
}
-static int clcHookModulesLoaded(WPARAM wParam, LPARAM lParam)
+static int clcHookModulesLoaded(WPARAM, LPARAM)
{
if (MirandaExiting())
return 0;
@@ -141,7 +141,7 @@ static int clcHookModulesLoaded(WPARAM wParam, LPARAM lParam)
return 0;
}
-static int clcHookSmileyAddOptionsChanged(WPARAM wParam, LPARAM lParam)
+static int clcHookSmileyAddOptionsChanged(WPARAM, LPARAM)
{
if (MirandaExiting()) return 0;
pcli->pfnClcBroadcast(CLM_AUTOREBUILD, 0, 0);
@@ -154,7 +154,7 @@ static int clcHookProtoAck(WPARAM wParam, LPARAM lParam)
return ClcDoProtoAck(wParam, (ACKDATA*)lParam);
}
-static int clcHookIconsChanged(WPARAM wParam, LPARAM lParam)
+static int clcHookIconsChanged(WPARAM, LPARAM)
{
int i;
if (MirandaExiting()) return 0;
@@ -190,7 +190,7 @@ static int clcMetaModeChanged(WPARAM, LPARAM)
return 0;
}
-static int clcMetacontactChanged(WPARAM hMeta, LPARAM)
+static int clcMetacontactChanged(WPARAM, LPARAM)
{
pcli->pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0);
return 0;
@@ -355,7 +355,7 @@ static int clcSearchNextContact(HWND hwnd, ClcData *dat, int index, const TCHAR
return -1;
}
-static BOOL clcItemNotHiddenOffline(ClcData *dat, ClcGroup* group, ClcContact *contact)
+static BOOL clcItemNotHiddenOffline(ClcGroup *group, ClcContact *contact)
{
if (g_CluiData.bFilterEffective) return FALSE;
@@ -414,12 +414,12 @@ static LRESULT clcOnCreate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPA
return 0;
}
-static LRESULT clcOnHitTest(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnHitTest(ClcData *, HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)
{
return DefWindowProc(hwnd, WM_NCHITTEST, wParam, lParam);
}
-static LRESULT clcOnCommand(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnCommand(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM)
{
ClcContact *contact;
int hit = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, NULL);
@@ -510,7 +510,7 @@ static LRESULT clcOnChar(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARA
{
if (wParam == 27 && dat->szQuickSearch[0] == '\0') { //escape and not quick search
// minimize clist
- CListMod_HideWindow(pcli->hwndContactList, SW_HIDE);
+ CListMod_HideWindow();
}
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
@@ -528,12 +528,12 @@ static LRESULT clcOnPaint(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR
return DefWindowProc(hwnd, msg, wParam, lParam);
}
-static LRESULT clcOnEraseBkGround(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnEraseBkGround(ClcData *, HWND, UINT, WPARAM, LPARAM)
{
return 1;
}
-static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnKeyDown(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)
{
if (wParam == VK_CONTROL)
return 0;
@@ -715,10 +715,10 @@ void clcSetDelayTimer(UINT_PTR uIDEvent, HWND hwnd, int nDelay)
int delay = nDelay;
if (delay == -1) {
switch (uIDEvent) {
- case TIMERID_DELAYEDRESORTCLC: delay = 10; break;
- case TIMERID_RECALCSCROLLBAR: delay = 10; break;
- case TIMERID_REBUILDAFTER: delay = 50; break;
- default: delay = 100; break;
+ case TIMERID_DELAYEDRESORTCLC: delay = 10; break;
+ case TIMERID_RECALCSCROLLBAR: delay = 10; break;
+ case TIMERID_REBUILDAFTER: delay = 50; break;
+ default: delay = 100; break;
}
}
CLUI_SafeSetTimer(hwnd, uIDEvent, delay, NULL);
@@ -734,14 +734,14 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
case TIMERID_INVALIDATE:
- {
- 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;
- }
+ {
+ 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;
}
- return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
+ }
+ return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
case TIMERID_SUBEXPAND:
KillTimer(hwnd, TIMERID_SUBEXPAND);
@@ -785,7 +785,6 @@ static LRESULT clcOnTimer(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPAR
default:
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
- return 0;
}
@@ -801,7 +800,7 @@ static LRESULT clcOnActivate(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, L
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
-static LRESULT clcOnSetCursor(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnSetCursor(ClcData *, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (!CLUI_IsInMainWindow(hwnd))
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -810,13 +809,13 @@ static LRESULT clcOnSetCursor(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
CLUI_ShowFromBehindEdge();
if (g_CluiData.bBehindEdgeSettings)
- CLUI_UpdateTimer(0);
+ CLUI_UpdateTimer();
int lResult = CLUI_TestCursorOnBorders();
return lResult ? lResult : DefWindowProc(hwnd, msg, wParam, lParam);
}
-static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lParam)
{
POINT pt = { LOWORD(lParam), HIWORD(lParam) };
ClientToScreen(hwnd, &pt);
@@ -866,8 +865,6 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam
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);
-
hitcontact = contact;
HitPoint.x = (short)LOWORD(lParam);
HitPoint.y = (short)HIWORD(lParam);
@@ -954,7 +951,7 @@ static LRESULT clcOnLButtonDown(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam
return TRUE;
}
-static LRESULT clcOnCaptureChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnCaptureChanged(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM lParam)
{
if ((HWND)lParam != hwnd) {
if (dat->iHotTrack != -1) {
@@ -968,12 +965,12 @@ static LRESULT clcOnCaptureChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wPa
return 0;
}
-static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)
{
BOOL isOutside = FALSE;
if (CLUI_IsInMainWindow(hwnd)) {
if (g_CluiData.bBehindEdgeSettings)
- CLUI_UpdateTimer(0);
+ CLUI_UpdateTimer();
CLUI_TestCursorOnBorders();
}
@@ -1240,7 +1237,6 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
}
else {
hcontact = contSour->hContact;
- MCONTACT hfrom = contSour->subcontacts->hContact;
MCONTACT 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);
int res = MessageBox(hwnd, Wording, TranslateT("Converting to metacontact (moving)"), MB_OKCANCEL | MB_ICONQUESTION);
@@ -1285,7 +1281,6 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
}
else {
MCONTACT hcontact = contSour->hContact;
- MCONTACT hfrom = contSour->subcontacts->hContact;
MCONTACT 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);
int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION);
@@ -1316,13 +1311,12 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
if (res == 1) {
if (!handle)
return 0;
-
+
CallService(MS_MC_ADDTOMETA, hcontact, handle);
}
}
else if (contSour->subcontacts != contDest->subcontacts) {
MCONTACT hcontact = contSour->hContact;
- MCONTACT hfrom = contSour->subcontacts->hContact;
MCONTACT 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);
int res = MessageBox(hwnd, Wording, TranslateT("Changing metacontacts (moving)"), MB_OKCANCEL | MB_ICONQUESTION);
@@ -1342,39 +1336,38 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
break;
case DROPTARGET_INSERTION:
- {
- ClcContact *contact, *destcontact;
- ClcGroup *group, *destgroup;
- BOOL NeedRename = FALSE;
- TCHAR newName[128] = { 0 };
- pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
- int 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));
- if (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;
- if (sourceGrName)
- mir_sntprintf(newName, SIZEOF(newName), _T("%s\\%s"), sourceGrName, shortGroup);
- else
- _tcsncpy_s(newName, shortGroup, _TRUNCATE);
- }
- mir_free(groupName);
- mir_free(sourceGrName);
+ {
+ ClcContact *contact, *destcontact;
+ ClcGroup *group, *destgroup;
+ BOOL NeedRename = FALSE;
+ TCHAR newName[128] = { 0 };
+ pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
+ int 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));
+ if (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;
+ if (sourceGrName)
+ mir_sntprintf(newName, SIZEOF(newName), _T("%s\\%s"), sourceGrName, shortGroup);
+ else
+ _tcsncpy_s(newName, shortGroup, _TRUNCATE);
}
- int newIndex = CallService(MS_CLIST_GROUPMOVEBEFORE, contact->groupId, (destcontact && i != -1) ? destcontact->groupId : 0);
- newIndex = newIndex ? newIndex : contact->groupId;
- if (NeedRename) pcli->pfnRenameGroup(newIndex, newName);
+ mir_free(groupName);
+ mir_free(sourceGrName);
}
- break;
+ int 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;
case DROPTARGET_OUTSIDE:
corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
@@ -1392,7 +1385,7 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam,
return 0;
}
-static LRESULT clcOnLButtonDblClick(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnLButtonDblClick(ClcData *, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
KillTimer(hwnd, TIMERID_SUBEXPAND);
hitcontact = NULL;
@@ -1427,7 +1420,7 @@ static LRESULT clcOnDestroy(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LP
return 0;
}
-static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM)
{
WORD iExtraImage[EXTRA_ICON_COUNT];
BYTE flags = 0;
@@ -1460,13 +1453,12 @@ static LRESULT clcOnIntmGroupChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM w
return 0;
}
-static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)
{
ClcContact *contact = NULL;
ClcGroup *group = NULL;
int recalcScrollBar = 0, shouldShow;
BOOL needRepaint = FALSE;
- RECT iconRect = { 0 };
int contacticon = corecli.pfnGetContactIcon(wParam);
MCONTACT hSelItem = NULL;
ClcContact *selcontact = NULL;
@@ -1508,7 +1500,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
if (contact && contact->iImage == lParam)
return 0;
- if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline) && clcItemNotHiddenOffline(dat, group, contact))
+ if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline) && clcItemNotHiddenOffline(group, contact))
shouldShow = TRUE;
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) { // CLVM changed
@@ -1558,7 +1550,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
return 0;
}
-static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnIntmAvatarChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPARAM)
{
ClcContact *contact;
if (FindItem(hwnd, dat, wParam, &contact, NULL, NULL, FALSE))
@@ -1605,7 +1597,7 @@ static LRESULT clcOnIntmNameChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wP
return ret;
}
-static LRESULT clcOnIntmApparentModeChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnIntmApparentModeChanged(ClcData *, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
@@ -1647,7 +1639,7 @@ static LRESULT clcOnIntmNotOnListChanged(ClcData *dat, HWND hwnd, UINT msg, WPAR
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
-static LRESULT clcOnIntmScrollBarChanged(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT clcOnIntmScrollBarChanged(ClcData *dat, HWND hwnd, UINT, WPARAM, LPARAM)
{
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_CONTACTLIST) {
if (dat->noVScrollbar)
@@ -1726,7 +1718,7 @@ int ClcUnloadModule()
return 0;
}
-int ClcDoProtoAck(MCONTACT wParam, ACKDATA * ack)
+int ClcDoProtoAck(MCONTACT, ACKDATA * ack)
{
if (MirandaExiting()) return 0;
if (ack->type == ACKTYPE_STATUS) {
@@ -1789,7 +1781,7 @@ int ClcGetShortData(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;
@@ -1884,5 +1876,4 @@ LRESULT CALLBACK cli_ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wPara
default:
return corecli.pfnContactListControlWndProc(hwnd, msg, wParam, lParam);
}
- return TRUE;
}
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp
index 85d3e3e969..fb0267c648 100644
--- a/plugins/Clist_modern/src/modern_clcidents.cpp
+++ b/plugins/Clist_modern/src/modern_clcidents.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hdr/modern_commonprototypes.h"
#define CacheArrSize 255
-ClcGroup *CacheIndex[CacheArrSize] = {NULL};
+ClcGroup *CacheIndex[CacheArrSize] = { NULL };
bool CacheIndexClear = TRUE;
/* the CLC uses 3 different ways to identify elements in its list, this file
@@ -47,19 +47,19 @@ exclusively externally
2->1: GetRowByIndex()
*/
-int GetContactIndex(ClcGroup *group,ClcContact *contact)
+int GetContactIndex(ClcGroup *group, ClcContact *contact)
{
- for (int i=0; i < group->cl.count; i++)
+ for (int i = 0; i < group->cl.count; i++)
if (group->cl.items[i]->hContact == contact->hContact) return i;
return -1;
}
-int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex)
+int cliGetRowsPriorTo(ClcGroup *group, ClcGroup *subgroup, int contactIndex)
{
int count = 0;
BYTE k;
int subcontactscount = 0;
- k = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
+ k = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
group->scanIndex = 0;
for (;;) {
if (group->scanIndex == group->cl.count) {
@@ -68,7 +68,7 @@ int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex)
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)) {
@@ -77,7 +77,7 @@ int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex)
*/
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
if (group->cl.items[group->scanIndex]->group == subgroup && contactIndex == -1)
- return count-1;
+ return count - 1;
if (group->cl.items[group->scanIndex]->group->expanded) {
group = group->cl.items[group->scanIndex]->group;
group->scanIndex = 0;
@@ -90,8 +90,8 @@ int cliGetRowsPriorTo(ClcGroup *group,ClcGroup *subgroup,int contactIndex)
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)
- return count+(contactIndex-group->scanIndex)-1;
+ if (group->scanIndex + rows >= contactIndex)
+ return count + (contactIndex - group->scanIndex) - 1;
}
}
if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT)
@@ -124,7 +124,7 @@ int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGro
group = group->parent;
if (group == NULL)
break;
-
+
nowVisible = 1;
for (tgroup = group; tgroup; tgroup = tgroup->parent) {
if (!tgroup->expanded) {
@@ -136,20 +136,20 @@ int FindItem(HWND hwnd, ClcData *dat, DWORD dwItem, ClcContact **contact, ClcGro
continue;
}
if (nowVisible) index++;
- if ((IsHContactGroup(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) ||
- (IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == dwItem) ||
- (IsHContactInfo(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (dwItem & ~HCONTACT_ISINFO)))
+ if ((IsHContactGroup(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_GROUP && (dwItem & ~HCONTACT_ISGROUP) == group->cl.items[group->scanIndex]->groupId) ||
+ (IsHContactContact(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->hContact == dwItem) ||
+ (IsHContactInfo(dwItem) && group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->hContact == (dwItem & ~HCONTACT_ISINFO)))
{
if (isVisible) {
if (!nowVisible) *isVisible = 0;
else {
- int posy = cliGetRowTopY(dat,index+1);
+ int posy = cliGetRowTopY(dat, index + 1);
if (posy < dat->yScroll)
*isVisible = 0;
else {
RECT clRect;
- GetClientRect(hwnd,&clRect);
- if (posy >= dat->yScroll+clRect.bottom) *isVisible = 0;
+ GetClientRect(hwnd, &clRect);
+ if (posy >= dat->yScroll + clRect.bottom) *isVisible = 0;
else *isVisible = 1;
}
}
@@ -193,7 +193,7 @@ void ClearRowByIndexCache()
}
}
-int cliGetRowByIndex(ClcData *dat,int testindex,ClcContact **contact,ClcGroup **subgroup)
+int cliGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup)
{
int index = 0, i;
ClcGroup *group = &dat->list;
@@ -208,7 +208,7 @@ int cliGetRowByIndex(ClcData *dat,int testindex,ClcContact **contact,ClcGroup **
group->scanIndex++;
continue;
}
-
+
if (index > 0 && index < CacheArrSize) {
CacheIndex[index] = group;
CacheIndexClear = FALSE;
@@ -221,25 +221,25 @@ int cliGetRowByIndex(ClcData *dat,int testindex,ClcContact **contact,ClcGroup **
}
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++) {
- if ((index>0) && (index < CacheArrSize)) {
- CacheIndex[index] = group;
- CacheIndexClear = FALSE;
- }
- index++;
- if (testindex == index) {
- if (contact) {
- *contact = &group->cl.items[group->scanIndex]->subcontacts[i];
- (*contact)->subcontacts = group->cl.items[group->scanIndex];
- }
+ 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++) {
+ if ((index>0) && (index < CacheArrSize)) {
+ CacheIndex[index] = group;
+ CacheIndexClear = FALSE;
+ }
+ index++;
+ if (testindex == index) {
+ if (contact) {
+ *contact = &group->cl.items[group->scanIndex]->subcontacts[i];
+ (*contact)->subcontacts = group->cl.items[group->scanIndex];
+ }
- if (subgroup) *subgroup = group;
- return index;
+ if (subgroup) *subgroup = group;
+ return index;
+ }
+ }
}
- }
- }
index++;
if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) {
@@ -254,20 +254,20 @@ int cliGetRowByIndex(ClcData *dat,int testindex,ClcContact **contact,ClcGroup **
HANDLE ContactToHItem(ClcContact *contact)
{
- switch(contact->type) {
+ switch (contact->type) {
case CLCIT_CONTACT:
return (HANDLE)contact->hContact;
case CLCIT_GROUP:
- return (HANDLE)(contact->groupId|HCONTACT_ISGROUP);
+ return (HANDLE)(contact->groupId | HCONTACT_ISGROUP);
case CLCIT_INFO:
- return (HANDLE)((DWORD_PTR)contact->hContact|HCONTACT_ISINFO);
+ return (HANDLE)((DWORD_PTR)contact->hContact | HCONTACT_ISINFO);
}
return NULL;
}
-HANDLE ContactToItemHandle(ClcContact *contact,DWORD *nmFlags)
+HANDLE ContactToItemHandle(ClcContact *contact, DWORD *nmFlags)
{
- switch(contact->type) {
+ switch (contact->type) {
case CLCIT_CONTACT:
return (HANDLE)contact->hContact;
case CLCIT_GROUP:
@@ -275,7 +275,7 @@ HANDLE ContactToItemHandle(ClcContact *contact,DWORD *nmFlags)
return (HANDLE)contact->groupId;
case CLCIT_INFO:
if (nmFlags) *nmFlags |= CLNF_ISINFO;
- return (HANDLE)((DWORD_PTR)contact->hContact|HCONTACT_ISINFO);
+ return (HANDLE)((DWORD_PTR)contact->hContact | HCONTACT_ISINFO);
}
return NULL;
} \ No newline at end of file
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 3823497854..7d2bf66c8d 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -153,7 +153,7 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat,
{
if (!cont)
return;
-
+
cont->type = CLCIT_CONTACT;
cont->SubAllocated = 0;
cont->isSubcontact = 0;
@@ -184,7 +184,7 @@ static void _LoadDataToContact(ClcContact *cont, ClcGroup *group, ClcData *dat,
break;
default:
cont->flags |= CONTACTF_VISTO | CONTACTF_INVISTO;
- }
+ }
if (cacheEntry->NotOnList)
cont->flags |= CONTACTF_NOTONLIST;
@@ -225,7 +225,7 @@ static ClcContact* AddContactToGroup(ClcData *dat, ClcGroup *group, ClcCacheEntr
return group->cl.items[i];
}
-void* AddTempGroup(HWND hwnd, ClcData *dat, const TCHAR *szName, DWORD flags, int groupId, int calcTotalMembers)
+void* AddTempGroup(HWND hwnd, ClcData *dat, const TCHAR *szName)
{
int i = 0;
int f = 0;
@@ -242,9 +242,9 @@ void* AddTempGroup(HWND hwnd, ClcData *dat, const TCHAR *szName, DWORD flags, in
if (f)
return NULL;
-
+
char buf[20];
- _itoa_s(i-1, buf, 10);
+ _itoa_s(i - 1, buf, 10);
TCHAR b2[255];
mir_sntprintf(b2, SIZEOF(b2), _T("#%s"), szName);
@@ -326,7 +326,7 @@ int RestoreSelection(ClcData *dat, MCONTACT hSelected)
void cliRebuildEntireList(HWND hwnd, ClcData *dat)
{
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
- ClcGroup *group;
+ ClcGroup *group = NULL;
static int rebuildCounter = 0;
BOOL PlaceOfflineToRoot = db_get_b(NULL, "CList", "PlaceOfflineToRoot", SETTING_PLACEOFFLINETOROOT_DEFAULT);
@@ -371,7 +371,7 @@ void cliRebuildEntireList(HWND hwnd, ClcData *dat)
WORD wStatus = pdnce___GetStatus(cacheEntry);
if (wStatus == ID_STATUS_OFFLINE && PlaceOfflineToRoot)
group = &dat->list;
-
+
group->totalMembers++;
if (!(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline)) {
@@ -441,10 +441,10 @@ int GetNewSelection(ClcGroup *group, int selection, int direction)
group->scanIndex++;
continue;
}
-
+
if (count >= selection)
return count;
-
+
lastcount = count;
count++;
if (!direction && count > selection)
diff --git a/plugins/Clist_modern/src/modern_clcmsgs.cpp b/plugins/Clist_modern/src/modern_clcmsgs.cpp
index 5ea6fac23b..3c37af72c4 100644
--- a/plugins/Clist_modern/src/modern_clcmsgs.cpp
+++ b/plugins/Clist_modern/src/modern_clcmsgs.cpp
@@ -28,12 +28,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//processing of all the CLM_ messages incoming
-LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wParam, LPARAM lParam)
+LRESULT cli_ProcessExternalMessages(HWND hwnd, ClcData *dat, UINT msg, WPARAM wParam, LPARAM lParam)
{
- ClcContact *contact;
- ClcGroup *group;
+ ClcContact *contact = NULL;
+ ClcGroup *group = NULL;
- switch(msg) {
+ switch (msg) {
case CLM_DELETEITEM:
pcli->pfnDeleteItemFromTree(hwnd, wParam);
clcSetDelayTimer(TIMERID_DELAYEDRESORTCLC, hwnd, 1); //pcli->pfnSortCLC(hwnd, dat, 1);
@@ -50,7 +50,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
return 0;
case CLM_SETFONT:
- if (HIWORD(lParam)>FONTID_MODERN_MAX) return 0;
+ if (HIWORD(lParam) > FONTID_MODERN_MAX) return 0;
dat->fontModernInfo[HIWORD(lParam)].hFont = (HFONT)wParam;
dat->fontModernInfo[HIWORD(lParam)].changed = 1;
@@ -58,21 +58,21 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
RowHeights_GetMaxRowHeight(dat, hwnd);
if (LOWORD(lParam))
- CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
+ CLUI__cliInvalidateRect(hwnd, NULL, FALSE);
return 0;
case CLM_SETHIDEEMPTYGROUPS:
- {
- BOOL old = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
- if (wParam)
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_HIDEEMPTYGROUPS);
- else
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) &~ CLS_HIDEEMPTYGROUPS);
- BOOL newval = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
- if (newval != old)
- pcli->pfnInitAutoRebuild(hwnd);
- }
- return 0;
+ {
+ BOOL old = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
+ if (wParam)
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | CLS_HIDEEMPTYGROUPS);
+ else
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) &~CLS_HIDEEMPTYGROUPS);
+ BOOL newval = ((GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) != 0);
+ if (newval != old)
+ pcli->pfnInitAutoRebuild(hwnd);
+ }
+ return 0;
case CLM_SETTEXTCOLOR:
if (wParam > FONTID_MODERN_MAX) break;
@@ -81,7 +81,7 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
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 ) {
+ switch (wParam) {
case FONTID_CONTACTS:
dat->fontModernInfo[FONTID_SECONDLINE].colour = lParam;
dat->fontModernInfo[FONTID_THIRDLINE].colour = lParam;
@@ -105,113 +105,110 @@ LRESULT cli_ProcessExternalMessages(HWND hwnd,ClcData *dat,UINT msg,WPARAM wPara
return 0;
case CLM_GETNEXTITEM:
- {
- int i;
- if (wParam != CLGN_ROOT) {
- if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL))
- return NULL;
- i = List_IndexOf((SortedList*)&group->cl,contact);
- if (i < 0) return 0;
- }
- switch (wParam) {
- case CLGN_ROOT:
- if (dat->list.cl.count)
- return (LRESULT)pcli->pfnContactToHItem(dat->list.cl.items[0]);
- else
- return NULL;
- case CLGN_CHILD:
- if (contact->type != CLCIT_GROUP)
- return NULL;
- group = contact->group;
- if (group->cl.count == 0)
- return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]);
- case CLGN_PARENT:
- return group->groupId | HCONTACT_ISGROUP;
- case CLGN_NEXT:
- do {
- if (++i >= group->cl.count)
- return NULL;
- }
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_PREVIOUS:
- do {
- if (--i < 0)
- return NULL;
- }
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_NEXTCONTACT:
- for (i++; i < group->cl.count; i++)
- if (group->cl.items[i]->type == CLCIT_CONTACT)
- break;
- if (i >= group->cl.count)
- return NULL;
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_PREVIOUSCONTACT:
- if (i >= group->cl.count)
- return NULL;
- for (i--; i >= 0; i--)
- if (group->cl.items[i]->type == CLCIT_CONTACT)
- break;
- if (i < 0)
- return NULL;
- return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_NEXTGROUP:
- for (i++; i < group->cl.count; i++)
- if (group->cl.items[i]->type == CLCIT_GROUP)
- break;
- if (i >= group->cl.count)
- return NULL;
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
- case CLGN_PREVIOUSGROUP:
- if (i >= group->cl.count)
+ {
+ int i = 0;
+ if (wParam != CLGN_ROOT) {
+ if (!pcli->pfnFindItem(hwnd, dat, lParam, &contact, &group, NULL))
+ return NULL;
+ i = List_IndexOf((SortedList*)&group->cl, contact);
+ if (i < 0) return 0;
+ }
+ switch (wParam) {
+ case CLGN_ROOT:
+ if (dat->list.cl.count)
+ return (LRESULT)pcli->pfnContactToHItem(dat->list.cl.items[0]);
+ else
+ return NULL;
+ case CLGN_CHILD:
+ if (contact->type != CLCIT_GROUP)
+ return NULL;
+ group = contact->group;
+ if (group->cl.count == 0)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[0]);
+ case CLGN_PARENT:
+ return group->groupId | HCONTACT_ISGROUP;
+ case CLGN_NEXT:
+ do {
+ if (++i >= group->cl.count)
return NULL;
- for (i--; i >= 0; i--)
- if (group->cl.items[i]->type == CLCIT_GROUP)
- break;
- if (i < 0)
+ } while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_PREVIOUS:
+ do {
+ if (--i < 0)
return NULL;
- return (LRESULT) pcli->pfnContactToHItem(group->cl.items[i]);
- }
- return NULL;
+ } while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_NEXTCONTACT:
+ for (i++; i < group->cl.count; i++)
+ if (group->cl.items[i]->type == CLCIT_CONTACT)
+ break;
+ if (i >= group->cl.count)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_PREVIOUSCONTACT:
+ if (i >= group->cl.count)
+ return NULL;
+ for (i--; i >= 0; i--)
+ if (group->cl.items[i]->type == CLCIT_CONTACT)
+ break;
+ if (i < 0)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_NEXTGROUP:
+ for (i++; i < group->cl.count; i++)
+ if (group->cl.items[i]->type == CLCIT_GROUP)
+ break;
+ if (i >= group->cl.count)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
+ case CLGN_PREVIOUSGROUP:
+ if (i >= group->cl.count)
+ return NULL;
+ for (i--; i >= 0; i--)
+ if (group->cl.items[i]->type == CLCIT_GROUP)
+ break;
+ if (i < 0)
+ return NULL;
+ return (LRESULT)pcli->pfnContactToHItem(group->cl.items[i]);
}
- return 0;
+ return NULL;
+ }
case CLM_SELECTITEM:
- {
- ClcGroup *tgroup;
- int index = -1;
- int mainindex = -1;
- if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL))
- break;
- for (tgroup = group; tgroup; tgroup = tgroup->parent)
- pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
-
- if (!contact->isSubcontact) {
- index = List_IndexOf((SortedList*)&group->cl,contact);
- mainindex = index;
- }
- else {
- index = List_IndexOf((SortedList*)&group->cl,contact->subcontacts);
- mainindex = index;
- index += contact->isSubcontact;
- }
+ {
+ ClcGroup *tgroup;
+ int index = -1;
+ int mainindex = -1;
+ if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL))
+ break;
+ for (tgroup = group; tgroup; tgroup = tgroup->parent)
+ pcli->pfnSetGroupExpand(hwnd, dat, tgroup, 1);
- BYTE k = db_get_b(NULL,"CLC","MetaExpanding",SETTING_METAEXPANDING_DEFAULT);
- if (k) {
- for (int i=0; i < mainindex; i++)
- {
- ClcContact *tempCont = group->cl.items[i];
- if (tempCont->type == CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded)
- index += tempCont->SubAllocated;
- }
- }
+ if (!contact->isSubcontact) {
+ index = List_IndexOf((SortedList*)&group->cl, contact);
+ mainindex = index;
+ }
+ else {
+ index = List_IndexOf((SortedList*)&group->cl, contact->subcontacts);
+ mainindex = index;
+ index += contact->isSubcontact;
+ }
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, group, index);
- pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ BYTE k = db_get_b(NULL, "CLC", "MetaExpanding", SETTING_METAEXPANDING_DEFAULT);
+ if (k) {
+ for (int i = 0; i < mainindex; i++)
+ {
+ ClcContact *tempCont = group->cl.items[i];
+ if (tempCont->type == CLCIT_CONTACT && tempCont->SubAllocated && tempCont->SubExpanded)
+ index += tempCont->SubAllocated;
+ }
}
- return 0;
+
+ dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, group, index);
+ pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
+ }
+ return 0;
case CLM_SETEXTRAIMAGE:
if (LOWORD(lParam) >= dat->extraColumnsCount)
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp
index 5ca968b805..0f174073cc 100644
--- a/plugins/Clist_modern/src/modern_clcopts.cpp
+++ b/plugins/Clist_modern/src/modern_clcopts.cpp
@@ -71,32 +71,32 @@ struct FontOptionsList {
#define DEFAULT_SMALLSIZE -8
static struct FontOptionsList fontOptionsList[] = {
- { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT("Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENT("Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENT("DND contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENT("NA contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENT("Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENT("Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENT("Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT("On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT("Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT("Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT("Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT("Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT("Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT("Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENT("Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT("Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT("Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT("Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT("Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT("Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
- { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT("Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
-
- { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT("Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT("Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
- { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT("Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CONTACTS, CLCGROUP, LPGENT("Standard contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_AWAY, CLCGROUP, LPGENT("Away contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_DND, CLCGROUP, LPGENT("DND contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NA, CLCGROUP, LPGENT("NA contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OCCUPIED, CLCGROUP, LPGENT("Occupied contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_CHAT, CLCGROUP, LPGENT("Free for chat contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVISIBLE, CLCGROUP, LPGENT("Invisible contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_PHONE, CLCGROUP, LPGENT("On the phone contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_LUNCH, CLCGROUP, LPGENT("Out to lunch contacts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFLINE, CLCGROUP, LPGENT("Offline contacts"), DEFAULT_GREYCOLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_INVIS, CLCGROUP, LPGENT("Online contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_OFFINVIS, CLCGROUP, LPGENT("Offline contacts to whom you have a different visibility"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_NOTONLIST, CLCGROUP, LPGENT("Contacts who are 'not on list'"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPS, CLCGROUP, LPGENT("Open groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_OPENGROUPCOUNTS, CLCGROUP, LPGENT("Open group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPS, CLCGROUP, LPGENT("Closed groups"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_BOLD, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSHEADER, FONTID_CLOSEDGROUPCOUNTS, CLCGROUP, LPGENT("Closed group member counts"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_DIVIDERS, CLCGROUP, LPGENT("Dividers"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSSMALL, FONTID_SECONDLINE, CLCLINESGROUP, LPGENT("Second line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_THIRDLINE, CLCLINESGROUP, LPGENT("Third line"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSSMALL, FONTID_CONTACT_TIME, CLCLINESGROUP, LPGENT("Contact time"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SMALLSIZE, DEFAULT_EFFECT },
+
+ { FIDF_CLASSGENERAL, FONTID_STATUSBAR_PROTONAME, CLCFRAMESGROUP, LPGENT("Status bar text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_EVENTAREA, CLCFRAMESGROUP, LPGENT("Event area text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
+ { FIDF_CLASSGENERAL, FONTID_VIEMODES, CLCFRAMESGROUP, LPGENT("Current view mode text"), DEFAULT_COLOUR, DEFAULT_FAMILY, DEFAULT_CHARSET, FONTF_NORMAL, DEFAULT_SIZE, DEFAULT_EFFECT },
};
struct ColourOptionsList {
@@ -108,19 +108,19 @@ struct ColourOptionsList {
};
static struct ColourOptionsList colourOptionsList[] = {
- { "CLC", "BkColour", CLCGROUP, LPGENT("Background"), CLCDEFAULT_BKCOLOUR },
- { "CLC", "Rows_BkColour", CLCLINESGROUP, LPGENT("Background"), CLCDEFAULT_BKCOLOUR },
- { "CLC", "Frames_BkColour", CLCFRAMESGROUP, LPGENT("Background"), CLCDEFAULT_BKCOLOUR },
-
- { "CLC", "HotTextColour", CLCCOLOURSGROUP, LPGENT("Hot text"), CLCDEFAULT_MODERN_HOTTEXTCOLOUR },
- { "CLC", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
- { "CLC", "QuickSearchColour", CLCCOLOURSGROUP, LPGENT("Quick search text"), CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR },
-
- { "Menu", "TextColour", CLCCOLOURSGROUP, LPGENT("Menu text"), CLCDEFAULT_TEXTCOLOUR },
- { "Menu", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected menu text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
- { "FrameTitleBar", "TextColour", CLCCOLOURSGROUP, LPGENT("Frame title text"), CLCDEFAULT_TEXTCOLOUR },
- { "StatusBar", "TextColour", CLCCOLOURSGROUP, LPGENT("Status bar text"), CLCDEFAULT_TEXTCOLOUR },
- { "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENT("3rd party frames transparent back color"), SETTING_KEYCOLOR_DEFAULT }
+ { "CLC", "BkColour", CLCGROUP, LPGENT("Background"), CLCDEFAULT_BKCOLOUR },
+ { "CLC", "Rows_BkColour", CLCLINESGROUP, LPGENT("Background"), CLCDEFAULT_BKCOLOUR },
+ { "CLC", "Frames_BkColour", CLCFRAMESGROUP, LPGENT("Background"), CLCDEFAULT_BKCOLOUR },
+
+ { "CLC", "HotTextColour", CLCCOLOURSGROUP, LPGENT("Hot text"), CLCDEFAULT_MODERN_HOTTEXTCOLOUR },
+ { "CLC", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
+ { "CLC", "QuickSearchColour", CLCCOLOURSGROUP, LPGENT("Quick search text"), CLCDEFAULT_MODERN_QUICKSEARCHCOLOUR },
+
+ { "Menu", "TextColour", CLCCOLOURSGROUP, LPGENT("Menu text"), CLCDEFAULT_TEXTCOLOUR },
+ { "Menu", "SelTextColour", CLCCOLOURSGROUP, LPGENT("Selected menu text"), CLCDEFAULT_MODERN_SELTEXTCOLOUR },
+ { "FrameTitleBar", "TextColour", CLCCOLOURSGROUP, LPGENT("Frame title text"), CLCDEFAULT_TEXTCOLOUR },
+ { "StatusBar", "TextColour", CLCCOLOURSGROUP, LPGENT("Status bar text"), CLCDEFAULT_TEXTCOLOUR },
+ { "ModernSettings", "KeyColor", CLCCOLOURSGROUP, LPGENT("3rd party frames transparent back color"), SETTING_KEYCOLOR_DEFAULT }
};
void RegisterCLUIFonts(void)
@@ -199,7 +199,6 @@ DWORD GetDefaultExStyle(void)
void GetFontSetting(int i, LOGFONT *lf, COLORREF *colour, BYTE *effect, COLORREF *eColour1, COLORREF *eColour2)
{
- DBVARIANT dbv = { 0 };
char idstr[32];
int index;
@@ -1216,16 +1215,16 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
break;
case WM_HSCROLL:
- {
- char str[10];
- mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
- SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
- mir_snprintf(str, SIZEOF(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);
- break;
+ {
+ char str[10];
+ mir_snprintf(str, SIZEOF(str), "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
+ SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
+ mir_snprintf(str, SIZEOF(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);
+ break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
@@ -1406,72 +1405,72 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam,
return TRUE;
case M_BKGR_GETSTATE:
- {
- int indx = wParam;
- if (indx == CB_ERR || indx >= dat->count)
- break;
+ {
+ int indx = wParam;
+ if (indx == CB_ERR || indx >= dat->count)
+ break;
- indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
+ indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
- dat->item[indx].useBitmap = IsDlgButtonChecked(hwndDlg, IDC_BITMAP);
- dat->item[indx].useWinColours = IsDlgButtonChecked(hwndDlg, IDC_USEWINCOL);
- dat->item[indx].bkColor = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
- dat->item[indx].selColor = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0);
+ dat->item[indx].useBitmap = IsDlgButtonChecked(hwndDlg, IDC_BITMAP);
+ dat->item[indx].useWinColours = IsDlgButtonChecked(hwndDlg, IDC_USEWINCOL);
+ dat->item[indx].bkColor = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
+ dat->item[indx].selColor = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0);
- GetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename, SIZEOF(dat->item[indx].filename));
+ GetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename, SIZEOF(dat->item[indx].filename));
- WORD flags = 0;
- if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH)) flags |= CLB_STRETCHH;
- if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHV)) flags |= CLB_STRETCHV;
- if (IsDlgButtonChecked(hwndDlg, IDC_TILEH)) flags |= CLBF_TILEH;
- if (IsDlgButtonChecked(hwndDlg, IDC_TILEV)) flags |= CLBF_TILEV;
- if (IsDlgButtonChecked(hwndDlg, IDC_SCROLL)) flags |= CLBF_SCROLL;
- if (IsDlgButtonChecked(hwndDlg, IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
- if (IsDlgButtonChecked(hwndDlg, IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
- dat->item[indx].flags = flags;
- }
- break;
+ WORD flags = 0;
+ if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH)) flags |= CLB_STRETCHH;
+ if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHV)) flags |= CLB_STRETCHV;
+ if (IsDlgButtonChecked(hwndDlg, IDC_TILEH)) flags |= CLBF_TILEH;
+ if (IsDlgButtonChecked(hwndDlg, IDC_TILEV)) flags |= CLBF_TILEV;
+ if (IsDlgButtonChecked(hwndDlg, IDC_SCROLL)) flags |= CLBF_SCROLL;
+ if (IsDlgButtonChecked(hwndDlg, IDC_PROPORTIONAL)) flags |= CLBF_PROPORTIONAL;
+ if (IsDlgButtonChecked(hwndDlg, IDC_TILEVROWH)) flags |= CLBF_TILEVTOROWHEIGHT;
+ dat->item[indx].flags = flags;
+ }
+ break;
case M_BKGR_SETSTATE:
- {
- int flags;
- int indx = wParam;
- if (indx == -1) break;
- flags = dat->item[indx].flags;
- if (indx == CB_ERR || indx >= dat->count) break;
- indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
-
- CheckDlgButton(hwndDlg, IDC_BITMAP, dat->item[indx].useBitmap ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_USEWINCOL, dat->item[indx].useWinColours ? BST_CHECKED : BST_UNCHECKED);
-
- EnableWindow(GetDlgItem(hwndDlg, IDC_BKGCOLOUR), !dat->item[indx].useWinColours);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SELCOLOUR), !dat->item[indx].useWinColours);
-
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_BKCOLOUR);
- SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].bkColor);
- SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_SELBKCOLOUR);
- SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].selColor);
- SetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename);
-
- CheckDlgButton(hwndDlg, IDC_STRETCHH, flags&CLB_STRETCHH ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_STRETCHV, flags&CLB_STRETCHV ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TILEH, flags&CLBF_TILEH ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TILEV, flags&CLBF_TILEV ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SCROLL, flags&CLBF_SCROLL ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_PROPORTIONAL, flags&CLBF_PROPORTIONAL ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TILEVROWH, flags&CLBF_TILEVTOROWHEIGHT ? BST_CHECKED : BST_UNCHECKED);
-
- SendMessage(hwndDlg, M_BKGR_UPDATE, 0, 0);
- }
- break;
+ {
+ int flags;
+ int indx = wParam;
+ if (indx == -1) break;
+ flags = dat->item[indx].flags;
+ if (indx == CB_ERR || indx >= dat->count) break;
+ indx = SendDlgItemMessage(hwndDlg, IDC_BKGRLIST, CB_GETITEMDATA, indx, 0);
+
+ CheckDlgButton(hwndDlg, IDC_BITMAP, dat->item[indx].useBitmap ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USEWINCOL, dat->item[indx].useWinColours ? BST_CHECKED : BST_UNCHECKED);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKGCOLOUR), !dat->item[indx].useWinColours);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SELCOLOUR), !dat->item[indx].useWinColours);
+
+ SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_BKCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].bkColor);
+ SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, DEFAULT_SELBKCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, dat->item[indx].selColor);
+ SetDlgItemTextA(hwndDlg, IDC_FILENAME, dat->item[indx].filename);
+
+ CheckDlgButton(hwndDlg, IDC_STRETCHH, flags&CLB_STRETCHH ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_STRETCHV, flags&CLB_STRETCHV ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TILEH, flags&CLBF_TILEH ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TILEV, flags&CLBF_TILEV ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SCROLL, flags&CLBF_SCROLL ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PROPORTIONAL, flags&CLBF_PROPORTIONAL ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TILEVROWH, flags&CLBF_TILEVTOROWHEIGHT ? BST_CHECKED : BST_UNCHECKED);
+
+ SendMessage(hwndDlg, M_BKGR_UPDATE, 0, 0);
+ }
+ break;
case M_BKGR_UPDATE:
- {
- int isChecked = IsDlgButtonChecked(hwndDlg, IDC_BITMAP);
- for (int indx = 0; indx < SIZEOF(bitmapRelatedControls); indx++)
- EnableWindow(GetDlgItem(hwndDlg, bitmapRelatedControls[indx]), isChecked);
- }
- break;
+ {
+ int isChecked = IsDlgButtonChecked(hwndDlg, IDC_BITMAP);
+ for (int indx = 0; indx < SIZEOF(bitmapRelatedControls); indx++)
+ EnableWindow(GetDlgItem(hwndDlg, bitmapRelatedControls[indx]), isChecked);
+ }
+ break;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_BROWSE) {
@@ -1877,7 +1876,7 @@ static INT_PTR CALLBACK DlgProcModernOptions(HWND hwndDlg, UINT msg, WPARAM wPar
/////////////////////////////////////////////////////////////////////////////////////////
-int ModernOptInit(WPARAM wParam, LPARAM lParam)
+int ModernOptInit(WPARAM wParam, LPARAM)
{
static int iBoldControls[] =
{
@@ -1925,7 +1924,7 @@ static clist_opt_items[] =
{ LPGEN("Additional stuff"), IDD_OPT_META_CLC, DlgProcClistAdditionalOpts, 0 }
};
-int ClcOptInit(WPARAM wParam, LPARAM lParam)
+int ClcOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.hInstance = g_hInst;
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index 2149b965d5..345386b77d 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -32,7 +32,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
CLCPaint g_clcPainter;
-DWORD CLCPaint::HASH[hi_LastItem] = {0};
+DWORD CLCPaint::HASH[hi_LastItem] = { 0 };
const char* CLCPaint::HASHTEXT[hi_LastItem] = {
"Module",
"ID",
@@ -88,15 +88,15 @@ const char* CLCPaint::HASHTEXT[hi_LastItem] = {
"Inactive"
//ADD item here
};
-const int CLCPaint::HORIZONTAL_SPACE = 2;
+const int CLCPaint::HORIZONTAL_SPACE = 2;
const int CLCPaint::EXTRA_CHECKBOX_SPACE = 2;
-const int CLCPaint::EXTRA_SPACE = 2;
-const int CLCPaint::SELECTION_BORDER = 6;
-const int CLCPaint::MIN_TEXT_WIDTH = 20;
-const int CLCPaint::BUF2SIZE = 7;
+const int CLCPaint::EXTRA_SPACE = 2;
+const int CLCPaint::SELECTION_BORDER = 6;
+const int CLCPaint::MIN_TEXT_WIDTH = 20;
+const int CLCPaint::BUF2SIZE = 7;
const BYTE CLCPaint::GIM_SELECTED_AFFECT = 1;
-const BYTE CLCPaint::GIM_HOT_AFFECT = 2;
+const BYTE CLCPaint::GIM_HOT_AFFECT = 2;
const BYTE CLCPaint::GIM_TEMP_AFFECT = 4;
const BYTE CLCPaint::GIM_IDLE_AFFECT = 8;
const BYTE CLCPaint::GIM_EXTRAICON_AFFECT = CLCPaint::GIM_SELECTED_AFFECT | CLCPaint::GIM_HOT_AFFECT | CLCPaint::GIM_IDLE_AFFECT | CLCPaint::GIM_TEMP_AFFECT;
@@ -108,44 +108,44 @@ CLCPaint::CLCPaint()
_FillQuickHash();
};
-void CLCPaint::cliPaintClc( HWND hwnd, ClcData *dat, HDC hdc, RECT *rcPaint )
+void CLCPaint::cliPaintClc(HWND hwnd, ClcData *dat, HDC hdc, RECT *rcPaint)
{
- if ( MirandaExiting()) return;
+ if (MirandaExiting()) return;
g_CluiData.mutexPaintLock++;
- g_clcPainter._PaintClc( hwnd, dat, hdc, rcPaint );
+ g_clcPainter._PaintClc(hwnd, dat, hdc, rcPaint);
g_CluiData.mutexPaintLock--;
}
-BOOL CLCPaint::IsForegroundWindow( HWND hWnd )
+BOOL CLCPaint::IsForegroundWindow(HWND hWnd)
{
HWND hWindow;
hWindow = hWnd;
- while ( hWindow ) {
- if ( GetForegroundWindow() == hWindow ) return TRUE;
- hWindow = GetParent( hWindow );
+ while (hWindow) {
+ if (GetForegroundWindow() == hWindow) return TRUE;
+ hWindow = GetParent(hWindow);
}
return FALSE;
}
-HFONT CLCPaint::ChangeToFont( HDC hdc, ClcData *dat, int id, int *fontHeight )
+HFONT CLCPaint::ChangeToFont(HDC hdc, ClcData *dat, int id, int *fontHeight)
{
if (!dat)
- dat = (ClcData*)GetWindowLongPtr( pcli->hwndContactTree, 0 );
+ dat = (ClcData*)GetWindowLongPtr(pcli->hwndContactTree, 0);
if (!dat)
return NULL;
- HFONT res = ( HFONT )SelectObject( hdc, dat->fontModernInfo[id].hFont );
- SetTextColor( hdc, dat->fontModernInfo[id].colour );
+ HFONT res = (HFONT)SelectObject(hdc, dat->fontModernInfo[id].hFont);
+ SetTextColor(hdc, dat->fontModernInfo[id].colour);
- if ( fontHeight )
+ if (fontHeight)
*fontHeight = dat->fontModernInfo[id].fontHeight;
- ske_ResetTextEffect( hdc );
+ ske_ResetTextEffect(hdc);
- 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 );
+ 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 );
+ ske_ResetTextEffect(hdc);
return res;
}
@@ -158,10 +158,10 @@ int CLCPaint::GetBasicFontID(ClcContact *contact)
switch (contact->type) {
case CLCIT_GROUP:
- return ( contact->group->expanded ) ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS;
+ return (contact->group->expanded) ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS;
case CLCIT_INFO:
- return ( contact->flags & CLCIIF_GROUPFONT ) ? FONTID_OPENGROUPS : FONTID_CONTACTS;
+ return (contact->flags & CLCIIF_GROUPFONT) ? FONTID_OPENGROUPS : FONTID_CONTACTS;
case CLCIT_DIVIDER:
return FONTID_DIVIDERS;
@@ -177,16 +177,16 @@ int CLCPaint::GetBasicFontID(ClcContact *contact)
return (contact->flags & CONTACTF_ONLINE) ? FONTID_INVIS : FONTID_OFFINVIS;
}
- switch( pdnce___GetStatus( pdnce )) {
- case ID_STATUS_OFFLINE: return FONTID_OFFLINE;
- case ID_STATUS_AWAY: return FONTID_AWAY;
- case ID_STATUS_DND: return FONTID_DND;
- case ID_STATUS_NA: return FONTID_NA;
- case ID_STATUS_OCCUPIED: return FONTID_OCCUPIED;
- case ID_STATUS_FREECHAT: return FONTID_CHAT;
- case ID_STATUS_INVISIBLE: return FONTID_INVISIBLE;
- case ID_STATUS_ONTHEPHONE: return FONTID_PHONE;
- case ID_STATUS_OUTTOLUNCH: return FONTID_LUNCH;
+ switch (pdnce___GetStatus(pdnce)) {
+ case ID_STATUS_OFFLINE: return FONTID_OFFLINE;
+ case ID_STATUS_AWAY: return FONTID_AWAY;
+ case ID_STATUS_DND: return FONTID_DND;
+ case ID_STATUS_NA: return FONTID_NA;
+ case ID_STATUS_OCCUPIED: return FONTID_OCCUPIED;
+ case ID_STATUS_FREECHAT: return FONTID_CHAT;
+ case ID_STATUS_INVISIBLE: return FONTID_INVISIBLE;
+ case ID_STATUS_ONTHEPHONE: return FONTID_PHONE;
+ case ID_STATUS_OUTTOLUNCH: return FONTID_LUNCH;
}
default:
@@ -194,9 +194,9 @@ int CLCPaint::GetBasicFontID(ClcContact *contact)
}
}
-void CLCPaint::GetTextSize( SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height )
+void CLCPaint::GetTextSize(SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHAR *szText, SortedList *plText, UINT uTextFormat, int smiley_height)
{
- if ( szText == NULL || !szText[0] ) {
+ if (szText == NULL || !szText[0]) {
text_size->cy = 0;
text_size->cx = 0;
}
@@ -209,124 +209,124 @@ void CLCPaint::GetTextSize( SIZE *text_size, HDC hdcMem, RECT free_row_rc, TCHA
free_height = text_rc.bottom - text_rc.top;
// Always need cy...
- text_size->cy = ske_DrawText(hdcMem, szText, mir_tstrlen( szText ), &text_rc, DT_CALCRECT | uTextFormat );
- text_size->cy = min( text_size->cy, free_height );
- if ( plText == NULL )
- text_size->cx = min( text_rc.right - text_rc.left + 2, free_width );
+ text_size->cy = ske_DrawText(hdcMem, szText, mir_tstrlen(szText), &text_rc, DT_CALCRECT | uTextFormat);
+ text_size->cy = min(text_size->cy, free_height);
+ if (plText == NULL)
+ text_size->cx = min(text_rc.right - text_rc.left + 2, free_width);
else {
// See each item of list
int i;
- text_size->cy = min( max( text_size->cy, smiley_height ), free_height );
+ text_size->cy = min(max(text_size->cy, smiley_height), free_height);
text_size->cx = 0;
- for ( i=0; i < plText->realCount && text_size->cx < free_width; i++ ) {
- ClcContactTextPiece *piece = ( ClcContactTextPiece * ) plText->items[i];
+ for (i = 0; i < plText->realCount && text_size->cx < free_width; i++) {
+ ClcContactTextPiece *piece = (ClcContactTextPiece *)plText->items[i];
- if ( piece->type == TEXT_PIECE_TYPE_TEXT ) {
+ if (piece->type == TEXT_PIECE_TYPE_TEXT) {
text_rc = free_row_rc;
- ske_DrawText(hdcMem, &szText[piece->start_pos], piece->len, &text_rc, DT_CALCRECT | uTextFormat );
- text_size->cx = min( text_size->cx + text_rc.right - text_rc.left + 2, free_width );
+ ske_DrawText(hdcMem, &szText[piece->start_pos], piece->len, &text_rc, DT_CALCRECT | uTextFormat);
+ text_size->cx = min(text_size->cx + text_rc.right - text_rc.left + 2, free_width);
}
else {
double factor;
- if ( piece->smiley_height > text_size->cy )
- factor = text_size->cy / ( double ) piece->smiley_height;
+ if (piece->smiley_height > text_size->cy)
+ factor = text_size->cy / (double)piece->smiley_height;
else
factor = 1;
- text_size->cx = min( text_size->cx + ( long )( factor * piece->smiley_width ), free_width );
+ text_size->cx = min(text_size->cx + (long)(factor * piece->smiley_width), free_width);
}
}
}
}
}
-void CLCPaint::AddParam( MODERNMASK *mpModernMask, DWORD dwParamHash, const char* const szValue, DWORD dwValueHash )
+void CLCPaint::AddParam(MODERNMASK *mpModernMask, DWORD dwParamHash, const char* const szValue, DWORD dwValueHash)
{
- static MASKPARAM param = {0}; //AddParameter will clear it so it can be static to avoid initializations
- _FillParam( &param, dwParamHash, szValue, dwValueHash );
- _AddParameter( mpModernMask, &param );
+ static MASKPARAM param = { 0 }; //AddParameter will clear it so it can be static to avoid initializations
+ _FillParam(&param, dwParamHash, szValue, dwValueHash);
+ _AddParameter(mpModernMask, &param);
}
-BOOL CLCPaint::CheckMiniMode( ClcData *dat, BOOL selected, BOOL hot )
+BOOL CLCPaint::CheckMiniMode(ClcData *dat, BOOL selected)
{
- if ((!dat->bCompactMode /* not mini*/ )
- || (( dat->bCompactMode&0x01 ) && selected /*mini on selected*/ )
- /* || ( TRUE && hot )*/ ) return FALSE;
+ if ((!dat->bCompactMode /* not mini*/)
+ || ((dat->bCompactMode & 0x01) && selected /*mini on selected*/)
+ /* || ( TRUE && hot )*/) return FALSE;
return TRUE;
}
-tPaintCallbackProc CLCPaint::PaintCallbackProc( HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData )
+tPaintCallbackProc CLCPaint::PaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN, DWORD, void *)
{
- ClcData* dat = ( ClcData* )GetWindowLongPtr( hWnd, 0 );
- if (!dat ) return 0;
- cliPaintClc( hWnd, dat, hDC, rcPaint );
+ ClcData* dat = (ClcData*)GetWindowLongPtr(hWnd, 0);
+ if (!dat) return 0;
+ cliPaintClc(hWnd, dat, hDC, rcPaint);
return NULL;
}
void CLCPaint::_FillQuickHash()
{
int i;
- for ( i=0; i < hi_LastItem; i++ )
- HASH[i] = mod_CalcHash( HASHTEXT[i] );
+ for (i = 0; i < hi_LastItem; i++)
+ HASH[i] = mod_CalcHash(HASHTEXT[i]);
}
-void CLCPaint::_SetHotTrackColour( HDC hdc, ClcData *dat )
+void CLCPaint::_SetHotTrackColour(HDC hdc, ClcData *dat)
{
- if ( dat->gammaCorrection ) {
+ if (dat->gammaCorrection) {
COLORREF oldCol, newCol;
int oldLum, newLum;
- oldCol = GetTextColor( hdc );
- oldLum = ( GetRValue( oldCol )*30+GetGValue( oldCol )*59+GetBValue( oldCol )*11 )/100;
- newLum = ( GetRValue( dat->hotTextColour )*30+GetGValue( dat->hotTextColour )*59+GetBValue( dat->hotTextColour )*11 )/100;
- if ( newLum == 0 ) {
- SetTextColor( hdc, dat->hotTextColour );
+ oldCol = GetTextColor(hdc);
+ oldLum = (GetRValue(oldCol) * 30 + GetGValue(oldCol) * 59 + GetBValue(oldCol) * 11) / 100;
+ newLum = (GetRValue(dat->hotTextColour) * 30 + GetGValue(dat->hotTextColour) * 59 + GetBValue(dat->hotTextColour) * 11) / 100;
+ if (newLum == 0) {
+ SetTextColor(hdc, dat->hotTextColour);
return;
}
- if ( newLum >= oldLum+20 ) {
+ if (newLum >= oldLum + 20) {
oldLum += 20;
- newCol = RGB( GetRValue( dat->hotTextColour )*oldLum/newLum, GetGValue( dat->hotTextColour )*oldLum/newLum, GetBValue( dat->hotTextColour )*oldLum/newLum );
+ 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;
+ r = GetRValue(dat->hotTextColour)*oldLum / newLum;
+ g = GetGValue(dat->hotTextColour)*oldLum / newLum;
+ b = GetBValue(dat->hotTextColour)*oldLum / newLum;
+ if (r > 255) {
+ g += (r - 255) * 3 / 7;
+ b += (r - 255) * 3 / 7;
r = 255;
}
- if ( g>255 ) {
- r += ( g-255 )*59/41;
- if ( r>255 ) r = 255;
- b += ( g-255 )*59/41;
+ if (g > 255) {
+ r += (g - 255) * 59 / 41;
+ if (r > 255) r = 255;
+ b += (g - 255) * 59 / 41;
g = 255;
}
- if ( b>255 ) {
- r += ( b-255 )*11/89;
- if ( r>255 ) r = 255;
- g += ( b-255 )*11/89;
- if ( g>255 ) g = 255;
+ if (b > 255) {
+ r += (b - 255) * 11 / 89;
+ if (r > 255) r = 255;
+ g += (b - 255) * 11 / 89;
+ if (g > 255) g = 255;
b = 255;
}
- newCol = RGB( r, g, b );
+ newCol = RGB(r, g, b);
}
else newCol = dat->hotTextColour;
- SetTextColor( hdc, newCol );
+ SetTextColor(hdc, newCol);
}
else
- SetTextColor( hdc, dat->hotTextColour );
+ SetTextColor(hdc, dat->hotTextColour);
}
-int CLCPaint::_GetStatusOnlineness( int status )
+int CLCPaint::_GetStatusOnlineness(int status)
{
- switch( status )
+ switch (status)
{
case ID_STATUS_FREECHAT: return 110;
case ID_STATUS_ONLINE: return 100;
@@ -346,14 +346,14 @@ 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 )
+ if (thisStatus == ID_STATUS_INVISIBLE)
return ID_STATUS_INVISIBLE;
- int thisOnlineness = _GetStatusOnlineness( thisStatus );
- if ( thisOnlineness > statusOnlineness )
+ int thisOnlineness = _GetStatusOnlineness(thisStatus);
+ if (thisOnlineness > statusOnlineness)
{
status = thisStatus;
statusOnlineness = thisOnlineness;
@@ -362,53 +362,53 @@ int CLCPaint::_GetGeneralisedStatus()
return status;
}
-int CLCPaint::_GetRealStatus( ClcContact *pContact, int nStatus )
+int CLCPaint::_GetRealStatus(ClcContact *pContact, int nStatus)
{
- if (!pContact->proto )
+ if (!pContact->proto)
return nStatus;
- for ( int i=0; i < pcli->hClcProtoCount; i++ )
+ for (int i = 0; i < pcli->hClcProtoCount; i++)
{
- if (!mir_strcmp( pcli->clcProto[i].szProto, pContact->proto ))
+ if (!mir_strcmp(pcli->clcProto[i].szProto, pContact->proto))
return pcli->clcProto[i].dwStatus;
}
return nStatus;
}
-RECT CLCPaint::_GetRectangle( ClcData *dat, RECT *row_rc, RECT *free_row_rc, int *left_pos, int *right_pos, BOOL left, int real_width, int width, int height, int horizontal_space )
+RECT CLCPaint::_GetRectangle(ClcData *dat, RECT *row_rc, RECT *free_row_rc, int *left_pos, int *right_pos, BOOL left, int real_width, int width, int height, int horizontal_space)
{
RECT rc = *free_row_rc;
int width_tmp = width;
- if ( left )
+ if (left)
{
- if ( dat->row_align_left_items_to_left )
+ 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;
free_row_rc->left = row_rc->left + *left_pos;
}
else // if (!left )
{
- if ( dat->row_align_right_items_to_right )
+ if (dat->row_align_right_items_to_right)
width_tmp = real_width;
- if ( width_tmp > rc.right - rc.left )
+ if (width_tmp > rc.right - rc.left)
{
rc.left = rc.right + 1;
}
else
{
- 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.bottom = min( rc.top + height, rc.bottom );
+ 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.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;
}
}
@@ -418,18 +418,18 @@ RECT CLCPaint::_GetRectangle( ClcData *dat, RECT *row_rc, RECT *free_row_rc, in
-void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT *free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley )
+void CLCPaint::_DrawTextSmiley(HDC hdcMem, RECT *free_rc, SIZE * text_size, TCHAR *szText, int start, int len, SortedList *plText, UINT uTextFormat, BOOL ResizeSizeSmiley)
{
- if ( szText == NULL )return;
- uTextFormat &= ~DT_RIGHT;
- if ( plText == NULL ) {
+ if (szText == NULL)return;
+ uTextFormat &= ~DT_RIGHT;
+ if (plText == NULL) {
if (start) {
SIZE size;
GetTextExtentPoint32(hdcMem, szText, start, &size);
free_rc->left += size.cx;
}
- ske_DrawText(hdcMem, szText + start, len, free_rc, uTextFormat );
+ ske_DrawText(hdcMem, szText + start, len, free_rc, uTextFormat);
}
else
{
@@ -438,51 +438,51 @@ void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT *free_rc, SIZE * text_size, TC
int pos_x = 0;
int row_height;
RECT tmp_rc = *free_rc;
- if ( len == -1 ) len = (int)_tcslen( szText );
- if ( uTextFormat & DT_RTLREADING )
+ if (len == -1) len = (int)_tcslen(szText);
+ if (uTextFormat & DT_RTLREADING)
i = plText->realCount - 1;
else
- i=0;
+ i = 0;
// Get real height of the line
- row_height = ske_DrawText(hdcMem, _T("A"), 1, &tmp_rc, DT_CALCRECT | uTextFormat );
+ row_height = ske_DrawText(hdcMem, _T("A"), 1, &tmp_rc, DT_CALCRECT | uTextFormat);
// Just draw ellipsis
- if ( free_rc->right <= free_rc->left )
+ if (free_rc->right <= free_rc->left)
{
- if ( gl_TrimText ) ske_DrawText(hdcMem, _T("..."), 3, free_rc, uTextFormat & ~DT_END_ELLIPSIS );
+ if (gl_TrimText) ske_DrawText(hdcMem, _T("..."), 3, free_rc, uTextFormat & ~DT_END_ELLIPSIS);
}
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];
+ ClcContactTextPiece *piece = (ClcContactTextPiece *)plText->items[i];
RECT text_rc = *free_rc;
- if ( uTextFormat & DT_RTLREADING )
+ if (uTextFormat & DT_RTLREADING)
text_rc.right -= pos_x;
else
text_rc.left += pos_x;
- if ( piece->type == TEXT_PIECE_TYPE_TEXT )
+ if (piece->type == TEXT_PIECE_TYPE_TEXT)
{
tmp_rc = text_rc;
tmp_rc.right += 50;
- ske_DrawText(hdcMem, &szText[piece->start_pos + start], min( len, piece->len ), &tmp_rc, DT_CALCRECT | ( uTextFormat & ~DT_END_ELLIPSIS ));
+ ske_DrawText(hdcMem, &szText[piece->start_pos + start], min(len, piece->len), &tmp_rc, DT_CALCRECT | (uTextFormat & ~DT_END_ELLIPSIS));
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 ));
+ 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 + start], min( len, piece->len ), &text_rc, uTextFormat );
+ ske_DrawText(hdcMem, &szText[piece->start_pos + start], min(len, piece->len), &text_rc, uTextFormat);
len -= piece->len;
}
else
{
float factor = 0;
- if ( len < piece->len )
+ if (len < piece->len)
{
len = 0;
}
@@ -491,31 +491,31 @@ void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT *free_rc, SIZE * text_size, TC
LONG fac_width, fac_height;
len -= piece->len;
- if ( piece->smiley_height > row_height && ResizeSizeSmiley )
+ if (piece->smiley_height > row_height && ResizeSizeSmiley)
{
- factor = row_height / ( float ) piece->smiley_height;
+ factor = row_height / (float)piece->smiley_height;
}
else
{
factor = 1;
}
- fac_width = ( LONG )( piece->smiley_width * factor );
- fac_height = ( LONG )( piece->smiley_height * factor );
+ fac_width = (LONG)(piece->smiley_width * factor);
+ fac_height = (LONG)(piece->smiley_height * factor);
- if ( uTextFormat & DT_RTLREADING )
- text_rc.left = max( text_rc.right - fac_width, text_rc.left );
+ if (uTextFormat & DT_RTLREADING)
+ text_rc.left = max(text_rc.right - fac_width, text_rc.left);
- if ( fac_width <= text_rc.right - text_rc.left )
+ 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, _T("..."), 3, &text_rc, uTextFormat );
+ ske_DrawText(hdcMem, _T("..."), 3, &text_rc, uTextFormat);
}
pos_x += fac_width;
@@ -527,226 +527,226 @@ void CLCPaint::_DrawTextSmiley( HDC hdcMem, RECT *free_rc, SIZE * text_size, TC
}
-void CLCPaint::_AddParameter( MODERNMASK *mpModernMask, MASKPARAM * lpParam )
+void CLCPaint::_AddParameter(MODERNMASK *mpModernMask, MASKPARAM * lpParam)
{
- mpModernMask->pl_Params = ( MASKPARAM * )realloc( mpModernMask->pl_Params, ( mpModernMask->dwParamCnt+1 )*sizeof( MASKPARAM ));
- memmove( &( mpModernMask->pl_Params[mpModernMask->dwParamCnt] ), lpParam, sizeof( MASKPARAM ));
+ mpModernMask->pl_Params = (MASKPARAM *)realloc(mpModernMask->pl_Params, (mpModernMask->dwParamCnt + 1)*sizeof(MASKPARAM));
+ memmove(&(mpModernMask->pl_Params[mpModernMask->dwParamCnt]), lpParam, sizeof(MASKPARAM));
mpModernMask->dwParamCnt++;
- memset( lpParam, 0, sizeof( MASKPARAM ));
+ memset(lpParam, 0, sizeof(MASKPARAM));
}
-void CLCPaint::_FillParam( MASKPARAM * lpParam, DWORD dwParamHash, const char* const szValue, DWORD dwValueHash )
+void CLCPaint::_FillParam(MASKPARAM * lpParam, DWORD dwParamHash, const char* const szValue, DWORD dwValueHash)
{
- lpParam->bMaskParamFlag = MPF_EQUAL|MPF_HASHED;
+ lpParam->bMaskParamFlag = MPF_EQUAL | MPF_HASHED;
lpParam->dwId = dwParamHash;
- if (!dwValueHash && szValue && szValue[0] ) lpParam->dwValueHash = mod_CalcHash( szValue );
+ if (!dwValueHash && szValue && szValue[0]) lpParam->dwValueHash = mod_CalcHash(szValue);
else lpParam->dwValueHash = dwValueHash;
- if ( szValue ) lpParam->szValue = strdupn( szValue, strlen( szValue ));
+ if (szValue) lpParam->szValue = strdupn(szValue, strlen(szValue));
else lpParam->szValue = NULL;
}
-void CLCPaint::_AddParamShort( MODERNMASK *mpModernMask, DWORD dwParamIndex, DWORD dwValueIndex )
+void CLCPaint::_AddParamShort(MODERNMASK *mpModernMask, DWORD dwParamIndex, DWORD dwValueIndex)
{
- AddParam( mpModernMask, HASH[dwParamIndex], HASHTEXT[dwValueIndex], HASH[dwValueIndex] );
+ AddParam(mpModernMask, HASH[dwParamIndex], HASHTEXT[dwValueIndex], HASH[dwValueIndex]);
}
-MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask( ClcGroup *group, ClcContact *Drawing, int indent, int index, BOOL selected, BOOL hottrack, ClcData *dat )
+MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContact *Drawing, int indent, int index, BOOL selected, BOOL hottrack, ClcData *dat)
{
MODERNMASK *mpModernMask = NULL;
- char buf[BUF2SIZE] = {0};
- mpModernMask = ( MODERNMASK* )mir_calloc( sizeof( MODERNMASK ));
+ char buf[BUF2SIZE] = { 0 };
+ mpModernMask = (MODERNMASK*)mir_calloc(sizeof(MODERNMASK));
- _AddParamShort( mpModernMask, hi_Module, hi_CL );
- _AddParamShort( mpModernMask, hi_ID, hi_Row );
- switch ( Drawing->type )
+ _AddParamShort(mpModernMask, hi_Module, hi_CL);
+ _AddParamShort(mpModernMask, hi_ID, hi_Row);
+ switch (Drawing->type)
{
case CLCIT_GROUP:
- {
- _AddParamShort( mpModernMask, hi_Type, hi_Group );
- _AddParamShort( mpModernMask, hi_Open, ( Drawing && Drawing->group && Drawing->group->expanded )?hi_True:hi_False );
- _AddParamShort( mpModernMask, hi_IsEmpty, ( Drawing->group->cl.count == 0 )?hi_True:hi_False );
- }
- break;
+ {
+ _AddParamShort(mpModernMask, hi_Type, hi_Group);
+ _AddParamShort(mpModernMask, hi_Open, (Drawing && Drawing->group && Drawing->group->expanded) ? hi_True : hi_False);
+ _AddParamShort(mpModernMask, hi_IsEmpty, (Drawing->group->cl.count == 0) ? hi_True : hi_False);
+ }
+ break;
case CLCIT_CONTACT:
+ {
+ ClcContact *mCont = Drawing;
+ if (Drawing->isSubcontact)
{
- ClcContact *mCont = Drawing;
- if (Drawing->isSubcontact)
- {
- _AddParamShort( mpModernMask, hi_Type, hi_SubContact );
- if ( Drawing->isSubcontact == 1 && Drawing->subcontacts->SubAllocated == 1 )
- _AddParamShort( mpModernMask, hi_SubPos, hi_First_Single );
- else if ( Drawing->isSubcontact == 1 )
- _AddParamShort( mpModernMask, hi_SubPos, hi_First );
- else if ( Drawing->isSubcontact == Drawing->subcontacts->SubAllocated )
- _AddParamShort( mpModernMask, hi_SubPos, hi_Last );
- else
- _AddParamShort( mpModernMask, hi_SubPos, hi_Middle );
- mCont = Drawing->subcontacts;
- }
- else if ( Drawing->SubAllocated )
- {
- _AddParamShort( mpModernMask, hi_Type, hi_MetaContact );
- _AddParamShort( mpModernMask, hi_Open, ( Drawing->SubExpanded )?hi_True:hi_False );
- }
+ _AddParamShort(mpModernMask, hi_Type, hi_SubContact);
+ if (Drawing->isSubcontact == 1 && Drawing->subcontacts->SubAllocated == 1)
+ _AddParamShort(mpModernMask, hi_SubPos, hi_First_Single);
+ else if (Drawing->isSubcontact == 1)
+ _AddParamShort(mpModernMask, hi_SubPos, hi_First);
+ else if (Drawing->isSubcontact == Drawing->subcontacts->SubAllocated)
+ _AddParamShort(mpModernMask, hi_SubPos, hi_Last);
else
- _AddParamShort( mpModernMask, hi_Type, hi_Contact );
- AddParam( mpModernMask, HASH[hi_Protocol], Drawing->proto, 0 );
- _AddParamShort( mpModernMask, hi_RootGroup, ( group && group->parent == NULL )?hi_True:hi_False );
- switch( GetContactCachedStatus( Drawing->hContact ))
- {
- // case ID_STATUS_CONNECTING: AppendChar( buf, BUFSIZE, "CONNECTING"); break;
- case ID_STATUS_ONLINE: _AddParamShort( mpModernMask, hi_Status, hi_ONLINE ); break;
- case ID_STATUS_AWAY: _AddParamShort( mpModernMask, hi_Status, hi_AWAY ); break;
- case ID_STATUS_DND: _AddParamShort( mpModernMask, hi_Status, hi_DND ); break;
- case ID_STATUS_NA: _AddParamShort( mpModernMask, hi_Status, hi_NA ); break;
- case ID_STATUS_OCCUPIED: _AddParamShort( mpModernMask, hi_Status, hi_OCCUPIED ); break;
- case ID_STATUS_FREECHAT: _AddParamShort( mpModernMask, hi_Status, hi_FREECHAT ); break;
- case ID_STATUS_INVISIBLE: _AddParamShort( mpModernMask, hi_Status, hi_INVISIBLE ); break;
- case ID_STATUS_OUTTOLUNCH: _AddParamShort( mpModernMask, hi_Status, hi_OUTTOLUNCH );break;
- case ID_STATUS_ONTHEPHONE: _AddParamShort( mpModernMask, hi_Status, hi_ONTHEPHONE );break;
- 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_Rate, hi_None + Drawing->bContactRate );
- break;
+ _AddParamShort(mpModernMask, hi_SubPos, hi_Middle);
+ mCont = Drawing->subcontacts;
}
- case CLCIT_DIVIDER:
+ else if (Drawing->SubAllocated)
{
- _AddParamShort( mpModernMask, hi_Type, hi_Divider );
+ _AddParamShort(mpModernMask, hi_Type, hi_MetaContact);
+ _AddParamShort(mpModernMask, hi_Open, (Drawing->SubExpanded) ? hi_True : hi_False);
}
- break;
- case CLCIT_INFO:
+ else
+ _AddParamShort(mpModernMask, hi_Type, hi_Contact);
+ AddParam(mpModernMask, HASH[hi_Protocol], Drawing->proto, 0);
+ _AddParamShort(mpModernMask, hi_RootGroup, (group && group->parent == NULL) ? hi_True : hi_False);
+ switch (GetContactCachedStatus(Drawing->hContact))
{
- _AddParamShort( mpModernMask, hi_Type, hi_Info );
+ // case ID_STATUS_CONNECTING: AppendChar( buf, BUFSIZE, "CONNECTING"); break;
+ case ID_STATUS_ONLINE: _AddParamShort(mpModernMask, hi_Status, hi_ONLINE); break;
+ case ID_STATUS_AWAY: _AddParamShort(mpModernMask, hi_Status, hi_AWAY); break;
+ case ID_STATUS_DND: _AddParamShort(mpModernMask, hi_Status, hi_DND); break;
+ case ID_STATUS_NA: _AddParamShort(mpModernMask, hi_Status, hi_NA); break;
+ case ID_STATUS_OCCUPIED: _AddParamShort(mpModernMask, hi_Status, hi_OCCUPIED); break;
+ case ID_STATUS_FREECHAT: _AddParamShort(mpModernMask, hi_Status, hi_FREECHAT); break;
+ case ID_STATUS_INVISIBLE: _AddParamShort(mpModernMask, hi_Status, hi_INVISIBLE); break;
+ case ID_STATUS_OUTTOLUNCH: _AddParamShort(mpModernMask, hi_Status, hi_OUTTOLUNCH); break;
+ case ID_STATUS_ONTHEPHONE: _AddParamShort(mpModernMask, hi_Status, hi_ONTHEPHONE); break;
+ 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_Rate, hi_None + Drawing->bContactRate);
break;
}
- if ( group->scanIndex == 0 && group->cl.count == 1 )
- _AddParamShort( mpModernMask, hi_GroupPos, hi_First_Single );
- else if ( group->scanIndex == 0 )
- _AddParamShort( mpModernMask, hi_GroupPos, hi_First );
- else if ( group->scanIndex+1 == group->cl.count )
- _AddParamShort( mpModernMask, hi_GroupPos, hi_Last );
+ case CLCIT_DIVIDER:
+ {
+ _AddParamShort(mpModernMask, hi_Type, hi_Divider);
+ }
+ break;
+ case CLCIT_INFO:
+ {
+ _AddParamShort(mpModernMask, hi_Type, hi_Info);
+ }
+ break;
+ }
+ if (group->scanIndex == 0 && group->cl.count == 1)
+ _AddParamShort(mpModernMask, hi_GroupPos, hi_First_Single);
+ else if (group->scanIndex == 0)
+ _AddParamShort(mpModernMask, hi_GroupPos, hi_First);
+ else if (group->scanIndex + 1 == group->cl.count)
+ _AddParamShort(mpModernMask, hi_GroupPos, hi_Last);
else
- _AddParamShort( mpModernMask, hi_GroupPos, hi_Mid );
+ _AddParamShort(mpModernMask, hi_GroupPos, hi_Mid);
- _AddParamShort( mpModernMask, hi_Selected, ( selected )?hi_True:hi_False );
- _AddParamShort( mpModernMask, hi_Hot, ( hottrack )?hi_True:hi_False );
- _AddParamShort( mpModernMask, hi_Odd, ( index&1 )?hi_True:hi_False );
+ _AddParamShort(mpModernMask, hi_Selected, (selected) ? hi_True : hi_False);
+ _AddParamShort(mpModernMask, hi_Hot, (hottrack) ? hi_True : hi_False);
+ _AddParamShort(mpModernMask, hi_Odd, (index & 1) ? hi_True : hi_False);
- _itoa( indent, buf, BUF2SIZE );
- AddParam( mpModernMask, HASH[hi_Indent], buf, 0 );
- _itoa( index, buf, BUF2SIZE );
- AddParam( mpModernMask, HASH[hi_Index], buf, 0 );
+ _itoa(indent, buf, BUF2SIZE);
+ AddParam(mpModernMask, HASH[hi_Indent], buf, 0);
+ _itoa(index, buf, BUF2SIZE);
+ AddParam(mpModernMask, HASH[hi_Index], buf, 0);
{
- TCHAR * b2 = mir_tstrdup( Drawing->szText );
+ TCHAR * b2 = mir_tstrdup(Drawing->szText);
int i, m;
- m = mir_tstrlen( b2 );
- for ( i=0; i < m; i++ )
- if ( b2[i] == _T( ',' )) b2[i] = _T( '.' );
+ m = mir_tstrlen(b2);
+ for (i = 0; i < m; i++)
+ if (b2[i] == _T(',')) b2[i] = _T('.');
{
- char* b3 = mir_utf8encodeT( b2 );
- AddParam( mpModernMask, HASH[hi_Name], b3, 0 );
- mir_free( b3 );
+ char* b3 = mir_utf8encodeT(b2);
+ AddParam(mpModernMask, HASH[hi_Name], b3, 0);
+ mir_free(b3);
}
- mir_free( b2 );
+ mir_free(b2);
}
- if ( group->parent )
+ if (group->parent)
{
- TCHAR * b2 = mir_tstrdup( group->parent->cl.items[0]->szText );
+ TCHAR * b2 = mir_tstrdup(group->parent->cl.items[0]->szText);
int i, m;
- m = mir_tstrlen( b2 );
- for ( i=0; i < m; i++ )
- if ( b2[i] == _T( ',' )) b2[i] = _T( '.' );
+ m = mir_tstrlen(b2);
+ for (i = 0; i < m; i++)
+ if (b2[i] == _T(',')) b2[i] = _T('.');
{
- char * b3 = mir_utf8encodeT( b2 );
- AddParam( mpModernMask, HASH[hi_Group], b3, 0 );
- mir_free( b3 );
+ char * b3 = mir_utf8encodeT(b2);
+ AddParam(mpModernMask, HASH[hi_Group], b3, 0);
+ mir_free(b3);
}
- mir_free( b2 );
+ mir_free(b2);
}
return mpModernMask;
}
-void CLCPaint::_RTLRect( RECT *rect, int width, int offset )
+void CLCPaint::_RTLRect(RECT *rect, int width)
{
int left, right;
- if (!rect ) return;
- left = ( width )-rect->right;
- right = ( width )-rect->left;
+ if (!rect) return;
+ left = (width)-rect->right;
+ right = (width)-rect->left;
rect->left = left;//-offset;
rect->right = right;//-offset;
return;
}
-void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
+void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int selected, int hottrack)
{
- int i=0;
+ int i = 0;
int dx = free_row_rc.left;
- int dy = row_rc.top+dat->row_border;
+ int dy = row_rc.top + dat->row_border;
int dg = 0;
// Let calc placeholder
int minheight = dat->row_min_heigh;
int mode2 = -1;
- COLORREF colourFg = RGB( 0, 0, 0 );
- BOOL InClistWindow = ( dat->hWnd == pcli->hwndContactTree );
+ COLORREF colourFg = RGB(0, 0, 0);
+ BOOL InClistWindow = (dat->hWnd == pcli->hwndContactTree);
ClcCacheEntry *pdnce = NULL;
- int height = RowHeight_CalcRowHeight( dat, hwnd, Drawing, -1 );
+ int height = RowHeight_CalcRowHeight(dat, hwnd, Drawing, -1);
// TO DO DEPRECATE OLD ROW LAYOUT
- if ( Drawing->type == CLCIT_CONTACT )
- pdnce = pcli->pfnGetCacheEntry( Drawing->hContact );
+ if (Drawing->type == CLCIT_CONTACT)
+ pdnce = pcli->pfnGetCacheEntry(Drawing->hContact);
- if ( Drawing->type == CLCIT_GROUP &&
- Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing )
+ if (Drawing->type == CLCIT_GROUP &&
+ Drawing->group->parent->groupId == 0 &&
+ Drawing->group->parent->cl.items[0] != Drawing)
{
dg = dat->row_before_group_space;
free_row_rc.top += dg;
height -= dg;
}
- if (!InClistWindow || !gl_RowRoot || Drawing->type == CLCIT_GROUP )
+ if (!InClistWindow || !gl_RowRoot || Drawing->type == CLCIT_GROUP)
{
// to do paint simple
RECT fr_rc = free_row_rc;
//1 draw icon
- if (!( Drawing->type == CLCIT_GROUP && InClistWindow && dat->row_hide_group_icon ))
+ if (!(Drawing->type == CLCIT_GROUP && InClistWindow && dat->row_hide_group_icon))
{
int iImage = -1;
// Get image
- if ( Drawing->type == CLCIT_GROUP )
+ if (Drawing->type == CLCIT_GROUP)
{
iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
}
- else if ( Drawing->type == CLCIT_CONTACT )
+ else if (Drawing->type == CLCIT_CONTACT)
iImage = Drawing->iImage;
- if ( iImage != -1 )
+ if (iImage != -1)
{
COLORREF colourFg;
int mode;
- RECT p_rect = {0};
- p_rect.top = fr_rc.top+(( fr_rc.bottom-fr_rc.top-ICON_HEIGHT )>>1 );
+ RECT p_rect = { 0 };
+ p_rect.top = fr_rc.top + ((fr_rc.bottom - fr_rc.top - ICON_HEIGHT) >> 1);
p_rect.left = fr_rc.left;
- p_rect.right = p_rect.left+ICON_HEIGHT;
- p_rect.bottom = p_rect.top+ICON_HEIGHT;
+ 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);
Drawing->pos_icon = p_rect;
- if ( hottrack )
+ if (hottrack)
{
colourFg = dat->hotTextColour;
mode = ILD_NORMAL;
}
- else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if (Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST)
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = ILD_BLEND50;
@@ -757,26 +757,26 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
mode = ILD_NORMAL;
}
- if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE )
+ if (Drawing->type == CLCIT_CONTACT && dat->showIdle && (Drawing->flags&CONTACTF_IDLE) &&
+ _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 );
+ _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
{
- RECT p_rect = {0};
- p_rect.top = fr_rc.top+(( fr_rc.bottom-fr_rc.top-ICON_HEIGHT )>>1 );
+ RECT p_rect = { 0 };
+ p_rect.top = fr_rc.top + ((fr_rc.bottom - fr_rc.top - ICON_HEIGHT) >> 1);
//p_rect.left = fr_rc.left;
//p_rect.right = p_rect.left+ICON_HEIGHT;
- p_rect.bottom = p_rect.top+ICON_HEIGHT;
+ p_rect.bottom = p_rect.top + ICON_HEIGHT;
- if (( Drawing->type == CLCIT_GROUP || Drawing->type == CLCIT_CONTACT || Drawing->type == CLCIT_INFO )
- && dat->extraColumnsCount > 0 && (!InClistWindow || Drawing->type == CLCIT_CONTACT ))
+ if ((Drawing->type == CLCIT_GROUP || Drawing->type == CLCIT_CONTACT || Drawing->type == CLCIT_INFO)
+ && dat->extraColumnsCount > 0 && (!InClistWindow || Drawing->type == CLCIT_CONTACT))
{
int BlendedInActiveState = dat->dbbBlendInActiveState;
int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
@@ -784,105 +784,105 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
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;
+ int mode = BlendedInActiveState ? BlendValue : ILD_NORMAL;
if (Drawing->iExtraImage[iImage] == EMPTY_EXTRA_ICON) {
- 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 );
+ 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);
Drawing->pos_extra[iImage] = rc;
count++;
continue;
}
- if ( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
- else if ( hottrack )
+ if (selected) mode = BlendedInActiveState ? ILD_NORMAL : ILD_SELECTED;
+ else if (hottrack)
{
- mode = BlendedInActiveState?ILD_NORMAL:ILD_FOCUS;
+ mode = BlendedInActiveState ? ILD_NORMAL : ILD_FOCUS;
colourFg = dat->hotTextColour;
}
- else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
+ else if (Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST)
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = BlendValue;
}
- 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 );
+ 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);
Drawing->pos_extra[iImage] = rc;
Drawing->pos_extra[iImage] = rc;
if (Drawing->iExtraImage[iImage] != EMPTY_EXTRA_ICON)
- ske_ImageList_DrawEx( dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
- rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode );
+ ske_ImageList_DrawEx(dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
+ rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode);
}
fr_rc.right -= x;
}
}
//3 draw text
{
- SIZE text_size = {0};
+ SIZE text_size = { 0 };
char * szCounts = NULL;
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;
+ 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;
// Select font
- ChangeToFont(hdcMem, dat, GetBasicFontID( Drawing ), NULL );
+ ChangeToFont(hdcMem, dat, GetBasicFontID(Drawing), NULL);
// Get text size
- GetTextSize( &text_size, hdcMem, fr_rc, Drawing->szText, Drawing->ssText.plText, uTextFormat,
- dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight );
+ GetTextSize(&text_size, hdcMem, fr_rc, Drawing->szText, Drawing->ssText.plText, uTextFormat,
+ dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight);
// counters
- if ( Drawing->type == CLCIT_GROUP && InClistWindow )
+ if (Drawing->type == CLCIT_GROUP && InClistWindow)
{
RECT nameRect = fr_rc;
- RECT countRect = {0};
- RECT count_rc = {0};
- SIZE count_size = {0};
+ RECT countRect = { 0 };
+ RECT count_rc = { 0 };
+ SIZE count_size = { 0 };
int space_width = 0;
- char * szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
+ char * szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
- if ( szCounts && strlen( szCounts )>0 )
+ if (szCounts && strlen(szCounts) > 0)
{
// calc width and height
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- ske_DrawText(hdcMem, _T(" "), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX );
- count_size.cx = count_rc.right-count_rc.left;
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
+ ske_DrawText(hdcMem, _T(" "), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX);
+ count_size.cx = count_rc.right - count_rc.left;
space_width = count_size.cx;
count_rc.right = 0;
count_rc.left = 0;
- ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &count_rc, DT_CALCRECT );
- count_size.cx += count_rc.right-count_rc.left;
- count_size.cy = count_rc.bottom-count_rc.top;
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen(szCounts), &count_rc, DT_CALCRECT);
+ count_size.cx += count_rc.right - count_rc.left;
+ count_size.cy = count_rc.bottom - count_rc.top;
}
// modify text rect
//if (!RTL )
{
- SIZE text_size = {0};
- int wid = fr_rc.right-fr_rc.left;
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPS:FONTID_CLOSEDGROUPS, NULL );
- GetTextSize( &text_size, hdcMem, fr_rc, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight );
+ SIZE text_size = { 0 };
+ int wid = fr_rc.right - fr_rc.left;
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, NULL);
+ GetTextSize(&text_size, hdcMem, fr_rc, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight);
- if ( wid-count_size.cx > text_size.cx )
+ 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;
+ int x = (dat->row_align_group_mode == 1) ? (wid - (text_size.cx + count_size.cx)) >> 1 : 0;
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;
+ nameRect.right = nameRect.left + text_size.cx;
+ countRect.left = nameRect.right + space_width;
+ countRect.right = countRect.left + count_size.cx - space_width;
}
else
{
countRect.right = nameRect.right;
- countRect.left = countRect.right-(( count_size.cx>0 )?( count_size.cx-space_width ):0 );
- nameRect.right = countRect.left-(( count_size.cx>0 )?space_width:0 );
- nameRect.left = nameRect.right-text_size.cx;
+ countRect.left = countRect.right - ((count_size.cx > 0) ? (count_size.cx - space_width) : 0);
+ nameRect.right = countRect.left - ((count_size.cx > 0) ? space_width : 0);
+ nameRect.left = nameRect.right - text_size.cx;
}
}
@@ -891,7 +891,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
{
countRect.right = nameRect.right;
nameRect.right -= count_size.cx;
- countRect.left = nameRect.right+space_width;
+ countRect.left = nameRect.right + space_width;
}
countRect.bottom = nameRect.bottom;
countRect.top = nameRect.top;
@@ -903,66 +903,66 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
//uTextFormat |= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT;
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 );
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ 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);
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
if (selected && !dat->filterSearch) {
- SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ SetTextColor(hdcMem, dat->quickSearchColour);
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
- if ( szCounts && strlen( szCounts )>0 )
+ if (szCounts && strlen(szCounts) > 0)
{
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- if ( selected )
- SetTextColor(hdcMem, dat->selTextColour );
- else if ( hottrack )
- _SetHotTrackColour(hdcMem, dat );
- if ( dat->text_rtl != 0 ) _RTLRect( &countRect, free_row_rc.right, dx );
- ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &countRect, uTextFormat );
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
+ if (selected)
+ SetTextColor(hdcMem, dat->selTextColour);
+ else if (hottrack)
+ _SetHotTrackColour(hdcMem, dat);
+ if (dat->text_rtl != 0) _RTLRect(&countRect, free_row_rc.right);
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen(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);
Drawing->pos_rename_rect = rc;
}
Drawing->pos_label = nameRect;
return;
}
- else if ( Drawing->type == CLCIT_GROUP )
+ else if (Drawing->type == CLCIT_GROUP)
{
- szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
+ szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
- if ( szCounts && szCounts[0] )
+ if (szCounts && szCounts[0])
{
RECT space_rc = fr_rc;
int text_width = 0;
- SIZE space_size = {0};
- SIZE counts_size = {0};
+ SIZE space_size = { 0 };
+ SIZE counts_size = { 0 };
// Get widths
counts_rc = fr_rc;
- DrawText(hdcMem, _T(" "), 1, &space_rc, DT_CALCRECT | DT_NOPREFIX );
+ DrawText(hdcMem, _T(" "), 1, &space_rc, DT_CALCRECT | DT_NOPREFIX);
space_size.cx = space_rc.right - space_rc.left;
- space_size.cy = min( space_rc.bottom - space_rc.top, fr_rc.bottom-fr_rc.top );
+ space_size.cy = min(space_rc.bottom - space_rc.top, fr_rc.bottom - fr_rc.top);
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &counts_rc, DT_CALCRECT );
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
+ DrawTextA(hdcMem, szCounts, mir_strlen(szCounts), &counts_rc, DT_CALCRECT);
counts_size.cx = counts_rc.right - counts_rc.left;
- counts_size.cy = min( counts_rc.bottom - counts_rc.top, fr_rc.bottom-fr_rc.top );
+ counts_size.cy = min(counts_rc.bottom - counts_rc.top, fr_rc.bottom - fr_rc.top);
text_width = fr_rc.right - fr_rc.left - space_size.cx - counts_size.cx;
- if ( text_width > 4 )
+ if (text_width > 4)
{
- text_size.cx = min( text_width, text_size.cx );
+ text_size.cx = min(text_width, text_size.cx);
text_width = text_size.cx + space_size.cx + counts_size.cx;
}
else
@@ -971,25 +971,25 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
space_size.cx = 0;
counts_size.cx = 0;
}
- text_rect.right = text_rect.left+text_size.cx;
+ text_rect.right = text_rect.left + text_size.cx;
counts_rc = text_rect;
- counts_rc.left = text_rect.right+space_size.cx;
- counts_rc.right = counts_rc.left+counts_size.cx;
+ counts_rc.left = text_rect.right + space_size.cx;
+ counts_rc.right = counts_rc.left + counts_size.cx;
}
}
- ChangeToFont(hdcMem, dat, GetBasicFontID( Drawing ), NULL );
+ ChangeToFont(hdcMem, dat, GetBasicFontID(Drawing), NULL);
// Set color
- if ( selected )
- SetTextColor(hdcMem, dat->selTextColour );
- else if ( hottrack )
- _SetHotTrackColour(hdcMem, dat );
- if ( dat->text_rtl != 0 ) _RTLRect( &text_rect, free_row_rc.right, dx );
- _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if ( ((dat->filterSearch && Drawing->type != CLCIT_GROUP) || selected) && dat->szQuickSearch[0] != '\0' )
+ if (selected)
+ SetTextColor(hdcMem, dat->selTextColour);
+ else if (hottrack)
+ _SetHotTrackColour(hdcMem, dat);
+ if (dat->text_rtl != 0) _RTLRect(&text_rect, free_row_rc.right);
+ _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, 0, mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ if (((dat->filterSearch && Drawing->type != CLCIT_GROUP) || selected) && dat->szQuickSearch[0] != '\0')
{
int idx = 0;
- if ( dat->filterSearch )
+ if (dat->filterSearch)
{
TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
@@ -997,15 +997,15 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
if (p1)
idx = int(p1 - lowered);
}
- SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, idx, mir_tstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ SetTextColor(hdcMem, dat->quickSearchColour);
+ _DrawTextSmiley(hdcMem, &text_rect, &text_size, Drawing->szText, idx, mir_tstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
- if ( Drawing->type == CLCIT_GROUP && szCounts && szCounts[0] && counts_rc.right-counts_rc.left>0 )
+ 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 );
- ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &counts_rc, uTextFormat );
- if ( dat->text_rtl == 0 )
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
+ if (dat->text_rtl != 0) _RTLRect(&counts_rc, free_row_rc.right);
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen(szCounts), &counts_rc, uTextFormat);
+ if (dat->text_rtl == 0)
text_rect.right = counts_rc.right;
else
text_rect.left = counts_rc.left;
@@ -1013,141 +1013,141 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
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);
Drawing->pos_rename_rect = rc;
}
- if ((!InClistWindow || !g_CluiData.fLayered ) && (( Drawing->type == CLCIT_DIVIDER ) || ( Drawing->type == CLCIT_GROUP && dat->exStyle&CLS_EX_LINEWITHGROUPS )))
+ if ((!InClistWindow || !g_CluiData.fLayered) && ((Drawing->type == CLCIT_DIVIDER) || (Drawing->type == CLCIT_GROUP && dat->exStyle&CLS_EX_LINEWITHGROUPS)))
{
//???
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;
+ rc.right = text_rect.left - 3;
}
else
- rc.left = text_rect.right+3;
- if ( rc.right-rc.left>4 )
+ rc.left = text_rect.right + 3;
+ if (rc.right - rc.left > 4)
{
- rc.top += (( rc.bottom-rc.top )>>1 )-1;
- rc.bottom = rc.top+2;
- DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT );
- ske_SetRectOpaque(hdcMem, &rc );
+ rc.top += ((rc.bottom - rc.top) >> 1) - 1;
+ rc.bottom = rc.top + 2;
+ DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
+ ske_SetRectOpaque(hdcMem, &rc);
}
}
}
return;
}
- minheight = max( minheight, height );
- dy += ( minheight>height )?(( minheight-height )>>1 ):0;
+ minheight = max(minheight, height);
+ dy += (minheight > height) ? ((minheight - height) >> 1) : 0;
// Call Placement
- cppCalculateRowItemsPos( gl_RowRoot, free_row_rc.right-free_row_rc.left );
+ 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
- && gl_RowTabAccess[i]->r.bottom-gl_RowTabAccess[i]->r.top>0 )
+ if (gl_RowTabAccess[i]->r.right - gl_RowTabAccess[i]->r.left>0
+ && gl_RowTabAccess[i]->r.bottom - gl_RowTabAccess[i]->r.top > 0)
{
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 );
- switch ( gl_RowTabAccess[i]->type )
+ 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);
+ switch (gl_RowTabAccess[i]->type)
{
case TC_TEXT1:
+ {
+ //paint text 1
+ SIZE text_size;
+ UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
+ text_size.cx = p_rect.right - p_rect.left;
+ 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 = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
+ if (Drawing->type == CLCIT_CONTACT)
{
- //paint text 1
- SIZE text_size;
- UINT uTextFormat = ( dat->text_rtl ? DT_RTLREADING : 0 ) ;
- text_size.cx = p_rect.right-p_rect.left;
- 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 = uTextFormat | ( gl_TrimText?DT_END_ELLIPSIS:0 )|DT_SINGLELINE;
- if ( Drawing->type == CLCIT_CONTACT )
+ if (selected)
+ SetTextColor(hdcMem, dat->selTextColour);
+ else if (hottrack)
+ _SetHotTrackColour(hdcMem, dat);
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, 0, mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ if ((dat->filterSearch || selected) && dat->szQuickSearch[0] != '\0')
{
- if ( selected )
- SetTextColor(hdcMem, dat->selTextColour );
- else if ( hottrack )
- _SetHotTrackColour(hdcMem, dat );
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if ( (dat->filterSearch || selected) && dat->szQuickSearch[0] != '\0' )
+ int idx = 0;
+ if (dat->filterSearch)
{
- int idx = 0;
- if ( dat->filterSearch )
- {
- TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
- TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
- TCHAR *p1 = _tcsstr(lowered, lowered_search);
- if (p1)
- idx = int(p1 - lowered);
- }
- SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, idx, mir_tstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- }
- Drawing->pos_rename_rect = p_rect;
- {
- SIZE size;
- GetTextSize( &size, hdcMem, p_rect, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight );
- Drawing->pos_label = p_rect;
- Drawing->pos_label.right = min( Drawing->pos_label.right, Drawing->pos_label.left+size.cx );
+ TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
+ TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
+ TCHAR *p1 = _tcsstr(lowered, lowered_search);
+ if (p1)
+ idx = int(p1 - lowered);
}
-
+ SetTextColor(hdcMem, dat->quickSearchColour);
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, Drawing->szText, idx, mir_tstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
- else if ( Drawing->type == CLCIT_GROUP )
+ Drawing->pos_rename_rect = p_rect;
+ {
+ SIZE size;
+ GetTextSize(&size, hdcMem, p_rect, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight);
+ Drawing->pos_label = p_rect;
+ Drawing->pos_label.right = min(Drawing->pos_label.right, Drawing->pos_label.left + size.cx);
+ }
+
+ }
+ else if (Drawing->type == CLCIT_GROUP)
+ {
+ RECT nameRect = p_rect;
+ RECT countRect = { 0 };
+ RECT count_rc = { 0 };
+ SIZE count_size = { 0 };
+ int space_width = 0;
+ char * szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ // Has to draw the count?
+ if (szCounts && strlen(szCounts) > 0)
{
- RECT nameRect = p_rect;
- RECT countRect = {0};
- RECT count_rc = {0};
- SIZE count_size = {0};
- int space_width = 0;
- char * szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
- // Has to draw the count?
- if ( szCounts && strlen( szCounts )>0 )
- {
- // calc width and height
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- ske_DrawText(hdcMem, _T(" "), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX );
- count_size.cx = count_rc.right-count_rc.left;
- space_width = count_size.cx;
- count_rc.right = 0;
- count_rc.left = 0;
- ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &count_rc, DT_CALCRECT );
- count_size.cx += count_rc.right-count_rc.left;
- count_size.cy = count_rc.bottom-count_rc.top;
- }
- // modify text rect
- //if (!RTL )
+ // calc width and height
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
+ ske_DrawText(hdcMem, _T(" "), 1, &count_rc, DT_CALCRECT | DT_NOPREFIX);
+ count_size.cx = count_rc.right - count_rc.left;
+ space_width = count_size.cx;
+ count_rc.right = 0;
+ count_rc.left = 0;
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen(szCounts), &count_rc, DT_CALCRECT);
+ count_size.cx += count_rc.right - count_rc.left;
+ count_size.cy = count_rc.bottom - count_rc.top;
+ }
+ // modify text rect
+ //if (!RTL )
{
- SIZE text_size = {0};
- int wid = p_rect.right-p_rect.left;
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPS:FONTID_CLOSEDGROUPS, NULL );
- GetTextSize( &text_size, hdcMem, p_rect, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight );
+ SIZE text_size = { 0 };
+ int wid = p_rect.right - p_rect.left;
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, NULL);
+ GetTextSize(&text_size, hdcMem, p_rect, Drawing->szText, Drawing->ssText.plText, 0, dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight);
- if ( wid-count_size.cx > text_size.cx )
+ 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;
+ int x = (dat->row_align_group_mode == 1) ? (wid - (text_size.cx + count_size.cx)) >> 1 : 0;
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;
+ nameRect.right = nameRect.left + text_size.cx;
+ countRect.left = nameRect.right + space_width;
+ countRect.right = countRect.left + count_size.cx - space_width;
}
else
{
countRect.right = nameRect.right;
- countRect.left = countRect.right-(( count_size.cx>0 )?( count_size.cx-space_width ):0 );
- nameRect.right = countRect.left-(( count_size.cx>0 )?space_width:0 );
- nameRect.left = nameRect.right-text_size.cx;
+ countRect.left = countRect.right - ((count_size.cx > 0) ? (count_size.cx - space_width) : 0);
+ nameRect.right = countRect.left - ((count_size.cx > 0) ? space_width : 0);
+ nameRect.left = nameRect.right - text_size.cx;
}
}
@@ -1156,7 +1156,7 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
{
countRect.right = nameRect.right;
nameRect.right -= count_size.cx;
- countRect.left = nameRect.right+space_width;
+ countRect.left = nameRect.right + space_width;
}
countRect.bottom = nameRect.bottom;
countRect.top = nameRect.top;
@@ -1168,359 +1168,357 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
//uTextFormat |= ( dat->row_align_group_mode == 2 )?DT_RIGHT:( dat->row_align_group_mode == 1 )?DT_CENTER:DT_LEFT;
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, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ 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, 0, mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
if (selected && !dat->filterSearch) {
- SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen( Drawing->szText ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ SetTextColor(hdcMem, dat->quickSearchColour);
+ _DrawTextSmiley(hdcMem, &nameRect, &text_size, Drawing->szText, 0, mir_tstrlen(Drawing->szText), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
- if ( szCounts && strlen( szCounts )>0 )
+ if (szCounts && strlen(szCounts) > 0)
{
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- if ( selected )
- SetTextColor(hdcMem, dat->selTextColour );
- else if ( hottrack )
- _SetHotTrackColour(hdcMem, dat );
- ske_DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &countRect, uTextFormat );
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
+ if (selected)
+ SetTextColor(hdcMem, dat->selTextColour);
+ else if (hottrack)
+ _SetHotTrackColour(hdcMem, dat);
+ ske_DrawTextA(hdcMem, szCounts, mir_strlen(szCounts), &countRect, uTextFormat);
}
Drawing->pos_rename_rect = p_rect;
Drawing->pos_label = nameRect;
- }
- break;
}
+ break;
+ }
case TC_TEXT2:
+ {
+ // paint text 2
+ //
+ // Select font
+ SIZE text_size;
+ UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
{
- // paint text 2
- //
- // Select font
- SIZE text_size;
- UINT uTextFormat = ( dat->text_rtl ? DT_RTLREADING : 0 ) ;
+ if (dat->second_line_show && dat->second_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone)
{
- if ( dat->second_line_show && dat->second_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone )
- {
- // Get contact time
- TCHAR buf[70] = _T("");
- mir_free_and_nil( pdnce->szSecondLineText );
+ // Get contact time
+ TCHAR buf[70] = _T("");
+ mir_free_and_nil(pdnce->szSecondLineText);
- tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
- pdnce->szSecondLineText = mir_tstrdup( buf );
- }
+ tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
+ 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;
+ text_size.cx = p_rect.right - p_rect.left;
+ text_size.cy = p_rect.bottom - p_rect.top;
- ChangeToFont(hdcMem, dat, FONTID_SECONDLINE, NULL );
- uTextFormat = uTextFormat | ( gl_TrimText?DT_END_ELLIPSIS:0 )|DT_SINGLELINE;
- if ( Drawing->type == CLCIT_CONTACT )
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szSecondLineText, 0, mir_tstrlen( pdnce->szSecondLineText ), pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys );
- break;
- }
+ ChangeToFont(hdcMem, dat, FONTID_SECONDLINE, NULL);
+ uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
+ if (Drawing->type == CLCIT_CONTACT)
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szSecondLineText, 0, mir_tstrlen(pdnce->szSecondLineText), pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys);
+ break;
+ }
case TC_TEXT3:
+ {
+ //paint text 3
+ // Select font
+ SIZE text_size;
+ UINT uTextFormat = (dat->text_rtl ? DT_RTLREADING : 0);
{
- //paint text 3
- // Select font
- SIZE text_size;
- UINT uTextFormat = ( dat->text_rtl ? DT_RTLREADING : 0 ) ;
+ if (dat->third_line_show && dat->third_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone)
{
- if ( dat->third_line_show && dat->third_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone )
- {
- // Get contact time
- TCHAR buf[70] = _T("");
- mir_free( pdnce->szThirdLineText );
+ // Get contact time
+ TCHAR buf[70] = _T("");
+ mir_free(pdnce->szThirdLineText);
- tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
- pdnce->szThirdLineText = mir_tstrdup( buf );
- }
+ tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
+ 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;
+ text_size.cx = p_rect.right - p_rect.left;
+ text_size.cy = p_rect.bottom - p_rect.top;
- ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL );
- uTextFormat = uTextFormat | ( gl_TrimText?DT_END_ELLIPSIS:0 )|DT_SINGLELINE;
- if ( Drawing->type == CLCIT_CONTACT )
- _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szThirdLineText, 0, mir_tstrlen( pdnce->szThirdLineText ), pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys );
- break;
- }
+ ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL);
+ uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0) | DT_SINGLELINE;
+ if (Drawing->type == CLCIT_CONTACT)
+ _DrawTextSmiley(hdcMem, &p_rect, &text_size, pdnce->szThirdLineText, 0, mir_tstrlen(pdnce->szThirdLineText), pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys);
+ break;
+ }
case TC_STATUS:
- {
+ {
- if (( Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon )
- || ( 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 )
- )
- && !Drawing->image_is_special )))
+ if ((Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon)
+ || (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)
+ )
+ && !Drawing->image_is_special)))
+ {
+ int iImage = -1;
+ // Get image
+ if (Drawing->type == CLCIT_GROUP)
{
- int iImage = -1;
- // Get image
- if ( Drawing->type == CLCIT_GROUP )
+ if (!dat->row_hide_group_icon) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ else iImage = -1;
+ }
+ else if (Drawing->type == CLCIT_CONTACT)
+ iImage = Drawing->iImage;
+ if (iImage != -1)
+ {
+ COLORREF colourFg;
+ int mode;
+ // Store pos
+ Drawing->pos_icon = p_rect;
+ if (hottrack)
{
- if (!dat->row_hide_group_icon ) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
- else iImage = -1;
+ colourFg = dat->hotTextColour;
+ mode = ILD_NORMAL;
}
- else if ( Drawing->type == CLCIT_CONTACT )
- iImage = Drawing->iImage;
- if ( iImage != -1 )
+ else if (Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST)
{
- COLORREF colourFg;
- int mode;
- // Store pos
- Drawing->pos_icon = p_rect;
- if ( hottrack )
- {
- colourFg = dat->hotTextColour;
- mode = ILD_NORMAL;
- }
- else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
- {
- colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
- mode = ILD_BLEND50;
- }
- else
- {
- colourFg = dat->selBkColour;
- mode = ILD_NORMAL;
- }
+ colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
+ mode = ILD_BLEND50;
+ }
+ else
+ {
+ colourFg = dat->selBkColour;
+ mode = ILD_NORMAL;
+ }
- if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE )
- {
- mode = ILD_SELECTED;
- }
+ if (Drawing->type == CLCIT_CONTACT && dat->showIdle && (Drawing->flags&CONTACTF_IDLE) &&
+ _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 );
+ _DrawStatusIcon(Drawing, dat, iImage, hdcMem, p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode);
- }
}
-
- break;
}
+
+ break;
+ }
case TC_AVATAR:
+ {
+ 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)
+ blendmode = 128;
+ if (!hasAvatar) //if no avatar then paint icon image
{
- 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 )
- blendmode = 128;
- if (!hasAvatar ) //if no avatar then paint icon image
+ int iImage = Drawing->iImage;
+ if (iImage != -1)
{
- int iImage = Drawing->iImage;
- if ( iImage != -1 )
+ COLORREF colourFg;
+ int mode;
+ // Store pos
+ Drawing->pos_icon = p_rect;
+ if (hottrack)
{
- COLORREF colourFg;
- int mode;
- // Store pos
- Drawing->pos_icon = p_rect;
- if ( hottrack )
- {
- colourFg = dat->hotTextColour;
- mode = ILD_NORMAL;
- }
- else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
- {
- colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
- mode = ILD_BLEND50;
- }
- else
- {
- colourFg = dat->selBkColour;
- mode = ILD_NORMAL;
- }
-
- if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _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 );
-
+ colourFg = dat->hotTextColour;
+ mode = ILD_NORMAL;
}
- }
- else
- {
- HRGN rgn = NULL;
- HRGN oldrgn;
- int round_radius = 0;
- int width = p_rect.right-p_rect.left;
- int height = p_rect.bottom-p_rect.top;
- // Store pos
- Drawing->pos_avatar = p_rect;
- oldrgn = CreateRectRgn( 0, 0, 0, 0 );
- GetClipRgn(hdcMem, oldrgn );
-
- // Round corners
- if ( dat->avatars_round_corners )
+ else if (Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST)
{
- if ( dat->avatars_use_custom_corner_size )
- round_radius = dat->avatars_custom_corner_size;
- else
- round_radius = min( width, height ) / 5;
+ colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
+ mode = ILD_BLEND50;
}
else
{
- round_radius = 0;
+ colourFg = dat->selBkColour;
+ mode = ILD_NORMAL;
}
- if ( dat->avatars_draw_border )
+
+ if (Drawing->type == CLCIT_CONTACT && dat->showIdle && (Drawing->flags&CONTACTF_IDLE) &&
+ _GetRealStatus(Drawing, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
{
- 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 );
- CombineRgn( rgn2, rgn, rgn2, RGN_DIFF );
- // FrameRgn(hdcMem, rgn, hBrush, 1, 1 );
- FillRgn(hdcMem, rgn2, hBrush );
- ske_SetRgnOpaque(hdcMem, rgn2 );
- SelectObject(hdcMem, hOldBrush );
- DeleteObject( hBrush );
- DeleteObject( rgn );
- DeleteObject( rgn2 );
+ mode = ILD_SELECTED;
}
- if ( dat->avatars_round_corners || dat->avatars_draw_border )
+
+ _DrawStatusIcon(Drawing, dat, iImage, hdcMem, p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode);
+
+ }
+ }
+ else
+ {
+ HRGN rgn = NULL;
+ HRGN oldrgn;
+ int round_radius = 0;
+ int width = p_rect.right - p_rect.left;
+ int height = p_rect.bottom - p_rect.top;
+ // Store pos
+ Drawing->pos_avatar = p_rect;
+ oldrgn = CreateRectRgn(0, 0, 0, 0);
+ GetClipRgn(hdcMem, oldrgn);
+
+ // Round corners
+ if (dat->avatars_round_corners)
+ {
+ if (dat->avatars_use_custom_corner_size)
+ round_radius = dat->avatars_custom_corner_size;
+ else
+ round_radius = min(width, height) / 5;
+ }
+ else
+ {
+ round_radius = 0;
+ }
+ if (dat->avatars_draw_border)
+ {
+ 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);
+ CombineRgn(rgn2, rgn, rgn2, RGN_DIFF);
+ // FrameRgn(hdcMem, rgn, hBrush, 1, 1 );
+ FillRgn(hdcMem, rgn2, hBrush);
+ ske_SetRgnOpaque(hdcMem, rgn2);
+ SelectObject(hdcMem, hOldBrush);
+ DeleteObject(hBrush);
+ DeleteObject(rgn);
+ DeleteObject(rgn2);
+ }
+ if (dat->avatars_round_corners || dat->avatars_draw_border)
+ {
+ int k = dat->avatars_draw_border ? 1 : 0;
+ rgn = CreateRoundRectRgn(p_rect.left + k, p_rect.top + k, p_rect.right + 1 - k, p_rect.bottom + 1 - k, round_radius * 2, round_radius * 2);
+ ExtSelectClipRgn(hdcMem, rgn, RGN_AND);
+ }
+
+ // Draw avatar
+ if (dat->use_avatar_service)
+ {
+ _DrawContactAvatar(hdcMem, dat, Drawing, &row_rc, selected, hottrack, &p_rect);
+ }
+ else
+ {
+ ImageArray_DrawImage(&dat->avatar_cache, Drawing->avatar_pos, hdcMem, p_rect.left, p_rect.top, 255);
+ }
+ // Restore region
+ if (dat->avatars_round_corners || dat->avatars_draw_border)
+ {
+ DeleteObject(rgn);
+ }
+ SelectClipRgn(hdcMem, oldrgn);
+ DeleteObject(oldrgn);
+
+
+ // Draw borders
+
+ //TODO fix overlays
+ // Draw overlay
+ if (dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
+ && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons))
+ {
+ p_rect.top = p_rect.bottom - ICON_HEIGHT;
+ p_rect.left = p_rect.right - ICON_HEIGHT;
+
+ if (dat->avatars_draw_border)
{
- int k = dat->avatars_draw_border?1:0;
- rgn = CreateRoundRectRgn( p_rect.left+k, p_rect.top+k, p_rect.right+1-k, p_rect.bottom+1-k, round_radius * 2, round_radius * 2 );
- ExtSelectClipRgn(hdcMem, rgn, RGN_AND );
+ p_rect.top--;
+ p_rect.left--;
}
- // Draw avatar
- if ( dat->use_avatar_service )
+ switch (dat->avatars_overlay_type)
{
- int w = width;
- int h = height;
- _DrawContactAvatar(hdcMem, dat, Drawing, &row_rc, selected, hottrack, p_rect, &p_rect );
- }
- else
+ case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
{
- ImageArray_DrawImage( &dat->avatar_cache, Drawing->avatar_pos, hdcMem, p_rect.left, p_rect.top, 255 );
+ UINT a = blendmode;
+ 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,
+ CLR_NONE, CLR_NONE,
+ (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
+
+ //ske_DrawIconEx(hdcMem, p_rect.left, p_rect.top, g_pAvatarOverlayIcons[GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE].icon,
+ // ICON_HEIGHT, ICON_HEIGHT, 0, NULL, DI_NORMAL|a );
+ break;
}
- // Restore region
- if ( dat->avatars_round_corners || dat->avatars_draw_border )
+ case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
{
- DeleteObject( rgn );
+ int item = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ 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);
}
- SelectClipRgn(hdcMem, oldrgn );
- DeleteObject( oldrgn );
-
-
- // Draw borders
-
- //TODO fix overlays
- // Draw overlay
- if (dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
- && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons))
- {
- p_rect.top = p_rect.bottom - ICON_HEIGHT;
- p_rect.left = p_rect.right - ICON_HEIGHT;
-
- if ( dat->avatars_draw_border )
- {
- p_rect.top--;
- p_rect.left--;
- }
-
- switch( dat->avatars_overlay_type )
- {
- case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
- {
- UINT a = blendmode;
- 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,
- CLR_NONE, CLR_NONE,
- ( blendmode == 255 )?ILD_NORMAL:( blendmode == 128 )?ILD_BLEND50:ILD_BLEND25 );
-
- //ske_DrawIconEx(hdcMem, p_rect.left, p_rect.top, g_pAvatarOverlayIcons[GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE].icon,
- // ICON_HEIGHT, ICON_HEIGHT, 0, NULL, DI_NORMAL|a );
- break;
- }
- case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
- {
- int item = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
- 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 );
- }
- break;
- case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
- 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 );
- break;
- }
+ break;
+ case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
+ 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);
+ break;
}
}
-
- break;
}
- case TC_EXTRA:
- {
- if ( Drawing->type == CLCIT_CONTACT &&
- (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 ))
- {
- int BlendedInActiveState = dat->dbbBlendInActiveState;
- int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
- int iImage;
- int count = 0;
- RECT rc;
- int x = 0;
- for ( iImage = 0; iImage < dat->extraColumnsCount ; iImage++ ) {
- COLORREF colourFg = dat->selBkColour;
- int mode = BlendedInActiveState?BlendValue:ILD_NORMAL;
- if (Drawing->iExtraImage[iImage] == EMPTY_EXTRA_ICON) {
- 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 );
- Drawing->pos_extra[iImage] = rc;
- count++;
- }
- continue;
- }
+ break;
+ }
+ case TC_EXTRA:
+ {
- if ( selected )
- mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
- else if (hottrack) {
- mode = BlendedInActiveState?ILD_NORMAL:ILD_FOCUS;
- colourFg = dat->hotTextColour;
- }
- else if (Drawing->type == CLCIT_CONTACT && (Drawing->flags & CONTACTF_NOTONLIST)) {
- colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
- mode = BlendValue;
+ if (Drawing->type == CLCIT_CONTACT &&
+ (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0))
+ {
+ int BlendedInActiveState = dat->dbbBlendInActiveState;
+ int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
+ int iImage;
+ int count = 0;
+ RECT rc;
+ int x = 0;
+ for (iImage = 0; iImage < dat->extraColumnsCount; iImage++) {
+ COLORREF colourFg = dat->selBkColour;
+ int mode = BlendedInActiveState ? BlendValue : ILD_NORMAL;
+ if (Drawing->iExtraImage[iImage] == EMPTY_EXTRA_ICON) {
+ 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);
+ Drawing->pos_extra[iImage] = rc;
+ count++;
}
+ continue;
+ }
- SetRect( &rc, p_rect.left+x, p_rect.top, p_rect.left+x+ICON_HEIGHT, p_rect.bottom );
- x += dat->extraColumnSpacing;
- count++;
- if ( dat->text_rtl != 0 ) _RTLRect( &rc, free_row_rc.right, 0 );
- Drawing->pos_extra[iImage] = rc;
- if (Drawing->iExtraImage[iImage] != EMPTY_EXTRA_ICON)
- ske_ImageList_DrawEx( dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
- rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode );
+ if (selected)
+ mode = BlendedInActiveState ? ILD_NORMAL : ILD_SELECTED;
+ else if (hottrack) {
+ mode = BlendedInActiveState ? ILD_NORMAL : ILD_FOCUS;
+ colourFg = dat->hotTextColour;
}
+ else if (Drawing->type == CLCIT_CONTACT && (Drawing->flags & CONTACTF_NOTONLIST)) {
+ colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
+ mode = BlendValue;
+ }
+
+ SetRect(&rc, p_rect.left + x, p_rect.top, p_rect.left + x + ICON_HEIGHT, p_rect.bottom);
+ x += dat->extraColumnSpacing;
+ count++;
+ if (dat->text_rtl != 0) _RTLRect(&rc, free_row_rc.right);
+ Drawing->pos_extra[iImage] = rc;
+ if (Drawing->iExtraImage[iImage] != EMPTY_EXTRA_ICON)
+ ske_ImageList_DrawEx(dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
+ rc.left, rc.top, 0, 0, CLR_NONE, colourFg, mode);
}
- break;
}
+ break;
+ }
case TC_EXTRA1:
case TC_EXTRA2:
case TC_EXTRA3:
@@ -1530,52 +1528,52 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
case TC_EXTRA7:
case TC_EXTRA8:
case TC_EXTRA9:
+ {
+ if (Drawing->type == CLCIT_CONTACT &&
+ (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0))
{
- if ( Drawing->type == CLCIT_CONTACT &&
- (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 ))
- {
- int eNum = gl_RowTabAccess[i]->type-TC_EXTRA1;
- if ( eNum < dat->extraColumnsCount )
- if (Drawing->iExtraImage[eNum] != EMPTY_EXTRA_ICON) {
- int mode = 0;
- int BlendedInActiveState = dat->dbbBlendInActiveState;
- int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
- if ( mode2 != -1 ) mode = mode2;
- else
+ int eNum = gl_RowTabAccess[i]->type - TC_EXTRA1;
+ if (eNum < dat->extraColumnsCount)
+ if (Drawing->iExtraImage[eNum] != EMPTY_EXTRA_ICON) {
+ int mode = 0;
+ int BlendedInActiveState = dat->dbbBlendInActiveState;
+ int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
+ if (mode2 != -1) mode = mode2;
+ else
+ {
+ if (selected) mode = BlendedInActiveState ? ILD_NORMAL : ILD_SELECTED;
+ else if (hottrack)
{
- if ( selected ) mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
- else if ( hottrack )
- {
- mode = BlendedInActiveState?ILD_NORMAL:ILD_FOCUS;
- colourFg = dat->hotTextColour;
- }
- else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST )
- {
- colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
- mode = BlendValue;
- }
- mode2 = mode;
+ mode = BlendedInActiveState ? ILD_NORMAL : ILD_FOCUS;
+ colourFg = dat->hotTextColour;
}
- if ( dat->text_rtl != 0 ) _RTLRect( &p_rect, free_row_rc.right, 0 );
- Drawing->pos_extra[eNum] = p_rect;
- if (Drawing->iExtraImage[eNum] != EMPTY_EXTRA_ICON)
- ske_ImageList_DrawEx( dat->himlExtraColumns, Drawing->iExtraImage[eNum], hdcMem,
- p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode );
+ else if (Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST)
+ {
+ colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
+ mode = BlendValue;
+ }
+ mode2 = mode;
}
- }
+ if (dat->text_rtl != 0) _RTLRect(&p_rect, free_row_rc.right);
+ Drawing->pos_extra[eNum] = p_rect;
+ if (Drawing->iExtraImage[eNum] != EMPTY_EXTRA_ICON)
+ ske_ImageList_DrawEx(dat->himlExtraColumns, Drawing->iExtraImage[eNum], hdcMem,
+ p_rect.left, p_rect.top, 0, 0, CLR_NONE, colourFg, mode);
+ }
}
+ }
case TC_TIME:
- {
- TCHAR szResult[80];
+ {
+ TCHAR szResult[80];
- if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
- {
- // Select font
- ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL );
- ske_DrawText(hdcMem, szResult, mir_tstrlen( szResult ), &p_rect, DT_NOPREFIX | DT_SINGLELINE|( dat->text_rtl ? DT_RTLREADING : 0 ));
- }
- break;
+ if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
+ {
+ // Select font
+ ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
+ ske_DrawText(hdcMem, szResult, mir_tstrlen(szResult), &p_rect, DT_NOPREFIX | DT_SINGLELINE | (dat->text_rtl ? DT_RTLREADING : 0));
}
+ break;
+ }
}
}
i++;
@@ -1586,62 +1584,62 @@ void CLCPaint::_PaintRowItemsEx( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
-void CLCPaint::_DrawStatusIcon( ClcContact *Drawing, ClcData *dat, int iImage, HDC hdcMem, int x, int y, int cx, int cy, DWORD colorbg, DWORD colorfg, int mode )
+void CLCPaint::_DrawStatusIcon(ClcContact *Drawing, 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 );
+ ske_ImageList_DrawEx(g_himlCListClc, LOWORD(iImage), hdcMem,
+ x, y, cx, cy, colorbg, colorfg, mode);
}
- else if ( Drawing->image_is_special )
+ else if (Drawing->image_is_special)
{
- ske_ImageList_DrawEx( g_himlCListClc, LOWORD(iImage), hdcMem,
- x, y, cx, cy, colorbg, colorfg, mode );
+ 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 );
+ int status = GetContactCachedStatus(Drawing->hContact);
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);
if (dat->drawOverlayedStatus & 2) //draw overlay
- ske_ImageList_DrawEx( hAvatarOverlays, g_pStatusOverlayIcons[status-ID_STATUS_OFFLINE].listID, hdcMem,
- x, y, cx, cy, colorbg, colorfg, mode );
+ ske_ImageList_DrawEx(hAvatarOverlays, g_pStatusOverlayIcons[status - ID_STATUS_OFFLINE].listID, hdcMem,
+ x, y, cx, cy, colorbg, colorfg, mode);
}
else
{
- ske_ImageList_DrawEx( g_himlCListClc, LOWORD(iImage), hdcMem,
- x, y, cx, cy, colorbg, colorfg, mode );
+ ske_ImageList_DrawEx(g_himlCListClc, LOWORD(iImage), hdcMem,
+ x, y, cx, cy, colorbg, colorfg, mode);
}
}
-BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT *rcPaint, RECT clRect, ClcData *dat )
+BOOL CLCPaint::_DrawNonEnginedBackground(HDC hdcMem, RECT *rcPaint, RECT clRect, ClcData *dat)
{
if (!dat->hBmpBackground)
return FALSE;
// XXX: Halftone isnt supported on 9x, however the scretch problems dont happen on 98.
- SetStretchBltMode(hdcMem, HALFTONE );
+ SetStretchBltMode(hdcMem, HALFTONE);
BITMAP bmp;
GetObject(dat->hBmpBackground, sizeof(bmp), &bmp);
- HDC hdcBmp = CreateCompatibleDC(hdcMem );
- HBITMAP oldbm = ( HBITMAP )SelectObject( hdcBmp, dat->hBmpBackground );
- int x, y = dat->backgroundBmpUse&CLBF_SCROLL?-dat->yScroll:0;
- int maxx = dat->backgroundBmpUse&CLBF_TILEH?clRect.right:1;
- int maxy = dat->backgroundBmpUse&CLBF_TILEV?maxy = rcPaint->bottom:y+1;
+ HDC hdcBmp = CreateCompatibleDC(hdcMem);
+ HBITMAP oldbm = (HBITMAP)SelectObject(hdcBmp, dat->hBmpBackground);
+ int x, y = dat->backgroundBmpUse&CLBF_SCROLL ? -dat->yScroll : 0;
+ int maxx = dat->backgroundBmpUse&CLBF_TILEH ? clRect.right : 1;
+ int maxy = dat->backgroundBmpUse&CLBF_TILEV ? maxy = rcPaint->bottom : y + 1;
int destw, desth;
- switch( dat->backgroundBmpUse&CLBM_TYPE ) {
+ switch (dat->backgroundBmpUse&CLBM_TYPE) {
case CLB_STRETCH:
- if ( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
- if ( clRect.right*bmp.bmHeight < clRect.bottom*bmp.bmWidth ) {
+ if (dat->backgroundBmpUse&CLBF_PROPORTIONAL) {
+ if (clRect.right*bmp.bmHeight < clRect.bottom*bmp.bmWidth) {
desth = clRect.bottom;
- destw = desth*bmp.bmWidth/bmp.bmHeight;
+ destw = desth*bmp.bmWidth / bmp.bmHeight;
}
else {
destw = clRect.right;
- desth = destw*bmp.bmHeight/bmp.bmWidth;
+ desth = destw*bmp.bmHeight / bmp.bmWidth;
}
}
else {
@@ -1651,14 +1649,14 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT *rcPaint,
break;
case CLB_STRETCHH:
- if ( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
+ if (dat->backgroundBmpUse&CLBF_PROPORTIONAL) {
destw = clRect.right;
- desth = destw*bmp.bmHeight/bmp.bmWidth;
+ desth = destw*bmp.bmHeight / bmp.bmWidth;
}
else {
destw = clRect.right;
desth = bmp.bmHeight;
- if ( dat->backgroundBmpUse&CLBF_TILEVTOROWHEIGHT )
+ if (dat->backgroundBmpUse&CLBF_TILEVTOROWHEIGHT)
{
desth = dat->row_min_heigh;
}
@@ -1667,9 +1665,9 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT *rcPaint,
break;
case CLB_STRETCHV:
- if ( dat->backgroundBmpUse&CLBF_PROPORTIONAL ) {
+ if (dat->backgroundBmpUse&CLBF_PROPORTIONAL) {
desth = clRect.bottom;
- destw = desth*bmp.bmWidth/bmp.bmHeight;
+ destw = desth*bmp.bmWidth / bmp.bmHeight;
}
else {
destw = bmp.bmWidth;
@@ -1680,91 +1678,91 @@ BOOL CLCPaint::_DrawNonEnginedBackground( HWND hwnd, HDC hdcMem, RECT *rcPaint,
default: //clb_topleft
destw = bmp.bmWidth;
desth = bmp.bmHeight;
- if ( dat->backgroundBmpUse&CLBF_TILEVTOROWHEIGHT )
+ if (dat->backgroundBmpUse&CLBF_TILEVTOROWHEIGHT)
{
desth = dat->row_min_heigh;
}
break;
}
- for ( ;y < maxy;y += desth ) {
- if ( y < rcPaint->top-desth ) continue;
- for ( x = 0;x < maxx;x += destw )
- StretchBlt(hdcMem, x, y, destw, desth, hdcBmp, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY );
+ 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 );
- DeleteDC( hdcBmp );
+ SelectObject(hdcBmp, oldbm);
+ DeleteDC(hdcBmp);
return TRUE;
}
-int CLCPaint::_DetermineDrawMode( HWND hWnd, ClcData *dat )
+int CLCPaint::_DetermineDrawMode(HWND hWnd, ClcData *dat)
{
int paintMode = DM_LAYERED; // by default
- if ( dat->force_in_dialog )
+ if (dat->force_in_dialog)
paintMode = DM_CONTROL;
- else if ( g_CluiData.fDisableSkinEngine )
+ else if (g_CluiData.fDisableSkinEngine)
paintMode = DM_CLASSIC;
- else if (!g_CluiData.fLayered )
+ else if (!g_CluiData.fLayered)
paintMode = DM_NON_LAYERED;
- if (!(paintMode&DM_CONTROL) && !CLUI_IsInMainWindow( hWnd ))
+ 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 )))
+ if ((lStyle & WS_DISABLED)
+ || (dat->greyoutFlags & pcli->pfnClcStatusToPf2(nStatus))
+ || ((dat->greyoutFlags & GREYF_UNFOCUS) && (GetFocus() != hWnd)))
paintMode |= DM_GRAY;
- if ( lStyle&CLS_GREYALTERNATE )
+ if (lStyle&CLS_GREYALTERNATE)
paintMode |= DM_GREYALTERNATE;
return paintMode;
}
-void CLCPaint::_PreparePaintContext( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT& clRect, _PaintContext& pc )
+void CLCPaint::_PreparePaintContext(ClcData *dat, HDC hdc, int paintMode, RECT& clRect, _PaintContext& pc)
{
if ((paintMode & DM_GRAY) && !(paintMode & DM_LAYERED)) {
pc.hdcMem2 = CreateCompatibleDC(hdc);
if (paintMode & DM_CLASSIC)
- pc.hBmpOsb2 = CreateBitmap( clRect.right, clRect.bottom, 1, GetDeviceCaps( hdc, BITSPIXEL ), NULL );
+ pc.hBmpOsb2 = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), NULL);
else
- pc.hBmpOsb2 = ske_CreateDIB32( clRect.right, clRect.bottom );
- pc.oldbmp2 = (HBITMAP)SelectObject( pc.hdcMem2, pc.hBmpOsb2 );
+ pc.hBmpOsb2 = ske_CreateDIB32(clRect.right, clRect.bottom);
+ pc.oldbmp2 = (HBITMAP)SelectObject(pc.hdcMem2, pc.hBmpOsb2);
pc.fRelease |= _PaintContext::release_hdcmem2;
}
if (paintMode & (DM_DRAW_OFFSCREEN | DM_GRAY)) {
pc.hdcMem = CreateCompatibleDC(hdc);
pc.fRelease |= _PaintContext::release_hdcmem;
- pc.hBmpOsb = ske_CreateDIB32( clRect.right, clRect.bottom );
- pc.oldbmp = (HBITMAP)SelectObject( pc.hdcMem, pc.hBmpOsb );
+ pc.hBmpOsb = ske_CreateDIB32(clRect.right, clRect.bottom);
+ pc.oldbmp = (HBITMAP)SelectObject(pc.hdcMem, pc.hBmpOsb);
}
if ((paintMode & DM_CONTROL) && !dat->bkChanged) {
- pc.tmpbkcolour = GetSysColor( COLOR_3DFACE );
- pc.tmpforecolour = GetSysColor( COLOR_BTNTEXT );
+ pc.tmpbkcolour = GetSysColor(COLOR_3DFACE);
+ pc.tmpforecolour = GetSysColor(COLOR_BTNTEXT);
}
else {
- pc.tmpbkcolour = (!(paintMode & DM_CONTROL) && dat->bkChanged ) ? dat->bkColour : (!dat->useWindowsColours ? dat->bkColour : GetSysColor( COLOR_3DFACE ));
+ pc.tmpbkcolour = (!(paintMode & DM_CONTROL) && dat->bkChanged) ? dat->bkColour : (!dat->useWindowsColours ? dat->bkColour : GetSysColor(COLOR_3DFACE));
pc.tmpforecolour = dat->fontModernInfo[FONTID_CONTACTS].colour;
}
- if ( paintMode & DM_GREYALTERNATE ) {
- int rDelta = ( GetRValue( pc.tmpbkcolour ) > GetRValue( pc.tmpforecolour )) ? -10 : 10;
- int gDelta = ( GetGValue( pc.tmpbkcolour ) > GetGValue( pc.tmpforecolour )) ? -10 : 10;
- int bDelta = ( GetBValue( pc.tmpbkcolour ) > GetBValue( pc.tmpforecolour )) ? -10 : 10;
- int rValue = GetRValue( pc.tmpbkcolour ) + rDelta;
- int gValue = GetRValue( pc.tmpbkcolour ) + gDelta;
- int bValue = GetRValue( pc.tmpbkcolour ) + bDelta;
+ if (paintMode & DM_GREYALTERNATE) {
+ int rDelta = (GetRValue(pc.tmpbkcolour) > GetRValue(pc.tmpforecolour)) ? -10 : 10;
+ int gDelta = (GetGValue(pc.tmpbkcolour) > GetGValue(pc.tmpforecolour)) ? -10 : 10;
+ int bDelta = (GetBValue(pc.tmpbkcolour) > GetBValue(pc.tmpforecolour)) ? -10 : 10;
+ int rValue = GetRValue(pc.tmpbkcolour) + rDelta;
+ int gValue = GetRValue(pc.tmpbkcolour) + gDelta;
+ int bValue = GetRValue(pc.tmpbkcolour) + bDelta;
- BYTE brValue = ( rValue >255) ? 255 : rValue < 0 ? 0 : (BYTE)rValue;
- BYTE bgValue = ( gValue >255) ? 255 : gValue < 0 ? 0 : (BYTE)gValue;
- BYTE bbValue = ( bValue >255) ? 255 : bValue < 0 ? 0 : (BYTE)bValue;
+ BYTE brValue = (rValue > 255) ? 255 : rValue < 0 ? 0 : (BYTE)rValue;
+ BYTE bgValue = (gValue >255) ? 255 : gValue < 0 ? 0 : (BYTE)gValue;
+ BYTE bbValue = (bValue >255) ? 255 : bValue < 0 ? 0 : (BYTE)bValue;
- pc.hBrushAlternateGrey = CreateSolidBrush( GetNearestColor( pc.hdcMem, RGB( brValue, bgValue, bbValue )));
+ pc.hBrushAlternateGrey = CreateSolidBrush(GetNearestColor(pc.hdcMem, RGB(brValue, bgValue, bbValue)));
}
// Set some draw states
@@ -1772,36 +1770,36 @@ void CLCPaint::_PreparePaintContext( HWND hWnd, ClcData *dat, HDC hdc, int paint
SetStretchBltMode(pc.hdcMem, HALFTONE);
POINT org;
- GetBrushOrgEx( pc.hdcMem, &org );
- SetBrushOrgEx( pc.hdcMem, org.x, org.y, NULL );
+ GetBrushOrgEx(pc.hdcMem, &org);
+ SetBrushOrgEx(pc.hdcMem, org.x, org.y, NULL);
}
-void CLCPaint::_DrawBackground( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT *rcPaint, RECT& clRect, _PaintContext& pc )
+void CLCPaint::_DrawBackground(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, RECT& clRect, _PaintContext& pc)
{
if (paintMode & (DM_FLOAT | DM_CONTROL)) {
- HBRUSH hBrush = CreateSolidBrush( pc.tmpbkcolour );
- FillRect( pc.hdcMem, rcPaint, hBrush );
- DeleteObject( hBrush );
- ske_SetRectOpaque( pc.hdcMem, rcPaint );
- if (!( paintMode & DM_GREYALTERNATE))
- SkinDrawGlyph( pc.hdcMem, &clRect, rcPaint, "CL,ID=Background,Type=Control");
- }
- else if ( paintMode&DM_CLASSIC) {
- if (!_DrawNonEnginedBackground( hWnd, pc.hdcMem, rcPaint, clRect, dat )) {
- HBRUSH hBrush = CreateSolidBrush( pc.tmpbkcolour );
- FillRect( pc.hdcMem, rcPaint, hBrush );
- DeleteObject( hBrush );
+ HBRUSH hBrush = CreateSolidBrush(pc.tmpbkcolour);
+ FillRect(pc.hdcMem, rcPaint, hBrush);
+ DeleteObject(hBrush);
+ ske_SetRectOpaque(pc.hdcMem, rcPaint);
+ if (!(paintMode & DM_GREYALTERNATE))
+ SkinDrawGlyph(pc.hdcMem, &clRect, rcPaint, "CL,ID=Background,Type=Control");
+ }
+ else if (paintMode&DM_CLASSIC) {
+ if (!_DrawNonEnginedBackground(pc.hdcMem, rcPaint, clRect, dat)) {
+ HBRUSH hBrush = CreateSolidBrush(pc.tmpbkcolour);
+ FillRect(pc.hdcMem, rcPaint, hBrush);
+ DeleteObject(hBrush);
}
}
else {
- if ( paintMode&DM_NON_LAYERED )
- ske_BltBackImage( hWnd, (paintMode&DM_GRAY) ? pc.hdcMem2 : pc.hdcMem, rcPaint );
+ if (paintMode&DM_NON_LAYERED)
+ ske_BltBackImage(hWnd, (paintMode&DM_GRAY) ? pc.hdcMem2 : pc.hdcMem, rcPaint);
SkinDrawGlyph(pc.hdcMem, &clRect, rcPaint, "CL,ID=Background");
}
}
-void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc )
+void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc)
{
ClcContact *Drawing;
ClcGroup *group = &dat->list;
@@ -1811,18 +1809,18 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
int subindex = -1;
int line_num = -1;
int y = -dat->yScroll;
- BOOL is_foreground = IsForegroundWindow( hWnd );
- LONG lStyle = GetWindowLongPtr( hWnd, GWL_STYLE );
+ BOOL is_foreground = IsForegroundWindow(hWnd);
+ LONG lStyle = GetWindowLongPtr(hWnd, GWL_STYLE);
- while( y < rcPaint->bottom )
+ while (y < rcPaint->bottom)
{
- if ( subindex == -1 )
+ if (subindex == -1)
{
- if ( group->scanIndex >= group->cl.count )
+ if (group->scanIndex >= group->cl.count)
{
group = group->parent;
indent--;
- if ( group == NULL ) break; // Finished list
+ if (group == NULL) break; // Finished list
group->scanIndex++;
continue;
}
@@ -1831,7 +1829,7 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
line_num++;
// Draw line, if needed
- if ( y > rcPaint->top - dat->row_heights[line_num] )
+ if (y > rcPaint->top - dat->row_heights[line_num])
{
int selected;
int hottrack;
@@ -1844,35 +1842,35 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
RECT rc;
// Get item to draw
- if ( group->scanIndex < group->cl.count )
+ if (group->scanIndex < group->cl.count)
{
- if ( subindex == -1 ) {
+ if (subindex == -1) {
Drawing = group->cl.items[group->scanIndex];
subident = 0;
}
else {
- Drawing = &( group->cl.items[group->scanIndex]->subcontacts[subindex] );
+ Drawing = &(group->cl.items[group->scanIndex]->subcontacts[subindex]);
subident = dat->subIndent;
}
}
else Drawing = NULL;
// Something to draw?
- if ( Drawing ) {
+ if (Drawing) {
// Calc row height
- if (!gl_RowRoot )
- RowHeights_GetRowHeight( dat, hWnd, Drawing, line_num );
+ if (!gl_RowRoot)
+ RowHeights_GetRowHeight(dat, hWnd, Drawing, line_num);
else
- RowHeight_CalcRowHeight( dat, hWnd, Drawing, line_num );
+ 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 );
+ 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] );
+ 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;
@@ -1881,9 +1879,9 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
free_row_height = free_row_rc.bottom - free_row_rc.top;
{
- HRGN rgn = CreateRectRgn( row_rc.left, row_rc.top, row_rc.right, row_rc.bottom );
- SelectClipRgn( pc.hdcMem, rgn );
- DeleteObject( rgn );
+ HRGN rgn = CreateRectRgn(row_rc.left, row_rc.top, row_rc.right, row_rc.bottom);
+ SelectClipRgn(pc.hdcMem, rgn);
+ DeleteObject(rgn);
}
// Store pos
@@ -1899,54 +1897,54 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
//**** Draw Background
// Alternating grey
- if ( paintMode&DM_GREYALTERNATE && line_num&1 )
+ if (paintMode&DM_GREYALTERNATE && line_num & 1)
{
- if ( paintMode&DM_CONTROL || dat->bkChanged )
- FillRect( pc.hdcMem, &row_rc, pc.hBrushAlternateGrey );
+ if (paintMode&DM_CONTROL || dat->bkChanged)
+ 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)))
+ if (!(paintMode&(DM_CLASSIC | DM_CONTROL)))
{
// Row background
if (!(paintMode&DM_CONTROL))
{ //Build mpRequest string
- mpRequest = _GetCLCContactRowBackModernMask( group, Drawing, indent, line_num, selected, hottrack, dat );
+ mpRequest = _GetCLCContactRowBackModernMask(group, Drawing, indent, line_num, selected, hottrack, dat);
{
RECT mrc = row_rc;
- if ( group->parent == 0
+ if (group->parent == 0
&& group->scanIndex != 0
&& group->scanIndex < group->cl.count
- && group->cl.items[group->scanIndex]->type == CLCIT_GROUP )
+ && group->cl.items[group->scanIndex]->type == CLCIT_GROUP)
{
mrc.top += dat->row_before_group_space;
}
- SkinDrawGlyphMask( pc.hdcMem, &mrc, rcPaint, mpRequest );
+ SkinDrawGlyphMask(pc.hdcMem, &mrc, rcPaint, mpRequest);
}
}
- if ( selected || hottrack )
+ if (selected || hottrack)
{
RECT mrc = row_rc;
- if ( Drawing->type == CLCIT_GROUP &&
- Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing )
+ if (Drawing->type == CLCIT_GROUP &&
+ Drawing->group->parent->groupId == 0 &&
+ Drawing->group->parent->cl.items[0] != Drawing)
{
mrc.top += dat->row_before_group_space;
}
// Selection background ( only if hole line - full/less )
- if ( dat->HiLightMode == 1 ) // Full or default
+ if (dat->HiLightMode == 1) // Full or default
{
- if ( selected )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection");
- if ( hottrack )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking");
+ if (selected)
+ SkinDrawGlyph(pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection");
+ if (hottrack)
+ SkinDrawGlyph(pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking");
}
- else if ( dat->HiLightMode == 2 ) // Less
+ else if (dat->HiLightMode == 2) // Less
{
- if ( selected )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection"); //instead of free_row_rc
- if ( hottrack )
- SkinDrawGlyph( pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking");
+ if (selected)
+ SkinDrawGlyph(pc.hdcMem, &mrc, rcPaint, "CL,ID=Selection"); //instead of free_row_rc
+ if (hottrack)
+ SkinDrawGlyph(pc.hdcMem, &mrc, rcPaint, "CL,ID=HotTracking");
}
}
@@ -1954,64 +1952,64 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
else
{
int checkboxWidth;
- if (( lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT ) ||
- ( lStyle&CLS_GROUPCHECKBOXES && Drawing->type == CLCIT_GROUP ) ||
- ( Drawing->type == CLCIT_INFO && Drawing->flags&CLCIIF_CHECKBOX ))
- checkboxWidth = dat->checkboxSize+2;
+ if ((lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT) ||
+ (lStyle&CLS_GROUPCHECKBOXES && Drawing->type == CLCIT_GROUP) ||
+ (Drawing->type == CLCIT_INFO && Drawing->flags&CLCIIF_CHECKBOX))
+ checkboxWidth = dat->checkboxSize + 2;
else checkboxWidth = 0;
//background
- if ( selected ) {
- switch ( dat->HiLightMode )
+ if (selected) {
+ switch (dat->HiLightMode)
{
case 0:
case 1:
+ {
+ 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))
{
- 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 ))
- {
- 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,
- dat->exStyle&CLS_EX_NOTRANSLUCENTSEL?ILD_NORMAL:ILD_BLEND25 );
- }
- SetTextColor( pc.hdcMem, paintMode&DM_CONTROL ? GetSysColor( COLOR_HIGHLIGHTTEXT ) : dat->selTextColour );
- break;
+ 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,
+ dat->exStyle&CLS_EX_NOTRANSLUCENTSEL ? ILD_NORMAL : ILD_BLEND25);
}
+ SetTextColor(pc.hdcMem, paintMode&DM_CONTROL ? GetSysColor(COLOR_HIGHLIGHTTEXT) : dat->selTextColour);
+ break;
+ }
case 2:
+ {
+ 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))
{
- 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 ))
- {
- 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,
- dat->exStyle&CLS_EX_NOTRANSLUCENTSEL?ILD_NORMAL:ILD_BLEND25 );
- }
- SetTextColor( pc.hdcMem, paintMode&DM_CONTROL ? GetSysColor( COLOR_HIGHLIGHTTEXT ) : dat->selTextColour );
- break;
+ 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,
+ dat->exStyle&CLS_EX_NOTRANSLUCENTSEL ? ILD_NORMAL : ILD_BLEND25);
}
+ SetTextColor(pc.hdcMem, paintMode&DM_CONTROL ? GetSysColor(COLOR_HIGHLIGHTTEXT) : dat->selTextColour);
+ break;
+ }
}
}
}
//**** Checkboxes
- if (( lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT ) ||
- ( lStyle&CLS_GROUPCHECKBOXES && Drawing->type == CLCIT_GROUP ) ||
- ( Drawing->type == CLCIT_INFO && Drawing->flags&CLCIIF_CHECKBOX ))
+ if ((lStyle&CLS_CHECKBOXES && Drawing->type == CLCIT_CONTACT) ||
+ (lStyle&CLS_GROUPCHECKBOXES && Drawing->type == CLCIT_GROUP) ||
+ (Drawing->type == CLCIT_INFO && Drawing->flags&CLCIIF_CHECKBOX))
{
//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);
- 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 );
+ 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 ));
+ 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;
free_row_rc.left = row_rc.left + left_pos;
@@ -2019,41 +2017,41 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
// Store pos
Drawing->pos_check = rc;
}
- _PaintRowItems( hWnd, pc.hdcMem, dat, Drawing, row_rc, free_row_rc, left_pos, right_pos, selected, hottrack, rcPaint );
- if ( mpRequest && !dat->force_in_dialog )
+ _PaintRowItems(hWnd, pc.hdcMem, dat, Drawing, row_rc, free_row_rc, left_pos, right_pos, selected, hottrack, rcPaint);
+ if (mpRequest && !dat->force_in_dialog)
{
free(mpRequest->pl_Params[1].szValue);
- mpRequest->pl_Params[1].szValue = strdupn("Ovl", 3 );
+ mpRequest->pl_Params[1].szValue = strdupn("Ovl", 3);
mpRequest->pl_Params[1].dwValueHash = mod_CalcHash("Ovl");
{
RECT mrc = row_rc;
- if ( Drawing->type == CLCIT_GROUP &&
- Drawing->group->parent->groupId == 0 &&
- Drawing->group->parent->cl.items[0] != Drawing )
+ if (Drawing->type == CLCIT_GROUP &&
+ Drawing->group->parent->groupId == 0 &&
+ Drawing->group->parent->cl.items[0] != Drawing)
{
mrc.top += dat->row_before_group_space;
}
- SkinDrawGlyphMask( pc.hdcMem, &mrc, rcPaint, mpRequest );
+ SkinDrawGlyphMask(pc.hdcMem, &mrc, rcPaint, mpRequest);
}
- SkinSelector_DeleteMask( mpRequest );
- mir_free( mpRequest );
+ SkinSelector_DeleteMask(mpRequest);
+ mir_free(mpRequest);
}
}
}
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 )
- && ( group->cl.items[group->scanIndex]->SubExpanded && dat->expandMeta ))
+ 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 )
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded)
{
group = group->cl.items[group->scanIndex]->group;
indent++;
@@ -2063,132 +2061,132 @@ void CLCPaint::_DrawLines( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT
}
group->scanIndex++;
}
- else if ( group->scanIndex >= group->cl.count )
+ else if (group->scanIndex >= group->cl.count)
{
subindex = -1;
}
}
- SelectClipRgn( pc.hdcMem, NULL );
+ SelectClipRgn(pc.hdcMem, NULL);
}
-void CLCPaint::_DrawInsertionMark( ClcData *dat, RECT& clRect, _PaintContext& pc )
+void CLCPaint::_DrawInsertionMark(ClcData *dat, RECT& clRect, _PaintContext& pc)
{
HBRUSH hBrush, hoBrush;
POINT pts[8];
HRGN hRgn;
int identation = dat->nInsertionLevel*dat->groupIndent;
- int yt = cliGetRowTopY( dat, dat->iInsertionMark );
+ int yt = cliGetRowTopY(dat, dat->iInsertionMark);
pts[0].y = yt - dat->yScroll - 4;
- if ( pts[0].y < -3 ) pts[0].y = -3;
- pts[0].x = 1+identation*( dat->text_rtl?0:1 );
+ 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;
- pts[1].y = pts[0].y+3;
+ pts[1].x = pts[0].x + 2;
+ pts[1].y = pts[0].y + 3;
- pts[2].x = clRect.right-identation*( dat->text_rtl?1:0 )-4;
+ pts[2].x = clRect.right - identation*(dat->text_rtl ? 1 : 0) - 4;
pts[2].y = pts[1].y;
- pts[3].x = clRect.right-1-identation*( dat->text_rtl?1:0 );
- pts[3].y = pts[0].y-1;
+ pts[3].x = clRect.right - 1 - identation*(dat->text_rtl ? 1 : 0);
+ pts[3].y = pts[0].y - 1;
- pts[4].x = pts[3].x; pts[4].y = pts[0].y+7;
- pts[5].x = pts[2].x+1; pts[5].y = pts[1].y+2;
+ pts[4].x = pts[3].x; pts[4].y = pts[0].y + 7;
+ pts[5].x = pts[2].x + 1; pts[5].y = pts[1].y + 2;
pts[6].x = pts[1].x; pts[6].y = pts[5].y;
pts[7].x = pts[0].x; pts[7].y = pts[4].y;
- hRgn = CreatePolygonRgn( pts, sizeof( pts )/sizeof( pts[0] ), ALTERNATE );
- hBrush = CreateSolidBrush( dat->fontModernInfo[FONTID_CONTACTS].colour );
- hoBrush = ( HBRUSH )SelectObject( pc.hdcMem, hBrush );
- FillRgn( pc.hdcMem, hRgn, hBrush );
- ske_SetRgnOpaque( pc.hdcMem, hRgn );
- SelectObject( pc.hdcMem, hoBrush );
- DeleteObject( hBrush );
+ hRgn = CreatePolygonRgn(pts, sizeof(pts) / sizeof(pts[0]), ALTERNATE);
+ hBrush = CreateSolidBrush(dat->fontModernInfo[FONTID_CONTACTS].colour);
+ hoBrush = (HBRUSH)SelectObject(pc.hdcMem, hBrush);
+ FillRgn(pc.hdcMem, hRgn, hBrush);
+ ske_SetRgnOpaque(pc.hdcMem, hRgn);
+ SelectObject(pc.hdcMem, hoBrush);
+ DeleteObject(hBrush);
}
-void CLCPaint::_CopyPaintToDest( HWND hWnd, ClcData *dat, HDC hdc, int paintMode, RECT* rcPaint, RECT& clRect, _PaintContext& pc )
+void CLCPaint::_CopyPaintToDest(HDC hdc, int paintMode, RECT* rcPaint, _PaintContext& pc)
{
- if (!( paintMode&DM_GRAY ) && ( paintMode & DM_DRAW_OFFSCREEN ))
+ if (!(paintMode&DM_GRAY) && (paintMode & DM_DRAW_OFFSCREEN))
{
- BitBlt( hdc, rcPaint->left, rcPaint->top, rcPaint->right-rcPaint->left, rcPaint->bottom-rcPaint->top, pc.hdcMem, rcPaint->left, rcPaint->top, SRCCOPY );
+ 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)));
- ske_AlphaBlend( a ? pc.hdcMem2 : hdc, rcPaint->left, rcPaint->top, rcPaint->right-rcPaint->left, rcPaint->bottom-rcPaint->top, pc.hdcMem, rcPaint->left, rcPaint->top, rcPaint->right-rcPaint->left, rcPaint->bottom-rcPaint->top, bf );
- if ( a )
- BitBlt( hdc, rcPaint->left, rcPaint->top, rcPaint->right-rcPaint->left, rcPaint->bottom-rcPaint->top, pc.hdcMem2, rcPaint->left, rcPaint->top, SRCCOPY );
+ BLENDFUNCTION bf = { AC_SRC_OVER, 0, 80, AC_SRC_ALPHA };
+ BOOL a = ((paintMode&DM_GRAY) && ((paintMode&DM_NON_LAYERED)));
+ ske_AlphaBlend(a ? pc.hdcMem2 : hdc, rcPaint->left, rcPaint->top, rcPaint->right - rcPaint->left, rcPaint->bottom - rcPaint->top, pc.hdcMem, rcPaint->left, rcPaint->top, rcPaint->right - rcPaint->left, rcPaint->bottom - rcPaint->top, bf);
+ if (a)
+ BitBlt(hdc, rcPaint->left, rcPaint->top, rcPaint->right - rcPaint->left, rcPaint->bottom - rcPaint->top, pc.hdcMem2, rcPaint->left, rcPaint->top, SRCCOPY);
}
}
-void CLCPaint::_FreePaintContext( _PaintContext& pc )
+void CLCPaint::_FreePaintContext(_PaintContext& pc)
{
- if ( pc.hBrushAlternateGrey ) DeleteObject( pc.hBrushAlternateGrey );
- SelectObject( pc.hdcMem, (HFONT) GetStockObject( DEFAULT_GUI_FONT ));
- if ( pc.fRelease&_PaintContext::release_hdcmem )
+ if (pc.hBrushAlternateGrey) DeleteObject(pc.hBrushAlternateGrey);
+ SelectObject(pc.hdcMem, (HFONT)GetStockObject(DEFAULT_GUI_FONT));
+ if (pc.fRelease&_PaintContext::release_hdcmem)
{
- SelectObject( pc.hdcMem, pc.oldbmp );
- DeleteObject( pc.hBmpOsb );
- DeleteDC( pc.hdcMem );
+ SelectObject(pc.hdcMem, pc.oldbmp);
+ DeleteObject(pc.hBmpOsb);
+ DeleteDC(pc.hdcMem);
}
- if ( pc.fRelease&_PaintContext::release_hdcmem2)
+ if (pc.fRelease&_PaintContext::release_hdcmem2)
{
- SelectObject( pc.hdcMem2, pc.oldbmp2 );
- DeleteObject( pc.hBmpOsb2 );
- DeleteDC( pc.hdcMem2 );
+ SelectObject(pc.hdcMem2, pc.oldbmp2);
+ DeleteObject(pc.hBmpOsb2);
+ DeleteDC(pc.hdcMem2);
}
}
-void CLCPaint::_PaintClc( HWND hwnd, ClcData *dat, HDC hdc, RECT *_rcPaint )
+void CLCPaint::_PaintClc(HWND hwnd, ClcData *dat, HDC hdc, RECT *_rcPaint)
{
- g_CluiData.t_now = time( NULL );
+ g_CluiData.t_now = time(NULL);
- if ( _rcPaint && IsRectEmpty( _rcPaint )) return; // check if draw area is not empty
- if (!IsWindowVisible( hwnd )) return; // and window is visible
+ if (_rcPaint && IsRectEmpty(_rcPaint)) return; // check if draw area is not empty
+ if (!IsWindowVisible(hwnd)) return; // and window is visible
RECT clRect;
- GetClientRect( hwnd, &clRect );
+ GetClientRect(hwnd, &clRect);
RECT *rcPaint = _rcPaint ? _rcPaint : &clRect; // if null is transmitted - use whole client area
// Invalidate ani avatars, avatars have to be validated in row paint routine below
- if ( rcPaint->top == 0 && rcPaint->bottom == clRect.bottom && dat->avatars_show )
- AniAva_InvalidateAvatarPositions( NULL );
+ if (rcPaint->top == 0 && rcPaint->bottom == clRect.bottom && dat->avatars_show)
+ AniAva_InvalidateAvatarPositions(NULL);
// Now determine paint mode
- int paintMode = _DetermineDrawMode( hwnd, dat );
+ int paintMode = _DetermineDrawMode(hwnd, dat);
// Preparing drawing contexts
- _PaintContext pc( hdc );
- _PreparePaintContext( hwnd, dat, hdc, paintMode, clRect, pc );
+ _PaintContext pc(hdc);
+ _PreparePaintContext(dat, hdc, paintMode, clRect, pc);
// Draw background
- _DrawBackground( hwnd, dat, hdc, paintMode, rcPaint, clRect, pc );
+ _DrawBackground(hwnd, dat, paintMode, rcPaint, clRect, pc);
// Draw lines
- if ( dat->row_heights )
- _DrawLines( hwnd, dat, hdc, paintMode, rcPaint, clRect, pc );
+ if (dat->row_heights)
+ _DrawLines(hwnd, dat, paintMode, rcPaint, clRect, pc);
//insertion mark
- if ( dat->iInsertionMark != -1 )
- _DrawInsertionMark( dat, clRect, pc );
+ if (dat->iInsertionMark != -1)
+ _DrawInsertionMark(dat, clRect, pc);
// BitBlt from memory to destination
- _CopyPaintToDest( hwnd, dat, hdc, paintMode, rcPaint, clRect, pc );
+ _CopyPaintToDest(hdc, paintMode, rcPaint, pc);
// Free
- _FreePaintContext( pc );
+ _FreePaintContext(pc);
// all still non-validated animated avatars have to be removed
AniAva_RemoveInvalidatedAvatars();
}
-void CLCPaint::_StoreItemPos( ClcContact *contact, int ItemType, RECT *rc )
+void CLCPaint::_StoreItemPos(ClcContact *contact, int ItemType, RECT *rc)
{
contact->ext_mpItemsDesc[contact->ext_nItemsNum].itemType = ItemType;
contact->ext_mpItemsDesc[contact->ext_nItemsNum].itemRect = *rc;
contact->ext_nItemsNum++;
- switch ( ItemType )
+ switch (ItemType)
{
case CIT_AVATAR:
contact->pos_avatar = *rc;
@@ -2206,9 +2204,9 @@ void CLCPaint::_StoreItemPos( ClcContact *contact, int ItemType, RECT *rc )
case CIT_CHECKBOX:
break;
default:
- if (( ItemType&CIT_EXTRA ) == CIT_EXTRA )
+ if ((ItemType&CIT_EXTRA) == CIT_EXTRA)
{
- int iImage = ItemType&0x3F;
+ int iImage = ItemType & 0x3F;
contact->pos_extra[iImage] = *rc;
}
break;
@@ -2216,278 +2214,280 @@ void CLCPaint::_StoreItemPos( ClcContact *contact, int ItemType, RECT *rc )
}
-void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected, int hottrack )
+void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *in_row_rc, RECT *in_free_row_rc, int left_pos, int right_pos, int selected)
{
- int item_iterator, item, item_text, text_left_pos;
+ int item_iterator, item, item_text = 0, text_left_pos;
BOOL left = TRUE; //TODO remove
RECT free_row_rc = *in_free_row_rc;
RECT row_rc = *in_row_rc;
Drawing->ext_nItemsNum = 0;
text_left_pos = row_rc.right;
// 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++ )
+ 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 ( left )
+ if (Drawing->ext_nItemsNum >= SIZEOF(Drawing->ext_mpItemsDesc)) break;
+ if (left)
item = item_iterator;
else
- item = NUM_ITEM_TYPE - ( item_iterator - item_text );
+ item = NUM_ITEM_TYPE - (item_iterator - item_text);
- switch( dat->row_items[item] )
+ switch (dat->row_items[item])
{
case ITEM_AVATAR: ///////////////////////////////////////////////////////////////////////////////////////////////////
+ {
+ RECT rc;
+ int max_width;
+ int width;
+ int height;
+ BOOL miniMode;
+ if (!dat->avatars_show || Drawing->type != CLCIT_CONTACT)
+ break;
+ miniMode = CheckMiniMode(dat, selected);
+ AniAva_InvalidateAvatarPositions(Drawing->hContact);
+ if (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space)
+ max_width = max(dat->iconXSpace, dat->avatars_maxheight_size);
+ else
+ max_width = dat->avatars_maxheight_size;
+
+ // Has to draw?
+ if ((dat->use_avatar_service && Drawing->avatar_data == NULL)
+ || (!dat->use_avatar_service && Drawing->avatar_pos == AVATAR_POS_DONT_HAVE)
+ || miniMode)
{
- RECT rc;
- int max_width;
- int width;
- int height;
- BOOL miniMode;
- if (!dat->avatars_show || Drawing->type != CLCIT_CONTACT )
- break;
- miniMode = CheckMiniMode( dat, selected, hottrack );
- AniAva_InvalidateAvatarPositions( Drawing->hContact );
- if ( dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space )
- max_width = max( dat->iconXSpace, dat->avatars_maxheight_size );
- else
- max_width = dat->avatars_maxheight_size;
+ // Don't have to draw avatar
- // Has to draw?
- if (( dat->use_avatar_service && Drawing->avatar_data == NULL )
- || (!dat->use_avatar_service && Drawing->avatar_pos == AVATAR_POS_DONT_HAVE )
- || miniMode )
+ // Has to draw icon instead?
+ if (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && Drawing->iImage != -1)
{
- // 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 )
- {
- RECT rc;
+ RECT rc;
- // Make rectangle
- rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, dat->iconXSpace, max_width, ICON_HEIGHT, HORIZONTAL_SPACE );
+ // Make rectangle
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, dat->iconXSpace, max_width, ICON_HEIGHT, HORIZONTAL_SPACE);
- 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.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);
- // Store position
- _StoreItemPos( Drawing, CIT_ICON, &rc );
- }
+ // Store position
+ _StoreItemPos(Drawing, CIT_ICON, &rc);
}
- else
+ }
+ else
+ {
+ // Has to keep the empty space??
+ if ((left && !dat->row_align_left_items_to_left) || (!left && !dat->row_align_right_items_to_right))
{
- // Has to keep the empty space??
- if (( left && !dat->row_align_left_items_to_left ) || (!left && !dat->row_align_right_items_to_right ))
- {
- // Make rectangle
- rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, max_width, max_width, dat->avatars_maxheight_size, HORIZONTAL_SPACE );
+ // Make rectangle
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, max_width, max_width, dat->avatars_maxheight_size, HORIZONTAL_SPACE);
- // Store position
- //StoreItemPos( Drawing, CIT_AVATAR, &rc );
- //Drawing->pos_avatar = rc;
- }
+ // Store position
+ //StoreItemPos( Drawing, CIT_AVATAR, &rc );
+ //Drawing->pos_avatar = rc;
}
- break;
}
+ break;
+ }
- // Has to draw avatar
- if ( dat->avatar_cache.nodes && Drawing->avatar_pos > AVATAR_POS_DONT_HAVE ) {
- width = dat->avatar_cache.nodes[Drawing->avatar_pos].width;
- height = dat->avatar_cache.nodes[Drawing->avatar_pos].height;
- }else if ( Drawing->avatar_pos == AVATAR_POS_ANIMATED ) {
- width = Drawing->avatar_size.cx;
- height = Drawing->avatar_size.cy;
- }else {
- width = 0;
- height = 0;
- }
+ // Has to draw avatar
+ if (dat->avatar_cache.nodes && Drawing->avatar_pos > AVATAR_POS_DONT_HAVE) {
+ width = dat->avatar_cache.nodes[Drawing->avatar_pos].width;
+ height = dat->avatar_cache.nodes[Drawing->avatar_pos].height;
+ }
+ else if (Drawing->avatar_pos == AVATAR_POS_ANIMATED) {
+ width = Drawing->avatar_size.cx;
+ height = Drawing->avatar_size.cy;
+ }
+ else {
+ width = 0;
+ height = 0;
+ }
- // Make rectangle
- rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, width, max_width, height, HORIZONTAL_SPACE );
+ // Make rectangle
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, width, max_width, height, HORIZONTAL_SPACE);
- rc.top = max( free_row_rc.top, rc.top );
- rc.bottom = min( free_row_rc.bottom, rc.bottom );
+ rc.top = max(free_row_rc.top, rc.top);
+ rc.bottom = min(free_row_rc.bottom, rc.bottom);
- if ( rc.left < rc.right ) {
- // Store position
- _StoreItemPos( Drawing, CIT_AVATAR, &rc );
- }
- //TO DO: CALC avatar overlays
- break;
+ if (rc.left < rc.right) {
+ // Store position
+ _StoreItemPos(Drawing, CIT_AVATAR, &rc);
}
+ //TO DO: CALC avatar overlays
+ break;
+ }
case ITEM_ICON: /////////////////////////////////////////////////////////////////////////////////////////////////////
+ {
+ 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))
+ && !(CheckMiniMode(dat, selected));
+
+ if (Drawing->type == CLCIT_CONTACT
+ && dat->icon_hide_on_avatar
+ && !dat->icon_draw_on_avatar_space
+ && has_avatar
+ && !Drawing->image_is_special)
{
- 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 ))
- && !( CheckMiniMode( dat, selected, hottrack ));
-
- if ( Drawing->type == CLCIT_CONTACT
- && dat->icon_hide_on_avatar
- && !dat->icon_draw_on_avatar_space
- && has_avatar
- && !Drawing->image_is_special )
+ // Don't have to draw, but has to keep the empty space?
+ if ((left && !dat->row_align_left_items_to_left) || (!left && !dat->row_align_right_items_to_right))
{
- // Don't have to draw, but has to keep the empty space?
- if (( left && !dat->row_align_left_items_to_left ) || (!left && !dat->row_align_right_items_to_right ))
- {
- rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE );
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE);
- if ( rc.left < rc.right ) {
- // Store position
- _StoreItemPos( Drawing, CIT_ICON, &rc );
- }
+ if (rc.left < rc.right) {
+ // Store position
+ _StoreItemPos(Drawing, CIT_ICON, &rc);
}
- break;
- }
- if ( Drawing->type == CLCIT_CONTACT
- && dat->icon_hide_on_avatar
- && dat->icon_draw_on_avatar_space
- && (!Drawing->image_is_special || !has_avatar ||
- (
- dat->avatars_draw_overlay
- && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
- && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons)
- && dat->avatars_overlay_type == SETTING_AVATAR_OVERLAY_TYPE_CONTACT
- )))
- {
- // Don't have to draw and don't have to keep the empty space
- break;
}
+ break;
+ }
+ if (Drawing->type == CLCIT_CONTACT
+ && dat->icon_hide_on_avatar
+ && dat->icon_draw_on_avatar_space
+ && (!Drawing->image_is_special || !has_avatar ||
+ (
+ dat->avatars_draw_overlay
+ && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
+ && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons)
+ && dat->avatars_overlay_type == SETTING_AVATAR_OVERLAY_TYPE_CONTACT
+ )))
+ {
+ // Don't have to draw and don't have to keep the empty space
+ break;
+ }
- // Get image
- iImage = -1;
- if ( Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon )
- iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
- else if ( Drawing->type == CLCIT_CONTACT )
- iImage = Drawing->iImage;
+ // Get image
+ iImage = -1;
+ if (Drawing->type == CLCIT_GROUP && !dat->row_hide_group_icon)
+ iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ else if (Drawing->type == CLCIT_CONTACT)
+ iImage = Drawing->iImage;
- // Has image to draw?
- if ( iImage != -1 )
- {
- // Make rectangle
- rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE );
+ // Has image to draw?
+ if (iImage != -1)
+ {
+ // Make rectangle
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, dat->iconXSpace, dat->iconXSpace, ICON_HEIGHT, HORIZONTAL_SPACE);
- if ( rc.left < rc.right )
- {
- // Store position
- _StoreItemPos( Drawing, CIT_ICON, &rc );
- }
+ if (rc.left < rc.right)
+ {
+ // Store position
+ _StoreItemPos(Drawing, CIT_ICON, &rc);
}
- break;
}
+ break;
+ }
case ITEM_CONTACT_TIME: /////////////////////////////////////////////////////////////////////////////////////////////////////
+ {
+ ClcCacheEntry *pdnce = (Drawing->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(Drawing->hContact) : NULL;
+ if (Drawing->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone)
{
- ClcCacheEntry *pdnce = (Drawing->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(Drawing->hContact) : NULL;
- if ( Drawing->type == CLCIT_CONTACT && dat->contact_time_show && pdnce->hTimeZone )
- {
- TCHAR szResult[80];
+ TCHAR szResult[80];
- if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
- {
- SIZE text_size;
- RECT rc;
+ if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0))
+ {
+ SIZE text_size;
+ RECT rc;
- // Select font
- ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL );
+ // Select font
+ ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
- // Get text size
- text_size.cy = ske_DrawText(hdcMem, szResult, mir_tstrlen( szResult ), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE );
- text_size.cy = min( text_size.cy, free_row_rc.bottom - free_row_rc.top );
- text_size.cx = rc.right - rc.left;
+ // Get text size
+ text_size.cy = ske_DrawText(hdcMem, szResult, mir_tstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
+ text_size.cy = min(text_size.cy, free_row_rc.bottom - free_row_rc.top);
+ text_size.cx = rc.right - rc.left;
- // Get rc
- rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos, left,
- text_size.cx, text_size.cx, text_size.cy, HORIZONTAL_SPACE );
+ // Get rc
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos, left,
+ text_size.cx, text_size.cx, text_size.cy, HORIZONTAL_SPACE);
- if ( rc.left < rc.right )
- {
- // Store pos
- Drawing->pos_contact_time = rc;
- _StoreItemPos( Drawing, CIT_TIME, &rc );
- }
+ if (rc.left < rc.right)
+ {
+ // Store pos
+ Drawing->pos_contact_time = rc;
+ _StoreItemPos(Drawing, CIT_TIME, &rc);
}
}
- break;
}
+ break;
+ }
case ITEM_TEXT: /////////////////////////////////////////////////////////////////////////////////////////////////////
- {
- // Store init text position:
- text_left_pos = left_pos;
+ {
+ // Store init text position:
+ text_left_pos = left_pos;
- left_pos += MIN_TEXT_WIDTH;
- free_row_rc.left = row_rc.left + left_pos;
+ left_pos += MIN_TEXT_WIDTH;
+ free_row_rc.left = row_rc.left + left_pos;
- item_text = item;
- left = FALSE;
- break;
- }
+ item_text = item;
+ left = FALSE;
+ break;
+ }
case ITEM_EXTRA_ICONS: //////////////////////////////////////////////////////////////////////////////////////////////
+ {
+ // Draw extra icons
+ if (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0)
{
- // Draw extra icons
- if (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0 )
- {
- int iImage;
- int count = 0;
- RECT rc;
+ int iImage;
+ int count = 0;
+ RECT rc;
- for ( iImage = dat->extraColumnsCount-1 ; iImage >= 0 ; iImage-- ) {
- if ( Drawing->iExtraImage[iImage] != EMPTY_EXTRA_ICON || !dat->MetaIgnoreEmptyExtra ) {
- rc = _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, dat->extraColumnSpacing, dat->extraColumnSpacing, ICON_HEIGHT, 0 );
- if (rc.left < rc.right) {
- // Store position
- _StoreItemPos( Drawing, CIT_EXTRA|( iImage&0x3F ), &rc );
- //Drawing->pos_extra[iImage] = rc;
- count++;
- }
+ for (iImage = dat->extraColumnsCount - 1; iImage >= 0; iImage--) {
+ if (Drawing->iExtraImage[iImage] != EMPTY_EXTRA_ICON || !dat->MetaIgnoreEmptyExtra) {
+ rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, dat->extraColumnSpacing, dat->extraColumnSpacing, ICON_HEIGHT, 0);
+ if (rc.left < rc.right) {
+ // Store position
+ _StoreItemPos(Drawing, CIT_EXTRA | (iImage & 0x3F), &rc);
+ //Drawing->pos_extra[iImage] = rc;
+ count++;
}
}
- // Add extra space
- if ( count )
- {
- _GetRectangle( dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, HORIZONTAL_SPACE, HORIZONTAL_SPACE, ICON_HEIGHT, 0 );
- }
}
- break;
+ // Add extra space
+ if (count)
+ {
+ _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
+ left, HORIZONTAL_SPACE, HORIZONTAL_SPACE, ICON_HEIGHT, 0);
+ }
}
+ break;
+ }
}
}
- if ( text_left_pos < free_row_rc.right )
+ if (text_left_pos < free_row_rc.right)
{
// Draw text
RECT text_rc;
RECT selection_text_rc;
- SIZE text_size = {0};
- SIZE second_line_text_size = {0};
- SIZE third_line_text_size = {0};
- SIZE space_size = {0};
- SIZE counts_size = {0};
+ SIZE text_size = { 0 };
+ SIZE second_line_text_size = { 0 };
+ SIZE third_line_text_size = { 0 };
+ SIZE space_size = { 0 };
+ SIZE counts_size = { 0 };
char *szCounts = NULL;//mir_tstrdup( _T(""));
int free_width;
int free_height;
int max_bottom_selection_border = SELECTION_BORDER;
- UINT uTextFormat = DT_NOPREFIX| /*DT_VCENTER |*/ DT_SINGLELINE | ( dat->text_rtl ? DT_RTLREADING : 0 ) | ( dat->text_align_right ? DT_RIGHT : 0 );
+ UINT uTextFormat = DT_NOPREFIX | /*DT_VCENTER |*/ DT_SINGLELINE | (dat->text_rtl ? DT_RTLREADING : 0) | (dat->text_align_right ? DT_RIGHT : 0);
free_row_rc.left = text_left_pos;
free_width = free_row_rc.right - free_row_rc.left;
free_height = free_row_rc.bottom - free_row_rc.top;
// Select font
- ChangeToFont(hdcMem, dat, GetBasicFontID( Drawing ), NULL );
+ ChangeToFont(hdcMem, dat, GetBasicFontID(Drawing), NULL);
// Get text size
- GetTextSize( &text_size, hdcMem, free_row_rc, Drawing->szText, Drawing->ssText.plText, uTextFormat,
- dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight );
+ GetTextSize(&text_size, hdcMem, free_row_rc, Drawing->szText, Drawing->ssText.plText, uTextFormat,
+ dat->text_resize_smileys ? 0 : Drawing->ssText.iMaxSmileyHeight);
// Get rect
text_rc = free_row_rc;
@@ -2496,22 +2496,22 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
text_rc.top += free_height >> 1;
text_rc.bottom = text_rc.top + text_size.cy;
- if ( dat->text_align_right )
- text_rc.left = max( free_row_rc.left, free_row_rc.right - text_size.cx );
+ if (dat->text_align_right)
+ text_rc.left = max(free_row_rc.left, free_row_rc.right - text_size.cx);
else
- text_rc.right = min( free_row_rc.right, free_row_rc.left + text_size.cx );
+ text_rc.right = min(free_row_rc.right, free_row_rc.left + text_size.cx);
selection_text_rc = text_rc;
// If group, can have the size of count
- if ( Drawing->type == CLCIT_GROUP )
+ if (Drawing->type == CLCIT_GROUP)
{
int full_text_width = text_size.cx;
// Group conts?
- szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
+ szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
- if ( szCounts && szCounts[0] )
+ if (szCounts && szCounts[0])
{
RECT space_rc = free_row_rc;
RECT counts_rc = free_row_rc;
@@ -2520,26 +2520,26 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
free_height = free_row_rc.bottom - free_row_rc.top;
// Get widths
- ske_DrawText(hdcMem, _T(" "), 1, &space_rc, DT_CALCRECT | DT_NOPREFIX );
+ ske_DrawText(hdcMem, _T(" "), 1, &space_rc, DT_CALCRECT | DT_NOPREFIX);
space_size.cx = space_rc.right - space_rc.left;
- space_size.cy = min( space_rc.bottom - space_rc.top, free_height );
+ space_size.cy = min(space_rc.bottom - space_rc.top, free_height);
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- DrawTextA(hdcMem, szCounts, mir_strlen( szCounts ), &counts_rc, DT_CALCRECT );
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
+ DrawTextA(hdcMem, szCounts, mir_strlen(szCounts), &counts_rc, DT_CALCRECT);
//Store position
//StoreItemPos( Drawing, CIT_SUBTEXT1, &counts_rc ); // Or not to comment?
counts_size.cx = counts_rc.right - counts_rc.left;
- counts_size.cy = min( counts_rc.bottom - counts_rc.top, free_height );
+ counts_size.cy = min(counts_rc.bottom - counts_rc.top, free_height);
counts_size.cx += 1; // FIXME: This is workaround for sometimes stripped user counts by one pixel, it somehow wrongly counts width of space or counts text (used wrong font?)
text_width = free_row_rc.right - free_row_rc.left - space_size.cx - counts_size.cx;
- if ( text_width > 4 )
+ if (text_width > 4)
{
- text_size.cx = min( text_width, text_size.cx );
+ text_size.cx = min(text_width, text_size.cx);
text_width = text_size.cx + space_size.cx + counts_size.cx;
}
else
@@ -2552,121 +2552,121 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
}
// Get rect
- 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 );
+ 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);
- if ( dat->text_align_right )
+ if (dat->text_align_right)
text_rc.left = free_row_rc.right - text_width;
else
text_rc.right = free_row_rc.left + text_width;
selection_text_rc = text_rc;
full_text_width = text_width;
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPS:FONTID_CLOSEDGROUPS, NULL );
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPS : FONTID_CLOSEDGROUPS, NULL);
}
- if ( dat->row_align_group_mode == 1 ) //center
+ if (dat->row_align_group_mode == 1) //center
{
int x;
- x = free_row_rc.left+(( free_row_rc.right-free_row_rc.left-full_text_width )>>1 );
+ x = free_row_rc.left + ((free_row_rc.right - free_row_rc.left - full_text_width) >> 1);
//int l = dat->leftMargin;
//int r = dat->rightMargin;
//x = l+row_rc.left+(( row_rc.right-row_rc.left-full_text_width-l-r )>>1 );
text_rc.left = x;
- text_rc.right = x+full_text_width;
+ text_rc.right = x + full_text_width;
}
- else if ( dat->row_align_group_mode == 2 ) //right
+ else if (dat->row_align_group_mode == 2) //right
{
- text_rc.left = free_row_rc.right-full_text_width;
+ text_rc.left = free_row_rc.right - full_text_width;
text_rc.right = free_row_rc.right;
}
else //left
{
text_rc.left = free_row_rc.left;
- text_rc.right = free_row_rc.left+full_text_width;
+ text_rc.right = free_row_rc.left + full_text_width;
}
}
- else if ( Drawing->type == CLCIT_CONTACT && !CheckMiniMode( dat, selected, hottrack ))
+ else if (Drawing->type == CLCIT_CONTACT && !CheckMiniMode(dat, selected))
{
int tmp;
ClcCacheEntry *pdnce = (Drawing->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(Drawing->hContact) : NULL;
- if ( dat->second_line_show && dat->second_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone)
+ if (dat->second_line_show && dat->second_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone)
{
// Get contact time
TCHAR buf[70] = _T("");
tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
- mir_free( pdnce->szThirdLineText );
- pdnce->szSecondLineText = mir_tstrdup( buf );
+ mir_free(pdnce->szThirdLineText);
+ pdnce->szSecondLineText = mir_tstrdup(buf);
}
- if ( dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0]
- && free_height > dat->second_line_top_space )
+ if (dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0]
+ && free_height > dat->second_line_top_space)
{
//RECT rc_tmp = free_row_rc;
- ChangeToFont(hdcMem, dat, FONTID_SECONDLINE, NULL );
+ ChangeToFont(hdcMem, dat, FONTID_SECONDLINE, NULL);
// Get sizes
- GetTextSize( &second_line_text_size, hdcMem, free_row_rc, pdnce->szSecondLineText, pdnce->ssSecondLine.plText,
- uTextFormat, dat->text_resize_smileys ? 0 : pdnce->ssSecondLine.iMaxSmileyHeight );
+ GetTextSize(&second_line_text_size, hdcMem, free_row_rc, pdnce->szSecondLineText, pdnce->ssSecondLine.plText,
+ uTextFormat, dat->text_resize_smileys ? 0 : pdnce->ssSecondLine.iMaxSmileyHeight);
// Get rect
- tmp = min( free_height, dat->second_line_top_space + second_line_text_size.cy );
+ tmp = min(free_height, dat->second_line_top_space + second_line_text_size.cy);
free_height -= tmp;
- text_rc.top = free_row_rc.top + ( free_height >> 1 );
+ 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;
- if ( dat->text_align_right )
- text_rc.left = max( free_row_rc.left, min( text_rc.left, free_row_rc.right - second_line_text_size.cx ));
+ if (dat->text_align_right)
+ text_rc.left = max(free_row_rc.left, min(text_rc.left, free_row_rc.right - second_line_text_size.cx));
else
- text_rc.right = min( free_row_rc.right, max( text_rc.right, free_row_rc.left + second_line_text_size.cx ));
+ text_rc.right = min(free_row_rc.right, max(text_rc.right, free_row_rc.left + second_line_text_size.cx));
selection_text_rc.top = text_rc.top;
- selection_text_rc.bottom = min( selection_text_rc.bottom, selection_text_rc.top + text_size.cy );
+ selection_text_rc.bottom = min(selection_text_rc.bottom, selection_text_rc.top + text_size.cy);
- max_bottom_selection_border = min( max_bottom_selection_border, dat->second_line_top_space / 2 );
+ max_bottom_selection_border = min(max_bottom_selection_border, dat->second_line_top_space / 2);
}
- if ( dat->third_line_show && dat->third_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone )
+ if (dat->third_line_show && dat->third_line_type == TEXT_CONTACT_TIME && pdnce->hTimeZone)
{
// Get contact time
TCHAR buf[70] = _T("");
tmi.printDateTime(pdnce->hTimeZone, _T("t"), buf, SIZEOF(buf), 0);
- mir_free( pdnce->szThirdLineText );
- pdnce->szThirdLineText = mir_tstrdup( buf );
+ mir_free(pdnce->szThirdLineText);
+ pdnce->szThirdLineText = mir_tstrdup(buf);
}
- if ( dat->third_line_show && pdnce->szThirdLineText != NULL && pdnce->szThirdLineText[0]
- && free_height > dat->third_line_top_space )
+ if (dat->third_line_show && pdnce->szThirdLineText != NULL && pdnce->szThirdLineText[0]
+ && free_height > dat->third_line_top_space)
{
//RECT rc_tmp = free_row_rc;
- ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL );
+ ChangeToFont(hdcMem, dat, FONTID_THIRDLINE, NULL);
// Get sizes
- GetTextSize( &third_line_text_size, hdcMem, free_row_rc, pdnce->szThirdLineText, pdnce->ssThirdLine.plText,
- uTextFormat, dat->text_resize_smileys ? 0 : pdnce->ssThirdLine.iMaxSmileyHeight );
+ GetTextSize(&third_line_text_size, hdcMem, free_row_rc, pdnce->szThirdLineText, pdnce->ssThirdLine.plText,
+ uTextFormat, dat->text_resize_smileys ? 0 : pdnce->ssThirdLine.iMaxSmileyHeight);
// Get rect
- tmp = min( free_height, dat->third_line_top_space + third_line_text_size.cy );
+ tmp = min(free_height, dat->third_line_top_space + third_line_text_size.cy);
free_height -= tmp;
- text_rc.top = free_row_rc.top + ( free_height >> 1 );
+ 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;
- if ( dat->text_align_right )
- text_rc.left = max( free_row_rc.left, min( text_rc.left, free_row_rc.right - third_line_text_size.cx ));
+ if (dat->text_align_right)
+ text_rc.left = max(free_row_rc.left, min(text_rc.left, free_row_rc.right - third_line_text_size.cx));
else
- text_rc.right = min( free_row_rc.right, max( text_rc.right, free_row_rc.left + third_line_text_size.cx ));
+ text_rc.right = min(free_row_rc.right, max(text_rc.right, free_row_rc.left + third_line_text_size.cx));
selection_text_rc.top = text_rc.top;
- selection_text_rc.bottom = min( selection_text_rc.bottom, selection_text_rc.top + text_size.cy );
+ selection_text_rc.bottom = min(selection_text_rc.bottom, selection_text_rc.top + text_size.cy);
- max_bottom_selection_border = min( max_bottom_selection_border, dat->third_line_top_space / 2 );
+ max_bottom_selection_border = min(max_bottom_selection_border, dat->third_line_top_space / 2);
}
- ChangeToFont(hdcMem, dat, GetBasicFontID( Drawing ), NULL );
+ ChangeToFont(hdcMem, dat, GetBasicFontID(Drawing), NULL);
}
@@ -2675,152 +2675,151 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
Drawing->pos_label = text_rc;
- selection_text_rc.top = max( selection_text_rc.top - SELECTION_BORDER, row_rc.top );
- selection_text_rc.bottom = min( selection_text_rc.bottom + max_bottom_selection_border, row_rc.bottom );
+ selection_text_rc.top = max(selection_text_rc.top - SELECTION_BORDER, row_rc.top);
+ selection_text_rc.bottom = min(selection_text_rc.bottom + max_bottom_selection_border, row_rc.bottom);
- if ( dat->text_align_right )
- selection_text_rc.left = max( selection_text_rc.left - SELECTION_BORDER, free_row_rc.left );
+ if (dat->text_align_right)
+ selection_text_rc.left = max(selection_text_rc.left - SELECTION_BORDER, free_row_rc.left);
else
- selection_text_rc.right = min( selection_text_rc.right + SELECTION_BORDER, free_row_rc.right );
- _StoreItemPos( Drawing, CIT_SELECTION, &selection_text_rc );
+ selection_text_rc.right = min(selection_text_rc.right + SELECTION_BORDER, free_row_rc.right);
+ _StoreItemPos(Drawing, CIT_SELECTION, &selection_text_rc);
Drawing->pos_rename_rect = free_row_rc;
{
// Draw text
- uTextFormat = uTextFormat | ( gl_TrimText?DT_END_ELLIPSIS:0 );
+ uTextFormat = uTextFormat | (gl_TrimText ? DT_END_ELLIPSIS : 0);
- switch ( Drawing->type )
+ switch (Drawing->type)
{
case CLCIT_DIVIDER:
+ {
+ //devider
+ RECT trc = free_row_rc;
+ RECT rc = free_row_rc;
+ 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)
{
- //devider
- RECT trc = free_row_rc;
- RECT rc = free_row_rc;
- 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.bottom = trc.top + text_size.cy;
- }
- _StoreItemPos( Drawing, CIT_TEXT, &trc );
- rc.left = rc.right + 6 + text_size.cx;
- rc.right = free_row_rc.right;
- break;
+ trc.top += (trc.bottom - trc.top - text_size.cy) >> 1;
+ trc.bottom = trc.top + text_size.cy;
}
+ _StoreItemPos(Drawing, CIT_TEXT, &trc);
+ rc.left = rc.right + 6 + text_size.cx;
+ rc.right = free_row_rc.right;
+ break;
+ }
case CLCIT_GROUP:
+ {
+ RECT rc = text_rc;
+
+ // Get text rectangle
+ if (dat->text_align_right)
+ rc.left = rc.right - text_size.cx;
+ else
+ rc.right = rc.left + text_size.cx;
+
+
+ if (text_size.cy < rc.bottom - rc.top)
{
- RECT rc = text_rc;
+ rc.top += (rc.bottom - rc.top - text_size.cy) >> 1;
+ rc.bottom = rc.top + text_size.cy;
+ }
- // Get text rectangle
- if ( dat->text_align_right )
- rc.left = rc.right - text_size.cx;
- else
- rc.right = rc.left + text_size.cx;
+ // Draw text
+ _StoreItemPos(Drawing, CIT_TEXT, &rc);
+ // Has to draw the count?
+ if (counts_size.cx > 0)
+ {
+ RECT counts_rc = text_rc;
+ //counts_size.cx;
+ if (dat->text_align_right)
+ counts_rc.right = text_rc.left + counts_size.cx;
+ else
+ counts_rc.left = text_rc.right - counts_size.cx;
- if ( text_size.cy < rc.bottom - rc.top )
+ if (counts_size.cy < counts_rc.bottom - counts_rc.top)
{
- rc.top += ( rc.bottom - rc.top - text_size.cy ) >> 1;
- rc.bottom = rc.top + text_size.cy;
+ 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
+ _StoreItemPos(Drawing, CIT_SUBTEXT1, &counts_rc);
+ }
+ break;
+ }
+ case CLCIT_CONTACT:
+ {
- // Draw text
- _StoreItemPos( Drawing, CIT_TEXT, &rc );
+ RECT free_rc = text_rc;
+ if (text_size.cx > 0 && free_rc.bottom > free_rc.top)
+ {
+ RECT rc = free_rc;
+ rc.bottom = min(rc.bottom, rc.top + text_size.cy);
- // Has to draw the count?
- if ( counts_size.cx > 0 )
+ if (text_size.cx < rc.right - rc.left)
{
- RECT counts_rc = text_rc;
- //counts_size.cx;
- if ( dat->text_align_right )
- counts_rc.right = text_rc.left + counts_size.cx;
+ if (dat->text_align_right)
+ rc.left = rc.right - text_size.cx;
else
- counts_rc.left = text_rc.right - counts_size.cx;
-
- 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.bottom = counts_rc.top + counts_size.cy;
- }
- // Draw counts
- _StoreItemPos( Drawing, CIT_SUBTEXT1, &counts_rc );
+ rc.right = rc.left + text_size.cx;
}
- break;
+ uTextFormat |= DT_VCENTER;
+ _StoreItemPos(Drawing, CIT_TEXT, &rc);
+ free_rc.top = rc.bottom;
}
- case CLCIT_CONTACT:
+ uTextFormat &= ~DT_VCENTER;
+ if (second_line_text_size.cx > 0 && free_rc.bottom > free_rc.top)
{
+ free_rc.top += dat->second_line_top_space;
- RECT free_rc = text_rc;
- ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry( Drawing->hContact );
- if ( text_size.cx > 0 && free_rc.bottom > free_rc.top )
+ if (free_rc.bottom > free_rc.top)
{
RECT rc = free_rc;
- rc.bottom = min( rc.bottom, rc.top + text_size.cy );
+ rc.bottom = min(rc.bottom, rc.top + second_line_text_size.cy);
- if ( text_size.cx < rc.right - rc.left )
+ if (second_line_text_size.cx < rc.right - rc.left)
{
- if ( dat->text_align_right )
- rc.left = rc.right - text_size.cx;
+ if (dat->text_align_right)
+ rc.left = rc.right - second_line_text_size.cx;
else
- rc.right = rc.left + text_size.cx;
+ rc.right = rc.left + second_line_text_size.cx;
}
- uTextFormat |= DT_VCENTER;
- _StoreItemPos( Drawing, CIT_TEXT, &rc );
+ _StoreItemPos(Drawing, CIT_SUBTEXT1, &rc);
free_rc.top = rc.bottom;
}
- uTextFormat &= ~DT_VCENTER;
- if ( second_line_text_size.cx > 0 && free_rc.bottom > free_rc.top )
- {
- free_rc.top += dat->second_line_top_space;
-
- if ( free_rc.bottom > free_rc.top )
- {
- RECT rc = free_rc;
- rc.bottom = min( rc.bottom, rc.top + second_line_text_size.cy );
+ }
- if ( second_line_text_size.cx < rc.right - rc.left )
- {
- if ( dat->text_align_right )
- rc.left = rc.right - second_line_text_size.cx;
- else
- rc.right = rc.left + second_line_text_size.cx;
- }
- _StoreItemPos( Drawing, CIT_SUBTEXT1, &rc );
- free_rc.top = rc.bottom;
- }
- }
+ if (third_line_text_size.cx > 0 && free_rc.bottom > free_rc.top)
+ {
+ free_rc.top += dat->third_line_top_space;
- if ( third_line_text_size.cx > 0 && free_rc.bottom > free_rc.top )
+ if (free_rc.bottom > free_rc.top)
{
- free_rc.top += dat->third_line_top_space;
+ RECT rc = free_rc;
+ rc.bottom = min(rc.bottom, rc.top + third_line_text_size.cy);
- if ( free_rc.bottom > free_rc.top )
+ if (third_line_text_size.cx < rc.right - rc.left)
{
- RECT rc = free_rc;
- rc.bottom = min( rc.bottom, rc.top + third_line_text_size.cy );
-
- if ( third_line_text_size.cx < rc.right - rc.left )
- {
- if ( dat->text_align_right )
- rc.left = rc.right - third_line_text_size.cx;
- else
- rc.right = rc.left + third_line_text_size.cx;
- }
- _StoreItemPos( Drawing, CIT_SUBTEXT2, &rc );
- free_rc.top = rc.bottom;
+ if (dat->text_align_right)
+ rc.left = rc.right - third_line_text_size.cx;
+ else
+ rc.right = rc.left + third_line_text_size.cx;
}
+ _StoreItemPos(Drawing, CIT_SUBTEXT2, &rc);
+ free_rc.top = rc.bottom;
}
- break;
}
+ break;
+ }
default: // CLCIT_INFO
- {
- _StoreItemPos( Drawing, CIT_TEXT, &text_rc );
- }
+ {
+ _StoreItemPos(Drawing, CIT_TEXT, &text_rc);
+ }
}
}
}
@@ -2829,31 +2828,31 @@ void CLCPaint::_CalcItemsPos( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *D
*in_row_rc = row_rc;
Drawing->ext_fItemsValid = FALSE; /*TO DO: correctly implement placement recalculation*/
}
-BOOL CLCPaint::__IsVisible( RECT *firtRect, RECT *secondRect )
+BOOL CLCPaint::__IsVisible(RECT *firtRect, RECT *secondRect)
{
RECT res;
- IntersectRect( &res, firtRect, secondRect );
- return !IsRectEmpty( &res );
+ IntersectRect(&res, firtRect, secondRect);
+ return !IsRectEmpty(&res);
}
-void CLCPaint::_GetBlendMode( IN ClcData *dat, IN ClcContact *Drawing, IN BOOL selected, IN BOOL hottrack, IN BOOL bFlag, OUT COLORREF * OutColourFg, OUT int * OutMode )
+void CLCPaint::_GetBlendMode(IN ClcData *dat, IN ClcContact *Drawing, IN BOOL selected, IN BOOL hottrack, IN BOOL bFlag, OUT COLORREF * OutColourFg, OUT int * OutMode)
{
COLORREF colourFg;
int mode;
- int BlendedInActiveState = ( dat->dbbBlendInActiveState );
+ int BlendedInActiveState = (dat->dbbBlendInActiveState);
int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
- if ( selected && ( bFlag&GIM_SELECTED_AFFECT ))
+ if (selected && (bFlag&GIM_SELECTED_AFFECT))
{
colourFg = dat->selBkColour;
- mode = BlendedInActiveState?ILD_NORMAL:ILD_SELECTED;
+ mode = BlendedInActiveState ? ILD_NORMAL : ILD_SELECTED;
}
- else if ( hottrack && ( bFlag&GIM_HOT_AFFECT ))
+ else if (hottrack && (bFlag&GIM_HOT_AFFECT))
{
- mode = BlendedInActiveState?ILD_NORMAL:ILD_FOCUS;
+ mode = BlendedInActiveState ? ILD_NORMAL : ILD_FOCUS;
colourFg = dat->hotTextColour;
}
- else if ( Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST && ( bFlag&GIM_TEMP_AFFECT ))
+ else if (Drawing->type == CLCIT_CONTACT && Drawing->flags&CONTACTF_NOTONLIST && (bFlag&GIM_TEMP_AFFECT))
{
colourFg = dat->fontModernInfo[FONTID_NOTONLIST].colour;
mode = BlendValue;
@@ -2863,34 +2862,34 @@ void CLCPaint::_GetBlendMode( IN ClcData *dat, IN ClcContact *Drawing, IN BOOL s
colourFg = dat->selBkColour;
mode = ILD_NORMAL;
}
- if ( Drawing->type == CLCIT_CONTACT && dat->showIdle && ( Drawing->flags&CONTACTF_IDLE ) &&
- _GetRealStatus( Drawing, ID_STATUS_OFFLINE ) != ID_STATUS_OFFLINE &&
- ( bFlag&GIM_IDLE_AFFECT )
+ if (Drawing->type == CLCIT_CONTACT && dat->showIdle && (Drawing->flags&CONTACTF_IDLE) &&
+ _GetRealStatus(Drawing, ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE &&
+ (bFlag&GIM_IDLE_AFFECT)
)
mode = ILD_SELECTED;
- if ( OutColourFg ) *OutColourFg = colourFg;
- if ( OutMode )
+ if (OutColourFg) *OutColourFg = colourFg;
+ if (OutMode)
{
- if ( OutColourFg ) *OutMode = mode; //return ILD_MODE if color requested
+ if (OutColourFg) *OutMode = mode; //return ILD_MODE if color requested
else *OutMode =
- ( mode == ILD_BLEND50 )?128 :
- ( mode == ILD_BLEND25 )?64 :
+ (mode == ILD_BLEND50) ? 128 :
+ (mode == ILD_BLEND25) ? 64 :
255; //return alpha otherwise
}
}
-void CLCPaint::_DrawContactAvatar( HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem )
+void CLCPaint::_DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, int& selected, int& hottrack, RECT *prcItem)
{
- if ( Drawing->avatar_pos == AVATAR_POS_ANIMATED )
+ if (Drawing->avatar_pos == AVATAR_POS_ANIMATED)
{
int overlayIdx = -1;
int blendmode = 255;
if (dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
- && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons))
+ && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons))
{
- switch(dat->avatars_overlay_type) {
+ switch (dat->avatars_overlay_type) {
case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
- overlayIdx = g_pAvatarOverlayIcons[GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE].listID;
+ overlayIdx = g_pAvatarOverlayIcons[GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE].listID;
break;
case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
overlayIdx = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
@@ -2900,150 +2899,150 @@ void CLCPaint::_DrawContactAvatar( HDC hdcMem, ClcData *dat, ClcContact *Drawing
break;
}
}
- _GetBlendMode( dat, Drawing, selected, hottrack, GIM_AVATAR_AFFECT, NULL, &blendmode );
- AniAva_SetAvatarPos( Drawing->hContact, prcItem, overlayIdx, blendmode );
- AniAva_RenderAvatar( Drawing->hContact, hdcMem, prcItem );
+ _GetBlendMode(dat, Drawing, selected, hottrack, GIM_AVATAR_AFFECT, NULL, &blendmode);
+ AniAva_SetAvatarPos(Drawing->hContact, prcItem, overlayIdx, blendmode);
+ AniAva_RenderAvatar(Drawing->hContact, hdcMem, prcItem);
}
- else if ( Drawing->avatar_pos>AVATAR_POS_DONT_HAVE )
+ else if (Drawing->avatar_pos > AVATAR_POS_DONT_HAVE)
{
int round_radius = 0;
HRGN rgn;
int blendmode = 255;
- _GetBlendMode( dat, Drawing, selected, hottrack, GIM_AVATAR_AFFECT, NULL, &blendmode );
+ _GetBlendMode(dat, Drawing, selected, hottrack, GIM_AVATAR_AFFECT, NULL, &blendmode);
//get round corner radius
- if ( dat->avatars_round_corners )
+ if (dat->avatars_round_corners)
{
- if ( dat->avatars_use_custom_corner_size )
+ if (dat->avatars_use_custom_corner_size)
round_radius = dat->avatars_custom_corner_size;
else
- round_radius = min( _rcWidth( prcItem ), _rcHeight( prcItem )) / 5;
+ round_radius = min(_rcWidth(prcItem), _rcHeight(prcItem)) / 5;
}
// draw borders
- if ( dat->avatars_draw_border )
+ if (dat->avatars_draw_border)
{
- 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 );
- CombineRgn( rgnOutside, rgnOutside, rgnInside, RGN_DIFF );
- FillRgn(hdcMem, rgnOutside, hBrush );
- ske_SetRgnOpaque(hdcMem, rgnOutside );
- SelectObject(hdcMem, hOldBrush );
- DeleteObject( hBrush );
- DeleteObject( rgnInside );
- DeleteObject( rgnOutside );
+ 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);
+ CombineRgn(rgnOutside, rgnOutside, rgnInside, RGN_DIFF);
+ FillRgn(hdcMem, rgnOutside, hBrush);
+ ske_SetRgnOpaque(hdcMem, rgnOutside);
+ SelectObject(hdcMem, hOldBrush);
+ DeleteObject(hBrush);
+ DeleteObject(rgnInside);
+ DeleteObject(rgnOutside);
}
//set clip area to clip avatars within borders
- if ( dat->avatars_round_corners || dat->avatars_draw_border )
+ if (dat->avatars_round_corners || dat->avatars_draw_border)
{
- int k = dat->avatars_draw_border?1:0;
- rgn = CreateRoundRectRgn( prcItem->left+k, prcItem->top+k, prcItem->right+1-k, prcItem->bottom+1-k, round_radius * 2, round_radius * 2 );
+ int k = dat->avatars_draw_border ? 1 : 0;
+ rgn = CreateRoundRectRgn(prcItem->left + k, prcItem->top + k, prcItem->right + 1 - k, prcItem->bottom + 1 - k, round_radius * 2, round_radius * 2);
}
else
- rgn = CreateRectRgn( prcItem->left, prcItem->top, prcItem->right, prcItem->bottom );
- ExtSelectClipRgn(hdcMem, rgn, RGN_AND );
+ rgn = CreateRectRgn(prcItem->left, prcItem->top, prcItem->right, prcItem->bottom);
+ ExtSelectClipRgn(hdcMem, rgn, RGN_AND);
// Draw avatar
- ImageArray_DrawImage( &dat->avatar_cache, Drawing->avatar_pos, hdcMem, prcItem->left, prcItem->top, blendmode );
+ ImageArray_DrawImage(&dat->avatar_cache, Drawing->avatar_pos, hdcMem, prcItem->left, prcItem->top, blendmode);
// Restore region
- DeleteObject( rgn );
- rgn = CreateRectRgn( row_rc->left, row_rc->top, row_rc->right, row_rc->bottom );
- SelectClipRgn(hdcMem, rgn );
- DeleteObject( rgn );
+ DeleteObject(rgn);
+ rgn = CreateRectRgn(row_rc->left, row_rc->top, row_rc->right, row_rc->bottom);
+ SelectClipRgn(hdcMem, rgn);
+ DeleteObject(rgn);
// Draw overlays
if (dat->avatars_draw_overlay && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
- && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons))
+ && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < SIZEOF(g_pAvatarOverlayIcons))
{
- POINT ptOverlay = { prcItem->right-ICON_HEIGHT, prcItem->bottom-ICON_HEIGHT };
- if ( dat->avatars_draw_border ) {
+ POINT ptOverlay = { prcItem->right - ICON_HEIGHT, prcItem->bottom - ICON_HEIGHT };
+ if (dat->avatars_draw_border) {
ptOverlay.x--;
ptOverlay.y--;
}
- switch( dat->avatars_overlay_type ) {
+ switch (dat->avatars_overlay_type) {
case SETTING_AVATAR_OVERLAY_TYPE_NORMAL:
- ske_ImageList_DrawEx( hAvatarOverlays, g_pAvatarOverlayIcons[GetContactCachedStatus( Drawing->hContact ) - ID_STATUS_OFFLINE].listID,
+ ske_ImageList_DrawEx(hAvatarOverlays, g_pAvatarOverlayIcons[GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE].listID,
hdcMem,
ptOverlay.x, ptOverlay.y, ICON_HEIGHT, ICON_HEIGHT,
CLR_NONE, CLR_NONE,
- ( blendmode == 255 )?ILD_NORMAL:( blendmode == 128 )?ILD_BLEND50:ILD_BLEND25 );
+ (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
break;
case SETTING_AVATAR_OVERLAY_TYPE_PROTOCOL:
- {
- int item = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
- 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 );
- }
- break;
+ {
+ int item = pcli->pfnIconFromStatusMode(Drawing->proto, Drawing->proto == NULL ? ID_STATUS_OFFLINE : GetContactCachedStatus(Drawing->hContact), Drawing->hContact);
+ 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);
+ }
+ break;
case SETTING_AVATAR_OVERLAY_TYPE_CONTACT:
- 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 );
+ 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);
break;
}
}
}
}
-void CLCPaint::_DrawContactIcon( HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem )
+void CLCPaint::_DrawContactIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *prcItem)
{
//Draw Icon
int iImage = -1;
// Get image
- if ( Drawing->type == CLCIT_GROUP )
+ if (Drawing->type == CLCIT_GROUP)
{
- if (!dat->row_hide_group_icon ) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ if (!dat->row_hide_group_icon) iImage = Drawing->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
else iImage = -1;
}
- else if ( Drawing->type == CLCIT_CONTACT )
+ else if (Drawing->type == CLCIT_CONTACT)
iImage = Drawing->iImage;
// Has image to draw?
- if ( iImage != -1 )
+ if (iImage != -1)
{
COLORREF colourFg;
int mode;
- _GetBlendMode( dat, Drawing, selected, hottrack, GIM_STATUSICON_AFFECT, &colourFg, &mode );
- _DrawStatusIcon( Drawing, dat, iImage, hdcMem,
+ _GetBlendMode(dat, Drawing, selected, hottrack, GIM_STATUSICON_AFFECT, &colourFg, &mode);
+ _DrawStatusIcon(Drawing, dat, iImage, hdcMem,
prcItem->left, prcItem->top,
- 0, 0, CLR_NONE, colourFg, mode );
+ 0, 0, CLR_NONE, colourFg, mode);
}
}
-void CLCPaint::_DrawContactText( HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat )
+void CLCPaint::_DrawContactText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat)
{
- ChangeToFont(hdcMem, dat, GetBasicFontID( Drawing ), NULL );
- if ( selected )
- SetTextColor(hdcMem, dat->force_in_dialog ? GetSysColor( COLOR_HIGHLIGHTTEXT ) : dat->selTextColour );
- else if ( hottrack || (dat->filterSearch && dat->szQuickSearch[0] != '\0' && Drawing->type != CLCIT_GROUP) )
- _SetHotTrackColour(hdcMem, dat );
+ ChangeToFont(hdcMem, dat, GetBasicFontID(Drawing), NULL);
+ if (selected)
+ SetTextColor(hdcMem, dat->force_in_dialog ? GetSysColor(COLOR_HIGHLIGHTTEXT) : dat->selTextColour);
+ else if (hottrack || (dat->filterSearch && dat->szQuickSearch[0] != '\0' && Drawing->type != CLCIT_GROUP))
+ _SetHotTrackColour(hdcMem, dat);
- if ( Drawing->type == CLCIT_GROUP )
+ if (Drawing->type == CLCIT_GROUP)
{
- ske_DrawText(hdcMem, Drawing->szText, -1, prcItem, uTextFormat );
+ ske_DrawText(hdcMem, Drawing->szText, -1, prcItem, uTextFormat);
if (selected && !dat->filterSearch) {
- SetTextColor(hdcMem, dat->quickSearchColour );
- ske_DrawText(hdcMem, Drawing->szText, mir_tstrlen( dat->szQuickSearch ), prcItem, uTextFormat );
+ SetTextColor(hdcMem, dat->quickSearchColour);
+ ske_DrawText(hdcMem, Drawing->szText, mir_tstrlen(dat->szQuickSearch), prcItem, uTextFormat);
}
}
- else if ( Drawing->type == CLCIT_CONTACT )
+ else if (Drawing->type == CLCIT_CONTACT)
{
SIZE text_size;
- text_size.cx = _rcWidth( prcItem );
- text_size.cy = _rcHeight( prcItem );
+ text_size.cx = _rcWidth(prcItem);
+ text_size.cy = _rcHeight(prcItem);
uTextFormat |= DT_VCENTER;
//get font
- _DrawTextSmiley(hdcMem, prcItem, &text_size, Drawing->szText, 0, -1, Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
- if ( (dat->filterSearch || selected) && dat->szQuickSearch[0] != '\0' )
+ _DrawTextSmiley(hdcMem, prcItem, &text_size, Drawing->szText, 0, -1, Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
+ if ((dat->filterSearch || selected) && dat->szQuickSearch[0] != '\0')
{
int idx = 0;
- if ( dat->filterSearch )
+ if (dat->filterSearch)
{
TCHAR *lowered = CharLowerW(NEWTSTR_ALLOCA(Drawing->szText));
TCHAR *lowered_search = CharLowerW(NEWTSTR_ALLOCA(dat->szQuickSearch));
@@ -3051,203 +3050,203 @@ void CLCPaint::_DrawContactText( HDC hdcMem, ClcData *dat, ClcContact *Drawing,
if (p1)
idx = int(p1 - lowered);
}
- SetTextColor(hdcMem, dat->quickSearchColour );
- _DrawTextSmiley(hdcMem, prcItem, &text_size, Drawing->szText, idx, mir_tstrlen( dat->szQuickSearch ), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys );
+ SetTextColor(hdcMem, dat->quickSearchColour);
+ _DrawTextSmiley(hdcMem, prcItem, &text_size, Drawing->szText, idx, mir_tstrlen(dat->szQuickSearch), Drawing->ssText.plText, uTextFormat, dat->text_resize_smileys);
}
}
else
{
- ske_DrawText(hdcMem, Drawing->szText, -1, prcItem, uTextFormat );
+ ske_DrawText(hdcMem, Drawing->szText, -1, prcItem, uTextFormat);
}
- text_rc.right = max( text_rc.right, prcItem->right );
- text_rc.left = min( text_rc.left, prcItem->left );
+ text_rc.right = max(text_rc.right, prcItem->right);
+ text_rc.left = min(text_rc.left, prcItem->left);
}
-void CLCPaint::_DrawContactSubText( HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType )
+void CLCPaint::_DrawContactSubText(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem, UINT uTextFormat, BYTE itemType)
{
- if ( Drawing->type == CLCIT_GROUP )
+ if (Drawing->type == CLCIT_GROUP)
{
- char * szCounts = pcli->pfnGetGroupCountsText( dat, Drawing );
+ char * szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
- if ( szCounts && szCounts[0] )
+ if (szCounts && szCounts[0])
{
- ChangeToFont(hdcMem, dat, Drawing->group->expanded?FONTID_OPENGROUPCOUNTS:FONTID_CLOSEDGROUPCOUNTS, NULL );
- if ( selected )
- SetTextColor(hdcMem, dat->selTextColour );
- else if ( hottrack )
- _SetHotTrackColour(hdcMem, dat );
- ske_DrawTextA(hdcMem, szCounts, -1, prcItem, uTextFormat );
- ske_ResetTextEffect(hdcMem );
+ ChangeToFont(hdcMem, dat, Drawing->group->expanded ? FONTID_OPENGROUPCOUNTS : FONTID_CLOSEDGROUPCOUNTS, NULL);
+ if (selected)
+ SetTextColor(hdcMem, dat->selTextColour);
+ else if (hottrack)
+ _SetHotTrackColour(hdcMem, dat);
+ ske_DrawTextA(hdcMem, szCounts, -1, prcItem, uTextFormat);
+ ske_ResetTextEffect(hdcMem);
}
}
- else if ( Drawing->type == CLCIT_CONTACT )
+ else if (Drawing->type == CLCIT_CONTACT)
{
- SIZE text_size = { _rcWidth( prcItem ), _rcHeight( prcItem ) };
+ SIZE text_size = { _rcWidth(prcItem), _rcHeight(prcItem) };
ClcCacheEntry *pdnce = (Drawing->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(Drawing->hContact) : NULL;
- if ( pdnce ) {
- ChangeToFont(hdcMem, dat, itemType == CIT_SUBTEXT1 ? FONTID_SECONDLINE : FONTID_THIRDLINE, NULL );
+ if (pdnce) {
+ ChangeToFont(hdcMem, dat, itemType == CIT_SUBTEXT1 ? FONTID_SECONDLINE : FONTID_THIRDLINE, NULL);
//draw second and third line
- if ( selected )
- SetTextColor(hdcMem, dat->selTextColour );
- else if ( hottrack )
- _SetHotTrackColour(hdcMem, dat );
+ if (selected)
+ SetTextColor(hdcMem, dat->selTextColour);
+ else if (hottrack)
+ _SetHotTrackColour(hdcMem, dat);
uTextFormat |= DT_VCENTER;
- if ( itemType == CIT_SUBTEXT1 )
- _DrawTextSmiley(hdcMem, prcItem, &text_size, pdnce->szSecondLineText, 0, -1, pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys );
+ if (itemType == CIT_SUBTEXT1)
+ _DrawTextSmiley(hdcMem, prcItem, &text_size, pdnce->szSecondLineText, 0, -1, pdnce->ssSecondLine.plText, uTextFormat, dat->text_resize_smileys);
else
- _DrawTextSmiley(hdcMem, prcItem, &text_size, pdnce->szThirdLineText, 0, -1, pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys );
+ _DrawTextSmiley(hdcMem, prcItem, &text_size, pdnce->szThirdLineText, 0, -1, pdnce->ssThirdLine.plText, uTextFormat, dat->text_resize_smileys);
}
}
- text_rc.right = max( text_rc.right, prcItem->right );
- text_rc.left = min( text_rc.left, prcItem->left );
+ text_rc.right = max(text_rc.right, prcItem->right);
+ text_rc.left = min(text_rc.left, prcItem->left);
}
-void CLCPaint::_DrawContactTime( HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *prcItem )
+void CLCPaint::_DrawContactTime(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *prcItem)
{
TCHAR szResult[80];
ClcCacheEntry *pdnce = (Drawing->type == CLCIT_CONTACT) ? pcli->pfnGetCacheEntry(Drawing->hContact) : NULL;
- if (!pdnce )
+ if (!pdnce)
return;
if (!tmi.printDateTime(pdnce->hTimeZone, _T("t"), szResult, SIZEOF(szResult), 0)) {
// Select font
- ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL );
- ske_DrawText(hdcMem, szResult, mir_tstrlen( szResult ), prcItem, DT_NOPREFIX | DT_SINGLELINE );
+ ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
+ ske_DrawText(hdcMem, szResult, mir_tstrlen(szResult), prcItem, DT_NOPREFIX | DT_SINGLELINE);
}
}
-void CLCPaint::_DrawContactSelection( HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rcPaint, RECT *prcItem )
+void CLCPaint::_DrawContactSelection(HDC hdcMem, ClcData *dat, int& selected, int& hottrack, RECT *rcPaint, RECT *prcItem)
{
// Selection background
- if (( selected || hottrack ) && dat->HiLightMode == 0) {
- if ( selected )
+ if ((selected || hottrack) && dat->HiLightMode == 0) {
+ if (selected)
SkinDrawGlyph(hdcMem, prcItem, rcPaint, "Contact List/Selection");
- else if ( hottrack )
+ else if (hottrack)
SkinDrawGlyph(hdcMem, prcItem, rcPaint, "Contact List/HotTracking");
}
}
-void CLCPaint::_DrawContactExtraIcon( HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT& text_rc, RECT *rc, int iImage )
+void CLCPaint::_DrawContactExtraIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawing, int& selected, int& hottrack, RECT *rc, int iImage)
{
//Draw extra icon
- if ( iImage != -1 ) {
+ if (iImage != -1) {
int mode;
COLORREF colourFg;
- _GetBlendMode( dat, Drawing, selected, hottrack, GIM_EXTRAICON_AFFECT, &colourFg, &mode );
+ _GetBlendMode(dat, Drawing, selected, hottrack, GIM_EXTRAICON_AFFECT, &colourFg, &mode);
if (Drawing->iExtraImage[iImage] != EMPTY_EXTRA_ICON)
- ske_ImageList_DrawEx( dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
- rc->left, rc->top, 0, 0, CLR_NONE, colourFg, mode );
+ ske_ImageList_DrawEx(dat->himlExtraColumns, Drawing->iExtraImage[iImage], hdcMem,
+ rc->left, rc->top, 0, 0, CLR_NONE, colourFg, mode);
}
}
-void CLCPaint::_DrawContactLine( HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc )
+void CLCPaint::_DrawContactLine(HDC hdcMem, ClcContact *Drawing, RECT *free_row_rc, RECT *rcPaint, RECT& text_rc)
{ //draw line
RECT rc1 = *free_row_rc;
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.right = text_rc.left - 3;
+ rc2.left = text_rc.right + 3;
+ 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;
- IntersectRect( &rc1, &rcTemp, rcPaint );
+ IntersectRect(&rc1, &rcTemp, rcPaint);
}
{ //Subtract icon rect from left and right.
RECT rcTemp;
- IntersectRect( &rcTemp, &Drawing->pos_icon, &rc1 );
- if (!IsRectEmpty( &rcTemp )) rc1.right = rcTemp.left;
- IntersectRect( &rcTemp, &Drawing->pos_icon, &rc2 );
- if (!IsRectEmpty( &rcTemp )) rc2.left = rcTemp.right;
+ IntersectRect(&rcTemp, &Drawing->pos_icon, &rc1);
+ if (!IsRectEmpty(&rcTemp)) rc1.right = rcTemp.left;
+ IntersectRect(&rcTemp, &Drawing->pos_icon, &rc2);
+ 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 );
+ DrawEdge(hdcMem, &rc1, BDR_SUNKENOUTER, BF_RECT);
+ ske_SetRectOpaque(hdcMem, &rc1);
}
{
RECT rcTemp = rc2;
- IntersectRect( &rc2, &rcTemp, rcPaint );
+ 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 );
+ DrawEdge(hdcMem, &rc2, BDR_SUNKENOUTER, BF_RECT);
+ ske_SetRectOpaque(hdcMem, &rc2);
}
}
-void CLCPaint::_DrawContactItems( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
+void CLCPaint::_DrawContactItems(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT *row_rc, RECT *free_row_rc, int selected, int hottrack, RECT *rcPaint)
{
UINT uTextFormat = DT_NOPREFIX |
/*DT_VCENTER |*/
DT_SINGLELINE |
- ( dat->text_rtl ? DT_RTLREADING : 0 ) |
- ( dat->text_align_right ? DT_RIGHT : 0 )|
- ( gl_TrimText?DT_END_ELLIPSIS:0 )|
- (( dat->force_in_dialog || dat->bkChanged ) ? DT_FORCENATIVERENDER:0 );
+ (dat->text_rtl ? DT_RTLREADING : 0) |
+ (dat->text_align_right ? DT_RIGHT : 0) |
+ (gl_TrimText ? DT_END_ELLIPSIS : 0) |
+ ((dat->force_in_dialog || dat->bkChanged) ? DT_FORCENATIVERENDER : 0);
RECT text_rc = *row_rc;
text_rc.right = row_rc->left;
text_rc.left = row_rc->right;
- for (int i=0; i < Drawing->ext_nItemsNum; i++ )
+ for (int 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 ))
+ RECT *prcItem = &(Drawing->ext_mpItemsDesc[i].itemRect);
+ if (__IsVisible(rcPaint, prcItem) || (Drawing->ext_mpItemsDesc[i].itemType == CIT_AVATAR && Drawing->avatar_pos == AVATAR_POS_ANIMATED))
{
- switch( Drawing->ext_mpItemsDesc[i].itemType )
+ switch (Drawing->ext_mpItemsDesc[i].itemType)
{
case CIT_AVATAR:
- _DrawContactAvatar(hdcMem, dat, Drawing, row_rc, selected, hottrack, text_rc, prcItem );
+ _DrawContactAvatar(hdcMem, dat, Drawing, row_rc, selected, hottrack, prcItem);
break;
case CIT_ICON:
- _DrawContactIcon(hdcMem, dat, Drawing, selected, hottrack, text_rc, prcItem );
+ _DrawContactIcon(hdcMem, dat, Drawing, selected, hottrack, prcItem);
break;
case CIT_TEXT:
- _DrawContactText(hdcMem, dat, Drawing, selected, hottrack, text_rc, prcItem, uTextFormat );
+ _DrawContactText(hdcMem, dat, Drawing, selected, hottrack, text_rc, prcItem, uTextFormat);
break;
case CIT_SUBTEXT1:
case CIT_SUBTEXT2:
- _DrawContactSubText(hdcMem, dat, Drawing, selected, hottrack, text_rc, prcItem, uTextFormat, Drawing->ext_mpItemsDesc[i].itemType );
+ _DrawContactSubText(hdcMem, dat, Drawing, selected, hottrack, text_rc, prcItem, uTextFormat, Drawing->ext_mpItemsDesc[i].itemType);
break;
case CIT_TIME:
- _DrawContactTime(hdcMem, dat, Drawing, selected, hottrack, text_rc, prcItem );
+ _DrawContactTime(hdcMem, dat, Drawing, prcItem);
break;
case CIT_CHECKBOX:
//_DrawNothing no check boxes in skinned mode
break;
//other here
case CIT_SELECTION:
- _DrawContactSelection(hdcMem, dat, Drawing, selected, hottrack, rcPaint, prcItem );
+ _DrawContactSelection(hdcMem, dat, selected, hottrack, rcPaint, prcItem);
break;
default:
- if ( Drawing->ext_mpItemsDesc[i].itemType&CIT_EXTRA )
- _DrawContactExtraIcon(hdcMem, dat, Drawing, selected, hottrack, text_rc, prcItem, Drawing->ext_mpItemsDesc[i].itemType&0x3F );
+ if (Drawing->ext_mpItemsDesc[i].itemType&CIT_EXTRA)
+ _DrawContactExtraIcon(hdcMem, dat, Drawing, selected, hottrack, prcItem, Drawing->ext_mpItemsDesc[i].itemType & 0x3F);
break;
}
}
}
- if (( Drawing->type == CLCIT_GROUP && dat->exStyle&CLS_EX_LINEWITHGROUPS )
- || ( Drawing->type == CLCIT_DIVIDER ))
- _DrawContactLine(hdcMem, dat, Drawing, free_row_rc, rcPaint, text_rc );
+ if ((Drawing->type == CLCIT_GROUP && dat->exStyle&CLS_EX_LINEWITHGROUPS)
+ || (Drawing->type == CLCIT_DIVIDER))
+ _DrawContactLine(hdcMem, Drawing, free_row_rc, rcPaint, text_rc);
}
-void CLCPaint::_PaintRowItems ( HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint )
+void CLCPaint::_PaintRowItems(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT row_rc, RECT free_row_rc, int left_pos, int right_pos, int selected, int hottrack, RECT *rcPaint)
{
//Extended LAYOUT
- if ( gl_RowRoot && ( dat->hWnd == pcli->hwndContactTree ))
+ if (gl_RowRoot && (dat->hWnd == pcli->hwndContactTree))
{
- _PaintRowItemsEx( hwnd, hdcMem, dat, Drawing, row_rc, free_row_rc, left_pos, right_pos, selected, hottrack, rcPaint );
- ske_ResetTextEffect(hdcMem );
+ _PaintRowItemsEx(hwnd, hdcMem, dat, Drawing, row_rc, free_row_rc, selected, hottrack);
+ ske_ResetTextEffect(hdcMem);
return;
}
//END OFF Extended LAYOUT
- if (!Drawing->ext_fItemsValid ) _CalcItemsPos( hwnd, hdcMem, dat, Drawing, &row_rc, &free_row_rc, left_pos, right_pos, selected, hottrack );
- _DrawContactItems( hwnd, hdcMem, dat, Drawing, &row_rc, &free_row_rc, left_pos, right_pos, selected, hottrack, rcPaint );
- ske_ResetTextEffect(hdcMem );
+ if (!Drawing->ext_fItemsValid) _CalcItemsPos(hdcMem, dat, Drawing, &row_rc, &free_row_rc, left_pos, right_pos, selected);
+ _DrawContactItems(hdcMem, dat, Drawing, &row_rc, &free_row_rc, selected, hottrack, rcPaint);
+ ske_ResetTextEffect(hdcMem);
}
/* TODO Render items
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 865edfe98d..9939816e71 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -34,7 +34,7 @@ BOOL RectHitTest(RECT *rc, int testx, int testy)
return testx >= rc->left && testx < rc->right && testy >= rc->top && testy < rc->bottom;
}
-int cliHitTest(HWND hwnd,ClcData *dat,int testx,int testy,ClcContact **contact,ClcGroup **group,DWORD *flags)
+int cliHitTest(HWND hwnd, ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD *flags)
{
ClcContact *hitcontact = NULL;
ClcGroup *hitgroup = NULL;
@@ -46,7 +46,7 @@ int cliHitTest(HWND hwnd,ClcData *dat,int testx,int testy,ClcContact **contact,C
return -1;
}
if (flags) *flags = 0;
- GetClientRect(hwnd,&clRect);
+ GetClientRect(hwnd, &clRect);
if (testx < 0 || testy < 0 || testy >= clRect.bottom || testx >= clRect.right) {
if (flags) {
if (testx < 0) *flags |= CLCHT_TOLEFT;
@@ -57,7 +57,7 @@ int cliHitTest(HWND hwnd,ClcData *dat,int testx,int testy,ClcContact **contact,C
return -1;
}
if (testx < dat->leftMargin) {
- if (flags) *flags |= CLCHT_INLEFTMARGIN|CLCHT_NOWHERE;
+ if (flags) *flags |= CLCHT_INLEFTMARGIN | CLCHT_NOWHERE;
return -1;
}
@@ -68,15 +68,15 @@ int cliHitTest(HWND hwnd,ClcData *dat,int testx,int testy,ClcContact **contact,C
hit = cliGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
if (hit == -1) {
- if (flags) *flags |= CLCHT_NOWHERE|CLCHT_BELOWITEMS;
+ if (flags) *flags |= CLCHT_NOWHERE | CLCHT_BELOWITEMS;
return -1;
}
if (contact) *contact = hitcontact;
if (group) *group = hitgroup;
/////////
- if (((testx < hitcontact->pos_indent) && !dat->text_rtl) ||
- ((testx>clRect.right-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;
return hit;
@@ -105,11 +105,11 @@ int cliHitTest(HWND hwnd,ClcData *dat,int testx,int testy,ClcContact **contact,C
{
// int c = -1;
int i;
- for (i=0; i < dat->extraColumnsCount; i++)
+ for (i = 0; i < dat->extraColumnsCount; i++)
{
if (RectHitTest(&hitcontact->pos_extra[i], testx, testy))
{
- if (flags) *flags |= CLCHT_ONITEMEXTRA|(i << 24);
+ if (flags) *flags |= CLCHT_ONITEMEXTRA | (i << 24);
return hit;
}
}
@@ -131,54 +131,54 @@ int cliHitTest(HWND hwnd,ClcData *dat,int testx,int testy,ClcContact **contact,C
return hit;
}
-void cliScrollTo(HWND hwnd,ClcData *dat,int desty,int noSmooth)
+void cliScrollTo(HWND hwnd, ClcData *dat, int desty, int noSmooth)
{
- DWORD startTick,nowTick;
+ DWORD startTick, nowTick;
int oldy = dat->yScroll;
- RECT clRect,rcInvalidate;
- int maxy,previousy;
+ RECT clRect, rcInvalidate;
+ int maxy, previousy;
if (dat->iHotTrack != -1 && dat->yScroll != desty) {
- pcli->pfnInvalidateItem(hwnd,dat,dat->iHotTrack);
+ pcli->pfnInvalidateItem(hwnd, dat, dat->iHotTrack);
dat->iHotTrack = -1;
ReleaseCapture();
}
- GetClientRect(hwnd,&clRect);
+ GetClientRect(hwnd, &clRect);
rcInvalidate = clRect;
//maxy = dat->rowHeight*GetGroupContentsCount(&dat->list,2)-clRect.bottom;
- maxy = cliGetRowTotalHeight(dat)-clRect.bottom;
- if (desty>maxy) desty = maxy;
+ maxy = cliGetRowTotalHeight(dat) - clRect.bottom;
+ if (desty > maxy) desty = maxy;
if (desty < 0) desty = 0;
- if (abs(desty-dat->yScroll) < 4) noSmooth = 1;
+ 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 )
- | GetKeyState( VK_LEFT )
- | GetKeyState( VK_RIGHT )
- | GetKeyState( VK_PRIOR )
- | GetKeyState( VK_NEXT )
- | GetKeyState( VK_HOME )
- | GetKeyState( VK_END )) & 0x8000 );
+ BOOL keyDown = ((GetKeyState(VK_UP)
+ | GetKeyState(VK_DOWN)
+ | GetKeyState(VK_LEFT)
+ | GetKeyState(VK_RIGHT)
+ | GetKeyState(VK_PRIOR)
+ | GetKeyState(VK_NEXT)
+ | GetKeyState(VK_HOME)
+ | GetKeyState(VK_END)) & 0x8000);
if (!noSmooth && !keyDown)
{
startTick = GetTickCount();
for (;;) {
nowTick = GetTickCount();
- if (nowTick >= startTick+dat->scrollTime) break;
- dat->yScroll = oldy+(desty-oldy)*(int)(nowTick-startTick)/dat->scrollTime;
+ 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);
+ ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE);
else
{
- CallService(MS_SKINENG_UPTATEFRAMEIMAGE,(WPARAM) hwnd, (LPARAM) 0);
+ CallService(MS_SKINENG_UPTATEFRAMEIMAGE, (WPARAM)hwnd, (LPARAM)0);
//InvalidateRectZ(hwnd,NULL,FALSE);
}
previousy = dat->yScroll;
- SetScrollPos(hwnd,SB_VERT,dat->yScroll,TRUE);
- CallService(MS_SKINENG_UPTATEFRAMEIMAGE,(WPARAM) hwnd, (LPARAM) 0);
+ SetScrollPos(hwnd, SB_VERT, dat->yScroll, TRUE);
+ CallService(MS_SKINENG_UPTATEFRAMEIMAGE, (WPARAM)hwnd, (LPARAM)0);
UpdateWindow(hwnd);
}
}
@@ -188,20 +188,20 @@ void cliScrollTo(HWND hwnd,ClcData *dat,int desty,int noSmooth)
}
-void cliRecalcScrollBar(HWND hwnd,ClcData *dat)
+void cliRecalcScrollBar(HWND hwnd, ClcData *dat)
{
- SCROLLINFO si = {0};
+ SCROLLINFO si = { 0 };
RECT clRect;
NMCLISTCONTROL nm;
if (LOCK_RECALC_SCROLLBAR) return;
RowHeights_CalcRowHeights(dat, hwnd);
- GetClientRect(hwnd,&clRect);
+ GetClientRect(hwnd, &clRect);
si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
si.nMin = 0;
- si.nMax = cliGetRowTotalHeight(dat)-1;
+ si.nMax = cliGetRowTotalHeight(dat) - 1;
si.nPage = clRect.bottom;
si.nPos = dat->yScroll;
@@ -210,38 +210,38 @@ void cliRecalcScrollBar(HWND hwnd,ClcData *dat)
nm.hdr.idFrom = 0;//GetDlgCtrlID(hwnd);
nm.pt.y = si.nMax;
- SendMessage(GetParent(hwnd),WM_NOTIFY, 0, (LPARAM)&nm); //post
+ SendMessage(GetParent(hwnd), WM_NOTIFY, 0, (LPARAM)&nm); //post
- GetClientRect(hwnd,&clRect);
+ GetClientRect(hwnd, &clRect);
si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
si.nMin = 0;
- si.nMax = cliGetRowTotalHeight(dat)-1;
+ 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 (GetWindowLongPtr(hwnd, GWL_STYLE)&CLS_CONTACTLIST) {
+ if (dat->noVScrollbar == 0) SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
//else SetScrollInfo(hwnd,SB_VERT,&si,FALSE);
}
else
- SetScrollInfo(hwnd,SB_VERT,&si,TRUE);
+ SetScrollInfo(hwnd, SB_VERT, &si, TRUE);
g_mutex_bSizing = 1;
- cliScrollTo(hwnd,dat,dat->yScroll,1);
+ cliScrollTo(hwnd, dat, dat->yScroll, 1);
g_mutex_bSizing = 0;
}
static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_KEYDOWN:
- switch(wParam) {
+ switch (wParam) {
case VK_RETURN:
- pcli->pfnEndRename(GetParent(hwnd),(ClcData*)GetWindowLongPtr(hwnd,GWLP_USERDATA),1);
+ pcli->pfnEndRename(GetParent(hwnd), (ClcData*)GetWindowLongPtr(hwnd, GWLP_USERDATA), 1);
return 0;
case VK_ESCAPE:
- pcli->pfnEndRename(GetParent(hwnd),(ClcData*)GetWindowLongPtr(hwnd,GWLP_USERDATA),0);
+ pcli->pfnEndRename(GetParent(hwnd), (ClcData*)GetWindowLongPtr(hwnd, GWLP_USERDATA), 0);
return 0;
}
break;
@@ -253,26 +253,26 @@ static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
}
return DLGC_WANTMESSAGE;
case WM_KILLFOCUS:
- pcli->pfnEndRename(GetParent(hwnd),(ClcData*)GetWindowLongPtr(hwnd,GWLP_USERDATA),1);
- SendMessage(pcli->hwndContactTree,WM_SIZE, 0, 0);
+ pcli->pfnEndRename(GetParent(hwnd), (ClcData*)GetWindowLongPtr(hwnd, GWLP_USERDATA), 1);
+ SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
return 0;
}
return mir_callNextSubclass(hwnd, RenameEditSubclassProc, msg, wParam, lParam);
}
-void cliBeginRenameSelection(HWND hwnd,ClcData *dat)
+void cliBeginRenameSelection(HWND hwnd, ClcData *dat)
{
ClcContact *contact;
ClcGroup *group;
- int indent,x,y,subident, h,w;
+ int indent, x, y, subident, h, w;
RECT clRect;
RECT r;
- KillTimer(hwnd,TIMERID_RENAME);
+ KillTimer(hwnd, TIMERID_RENAME);
ReleaseCapture();
dat->iHotTrack = -1;
- dat->selection = cliGetRowByIndex(dat,dat->selection,&contact,&group);
+ dat->selection = cliGetRowByIndex(dat, dat->selection, &contact, &group);
if (dat->selection == -1) return;
if (contact->type != CLCIT_CONTACT && contact->type != CLCIT_GROUP) return;
@@ -281,16 +281,16 @@ void cliBeginRenameSelection(HWND hwnd,ClcData *dat)
else
subident = 0;
- 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;
+ 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];
{
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
@@ -299,17 +299,17 @@ void cliBeginRenameSelection(HWND hwnd,ClcData *dat)
RECT rectW;
int h2;
- GetWindowRect(hwnd,&rectW);
+ 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;
+ 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);
}
@@ -323,106 +323,107 @@ void cliBeginRenameSelection(HWND hwnd,ClcData *dat)
}
if (dat->text_rtl) a |= EN_ALIGN_RTL_EC;
if (contact->type == CLCIT_GROUP)
- dat->hwndRenameEdit = CreateWindow(_T("EDIT"),contact->szText,WS_POPUP|WS_BORDER|ES_AUTOHSCROLL|a,x,y,w,h,hwnd,NULL,g_hInst,NULL);
+ dat->hwndRenameEdit = CreateWindow(_T("EDIT"), contact->szText, WS_POPUP | WS_BORDER | ES_AUTOHSCROLL | a, x, y, w, h, hwnd, NULL, g_hInst, NULL);
else
- dat->hwndRenameEdit = CreateWindow(_T("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(_T("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);
+ SetWindowLongPtr(dat->hwndRenameEdit, GWL_STYLE, GetWindowLongPtr(dat->hwndRenameEdit, GWL_STYLE)&(~WS_CAPTION) | WS_BORDER);
+ SetWindowLongPtr(dat->hwndRenameEdit, GWLP_USERDATA, (LONG_PTR)dat);
mir_subclassWindow(dat->hwndRenameEdit, 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));
+ 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));
r.top = 1;
- r.bottom = h-1;
+ r.bottom = h - 1;
r.left = 0;
r.right = w;
//ES_MULTILINE
- SendMessage(dat->hwndRenameEdit,EM_SETRECT, 0, (LPARAM)(&r));
+ SendMessage(dat->hwndRenameEdit, EM_SETRECT, 0, (LPARAM)(&r));
- CLUI_ShowWindowMod(dat->hwndRenameEdit,SW_SHOW);
- SetWindowPos(dat->hwndRenameEdit,HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
+ CLUI_ShowWindowMod(dat->hwndRenameEdit, SW_SHOW);
+ SetWindowPos(dat->hwndRenameEdit, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
SetFocus(dat->hwndRenameEdit);
}
-int GetDropTargetInformation(HWND hwnd,ClcData *dat,POINT pt)
+int GetDropTargetInformation(HWND hwnd, ClcData *dat, POINT pt)
{
RECT clRect;
int hit;
- ClcContact *contact = NULL,*movecontact = NULL;
- ClcGroup *group,*movegroup;
+ ClcContact *contact = NULL, *movecontact = NULL;
+ ClcGroup *group, *movegroup;
DWORD hitFlags;
int nSetSelection = -1;
- GetClientRect(hwnd,&clRect);
+ GetClientRect(hwnd, &clRect);
dat->selection = dat->iDragItem;
dat->iInsertionMark = -1;
dat->nInsertionLevel = 0;
- if (!PtInRect(&clRect,pt)) return DROPTARGET_OUTSIDE;
+ if (!PtInRect(&clRect, pt)) return DROPTARGET_OUTSIDE;
- hit = cliHitTest(hwnd,dat,pt.x,pt.y,&contact,&group,&hitFlags);
- cliGetRowByIndex(dat,dat->iDragItem,&movecontact,&movegroup);
+ 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) {
- ClcContact *bottomcontact = NULL,*topcontact = NULL;
+ ClcContact *bottomcontact = NULL, *topcontact = NULL;
ClcGroup *topgroup = NULL, *bottomgroup = NULL;
- int topItem = -1,bottomItem = -1;
+ int topItem = -1, bottomItem = -1;
int ok = 0;
- if (pt.y+dat->yScroll < cliGetRowTopY(dat,hit)+dat->insertionMarkHitHeight || contact->type != CLCIT_GROUP) {
+ if (pt.y + dat->yScroll < cliGetRowTopY(dat, hit) + dat->insertionMarkHitHeight || contact->type != CLCIT_GROUP) {
//could be insertion mark (above)
- topItem = hit-1; bottomItem = hit;
+ topItem = hit - 1; bottomItem = hit;
bottomcontact = contact;
bottomgroup = group;
- topItem = cliGetRowByIndex(dat,topItem,&topcontact,&topgroup);
+ 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))
+ }
+ 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;
+ topItem = hit; bottomItem = hit + 1;
topcontact = contact; topgroup = group;
- bottomItem = cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
+ bottomItem = cliGetRowByIndex(dat, bottomItem, &bottomcontact, &bottomgroup);
ok = 1;
}
if (ok)
{
if (bottomItem == -1 && contact->type == CLCIT_GROUP)
{
- bottomItem = topItem+1;
+ bottomItem = topItem + 1;
}
else
{
if (bottomItem == -1 && contact->type != CLCIT_GROUP && contact->groupId == 0)
{
bottomItem = topItem;
- cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
+ cliGetRowByIndex(dat, bottomItem, &bottomcontact, &bottomgroup);
}
if (bottomItem != -1 && bottomcontact->type != CLCIT_GROUP)
{
ClcGroup *gr = bottomgroup;
do
{
- bottomItem = cliGetRowByIndex(dat,bottomItem-1,&bottomcontact,&bottomgroup);}
- while (bottomItem >= 0 && bottomcontact->type != CLCIT_GROUP && bottomgroup == gr);
+ 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);
}
}
- if (bottomItem == -1) bottomItem = topItem+1;
+ if (bottomItem == -1) bottomItem = topItem + 1;
{
- int bi = cliGetRowByIndex(dat,bottomItem,&bottomcontact,&bottomgroup);
+ 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)
+ for (; group; group = group->parent)
{
dat->nInsertionLevel++;
if (group == movecontact->group) return DROPTARGET_ONSELF;
@@ -440,8 +441,8 @@ int GetDropTargetInformation(HWND hwnd,ClcData *dat,POINT pt)
{
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;
@@ -461,21 +462,21 @@ int GetDropTargetInformation(HWND hwnd,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);
}
-void RegisterCLUIFonts( void );
-void LoadCLCFonts( HWND hwnd, ClcData *dat )
+void RegisterCLUIFonts(void);
+void LoadCLCFonts(HWND hwnd, ClcData *dat)
{
RegisterCLUIFonts();
HDC hdc = GetDC(hwnd);
- HFONT holdfont = (HFONT)GetCurrentObject( hdc, OBJ_FONT );
+ HFONT holdfont = (HFONT)GetCurrentObject(hdc, OBJ_FONT);
- for ( int i=0 ; i <= FONTID_MODERN_MAX; i++ )
+ for (int i = 0; i <= FONTID_MODERN_MAX; i++)
{
- if (!dat->fontModernInfo[i].changed && dat->fontModernInfo[i].hFont )
+ if (!dat->fontModernInfo[i].changed && dat->fontModernInfo[i].hFont)
{
DeleteObject(dat->fontModernInfo[i].hFont);
}
@@ -483,17 +484,17 @@ void LoadCLCFonts( HWND hwnd, ClcData *dat )
// Issue 40: Do not reload font colors for embedded clists
// Parent window is responsible to re-set fonts colors if needed
- GetFontSetting( i, &lf, dat->force_in_dialog ? NULL: &dat->fontModernInfo[i].colour, &dat->fontModernInfo[i].effect, &dat->fontModernInfo[i].effectColour1, &dat->fontModernInfo[i].effectColour2 );
- dat->fontModernInfo[i].hFont = CreateFontIndirect( &lf );
+ GetFontSetting(i, &lf, dat->force_in_dialog ? NULL : &dat->fontModernInfo[i].colour, &dat->fontModernInfo[i].effect, &dat->fontModernInfo[i].effectColour1, &dat->fontModernInfo[i].effectColour2);
+ dat->fontModernInfo[i].hFont = CreateFontIndirect(&lf);
dat->fontModernInfo[i].changed = 0;
- SelectObject( hdc, dat->fontModernInfo[i].hFont );
+ SelectObject(hdc, dat->fontModernInfo[i].hFont);
SIZE fontSize;
- GetTextExtentPoint32A( hdc, "x", 1, &fontSize );
+ GetTextExtentPoint32A(hdc, "x", 1, &fontSize);
dat->fontModernInfo[i].fontHeight = fontSize.cy;
}
- SelectObject( hdc, holdfont );
- ReleaseDC( hwnd, hdc );
+ SelectObject(hdc, holdfont);
+ ReleaseDC(hwnd, hdc);
}
void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
@@ -708,7 +709,6 @@ void LoadCLCOptions(HWND hwnd, ClcData *dat, BOOL bFirst)
int ExpandMetaContact(HWND hwnd, ClcContact *contact, ClcData *dat, BOOL bExpand)
{
- 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;
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp
index f59d9a51f8..7e93070e67 100644
--- a/plugins/Clist_modern/src/modern_clistevents.cpp
+++ b/plugins/Clist_modern/src/modern_clistevents.cpp
@@ -85,7 +85,7 @@ static CLISTEVENT* MyGetEvent(int iSelection)
{
int i;
- for (i=0; i < pcli->events.count; i++) {
+ for (i = 0; i < pcli->events.count; i++) {
struct CListEvent* p = pcli->events.items[i];
if (p->menuId == iSelection)
return &p->cle;
@@ -94,7 +94,7 @@ static CLISTEVENT* MyGetEvent(int iSelection)
}
-CListEvent* cliCreateEvent( void )
+CListEvent* cliCreateEvent(void)
{
CListEvent *p = (CListEvent *)mir_calloc(sizeof(CListEvent));
return p;
@@ -106,20 +106,22 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle)
if (p == NULL)
return NULL;
- 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)) {
MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA | MIIM_BITMAP | MIIM_ID;
- if (p->cle.pszService &&
+ if (p->cle.pszService &&
(!strncmp("SRMsg/ReadMessage", p->cle.pszService, SIZEOF("SRMsg/ReadMessage")) ||
- !strncmp("GChat/DblClickEvent", p->cle.pszService, SIZEOF("GChat/DblClickEvent"))))
+ !strncmp("GChat/DblClickEvent", p->cle.pszService, SIZEOF("GChat/DblClickEvent"))))
{
// dup check only for msg events
for (int j = 0; j < GetMenuItemCount(g_CluiData.hMenuNotify); j++) {
if (GetMenuItemInfo(g_CluiData.hMenuNotify, j, TRUE, &mii) != 0) {
NotifyMenuItemExData *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;
- } } }
+ }
+ }
+ }
char *szProto = GetContactProto(p->cle.hContact);
TCHAR *szName = pcli->pfnGetContactDisplayName(p->cle.hContact, 0);
@@ -139,10 +141,10 @@ struct CListEvent* cli_AddEvent(CLISTEVENT *cle)
nmi->iIcon = p->imlIconIndex;
nmi->hIcon = p->cle.hIcon;
nmi->hDbEvent = p->cle.hDbEvent;
- mii.dwItemData = (ULONG_PTR) nmi;
+ mii.dwItemData = (ULONG_PTR)nmi;
mii.wID = g_CluiData.wNextMenuID;
SetMenuItemInfo(g_CluiData.hMenuNotify, g_CluiData.wNextMenuID, FALSE, &mii);
- p-> menuId = g_CluiData.wNextMenuID;
+ p->menuId = g_CluiData.wNextMenuID;
g_CluiData.wNextMenuID++;
if (g_CluiData.wNextMenuID > 0x7fff)
g_CluiData.wNextMenuID = 1;
@@ -182,7 +184,7 @@ int cli_RemoveEvent(MCONTACT hContact, HANDLE hDbEvent)
// remove event from the notify menu
if (pcli->events.items[i]->menuId > 0) {
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
if (GetMenuItemInfo(g_CluiData.hMenuNotify, pcli->events.items[i]->menuId, FALSE, &mii) != 0) {
@@ -217,11 +219,11 @@ struct event_area_t
int useWinColors;
int backgroundBmpUse;
- event_area_t():
- hBmpBackground( NULL),
- bkColour( CLCDEFAULT_BKCOLOUR ),
- useWinColors( CLCDEFAULT_USEWINDOWSCOLOURS ),
- backgroundBmpUse( CLCDEFAULT_USEBITMAP )
+ event_area_t() :
+ hBmpBackground(NULL),
+ bkColour(CLCDEFAULT_BKCOLOUR),
+ useWinColors(CLCDEFAULT_USEWINDOWSCOLOURS),
+ backgroundBmpUse(CLCDEFAULT_USEBITMAP)
{}
};
@@ -235,7 +237,7 @@ static BOOL sttDrawEventAreaBackground(HWND hwnd, HDC hdc, RECT *rect)
RECT rc;
if (rect) rc = *rect;
- else GetClientRect(hwnd,&rc);
+ else GetClientRect(hwnd, &rc);
if (!event_area.hBmpBackground && !event_area.useWinColors)
{
@@ -245,7 +247,7 @@ static BOOL sttDrawEventAreaBackground(HWND hwnd, HDC hdc, RECT *rect)
}
else
{
- DrawBackGround(hwnd,hdc,event_area.hBmpBackground,event_area.bkColour,event_area.backgroundBmpUse);
+ DrawBackGround(hwnd, hdc, event_area.hBmpBackground, event_area.bkColour, event_area.backgroundBmpUse);
}
}
return TRUE;
@@ -253,7 +255,7 @@ static BOOL sttDrawEventAreaBackground(HWND hwnd, HDC hdc, RECT *rect)
COLORREF sttGetColor(char * module, char * color, COLORREF defColor); //clcutils
-static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
+static int ehhEventAreaBackgroundSettingsChanged(WPARAM, LPARAM)
{
if (event_area.hBmpBackground)
{
@@ -263,9 +265,9 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
if (g_CluiData.fDisableSkinEngine)
{
DBVARIANT dbv;
- event_area.bkColour = sttGetColor("EventArea","BkColour",CLCDEFAULT_BKCOLOUR);
- if ( db_get_b(NULL,"EventArea","UseBitmap",CLCDEFAULT_USEBITMAP)) {
- if (!db_get_s(NULL,"EventArea","BkBitmap",&dbv)) {
+ event_area.bkColour = sttGetColor("EventArea", "BkColour", CLCDEFAULT_BKCOLOUR);
+ if (db_get_b(NULL, "EventArea", "UseBitmap", CLCDEFAULT_USEBITMAP)) {
+ if (!db_get_s(NULL, "EventArea", "BkBitmap", &dbv)) {
event_area.hBmpBackground = (HBITMAP)CallService(MS_UTILS_LOADBITMAP, 0, (LPARAM)dbv.pszVal);
db_free(&dbv);
}
@@ -273,7 +275,7 @@ static int ehhEventAreaBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
event_area.useWinColors = db_get_b(NULL, "EventArea", "UseWinColours", CLCDEFAULT_USEWINDOWSCOLOURS);
event_area.backgroundBmpUse = db_get_w(NULL, "EventArea", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- PostMessage(pcli->hwndContactList,WM_SIZE, 0, 0);
+ PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
return 0;
}
@@ -281,9 +283,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;
@@ -296,18 +298,18 @@ void EventArea_ConfigureEventArea()
}
-static int EventArea_PaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData)
+static int EventArea_PaintCallbackProc(HWND hWnd, HDC hDC, RECT *, HRGN, DWORD, void *)
{
- return EventArea_Draw(hWnd,hDC);
+ return EventArea_Draw(hWnd, hDC);
}
static int EventArea_Draw(HWND hwnd, HDC hDC)
{
if (hwnd == (HWND)-1) return 0;
if (GetParent(hwnd) == pcli->hwndContactList)
- return EventArea_DrawWorker(hwnd,hDC);
+ return EventArea_DrawWorker(hwnd, hDC);
- CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
+ CLUI__cliInvalidateRect(hwnd, NULL, FALSE);
return 0;
}
@@ -315,14 +317,14 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC)
{
RECT rc;
HFONT hOldFont;
- GetClientRect(hWnd,&rc);
- if ( g_CluiData.fDisableSkinEngine )
- sttDrawEventAreaBackground( hWnd, hDC, &rc );
+ GetClientRect(hWnd, &rc);
+ if (g_CluiData.fDisableSkinEngine)
+ sttDrawEventAreaBackground(hWnd, hDC, &rc);
else
- SkinDrawGlyph(hDC,&rc,&rc,"Main,ID=EventArea");
+ SkinDrawGlyph(hDC, &rc, &rc, "Main,ID=EventArea");
- hOldFont = g_clcPainter.ChangeToFont(hDC,NULL,FONTID_EVENTAREA,NULL);
- SetBkMode(hDC,TRANSPARENT);
+ hOldFont = g_clcPainter.ChangeToFont(hDC, NULL, FONTID_EVENTAREA, NULL);
+ SetBkMode(hDC, TRANSPARENT);
int iCount = GetMenuItemCount(g_CluiData.hMenuNotify);
rc.left += 26;
@@ -336,7 +338,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC)
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);
}
else if (iCount > 0) {
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
struct NotifyMenuItemExData *nmi;
TCHAR *szName;
int iIcon;
@@ -361,7 +363,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC)
}
ske_ResetTextEffect(hDC);
- SelectObject(hDC,hOldFont);
+ SelectObject(hDC, hOldFont);
return 0;
}
@@ -390,41 +392,41 @@ static void EventArea_HideShowNotifyFrame()
int EventArea_Create(HWND hCluiWnd)
{
- CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)(LPGEN("Event area background")"/EventArea"),0);
- HookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhEventAreaBackgroundSettingsChanged);
+ CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)(LPGEN("Event area background")"/EventArea"), 0);
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED, ehhEventAreaBackgroundSettingsChanged);
ehhEventAreaBackgroundSettingsChanged(0, 0);
- WNDCLASS wndclass = {0};
+ WNDCLASS wndclass = { 0 };
TCHAR pluginname[] = _T("EventArea");
- int h = GetSystemMetrics(SM_CYSMICON)+2;
- if (GetClassInfo(g_hInst,pluginname,&wndclass) == 0) {
- wndclass.style = 0;
- wndclass.lpfnWndProc = EventArea_WndProc;
- wndclass.cbClsExtra = 0;
- wndclass.cbWndExtra = 0;
- wndclass.hInstance = g_hInst;
- wndclass.hIcon = NULL;
- wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
+ int h = GetSystemMetrics(SM_CYSMICON) + 2;
+ if (GetClassInfo(g_hInst, pluginname, &wndclass) == 0) {
+ wndclass.style = 0;
+ wndclass.lpfnWndProc = EventArea_WndProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = g_hInst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.hbrBackground = GetSysColorBrush(COLOR_3DFACE);
- wndclass.lpszMenuName = NULL;
+ wndclass.lpszMenuName = NULL;
wndclass.lpszClassName = pluginname;
RegisterClass(&wndclass);
}
- g_CluiData.hwndEventFrame = CreateWindow(pluginname,pluginname,WS_CHILD|WS_VISIBLE|WS_CLIPCHILDREN,
- 0, 0, 0, h,hCluiWnd,NULL,g_hInst,NULL);
+ 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 = { sizeof(Frame) };
Frame.hWnd = g_CluiData.hwndEventFrame;
Frame.align = alBottom;
Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
- Frame.Flags = ( db_get_b(NULL,"CLUI","ShowEventArea",SETTING_SHOWEVENTAREAFRAME_DEFAULT)?F_VISIBLE:0)|F_LOCKED|F_NOBORDER|F_NO_SUBCONTAINER|F_TCHAR;
+ 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,0);
- CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)EventArea_PaintCallbackProc); //$$$$$ register sub for frame
- CallService(MS_CLIST_FRAMES_UPDATEFRAME,-1,0);
+ hNotifyFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 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.hMenuNotify = CreatePopupMenu();
@@ -437,51 +439,51 @@ int EventArea_UnloadModule()
{
// remove frame window
// remove all events data from menu
- DestroyMenu( g_CluiData.hMenuNotify );
+ DestroyMenu(g_CluiData.hMenuNotify);
return 0;
}
static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_MEASUREITEM:
- {
- MEASUREITEMSTRUCT *lpi = (LPMEASUREITEMSTRUCT) lParam;
- MENUITEMINFOA mii = {0};
+ {
+ MEASUREITEMSTRUCT *lpi = (LPMEASUREITEMSTRUCT)lParam;
+ MENUITEMINFOA mii = { 0 };
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_DATA | MIIM_ID;
- if (GetMenuItemInfoA(g_CluiData.hMenuNotify, lpi->itemID, FALSE, &mii) != 0) {
- if (mii.dwItemData == lpi->itemData) {
- lpi->itemWidth = 8 + 16;
- lpi->itemHeight = 0;
- return TRUE;
- }
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_DATA | MIIM_ID;
+ if (GetMenuItemInfoA(g_CluiData.hMenuNotify, lpi->itemID, FALSE, &mii) != 0) {
+ if (mii.dwItemData == lpi->itemData) {
+ lpi->itemWidth = 8 + 16;
+ lpi->itemHeight = 0;
+ return TRUE;
}
}
- break;
+ }
+ break;
case WM_DRAWITEM:
- {
- LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT) lParam;
- if (dis->hwndItem == (HWND) g_CluiData.hMenuNotify) {
- NotifyMenuItemExData *nmi = 0;
-
- MENUITEMINFOA mii = {0};
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_DATA;
- if (GetMenuItemInfoA(g_CluiData.hMenuNotify, (UINT) dis->itemID, FALSE, &mii) != 0) {
- nmi = (NotifyMenuItemExData *) mii.dwItemData;
- if (nmi) {
- int iIcon = cli_GetContactIcon(nmi->hContact);
- ske_ImageList_DrawEx(g_himlCListClc, nmi->iIcon, dis->hDC, 2, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
- ske_ImageList_DrawEx(g_himlCListClc, iIcon, dis->hDC, 2+GetSystemMetrics(SM_CXSMICON)+2, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
- return TRUE;
- }
+ {
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
+ if (dis->hwndItem == (HWND)g_CluiData.hMenuNotify) {
+ NotifyMenuItemExData *nmi = 0;
+
+ MENUITEMINFOA mii = { 0 };
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_DATA;
+ if (GetMenuItemInfoA(g_CluiData.hMenuNotify, (UINT)dis->itemID, FALSE, &mii) != 0) {
+ nmi = (NotifyMenuItemExData *)mii.dwItemData;
+ if (nmi) {
+ int iIcon = cli_GetContactIcon(nmi->hContact);
+ ske_ImageList_DrawEx(g_himlCListClc, nmi->iIcon, dis->hDC, 2, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
+ ske_ImageList_DrawEx(g_himlCListClc, iIcon, dis->hDC, 2 + GetSystemMetrics(SM_CXSMICON) + 2, (dis->rcItem.bottom + dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), CLR_NONE, CLR_NONE, ILD_NORMAL);
+ return TRUE;
}
}
- break;
}
+ break;
+ }
case WM_LBUTTONUP:
if (g_CluiData.bEventAreaEnabled)
SendMessage(hwnd, WM_COMMAND, MAKEWPARAM(IDC_NOTIFYBUTTON, 0), 0);
@@ -490,7 +492,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
case WM_COMMAND:
if (LOWORD(wParam) == IDC_NOTIFYBUTTON) {
int iSelection;
- MENUITEMINFO mii = {0};
+ MENUITEMINFO mii = { 0 };
POINT pt;
struct NotifyMenuItemExData *nmi = 0;
int iCount = GetMenuItemCount(g_CluiData.hMenuNotify);
@@ -503,19 +505,19 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
iSelection = TrackPopupMenu(g_CluiData.hMenuNotify, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, NULL);
else
iSelection = GetMenuItemID(g_CluiData.hMenuNotify, 0);
- result = GetMenuItemInfo(g_CluiData.hMenuNotify, (UINT) iSelection, FALSE, &mii);
+ result = GetMenuItemInfo(g_CluiData.hMenuNotify, (UINT)iSelection, FALSE, &mii);
if (result != 0) {
nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
if (nmi) {
CLISTEVENT *cle = MyGetEvent(iSelection);
if (cle) {
CLISTEVENT *cle1 = NULL;
- CallService(cle->pszService, (WPARAM) NULL, (LPARAM) cle);
+ CallService(cle->pszService, (WPARAM)NULL, (LPARAM)cle);
// 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)
- CallService(MS_CLIST_REMOVEEVENT, (WPARAM) cle->hContact, (LPARAM) cle->hDbEvent);
+ CallService(MS_CLIST_REMOVEEVENT, (WPARAM)cle->hContact, (LPARAM)cle->hDbEvent);
}
}
}
@@ -525,7 +527,7 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
case WM_SIZE:
if (!g_CluiData.fLayered)
- InvalidateRect(hwnd,NULL,FALSE);
+ InvalidateRect(hwnd, NULL, FALSE);
return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_ERASEBKGND:
@@ -533,28 +535,28 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
case WM_PAINT:
if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
- CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)hwnd,0);
+ CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)hwnd, 0);
else if (GetParent(hwnd) == pcli->hwndContactList && !g_CluiData.fLayered) {
HDC hdc, hdc2;
- HBITMAP hbmp,hbmpo;
- RECT rc = {0};
- GetClientRect(hwnd,&rc);
+ HBITMAP hbmp, hbmpo;
+ 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);
- ske_BltBackImage(hwnd,hdc2,&rc);
- EventArea_DrawWorker(hwnd,hdc2);
- BitBlt(hdc,rc.left,rc.top,rc.right-rc.left,rc.bottom-rc.top,
- hdc2,rc.left,rc.top,SRCCOPY);
- SelectObject(hdc2,hbmpo);
+ 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,
+ hdc2, rc.left, rc.top, SRCCOPY);
+ SelectObject(hdc2, hbmpo);
DeleteObject(hbmp);
DeleteDC(hdc2);
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ReleaseDC(hwnd,hdc);
- ValidateRect(hwnd,NULL);
+ SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
+ ReleaseDC(hwnd, hdc);
+ ValidateRect(hwnd, NULL);
}
else {
HDC hdc, hdc2;
@@ -562,20 +564,20 @@ static LRESULT CALLBACK EventArea_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LP
RECT rc;
PAINTSTRUCT ps;
HBRUSH br = GetSysColorBrush(COLOR_3DFACE);
- GetClientRect(hwnd,&rc);
- hdc = BeginPaint(hwnd,&ps);
+ GetClientRect(hwnd, &rc);
+ 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,
- hdc2,ps.rcPaint.left,ps.rcPaint.top,SRCCOPY);
- SelectObject(hdc2,hbmpo);
+ 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,
+ hdc2, ps.rcPaint.left, ps.rcPaint.top, SRCCOPY);
+ SelectObject(hdc2, hbmpo);
DeleteObject(hbmp);
DeleteDC(hdc2);
ps.fErase = FALSE;
- EndPaint(hwnd,&ps);
+ EndPaint(hwnd, &ps);
}
default:
diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp
index 11e6bafaaf..8221eceea7 100644
--- a/plugins/Clist_modern/src/modern_clistmenus.cpp
+++ b/plugins/Clist_modern/src/modern_clistmenus.cpp
@@ -33,7 +33,7 @@ int UnloadFavoriteContactMenu();
#pragma hdrstop
-INT_PTR CloseAction(WPARAM wParam, LPARAM lParam)
+INT_PTR CloseAction(WPARAM, LPARAM)
{
int k;
g_CluiData.bSTATE = STATE_PREPEARETOEXIT; // workaround for avatar service and other wich destroys service on OK_TOEXIT
@@ -85,10 +85,10 @@ static TCHAR *rates[] = {
static IconItem iconList[] =
{
- { LPGEN("Contact rate: none"), "Rate1", IDI_FAVORITE_0 },
- { LPGEN("Contact rate: low"), "Rate2", IDI_FAVORITE_1 },
- { LPGEN("Contact rate: medium"), "Rate3", IDI_FAVORITE_2 },
- { LPGEN("Contact rate: high"), "Rate4", IDI_FAVORITE_3 }
+ { LPGEN("Contact rate: none"), "Rate1", IDI_FAVORITE_0 },
+ { LPGEN("Contact rate: low"), "Rate2", IDI_FAVORITE_1 },
+ { LPGEN("Contact rate: medium"), "Rate3", IDI_FAVORITE_2 },
+ { LPGEN("Contact rate: high"), "Rate4", IDI_FAVORITE_3 }
};
static int FAV_OnContactMenuBuild(WPARAM hContact, LPARAM)
@@ -171,7 +171,7 @@ INT_PTR FAV_SetRate(WPARAM hContact, LPARAM nRate)
return 0;
}
-INT_PTR FAV_ToggleShowOffline(WPARAM hContact, LPARAM lParam)
+INT_PTR FAV_ToggleShowOffline(WPARAM hContact, LPARAM)
{
if (hContact)
db_set_b(hContact, "CList", "noOffline", !db_get_b(hContact, "CList", "noOffline", 0));
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp
index 0960825202..11f64df30c 100644
--- a/plugins/Clist_modern/src/modern_clistmod.cpp
+++ b/plugins/Clist_modern/src/modern_clistmod.cpp
@@ -31,7 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int OnLoadLangpack(WPARAM, LPARAM);
-int CListMod_HideWindow(HWND hwndContactList, int mode);
+int CListMod_HideWindow();
void GroupMenus_Init(void);
int AddMainMenuItem(WPARAM wParam, LPARAM lParam);
@@ -77,10 +77,10 @@ HICON cliGetIconFromStatusMode(MCONTACT hContact, const char *szProto, int statu
}
}
- return ske_ImageList_GetIcon(g_himlCListClc, pcli->pfnIconFromStatusMode(szProto, status, hContact), ILD_NORMAL);
+ return ske_ImageList_GetIcon(g_himlCListClc, pcli->pfnIconFromStatusMode(szProto, status, hContact));
}
-int cli_IconFromStatusMode(const char *szProto,int nStatus, MCONTACT hContact)
+int cli_IconFromStatusMode(const char *szProto, int nStatus, MCONTACT hContact)
{
if (hContact && szProto) {
char *szActProto = (char*)szProto;
@@ -114,7 +114,7 @@ int cli_IconFromStatusMode(const char *szProto,int nStatus, MCONTACT hContact)
return result;
}
- return corecli.pfnIconFromStatusMode(szProto,nStatus,NULL);
+ return corecli.pfnIconFromStatusMode(szProto, nStatus, NULL);
}
int cli_GetContactIcon(MCONTACT hContact)
@@ -139,7 +139,7 @@ void UnLoadContactListModule() //unhooks noncritical events
UninitCustomMenus();
}
-int CListMod_ContactListShutdownProc(WPARAM wParam, LPARAM lParam)
+int CListMod_ContactListShutdownProc(WPARAM, LPARAM)
{
FreeDisplayNameCache();
return 0;
@@ -310,8 +310,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
break;
}
}
- }
- while (hAux != NULL && hAuxOld != hAux);
+ } while (hAux != NULL && hAuxOld != hAux);
if (hWndFound) //There's window!
iNotCoveredDots++; //Let's count the not covered dots.
@@ -334,7 +333,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY)
BYTE g_bCalledFromShowHide = 0;
-int cliShowHide(WPARAM wParam, LPARAM lParam)
+int cliShowHide(WPARAM, LPARAM lParam)
{
BOOL bShow = FALSE;
@@ -377,7 +376,7 @@ int cliShowHide(WPARAM wParam, LPARAM lParam)
CLUI_ShowWindowMod(pcli->hwndContactList, SW_RESTORE);
if (!db_get_b(NULL, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
- Sync(CLUIFrames_OnShowHide, pcli->hwndContactList, 1); //TO BE PROXIED
+ Sync(CLUIFrames_OnShowHide, 1); //TO BE PROXIED
SetWindowPos(pcli->hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
g_bCalledFromShowHide = 1;
if (!db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
@@ -386,7 +385,7 @@ int cliShowHide(WPARAM wParam, LPARAM lParam)
}
else {
SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
- Sync(CLUIFrames_OnShowHide, pcli->hwndContactList, 1);
+ Sync(CLUIFrames_OnShowHide, 1);
SetForegroundWindow(pcli->hwndContactList);
}
db_set_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
@@ -399,7 +398,7 @@ int cliShowHide(WPARAM wParam, LPARAM lParam)
}
else { //It needs to be hidden
if (GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & WS_EX_TOOLWINDOW) {
- CListMod_HideWindow(pcli->hwndContactList, SW_HIDE);
+ CListMod_HideWindow();
db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
}
else {
@@ -418,7 +417,7 @@ int cliShowHide(WPARAM wParam, LPARAM lParam)
return 0;
}
-int CListMod_HideWindow(HWND hwndContactList, int mode)
+int CListMod_HideWindow()
{
KillTimer(pcli->hwndContactList, 1/*TM_AUTOALPHA*/);
if (!CLUI_HideBehindEdge()) return CLUI_SmoothAlphaTransition(pcli->hwndContactList, 0, 1);
diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp
index 45f45a953e..bd9c4483c3 100644
--- a/plugins/Clist_modern/src/modern_clistopts.cpp
+++ b/plugins/Clist_modern/src/modern_clistopts.cpp
@@ -477,7 +477,7 @@ static INT_PTR CALLBACK DlgProcItemIconOpts(HWND hwndDlg, UINT msg, WPARAM wPara
}
-static INT_PTR CALLBACK DlgProcItemContactTimeOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static INT_PTR CALLBACK DlgProcItemContactTimeOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
@@ -937,7 +937,7 @@ static row_opt_items[] =
{ LPGEN("Third line"), IDD_OPT_ITEM_THIRD_LINE, DlgProcItemThirdLineOpts },
};
-int CListOptInit(WPARAM wParam, LPARAM lParam)
+int CListOptInit(WPARAM wParam, LPARAM)
{
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
odp.position = -200000000;
diff --git a/plugins/Clist_modern/src/modern_clistsettings.cpp b/plugins/Clist_modern/src/modern_clistsettings.cpp
index 518dde0e40..c2fd6f06e6 100644
--- a/plugins/Clist_modern/src/modern_clistsettings.cpp
+++ b/plugins/Clist_modern/src/modern_clistsettings.cpp
@@ -27,25 +27,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hdr/modern_commonprototypes.h"
#include "hdr/modern_awaymsg.h"
-void InsertContactIntoTree(MCONTACT hContact,int status);
-void CListSettings_FreeCacheItemDataOption( ClcCacheEntry *pDst, DWORD flag );
+void InsertContactIntoTree(MCONTACT hContact, int status);
+void CListSettings_FreeCacheItemDataOption(ClcCacheEntry *pDst, DWORD flag);
static int displayNameCacheSize;
LIST<ClcCacheEntry> clistCache(50, NumericKeySortT);
char* GetProtoForContact(MCONTACT hContact);
-int GetStatusForContact(MCONTACT hContact,char *szProto);
+int GetStatusForContact(MCONTACT hContact, char *szProto);
TCHAR* UnknownConctactTranslatedName = NULL;
-void InvalidateDNCEbyPointer(MCONTACT hContact,ClcCacheEntry *pdnce,int SettingType);
+void InvalidateDNCEbyPointer(MCONTACT hContact, ClcCacheEntry *pdnce, int SettingType);
void InitCacheAsync();
void UninitCacheAsync();
void InitDisplayNameCache(void)
{
- int i = 0;
InitCacheAsync();
InitAwayMsgModule();
}
@@ -177,7 +176,6 @@ int CListSettings_SetToCache(ClcCacheEntry *pSrc, DWORD flag)
void cliFreeCacheItem(ClcCacheEntry *p)
{
- MCONTACT hContact = p->hContact;
TRACEVAR("cliFreeCacheItem hContact = %d", hContact);
p->freeName();
mir_free_and_nil(p->tszGroup);
@@ -342,7 +340,7 @@ void ClcCacheEntry::getName()
freeName();
if (m_bProtoNotExists || !m_cache_cszProto) {
-LBL_Unknown:
+ LBL_Unknown:
tszName = UnknownConctactTranslatedName;
isUnknown = true;
return;
@@ -376,7 +374,7 @@ int GetContactCachedStatus(MCONTACT hContact)
return pdnce___GetStatus(cacheEntry);
}
-int ContactAdded(WPARAM hContact, LPARAM lParam)
+int ContactAdded(WPARAM hContact, LPARAM)
{
if (!MirandaExiting()) {
cli_ChangeContactIcon(hContact, pcli->pfnIconFromStatusMode((char*)GetContactCachedProtocol(hContact), ID_STATUS_OFFLINE, hContact), 1); ///by FYR
@@ -385,7 +383,7 @@ int ContactAdded(WPARAM hContact, LPARAM lParam)
return 0;
}
-int MetaStatusChanged(WPARAM hMeta, LPARAM hSub)
+int MetaStatusChanged(WPARAM hMeta, LPARAM)
{
ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hMeta);
if (pdnce)
@@ -417,7 +415,6 @@ int ContactSettingChanged(WPARAM hContact, LPARAM lParam)
if (!mir_strcmp(cws->szSetting, "Status") || wildcmp(cws->szSetting, "Status?")) {
if (!mir_strcmp(cws->szModule, META_PROTO) && mir_strcmp(cws->szSetting, "Status")) {
- int res = 0;
if (pcli->hwndContactTree && g_flag_bOnModulesLoadedCalled)
pcli->pfnInitAutoRebuild(pcli->hwndContactTree);
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp
index f8681784ea..181c1cddd2 100644
--- a/plugins/Clist_modern/src/modern_clisttray.cpp
+++ b/plugins/Clist_modern/src/modern_clisttray.cpp
@@ -34,7 +34,7 @@ static HMENU hMainMenu, hStatusMenu;
static HANDLE hTrayMenuObject;
BOOL IS_WM_MOUSE_DOWN_IN_TRAY;
BOOL g_trayTooltipActive = FALSE;
-POINT tray_hover_pos = {0};
+POINT tray_hover_pos = { 0 };
// don't move to win2k.h, need new and old versions to work on 9x/2000/XP
#define NIF_STATE 0x00000008
@@ -68,16 +68,16 @@ char * g_szConnectingProto = NULL;
int GetStatusVal(int status)
{
switch (status) {
- case ID_STATUS_OFFLINE: return 50;
- case ID_STATUS_ONLINE: return 100;
- case ID_STATUS_FREECHAT: return 110;
- case ID_STATUS_INVISIBLE: return 120;
- case ID_STATUS_AWAY: return 200;
- case ID_STATUS_DND: return 210;
- case ID_STATUS_NA: return 220;
- case ID_STATUS_OCCUPIED: return 230;
- case ID_STATUS_ONTHEPHONE: return 400;
- case ID_STATUS_OUTTOLUNCH: return 410;
+ case ID_STATUS_OFFLINE: return 50;
+ case ID_STATUS_ONLINE: return 100;
+ case ID_STATUS_FREECHAT: return 110;
+ case ID_STATUS_INVISIBLE: return 120;
+ case ID_STATUS_AWAY: return 200;
+ case ID_STATUS_DND: return 210;
+ case ID_STATUS_NA: return 220;
+ case ID_STATUS_OCCUPIED: return 230;
+ 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
@@ -91,7 +91,7 @@ int GetStatusOrder(int currentStatus, int newStatus)
return (current > newstat) ? currentStatus : newStatus;
}
-INT_PTR CListTray_GetGlobalStatus(WPARAM wparam, LPARAM lparam)
+INT_PTR CListTray_GetGlobalStatus(WPARAM, LPARAM)
{
int curstatus = 0;
int connectingCount = 0;
@@ -99,7 +99,7 @@ INT_PTR CListTray_GetGlobalStatus(WPARAM wparam, LPARAM lparam)
ClcProtoStatus &p = pcli->clcProto[i];
if (!pcli->pfnGetProtocolVisibility(p.szProto))
continue;
-
+
if (p.dwStatus >= ID_STATUS_CONNECTING && p.dwStatus < ID_STATUS_CONNECTING + MAX_CONNECT_RETRIES) {
connectingCount++;
if (connectingCount == 1)
@@ -140,7 +140,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProto
}
else {
if (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE &&
- db_get_b(NULL, "CList", "AlwaysPrimary", SETTING_ALWAYSPRIMARY_DEFAULT)) {
+ db_get_b(NULL, "CList", "AlwaysPrimary", SETTING_ALWAYSPRIMARY_DEFAULT)) {
ptrA szProto(db_get_sa(NULL, "CList", "PrimaryStatus"));
return pcli->pfnTrayIconSetBaseInfo(cliGetIconFromStatusMode(NULL, szProto, averageMode), NULL);
}
@@ -248,7 +248,7 @@ int cliTrayCalcChanged(const char *szChangedProto, int averageMode, int netProto
static UINT_PTR autoHideTimerId;
-static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT message, UINT_PTR idEvent, DWORD dwTime)
+static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT, UINT_PTR idEvent, DWORD)
{
KillTimer(hwnd, idEvent);
HWND hwndClui = pcli->hwndContactList;
@@ -256,11 +256,11 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd, UINT message, UINT_PTR idE
if (ActiveWindow == hwndClui) return;
if (CLUI_CheckOwnedByClui(ActiveWindow)) return;
- CListMod_HideWindow(hwndClui, SW_HIDE);
+ CListMod_HideWindow();
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
}
-int cliTrayIconPauseAutoHide(WPARAM wParam, LPARAM lParam)
+int cliTrayIconPauseAutoHide(WPARAM, LPARAM)
{
if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (GetActiveWindow() != pcli->hwndContactList && GetWindow(GetParent(GetActiveWindow()), GW_OWNER) != pcli->hwndContactList) {
@@ -365,7 +365,7 @@ INT_PTR cli_TrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
HGENMENU hTrayMainMenuItemProxy, hTrayStatusMenuItemProxy, hTrayHideShowMainMenuItem;
-static INT_PTR BuildTrayMenu(WPARAM wParam, LPARAM lParam)
+static INT_PTR BuildTrayMenu(WPARAM, LPARAM)
{
NotifyEventHooks(g_CluiData.hEventPreBuildTrayMenu, 0, 0);
@@ -377,7 +377,7 @@ static INT_PTR BuildTrayMenu(WPARAM wParam, LPARAM lParam)
return (INT_PTR)hMenu;
}
-static INT_PTR AddTrayMenuItem(WPARAM wParam, LPARAM lParam)
+static INT_PTR AddTrayMenuItem(WPARAM, LPARAM lParam)
{
CLISTMENUITEM *mi = (CLISTMENUITEM*)lParam;
@@ -430,7 +430,7 @@ INT_PTR TrayMenuExecService(WPARAM wParam, LPARAM lParam)
return 1;
}
-INT_PTR FreeOwnerDataTrayMenu(WPARAM wParam, LPARAM lParam)
+INT_PTR FreeOwnerDataTrayMenu(WPARAM, LPARAM lParam)
{
mir_free((char*)lParam);
return 0;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 1e4e682571..f06f9347bc 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -54,8 +54,8 @@ static OBJLIST<PROTOTICKS> arTicks(1);
int ContactSettingChanged(WPARAM, LPARAM);
int MetaStatusChanged(WPARAM, LPARAM);
-HRESULT (WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
-BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT& result );
+HRESULT(WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
+BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam, LRESULT& result);
void DestroyTrayMenu(HMENU hMenu);
// new sources
@@ -73,7 +73,7 @@ BOOL g_mutex_bChangingMode = FALSE, g_mutex_bSizing = FALSE;
BOOL g_flag_bOnModulesLoadedCalled = FALSE;
-RECT g_rcEdgeSizingRect={0};
+RECT g_rcEdgeSizingRect = { 0 };
/* Module global variables */
@@ -82,35 +82,35 @@ static BYTE bOldHideOffline;
static BYTE bOldUseGroups;
static WORD wBehindEdgeShowDelay,
- wBehindEdgeHideDelay,
- wBehindEdgeBorderSize;
+wBehindEdgeHideDelay,
+wBehindEdgeBorderSize;
-static BOOL mutex_bAnimationInProgress=FALSE,
- mutex_bShowHideCalledFromAnimation=FALSE,
- mutex_bIgnoreActivation=FALSE,
- mutex_bDisableAutoUpdate=TRUE,
- mutex_bDuringSizing=FALSE,
- mutex_bDelayedSizing=FALSE; //TBC is it need?
+static BOOL mutex_bAnimationInProgress = FALSE,
+mutex_bShowHideCalledFromAnimation = FALSE,
+mutex_bIgnoreActivation = FALSE,
+mutex_bDisableAutoUpdate = TRUE,
+mutex_bDuringSizing = FALSE,
+mutex_bDelayedSizing = FALSE; //TBC is it need?
-static BOOL flag_bFirstTimeCall=FALSE;
+static BOOL flag_bFirstTimeCall = FALSE;
-static BOOL bTransparentFocus=TRUE,
- bNeedFixSizingRect=FALSE,
- bShowEventStarted=FALSE;
+static BOOL bTransparentFocus = TRUE,
+bNeedFixSizingRect = FALSE,
+bShowEventStarted = FALSE;
static HGENMENU hRenameMenuItem, hShowAvatarMenuItem, hHideAvatarMenuItem;
-static UINT uMsgGetProfile=0;
+static UINT uMsgGetProfile = 0;
-static int nLastRequiredHeight=0,
- nRequiredHeight=0,
- nMirMenuState=0,
- nStatusMenuState=0;
+static int nLastRequiredHeight = 0,
+nRequiredHeight = 0,
+nMirMenuState = 0,
+nStatusMenuState = 0;
-static RECT rcNewWindowRect={0},
- rcOldWindowRect ={0},
- rcSizingRect={0},
- rcCorrectSizeRect={0};
+static RECT rcNewWindowRect = { 0 },
+rcOldWindowRect = { 0 },
+rcSizingRect = { 0 },
+rcCorrectSizeRect = { 0 };
static HANDLE hFrameContactTree;
@@ -120,30 +120,30 @@ HIMAGELIST hAvatarOverlays = NULL;
OVERLAYICONINFO g_pAvatarOverlayIcons[ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1] =
{
- { "AVATAR_OVERLAY_OFFLINE", LPGEN("Offline"), IDI_AVATAR_OVERLAY_OFFLINE, -1},
- { "AVATAR_OVERLAY_ONLINE", LPGEN("Online"), IDI_AVATAR_OVERLAY_ONLINE, -1},
- { "AVATAR_OVERLAY_AWAY", LPGEN("Away"), IDI_AVATAR_OVERLAY_AWAY, -1},
- { "AVATAR_OVERLAY_DND", LPGEN("DND"), IDI_AVATAR_OVERLAY_DND, -1},
- { "AVATAR_OVERLAY_NA", LPGEN("NA"), IDI_AVATAR_OVERLAY_NA, -1},
- { "AVATAR_OVERLAY_OCCUPIED", LPGEN("Occupied"), IDI_AVATAR_OVERLAY_OCCUPIED, -1},
- { "AVATAR_OVERLAY_CHAT", LPGEN("Free for chat"), IDI_AVATAR_OVERLAY_CHAT, -1},
- { "AVATAR_OVERLAY_INVISIBLE", LPGEN("Invisible"), IDI_AVATAR_OVERLAY_INVISIBLE, -1},
- { "AVATAR_OVERLAY_PHONE", LPGEN("On the phone"), IDI_AVATAR_OVERLAY_PHONE, -1},
- { "AVATAR_OVERLAY_LUNCH", LPGEN("Out to lunch"), IDI_AVATAR_OVERLAY_LUNCH, -1}
+ { "AVATAR_OVERLAY_OFFLINE", LPGEN("Offline"), IDI_AVATAR_OVERLAY_OFFLINE, -1 },
+ { "AVATAR_OVERLAY_ONLINE", LPGEN("Online"), IDI_AVATAR_OVERLAY_ONLINE, -1 },
+ { "AVATAR_OVERLAY_AWAY", LPGEN("Away"), IDI_AVATAR_OVERLAY_AWAY, -1 },
+ { "AVATAR_OVERLAY_DND", LPGEN("DND"), IDI_AVATAR_OVERLAY_DND, -1 },
+ { "AVATAR_OVERLAY_NA", LPGEN("NA"), IDI_AVATAR_OVERLAY_NA, -1 },
+ { "AVATAR_OVERLAY_OCCUPIED", LPGEN("Occupied"), IDI_AVATAR_OVERLAY_OCCUPIED, -1 },
+ { "AVATAR_OVERLAY_CHAT", LPGEN("Free for chat"), IDI_AVATAR_OVERLAY_CHAT, -1 },
+ { "AVATAR_OVERLAY_INVISIBLE", LPGEN("Invisible"), IDI_AVATAR_OVERLAY_INVISIBLE, -1 },
+ { "AVATAR_OVERLAY_PHONE", LPGEN("On the phone"), IDI_AVATAR_OVERLAY_PHONE, -1 },
+ { "AVATAR_OVERLAY_LUNCH", LPGEN("Out to lunch"), IDI_AVATAR_OVERLAY_LUNCH, -1 }
};
OVERLAYICONINFO g_pStatusOverlayIcons[ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE + 1] =
{
- { "STATUS_OVERLAY_OFFLINE", LPGEN("Offline"), IDI_STATUS_OVERLAY_OFFLINE, -1},
- { "STATUS_OVERLAY_ONLINE", LPGEN("Online"), IDI_STATUS_OVERLAY_ONLINE, -1},
- { "STATUS_OVERLAY_AWAY", LPGEN("Away"), IDI_STATUS_OVERLAY_AWAY, -1},
- { "STATUS_OVERLAY_DND", LPGEN("DND"), IDI_STATUS_OVERLAY_DND, -1},
- { "STATUS_OVERLAY_NA", LPGEN("NA"), IDI_STATUS_OVERLAY_NA, -1},
- { "STATUS_OVERLAY_OCCUPIED", LPGEN("Occupied"), IDI_STATUS_OVERLAY_OCCUPIED, -1},
- { "STATUS_OVERLAY_CHAT", LPGEN("Free for chat"), IDI_STATUS_OVERLAY_CHAT, -1},
- { "STATUS_OVERLAY_INVISIBLE", LPGEN("Invisible"), IDI_STATUS_OVERLAY_INVISIBLE, -1},
- { "STATUS_OVERLAY_PHONE", LPGEN("On the phone"), IDI_STATUS_OVERLAY_PHONE, -1},
- { "STATUS_OVERLAY_LUNCH", LPGEN("Out to lunch"), IDI_STATUS_OVERLAY_LUNCH, -1}
+ { "STATUS_OVERLAY_OFFLINE", LPGEN("Offline"), IDI_STATUS_OVERLAY_OFFLINE, -1 },
+ { "STATUS_OVERLAY_ONLINE", LPGEN("Online"), IDI_STATUS_OVERLAY_ONLINE, -1 },
+ { "STATUS_OVERLAY_AWAY", LPGEN("Away"), IDI_STATUS_OVERLAY_AWAY, -1 },
+ { "STATUS_OVERLAY_DND", LPGEN("DND"), IDI_STATUS_OVERLAY_DND, -1 },
+ { "STATUS_OVERLAY_NA", LPGEN("NA"), IDI_STATUS_OVERLAY_NA, -1 },
+ { "STATUS_OVERLAY_OCCUPIED", LPGEN("Occupied"), IDI_STATUS_OVERLAY_OCCUPIED, -1 },
+ { "STATUS_OVERLAY_CHAT", LPGEN("Free for chat"), IDI_STATUS_OVERLAY_CHAT, -1 },
+ { "STATUS_OVERLAY_INVISIBLE", LPGEN("Invisible"), IDI_STATUS_OVERLAY_INVISIBLE, -1 },
+ { "STATUS_OVERLAY_PHONE", LPGEN("On the phone"), IDI_STATUS_OVERLAY_PHONE, -1 },
+ { "STATUS_OVERLAY_LUNCH", LPGEN("Out to lunch"), IDI_STATUS_OVERLAY_LUNCH, -1 }
};
//////////////// CLUI CLASS IMPLEMENTATION /////////////////////////////////
@@ -161,7 +161,7 @@ void CLUI::cliOnCreateClc(void)
m_pCLUI->CreateCluiFrames();
}
-int CLUI::OnEvent_ModulesLoaded(WPARAM wParam, LPARAM lParam)
+int CLUI::OnEvent_ModulesLoaded(WPARAM, LPARAM)
{
setlocale(LC_ALL, ""); //fix for case insensitive comparing
@@ -186,7 +186,7 @@ int CLUI::OnEvent_FontReload(WPARAM wParam, LPARAM lParam)
return 0;
}
-int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam)
+int CLUI::OnEvent_ContactMenuPreBuild(WPARAM, LPARAM)
{
if (MirandaExiting())
return 0;
@@ -227,7 +227,7 @@ int CLUI::OnEvent_ContactMenuPreBuild(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR CLUI::Service_ShowMainMenu(WPARAM wParam, LPARAM lParam)
+INT_PTR CLUI::Service_ShowMainMenu(WPARAM, LPARAM)
{
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUGETMAIN, 0, 0);
@@ -237,7 +237,7 @@ INT_PTR CLUI::Service_ShowMainMenu(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR CLUI::Service_ShowStatusMenu(WPARAM wParam, LPARAM lParam)
+INT_PTR CLUI::Service_ShowStatusMenu(WPARAM, LPARAM)
{
HMENU hMenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
@@ -247,7 +247,7 @@ INT_PTR CLUI::Service_ShowStatusMenu(WPARAM wParam, LPARAM lParam)
return 0;
}
-INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM hContact, LPARAM lParam)
+INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM hContact, LPARAM)
{
db_set_b(hContact, "CList", "HideContactAvatar", 0);
@@ -255,7 +255,7 @@ INT_PTR CLUI::Service_Menu_ShowContactAvatar(WPARAM hContact, LPARAM lParam)
return 0;
}
-INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM hContact, LPARAM lParam)
+INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM hContact, LPARAM)
{
db_set_b(hContact, "CList", "HideContactAvatar", 1);
@@ -292,7 +292,7 @@ HRESULT CLUI::CreateCluiFrames()
}
CLUI::CLUI() :
- m_hDwmapiDll(NULL)
+m_hDwmapiDll(NULL)
{
m_pCLUI = this;
g_CluiData.bSTATE = STATE_CLUI_LOADING;
@@ -345,8 +345,8 @@ HRESULT CLUI::LoadDllsRuntime()
}
static IconItemT iconItem[] = {
- { LPGENT("Show avatar"), "ShowAvatar", IDI_SHOW_AVATAR },
- { LPGENT("Hide avatar"), "HideAvatar", IDI_HIDE_AVATAR }
+ { LPGENT("Show avatar"), "ShowAvatar", IDI_SHOW_AVATAR },
+ { LPGENT("Hide avatar"), "HideAvatar", IDI_HIDE_AVATAR }
};
HRESULT CLUI::RegisterAvatarMenu()
@@ -396,7 +396,7 @@ HRESULT CLUI::CreateUIFrames()
return S_OK;
}
-HRESULT CLUI::FillAlphaChannel(HDC hDC, RECT *prcParent, BYTE bAlpha)
+HRESULT CLUI::FillAlphaChannel(HDC hDC, RECT *prcParent)
{
RECT rcWindow;
GetWindowRect(m_hWnd, &rcWindow);
@@ -534,8 +534,6 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd)
int CLUI_ShowWindowMod(HWND hWnd, int nCmd)
{
- int res = 0;
-
if (hWnd == pcli->hwndContactList && (nCmd == SW_HIDE || nCmd == SW_MINIMIZE)) {
AniAva_InvalidateAvatarPositions(NULL);
AniAva_RemoveInvalidatedAvatars();
@@ -568,12 +566,12 @@ int CLUI_ShowWindowMod(HWND hWnd, int nCmd)
return ShowWindow(hWnd, nCmd);
}
-static BOOL CLUI_WaitThreadsCompletion(HWND hwnd)
+static BOOL CLUI_WaitThreadsCompletion()
{
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_hAwayMsgThread || g_hGetTextAsyncThread || g_hSmoothAnimationThread) && !Miranda_Terminated())
{
TRACE("Waiting threads");
@@ -724,7 +722,7 @@ void CLUI_ChangeWindowMode()
storedVisMode = TRUE;
mutex_bShowHideCalledFromAnimation = TRUE;
ShowWindow(pcli->hwndContactList, SW_HIDE);
- Sync(CLUIFrames_OnShowHide, pcli->hwndContactList, 0);
+ Sync(CLUIFrames_OnShowHide, 0);
}
SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, curStyleEx);
SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, curStyle);
@@ -733,7 +731,6 @@ void CLUI_ChangeWindowMode()
CLUI_UpdateAeroGlass();
if (g_CluiData.fLayered || !db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT)) {
- HMENU m = GetMenu(pcli->hwndContactList);
SetMenu(pcli->hwndContactList, NULL);
}
else SetMenu(pcli->hwndContactList, g_hMenuMain);
@@ -759,7 +756,7 @@ void CLUI_ChangeWindowMode()
//7- if it was visible - show
if (storedVisMode) {
ShowWindow(pcli->hwndContactList, SW_SHOW);
- Sync(CLUIFrames_OnShowHide, pcli->hwndContactList, 1);
+ Sync(CLUIFrames_OnShowHide, 1);
}
mutex_bShowHideCalledFromAnimation = FALSE;
@@ -797,7 +794,7 @@ struct _tagTimerAsync
TIMERPROC proc;
};
-static UINT_PTR SetTimerSync(WPARAM wParam, LPARAM lParam)
+static UINT_PTR SetTimerSync(WPARAM wParam, LPARAM)
{
struct _tagTimerAsync * call = (struct _tagTimerAsync *) wParam;
return SetTimer(call->hwnd, call->ID, call->Timeout, call->proc);
@@ -809,7 +806,7 @@ UINT_PTR CLUI_SafeSetTimer(HWND hwnd, int ID, int Timeout, TIMERPROC proc)
return Sync(SetTimerSync, (WPARAM)&param, (LPARAM)0);
}
-int CLUI_UpdateTimer(BYTE BringIn)
+int CLUI_UpdateTimer()
{
if (g_CluiData.nBehindEdgeState == 0) {
KillTimer(pcli->hwndContactList, TM_BRINGOUTTIMEOUT);
@@ -909,7 +906,7 @@ int CLUI_IsInMainWindow(HWND hwnd)
return 0;
}
-int CLUI_OnSkinLoad(WPARAM wParam, LPARAM lParam)
+int CLUI_OnSkinLoad(WPARAM, LPARAM)
{
ske_LoadSkinFromDB();
return 0;
@@ -1033,7 +1030,7 @@ static bool StartTicksTimer(PROTOTICKS *pt)
return true;
}
-INT_PTR CLUI_GetConnectingIconService(WPARAM wParam, LPARAM lParam)
+INT_PTR CLUI_GetConnectingIconService(WPARAM wParam, LPARAM)
{
char *szProto = (char*)wParam;
if (!szProto || !g_StatusBarData.bConnectingIcon)
@@ -1046,7 +1043,7 @@ INT_PTR CLUI_GetConnectingIconService(WPARAM wParam, LPARAM lParam)
if (pt->nCycleStartTick != 0 && pt->nIconsCount != 0) {
int b = ((GetTickCount() - pt->nCycleStartTick) / (nAnimatedIconStep)) % (pt->nIconsCount);
if (pt->himlIconList)
- return (INT_PTR)ske_ImageList_GetIcon(pt->himlIconList, b, ILD_NORMAL);
+ return (INT_PTR)ske_ImageList_GetIcon(pt->himlIconList, b);
}
return NULL;
@@ -1275,7 +1272,7 @@ int CLUI_SyncGetShortData(WPARAM wParam, LPARAM lParam)
return ClcGetShortData(dat, (struct SHORTDATA *)lParam);
}
-int CLUI_IconsChanged(WPARAM wParam, LPARAM lParam)
+int CLUI_IconsChanged(WPARAM, LPARAM)
{
if (MirandaExiting())
return 0;
@@ -1311,7 +1308,7 @@ int CLUI_TestCursorOnBorders()
HCURSOR hCurs1 = NULL;
RECT r;
POINT pt;
- int k = 0, t = 0, fx, fy;
+ int k = 0, fx, fy;
HWND hAux;
BOOL mouse_in_window = 0;
HWND gf = GetForegroundWindow();
@@ -1423,9 +1420,9 @@ int CLUI_SizingOnBorder(POINT pt, int PerformSize)
return SCF_NONE;
}
-static int CLUI_SyncSmoothAnimation(WPARAM wParam, LPARAM lParam)
+static int CLUI_SyncSmoothAnimation(WPARAM, LPARAM)
{
- return CLUI_SmoothAlphaThreadTransition((HWND)lParam);
+ return CLUI_SmoothAlphaThreadTransition();
}
static void CLUI_SmoothAnimationThreadProc(void *param)
@@ -1448,7 +1445,7 @@ static void CLUI_SmoothAnimationThreadProc(void *param)
}
}
-static int CLUI_SmoothAlphaThreadTransition(HWND hwnd)
+static int CLUI_SmoothAlphaThreadTransition()
{
int step;
int a;
@@ -1463,7 +1460,7 @@ static int CLUI_SmoothAlphaThreadTransition(HWND hwnd)
ske_JustUpdateWindowImage();
mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList, 0);
- Sync(CLUIFrames_OnShowHide, hwnd, 0);
+ Sync(CLUIFrames_OnShowHide, 0);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = 0;
if (!g_CluiData.fLayered) RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_ERASE | RDW_FRAME);
@@ -1484,7 +1481,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
if (!IsWindowVisible(hwnd)) {
mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList, SW_RESTORE);
- Sync(CLUIFrames_OnShowHide, hwnd, 1);
+ Sync(CLUIFrames_OnShowHide, 1);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = GoalAlpha;
ske_UpdateWindowImage();
@@ -1495,7 +1492,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
if (IsWindowVisible(hwnd)) {
mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList, 0);
- Sync(CLUIFrames_OnShowHide, hwnd, 0);
+ Sync(CLUIFrames_OnShowHide, 0);
g_CluiData.bCurrentAlpha = GoalAlpha;
mutex_bShowHideCalledFromAnimation = 0;
@@ -1512,7 +1509,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
if ((!IsWindowVisible(hwnd) || g_CluiData.bCurrentAlpha == 0) && bAlphaEnd > 0) {
mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList, SW_SHOWNA);
- Sync(CLUIFrames_OnShowHide, hwnd, SW_SHOW);
+ Sync(CLUIFrames_OnShowHide, SW_SHOW);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = 1;
ske_UpdateWindowImage();
@@ -1535,7 +1532,7 @@ int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
ske_UpdateWindowImage();
mutex_bShowHideCalledFromAnimation = 1;
CLUI_ShowWindowMod(pcli->hwndContactList, 0);
- Sync(CLUIFrames_OnShowHide, pcli->hwndContactList, 0);
+ Sync(CLUIFrames_OnShowHide, 0);
mutex_bShowHideCalledFromAnimation = 0;
g_CluiData.bCurrentAlpha = 0;
}
@@ -1567,7 +1564,6 @@ 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;
fclose(f);
@@ -1739,35 +1735,35 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam)
return TRUE;
case WM_EXITSIZEMOVE:
- {
- int res = DefWindowProc(m_hWnd, msg, wParam, lParam);
- ReleaseCapture();
- TRACE("WM_EXITSIZEMOVE\n");
- SendMessage(m_hWnd, WM_ACTIVATE, (WPARAM)WA_ACTIVE, (LPARAM)m_hWnd);
- return res;
- }
+ {
+ int res = DefWindowProc(m_hWnd, msg, wParam, lParam);
+ ReleaseCapture();
+ TRACE("WM_EXITSIZEMOVE\n");
+ SendMessage(m_hWnd, WM_ACTIVATE, (WPARAM)WA_ACTIVE, (LPARAM)m_hWnd);
+ return res;
+ }
case WM_SIZING:
return DefWindowProc(m_hWnd, msg, wParam, lParam);
case WM_MOVE:
- {
- RECT rc;
- CallWindowProc(DefWindowProc, m_hWnd, msg, wParam, lParam);
- mutex_bDuringSizing = 0;
- GetWindowRect(m_hWnd, &rc);
- CheckFramesPos(&rc);
- Sync(CLUIFrames_OnMoving, m_hWnd, &rc);
- if (!IsIconic(m_hWnd)) {
- if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { //if g_CluiData.fDocked, dont remember pos (except for width)
- db_set_dw(NULL, "CList", "Height", (DWORD)(rc.bottom - rc.top));
- db_set_dw(NULL, "CList", "x", (DWORD)rc.left);
- db_set_dw(NULL, "CList", "y", (DWORD)rc.top);
- }
- db_set_dw(NULL, "CList", "Width", (DWORD)(rc.right - rc.left));
+ {
+ RECT rc;
+ CallWindowProc(DefWindowProc, m_hWnd, msg, wParam, lParam);
+ mutex_bDuringSizing = 0;
+ GetWindowRect(m_hWnd, &rc);
+ CheckFramesPos(&rc);
+ Sync(CLUIFrames_OnMoving, m_hWnd, &rc);
+ if (!IsIconic(m_hWnd)) {
+ if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) { //if g_CluiData.fDocked, dont remember pos (except for width)
+ db_set_dw(NULL, "CList", "Height", (DWORD)(rc.bottom - rc.top));
+ db_set_dw(NULL, "CList", "x", (DWORD)rc.left);
+ db_set_dw(NULL, "CList", "y", (DWORD)rc.top);
}
+ db_set_dw(NULL, "CList", "Width", (DWORD)(rc.right - rc.left));
}
- return TRUE;
+ }
+ return TRUE;
case WM_SIZE:
if (g_mutex_bSizing) return 0;
if (wParam != SIZE_MINIMIZED /* && IsWindowVisible(m_hWnd)*/) {
@@ -1955,7 +1951,7 @@ LRESULT CLUI::OnPaint(UINT msg, WPARAM wParam, LPARAM lParam)
return DefWindowProc(m_hWnd, msg, wParam, lParam);
}
-LRESULT CLUI::OnCreate(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnCreate(UINT, WPARAM, LPARAM)
{
TranslateMenu(GetMenu(m_hWnd));
DrawMenuBar(m_hWnd);
@@ -2026,7 +2022,7 @@ LRESULT CLUI::OnParentNotify(UINT msg, WPARAM wParam, LPARAM lParam)
return DefWindowProc(m_hWnd, msg, wParam, lParam);
}
-LRESULT CLUI::OnSetFocus(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnSetFocus(UINT, WPARAM, LPARAM)
{
if (hFrameContactTree && (!CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLOATING, hFrameContactTree), 0)))
SetFocus(pcli->hwndContactTree);
@@ -2069,7 +2065,7 @@ LRESULT CLUI::OnStatusBarUpdateTimer(UINT msg, WPARAM wParam, LPARAM lParam)
return DefCluiWndProc(msg, wParam, lParam);
}
-LRESULT CLUI::OnAutoAlphaTimer(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnAutoAlphaTimer(UINT, WPARAM, LPARAM)
{
int inwnd;
@@ -2088,7 +2084,6 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT msg, WPARAM wParam, LPARAM lParam)
if (inwnd != bTransparentFocus) {
//change
- HWND hwn = GetCapture();
bTransparentFocus = inwnd;
if (bTransparentFocus)
CLUI_SmoothAlphaTransition(m_hWnd, (BYTE)db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT), 1);
@@ -2100,13 +2095,13 @@ LRESULT CLUI::OnAutoAlphaTimer(UINT msg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
-LRESULT CLUI::OnSmoothAlphaTransitionTimer(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnSmoothAlphaTransitionTimer(UINT, WPARAM, LPARAM)
{
CLUI_SmoothAlphaTransition(m_hWnd, 0, 2);
return TRUE;
}
-LRESULT CLUI::OnDelayedSizingTimer(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnDelayedSizingTimer(UINT, WPARAM, LPARAM)
{
if (mutex_bDelayedSizing && !mutex_bDuringSizing) {
mutex_bDelayedSizing = 0;
@@ -2116,7 +2111,7 @@ LRESULT CLUI::OnDelayedSizingTimer(UINT msg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
-LRESULT CLUI::OnBringOutTimer(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnBringOutTimer(UINT, WPARAM, LPARAM)
{
//hide
KillTimer(m_hWnd, TM_BRINGINTIMEOUT);
@@ -2130,7 +2125,7 @@ LRESULT CLUI::OnBringOutTimer(UINT msg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
-LRESULT CLUI::OnBringInTimer(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnBringInTimer(UINT, WPARAM, LPARAM)
{
//show
KillTimer(m_hWnd, TM_BRINGINTIMEOUT);
@@ -2151,9 +2146,9 @@ LRESULT CLUI::OnBringInTimer(UINT msg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
-LRESULT CLUI::OnUpdateBringTimer(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnUpdateBringTimer(UINT, WPARAM, LPARAM)
{
- CLUI_UpdateTimer(0);
+ CLUI_UpdateTimer();
return TRUE;
}
@@ -2169,12 +2164,12 @@ LRESULT CLUI::OnTimer(UINT msg, WPARAM wParam, LPARAM lParam)
}
switch (wParam) {
- case TM_AUTOALPHA: return OnAutoAlphaTimer(msg, wParam, lParam);
- case TM_SMOTHALPHATRANSITION: return OnSmoothAlphaTransitionTimer(msg, wParam, lParam);
- case TM_DELAYEDSIZING: return OnDelayedSizingTimer(msg, wParam, lParam);
- case TM_BRINGOUTTIMEOUT: return OnBringOutTimer(msg, wParam, lParam);
- case TM_BRINGINTIMEOUT: return OnBringInTimer(msg, wParam, lParam);
- case TM_UPDATEBRINGTIMER: return OnUpdateBringTimer(msg, wParam, lParam);
+ case TM_AUTOALPHA: return OnAutoAlphaTimer(msg, wParam, lParam);
+ case TM_SMOTHALPHATRANSITION: return OnSmoothAlphaTransitionTimer(msg, wParam, lParam);
+ case TM_DELAYEDSIZING: return OnDelayedSizingTimer(msg, wParam, lParam);
+ case TM_BRINGOUTTIMEOUT: return OnBringOutTimer(msg, wParam, lParam);
+ case TM_BRINGINTIMEOUT: return OnBringInTimer(msg, wParam, lParam);
+ case TM_UPDATEBRINGTIMER: return OnUpdateBringTimer(msg, wParam, lParam);
}
return DefCluiWndProc(msg, wParam, lParam);
}
@@ -2186,7 +2181,7 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
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) {
- if (!g_bCalledFromShowHide) CLUI_UpdateTimer(0);
+ if (!g_bCalledFromShowHide) CLUI_UpdateTimer();
}
else if (!g_bCalledFromShowHide)
CLUI_ShowFromBehindEdge();
@@ -2223,10 +2218,10 @@ LRESULT CLUI::OnActivate(UINT msg, WPARAM wParam, LPARAM lParam)
return DefWindowProc(m_hWnd, msg, wParam, lParam);
}
-LRESULT CLUI::OnSetCursor(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnSetCursor(UINT, WPARAM, LPARAM)
{
HWND gf = GetForegroundWindow();
- if (g_CluiData.nBehindEdgeState >= 0) CLUI_UpdateTimer(1);
+ if (g_CluiData.nBehindEdgeState >= 0) CLUI_UpdateTimer();
if (g_bTransparentFlag) {
if (!bTransparentFocus && gf != m_hWnd) {
CLUI_SmoothAlphaTransition(m_hWnd, db_get_b(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT), 1);
@@ -2270,7 +2265,7 @@ LRESULT CLUI::OnNcLButtonDblClk(UINT msg, WPARAM wParam, LPARAM lParam)
return DefCluiWndProc(msg, wParam, lParam);
}
-LRESULT CLUI::OnNcHitTest(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnNcHitTest(UINT, WPARAM wParam, LPARAM lParam)
{
LRESULT result = DefWindowProc(m_hWnd, WM_NCHITTEST, wParam, lParam);
@@ -2297,7 +2292,7 @@ LRESULT CLUI::OnNcHitTest(UINT msg, WPARAM wParam, LPARAM lParam)
return result;
}
-LRESULT CLUI::OnShowWindow(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnShowWindow(UINT, WPARAM wParam, LPARAM lParam)
{
if (lParam) return 0;
if (mutex_bShowHideCalledFromAnimation) return 1;
@@ -2305,7 +2300,7 @@ LRESULT CLUI::OnShowWindow(UINT msg, WPARAM wParam, LPARAM lParam)
BYTE gAlpha = (!wParam) ? 0 : (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;
- Sync(CLUIFrames_OnShowHide, pcli->hwndContactList, 1);
+ Sync(CLUIFrames_OnShowHide, 1);
ske_RedrawCompleteWindow();
}
CLUI_SmoothAlphaTransition(m_hWnd, gAlpha, 1);
@@ -2470,7 +2465,7 @@ LRESULT CLUI::OnNotify(UINT msg, WPARAM wParam, LPARAM lParam)
return DefCluiWndProc(msg, wParam, lParam);
}
-LRESULT CLUI::OnContextMenu(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnContextMenu(UINT, WPARAM, LPARAM lParam)
{
POINT pt = UNPACK_POINT(lParam);
// x/y might be -1 if it was generated by a kb click
@@ -2493,7 +2488,7 @@ LRESULT CLUI::OnContextMenu(UINT msg, WPARAM wParam, LPARAM lParam)
return FALSE;
}
-LRESULT CLUI::OnMeasureItem(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnMeasureItem(UINT, WPARAM wParam, LPARAM lParam)
{
LPMEASUREITEMSTRUCT pmis = (LPMEASUREITEMSTRUCT)lParam;
switch (pmis->itemData) {
@@ -2515,7 +2510,7 @@ LRESULT CLUI::OnMeasureItem(UINT msg, WPARAM wParam, LPARAM lParam)
return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
}
-LRESULT CLUI::OnDrawItem(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnDrawItem(UINT, WPARAM wParam, LPARAM lParam)
{
ClcData *dat = (ClcData*)GetWindowLongPtr(pcli->hwndContactTree, 0);
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam;
@@ -2593,7 +2588,7 @@ LRESULT CLUI::OnDrawItem(UINT msg, WPARAM wParam, LPARAM lParam)
return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
}
-LRESULT CLUI::OnDestroy(UINT msg, WPARAM wParam, LPARAM lParam)
+LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM)
{
int state = db_get_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
BOOL wait = FALSE;
@@ -2616,7 +2611,7 @@ LRESULT CLUI::OnDestroy(UINT msg, WPARAM wParam, LPARAM lParam)
}
TRACE("CLUI.c: WM_DESTROY - WaitThreadsCompletion \n");
- while (CLUI_WaitThreadsCompletion(m_hWnd)); //stop all my threads
+ while (CLUI_WaitThreadsCompletion()); //stop all my threads
TRACE("CLUI.c: WM_DESTROY - WaitThreadsCompletion DONE\n");
arTicks.destroy();
diff --git a/plugins/Clist_modern/src/modern_cluiservices.cpp b/plugins/Clist_modern/src/modern_cluiservices.cpp
index 84a56f3f6c..44f1eac73c 100644
--- a/plugins/Clist_modern/src/modern_cluiservices.cpp
+++ b/plugins/Clist_modern/src/modern_cluiservices.cpp
@@ -25,29 +25,29 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hdr/modern_commonheaders.h"
#include "hdr/modern_commonprototypes.h"
-INT_PTR CListTray_GetGlobalStatus(WPARAM wparam,LPARAM lparam);
+INT_PTR CListTray_GetGlobalStatus(WPARAM wparam, LPARAM lparam);
-int CLUIUnreadEmailCountChanged(WPARAM wParam, LPARAM lParam)
+int CLUIUnreadEmailCountChanged(WPARAM, LPARAM)
{
- CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, 0 ,0);
+ CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, 0, 0);
return 0;
}
-void cliCluiProtocolStatusChanged(int status,const char * proto)
+void cliCluiProtocolStatusChanged(int, const char * proto)
{
- CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)pcli->hwndStatus,0);
+ CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, (WPARAM)pcli->hwndStatus, 0);
if (proto)
pcli->pfnTrayIconUpdateBase(proto);
}
-static INT_PTR MetaSupportCheck(WPARAM wParam, LPARAM lParam)
+static INT_PTR MetaSupportCheck(WPARAM, LPARAM)
{
return 1;
}
int CLUIServices_LoadModule(void)
{
- CreateServiceFunction(MS_CLUI_METASUPPORT,MetaSupportCheck);
- CreateServiceFunction(MS_CLIST_GETSTATUSMODE,CListTray_GetGlobalStatus);
+ CreateServiceFunction(MS_CLUI_METASUPPORT, MetaSupportCheck);
+ CreateServiceFunction(MS_CLIST_GETSTATUSMODE, CListTray_GetGlobalStatus);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp
index 3dc1408739..24516cb63e 100644
--- a/plugins/Clist_modern/src/modern_contact.cpp
+++ b/plugins/Clist_modern/src/modern_contact.cpp
@@ -57,7 +57,7 @@ void cli_ChangeContactIcon(MCONTACT hContact, int iIcon, int add)
static int GetStatusModeOrdering(int statusMode)
{
- for (int i=0; i < SIZEOF(statusModeOrder); i++)
+ for (int i = 0; i < SIZEOF(statusModeOrder); i++)
if (statusModeOrder[i].status == statusMode)
return statusModeOrder[i].order;
return 1000;
@@ -66,7 +66,7 @@ static int GetStatusModeOrdering(int statusMode)
DWORD CompareContacts2_getLMTime(MCONTACT hContact)
{
HANDLE hDbEvent = db_event_last(hContact);
- while(hDbEvent) {
+ while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT))
@@ -84,9 +84,9 @@ int GetProtoIndex(char * szName)
if (szName) {
PROTOACCOUNT **accs = NULL;
int accCount = 0;
- ProtoEnumAccounts( &accCount, &accs );
+ ProtoEnumAccounts(&accCount, &accs);
- for (int i=0; i < accCount; i++)
+ for (int i = 0; i < accCount; i++)
if (!mir_strcmpi(szName, accs[i]->szModuleName))
return accs[i]->iOrder;
}
@@ -94,11 +94,11 @@ int GetProtoIndex(char * szName)
return -1;
}
-int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int by)
+int CompareContacts2(const ClcContact *contact1, const ClcContact *contact2, int by)
{
TCHAR *namea, *nameb;
- int statusa,statusb;
- char *szProto1,*szProto2;
+ int statusa, statusb;
+ char *szProto1, *szProto2;
if ((INT_PTR)contact1 < 100 || (INT_PTR)contact2 < 100) return 0;
@@ -114,7 +114,7 @@ int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int
szProto2 = contact2->proto;
if (by == SORTBY_STATUS) { //status
- int ordera,orderb;
+ int ordera, orderb;
ordera = GetStatusModeOrdering(statusa);
orderb = GetStatusModeOrdering(statusb);
return (ordera != orderb) ? ordera - orderb : 0;
@@ -122,25 +122,25 @@ int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int
//one is offline: offline goes below online
if (g_CluiData.fSortNoOfflineBottom == 0 && (statusa == ID_STATUS_OFFLINE) != (statusb == ID_STATUS_OFFLINE))
- return 2*(statusa == ID_STATUS_OFFLINE)-1;
+ return 2 * (statusa == ID_STATUS_OFFLINE) - 1;
if (by == SORTBY_NAME) //name
- return mir_tstrcmpi(namea,nameb);
+ return mir_tstrcmpi(namea, nameb);
if (by == SORTBY_NAME_LOCALE) {
//name
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;
+ return (CompareString(LocaleId, NORM_IGNORECASE, SAFETSTRING(namea), -1, SAFETSTRING(nameb), -1)) - 2;
}
if (by == SORTBY_LASTMSG) {
//last message
DWORD ta = CompareContacts2_getLMTime(a);
DWORD tb = CompareContacts2_getLMTime(b);
- return tb-ta;
+ return tb - ta;
}
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;
}
@@ -150,10 +150,10 @@ int CompareContacts2(const ClcContact *contact1,const ClcContact *contact2, int
return 0;
}
-int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2)
+int cliCompareContacts(const ClcContact *contact1, const 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)
@@ -164,35 +164,35 @@ int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2)
#undef SAFESTRING
-INT_PTR ToggleHideOffline(WPARAM wParam, LPARAM lParam)
+INT_PTR ToggleHideOffline(WPARAM, LPARAM)
{
- return pcli->pfnSetHideOffline((WPARAM)-1,0);
+ return pcli->pfnSetHideOffline((WPARAM)-1, 0);
}
-INT_PTR ToggleGroups(WPARAM wParam, LPARAM lParam)
+INT_PTR ToggleGroups(WPARAM, LPARAM)
{
db_set_b(NULL, "CList", "UseGroups",
- (BYTE) !db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
+ (BYTE)!db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT));
pcli->pfnLoadContactTree();
return 0;
}
-INT_PTR SetUseGroups(WPARAM wParam, LPARAM lParam)
+INT_PTR SetUseGroups(WPARAM wParam, 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;
+ if (!newVal == (int)wParam) return 0;
newVal = wParam;
}
- db_set_b(NULL,"CList","UseGroups",(BYTE)newVal);
- SendMessage(pcli->hwndContactTree,CLM_SETUSEGROUPS,newVal,0);
+ db_set_b(NULL, "CList", "UseGroups", (BYTE)newVal);
+ SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
return 0;
}
-INT_PTR ToggleSounds(WPARAM wParam, LPARAM lParam)
+INT_PTR ToggleSounds(WPARAM, LPARAM)
{
db_set_b(NULL, "Skin", "UseSound",
- (BYTE) !db_get_b(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT ));
+ (BYTE)!db_get_b(NULL, "Skin", "UseSound", SETTING_ENABLESOUNDS_DEFAULT));
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp
index 02c59f3ddc..c9bb5042dd 100644
--- a/plugins/Clist_modern/src/modern_docking.cpp
+++ b/plugins/Clist_modern/src/modern_docking.cpp
@@ -42,15 +42,15 @@ static int TempDock = 0;
static int dock_drag_dx = 0;
static int dock_drag_dy = 0;
-static void Docking_GetMonitorRectFromPoint(POINT pt,RECT *rc)
+static void Docking_GetMonitorRectFromPoint(POINT pt, RECT *rc)
{
MONITORINFO monitorInfo;
- HMONITOR hMonitor = MonitorFromPoint(pt,MONITOR_DEFAULTTONEAREST); // always returns a valid value
+ HMONITOR hMonitor = MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST); // always returns a valid value
monitorInfo.cbSize = sizeof(MONITORINFO);
if (GetMonitorInfo(hMonitor, &monitorInfo))
{
- memcpy(rc,&monitorInfo.rcMonitor,sizeof(RECT));
+ memcpy(rc, &monitorInfo.rcMonitor, sizeof(RECT));
return;
}
@@ -61,40 +61,40 @@ static void Docking_GetMonitorRectFromPoint(POINT pt,RECT *rc)
rc->right = GetSystemMetrics(SM_CXSCREEN);
}
-void Docking_GetMonitorRectFromWindow(HWND hWnd,RECT *rc)
+void Docking_GetMonitorRectFromWindow(HWND hWnd, RECT *rc)
{
POINT ptWindow;
- GetWindowRect(hWnd,rc);
+ GetWindowRect(hWnd, rc);
ptWindow.x = rc->left;
ptWindow.y = rc->top;
- Docking_GetMonitorRectFromPoint(ptWindow,rc);
+ Docking_GetMonitorRectFromPoint(ptWindow, rc);
}
-static void Docking_AdjustPosition(HWND hwnd,RECT *rcDisplay,RECT *rc)
+static void Docking_AdjustPosition(HWND hwnd, RECT *rcDisplay, RECT *rc)
{
APPBARDATA abd;
memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = hwnd;
- abd.uEdge = g_CluiData.fDocked == DOCKED_LEFT?ABE_LEFT:ABE_RIGHT;
+ 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.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.left = rcDisplay->right - (abd.rc.right - abd.rc.left);
abd.rc.right = rcDisplay->right;
}
- SHAppBarMessage(ABM_SETPOS,&abd);
+ SHAppBarMessage(ABM_SETPOS, &abd);
*rc = abd.rc;
}
-int Docking_IsDocked(WPARAM wParam, LPARAM lParam)
+int Docking_IsDocked(WPARAM, LPARAM)
{
return g_CluiData.fDocked;
}
@@ -106,255 +106,236 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam)
MSG *msg = (MSG*)wParam;
if (msg->message == WM_DESTROY)
- db_set_b(NULL,"CList","Docked",(BYTE)g_CluiData.fDocked);
+ 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;
- 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))
- {
- PostMessage(msg->hwnd,WM_CREATEDOCKED, 0, 0);
- }
- draggingTitle = 0;
- 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))
+ {
+ PostMessage(msg->hwnd, WM_CREATEDOCKED, 0, 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)) {
- RECT rc, rcMonitor;
- memset(&abd, 0, sizeof(abd));
- 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;
- Sync(CLUIFrames_OnMoving,msg->hwnd,&rc);
- g_CluiData.mutexPreventDockMoving = 1;
- ModernSkinButton_ReposButtons( msg->hwnd, SBRF_DO_NOT_DRAW, NULL );
- }
- break;
- case WM_CAPTURECHANGED:
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW,NULL);
- return 0;
- case WM_ACTIVATE:
+ 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)) {
+ RECT rc, rcMonitor;
memset(&abd, 0, sizeof(abd));
abd.cbSize = sizeof(abd);
abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_ACTIVATE,&abd);
- return 0;
- case WM_SIZE:
- ModernSkinButton_ReposButtons( msg->hwnd, SBRF_DO_REDRAW_ALL, NULL );
- return 0;
-
- case WM_WINDOWPOSCHANGED:
- {
- if (g_CluiData.fDocked)
- ModernSkinButton_ReposButtons( msg->hwnd,SBRF_DO_NOT_DRAW, NULL );
- return 0; // XXX: check me!!!
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_WINDOWPOSCHANGED,&abd);
- ModernSkinButton_ReposButtons( msg->hwnd, SBRF_DO_NOT_DRAW, NULL );
- return 0;
- }
- case WM_MOVING:
- {
- RECT rcMonitor;
- RECT rcWindow;
- RECT *rc;
- int dx = 0;
- POINT ptCursor;
- if (g_CluiData.fDocked) return 0;
- // stop early
- BOOL bControlled = (BOOL)(GetAsyncKeyState(VK_CONTROL)&0x8000);
+ 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;
+ Sync(CLUIFrames_OnMoving, msg->hwnd, &rc);
+ g_CluiData.mutexPreventDockMoving = 1;
+ ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
+ }
+ break;
+ case WM_CAPTURECHANGED:
+ ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
+ return 0;
+ case WM_ACTIVATE:
+ memset(&abd, 0, sizeof(abd));
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
+ SHAppBarMessage(ABM_ACTIVATE, &abd);
+ return 0;
+ case WM_SIZE:
+ ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_REDRAW_ALL, NULL);
+ return 0;
- // 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;
- Docking_GetMonitorRectFromPoint(ptCursor,&rcMonitor);
+ case WM_WINDOWPOSCHANGED:
+ {
+ if (g_CluiData.fDocked)
+ ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
+ return 0;
+ }
+ case WM_MOVING:
+ {
+ RECT rcMonitor;
+ RECT rcWindow;
+ RECT *rc;
+ int dx = 0;
+ POINT ptCursor;
+ if (g_CluiData.fDocked) return 0;
- if (((ptCursor.x < rcMonitor.left+EDGESENSITIVITY)
- || (ptCursor.x >= rcMonitor.right-EDGESENSITIVITY))
- && db_get_b(NULL,"CLUI","DockToSides",SETTING_DOCKTOSIDES_DEFAULT))
- {
- memset(&abd, 0, sizeof(abd));
- 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;
- 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;
- else
- 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;
- Sync(CLUIFrames_OnMoving,msg->hwnd,(LPRECT)msg->lParam);
- 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 );
- return TRUE;
- }
- return 0;
- }
- case WM_EXITSIZEMOVE:
- {
- RECT rcMonitor;
- RECT rcWindow;
- 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;
- 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;
- return 1;
- }
+ // 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;
+ Docking_GetMonitorRectFromPoint(ptCursor, &rcMonitor);
- case WM_MOVE:
- {
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_ALT_DRAW, NULL);
- return 0;
- }
- case WM_SIZING:
- {
+ if (((ptCursor.x < rcMonitor.left + EDGESENSITIVITY)
+ || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY))
+ && db_get_b(NULL, "CLUI", "DockToSides", SETTING_DOCKTOSIDES_DEFAULT))
+ {
+ memset(&abd, 0, sizeof(abd));
+ 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;
+ 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;
+ else
+ 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;
+ Sync(CLUIFrames_OnMoving, msg->hwnd, (LPRECT)msg->lParam);
+ 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);
+ return TRUE;
+ }
+ return 0;
+ }
+ case WM_EXITSIZEMOVE:
+ {
+ RECT rcMonitor;
+ RECT rcWindow;
+ 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;
+ 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;
+ return 1;
+ }
- /*RECT rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
- Docking_AdjustPosition(msg->hwnd,&rcMonitor,(LPRECT)msg->lParam);
- *((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;
- Sync(CLUIFrames_OnMoving,msg->hwnd,&rc);
- // -= -= -=
- return TRUE;
- }
- case WM_SHOWWINDOW:
- {
- 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;
- memset(&abd, 0, sizeof(abd));
- 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;
- 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);// -= -= -=
- }
- else {
- SHAppBarMessage(ABM_REMOVE,&abd);
- }
- }
+ case WM_MOVE:
+ {
+ ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_ALT_DRAW, NULL);
+ return 0;
+ }
+ case WM_SIZING:
+ {
+ if (g_CluiData.fDocked) ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
+ return FALSE;
+ }
+ case WM_SHOWWINDOW:
+ {
+ if (msg->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;}
+ if ((msg->wParam && g_CluiData.fDocked < 0) || (!msg->wParam && g_CluiData.fDocked>0))
+ g_CluiData.fDocked = -g_CluiData.fDocked;
+ memset(&abd, 0, sizeof(abd));
+ 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;
+ 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);// -= -= -=
+ }
+ else {
+ SHAppBarMessage(ABM_REMOVE, &abd);
+ }
+ }
+ 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; }
- return 0;
- }
- case WM_SYSCOMMAND:
- if ((msg->wParam&0xFFF0) != SC_MOVE) return 0;
- SetActiveWindow(msg->hwnd);
- SetCapture(msg->hwnd);
- draggingTitle = 1;
- *((LRESULT*)lParam) = 0;
- return TRUE;
- case WM_MOUSEMOVE:
+ return 0;
+ }
+ case WM_SYSCOMMAND:
+ if ((msg->wParam & 0xFFF0) != SC_MOVE) return 0;
+ SetActiveWindow(msg->hwnd);
+ SetCapture(msg->hwnd);
+ draggingTitle = 1;
+ *((LRESULT*)lParam) = 0;
+ return TRUE;
+ case WM_MOUSEMOVE:
- if (!draggingTitle) return 0;
- { 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)) {
- ReleaseCapture();
- draggingTitle = 0;
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE,&abd);
- 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);
- db_set_b(NULL,"CList","Docked",(BYTE)g_CluiData.fDocked);
- // ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
- }
- return 1;
- }
- case WM_LBUTTONUP:
- if (draggingTitle) {
- ReleaseCapture();
- draggingTitle = 0;
- }
- return 0;
- case WM_DOCKCALLBACK:
- switch(msg->wParam) {
+ if (!draggingTitle) return 0;
+ { 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)) {
+ ReleaseCapture();
+ draggingTitle = 0;
+ memset(&abd, 0, sizeof(abd));
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
+ SHAppBarMessage(ABM_REMOVE, &abd);
+ 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);
+ db_set_b(NULL, "CList", "Docked", (BYTE)g_CluiData.fDocked);
+ // ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
+ }
+ return 1;
+ }
+ case WM_LBUTTONUP:
+ if (draggingTitle) {
+ ReleaseCapture();
+ draggingTitle = 0;
+ }
+ return 0;
+ case WM_DOCKCALLBACK:
+ switch (msg->wParam) {
case ABN_WINDOWARRANGE:
- CLUI_ShowWindowMod(msg->hwnd,msg->lParam?SW_HIDE:SW_SHOW);
+ CLUI_ShowWindowMod(msg->hwnd, msg->lParam ? SW_HIDE : SW_SHOW);
{
RECT rc, rcMonitor;
- Docking_GetMonitorRectFromWindow(msg->hwnd,&rcMonitor);
- GetWindowRect(msg->hwnd,&rc);
- Docking_AdjustPosition(msg->hwnd,&rcMonitor,&rc);
- Sync(CLUIFrames_OnMoving,msg->hwnd,&rc); // -= -= -=
+ Docking_GetMonitorRectFromWindow(msg->hwnd, &rcMonitor);
+ GetWindowRect(msg->hwnd, &rc);
+ Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rc);
+ Sync(CLUIFrames_OnMoving, msg->hwnd, &rc); // -= -= -=
ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
g_CluiData.mutexPreventDockMoving = 1;
}
break;
- }
- return TRUE;
- case WM_DESTROY:
- if (g_CluiData.fDocked>0) {
- memset(&abd, 0, sizeof(abd));
- abd.cbSize = sizeof(abd);
- abd.hWnd = msg->hwnd;
- SHAppBarMessage(ABM_REMOVE,&abd);
- ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
- }
- return 0;
+ }
+ return TRUE;
+ case WM_DESTROY:
+ if (g_CluiData.fDocked > 0) {
+ memset(&abd, 0, sizeof(abd));
+ abd.cbSize = sizeof(abd);
+ abd.hWnd = msg->hwnd;
+ SHAppBarMessage(ABM_REMOVE, &abd);
+ ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, NULL);
+ }
+ return 0;
}
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp
index 3110ea362e..2ec2359fc7 100644
--- a/plugins/Clist_modern/src/modern_gdiplus.cpp
+++ b/plugins/Clist_modern/src/modern_gdiplus.cpp
@@ -44,107 +44,103 @@ static ColorMatrix ClrMatrix =
DWORD argb_from_cola(COLORREF col, BYTE alpha)
{
- return((BYTE) (alpha) << 24 | col);
+ return((BYTE)(alpha) << 24 | col);
}
HBITMAP GDIPlus_LoadGlyphImage(const TCHAR *tszFileName)
{
- // Create a Bitmap object from a JPEG file.
- Bitmap bitmap(tszFileName, 0);
-
- // Clone a portion of the bitmap.
- Bitmap* clone = bitmap.Clone(0, 0, bitmap.GetWidth(), bitmap.GetHeight(), PixelFormat32bppPARGB);
- HBITMAP hbmp = NULL;
- if (clone) {
- clone->GetHBITMAP(Color(0, 0, 0),&hbmp);
- delete clone;
- }
- return hbmp;
-}
-
-void TextOutWithGDIp(HDC hDestDC, int x, int y, LPCTSTR lpString, int nCount)
-{
+ // Create a Bitmap object from a JPEG file.
+ Bitmap bitmap(tszFileName, 0);
+
+ // Clone a portion of the bitmap.
+ Bitmap* clone = bitmap.Clone(0, 0, bitmap.GetWidth(), bitmap.GetHeight(), PixelFormat32bppPARGB);
+ HBITMAP hbmp = NULL;
+ if (clone) {
+ clone->GetHBITMAP(Color(0, 0, 0), &hbmp);
+ delete clone;
+ }
+ return hbmp;
}
-void DrawAvatarImageWithGDIp(HDC hDestDC,int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1,DWORD flag,BYTE alpha)
+void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD height, HBITMAP hbmp, int x1, int y1, DWORD width1, DWORD height1, DWORD flag, BYTE alpha)
{
BITMAP bmp;
Bitmap *bm;
BYTE * bmbits = NULL;
- GetObject(hbmp,sizeof(BITMAP),&bmp);
+ GetObject(hbmp, sizeof(BITMAP), &bmp);
Graphics g(hDestDC);
if (bmp.bmBitsPixel == 32 && (flag&AVS_PREMULTIPLIED)) {
bmbits = (BYTE*)bmp.bmBits;
if (!bmbits) {
bmbits = (BYTE*)malloc(bmp.bmHeight*bmp.bmWidthBytes);
- GetBitmapBits(hbmp,bmp.bmHeight*bmp.bmWidthBytes,bmbits);
+ 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) {
bm->RotateFlip(RotateNoneFlipY);
free(bmbits);
}
}
- else bm = new Bitmap(hbmp,NULL);
+ else 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,
0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, ((float)alpha)/255, 0.0f,
+ 0.0f, 0.0f, 0.0f, ((float)alpha) / 255, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 1.0f
};
- attr.SetColorMatrix(&ClrMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
+ attr.SetColorMatrix(&ClrMatrix, ColorMatrixFlagsDefault, ColorAdjustTypeBitmap);
g.SetInterpolationMode(InterpolationModeHighQualityBicubic);
- RectF rect((float)x,(float)y,(float)width,(float)height);
- g.DrawImage(bm, rect, (float)x1, (float)y1, (float)width1, (float)height1 , UnitPixel, &attr, NULL, NULL);
+ RectF rect((float)x, (float)y, (float)width, (float)height);
+ g.DrawImage(bm, rect, (float)x1, (float)y1, (float)width1, (float)height1, UnitPixel, &attr, NULL, NULL);
delete bm;
}
-BOOL GDIPlus_AlphaBlend(HDC hdcDest,int nXOriginDest,int nYOriginDest,int nWidthDest,int nHeightDest,HDC hdcSrc,int nXOriginSrc,int nYOriginSrc,int nWidthSrc,int nHeightSrc, BLENDFUNCTION * bf)
+BOOL GDIPlus_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDest, int nHeightDest, HDC hdcSrc, int nXOriginSrc, int nYOriginSrc, int nWidthSrc, int nHeightSrc, BLENDFUNCTION * bf)
{
Graphics g(hdcDest);
BITMAP bmp;
- HBITMAP hbmp = (HBITMAP)GetCurrentObject(hdcSrc,OBJ_BITMAP);
- GetObject(hbmp,sizeof(BITMAP),&bmp);
+ HBITMAP hbmp = (HBITMAP)GetCurrentObject(hdcSrc, OBJ_BITMAP);
+ GetObject(hbmp, sizeof(BITMAP), &bmp);
Bitmap *bm;
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);
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,
0.0f, 0.0f, 1.0f, 0.0f, 0.0f,
- 0.0f, 0.0f, 0.0f, ((float)bf->SourceConstantAlpha)/255, 0.0f,
+ 0.0f, 0.0f, 0.0f, ((float)bf->SourceConstantAlpha) / 255, 0.0f,
0.0f, 0.0f, 0.0f, 0.0f, 1.0f
};
- attr.SetColorMatrix(&ClrMatrix, ColorMatrixFlagsDefault,ColorAdjustTypeBitmap);
+ 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);
- attr.SetGamma((REAL)0.8,ColorAdjustTypeBitmap);
+ attr.SetGamma((REAL)0.8, ColorAdjustTypeBitmap);
}
else g.SetInterpolationMode(InterpolationModeLowQuality);
- RectF rect((float)nXOriginDest,(float)nYOriginDest,(float)nWidthDest,(float)nHeightDest);
- g.DrawImage(bm, rect, (float)nXOriginSrc, (float)nYOriginSrc, (float)nWidthSrc, (float)nHeightSrc , UnitPixel, &attr, NULL, NULL);
+ RectF rect((float)nXOriginDest, (float)nYOriginDest, (float)nWidthDest, (float)nHeightDest);
+ g.DrawImage(bm, rect, (float)nXOriginSrc, (float)nYOriginSrc, (float)nWidthSrc, (float)nHeightSrc, UnitPixel, &attr, NULL, NULL);
delete bm;
return TRUE;
}
COLORREF __inline _revcolref(COLORREF colref)
{
- return RGB(GetBValue(colref), GetGValue(colref), GetRValue(colref));
+ return RGB(GetBValue(colref), GetGValue(colref), GetRValue(colref));
}
/////////////////////////////////////////////////////////////////////////////////
@@ -152,7 +148,7 @@ 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;
Image image(szName);
@@ -172,7 +168,7 @@ 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;
Bitmap image(szName);
@@ -194,7 +190,7 @@ void GDIPlus_ExtractAnimatedGIF (TCHAR * szName, int width, int height, HBITMAP
int nSize = image.GetPropertyItemSize(PropertyTagFrameDelay);
// Allocate a buffer to receive the property item.
- pPropertyItem = (PropertyItem*) malloc(nSize);
+ pPropertyItem = (PropertyItem*)malloc(nSize);
image.GetPropertyItem(PropertyTagFrameDelay, nSize, pPropertyItem);
@@ -202,20 +198,20 @@ void GDIPlus_ExtractAnimatedGIF (TCHAR * szName, int width, int height, HBITMAP
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);
+ 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);
+ HBITMAP oldBmp = (HBITMAP)SelectObject(hdc, hBitmap);
Graphics graphics(hdc);
ImageAttributes attr;
- graphics.SetInterpolationMode( InterpolationModeHighQualityBicubic );
- graphics.SetPixelOffsetMode( PixelOffsetModeHalf );
+ graphics.SetInterpolationMode(InterpolationModeHighQualityBicubic);
+ graphics.SetPixelOffsetMode(PixelOffsetModeHalf);
int * delays = (int*)malloc(nFrameCount*sizeof(int));
memset(delays, 0, nFrameCount*sizeof(int));
@@ -223,27 +219,27 @@ void GDIPlus_ExtractAnimatedGIF (TCHAR * szName, int width, int height, HBITMAP
/*
The GDIPlus strange behavior: without next 2 lines it will draw first frame anti aliased, but next - not
*/
- if ( nFrameCount > 1 )
- image.SelectActiveFrame(&pageGuid, 1 );
+ 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;
+ 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;
}
- SelectObject(hdc,oldBmp);
+ SelectObject(hdc, oldBmp);
DeleteDC(hdc);
free(pPropertyItem);
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();
}
diff --git a/plugins/Clist_modern/src/modern_gettextasync.cpp b/plugins/Clist_modern/src/modern_gettextasync.cpp
index 316152c19e..f876227b28 100644
--- a/plugins/Clist_modern/src/modern_gettextasync.cpp
+++ b/plugins/Clist_modern/src/modern_gettextasync.cpp
@@ -76,47 +76,46 @@ static BOOL gtaGetItem(GTACHAINITEM * mpChain)
return FALSE;
}
-static void gtaThreadProc(void *lpParam)
+static void gtaThreadProc(void *)
{
thread_catcher lck(g_hGetTextAsyncThread);
- HWND hwnd = pcli->hwndContactList;
- SHORTDATA data = {0};
+ SHORTDATA data = { 0 };
while (!MirandaExiting()) {
- Sync(CLUI_SyncGetShortData,(WPARAM)pcli->hwndContactTree,(LPARAM)&data);
+ Sync(CLUI_SyncGetShortData, (WPARAM)pcli->hwndContactTree, (LPARAM)&data);
while (true) {
- if ( MirandaExiting())
+ if (MirandaExiting())
return;
SleepEx(0, TRUE); //1000 contacts per second
- GTACHAINITEM mpChain = {0};
- struct SHORTDATA dat2 = {0};
+ GTACHAINITEM mpChain = { 0 };
+ struct SHORTDATA dat2 = { 0 };
if (!gtaGetItem(&mpChain))
break;
SHORTDATA *dat;
- if (mpChain.dat == NULL || (!IsBadReadPtr(mpChain.dat,sizeof(mpChain.dat)) && mpChain.dat->hWnd == data.hWnd))
+ 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);
+ Sync(CLUI_SyncGetShortData, (WPARAM)mpChain.dat->hWnd, (LPARAM)&dat2);
dat = &dat2;
}
- if ( MirandaExiting())
+ if (MirandaExiting())
return;
ClcCacheEntry cacheEntry;
memset(&cacheEntry, 0, sizeof(cacheEntry));
cacheEntry.hContact = mpChain.hContact;
- if (!Sync(CLUI_SyncGetPDNCE, (WPARAM) 0, (LPARAM)&cacheEntry)) {
+ if (!Sync(CLUI_SyncGetPDNCE, (WPARAM)0, (LPARAM)&cacheEntry)) {
Cache_GetSecondLineText(dat, &cacheEntry);
Cache_GetThirdLineText(dat, &cacheEntry);
- Sync(CLUI_SyncSetPDNCE, (WPARAM) CCI_LINES,(LPARAM)&cacheEntry);
+ Sync(CLUI_SyncSetPDNCE, (WPARAM)CCI_LINES, (LPARAM)&cacheEntry);
CListSettings_FreeCacheItemData(&cacheEntry);
}
- KillTimer(dat->hWnd,TIMERID_INVALIDATE_FULL);
- CLUI_SafeSetTimer(dat->hWnd,TIMERID_INVALIDATE_FULL,500, NULL);
+ KillTimer(dat->hWnd, TIMERID_INVALIDATE_FULL);
+ CLUI_SafeSetTimer(dat->hWnd, TIMERID_INVALIDATE_FULL, 500, NULL);
}
WaitForSingleObjectEx(hgtaWakeupEvent, INFINITE, TRUE);
@@ -134,7 +133,7 @@ BOOL gtaWakeThread()
return FALSE;
}
-int gtaAddRequest(ClcData *dat,ClcContact *contact,MCONTACT hContact)
+int gtaAddRequest(ClcData *dat, MCONTACT hContact)
{
if (MirandaExiting()) return 0;
gtalock;
@@ -161,10 +160,10 @@ int gtaAddRequest(ClcData *dat,ClcContact *contact,MCONTACT hContact)
void gtaRenewText(MCONTACT hContact)
{
- gtaAddRequest(NULL,NULL, hContact);
+ gtaAddRequest(NULL, hContact);
}
-int gtaOnModulesUnload(WPARAM wParam, LPARAM lParam)
+int gtaOnModulesUnload(WPARAM, LPARAM)
{
SetEvent(hgtaWakeupEvent);
return 0;
@@ -173,15 +172,15 @@ int gtaOnModulesUnload(WPARAM wParam, LPARAM lParam)
void InitCacheAsync()
{
InitializeCriticalSection(&gtaCS);
- hgtaWakeupEvent = CreateEvent(NULL,FALSE,FALSE,NULL);
+ hgtaWakeupEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
g_hGetTextAsyncThread = mir_forkthread(gtaThreadProc, 0);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, gtaOnModulesUnload);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, gtaOnModulesUnload);
}
void UninitCacheAsync()
{
SetEvent(hgtaWakeupEvent);
- while(g_hGetTextAsyncThread)
+ while (g_hGetTextAsyncThread)
SleepEx(50, TRUE);
CloseHandle(hgtaWakeupEvent);
diff --git a/plugins/Clist_modern/src/modern_image_array.cpp b/plugins/Clist_modern/src/modern_image_array.cpp
index 8f26cf3c77..6c03648ea7 100644
--- a/plugins/Clist_modern/src/modern_image_array.cpp
+++ b/plugins/Clist_modern/src/modern_image_array.cpp
@@ -46,8 +46,8 @@ static BOOL ImageArray_Alloc(LP_IMAGE_ARRAY_DATA iad, int size)
if (iad->nodes != NULL)
{
- IMAGE_ARRAY_DATA_NODE *tmp = (IMAGE_ARRAY_DATA_NODE *) realloc((void *)iad->nodes,
- sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
+ IMAGE_ARRAY_DATA_NODE *tmp = (IMAGE_ARRAY_DATA_NODE *)realloc((void *)iad->nodes,
+ sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
if (tmp == NULL)
{
@@ -57,11 +57,11 @@ static BOOL ImageArray_Alloc(LP_IMAGE_ARRAY_DATA iad, int size)
}
iad->nodes = tmp;
- memset( &iad->nodes[iad->nodes_allocated_size], 0, (size_grow - iad->nodes_allocated_size) * sizeof(IMAGE_ARRAY_DATA_NODE));
+ memset(&iad->nodes[iad->nodes_allocated_size], 0, (size_grow - iad->nodes_allocated_size) * sizeof(IMAGE_ARRAY_DATA_NODE));
}
else
{
- iad->nodes = (IMAGE_ARRAY_DATA_NODE *) malloc(sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
+ iad->nodes = (IMAGE_ARRAY_DATA_NODE *)malloc(sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
if (iad->nodes == NULL)
{
@@ -80,13 +80,13 @@ 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);
- tmp = (IMAGE_ARRAY_DATA_NODE *) realloc((void *)iad->nodes, sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
+ tmp = (IMAGE_ARRAY_DATA_NODE *)realloc((void *)iad->nodes, sizeof(IMAGE_ARRAY_DATA_NODE) * size_grow);
if (tmp == NULL)
{
@@ -214,7 +214,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
}
// Get bounds
- if (!GetObject(hBmp,sizeof(BITMAP),&bm))
+ if (!GetObject(hBmp, sizeof(BITMAP), &bm))
{
LeaveCriticalSection(&iad->cs);
return -1;
@@ -232,7 +232,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
}
// Alloc image
- hNewBmp = ImageArray_CreateBitmapPoint(new_width, new_height,&(iad->lpBits));
+ hNewBmp = ImageArray_CreateBitmapPoint(new_width, new_height, &(iad->lpBits));
if (hNewBmp == NULL)
{
LeaveCriticalSection(&iad->cs);
@@ -254,7 +254,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
hdc_old = CreateCompatibleDC(iad->hdc);
old_bmp = (HBITMAP)GetCurrentObject(hdc_old, OBJ_BITMAP);
- SetBkMode(iad->hdc,TRANSPARENT);
+ SetBkMode(iad->hdc, TRANSPARENT);
{
POINT org;
GetBrushOrgEx(iad->hdc, &org);
@@ -274,7 +274,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
{
w = iad->width;
h = 0;
- for (i=0; i < pos; i++)
+ for (i = 0; i < pos; i++)
{
h += iad->nodes[i].height;
}
@@ -283,7 +283,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
{
h = iad->height;
w = 0;
- for (i=0; i < pos; i++)
+ for (i = 0; i < pos; i++)
{
w += iad->nodes[i].width;
}
@@ -339,7 +339,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
}
// restore things
- SelectObject(hdc_old,old_bmp);
+ SelectObject(hdc_old, old_bmp);
DeleteDC(hdc_old);
if (iad->img != NULL) DeleteObject(iad->img);
iad->img = hNewBmp;
@@ -347,7 +347,7 @@ int ImageArray_AddImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
// Move array
if (!last_one && iad->nodes_size > 1)
{
- memmove(&iad->nodes[pos+1], &iad->nodes[pos], (iad->nodes_size - pos) * sizeof(IMAGE_ARRAY_DATA_NODE));
+ memmove(&iad->nodes[pos + 1], &iad->nodes[pos], (iad->nodes_size - pos) * sizeof(IMAGE_ARRAY_DATA_NODE));
}
iad->nodes[pos].width = bm.bmWidth;
iad->nodes[pos].height = bm.bmHeight;
@@ -384,7 +384,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
EnterCriticalSection(&iad->cs);
// Get bounds
- if (!GetObject(hBmp,sizeof(BITMAP),&bm))
+ if (!GetObject(hBmp, sizeof(BITMAP), &bm))
{
LeaveCriticalSection(&iad->cs);
return FALSE;
@@ -402,7 +402,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
}
// Alloc image
- hNewBmp = ImageArray_CreateBitmapPoint(new_width, new_height,&(iad->lpBits));
+ hNewBmp = ImageArray_CreateBitmapPoint(new_width, new_height, &(iad->lpBits));
if (hNewBmp == NULL)
{
LeaveCriticalSection(&iad->cs);
@@ -435,7 +435,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
{
w = iad->width;
h = 0;
- for (i=0; i < pos; i++)
+ for (i = 0; i < pos; i++)
{
h += iad->nodes[i].height;
}
@@ -444,7 +444,7 @@ BOOL ImageArray_ChangeImage(LP_IMAGE_ARRAY_DATA iad, HBITMAP hBmp, int pos)
{
h = iad->height;
w = 0;
- for (i=0; i < pos; i++)
+ for (i = 0; i < pos; i++)
{
w += iad->nodes[i].width;
}
@@ -547,7 +547,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos)
}
// Alloc image
- hNewBmp = ImageArray_CreateBitmapPoint(new_width, new_height,&(iad->lpBits));
+ hNewBmp = ImageArray_CreateBitmapPoint(new_width, new_height, &(iad->lpBits));
if (hNewBmp == NULL)
{
LeaveCriticalSection(&iad->cs);
@@ -579,7 +579,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos)
{
w = iad->width;
h = 0;
- for (i=0; i < pos; i++)
+ for (i = 0; i < pos; i++)
{
h += iad->nodes[i].height;
}
@@ -588,7 +588,7 @@ BOOL ImageArray_RemoveImage(LP_IMAGE_ARRAY_DATA iad, int pos)
{
h = iad->height;
w = 0;
- for (i=0; i < pos; i++)
+ for (i = 0; i < pos; i++)
{
w += iad->nodes[i].width;
}
@@ -668,7 +668,7 @@ BOOL ImageArray_DrawImage(LP_IMAGE_ARRAY_DATA iad, int pos, HDC hdcDest, int nXD
{
w = 0;
h = 0;
- for (i=0; i < pos; i++)
+ for (i = 0; i < pos; i++)
{
h += iad->nodes[i].height;
}
@@ -677,14 +677,14 @@ BOOL ImageArray_DrawImage(LP_IMAGE_ARRAY_DATA iad, int pos, HDC hdcDest, int nXD
{
h = 0;
w = 0;
- for (i=0; i < pos; i++)
+ for (i = 0; i < pos; i++)
{
w += iad->nodes[i].width;
}
}
{
- 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);
+ 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);
}
}
diff --git a/plugins/Clist_modern/src/modern_keyboard.cpp b/plugins/Clist_modern/src/modern_keyboard.cpp
index dac57d3eae..de9d108774 100644
--- a/plugins/Clist_modern/src/modern_keyboard.cpp
+++ b/plugins/Clist_modern/src/modern_keyboard.cpp
@@ -27,13 +27,13 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int InitSkinHotKeys(void);
-INT_PTR hkCloseMiranda(WPARAM wParam, LPARAM lParam)
+INT_PTR hkCloseMiranda(WPARAM, LPARAM)
{
CallService("CloseAction", 0, 0);
return 0;
}
-INT_PTR hkRestoreStatus(WPARAM wParam, LPARAM lParam)
+INT_PTR hkRestoreStatus(WPARAM, LPARAM)
{
int nStatus = db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE);
CallService(MS_CLIST_SETSTATUSMODE, nStatus, 0);
@@ -43,10 +43,10 @@ INT_PTR hkRestoreStatus(WPARAM wParam, LPARAM lParam)
int InitSkinHotKeys(void)
{
- CreateServiceFunction("CLIST/HK/CloseMiranda",hkCloseMiranda);
- CreateServiceFunction("CLIST/HK/RestoreStatus",hkRestoreStatus);
+ CreateServiceFunction("CLIST/HK/CloseMiranda", hkCloseMiranda);
+ CreateServiceFunction("CLIST/HK/RestoreStatus", hkRestoreStatus);
- HOTKEYDESC shk = {0};
+ HOTKEYDESC shk = { 0 };
shk.cbSize = sizeof(shk);
shk.dwFlags = HKD_TCHAR;
diff --git a/plugins/Clist_modern/src/modern_log.cpp b/plugins/Clist_modern/src/modern_log.cpp
index af2b9c9a68..25122fef72 100644
--- a/plugins/Clist_modern/src/modern_log.cpp
+++ b/plugins/Clist_modern/src/modern_log.cpp
@@ -5,14 +5,14 @@
#include <string.h>
-void Log(const char *file,int line,const char *fmt,...)
+void Log(const char *file, int line, const char *fmt, ...)
{
-
+
va_list vararg;
const char *file_tmp;
char str[1024];
- char buf[1024];
+ char buf[1024];
file_tmp = strrchr(file, '\\');
if (file_tmp == NULL)
@@ -20,27 +20,27 @@ void Log(const char *file,int line,const char *fmt,...)
else
file_tmp++;
- va_start(vararg,fmt);
- mir_vsnprintf(str,SIZEOF(str),fmt,vararg);
+ va_start(vararg, fmt);
+ mir_vsnprintf(str, SIZEOF(str), fmt, vararg);
va_end(vararg);
- {
- char * tmp = str;
- while(*tmp != '\0')
- {
- if (*tmp == '\n') *tmp = ' ';
- tmp++;
- }
- }
- mir_snprintf(buf,SIZEOF(buf),"clist_modern:[%u - %u]: %s \t\t(%s Ln %d)\n",GetCurrentThreadId(),GetTickCount(),str,file_tmp,line);
+ {
+ char * tmp = str;
+ while (*tmp != '\0')
+ {
+ if (*tmp == '\n') *tmp = ' ';
+ tmp++;
+ }
+ }
+ mir_snprintf(buf, SIZEOF(buf), "clist_modern:[%u - %u]: %s \t\t(%s Ln %d)\n", GetCurrentThreadId(), GetTickCount(), str, file_tmp, line);
#ifdef _FILELOG_
- {
- FILE *fp;
- fp = fopen(_FILELOG_,"at");
- fprintf(fp,buf);
- fclose(fp);
- }
+ {
+ FILE *fp;
+ fp = fopen(_FILELOG_,"at");
+ fprintf(fp,buf);
+ fclose(fp);
+ }
#else
- OutputDebugStringA(buf);
+ OutputDebugStringA(buf);
#endif
}
diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp
index 4e44190c77..2cf437935d 100644
--- a/plugins/Clist_modern/src/modern_newrowopts.cpp
+++ b/plugins/Clist_modern/src/modern_newrowopts.cpp
@@ -58,11 +58,11 @@ NodeList * AddNode(NodeList * Parent)
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->AllocatedChilds++;
- return &(Parent->childNodes[Parent->AllocatedChilds-1]);
+ return &(Parent->childNodes[Parent->AllocatedChilds - 1]);
}
@@ -71,7 +71,7 @@ BOOL RemoveChildNode(NodeList * FromList, DWORD index)
if (!FromList) return FALSE;
if (FromList->AllocatedChilds <= index) return FALSE;
NodeList *work = &(FromList->childNodes[index]);
- for (size_t i=0; i < work->AllocatedChilds; i++)
+ for (size_t i = 0; i < work->AllocatedChilds; i++)
if (work->childNodes[i].AllocatedChilds)
RemoveChildNode(work->childNodes, (DWORD)i);
@@ -79,7 +79,7 @@ BOOL RemoveChildNode(NodeList * FromList, DWORD index)
mir_free_and_nil(work->childNodes);
work->AllocatedChilds = 0;
}
- memmove(FromList->childNodes+index,FromList->childNodes+index+1,sizeof(NodeList)*(FromList->AllocatedChilds-index-1));
+ memmove(FromList->childNodes + index, FromList->childNodes + index + 1, sizeof(NodeList)*(FromList->AllocatedChilds - index - 1));
FromList->AllocatedChilds--;
return TRUE;
}
@@ -90,18 +90,17 @@ BOOL RemoveNode(NodeList * FromList)
if (FromList->itemParent)
{
DWORD k;
- for (k = 0;k < FromList->itemParent->AllocatedChilds;k++)
+ 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;
}
}
do
{
- RemoveChildNode(FromList,0);
- }
- while (FromList->AllocatedChilds>0);
+ RemoveChildNode(FromList, 0);
+ } while (FromList->AllocatedChilds>0);
mir_free_and_nil(FromList->childNodes);
mir_free_and_nil(FromList);
return TRUE;
@@ -110,7 +109,7 @@ int ident = 0;
void PrintIdent()
{
int k;
- for (k = 0;k < ident;k++)
+ for (k = 0; k < ident; k++)
TRACE("-");
}
@@ -121,11 +120,11 @@ void TraceTreeLevel(NodeList * node)
PrintIdent();
{
char buf[255];
- mir_snprintf(buf,SIZEOF(buf),"%d\n",node->pData);
+ mir_snprintf(buf, SIZEOF(buf), "%d\n", node->pData);
TRACE(buf);
}
ident += 5;
- for (i=0; i < node->AllocatedChilds; i++)
+ for (i = 0; i < node->AllocatedChilds; i++)
{
if (node->childNodes[i].AllocatedChilds>0)
@@ -135,7 +134,7 @@ void TraceTreeLevel(NodeList * node)
PrintIdent();
{
char buf[255];
- mir_snprintf(buf,SIZEOF(buf),"%d\n",node->childNodes[i].pData);
+ mir_snprintf(buf, SIZEOF(buf), "%d\n", node->childNodes[i].pData);
TRACE(buf);
}
}
@@ -143,55 +142,55 @@ void TraceTreeLevel(NodeList * node)
ident -= 5;
}
-BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam)
{
switch (msg)
{
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++;
- TRACE("*********** Nodes DUMP 1 ***********\n");
- TraceTreeLevel(RootNode);
- if (RemoveNode(res1)) res1 = 0;
- TRACE("*********** Nodes DUMP 2 ***********\n");
- TraceTreeLevel(RootNode);
- //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
- MessageBox(hwndDlg,_T("Init NewRow Dialog"),_T("Notify"),MB_OK);
- break;
- }
+ {
+ 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++;
+ TRACE("*********** Nodes DUMP 1 ***********\n");
+ TraceTreeLevel(RootNode);
+ if (RemoveNode(res1)) res1 = 0;
+ TRACE("*********** Nodes DUMP 2 ***********\n");
+ TraceTreeLevel(RootNode);
+ //CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(NULL,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
+ MessageBox(hwndDlg, _T("Init NewRow Dialog"), _T("Notify"), MB_OK);
+ break;
+ }
case WM_NOTIFY:
+ {
+ switch (((LPNMHDR)lParam)->idFrom)
{
- switch (((LPNMHDR)lParam)->idFrom)
+ case 0:
+ {
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
{
- case 0:
- {
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- return TRUE;
- }
- }
- }
+ return TRUE;
+ }
}
}
+ }
+ }
}
return 0;
};
diff --git a/plugins/Clist_modern/src/modern_row.cpp b/plugins/Clist_modern/src/modern_row.cpp
index cbcb0265ef..b03c891b09 100644
--- a/plugins/Clist_modern/src/modern_row.cpp
+++ b/plugins/Clist_modern/src/modern_row.cpp
@@ -65,27 +65,27 @@ ROWCELL *cppInitModernRow(ROWCELL ** tabAccess)
int seq = 0;
ROWCELL * RowRoot = NULL;
FILE * hFile;
- int i=0;
- if (!db_get_b(NULL,"ModernData","UseAdvancedRowLayout",SETTING_ROW_ADVANCEDLAYOUT_DEFAULT)) return NULL;
+ 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");
+ 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);
+ rowParse(RowRoot, RowRoot, tmplbuf, i, seq, tabAccess);
mir_free(tmplbuf);
return RowRoot;
}
if (hFile = fopen("template.txt", "rb"))
{
fsize = _filelength(_fileno(hFile));
- tmplbuf = (char*)malloc(fsize+1);
+ tmplbuf = (char*)malloc(fsize + 1);
memset(tmplbuf, 0, (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);
- db_set_s(NULL,"ModernData","RowTemplate",tmplbuf);
+ i = 0;
+ rowParse(RowRoot, RowRoot, tmplbuf, i, seq, tabAccess);
+ db_set_s(NULL, "ModernData", "RowTemplate", tmplbuf);
free(tmplbuf);
fclose(hFile);
return RowRoot;
@@ -167,7 +167,7 @@ char * rowParserGetNextWord(char *tbuf, int &hbuf)
memset(buf, 0, sizeof(buf));
- while(tbuf[hbuf] != 0)
+ while (tbuf[hbuf] != 0)
{
ch = tbuf[hbuf];
@@ -222,36 +222,36 @@ void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf)
char * word = rowParserGetNextWord(tbuf, hbuf);
int param = 0;
- if (!_strnicmp(word, "avatar", strlen(word))) param = TC_AVATAR;
- else if (!_strnicmp(word, "text1", strlen(word))) param = TC_TEXT1;
- else if (!_strnicmp(word, "text2", strlen(word))) param = TC_TEXT2;
- else if (!_strnicmp(word, "text3", strlen(word))) param = TC_TEXT3;
- else if (!_strnicmp(word, "status", strlen(word))) param = TC_STATUS;
- else if (!_strnicmp(word, "extra", strlen(word))) param = TC_EXTRA;
- else if (!_strnicmp(word, "extra1", strlen(word))) param = TC_EXTRA1;
- else if (!_strnicmp(word, "extra2", strlen(word))) param = TC_EXTRA2;
- else if (!_strnicmp(word, "extra3", strlen(word))) param = TC_EXTRA3;
- else if (!_strnicmp(word, "extra4", strlen(word))) param = TC_EXTRA4;
- else if (!_strnicmp(word, "extra5", strlen(word))) param = TC_EXTRA5;
- else if (!_strnicmp(word, "extra6", strlen(word))) param = TC_EXTRA6;
- else if (!_strnicmp(word, "extra7", strlen(word))) param = TC_EXTRA7;
- else if (!_strnicmp(word, "extra8", strlen(word))) param = TC_EXTRA8;
- else if (!_strnicmp(word, "extra9", strlen(word))) param = TC_EXTRA9;
- else if (!_strnicmp(word, "time", strlen(word))) param = TC_TIME;
- else if (!_strnicmp(word, "space", strlen(word))) param = TC_SPACE;
- else if (!_strnicmp(word, "fspace", strlen(word))) param = TC_FIXED;
-
- else if (!_strnicmp(word, "left", strlen(word))) param = TC_LEFT;
- else if (!_strnicmp(word, "top", strlen(word))) param = TC_TOP;
- else if (!_strnicmp(word, "vcenter", strlen(word))) param = TC_VCENTER;
- else if (!_strnicmp(word, "hcenter", strlen(word))) param = TC_HCENTER;
- else if (!_strnicmp(word, "right", strlen(word))) param = TC_RIGHT;
- else if (!_strnicmp(word, "bottom", strlen(word))) param = TC_BOTTOM;
-
- else if (!_strnicmp(word, "layer", strlen(word))) cell->layer = TRUE;
-
- else if (!_strnicmp(word, "width", strlen(word))) param = TC_WIDTH;
- else if (!_strnicmp(word, "height", strlen(word))) param = TC_HEIGHT;
+ if (!_strnicmp(word, "avatar", strlen(word))) param = TC_AVATAR;
+ else if (!_strnicmp(word, "text1", strlen(word))) param = TC_TEXT1;
+ else if (!_strnicmp(word, "text2", strlen(word))) param = TC_TEXT2;
+ else if (!_strnicmp(word, "text3", strlen(word))) param = TC_TEXT3;
+ else if (!_strnicmp(word, "status", strlen(word))) param = TC_STATUS;
+ else if (!_strnicmp(word, "extra", strlen(word))) param = TC_EXTRA;
+ else if (!_strnicmp(word, "extra1", strlen(word))) param = TC_EXTRA1;
+ else if (!_strnicmp(word, "extra2", strlen(word))) param = TC_EXTRA2;
+ else if (!_strnicmp(word, "extra3", strlen(word))) param = TC_EXTRA3;
+ else if (!_strnicmp(word, "extra4", strlen(word))) param = TC_EXTRA4;
+ else if (!_strnicmp(word, "extra5", strlen(word))) param = TC_EXTRA5;
+ else if (!_strnicmp(word, "extra6", strlen(word))) param = TC_EXTRA6;
+ else if (!_strnicmp(word, "extra7", strlen(word))) param = TC_EXTRA7;
+ else if (!_strnicmp(word, "extra8", strlen(word))) param = TC_EXTRA8;
+ else if (!_strnicmp(word, "extra9", strlen(word))) param = TC_EXTRA9;
+ else if (!_strnicmp(word, "time", strlen(word))) param = TC_TIME;
+ else if (!_strnicmp(word, "space", strlen(word))) param = TC_SPACE;
+ else if (!_strnicmp(word, "fspace", strlen(word))) param = TC_FIXED;
+
+ else if (!_strnicmp(word, "left", strlen(word))) param = TC_LEFT;
+ else if (!_strnicmp(word, "top", strlen(word))) param = TC_TOP;
+ else if (!_strnicmp(word, "vcenter", strlen(word))) param = TC_VCENTER;
+ else if (!_strnicmp(word, "hcenter", strlen(word))) param = TC_HCENTER;
+ else if (!_strnicmp(word, "right", strlen(word))) param = TC_RIGHT;
+ else if (!_strnicmp(word, "bottom", strlen(word))) param = TC_BOTTOM;
+
+ else if (!_strnicmp(word, "layer", strlen(word))) cell->layer = TRUE;
+
+ else if (!_strnicmp(word, "width", strlen(word))) param = TC_WIDTH;
+ else if (!_strnicmp(word, "height", strlen(word))) param = TC_HEIGHT;
else
{
@@ -259,7 +259,7 @@ void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf)
return;
}
- if (param>TC_TEXT3 && param != TC_SPACE) cell->hasfixed = 1;
+ if (param > TC_TEXT3 && param != TC_SPACE) cell->hasfixed = 1;
switch (param)
{
@@ -320,17 +320,17 @@ void rowParserGetParam(ROWCELL* &cell, char *tbuf, int &hbuf)
// hbuf - óêàçàòåëü áóôåðà
// sequence - íóæíî çàäàâàòü 0, ýòî î÷åðåäíîñòü íàõîæäåíèÿ
//
-BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &sequence, ROWCELL** RowTabAccess )
+BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &sequence, ROWCELL** RowTabAccess)
{
char * word;
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;
- else if (!_strnicmp(word, "/>", strlen(word)) ||
- !_strnicmp(word, "</tr>", strlen(word)) ||
- !_strnicmp(word, "</tc>", strlen(word))) return TRUE;
+ 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;
else return FALSE;
rowAddCell(cell, cont);
@@ -338,7 +338,7 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque
if (cell->type != 0 && cell->type != TC_SPACE && cell->type != TC_FIXED)
RowTabAccess[sequence++] = cell;
- if (!rowParse(cell->child, cell, tbuf, hbuf, sequence,RowTabAccess))
+ if (!rowParse(cell->child, cell, tbuf, hbuf, sequence, RowTabAccess))
return FALSE;
if (!parent)
@@ -347,7 +347,7 @@ BOOL rowParse(ROWCELL* &cell, ROWCELL* parent, char *tbuf, int &hbuf, int &seque
return TRUE;
}
- if (!rowParse(cell->next, parent, tbuf, hbuf, sequence,RowTabAccess))
+ if (!rowParse(cell->next, parent, tbuf, hbuf, sequence, RowTabAccess))
return FALSE;
parent->sizing |= cell->sizing;
@@ -382,15 +382,15 @@ void rowCalculateMinSize(ROWCELL* cell)
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;
+ 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);
@@ -407,15 +407,14 @@ void rowCalculateMinSize(ROWCELL* cell)
{
//w = max(w, curchild->r.right);
wl += curchild->r.right;
- fullWidth = max(fullWidth,max(curchild->full_width,curchild->w));
+ fullWidth = max(fullWidth, max(curchild->full_width, curchild->w));
}
else
{
w += curchild->r.right;
- fullWidth += max(curchild->full_width,curchild->w);
+ fullWidth += max(curchild->full_width, curchild->w);
}
- }
- while (curchild = curchild->next);
+ } while (curchild = curchild->next);
}
if (cell->cont == TC_COL)
@@ -423,7 +422,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)
{
@@ -437,10 +436,10 @@ void rowCalculateMinSize(ROWCELL* cell)
}
}
- cell->r.right = max(max(w, cell->r.right),wl);
- cell->r.bottom = max(max(h, cell->r.bottom),hl);
- cell->full_width = max(fullWidth,cell->full_width);
- cell->fixed_width = max(cell->fixed_width,cell->r.right);
+ cell->r.right = max(max(w, cell->r.right), wl);
+ cell->r.bottom = max(max(h, cell->r.bottom), hl);
+ cell->full_width = max(fullWidth, cell->full_width);
+ cell->fixed_width = max(cell->fixed_width, cell->r.right);
return;
}
@@ -464,8 +463,7 @@ void rowEqualize(ROWCELL* cell)
{
if (curchild->layer) continue;
curchild->r.bottom = cell->r.bottom;
- }
- while (curchild = curchild->next);
+ } while (curchild = curchild->next);
}
if (cell->cont == TC_COL)
@@ -474,8 +472,7 @@ void rowEqualize(ROWCELL* cell)
{
if (curchild->layer) continue;
curchild->r.right = cell->r.right;
- }
- while (curchild = curchild->next);
+ } while (curchild = curchild->next);
}
@@ -492,7 +489,7 @@ void rowPlacing(pROWCELL cell)
{
if (cell->type == 0) return;
- switch(cell->type)
+ switch (cell->type)
{
case TC_TEXT1:
case TC_TEXT2:
@@ -501,27 +498,27 @@ void rowPlacing(pROWCELL cell)
cell->r.right += cell->r.left;
break;
default:
+ {
+ switch (cell->halign)
{
- switch(cell->halign)
- {
- case TC_LEFT:
- break;
- case TC_HCENTER:
- cell->r.left += (cell->r.right - cell->w)/2;
- break;
- case TC_RIGHT:
- cell->r.left += cell->r.right - cell->w;
- }
- cell->r.right = cell->r.left + cell->w;
+ case TC_LEFT:
+ break;
+ case TC_HCENTER:
+ cell->r.left += (cell->r.right - cell->w) / 2;
+ break;
+ case TC_RIGHT:
+ cell->r.left += cell->r.right - cell->w;
}
+ cell->r.right = cell->r.left + cell->w;
+ }
}
- switch(cell->valign)
+ switch (cell->valign)
{
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;
@@ -544,26 +541,26 @@ void rowLayerProc(pROWCELL cell, pROWCELL parent)
}
else
{
- switch(cell->halign)
+ switch (cell->halign)
{
case TC_LEFT:
cell->r.left = parent->r.left;
break;
case TC_HCENTER:
- cell->r.left = parent->r.left + (parent->r.right - cell->r.right)/2;
+ cell->r.left = parent->r.left + (parent->r.right - cell->r.right) / 2;
break;
case TC_RIGHT:
cell->r.left = parent->r.left + parent->r.right - cell->r.right;
}
}
- switch(cell->valign)
+ switch (cell->valign)
{
case TC_TOP:
cell->r.top = parent->r.top;
break;
case TC_VCENTER:
- cell->r.top = parent->r.top + (parent->r.bottom - cell->r.bottom)/2;
+ cell->r.top = parent->r.top + (parent->r.bottom - cell->r.bottom) / 2;
break;
case TC_BOTTOM:
cell->r.top = parent->r.top + parent->r.bottom - cell->r.bottom;
@@ -623,7 +620,7 @@ void rowPositioning(pROWCELL cell, int &dist)
if (curchild->sizing)
{
- autosized += max(curchild->w,curchild->full_width);
+ autosized += max(curchild->w, curchild->full_width);
r++;
}
else
@@ -637,10 +634,10 @@ void rowPositioning(pROWCELL cell, int &dist)
if (r == 0)
{
- switch(cell->halign)
+ switch (cell->halign)
{
case TC_HCENTER:
- x += (dist - cw)/2;// - 1;
+ x += (dist - cw) / 2;// - 1;
break;
case TC_RIGHT:
x += dist - cw;
@@ -652,7 +649,7 @@ void rowPositioning(pROWCELL cell, int &dist)
curchild = cell->child;
size = 0;
- while(curchild)
+ while (curchild)
{
if (curchild->layer)
{
@@ -704,7 +701,7 @@ void rowPositioning(pROWCELL cell, int &dist)
if (h > size)
{
- switch(cell->valign)
+ switch (cell->valign)
{
case TC_VCENTER:
y += (h - size) / 2;
@@ -716,7 +713,7 @@ void rowPositioning(pROWCELL cell, int &dist)
}
curchild = cell->child;
- while(curchild)
+ while (curchild)
{
if (curchild->layer)
{
@@ -728,7 +725,7 @@ void rowPositioning(pROWCELL cell, int &dist)
curchild->r.top = y;
y += curchild->r.bottom;
- curchild->r.left = cell->r.left;
+ curchild->r.left = cell->r.left;
curchild->r.right = dist;
rowPositioning(curchild, size);
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
index 9593ac6d99..aaf9386b42 100644
--- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
+++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp
@@ -39,10 +39,10 @@ int RowHeights_GetRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact,
*
*/
-ROWCELL * gl_RowTabAccess[TC_ELEMENTSCOUNT+1] = {0}; // Ìàññèâ, ÷åðåç êîòîðûé îñóùåñòâëÿåòñÿ äîñòóï ê ýëåìåíòàì êîíòàêòà.
+ROWCELL * gl_RowTabAccess[TC_ELEMENTSCOUNT + 1] = { 0 }; // Ìàññèâ, ÷åðåç êîòîðûé îñóùåñòâëÿåòñÿ äîñòóï ê ýëåìåíòàì êîíòàêòà.
ROWCELL * gl_RowRoot;
-void FreeRowCell ()
+void FreeRowCell()
{
if (gl_RowRoot)
cppDeleteTree(gl_RowRoot);
@@ -50,43 +50,42 @@ void FreeRowCell ()
void RowHeight_InitModernRow()
{
- gl_RowRoot = cppInitModernRow(gl_RowTabAccess);
- return;
+ 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);
- return sz;
+ 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;
}
int RowHeight_CalcRowHeight(ClcData *dat, HWND hwnd, ClcContact *contact, int item)
{
if (MirandaExiting()) return 0;
g_mutex_nCalcRowHeightLock++;
- int res = mod_CalcRowHeight_worker(dat,hwnd,contact,item);
+ int res = mod_CalcRowHeight_worker(dat, hwnd, contact, item);
g_mutex_nCalcRowHeightLock--;
return res;
}
int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int item)
{
- BYTE i=0;
- int res = 0;
+ BYTE i = 0;
int height = 0;
ClcCacheEntry *pdnce;
BOOL hasAvatar = FALSE;
DWORD style;
- style = GetWindowLongPtr(hwnd,GWL_STYLE);
+ style = GetWindowLongPtr(hwnd, GWL_STYLE);
pdnce = pcli->pfnGetCacheEntry(contact->hContact);
if (!RowHeights_Alloc(dat, item + 1))
return -1;
@@ -102,11 +101,11 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
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);
+ 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, 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)
@@ -115,7 +114,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
return tmp;
}
- hasAvatar = (dat->use_avatar_service && contact->avatar_data != NULL) || (!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE);
+ 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) {
gl_RowTabAccess[i]->h = 0;
@@ -123,102 +122,100 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
SetRect(&(gl_RowTabAccess[i]->r), 0, 0, 0, 0);
switch (gl_RowTabAccess[i]->type) {
case TC_TEXT1:
+ {
+ 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)
{
- 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)
+ //calculate text width here
+ 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)
{
- //calculate text width here
- 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)
+ char * szCounts = pcli->pfnGetGroupCountsText(dat, contact);
+ if (szCounts && strlen(szCounts) > 0)
{
- char * szCounts = pcli->pfnGetGroupCountsText(dat, contact);
- if (szCounts && strlen(szCounts)>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;
- ske_DrawTextA(hdc,szCounts,mir_strlen(szCounts),&count_rc,DT_CALCRECT);
- size.cx += count_rc.right-count_rc.left;
- tmp = max(tmp,count_rc.bottom-count_rc.top);
- }
+ 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;
+ ske_DrawTextA(hdc, szCounts, mir_strlen(szCounts), &count_rc, DT_CALCRECT);
+ size.cx += count_rc.right - count_rc.left;
+ tmp = max(tmp, count_rc.bottom - count_rc.top);
}
- gl_RowTabAccess[i]->w = size.cx;
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ske_ResetTextEffect(hdc);
- DeleteDC(hdc);
}
- gl_RowTabAccess[i]->h = tmp;
+ gl_RowTabAccess[i]->w = size.cx;
+ SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
+ ske_ResetTextEffect(hdc);
+ DeleteDC(hdc);
}
- break;
+ gl_RowTabAccess[i]->h = tmp;
+ }
+ break;
case TC_TEXT2:
+ {
+ int tmp = 0;
+ if (dat->second_line_show && pdnce->szSecondLineText && pdnce->szSecondLineText[0])
{
- int tmp = 0;
- MCONTACT hContact = pdnce->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)
{
- 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)
- {
- //calculate text width here
+ //calculate text width here
- 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;
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ske_ResetTextEffect(hdc);
- DeleteDC(hdc);
- }
+ 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;
+ SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
+ ske_ResetTextEffect(hdc);
+ DeleteDC(hdc);
}
- gl_RowTabAccess[i]->h = tmp;
}
- break;
+ gl_RowTabAccess[i]->h = tmp;
+ }
+ break;
case TC_TEXT3:
- {
- MCONTACT hContact = pdnce->hContact;
- int tmp = 0;
- 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) {
- //calculate text width here
- 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;
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
- ske_ResetTextEffect(hdc);
- DeleteDC(hdc);
- }
+ {
+ int tmp = 0;
+ 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) {
+ //calculate text width here
+ 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;
+ SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
+ ske_ResetTextEffect(hdc);
+ DeleteDC(hdc);
}
- gl_RowTabAccess[i]->h = tmp;
}
- break;
+ 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;
@@ -241,8 +238,8 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
iW = dat->avatar_cache.nodes[contact->avatar_pos].width;
iH = dat->avatar_cache.nodes[contact->avatar_pos].height;
}
- SIZE 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)
+ SIZE 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;
@@ -254,7 +251,7 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
// Draw extra icons
if (contact->type == CLCIT_CONTACT &&
- (!contact->isSubcontact || db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
+ (!contact->isSubcontact || db_get_b(NULL, "CLC", "MetaHideExtra", SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
{
BOOL hasExtra = FALSE;
int width = 0;
@@ -262,12 +259,12 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
if (contact->iExtraImage[k] != EMPTY_EXTRA_ICON || !dat->MetaIgnoreEmptyExtra) {
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;
+ width += (width>0) ? dat->extraColumnSpacing : (dat->extraColumnSpacing - 2);
}
+ if (hasExtra) {
+ gl_RowTabAccess[i]->h = ICON_HEIGHT;
+ gl_RowTabAccess[i]->w = width;
+ }
}
break;
@@ -281,9 +278,9 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
case TC_EXTRA8:
case TC_EXTRA9:
if (contact->type == CLCIT_CONTACT &&
- (!contact->isSubcontact || db_get_b(NULL,"CLC","MetaHideExtra",SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
+ (!contact->isSubcontact || db_get_b(NULL, "CLC", "MetaHideExtra", SETTING_METAHIDEEXTRA_DEFAULT) == 0 && dat->extraColumnsCount > 0))
{
- int eNum = gl_RowTabAccess[i]->type-TC_EXTRA1;
+ int eNum = gl_RowTabAccess[i]->type - TC_EXTRA1;
if (eNum < dat->extraColumnsCount)
if (contact->iExtraImage[eNum] != EMPTY_EXTRA_ICON || !dat->MetaIgnoreEmptyExtra) {
gl_RowTabAccess[i]->h = ICON_HEIGHT;
@@ -299,15 +296,15 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
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);
- g_clcPainter.ChangeToFont(hdc,dat,FONTID_CONTACT_TIME,NULL);
+ g_clcPainter.ChangeToFont(hdc, dat, FONTID_CONTACT_TIME, NULL);
// Get text size
text_size.cy = ske_DrawText(hdc, szResult, mir_tstrlen(szResult), &rc, DT_CALCRECT | DT_NOPREFIX | DT_SINGLELINE);
- SelectObject(hdc,GetStockObject(DEFAULT_GUI_FONT));
+ SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
ske_ResetTextEffect(hdc);
DeleteDC(hdc);
text_size.cx = rc.right - rc.left;
@@ -322,8 +319,8 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
}
height = cppCalculateRowHeight(gl_RowRoot);
- height += dat->row_border*2;
- height = max(height,dat->row_min_heigh);
+ height += dat->row_border * 2;
+ height = max(height, dat->row_min_heigh);
if (item != -1) dat->row_heights[item] = height;
return height;
}
@@ -334,8 +331,8 @@ int mod_CalcRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact, int i
BOOL RowHeights_Initialize(struct ClcData *dat)
{
- dat->rowHeight = 0;
- dat->row_heights_size = 0;
+ dat->rowHeight = 0;
+ dat->row_heights_size = 0;
dat->row_heights_allocated = 0;
dat->row_heights = NULL;
@@ -367,7 +364,7 @@ BOOL RowHeights_Alloc(ClcData *dat, int size)
size_grow += 100 - (size_grow % 100);
if (dat->row_heights != NULL) {
- int *tmp = (int *) realloc((void *)dat->row_heights, sizeof(int)* size_grow);
+ int *tmp = (int *)realloc((void *)dat->row_heights, sizeof(int)* size_grow);
if (tmp == NULL) {
TRACE("Out of memory: realloc returned NULL (RowHeights_Alloc)");
RowHeights_Free(dat);
@@ -375,10 +372,10 @@ BOOL RowHeights_Alloc(ClcData *dat, int size)
}
dat->row_heights = tmp;
- memset(dat->row_heights+(dat->row_heights_allocated), 0, sizeof(int)* (size_grow-dat->row_heights_allocated));
+ memset(dat->row_heights + (dat->row_heights_allocated), 0, sizeof(int)* (size_grow - dat->row_heights_allocated));
}
else {
- dat->row_heights = (int *) malloc(sizeof(int)* size_grow);
+ dat->row_heights = (int *)malloc(sizeof(int)* size_grow);
if (dat->row_heights == NULL) {
TRACE("Out of memory: alloc returned NULL (RowHeights_Alloc)");
RowHeights_Free(dat);
@@ -398,15 +395,15 @@ BOOL RowHeights_Alloc(ClcData *dat, int size)
static int contact_fonts[] = {
FONTID_CONTACTS, FONTID_INVIS, FONTID_OFFLINE, FONTID_NOTONLIST, FONTID_OFFINVIS,
- FONTID_AWAY,FONTID_DND, FONTID_NA, FONTID_OCCUPIED, FONTID_CHAT, FONTID_INVISIBLE,
+ FONTID_AWAY, FONTID_DND, FONTID_NA, FONTID_OCCUPIED, FONTID_CHAT, FONTID_INVISIBLE,
FONTID_PHONE, FONTID_LUNCH };
-static int other_fonts[] = {FONTID_OPENGROUPS, FONTID_OPENGROUPCOUNTS,FONTID_CLOSEDGROUPS, FONTID_CLOSEDGROUPCOUNTS, FONTID_DIVIDERS, FONTID_CONTACT_TIME};
+static int other_fonts[] = { FONTID_OPENGROUPS, FONTID_OPENGROUPCOUNTS, FONTID_CLOSEDGROUPS, FONTID_CLOSEDGROUPCOUNTS, FONTID_DIVIDERS, FONTID_CONTACT_TIME };
int RowHeights_GetMaxRowHeight(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) {
// Get contact font size
@@ -464,10 +461,10 @@ int RowHeights_GetMaxRowHeight(ClcData *dat, HWND hwnd)
// Calc and store row height for all items in the list
void RowHeights_CalcRowHeights(ClcData *dat, HWND hwnd)
{
- if (MirandaExiting()) return;
- g_mutex_nCalcRowHeightLock++;
- RowHeights_CalcRowHeights_Worker(dat, hwnd);
- g_mutex_nCalcRowHeightLock--;
+ if (MirandaExiting()) return;
+ g_mutex_nCalcRowHeightLock++;
+ RowHeights_CalcRowHeights_Worker(dat, hwnd);
+ g_mutex_nCalcRowHeightLock--;
}
void RowHeights_CalcRowHeights_Worker(ClcData *dat, HWND hwnd)
@@ -484,7 +481,7 @@ void RowHeights_CalcRowHeights_Worker(ClcData *dat, HWND hwnd)
RowHeights_Clear(dat);
- while(TRUE) {
+ while (TRUE) {
if (subindex == -1) {
if (group->scanIndex == group->cl.count) {
group = group->parent;
@@ -515,7 +512,7 @@ void RowHeights_CalcRowHeights_Worker(ClcData *dat, HWND hwnd)
//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]->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;
@@ -554,8 +551,7 @@ int RowHeights_GetRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact,
//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 minimalistic = (g_clcPainter.CheckMiniMode(dat, selected));
if (!RowHeights_Alloc(dat, item + 1))
return -1;
@@ -589,15 +585,15 @@ int RowHeights_GetRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact,
// Avatar size
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)) && !minimalistic )
+ ((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);
}
@@ -607,7 +603,7 @@ int RowHeights_GetRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact,
if (contact->type == CLCIT_GROUP
|| (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_data != NULL) ||
(!dat->use_avatar_service && contact->avatar_pos != AVATAR_POS_DONT_HAVE))
&& !contact->image_is_special)))
{
@@ -631,10 +627,10 @@ int RowHeights_GetRowHeight_worker(ClcData *dat, HWND hwnd, ClcContact *contact,
int cliGetRowTopY(ClcData *dat, int item)
{
if (item >= dat->row_heights_size)
- return cliGetRowBottomY(dat,item-1);
+ return cliGetRowBottomY(dat, item - 1);
int y = 0;
- for (int i=0 ; i < item ; i++)
+ for (int i = 0; i < item; i++)
y += dat->row_heights[i];
return y;
}
@@ -646,7 +642,7 @@ int cliGetRowBottomY(ClcData *dat, int item)
return -1;
int y = 0;
- for (int i=0 ; i <= item ; i++)
+ for (int i = 0; i <= item; i++)
y += dat->row_heights[i];
return y;
}
@@ -656,7 +652,7 @@ int cliGetRowBottomY(ClcData *dat, int item)
int cliGetRowTotalHeight(ClcData *dat)
{
int y = 0;
- for (int i=0 ; i < dat->row_heights_size ; i++)
+ for (int i = 0; i < dat->row_heights_size; i++)
y += dat->row_heights[i];
return y;
@@ -669,7 +665,7 @@ int cliRowHitTest(ClcData *dat, int pos_y)
return -1;
int y = 0;
- for (int i=0 ; i < dat->row_heights_size ; i++) {
+ for (int i = 0; i < dat->row_heights_size; i++) {
y += dat->row_heights[i];
if (pos_y < y)
return i;
@@ -680,8 +676,8 @@ int cliRowHitTest(ClcData *dat, int pos_y)
int cliGetRowHeight(ClcData *dat, int item)
{
- if ( item >= dat->row_heights_size || item < 0 )
+ if (item >= dat->row_heights_size || item < 0)
return dat->rowHeight;
- return dat->row_heights[ item ];
+ return dat->row_heights[item];
}
diff --git a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
index 816d58bcb8..bfb0fd386f 100644
--- a/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
+++ b/plugins/Clist_modern/src/modern_rowtemplateopt.cpp
@@ -27,24 +27,24 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hdr/modern_commonprototypes.h"
#include "hdr/modern_row.h"
-void RefreshTree(HWND hwndDlg,HTREEITEM hti);
+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"),
- _T("avatar"), _T("extra"), _T("extra1"), _T("extra2"), _T("extra3"),
+ _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")
+ _T("extra9"), _T("time"), _T("space"), _T("fspace")
};
-RECT da = {205,58,440, 130}; // Draw area
+RECT da = { 205, 58, 440, 130 }; // Draw area
void rowOptBuildTA(pROWCELL cell, pROWCELL* TA, int* i)
{
if (!cell) return;
TA[(*i)++] = cell;
- rowOptBuildTA(cell->child,TA, i);
+ rowOptBuildTA(cell->child, TA, i);
rowOptBuildTA(cell->next, TA, i);
}
@@ -56,45 +56,45 @@ 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;
if (!tvi.hItem) {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),0);
- EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS, 0, 0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS, 0, 0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTLAYER),0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTTYPE), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_VALIGN), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_HALIGN), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTWIDTH), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTHEIGHT), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTWIDTH), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTHEIGHT), 0);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTWIDTH, UDM_SETPOS, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTHEIGHT, UDM_SETPOS, 0, 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTLAYER), 0);
return;
}
- EnableWindow(GetDlgItem(hwnd,IDC_CONTTYPE) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_VALIGN),1);
- EnableWindow(GetDlgItem(hwnd,IDC_HALIGN) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTLAYER),1);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTTYPE), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_VALIGN), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_HALIGN), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTLAYER), 1);
if (cell->type != TC_SPACE && cell->type != TC_FIXED) {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,0);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS, 0, 0);
- SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS, 0, 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTWIDTH), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTHEIGHT), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTWIDTH), 0);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTHEIGHT), 0);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTWIDTH, UDM_SETPOS, 0, 0);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTHEIGHT, UDM_SETPOS, 0, 0);
}
else {
- EnableWindow(GetDlgItem(hwnd,IDC_CONTWIDTH) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_CONTHEIGHT),1);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTWIDTH) ,1);
- EnableWindow(GetDlgItem(hwnd,IDC_SPINCONTHEIGHT),1);
- SendDlgItemMessage(hwnd,IDC_SPINCONTWIDTH, UDM_SETPOS, 0, MAKELONG(cell->w,0));
- SendDlgItemMessage(hwnd,IDC_SPINCONTHEIGHT,UDM_SETPOS, 0, MAKELONG(cell->h,0));
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTWIDTH), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_CONTHEIGHT), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTWIDTH), 1);
+ EnableWindow(GetDlgItem(hwnd, IDC_SPINCONTHEIGHT), 1);
+ SendDlgItemMessage(hwnd, IDC_SPINCONTWIDTH, UDM_SETPOS, 0, MAKELONG(cell->w, 0));
+ SendDlgItemMessage(hwnd, IDC_SPINCONTHEIGHT, UDM_SETPOS, 0, MAKELONG(cell->h, 0));
}
SendDlgItemMessage(hwnd, IDC_CONTTYPE, CB_SETCURSEL, cell->type, 0);
@@ -123,7 +123,7 @@ void rowOptShowSettings(HWND hwnd)
}
SendDlgItemMessage(hwnd, IDC_HALIGN, CB_SETCURSEL, param, 0);
- CheckDlgButton(hwnd,IDC_CONTLAYER,cell->layer ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwnd, IDC_CONTLAYER, cell->layer ? BST_CHECKED : BST_UNCHECKED);
}
void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd)
@@ -133,7 +133,7 @@ void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd)
TVINSERTSTRUCT tvis;
tvis.hParent = node;
tvis.hInsertAfter = TVI_LAST;
- tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.lParam = (LPARAM)cell;
@@ -145,12 +145,12 @@ void rowOptGenerateTreeView(pROWCELL cell, HTREEITEM node, HWND hwnd)
tvis.item.pszText = _T("Column");
}
- tvis.item.iImage = cell->child?1:2;
- tvis.item.iSelectedImage = cell->child?0:2;
+ tvis.item.iImage = cell->child ? 1 : 2;
+ tvis.item.iSelectedImage = cell->child ? 0 : 2;
- HTREEITEM pnode = TreeView_InsertItem(hwnd,&tvis);
+ HTREEITEM pnode = TreeView_InsertItem(hwnd, &tvis);
rowOptGenerateTreeView(cell->child, pnode, hwnd);
- rowOptGenerateTreeView(cell->next, node, hwnd);
+ rowOptGenerateTreeView(cell->next, node, hwnd);
}
int rowOptFillRowTree(HWND hwnd)
@@ -181,7 +181,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti)
else {
// Get parent item
tviparent.hItem = hti;
- tviparent.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tviparent.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
TreeView_GetItem(htree, &tviparent);
cell = (pROWCELL)tviparent.lParam;
@@ -196,11 +196,11 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti)
while (cell->next)
cell = cell->next;
- rowAddCell(cell->next, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW?TC_COL:TC_ROW);
+ rowAddCell(cell->next, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW ? TC_COL : TC_ROW);
cell = cell->next;
}
else {
- rowAddCell(cell->child, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW?TC_COL:TC_ROW);
+ rowAddCell(cell->child, ((ROWCELL*)tviparent.lParam)->cont == TC_ROW ? TC_COL : TC_ROW);
cell = cell->child;
}
@@ -210,12 +210,12 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti)
tvis.item.lParam = (LPARAM)cell;
tvis.hParent = hti;
- tvis.item.mask = TVIF_PARAM|TVIF_TEXT|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
tvis.item.iImage = 2;
tvis.item.iSelectedImage = 2;
- TreeView_InsertItem(htree,&tvis);
+ TreeView_InsertItem(htree, &tvis);
TreeView_Expand(htree, hti, TVM_EXPAND);
@@ -224,7 +224,7 @@ void rowOptAddContainer(HWND htree, HTREEITEM hti)
tviparent.iSelectedImage = 0;
TreeView_SetItem(htree, &tviparent);
- int i=0;
+ int i = 0;
memset(rowOptTA, 0, sizeof(rowOptTA));
rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &i);
}
@@ -239,10 +239,10 @@ 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;
+ tvpi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
if (prev)
{
@@ -272,9 +272,9 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti)
rowDeleteTree((pROWCELL)tvi.lParam);
{
- int i=0;
+ int i = 0;
memset(rowOptTA, 0, sizeof(rowOptTA));
- rowOptBuildTA((pROWCELL)tvpi.lParam, (pROWCELL*)&rowOptTA, &i );
+ rowOptBuildTA((pROWCELL)tvpi.lParam, (pROWCELL*)&rowOptTA, &i);
}
TreeView_DeleteItem(htree, hti);
@@ -283,7 +283,7 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti)
// Change icon at parent item
if (!prnt || (prnt != prev)) return;
- if ( TreeView_GetChild(htree, prnt))
+ if (TreeView_GetChild(htree, prnt))
{
tvpi.iImage = 1;
tvpi.iSelectedImage = 0;
@@ -297,11 +297,11 @@ void rowOptDelContainer(HWND htree, HTREEITEM hti)
}
-void RefreshTree(HWND hwndDlg,HTREEITEM hti)
+void RefreshTree(HWND hwndDlg, HTREEITEM hti)
{
HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
pROWCELL cell;
- TVITEM tvi = {0};
+ TVITEM tvi = { 0 };
if (hti == NULL) hti = TreeView_GetRoot(htree);
while (hti)
{
@@ -311,7 +311,7 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti)
cell = (pROWCELL)tvi.lParam;
if (cell)
{
- TCHAR buf[200] = {0};
+ TCHAR buf[200] = { 0 };
if (!cell->child)
{
if (cell->type == 0)
@@ -324,159 +324,158 @@ void RefreshTree(HWND hwndDlg,HTREEITEM hti)
if (cell->type == 0)
_tcsncpy_s(buf, (cell->cont != TC_COL ? TranslateT("columns") : TranslateT("lines")), _TRUNCATE);
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;
+ if (cell->layer) _tcsncat(buf, TranslateT(" layered"), SIZEOF(buf));
+ tvi.mask = TVIF_HANDLE | TVIF_TEXT;
tvi.pszText = buf;
- TreeView_SetItem(htree,&tvi);
+ TreeView_SetItem(htree, &tvi);
}
{
- HTREEITEM child_hti = TreeView_GetChild(htree,hti);
- if (child_hti) RefreshTree(hwndDlg,child_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);
+ RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
case WM_INITDIALOG:
- {
- int hbuf = 0, seq = 0;
- HWND htree = GetDlgItem(hwndDlg,IDC_ROWTREE);
+ {
+ 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 />");
+ TranslateDialogDefault(hwndDlg);
+ rowOptTmplStr = db_get_sa(NULL, "ModernData", "RowTemplate");
+ if (!rowOptTmplStr)
+ rowOptTmplStr = mir_strdup("<TR />");
- SendDlgItemMessage(hwndDlg,IDC_SPINCONTWIDTH, UDM_SETRANGE, 0, MAKELONG(999,0));
- SendDlgItemMessage(hwndDlg,IDC_SPINCONTHEIGHT,UDM_SETRANGE, 0, MAKELONG(999,0));
+ SendDlgItemMessage(hwndDlg, IDC_SPINCONTWIDTH, UDM_SETRANGE, 0, MAKELONG(999, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SPINCONTHEIGHT, UDM_SETRANGE, 0, MAKELONG(999, 0));
- int i, item;
+ int i, item;
- for (i=0; i < SIZEOF(types); i++) {
- item = SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_ADDSTRING, 0, (LPARAM)TranslateTS(types[i]));
- SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_CONTTYPE,CB_SETCURSEL, 0, 0);
+ for (i = 0; i < SIZEOF(types); i++) {
+ item = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_ADDSTRING, 0, (LPARAM)TranslateTS(types[i]));
+ SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_SETITEMDATA, item, 0);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_SETCURSEL, 0, 0);
- TCHAR *h_alignment[] = {_T("left"), _T("hCenter"), _T("right")};
- for (i=0; i < SIZEOF(h_alignment); i++) {
- item = SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_ADDSTRING, 0, (LPARAM)TranslateTS(h_alignment[i]));
- SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_HALIGN,CB_SETCURSEL, 0, 0);
+ TCHAR *h_alignment[] = { _T("left"), _T("hCenter"), _T("right") };
+ for (i = 0; i < SIZEOF(h_alignment); i++) {
+ item = SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(h_alignment[i]));
+ SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETITEMDATA, item, 0);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_SETCURSEL, 0, 0);
- TCHAR *v_alignment[] = {_T("top"), _T("vCenter"), _T("bottom")};
- for (i=0; i < SIZEOF(v_alignment); i++) {
- item = SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_ADDSTRING, 0, (LPARAM)TranslateTS(v_alignment[i]));
- SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETITEMDATA,item,0);
- }
- SendDlgItemMessage(hwndDlg,IDC_VALIGN,CB_SETCURSEL, 0, 0);
-
- rowDeleteTree(rowOptTmplRoot);
- rowOptTmplRoot = NULL;
- rowParse(rowOptTmplRoot, rowOptTmplRoot, rowOptTmplStr, hbuf, seq, rowOptTA);
- seq = 0;
- memset(rowOptTA, 0, sizeof(rowOptTA));
- rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &seq);
-
- rowOptFillRowTree(htree);
- RefreshTree(hwndDlg,NULL);
- TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_ROWTREE), TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_ROWTREE)));
- rowOptShowSettings(hwndDlg);
+ TCHAR *v_alignment[] = { _T("top"), _T("vCenter"), _T("bottom") };
+ for (i = 0; i < SIZEOF(v_alignment); i++) {
+ item = SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_ADDSTRING, 0, (LPARAM)TranslateTS(v_alignment[i]));
+ SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_SETITEMDATA, item, 0);
}
- return TRUE;
+ SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_SETCURSEL, 0, 0);
+
+ rowDeleteTree(rowOptTmplRoot);
+ rowOptTmplRoot = NULL;
+ rowParse(rowOptTmplRoot, rowOptTmplRoot, rowOptTmplStr, hbuf, seq, rowOptTA);
+ seq = 0;
+ memset(rowOptTA, 0, sizeof(rowOptTA));
+ rowOptBuildTA(rowOptTmplRoot, (pROWCELL*)&rowOptTA, &seq);
+
+ rowOptFillRowTree(htree);
+ RefreshTree(hwndDlg, NULL);
+ TreeView_SelectItem(GetDlgItem(hwndDlg, IDC_ROWTREE), TreeView_GetRoot(GetDlgItem(hwndDlg, IDC_ROWTREE)));
+ rowOptShowSettings(hwndDlg);
+ }
+ return TRUE;
case WM_COMMAND:
- {
- HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
- pROWCELL cell;
- TVITEM tvi = {0};
- HTREEITEM hti = TreeView_GetSelection(htree);
-
-
- tvi.hItem = hti;
- 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) {
- TVITEM tv = {0};
- int index = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_GETCURSEL, 0, 0);
- cell->type = index;
- RefreshTree(hwndDlg,NULL);
- }
+ {
+ HWND htree = GetDlgItem(hwndDlg, IDC_ROWTREE);
+ pROWCELL cell;
+ TVITEM tvi = { 0 };
+ HTREEITEM hti = TreeView_GetSelection(htree);
- case IDC_VALIGN:
- if (HIWORD(wParam) == CBN_SELENDOK) {
- switch (SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_GETCURSEL, 0, 0)) {
- case 0:
- cell->valign = TC_TOP;
- break;
- case 1:
- cell->valign = TC_VCENTER;
- break;
- case 2:
- cell->valign = TC_BOTTOM;
- break;
- }
- RefreshTree(hwndDlg,NULL);
- }
- case IDC_HALIGN:
- if (HIWORD(wParam) == CBN_SELENDOK) {
- switch (SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_GETCURSEL, 0, 0)) {
- case 0:
- cell->halign = TC_LEFT;
- break;
- case 1:
- cell->halign = TC_HCENTER;
- break;
- case 2:
- cell->halign = TC_RIGHT;
- break;
- }
- RefreshTree(hwndDlg,NULL);
- }
+ tvi.hItem = hti;
+ 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) {
+ int index = SendDlgItemMessage(hwndDlg, IDC_CONTTYPE, CB_GETCURSEL, 0, 0);
+ cell->type = index;
+ RefreshTree(hwndDlg, NULL);
}
- if (HIWORD(wParam) == BN_CLICKED) {
- if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_ADDCONTAINER))
- // Adding new container
- {
- rowOptAddContainer(htree, hti);
- }
- else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_DELCONTAINER))
- // Deleting container
- {
- rowOptDelContainer(htree, hti);
+ case IDC_VALIGN:
+ if (HIWORD(wParam) == CBN_SELENDOK) {
+ switch (SendDlgItemMessage(hwndDlg, IDC_VALIGN, CB_GETCURSEL, 0, 0)) {
+ case 0:
+ cell->valign = TC_TOP;
+ break;
+ case 1:
+ cell->valign = TC_VCENTER;
+ break;
+ case 2:
+ cell->valign = TC_BOTTOM;
+ break;
}
- else if (lParam == (LPARAM)GetDlgItem(hwndDlg,IDC_CONTUP))
- // Moving container to up
- {
- RedrawWindow(htree,&da,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ RefreshTree(hwndDlg, NULL);
+ }
+
+ case IDC_HALIGN:
+ if (HIWORD(wParam) == CBN_SELENDOK) {
+ switch (SendDlgItemMessage(hwndDlg, IDC_HALIGN, CB_GETCURSEL, 0, 0)) {
+ case 0:
+ cell->halign = TC_LEFT;
+ break;
+ case 1:
+ cell->halign = TC_HCENTER;
+ break;
+ case 2:
+ cell->halign = TC_RIGHT;
+ break;
}
- RefreshTree(hwndDlg,NULL);
- RedrawWindow(GetParent(hwndDlg),NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ RefreshTree(hwndDlg, NULL);
}
- return TRUE;
}
+ if (HIWORD(wParam) == BN_CLICKED) {
+ if (lParam == (LPARAM)GetDlgItem(hwndDlg, IDC_ADDCONTAINER))
+ // Adding new container
+ {
+ rowOptAddContainer(htree, hti);
+ }
+ else if (lParam == (LPARAM)GetDlgItem(hwndDlg, IDC_DELCONTAINER))
+ // Deleting container
+ {
+ rowOptDelContainer(htree, hti);
+ }
+ else if (lParam == (LPARAM)GetDlgItem(hwndDlg, IDC_CONTUP))
+ // Moving container to up
+ {
+ RedrawWindow(htree, &da, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ }
+ RefreshTree(hwndDlg, NULL);
+ RedrawWindow(GetParent(hwndDlg), NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ }
+ return TRUE;
+ }
+
case WM_NOTIFY:
- switch(((LPNMHDR)lParam)->idFrom) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case IDC_ROWTREE:
- if (((LPNMHDR)lParam)->code == NM_SETCURSOR )
+ if (((LPNMHDR)lParam)->code == NM_SETCURSOR)
rowOptShowSettings(hwndDlg);
- if (((LPNMHDR)lParam)->code == NM_CLICK )
- RedrawWindow(hwndDlg,&da,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW);
+ if (((LPNMHDR)lParam)->code == NM_CLICK)
+ RedrawWindow(hwndDlg, &da, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
break;
case 0: // Apply or Ok button is pressed
@@ -487,7 +486,7 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case WM_PAINT:
if (rowOptTmplRoot) {
- int i=0;
+ int i = 0;
// Drawning row template at properties page
PAINTSTRUCT ps;
@@ -495,11 +494,11 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
TVITEM curItem;
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]) {
- switch(rowOptTA[i]->type) {
+ while (rowOptTA[i]) {
+ switch (rowOptTA[i]->type) {
case TC_AVATAR:
rowOptTA[i]->w = 25;
rowOptTA[i]->h = 30;
@@ -541,12 +540,12 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
i++;
}
- rowSizeWithReposition(rowOptTmplRoot, da.right-da.left);
+ rowSizeWithReposition(rowOptTmplRoot, da.right - da.left);
i = -1;
while (rowOptTA[++i]) {
- switch(rowOptTA[i]->type) {
+ switch (rowOptTA[i]->type) {
case TC_SPACE:
case TC_FIXED:
case 0:
@@ -554,9 +553,9 @@ INT_PTR CALLBACK DlgTmplEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
continue;
}
Rectangle(hdc,
- rowOptTA[i]->r.left + da.left,
- rowOptTA[i]->r.top + da.top,
- rowOptTA[i]->r.right + da.left,
+ rowOptTA[i]->r.left + da.left,
+ rowOptTA[i]->r.top + da.top,
+ rowOptTA[i]->r.right + da.left,
rowOptTA[i]->r.bottom + da.top);
}
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp
index 51d9b64ef7..8430262674 100644
--- a/plugins/Clist_modern/src/modern_skinbutton.cpp
+++ b/plugins/Clist_modern/src/modern_skinbutton.cpp
@@ -33,7 +33,7 @@ This file contains code related to new modern free positioned skinned buttons
#define MODERNSKINBUTTONCLASS "MirandaModernSkinButtonClass"
BOOL ModernSkinButtonModuleIsLoaded = FALSE;
-static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
+static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam);
int SkinSelector_DeleteMask(MODERNMASK *mm);
HWND SetToolTip(HWND hwnd, TCHAR * tip);
@@ -73,20 +73,20 @@ int ModernSkinButtonLoadModule()
{
WNDCLASSEX wc;
memset(&wc, 0, sizeof(wc));
- wc.cbSize = sizeof(wc);
- wc.lpszClassName = _T(MODERNSKINBUTTONCLASS);
- wc.lpfnWndProc = ModernSkinButtonWndProc;
- wc.hCursor = LoadCursor(NULL, IDC_ARROW);
- wc.cbWndExtra = sizeof(ModernSkinButtonCtrl*);
- wc.hbrBackground = 0;
- wc.style = CS_GLOBALCLASS;
+ wc.cbSize = sizeof(wc);
+ wc.lpszClassName = _T(MODERNSKINBUTTONCLASS);
+ wc.lpfnWndProc = ModernSkinButtonWndProc;
+ wc.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wc.cbWndExtra = sizeof(ModernSkinButtonCtrl*);
+ wc.hbrBackground = 0;
+ wc.style = CS_GLOBALCLASS;
RegisterClassEx(&wc);
InitializeCriticalSection(&csTips);
ModernSkinButtonModuleIsLoaded = TRUE;
return 0;
}
-int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam)
+int ModernSkinButtonUnloadModule(WPARAM, LPARAM)
{
DeleteCriticalSection(&csTips);
return 0;
@@ -95,13 +95,12 @@ int ModernSkinButtonUnloadModule(WPARAM wParam, LPARAM lParam)
static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
{
HDC hdc;
- HBITMAP bmp,oldbmp;
+ HBITMAP bmp, oldbmp;
RECT rc;
- HDC sdc = NULL;
ModernSkinButtonCtrl* bct = (ModernSkinButtonCtrl *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (!bct) return 0;
if (!IsWindowVisible(hwnd)) return 0;
- if (!whdc && !g_CluiData.fLayered) InvalidateRect(hwnd,NULL,FALSE);
+ if (!whdc && !g_CluiData.fLayered) InvalidateRect(hwnd, NULL, FALSE);
if (whdc && g_CluiData.fLayered) hdc = whdc;
else
@@ -109,17 +108,16 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
//sdc = GetWindowDC(GetParent(hwnd));
hdc = CreateCompatibleDC(NULL);
}
- GetClientRect(hwnd,&rc);
- bmp = ske_CreateDIB32(rc.right,rc.bottom);
- oldbmp = (HBITMAP)SelectObject(hdc,bmp);
+ GetClientRect(hwnd, &rc);
+ bmp = ske_CreateDIB32(rc.right, rc.bottom);
+ oldbmp = (HBITMAP)SelectObject(hdc, bmp);
if (!g_CluiData.fLayered)
- ske_BltBackImage(bct->hwnd,hdc,NULL);
+ 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;
{
if (bct->ValueDBSection && bct->ValueTypeDef)
{
@@ -130,48 +128,48 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
key = mir_strdup(bct->ValueDBSection);
section = key;
if (bct->ValueTypeDef[0] != 's')
- defval = (DWORD)atol(bct->ValueTypeDef+1);
+ 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');
switch (bct->ValueTypeDef[0])
{
case 's':
- {
- Value = db_get_sa(NULL,section,key);
- if (!Value)
- Value = mir_strdup(bct->ValueTypeDef+1);
- break;
- }
+ {
+ Value = db_get_sa(NULL, section, key);
+ if (!Value)
+ 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(section);
}
}
- g_clcPainter.AddParam(&Request,mod_CalcHash("Module"),"MButton",0);
- g_clcPainter.AddParam(&Request,mod_CalcHash("ID"),bct->ID,0);
- g_clcPainter.AddParam(&Request,mod_CalcHash("Down"),bct->down?"1":"0",0);
- g_clcPainter.AddParam(&Request,mod_CalcHash("Focused"),bct->focus?"1":"0",0);
- g_clcPainter.AddParam(&Request,mod_CalcHash("Hovered"),bct->hover?"1":"0",0);
+ g_clcPainter.AddParam(&Request, mod_CalcHash("Module"), "MButton", 0);
+ g_clcPainter.AddParam(&Request, mod_CalcHash("ID"), bct->ID, 0);
+ g_clcPainter.AddParam(&Request, mod_CalcHash("Down"), bct->down ? "1" : "0", 0);
+ g_clcPainter.AddParam(&Request, mod_CalcHash("Focused"), bct->focus ? "1" : "0", 0);
+ g_clcPainter.AddParam(&Request, mod_CalcHash("Hovered"), bct->hover ? "1" : "0", 0);
if (Value) {
- g_clcPainter.AddParam(&Request,mod_CalcHash("Value"),Value,0);
+ g_clcPainter.AddParam(&Request, mod_CalcHash("Value"), Value, 0);
mir_free(Value);
}
- SkinDrawGlyphMask(hdc,&rc,&rc,&Request);
+ SkinDrawGlyphMask(hdc, &rc, &rc, &Request);
SkinSelector_DeleteMask(&Request);
// DeleteObject(br);
}
@@ -179,17 +177,17 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
if (!whdc && g_CluiData.fLayered)
{
RECT r;
- SetRect(&r,bct->Left,bct->Top,bct->Right,bct->Bottom);
- ske_DrawImageAt(hdc,&r);
+ SetRect(&r, bct->Left, bct->Top, bct->Right, bct->Bottom);
+ ske_DrawImageAt(hdc, &r);
//CallingService to immeadeately update window with new image.
}
if (whdc && !g_CluiData.fLayered)
{
- RECT r = {0};
- GetClientRect(bct->hwnd,&r);
- BitBlt(whdc, 0, 0, r.right,r.bottom,hdc, 0, 0, SRCCOPY);
+ RECT r = { 0 };
+ GetClientRect(bct->hwnd, &r);
+ BitBlt(whdc, 0, 0, r.right, r.bottom, hdc, 0, 0, SRCCOPY);
}
- SelectObject(hdc,oldbmp);
+ SelectObject(hdc, oldbmp);
DeleteObject(bmp);
if (!whdc || !g_CluiData.fLayered)
{
@@ -201,7 +199,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
return 0;
}
-static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDef)
+static int ModernSkinButtonToggleDBValue(char * ValueDBSection, char *ValueTypeDef)
{
if (ValueDBSection && ValueTypeDef)
{
@@ -210,22 +208,21 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDe
char * val;
char * val2;
char * Value;
- long l1,l2,curval;
- DWORD defval = 0;
+ long l1 = 0, l2 = 0, curval;
// char buf[20];
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');
- val = mir_strdup(ValueTypeDef+1);
+ 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');
@@ -237,31 +234,31 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDe
switch (ValueTypeDef[0]) {
case 's':
- Value = db_get_sa(NULL,section,key);
- if (!Value || (Value && mir_bool_strcmpi(Value,val2)))
+ Value = db_get_sa(NULL, section, key);
+ if (!Value || (Value && mir_bool_strcmpi(Value, val2)))
Value = mir_strdup(val);
else
Value = mir_strdup(val2);
- db_set_s(NULL,section,key,Value);
+ db_set_s(NULL, section, key, Value);
mir_free(Value);
break;
case 'd':
- curval = db_get_dw(NULL,section,key,l2);
- curval = (curval == l2)?l1:l2;
- db_set_dw(NULL,section,key,(DWORD)curval);
+ 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;
- db_set_w(NULL,section,key,(WORD)curval);
+ 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;
- db_set_b(NULL,section,key,(BYTE)curval);
+ curval = db_get_b(NULL, section, key, l2);
+ curval = (curval == l2) ? l1 : l2;
+ db_set_b(NULL, section, key, (BYTE)curval);
break;
}
mir_free(section);
@@ -272,7 +269,7 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection,char *ValueTypeDe
static char *_skipblank(char * str) //str will be modified;
{
- char * endstr = str+strlen(str);
+ char * endstr = str + strlen(str);
while ((*str == ' ' || *str == '\t') && *str != '\0') str++;
while ((*endstr == ' ' || *endstr == '\t') && *endstr != '\0' && endstr < str) endstr--;
if (*endstr != '\0')
@@ -319,7 +316,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
if (param1 && *param1 == '\"')
{
param1++;
- *(param1+strlen(param1)) = '\0';
+ *(param1 + strlen(param1)) = '\0';
}
else if (param1)
{
@@ -328,7 +325,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
if (param2 && *param2 == '\"')
{
param2++;
- *(param2+strlen(param2)) = '\0';
+ *(param2 + strlen(param2)) = '\0';
}
else if (param2)
param2 = (char*)atoi(param2);
@@ -354,26 +351,26 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
}
-static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- ModernSkinButtonCtrl* bct = (msg != WM_NCCREATE)?(ModernSkinButtonCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA):0;
- if (bct && bct->HandleService && IsBadStringPtrA(bct->HandleService,255))
+ ModernSkinButtonCtrl* bct = (msg != WM_NCCREATE) ? (ModernSkinButtonCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA) : 0;
+ if (bct && bct->HandleService && IsBadStringPtrA(bct->HandleService, 255))
bct->HandleService = NULL;
if (bct)
if (bct->HandleService && ServiceExists(bct->HandleService)) {
- HandleServiceParams MSG = {0};
+ HandleServiceParams MSG = { 0 };
MSG.hwnd = hwndDlg;
MSG.msg = msg;
MSG.wParam = wParam;
MSG.lParam = lParam;
- int t = CallService(bct->HandleService,(WPARAM)&MSG,0);
+ int t = CallService(bct->HandleService, (WPARAM)&MSG, 0);
if (MSG.handled) return t;
}
- switch(msg) {
+ switch (msg) {
case WM_NCCREATE:
- SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE)|BS_OWNERDRAW);
+ SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE) | BS_OWNERDRAW);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
if (((CREATESTRUCT *)lParam)->lpszName) SetWindowText(hwndDlg, ((CREATESTRUCT *)lParam)->lpszName);
return TRUE;
@@ -410,42 +407,42 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM
break; // DONT! fall thru
case WM_SETCURSOR:
- {
- HCURSOR hCurs1 = LoadCursor(NULL, IDC_ARROW);
- if (hCurs1) SetCursor(hCurs1);
- if (bct) SetToolTip(hwndDlg, bct->Hint);
- }
- return 1;
+ {
+ HCURSOR hCurs1 = LoadCursor(NULL, IDC_ARROW);
+ if (hCurs1) SetCursor(hCurs1);
+ if (bct) SetToolTip(hwndDlg, bct->Hint);
+ }
+ return 1;
case WM_PRINT:
if (IsWindowVisible(hwndDlg))
- ModernSkinButtonPaintWorker(hwndDlg,(HDC)wParam);
+ ModernSkinButtonPaintWorker(hwndDlg, (HDC)wParam);
break;
case WM_PAINT:
if (IsWindowVisible(hwndDlg) && !g_CluiData.fLayered) {
- PAINTSTRUCT ps = {0};
- BeginPaint(hwndDlg,&ps);
- ModernSkinButtonPaintWorker(hwndDlg,(HDC)ps.hdc);
- EndPaint(hwndDlg,&ps);
+ PAINTSTRUCT ps = { 0 };
+ BeginPaint(hwndDlg, &ps);
+ ModernSkinButtonPaintWorker(hwndDlg, (HDC)ps.hdc);
+ EndPaint(hwndDlg, &ps);
}
return DefWindowProc(hwndDlg, msg, wParam, lParam);
case WM_CAPTURECHANGED:
bct->hover = 0;
bct->down = 0;
- ModernSkinButtonPaintWorker(bct->hwnd,0);
+ ModernSkinButtonPaintWorker(bct->hwnd, 0);
break;
case WM_MOUSEMOVE:
if (!bct->hover) {
SetCapture(bct->hwnd);
bct->hover = 1;
- ModernSkinButtonPaintWorker(bct->hwnd,0);
+ ModernSkinButtonPaintWorker(bct->hwnd, 0);
}
else {
POINT t = UNPACK_POINT(lParam);
- ClientToScreen(bct->hwnd,&t);
+ ClientToScreen(bct->hwnd, &t);
if (WindowFromPoint(t) != bct->hwnd)
ReleaseCapture();
}
@@ -454,17 +451,17 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM
case WM_LBUTTONDOWN:
bct->down = 1;
SetForegroundWindow(GetParent(bct->hwnd));
- ModernSkinButtonPaintWorker(bct->hwnd,0);
- if (bct->CommandService && IsBadStringPtrA(bct->CommandService,255))
+ ModernSkinButtonPaintWorker(bct->hwnd, 0);
+ if (bct->CommandService && IsBadStringPtrA(bct->CommandService, 255))
bct->CommandService = NULL;
if (bct->fCallOnPress) {
if (bct->CommandService) {
- if (!_CallServiceStrParams(bct->CommandService, NULL) && (bct->ValueDBSection && bct->ValueTypeDef))
- ModernSkinButtonToggleDBValue(bct->ValueDBSection,bct->ValueTypeDef);
+ if (!_CallServiceStrParams(bct->CommandService, NULL) && (bct->ValueDBSection && bct->ValueTypeDef))
+ ModernSkinButtonToggleDBValue(bct->ValueDBSection, bct->ValueTypeDef);
}
bct->down = 0;
- ModernSkinButtonPaintWorker(bct->hwnd,0);
+ ModernSkinButtonPaintWorker(bct->hwnd, 0);
}
return 0;
@@ -473,14 +470,15 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM
ReleaseCapture();
bct->hover = 0;
bct->down = 0;
- ModernSkinButtonPaintWorker(bct->hwnd,0);
- if (bct->CommandService && IsBadStringPtrA(bct->CommandService,255))
+ ModernSkinButtonPaintWorker(bct->hwnd, 0);
+ if (bct->CommandService && IsBadStringPtrA(bct->CommandService, 255))
bct->CommandService = NULL;
if (bct->CommandService)
if (_CallServiceStrParams(bct->CommandService, NULL))
- {}
+ {
+ }
else if (bct->ValueDBSection && bct->ValueTypeDef)
- ModernSkinButtonToggleDBValue(bct->ValueDBSection,bct->ValueTypeDef);
+ ModernSkinButtonToggleDBValue(bct->ValueDBSection, bct->ValueTypeDef);
}
}
return DefWindowProc(hwndDlg, msg, wParam, lParam);
@@ -513,10 +511,10 @@ HWND SetToolTip(HWND hwnd, TCHAR * tip)
if (SendMessage(hwndToolTips, TTM_GETTOOLINFO, 0, (LPARAM)&ti)) {
SendMessage(hwndToolTips, TTM_DELTOOL, 0, (LPARAM)&ti);
}
- ti.uFlags = TTF_IDISHWND|TTF_SUBCLASS;
+ ti.uFlags = TTF_IDISHWND | TTF_SUBCLASS;
ti.uId = (UINT_PTR)hwnd;
ti.lpszText = (TCHAR*)tip;
- SendMessage(hwndToolTips,TTM_ADDTOOL, 0, (LPARAM)&ti);
+ SendMessage(hwndToolTips, TTM_ADDTOOL, 0, (LPARAM)&ti);
LeaveCriticalSection(&csTips);
return hwndToolTips;
@@ -528,8 +526,8 @@ typedef struct _MButton
{
HWND hwnd;
BYTE ConstrainPositionFrom; //(BBRRTTLL) L = 0 - from left, L = 1 from right, L = 2 from center
- int OrL,OrR,OrT,OrB;
- int minW,minH;
+ int OrL, OrR, OrT, OrB;
+ int minW, minH;
ModernSkinButtonCtrl * bct;
} MButton;
@@ -540,60 +538,60 @@ DWORD ButtonsCount = 0;
#define _center_v( rc ) (((rc)->bottom + (rc)->top ) >> 1)
int ModernSkinButton_AddButton(HWND parent,
- char * ID,
- char * CommandService,
- char * StateDefService,
- char * HandeService,
- int Left,
- int Top,
- int Right,
- int Bottom,
- DWORD sbFlags,
- TCHAR * Hint,
- char * DBkey,
- char * TypeDef,
- int MinWidth, int MinHeight)
+ char * ID,
+ char * CommandService,
+ char * StateDefService,
+ char * HandeService,
+ int Left,
+ int Top,
+ int Right,
+ int Bottom,
+ DWORD sbFlags,
+ TCHAR * Hint,
+ char * DBkey,
+ char * TypeDef,
+ int MinWidth, int MinHeight)
{
// if (!parent) return 0;
if (!ModernSkinButtonModuleIsLoaded) return 0;
if (!Buttons)
Buttons = (MButton*)mir_alloc(sizeof(MButton));
else
- Buttons = (MButton*)mir_realloc(Buttons,sizeof(MButton)*(ButtonsCount+1));
+ 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 ) :
- ( sbFlags & SBF_ALIGN_TL_HCENTER ) ? ( _center_h( &rc ) + Left ) :
- ( rc.left + Left );
-
- 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 ) :
- ( sbFlags & SBF_ALIGN_BR_HCENTER ) ? ( _center_h( &rc) + Right ) :
- ( rc.left + Right );
-
- b = ( sbFlags & SBF_ALIGN_BR_BOTTOM ) ? ( rc.bottom + Bottom ) :
- ( sbFlags & SBF_ALIGN_BR_VCENTER ) ? ( _center_v( &rc ) + Bottom ) :
- ( rc.top + Bottom );
+ int l, r, b, t;
+ if (parent) GetClientRect(parent, &rc);
+ 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) :
+ (sbFlags & SBF_ALIGN_TL_VCENTER) ? (_center_v(&rc) + Top) :
+ (rc.top + Top);
+
+ 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) :
+ (sbFlags & SBF_ALIGN_BR_VCENTER) ? (_center_v(&rc) + Bottom) :
+ (rc.top + Bottom);
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->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->ID = mir_strdup(ID);
bct->Hint = mir_tstrdup(Hint);
Buttons[ButtonsCount].bct = bct;
Buttons[ButtonsCount].hwnd = NULL;
@@ -612,28 +610,28 @@ int ModernSkinButton_AddButton(HWND parent,
-static int ModernSkinButtonErase(int l,int t,int r, int b)
+static int ModernSkinButtonErase(int l, int t, int r, int b)
{
DWORD i;
if (!ModernSkinButtonModuleIsLoaded) return 0;
if (!g_CluiData.fLayered) return 0;
if (!g_pCachedWindow) return 0;
- if (!g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0;
+ if (!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)
{
//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,
- g_pCachedWindow->hBackDC,Buttons[i].bct->Left,Buttons[i].bct->Top,SRCCOPY);
+ 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,
+ g_pCachedWindow->hBackDC, Buttons[i].bct->Left, Buttons[i].bct->Top, SRCCOPY);
}
}
}
else
{
- BitBlt(g_pCachedWindow->hImageDC,l,t,r-l,b-t, g_pCachedWindow->hBackDC,l,t,SRCCOPY);
+ BitBlt(g_pCachedWindow->hImageDC, l, t, r - l, b - t, g_pCachedWindow->hBackDC, l, t, SRCCOPY);
}
return 0;
}
@@ -646,7 +644,7 @@ static HWND ModernSkinButtonCreateWindow(ModernSkinButtonCtrl * bct, HWND parent
{
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);
+ 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);
}
@@ -656,16 +654,16 @@ static HWND ModernSkinButtonCreateWindow(ModernSkinButtonCtrl * bct, HWND parent
return hwnd;
}
-int ModernSkinButtonRedrawAll(HDC hdc)
+int ModernSkinButtonRedrawAll()
{
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);
- ModernSkinButtonPaintWorker(Buttons[i].hwnd,0);
+ Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct, pcli->hwndContactList);
+ ModernSkinButtonPaintWorker(Buttons[i].hwnd, 0);
}
g_mutex_bLockUpdating--;
return 0;
@@ -676,7 +674,7 @@ int ModernSkinButtonDeleteAll()
if (!ModernSkinButtonModuleIsLoaded)
return 0;
- for (size_t i=0; i < ButtonsCount; i++)
+ for (size_t i = 0; i < ButtonsCount; i++)
if (Buttons[i].hwnd)
DestroyWindow(Buttons[i].hwnd);
@@ -692,69 +690,68 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r)
RECT clr;
RECT rd;
BOOL altDraw = FALSE;
- static SIZE oldWndSize = {0};
+ static SIZE oldWndSize = { 0 };
if (!ModernSkinButtonModuleIsLoaded) return 0;
- GetWindowRect(parent,&rd);
- GetClientRect(parent,&clr);
+ GetWindowRect(parent, &rd);
+ GetClientRect(parent, &clr);
if (!r)
- GetWindowRect(parent,&rc);
+ GetWindowRect(parent, &rc);
else
rc = *r;
- if (g_CluiData.fLayered && ( draw & SBRF_DO_ALT_DRAW ))
+ if (g_CluiData.fLayered && (draw & SBRF_DO_ALT_DRAW))
{
- int sx,sy;
- sx = rd.right-rd.left;
- sy = rd.bottom-rd.top;
+ 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;
}
- 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++)
+ 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++)
{
- int l,r,b,t;
- RECT oldRect = {0};
+ int l, r, b, t;
int sbFlags = Buttons[i].ConstrainPositionFrom;
if (parent && Buttons[i].hwnd == NULL)
{
- Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct,parent);
+ Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct, parent);
altDraw = FALSE;
}
- l = ( sbFlags & SBF_ALIGN_TL_RIGHT ) ? ( rc.right + Buttons[i].OrL ) :
- ( sbFlags & SBF_ALIGN_TL_HCENTER ) ? ( _center_h( &rc ) + Buttons[i].OrL ) :
- ( rc.left + Buttons[i].OrL );
+ l = (sbFlags & SBF_ALIGN_TL_RIGHT) ? (rc.right + Buttons[i].OrL) :
+ (sbFlags & SBF_ALIGN_TL_HCENTER) ? (_center_h(&rc) + Buttons[i].OrL) :
+ (rc.left + Buttons[i].OrL);
- t = ( sbFlags & SBF_ALIGN_TL_BOTTOM ) ? ( rc.bottom + Buttons[i].OrT ) :
- ( sbFlags & SBF_ALIGN_TL_VCENTER ) ? ( _center_v( &rc ) + Buttons[i].OrT ) :
- ( rc.top + Buttons[i].OrT );
+ t = (sbFlags & SBF_ALIGN_TL_BOTTOM) ? (rc.bottom + Buttons[i].OrT) :
+ (sbFlags & SBF_ALIGN_TL_VCENTER) ? (_center_v(&rc) + Buttons[i].OrT) :
+ (rc.top + Buttons[i].OrT);
- r = ( sbFlags & SBF_ALIGN_BR_RIGHT ) ? ( rc.right + Buttons[i].OrR ) :
- ( sbFlags & SBF_ALIGN_BR_HCENTER ) ? ( _center_h( &rc) + Buttons[i].OrR ) :
- ( rc.left + Buttons[i].OrR );
+ r = (sbFlags & SBF_ALIGN_BR_RIGHT) ? (rc.right + Buttons[i].OrR) :
+ (sbFlags & SBF_ALIGN_BR_HCENTER) ? (_center_h(&rc) + Buttons[i].OrR) :
+ (rc.left + Buttons[i].OrR);
- b = ( sbFlags & SBF_ALIGN_BR_BOTTOM ) ? ( rc.bottom + Buttons[i].OrB ) :
- ( sbFlags & SBF_ALIGN_BR_VCENTER ) ? ( _center_v( &rc ) + Buttons[i].OrB ) :
- ( rc.top + Buttons[i].OrB );
+ b = (sbFlags & SBF_ALIGN_BR_BOTTOM) ? (rc.bottom + Buttons[i].OrB) :
+ (sbFlags & SBF_ALIGN_BR_VCENTER) ? (_center_v(&rc) + Buttons[i].OrB) :
+ (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*/))
- CLUI_ShowWindowMod(Buttons[i].hwnd,SW_HIDE);
+ 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*/))
+ CLUI_ShowWindowMod(Buttons[i].hwnd, SW_HIDE);
else
- CLUI_ShowWindowMod(Buttons[i].hwnd,SW_SHOW);
+ CLUI_ShowWindowMod(Buttons[i].hwnd, SW_SHOW);
if ((1 || altDraw) &&
- (Buttons[i].bct->Left != l ||
- Buttons[i].bct->Top != t ||
+ (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);
+ ModernSkinButtonErase(Buttons[i].bct->Left, Buttons[i].bct->Top, Buttons[i].bct->Right, Buttons[i].bct->Bottom);
}
Buttons[i].bct->Left = l;
@@ -764,6 +761,6 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r)
}
- if ( draw & SBRF_DO_REDRAW_ALL ) ModernSkinButtonRedrawAll(0);
+ if (draw & SBRF_DO_REDRAW_ALL) ModernSkinButtonRedrawAll();
return 0;
} \ No newline at end of file
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp
index 4bbe3902c3..3860214cc3 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -40,15 +40,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/* Global variables */
-SKINOBJECTSLIST g_SkinObjectList = {0};
+SKINOBJECTSLIST g_SkinObjectList = { 0 };
CURRWNDIMAGEDATA *g_pCachedWindow = NULL;
-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_plSkinFonts = NULL;
/* Private module variables */
@@ -67,11 +67,11 @@ static SKINOBJECTSLIST *pCurrentSkin = NULL;
static char **pszSettingName = NULL;
static int nArrayLen = 0;
-static BYTE pbGammaWeight[256] = {0};
-static BYTE pbGammaWeightAdv[256] = {0};
+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 };
static LISTMODERNMASK *MainModernMaskList = NULL;
@@ -80,20 +80,20 @@ static BOOL ske_GetMaskBit(BYTE *line, int x);
static INT_PTR ske_Service_AlphaTextOut(WPARAM wParam, LPARAM lParam);
static INT_PTR ske_Service_DrawIconEx(WPARAM wParam, LPARAM lParam);
-static int ske_AlphaTextOut (HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, UINT format, DWORD ARGBcolor);
-static void ske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineString,SKINOBJECTSLIST *Skin);
-static void ske_AddParseSkinFont(char * szFontID,char * szDefineString,SKINOBJECTSLIST *Skin);
+static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect, UINT format, DWORD ARGBcolor);
+static void ske_AddParseTextGlyphObject(char * szGlyphTextID, char * szDefineString, SKINOBJECTSLIST *Skin);
+static void ske_AddParseSkinFont(char * szFontID, char * szDefineString);
static int ske_DeleteAllSettingInSection(char * SectionName);
static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin);
-static LPSKINOBJECTDESCRIPTOR ske_FindObject(const char * szName, BYTE objType,SKINOBJECTSLIST* Skin);
+static LPSKINOBJECTDESCRIPTOR ske_FindObject(const char *szName, SKINOBJECTSLIST *Skin);
static int ske_LoadSkinFromResource(BOOL bOnlyObjects);
-static void ske_PreMultiplyChanells(HBITMAP hbmp,BYTE Mult);
+static void ske_PreMultiplyChanells(HBITMAP hbmp, BYTE Mult);
static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting);
static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam);
static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam);
static INT_PTR ske_Service_DrawTextWithEffect(WPARAM wParam, LPARAM lParam);
-static MODERNEFFECT meCurrentEffect = {-1,{0}, 0, 0};
+static MODERNEFFECT meCurrentEffect = { -1, { 0 }, 0, 0 };
//////////////////////////////////////////////////////////////////////////
// Ini file parser
@@ -433,8 +433,8 @@ BOOL ske_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthD
if (blendFunction.BlendFlags & 128) // Use gdi+ engine
return GDIPlus_AlphaBlend(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,
- hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
- &blendFunction);
+ hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,
+ &blendFunction);
blendFunction.BlendFlags &= ~128;
return AlphaBlend(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, blendFunction);
@@ -613,18 +613,14 @@ BOOL ske_SetRectOpaque(HDC memdc, RECT *fr, BOOL force)
return 1;
}
-static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *rGlyph, RECT *rClip, BYTE mode, BYTE drawMode, int depth)
+static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *rGlyph, RECT *rClip, BYTE mode, BYTE drawMode)
{
- 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) {
- HDC mem2dc;
- HBITMAP mem2bmp, oldbmp;
+ HDC mem2dc = NULL;
+ HBITMAP mem2bmp = NULL, oldbmp = NULL;
RECT wr;
IntersectRect(&wr, rClip, rFill);
if ((wr.bottom - wr.top)*(wr.right - wr.left) == 0) return 0;
@@ -675,7 +671,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
/// draw here
{
- int y = 0, sy = 0, maxy = 0;
+ int y = 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) {
@@ -766,7 +762,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
return 0;
/// draw here
{
- int x = 0, sy = 0, maxy = 0;
+ int x = 0;
{
//SetStretchBltMode(mem2dc, HALFTONE);
//StretchBlt(mem2dc, 0, 0, w,h,hSource,rGlyph->left+(wr.left-rFill->left),rGlyph->top,w,h,SRCCOPY);
@@ -833,7 +829,7 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
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 x = 0;
int h = rFill->bottom - rFill->top;
HBITMAP mem2bmp, oldbmp;
RECT wr;
@@ -1130,7 +1126,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
// Draw top side...
@@ -1148,7 +1144,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
// Draw bottom side...
if (1) {
@@ -1166,7 +1162,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
// Draw left side...
if (1) {
@@ -1184,7 +1180,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
// Draw right side...
@@ -1203,7 +1199,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
@@ -1223,7 +1219,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
// Draw Top-Right corner...
if (1) {
@@ -1241,7 +1237,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
// Draw Bottom-Left corner...
@@ -1261,7 +1257,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
// Draw Bottom-Right corner...
if (1) {
@@ -1279,7 +1275,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
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);
}
}
@@ -1410,7 +1406,7 @@ int ske_AddDescriptorToSkinObjectList(LPSKINOBJECTDESCRIPTOR lpDescr, SKINOBJECT
return 1;
}
-static LPSKINOBJECTDESCRIPTOR ske_FindObject(const char * szName, BYTE objType, SKINOBJECTSLIST* Skin)
+static LPSKINOBJECTDESCRIPTOR ske_FindObject(const char *szName, SKINOBJECTSLIST *Skin)
{
// DWORD i;
SKINOBJECTSLIST* sk;
@@ -1418,7 +1414,7 @@ static LPSKINOBJECTDESCRIPTOR ske_FindObject(const char * szName, BYTE objType,
return skin_FindObjectByRequest((char *)szName, sk->pMaskList);
}
-static LPSKINOBJECTDESCRIPTOR ske_FindObjectByMask(MODERNMASK *pModernMask, BYTE objType, SKINOBJECTSLIST* Skin)
+static LPSKINOBJECTDESCRIPTOR ske_FindObjectByMask(MODERNMASK *pModernMask, SKINOBJECTSLIST *Skin)
{
// DWORD i;
SKINOBJECTSLIST* sk;
@@ -1457,9 +1453,9 @@ INT_PTR ske_Service_DrawGlyph(WPARAM wParam, LPARAM lParam)
__try {
preq = (LPSKINDRAWREQUEST)wParam;
if (lParam)
- pgl = ske_FindObjectByMask((MODERNMASK*)lParam, OT_GLYPHOBJECT, NULL);
+ pgl = ske_FindObjectByMask((MODERNMASK*)lParam, NULL);
else
- pgl = ske_FindObject(preq->szObjectID, OT_GLYPHOBJECT, NULL);
+ pgl = ske_FindObject(preq->szObjectID, NULL);
if (pgl == NULL) return -1;
if (pgl->Data == NULL) return -1;
@@ -1691,8 +1687,8 @@ static HBITMAP ske_LoadGlyphImage_Png2Dib(const TCHAR *tszFilename)
HANDLE hFile, hMap = NULL;
BYTE* ppMap = NULL;
long cbFileSize = 0;
- BITMAPINFOHEADER* pDib;
- BYTE* pDibBits;
+ BITMAPINFOHEADER* pDib = { 0 };
+ BYTE* pDibBits = NULL;
if (!ServiceExists(MS_PNG2DIB)) {
MessageBox(NULL, TranslateT("You need an image services plugin to process PNG images."), TranslateT("Error"), MB_OK);
@@ -1747,7 +1743,6 @@ static HBITMAP ske_LoadGlyphImageByDecoders(const TCHAR *tszFileName)
HBITMAP hBitmap = NULL;
TCHAR ext[5];
BYTE f = 0;
- LPVOID pImg = NULL;
BITMAP bmpInfo;
{
@@ -1950,7 +1945,7 @@ static void RegisterMaskByParce(const char * szSetting, char * szValue, SKINOBJE
Obj = (char*)mir_alloc(i + 1);
strncpy(Obj, szValue, i);
Obj[i] = '\0';
- res = AddStrModernMaskToList(ID, Mask, Obj, pSkin->pMaskList, pSkin);
+ res = AddStrModernMaskToList(ID, Mask, Obj, pSkin->pMaskList);
mir_free(Obj);
}
}
@@ -1967,11 +1962,11 @@ static int ske_ProcessLoadindString(const char * szSetting, char *szValue)
else if (szSetting[0] == 't')
ske_AddParseTextGlyphObject((char*)szSetting, szValue, pCurrentSkin);
else if (szSetting[0] == 'f')
- ske_AddParseSkinFont((char*)szSetting, szValue, pCurrentSkin);
+ ske_AddParseSkinFont((char*)szSetting, szValue);
else return 0;
return 1;
}
-static int ske_enumdb_SkinObjectsProc(const char *szSetting, LPARAM lParam)
+static int ske_enumdb_SkinObjectsProc(const char *szSetting, LPARAM)
{
char *value;
value = db_get_sa(NULL, SKIN, szSetting);
@@ -2035,7 +2030,7 @@ static void ske_LinkSkinObjects(SKINOBJECTSLIST * pObjectList)
}
}
// Getting skin objects and masks from DB
-static int ske_GetSkinFromDB(char * szSection, SKINOBJECTSLIST * Skin)
+static int ske_GetSkinFromDB(char *, SKINOBJECTSLIST *Skin)
{
if (Skin == NULL) return 0;
ske_UnloadSkin(Skin);
@@ -2128,7 +2123,7 @@ int ske_LoadSkinFromIniFile(TCHAR *szFileName, BOOL bOnlyObjects)
return 0;
}
-static int ske_enumdb_SkinSectionDeletionProc(const char *szSetting, LPARAM lParam)
+static int ske_enumdb_SkinSectionDeletionProc(const char *szSetting, LPARAM)
{
if (szSetting == NULL)
return 0;
@@ -2168,7 +2163,6 @@ BOOL ske_TextOut(HDC hdc, int x, int y, LPCTSTR lpString, int nCount)
{
SIZE sz;
GetTextExtentPoint32(hdc, lpString, nCount, &sz);
- int ta = GetTextAlign(hdc);
RECT rc = { 0 };
SetRect(&rc, x, y, x + sz.cx, y + sz.cy);
@@ -2176,7 +2170,7 @@ BOOL ske_TextOut(HDC hdc, int x, int y, LPCTSTR lpString, int nCount)
return 1;
}
-static INT_PTR ske_Service_AlphaTextOut(WPARAM wParam, LPARAM lParam)
+static INT_PTR ske_Service_AlphaTextOut(WPARAM wParam, LPARAM)
{
if (!wParam) return 0;
@@ -2431,8 +2425,6 @@ static int ske_AlphaTextOut(HDC hDC, LPCTSTR lpString, int nCount, RECT *lpRect,
}
else pDestBits = (BYTE*)bmpDest.bmBits;
- BOOL isDest16bit = (bmpDest.bmBitsPixel) != 32;
-
// Creating offscreen buffer
HDC hOffscreenDC = CreateCompatibleDC(hDC);
@@ -2644,7 +2636,7 @@ static int ske_DrawTextWithEffectWorker(HDC hdc, LPCTSTR lpString, int nCount, R
return res;
}
-INT_PTR ske_Service_DrawTextWithEffect(WPARAM wParam, LPARAM lParam)
+INT_PTR ske_Service_DrawTextWithEffect(WPARAM wParam, LPARAM)
{
DrawTextWithEffectParam *p = (DrawTextWithEffectParam *)wParam;
if (p->cbSize != sizeof(DrawTextWithEffectParam))
@@ -2669,7 +2661,7 @@ BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT *lpRect, UINT form
return ske_AlphaTextOut(hdc, lpString, nCount, lpRect, form, color);
}
-HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i, UINT fStyle)
+HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i)
{
IMAGEINFO imi = { 0 };
BITMAP bm = { 0 };
@@ -2691,7 +2683,6 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i, UINT fStyle)
GetBitmapBits(imi.hbmImage, bm.bmWidthBytes*bm.bmHeight, bits);
}
- int wb = ((imi.rcImage.right - imi.rcImage.left)*bm.bmBitsPixel >> 3);
BYTE *bcbits = bits + (bm.bmHeight - imi.rcImage.bottom)*bm.bmWidthBytes + (imi.rcImage.left*bm.bmBitsPixel >> 3);
for (int iy = 0; iy < imi.rcImage.bottom - imi.rcImage.top; iy++) {
int x;
@@ -2727,14 +2718,6 @@ HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i, UINT fStyle)
return ImageList_GetIcon(himl, i, ILD_NORMAL);
}
-////////////////////////////////////////////////////////////////////////////
-// This creates new dib image from Imagelist icon ready to alphablend it
-
-HBITMAP ske_ExtractDIBFromImagelistIcon(HIMAGELIST himl, int index, int * outWidth, int * outHeight)
-{
- return NULL;
-}
-
BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int dx, int dy, COLORREF rgbBk, COLORREF rgbFg, UINT fStyle)
{
//the routine to directly draw icon from image list without creating icon from there - should be some faster
@@ -2749,7 +2732,7 @@ BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int
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);
if (hIcon == NULL)
return FALSE;
@@ -2758,7 +2741,7 @@ BOOL ske_ImageList_DrawEx(HIMAGELIST himl, int i, HDC hdcDst, int x, int y, int
return TRUE;
}
-static INT_PTR ske_Service_DrawIconEx(WPARAM wParam, LPARAM lParam)
+static INT_PTR ske_Service_DrawIconEx(WPARAM wParam, LPARAM)
{
DrawIconFixParam *p = (DrawIconFixParam*)wParam;
if (!p)
@@ -2775,7 +2758,7 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i
HDC imDC;
- HBITMAP oldBmp, imBmp, tBmp;
+ HBITMAP oldBmp, imBmp, tBmp = NULL;
BITMAP imbt, immaskbt;
BYTE * imbits;
BYTE * imimagbits;
@@ -2807,7 +2790,7 @@ BOOL ske_DrawIconEx(HDC hdcDst, int xLeft, int yTop, HICON hIcon, int cxWidth, i
cy = imbt.bmHeight;
if (imbt.bmBitsPixel != 32) {
- HBITMAP otBmp;
+ HBITMAP otBmp = NULL;
no32bit = TRUE;
HDC tempDC1 = CreateCompatibleDC(hdcDst);
tBmp = ske_CreateDIB32(imbt.bmWidth, imbt.bmHeight);
@@ -2946,7 +2929,7 @@ int ske_RedrawCompleteWindow()
// lParam = pointer to sPaintRequest (or NULL to redraw all)
// return 2 - already queued, data updated, 1-have been queued, 0 - failure
-static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM lParam) // Immideately recall paint routines for frame and refresh image
+static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM) // Immideately recall paint routines for frame and refresh image
{
if (MirandaLoading())
return 0;
@@ -3210,7 +3193,6 @@ int ske_BltBackImage(HWND destHWND, HDC destDC, RECT *BltClientRect)
{
POINT ptMainWnd = { 0 };
POINT ptChildWnd = { 0 };
- RECT from = { 0 };
RECT w = { 0 };
if (g_CluiData.fDisableSkinEngine) {
FillRect(destDC, BltClientRect, GetSysColorBrush(COLOR_3DFACE));
@@ -3381,7 +3363,7 @@ int ske_ValidateFrameImageProc(RECT *r) // Callin
ske_ValidateSingleFrameImage(&g_pfwFrames[i], IsForceAllPainting);
g_mutex_bLockUpdating = 1;
- ModernSkinButtonRedrawAll(0);
+ ModernSkinButtonRedrawAll();
g_mutex_bLockUpdating = 0;
if (!mutex_bLockUpdate)
ske_UpdateWindowImageRect(&wnd);
@@ -3539,9 +3521,9 @@ static TCHAR *ske_ReAppend(TCHAR *lfirst, TCHAR * lsecond, int len)
TCHAR* ske_ReplaceVar(TCHAR *var)
{
if (!var) return mir_tstrdup(_T(""));
- if (!mir_tstrcmpi(var,_T("Profile"))) {
- char buf[MAX_PATH] = {0};
- CallService(MS_DB_GETPROFILENAME,(WPARAM)MAX_PATH,(LPARAM)buf);
+ if (!mir_tstrcmpi(var, _T("Profile"))) {
+ char buf[MAX_PATH] = { 0 };
+ CallService(MS_DB_GETPROFILENAME, (WPARAM)MAX_PATH, (LPARAM)buf);
char *p = strrchr(buf, '.');
if (p) *p = 0;
@@ -3567,10 +3549,10 @@ TCHAR *ske_ParseText(TCHAR *stzText)
if (curpos < len) { //% found
if (curpos - stpos > 0)
result = ske_ReAppend(result, stzText + stpos, int(curpos - stpos));
- stpos = curpos+1;
+ stpos = curpos + 1;
curpos++;
//3 find second %
- while(curpos < len && stzText[curpos] != (TCHAR)'%')
+ while (curpos < len && stzText[curpos] != (TCHAR)'%')
curpos++;
if (curpos >= len)
break;
@@ -3601,7 +3583,7 @@ TCHAR *ske_ParseText(TCHAR *stzText)
* t[szGlyphTextID] = s[HostObjectID],[Left],[Top],[Right],[Bottom],[LTRBHV],[FontID],[Color1],[reservedforColor2],[Text]
*/
-static void ske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineString,SKINOBJECTSLIST *Skin)
+static void ske_AddParseTextGlyphObject(char * szGlyphTextID, char * szDefineString, SKINOBJECTSLIST *Skin)
{
char buf[255] = { 0 };
GetParamN(szDefineString, buf, sizeof(buf), 0, ',', TRUE);
@@ -3645,15 +3627,13 @@ static void ske_AddParseTextGlyphObject(char * szGlyphTextID,char * szDefineStri
* szGlyphTextID and Define string is:
* f[szFontID] = s[FontTypefaceName],[size],[BIU]
*/
-static void ske_AddParseSkinFont(char * szFontID, char * szDefineString, SKINOBJECTSLIST *Skin)
+static void ske_AddParseSkinFont(char * szFontID, char * szDefineString)
{
SKINFONT *sf = (SKINFONT*)mir_calloc(sizeof(SKINFONT));
if (!sf)
return;
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;
@@ -3771,7 +3751,6 @@ static DWORD ske_Blend(DWORD X1, DWORD X2, BYTE alpha)
HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
{
HBITMAP nMask;
- BITMAP bmp = { 0 };
BYTE *ptPixels;
ICONINFO iNew = { 0 };
ICONINFO iciBottom = { 0 };
@@ -3922,7 +3901,7 @@ HICON ske_CreateJoinedIcon(HICON hBottom, HICON hTop, BYTE alpha)
strcat(destination,first); \
strcat(destination,separator); \
strcat(destination,last); \
- }
+ }
#define SKINSETSECTION "SkinnedSettings"
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index 670f4914f4..8f31720e1b 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -38,14 +38,14 @@ typedef struct _SkinListData
} SkinListData;
HBITMAP hPreviewBitmap = NULL;
-HTREEITEM AddItemToTree( HWND hTree, TCHAR * folder, TCHAR * itemName, void * data );
-HTREEITEM AddSkinToListFullName( HWND hwndDlg, TCHAR * fullName );
-HTREEITEM AddSkinToList( HWND hwndDlg, TCHAR * path, TCHAR* file );
-HTREEITEM FillAvailableSkinList( HWND hwndDlg );
+HTREEITEM AddItemToTree(HWND hTree, TCHAR * itemName, void * data);
+HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR * fullName);
+HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR * path, TCHAR* file);
+HTREEITEM FillAvailableSkinList(HWND hwndDlg);
INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam);
-int SkinOptInit(WPARAM wParam, LPARAM lParam)
+int SkinOptInit(WPARAM wParam, LPARAM)
{
if (!g_CluiData.fDisableSkinEngine) {
//Tabbed settings
@@ -62,9 +62,9 @@ int SkinOptInit(WPARAM wParam, LPARAM lParam)
return 0;
}
-int ModernSkinOptInit(WPARAM wParam, LPARAM lParam)
+int ModernSkinOptInit(WPARAM wParam, LPARAM)
{
- MODERNOPTOBJECT obj = {0};
+ MODERNOPTOBJECT obj = { 0 };
obj.cbSize = sizeof(obj);
obj.dwFlags = MODEROPT_FLG_TCHAR;
obj.hIcon = LoadSkinnedIcon(SKINICON_OTHER_MIRANDA);
@@ -79,255 +79,254 @@ int ModernSkinOptInit(WPARAM wParam, LPARAM lParam)
}
INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch ( msg )
+ switch (msg)
{
case WM_DESTROY:
- {
- if ( hPreviewBitmap ) ske_UnloadGlyphImage( hPreviewBitmap );
- break;
- }
+ {
+ if (hPreviewBitmap) ske_UnloadGlyphImage(hPreviewBitmap);
+ break;
+ }
case WM_INITDIALOG:
- {
- TranslateDialogDefault(hwndDlg);
- SetDlgItemText(hwndDlg, IDC_SKINFOLDERLABEL, SkinsFolder);
- HTREEITEM it = FillAvailableSkinList(hwndDlg);
- HWND wnd = GetDlgItem(hwndDlg, IDC_TREE1);
- TreeView_SelectItem(wnd, it);
- }
- return 0;
+ {
+ TranslateDialogDefault(hwndDlg);
+ SetDlgItemText(hwndDlg, IDC_SKINFOLDERLABEL, SkinsFolder);
+ HTREEITEM it = FillAvailableSkinList(hwndDlg);
+ HWND wnd = GetDlgItem(hwndDlg, IDC_TREE1);
+ TreeView_SelectItem(wnd, it);
+ }
+ return 0;
case WM_COMMAND:
+ {
+ switch (LOWORD(wParam)) {
+ case IDC_COLOUR_MENUNORMAL:
+ case IDC_COLOUR_MENUSELECTED:
+ case IDC_COLOUR_FRAMES:
+ case IDC_COLOUR_STATUSBAR:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case IDC_BUTTON_INFO:
{
- int isLoad = 0;
- switch ( LOWORD(wParam )) {
- case IDC_COLOUR_MENUNORMAL:
- case IDC_COLOUR_MENUSELECTED:
- case IDC_COLOUR_FRAMES:
- case IDC_COLOUR_STATUSBAR:
- SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
- break;
-
- case IDC_BUTTON_INFO:
+ TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
+ SkinListData *sd = NULL;
+ HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1));
+ if (hti == 0) return 0;
+ {
+ TVITEM tvi = { 0 };
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi);
+ sd = (SkinListData*)(tvi.lParam);
+ }
+ if (!sd) return 0;
+ if (sd->File && !_tcschr(sd->File, _T('%')))
+ {
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File);
+ mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
+ sd->Name, Description, Author, Contact, URL, sd->File);
+ }
+ else
+ {
+ mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
+ TranslateT("reVista for Modern v0.5"),
+ TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
+ TranslateT("Angeli-Ka (graphics), FYR (template)"),
+ _T("JID: fyr@jabber.ru"),
+ _T("fyr.mirandaim.ru"),
+ TranslateT("Inside library"));
+ }
+ MessageBox(hwndDlg, text, TranslateT("Skin information"), MB_OK | MB_ICONINFORMATION);
+ }
+ break;
+ case IDC_BUTTON_APPLY_SKIN:
+ if (HIWORD(wParam) == BN_CLICKED)
+ {
+ SkinListData *sd = NULL;
+ HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1));
+ if (hti == 0) return 0;
{
- TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
- SkinListData *sd = NULL;
- HTREEITEM hti = TreeView_GetSelection( GetDlgItem( hwndDlg, IDC_TREE1 ));
- if ( hti == 0 ) return 0;
- {
- TVITEM tvi = {0};
- tvi.hItem = hti;
- tvi.mask = TVIF_HANDLE|TVIF_PARAM;
- TreeView_GetItem( GetDlgItem( hwndDlg, IDC_TREE1 ), &tvi );
- sd = ( SkinListData* )( tvi.lParam);
- }
- if (!sd ) return 0;
- if ( sd->File && !_tcschr( sd->File, _T('%')))
- {
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF( Author ), sd->File );
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF( URL ), sd->File );
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF( Contact ), sd->File );
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF( Description ), sd->File );
- mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s):\t %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
- sd->Name, Description, Author, Contact, URL, sd->File);
- }
- else
- {
- mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAuthor(s): %s\nContact:\t %s\nWeb:\t %s\n\nFile:\t %s"),
- TranslateT("reVista for Modern v0.5"),
- TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
- TranslateT("Angeli-Ka (graphics), FYR (template)"),
- _T("JID: fyr@jabber.ru"),
- _T("fyr.mirandaim.ru"),
- TranslateT("Inside library"));
- }
- MessageBox( hwndDlg, text, TranslateT("Skin information"), MB_OK|MB_ICONINFORMATION );
+ TVITEM tvi = { 0 };
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi);
+ sd = (SkinListData*)(tvi.lParam);
}
- break;
- case IDC_BUTTON_APPLY_SKIN:
- if ( HIWORD(wParam ) == BN_CLICKED )
+ if (!sd) return 0;
+ ske_LoadSkinFromIniFile(sd->File, FALSE);
+ ske_LoadSkinFromDB();
+ pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0);
+ Sync(CLUIFrames_OnClistResize_mod, 0, 0);
+ ske_RedrawCompleteWindow();
+ Sync(CLUIFrames_OnClistResize_mod, 0, 0);
{
- SkinListData *sd = NULL;
- HTREEITEM hti = TreeView_GetSelection( GetDlgItem( hwndDlg, IDC_TREE1 ));
- if ( hti == 0 ) return 0;
- {
- TVITEM tvi = {0};
- tvi.hItem = hti;
- tvi.mask = TVIF_HANDLE|TVIF_PARAM;
- TreeView_GetItem( GetDlgItem( hwndDlg, IDC_TREE1 ), &tvi );
- sd = ( SkinListData* )( tvi.lParam);
- }
- if (!sd ) return 0;
- ske_LoadSkinFromIniFile( sd->File, FALSE );
- ske_LoadSkinFromDB();
- pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0 );
- Sync( CLUIFrames_OnClistResize_mod, 0, 0 );
- ske_RedrawCompleteWindow( );
- Sync( CLUIFrames_OnClistResize_mod, 0, 0 );
- {
- HWND hwnd = pcli->hwndContactList;
- RECT rc = {0};
- GetWindowRect( hwnd, &rc );
- Sync( CLUIFrames_OnMoving, hwnd, &rc );
- }
- if ( g_hCLUIOptionsWnd )
- {
- SendDlgItemMessage( g_hCLUIOptionsWnd, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, db_get_b( NULL, "CLUI", "LeftClientMargin", SETTING_LEFTCLIENTMARIGN_DEFAULT ));
- SendDlgItemMessage( g_hCLUIOptionsWnd, IDC_RIGHTMARGINSPIN, UDM_SETPOS, 0, db_get_b( NULL, "CLUI", "RightClientMargin", SETTING_RIGHTCLIENTMARIGN_DEFAULT ));
- SendDlgItemMessage( g_hCLUIOptionsWnd, IDC_TOPMARGINSPIN, UDM_SETPOS, 0, db_get_b( NULL, "CLUI", "TopClientMargin", SETTING_TOPCLIENTMARIGN_DEFAULT ));
- SendDlgItemMessage( g_hCLUIOptionsWnd, IDC_BOTTOMMARGINSPIN, UDM_SETPOS, 0, db_get_b( NULL, "CLUI", "BottomClientMargin", SETTING_BOTTOMCLIENTMARIGN_DEFAULT ));
- }
+ HWND hwnd = pcli->hwndContactList;
+ RECT rc = { 0 };
+ GetWindowRect(hwnd, &rc);
+ Sync(CLUIFrames_OnMoving, hwnd, &rc);
}
- break;
- case IDC_BUTTON_RESCAN:
- if (HIWORD(wParam ) == BN_CLICKED)
+ if (g_hCLUIOptionsWnd)
{
- HTREEITEM it = FillAvailableSkinList(hwndDlg);
- HWND wnd = GetDlgItem(hwndDlg, IDC_TREE1);
- TreeView_SelectItem(wnd, it);
+ SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "LeftClientMargin", SETTING_LEFTCLIENTMARIGN_DEFAULT));
+ SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_RIGHTMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "RightClientMargin", SETTING_RIGHTCLIENTMARIGN_DEFAULT));
+ SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_TOPMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "TopClientMargin", SETTING_TOPCLIENTMARIGN_DEFAULT));
+ SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_BOTTOMMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "BottomClientMargin", SETTING_BOTTOMCLIENTMARIGN_DEFAULT));
}
}
break;
+ case IDC_BUTTON_RESCAN:
+ if (HIWORD(wParam) == BN_CLICKED)
+ {
+ HTREEITEM it = FillAvailableSkinList(hwndDlg);
+ HWND wnd = GetDlgItem(hwndDlg, IDC_TREE1);
+ TreeView_SelectItem(wnd, it);
+ }
}
+ break;
+ }
case WM_DRAWITEM:
- if ( wParam == IDC_PREVIEW )
+ if (wParam == IDC_PREVIEW)
{
//TODO:Draw hPreviewBitmap here
int mWidth, mHeight;
- HBRUSH hbr = CreateSolidBrush( GetSysColor( COLOR_3DFACE ));
- DRAWITEMSTRUCT *dis = ( DRAWITEMSTRUCT * )lParam;
- mWidth = dis->rcItem.right-dis->rcItem.left;
- mHeight = dis->rcItem.bottom-dis->rcItem.top;
- HDC memDC = CreateCompatibleDC( dis->hDC );
- HBITMAP hbmp = ske_CreateDIB32( mWidth, mHeight );
- HBITMAP holdbmp = ( HBITMAP )SelectObject( memDC, hbmp );
+ HBRUSH hbr = CreateSolidBrush(GetSysColor(COLOR_3DFACE));
+ DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
+ mWidth = dis->rcItem.right - dis->rcItem.left;
+ mHeight = dis->rcItem.bottom - dis->rcItem.top;
+ HDC memDC = CreateCompatibleDC(dis->hDC);
+ HBITMAP hbmp = ske_CreateDIB32(mWidth, mHeight);
+ HBITMAP holdbmp = (HBITMAP)SelectObject(memDC, hbmp);
RECT workRect = dis->rcItem;
- OffsetRect( &workRect, -workRect.left, -workRect.top );
- FillRect( memDC, &workRect, hbr );
- DeleteObject( hbr );
- if ( hPreviewBitmap )
+ OffsetRect(&workRect, -workRect.left, -workRect.top);
+ FillRect(memDC, &workRect, hbr);
+ DeleteObject(hbr);
+ if (hPreviewBitmap)
{
//variables
- BITMAP bmp = {0};
- POINT imgPos = {0};
+ BITMAP bmp = { 0 };
+ POINT imgPos = { 0 };
float xScale = 1, yScale = 1;
//GetSize
- GetObject( hPreviewBitmap, sizeof( BITMAP ), &bmp );
- int wWidth = workRect.right-workRect.left;
- int wHeight = workRect.bottom-workRect.top;
- if ( wWidth < bmp.bmWidth ) xScale = ( float )wWidth/bmp.bmWidth;
- if ( wHeight < bmp.bmHeight ) yScale = ( float )wHeight/bmp.bmHeight;
- xScale = min( xScale, yScale );
+ GetObject(hPreviewBitmap, sizeof(BITMAP), &bmp);
+ int wWidth = workRect.right - workRect.left;
+ int wHeight = workRect.bottom - workRect.top;
+ if (wWidth < bmp.bmWidth) xScale = (float)wWidth / bmp.bmWidth;
+ if (wHeight < bmp.bmHeight) yScale = (float)wHeight / bmp.bmHeight;
+ xScale = min(xScale, yScale);
yScale = xScale;
- int dWidth = ( int )( xScale*bmp.bmWidth );
- int dHeight = ( int )( yScale*bmp.bmHeight );
+ int dWidth = (int)(xScale*bmp.bmWidth);
+ int dHeight = (int)(yScale*bmp.bmHeight);
//CalcPosition
- imgPos.x = workRect.left+(( wWidth-dWidth )>>1 );
- imgPos.y = workRect.top+(( wHeight-dHeight )>>1 );
+ imgPos.x = workRect.left + ((wWidth - dWidth) >> 1);
+ imgPos.y = workRect.top + ((wHeight - dHeight) >> 1);
//DrawImage
- DrawAvatarImageWithGDIp( memDC, imgPos.x, imgPos.y, dWidth, dHeight, hPreviewBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, 8, 255 );
+ DrawAvatarImageWithGDIp(memDC, imgPos.x, imgPos.y, dWidth, dHeight, hPreviewBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, 8, 255);
}
- BitBlt( dis->hDC, dis->rcItem.left, dis->rcItem.top, mWidth, mHeight, memDC, 0, 0, SRCCOPY );
- SelectObject( memDC, holdbmp );
- DeleteObject( hbmp );
- DeleteDC( memDC );
+ BitBlt(dis->hDC, dis->rcItem.left, dis->rcItem.top, mWidth, mHeight, memDC, 0, 0, SRCCOPY);
+ SelectObject(memDC, holdbmp);
+ DeleteObject(hbmp);
+ DeleteDC(memDC);
}
break;
case WM_NOTIFY:
- switch (( ( LPNMHDR )lParam)->idFrom ) {
+ switch (((LPNMHDR)lParam)->idFrom) {
case IDC_TREE1:
- {
- NMTREEVIEW * nmtv = ( NMTREEVIEW * ) lParam;
- if (nmtv == NULL)
- return 0;
-
- if (nmtv->hdr.code == TVN_SELCHANGEDA || nmtv->hdr.code == TVN_SELCHANGEDW) {
- SkinListData * sd = NULL;
- if (hPreviewBitmap) {
- ske_UnloadGlyphImage( hPreviewBitmap );
- hPreviewBitmap = NULL;
- }
+ {
+ NMTREEVIEW * nmtv = (NMTREEVIEW *)lParam;
+ if (nmtv == NULL)
+ return 0;
+
+ if (nmtv->hdr.code == TVN_SELCHANGEDA || nmtv->hdr.code == TVN_SELCHANGEDW) {
+ SkinListData * sd = NULL;
+ if (hPreviewBitmap) {
+ ske_UnloadGlyphImage(hPreviewBitmap);
+ hPreviewBitmap = NULL;
+ }
- if (nmtv->itemNew.lParam) {
- sd = ( SkinListData* )nmtv->itemNew.lParam;
-
- TCHAR buf[MAX_PATH];
- PathToRelativeT(sd->File, buf);
- SetDlgItemText(hwndDlg,IDC_EDIT_SKIN_FILENAME,buf);
-
- TCHAR prfn[MAX_PATH] = {0}, imfn[MAX_PATH] = {0}, skinfolder[MAX_PATH] = {0};
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF( imfn ), sd->File );
- IniParser::GetSkinFolder( sd->File, skinfolder );
- mir_sntprintf(prfn, SIZEOF(prfn), _T("%s\\%s"), skinfolder, imfn);
- PathToAbsoluteT(prfn, imfn);
- hPreviewBitmap = ske_LoadGlyphImage(imfn);
-
- EnableWindow( GetDlgItem( hwndDlg, IDC_BUTTON_APPLY_SKIN ), TRUE );
- EnableWindow( GetDlgItem( hwndDlg, IDC_BUTTON_INFO ), TRUE );
- if ( hPreviewBitmap )
- InvalidateRect( GetDlgItem( hwndDlg, IDC_PREVIEW ), NULL, TRUE );
- else { //prepare text
- TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
- SkinListData* sd = NULL;
- HTREEITEM hti = TreeView_GetSelection( GetDlgItem( hwndDlg, IDC_TREE1 ));
- if ( hti == 0 ) return 0;
- {
- TVITEM tvi = {0};
- tvi.hItem = hti;
- tvi.mask = TVIF_HANDLE|TVIF_PARAM;
- TreeView_GetItem( GetDlgItem( hwndDlg, IDC_TREE1 ), &tvi );
- sd = ( SkinListData* )( tvi.lParam);
- }
- if (!sd ) return 0;
-
- if ( sd->File && !_tcschr( sd->File, _T('%')))
- {
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF( Author ), sd->File );
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF( URL ), sd->File );
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF( Contact ), sd->File );
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF( Description ), sd->File );
- mir_sntprintf(text, SIZEOF(text), TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"),
- sd->Name, Description, Author, Contact, URL);
- }
- else
- {
- mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"),
- TranslateT("reVista for Modern v0.5"),
- TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
- TranslateT("graphics by Angeli-Ka\ntemplate by FYR"),
- _T("JID: fyr@jabber.ru"),
- _T("fyr.mirandaim.ru"));
- }
- ShowWindow( GetDlgItem( hwndDlg, IDC_PREVIEW ), SW_HIDE );
- ShowWindow( GetDlgItem( hwndDlg, IDC_STATIC_INFO ), SW_SHOW );
- SetDlgItemText(hwndDlg, IDC_STATIC_INFO, text);
+ if (nmtv->itemNew.lParam) {
+ sd = (SkinListData*)nmtv->itemNew.lParam;
+
+ TCHAR buf[MAX_PATH];
+ PathToRelativeT(sd->File, buf);
+ SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, buf);
+
+ TCHAR prfn[MAX_PATH] = { 0 }, imfn[MAX_PATH] = { 0 }, skinfolder[MAX_PATH] = { 0 };
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF(imfn), sd->File);
+ IniParser::GetSkinFolder(sd->File, skinfolder);
+ mir_sntprintf(prfn, SIZEOF(prfn), _T("%s\\%s"), skinfolder, imfn);
+ PathToAbsoluteT(prfn, imfn);
+ hPreviewBitmap = ske_LoadGlyphImage(imfn);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), TRUE);
+ if (hPreviewBitmap)
+ InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEW), NULL, TRUE);
+ else { //prepare text
+ TCHAR Author[255], URL[MAX_PATH], Contact[255], Description[400], text[2000];
+ SkinListData* sd = NULL;
+ HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1));
+ if (hti == 0) return 0;
+ {
+ TVITEM tvi = { 0 };
+ tvi.hItem = hti;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi);
+ sd = (SkinListData*)(tvi.lParam);
}
+ if (!sd) return 0;
+
+ if (sd->File && !_tcschr(sd->File, _T('%')))
+ {
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, SIZEOF(Author), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, SIZEOF(URL), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, SIZEOF(Contact), sd->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, SIZEOF(Description), sd->File);
+ mir_sntprintf(text, SIZEOF(text), TranslateT("Preview is not available\n\n%s\n----------------------\n\n%s\n\nAUTHOR(S):\n%s\n\nCONTACT:\n%s\n\nHOMEPAGE:\n%s"),
+ sd->Name, Description, Author, Contact, URL);
+ }
+ else
+ {
+ mir_sntprintf(text, SIZEOF(text), TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"),
+ TranslateT("reVista for Modern v0.5"),
+ TranslateT("This is second default Modern Contact list skin in Vista Aero style"),
+ TranslateT("graphics by Angeli-Ka\ntemplate by FYR"),
+ _T("JID: fyr@jabber.ru"),
+ _T("fyr.mirandaim.ru"));
+ }
+ ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_STATIC_INFO), SW_SHOW);
+ SetDlgItemText(hwndDlg, IDC_STATIC_INFO, text);
}
- else {
- //no selected
- SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, TranslateT("Select skin from list"));
- EnableWindow( GetDlgItem( hwndDlg, IDC_BUTTON_APPLY_SKIN ), FALSE );
- EnableWindow( GetDlgItem( hwndDlg, IDC_BUTTON_INFO ), FALSE );
- SetDlgItemText(hwndDlg, IDC_STATIC_INFO, TranslateT("Please select skin to apply"));
- ShowWindow( GetDlgItem( hwndDlg, IDC_PREVIEW ), SW_HIDE );
- }
- ShowWindow( GetDlgItem( hwndDlg, IDC_PREVIEW ), hPreviewBitmap?SW_SHOW:SW_HIDE );
- return 0;
}
- else if (nmtv->hdr.code == TVN_DELETEITEMA || nmtv->hdr.code == TVN_DELETEITEMW) {
- mir_free_and_nil( nmtv->itemOld.lParam);
- return 0;
+ else {
+ //no selected
+ SetDlgItemText(hwndDlg, IDC_EDIT_SKIN_FILENAME, TranslateT("Select skin from list"));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_APPLY_SKIN), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BUTTON_INFO), FALSE);
+ SetDlgItemText(hwndDlg, IDC_STATIC_INFO, TranslateT("Please select skin to apply"));
+ ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), SW_HIDE);
}
+ ShowWindow(GetDlgItem(hwndDlg, IDC_PREVIEW), hPreviewBitmap ? SW_SHOW : SW_HIDE);
+ return 0;
}
- break;
+ else if (nmtv->hdr.code == TVN_DELETEITEMA || nmtv->hdr.code == TVN_DELETEITEMW) {
+ mir_free_and_nil(nmtv->itemOld.lParam);
+ return 0;
+ }
+ }
+ break;
case 0:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0 );
- NotifyEventHooks( g_CluiData.hEventBkgrChanged, 0, 0 );
- pcli->pfnClcBroadcast(INTM_INVALIDATE, 0, 0 );
- RedrawWindow( GetParent( pcli->hwndContactTree ), NULL, NULL, RDW_INVALIDATE|RDW_FRAME|RDW_ALLCHILDREN );
+ pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0);
+ NotifyEventHooks(g_CluiData.hEventBkgrChanged, 0, 0);
+ pcli->pfnClcBroadcast(INTM_INVALIDATE, 0, 0);
+ RedrawWindow(GetParent(pcli->hwndContactTree), NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);
}
break;
}
@@ -335,41 +334,39 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
return 0;
}
-int SearchSkinFiles( HWND hwndDlg, TCHAR * Folder )
+int SearchSkinFiles(HWND hwndDlg, TCHAR * Folder)
{
- struct _tfinddata_t fd = {0};
+ struct _tfinddata_t fd = { 0 };
TCHAR mask[MAX_PATH];
long hFile;
mir_sntprintf(mask, SIZEOF(mask), _T("%s\\*.msf"), Folder);
//fd.attrib = _A_SUBDIR;
- hFile = _tfindfirst( mask, &fd );
- if ( hFile != -1 )
+ hFile = _tfindfirst(mask, &fd);
+ if (hFile != -1)
{
do {
- AddSkinToList( hwndDlg, Folder, fd.name );
- }
- while (!_tfindnext( hFile, &fd ));
- _findclose( hFile );
+ AddSkinToList(hwndDlg, Folder, fd.name);
+ } while (!_tfindnext(hFile, &fd));
+ _findclose(hFile);
}
mir_sntprintf(mask, SIZEOF(mask), _T("%s\\*"), Folder);
- hFile = _tfindfirst( mask, &fd );
+ 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];
mir_sntprintf(path, SIZEOF(path), _T("%s\\%s"), Folder, fd.name);
- SearchSkinFiles( hwndDlg, path );
+ SearchSkinFiles(hwndDlg, path);
}
- }while (!_tfindnext( hFile, &fd ));
- _findclose( hFile );
+ } while (!_tfindnext(hFile, &fd));
+ _findclose(hFile);
}
return 0;
}
HTREEITEM FillAvailableSkinList(HWND hwndDlg)
{
- struct _finddata_t fd = {0};
//long hFile;
HTREEITEM res = (HTREEITEM)-1;
int attrib;
@@ -381,7 +378,7 @@ HTREEITEM FillAvailableSkinList(HWND hwndDlg)
SearchSkinFiles(hwndDlg, SkinsFolder);
{
TCHAR skinfull[MAX_PATH];
- ptrT skinfile( db_get_tsa( NULL, SKIN, "SkinFile"));
+ ptrT skinfile(db_get_tsa(NULL, SKIN, "SkinFile"));
if (skinfile) {
PathToAbsoluteT(skinfile, skinfull);
res = AddSkinToListFullName(hwndDlg, skinfull);
@@ -389,77 +386,77 @@ HTREEITEM FillAvailableSkinList(HWND hwndDlg)
}
return res;
}
-HTREEITEM AddSkinToListFullName( HWND hwndDlg, TCHAR * fullName )
+HTREEITEM AddSkinToListFullName(HWND hwndDlg, TCHAR * fullName)
{
- TCHAR path[MAX_PATH] = {0};
- TCHAR file[MAX_PATH] = {0};
+ TCHAR path[MAX_PATH] = { 0 };
+ TCHAR file[MAX_PATH] = { 0 };
TCHAR *buf;
- _tcsncpy( path, fullName, SIZEOF( path ));
- buf = path + _tcslen( path );
- while ( buf > path )
+ _tcsncpy(path, fullName, SIZEOF(path));
+ buf = path + _tcslen(path);
+ while (buf > path)
{
- if ( *buf == _T( '\\' ))
+ if (*buf == _T('\\'))
{
- *buf = _T( '\0' );
+ *buf = _T('\0');
break;
}
buf--;
}
buf++;
- _tcsncpy( file, buf, SIZEOF( file ));
- return AddSkinToList( hwndDlg, path, file );
+ _tcsncpy(file, buf, SIZEOF(file));
+ return AddSkinToList(hwndDlg, path, file);
}
-HTREEITEM AddSkinToList( HWND hwndDlg, TCHAR * path, TCHAR* file )
+HTREEITEM AddSkinToList(HWND hwndDlg, TCHAR * path, TCHAR* file)
{
TCHAR fullName[MAX_PATH], defskinname[MAX_PATH];
- SkinListData *sd = ( SkinListData * )mir_alloc( sizeof( SkinListData ));
- if (!sd )
+ SkinListData *sd = (SkinListData *)mir_alloc(sizeof(SkinListData));
+ if (!sd)
return 0;
- if (!file || _tcschr( file, _T('%'))) {
+ if (!file || _tcschr(file, _T('%'))) {
mir_sntprintf(sd->File, SIZEOF(sd->File), _T("%%Default Skin%%"));
mir_sntprintf(sd->Name, SIZEOF(sd->Name), TranslateT("%Default Skin%"));
_tcsncpy(fullName, TranslateT("Default Skin"), SIZEOF(fullName));
}
else {
mir_sntprintf(fullName, SIZEOF(fullName), _T("%s\\%s"), path, file);
- memcpy(defskinname, file, (_tcslen( file )-4) * sizeof(TCHAR));
- defskinname[_tcslen( file )+1] = _T('\0');
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Name"), defskinname, sd->Name, SIZEOF( sd->Name ), fullName );
+ memcpy(defskinname, file, (_tcslen(file) - 4) * sizeof(TCHAR));
+ defskinname[_tcslen(file) + 1] = _T('\0');
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Name"), defskinname, sd->Name, SIZEOF(sd->Name), fullName);
_tcscpy(sd->File, fullName);
}
- return AddItemToTree( GetDlgItem( hwndDlg, IDC_TREE1 ), fullName, sd->Name, sd );
+ return AddItemToTree(GetDlgItem(hwndDlg, IDC_TREE1), sd->Name, sd);
}
-HTREEITEM FindChild( HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data )
+HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data)
{
- HTREEITEM res = NULL, tmp = NULL;
- if ( Parent )
- tmp = TreeView_GetChild( hTree, Parent );
+ HTREEITEM tmp = NULL;
+ if (Parent)
+ tmp = TreeView_GetChild(hTree, Parent);
else
- tmp = TreeView_GetRoot( hTree );
+ tmp = TreeView_GetRoot(hTree);
while (tmp) {
TVITEM tvi;
TCHAR buf[255];
tvi.hItem = tmp;
- tvi.mask = TVIF_TEXT|TVIF_HANDLE;
+ tvi.mask = TVIF_TEXT | TVIF_HANDLE;
tvi.pszText = buf;
tvi.cchTextMax = SIZEOF(buf);
- TreeView_GetItem( hTree, &tvi );
- if ( _tcsicmp(Caption, tvi.pszText) == 0) {
+ TreeView_GetItem(hTree, &tvi);
+ if (_tcsicmp(Caption, tvi.pszText) == 0) {
if (!data)
return tmp;
- TVITEM tvi = {0};
+ TVITEM tvi = { 0 };
tvi.hItem = tmp;
- tvi.mask = TVIF_HANDLE|TVIF_PARAM;
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(hTree, &tvi);
SkinListData *sd = (SkinListData*)tvi.lParam;
if (sd)
- if (!_tcsicmp(sd->File, (( SkinListData* )data )->File))
+ if (!_tcsicmp(sd->File, ((SkinListData*)data)->File))
return tmp;
}
tmp = TreeView_GetNextSibling(hTree, tmp);
@@ -467,13 +464,13 @@ HTREEITEM FindChild( HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data
return tmp;
}
-HTREEITEM AddItemToTree(HWND hTree, TCHAR *folder, TCHAR *itemName, void *data)
+HTREEITEM AddItemToTree(HWND hTree, TCHAR *itemName, void *data)
{
HTREEITEM cItem = NULL;
//Insert item node
- cItem = FindChild( hTree, 0, itemName, data );
+ cItem = FindChild(hTree, 0, itemName, data);
if (!cItem) {
- TVINSERTSTRUCT tvis = {0};
+ TVINSERTSTRUCT tvis = { 0 };
tvis.hInsertAfter = TVI_SORT;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_PARAM;
tvis.item.pszText = itemName;
@@ -485,9 +482,9 @@ HTREEITEM AddItemToTree(HWND hTree, TCHAR *folder, TCHAR *itemName, void *data)
return cItem;
}
-INT_PTR SvcActiveSkin(WPARAM wParam, LPARAM lParam)
+INT_PTR SvcActiveSkin(WPARAM, LPARAM)
{
- ptrT skinfile( db_get_tsa(NULL, SKIN, "SkinFile"));
+ ptrT skinfile(db_get_tsa(NULL, SKIN, "SkinFile"));
if (skinfile) {
TCHAR skinfull[MAX_PATH];
PathToAbsoluteT(skinfile, skinfull);
@@ -497,69 +494,67 @@ INT_PTR SvcActiveSkin(WPARAM wParam, LPARAM lParam)
return NULL;
}
-INT_PTR SvcApplySkin(WPARAM wParam, LPARAM lParam)
+INT_PTR SvcApplySkin(WPARAM, LPARAM lParam)
{
ske_LoadSkinFromIniFile((TCHAR *)lParam, FALSE);
- ske_LoadSkinFromDB( );
- pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0 );
- Sync( CLUIFrames_OnClistResize_mod, 0, 0 );
- ske_RedrawCompleteWindow( );
- Sync( CLUIFrames_OnClistResize_mod, 0, 0 );
+ ske_LoadSkinFromDB();
+ pcli->pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0);
+ Sync(CLUIFrames_OnClistResize_mod, 0, 0);
+ ske_RedrawCompleteWindow();
+ Sync(CLUIFrames_OnClistResize_mod, 0, 0);
HWND hwnd = pcli->hwndContactList;
- RECT rc = {0};
- GetWindowRect( hwnd, &rc );
- Sync( CLUIFrames_OnMoving, hwnd, &rc );
+ RECT rc = { 0 };
+ GetWindowRect(hwnd, &rc);
+ Sync(CLUIFrames_OnMoving, hwnd, &rc);
if (g_hCLUIOptionsWnd) {
- SendDlgItemMessage( g_hCLUIOptionsWnd, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, db_get_b( NULL, "CLUI", "LeftClientMargin", SETTING_LEFTCLIENTMARIGN_DEFAULT ));
- SendDlgItemMessage( g_hCLUIOptionsWnd, IDC_RIGHTMARGINSPIN, UDM_SETPOS, 0, db_get_b( NULL, "CLUI", "RightClientMargin", SETTING_RIGHTCLIENTMARIGN_DEFAULT ));
- SendDlgItemMessage( g_hCLUIOptionsWnd, IDC_TOPMARGINSPIN, UDM_SETPOS, 0, db_get_b( NULL, "CLUI", "TopClientMargin", SETTING_TOPCLIENTMARIGN_DEFAULT ));
- SendDlgItemMessage( g_hCLUIOptionsWnd, IDC_BOTTOMMARGINSPIN, UDM_SETPOS, 0, db_get_b( NULL, "CLUI", "BottomClientMargin", SETTING_BOTTOMCLIENTMARIGN_DEFAULT ));
+ SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "LeftClientMargin", SETTING_LEFTCLIENTMARIGN_DEFAULT));
+ SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_RIGHTMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "RightClientMargin", SETTING_RIGHTCLIENTMARIGN_DEFAULT));
+ SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_TOPMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "TopClientMargin", SETTING_TOPCLIENTMARIGN_DEFAULT));
+ SendDlgItemMessage(g_hCLUIOptionsWnd, IDC_BOTTOMMARGINSPIN, UDM_SETPOS, 0, db_get_b(NULL, "CLUI", "BottomClientMargin", SETTING_BOTTOMCLIENTMARIGN_DEFAULT));
}
return 0;
}
INT_PTR SvcPreviewSkin(WPARAM wParam, LPARAM lParam)
{
- DRAWITEMSTRUCT *dis = ( DRAWITEMSTRUCT * )wParam;
- int mWidth = dis->rcItem.right-dis->rcItem.left;
- int mHeight = dis->rcItem.bottom-dis->rcItem.top;
+ DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)wParam;
RECT workRect = dis->rcItem;
- OffsetRect( &workRect, -workRect.left, -workRect.top );
+ OffsetRect(&workRect, -workRect.left, -workRect.top);
if (lParam) {
- TCHAR prfn[MAX_PATH] = {0};
- TCHAR imfn[MAX_PATH] = {0};
- TCHAR skinfolder[MAX_PATH] = {0};
- GetPrivateProfileString( _T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF( imfn ), (LPCTSTR)lParam);
- IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder );
+ TCHAR prfn[MAX_PATH] = { 0 };
+ TCHAR imfn[MAX_PATH] = { 0 };
+ TCHAR skinfolder[MAX_PATH] = { 0 };
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Preview"), _T(""), imfn, SIZEOF(imfn), (LPCTSTR)lParam);
+ IniParser::GetSkinFolder((LPCTSTR)lParam, skinfolder);
mir_sntprintf(prfn, SIZEOF(prfn), _T("%s\\%s"), skinfolder, imfn);
PathToAbsoluteT(prfn, imfn);
hPreviewBitmap = ske_LoadGlyphImage(imfn);
if (hPreviewBitmap) {
//variables
- BITMAP bmp = {0};
- POINT imgPos = {0};
+ BITMAP bmp = { 0 };
+ POINT imgPos = { 0 };
int wWidth, wHeight;
int dWidth, dHeight;
float xScale = 1, yScale = 1;
//GetSize
- 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;
- xScale = min( xScale, yScale );
+ 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;
+ xScale = min(xScale, yScale);
yScale = xScale;
- dWidth = ( int )( xScale*bmp.bmWidth );
- dHeight = ( int )( yScale*bmp.bmHeight );
+ dWidth = (int)(xScale*bmp.bmWidth);
+ dHeight = (int)(yScale*bmp.bmHeight);
//CalcPosition
- imgPos.x = workRect.left+(( wWidth-dWidth )>>1 );
- imgPos.y = workRect.top+(( wHeight-dHeight )>>1 );
+ imgPos.x = workRect.left + ((wWidth - dWidth) >> 1);
+ imgPos.y = workRect.top + ((wHeight - dHeight) >> 1);
//DrawImage
- DrawAvatarImageWithGDIp( dis->hDC, imgPos.x, imgPos.y, dWidth, dHeight, hPreviewBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, 8, 255 );
+ DrawAvatarImageWithGDIp(dis->hDC, imgPos.x, imgPos.y, dWidth, dHeight, hPreviewBitmap, 0, 0, bmp.bmWidth, bmp.bmHeight, 8, 255);
ske_UnloadGlyphImage(hPreviewBitmap);
}
}
diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp
index c2c6f1320a..0d0fdba17a 100644
--- a/plugins/Clist_modern/src/modern_skinselector.cpp
+++ b/plugins/Clist_modern/src/modern_skinselector.cpp
@@ -35,8 +35,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
/// 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)
{
@@ -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++)
{
free(mm->pl_Params[i].szName);
free(mm->pl_Params[i].szValue);
@@ -67,18 +67,18 @@ int SkinSelector_DeleteMask(MODERNMASK *mm)
BOOL MatchMask(char * name, char * mask)
{
if (!mask || !name) return mask == name;
- if (*mask != '|') return wildcmpi(name,mask);
+ if (*mask != '|') return wildcmpi(name, mask);
{
- int s = 1,e = 1;
+ int s = 1, e = 1;
char * temp;
while (mask[e] != '\0')
{
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';
- if (wildcmpi(name,temp))
+ while (mask[e] != '\0' && mask[e] != '|') e++;
+ temp = (char*)malloc(e - s + 1);
+ memcpy(temp, mask + s, e - s);
+ temp[e - s] = '\0';
+ if (wildcmpi(name, temp))
{
free(temp);
return TRUE;
@@ -98,46 +98,46 @@ BOOL MatchMask(char * name, char * mask)
DWORD mod_CalcHash(const char *szStr)
{
#if defined _M_IX86 && !defined _NUMEGA_BC_FINALCHECK && !defined NOINLINEASM
- __asm { //this breaks if szStr is empty
- xor edx,edx
- xor eax,eax
- mov esi,szStr
- mov al,[esi]
- xor cl,cl
-lph_top: //only 4 of 9 instructions in here don't use AL, so optimal pipe use is impossible
- xor edx,eax
- inc esi
- xor eax,eax
- and cl,31
- mov al,[esi]
- add cl,5
- test al,al
- rol eax,cl //rol is u-pipe only, but pairable
- //rol doesn't touch z-flag
- jnz lph_top //5 clock tick loop. not bad.
-
- xor eax,edx
- }
+ __asm { //this breaks if szStr is empty
+ xor edx, edx
+ xor eax, eax
+ mov esi, szStr
+ mov al, [esi]
+ xor cl, cl
+ lph_top : //only 4 of 9 instructions in here don't use AL, so optimal pipe use is impossible
+ xor edx, eax
+ inc esi
+ xor eax, eax
+ and cl, 31
+ mov al, [esi]
+ add cl, 5
+ test al, al
+ rol eax, cl //rol is u-pipe only, but pairable
+ //rol doesn't touch z-flag
+ jnz lph_top //5 clock tick loop. not bad.
+
+ xor eax, edx
+ }
#else
- 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;
- }
- return hash;
+ 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;
+ }
+ return hash;
#endif
}
-int AddModernMaskToList(MODERNMASK *mm, LISTMODERNMASK * mmTemplateList)
+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));
- memmove(&(mmTemplateList->pl_Masks[mmTemplateList->dwMaskCnt]),mm,sizeof(MODERNMASK));
+ 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;
+ return mmTemplateList->dwMaskCnt - 1;
}
int ClearMaskList(LISTMODERNMASK * mmTemplateList)
@@ -145,7 +145,7 @@ 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_nil(mmTemplateList->pl_Masks);
mmTemplateList->dwMaskCnt = 0;
@@ -168,11 +168,11 @@ 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);
- memcpy(newAlocation,mmTemplateList->pl_Masks,sizeof(MODERNMASK)*(mID+1));
- for (i = mID; i < mmTemplateList->dwMaskCnt-1; i++)
+ newAlocation = (MODERNMASK *)mir_alloc(sizeof(MODERNMASK)*mmTemplateList->dwMaskCnt - 1);
+ memcpy(newAlocation, mmTemplateList->pl_Masks, sizeof(MODERNMASK)*(mID + 1));
+ for (i = mID; i < mmTemplateList->dwMaskCnt - 1; i++)
{
- newAlocation[i] = mmTemplateList->pl_Masks[i+1];
+ newAlocation[i] = mmTemplateList->pl_Masks[i + 1];
newAlocation[i].dwMaskId = i;
}
mir_free_and_nil(mmTemplateList->pl_Masks);
@@ -203,16 +203,16 @@ int SortMaskList(LISTMODERNMASK * mmList)
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);
+ ExchangeMasksByID(pos, pos - 1, mmList);
pos--;
if (pos < 1)
pos = 1;
}
else
pos++;
- } while(pos < mmList->dwMaskCnt);
+ } while (pos < mmList->dwMaskCnt);
return 1;
}
@@ -223,14 +223,14 @@ enum
EXCEPTION_NOT_EQUAL = 1,
EXCEPTION_WILD = 2,
};
-static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int length, char* &param, unsigned int& paramlen, char* &value, unsigned int& valuelen, int& except )
+static BOOL _GetParamValue(char * szText, unsigned int& start, unsigned int length, char* &param, unsigned int& paramlen, char* &value, unsigned int& valuelen, int& except)
{
char * curChar = szText + start;
char * lastChar = szText + length;
enum { STATE_PARAM, STATE_VALUE };
int state = STATE_PARAM;
- if ( start >= length ) return FALSE;
+ if (start >= length) return FALSE;
paramlen = 0;
valuelen = 0;
@@ -242,18 +242,18 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len
BOOL exitLoop = false;
- while (!exitLoop )
+ while (!exitLoop)
{
- switch ( *curChar )
+ switch (*curChar)
{
case '^':
- if ( state == STATE_VALUE ) break;
+ if (state == STATE_VALUE) break;
except |= EXCEPTION_NOT_EQUAL;
exitLoop = TRUE;
//fall trough
case '=':
- if ( state == STATE_VALUE ) break;
+ if (state == STATE_VALUE) break;
//search value end
paramlen = curChar - param;
exitLoop = TRUE;
@@ -261,8 +261,8 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len
case ',':
default:
- if ( *curChar != ',' && curChar < lastChar ) break;
- if ( state == STATE_PARAM )
+ if (*curChar != ',' && curChar < lastChar) break;
+ if (state == STATE_PARAM)
{
// no parameter name only value
value = param;
@@ -273,13 +273,13 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len
exitLoop = TRUE;
break;
case '*': case '?':
- if (state == STATE_PARAM ) break;
+ if (state == STATE_PARAM) break;
except |= EXCEPTION_WILD;
break;
}
- if ( exitLoop)
+ if (exitLoop)
{
- if (state == STATE_PARAM )
+ if (state == STATE_PARAM)
{
paramlen = curChar - param;
state = STATE_VALUE;
@@ -287,7 +287,7 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len
value = curChar;
exitLoop = FALSE;
}
- else if ( state == STATE_VALUE )
+ else if (state == STATE_VALUE)
{
valuelen = curChar - value;
}
@@ -301,29 +301,29 @@ static BOOL _GetParamValue( char * szText, unsigned int& start, unsigned int len
start = curChar - szText + 1;
// skip spaces
- if ( value && valuelen )
+ if (value && valuelen)
{
- while ( *value == ' ' || *value == '\t' )
+ while (*value == ' ' || *value == '\t')
{
value++;
valuelen--;
}
- while ( *( value + valuelen - 1) == ' ' || *( value + valuelen -1 ) == '\t' )
+ while (*(value + valuelen - 1) == ' ' || *(value + valuelen - 1) == '\t')
valuelen--;
}
- if ( param && paramlen )
+ if (param && paramlen)
{
- while (*param == ' ' || *param == '\t' )
+ while (*param == ' ' || *param == '\t')
{
param++;
paramlen--;
}
- while (*(param+paramlen-1) == ' ' || *(param+paramlen-1) == '\t' )
+ while (*(param + paramlen - 1) == ' ' || *(param + paramlen - 1) == '\t')
paramlen--;
}
- return ( value || param );
+ return (value || param);
}
int ParseToModernMask(MODERNMASK *mm, char *szText)
@@ -333,7 +333,7 @@ int ParseToModernMask(MODERNMASK *mm, char *szText)
unsigned int textLen = (unsigned)mir_strlen(szText);
BYTE curParam = 0;
- MASKPARAM param = {0};
+ MASKPARAM param = { 0 };
unsigned int startPos = 0;
char * pszParam;
@@ -342,39 +342,39 @@ int ParseToModernMask(MODERNMASK *mm, char *szText)
unsigned int valuelen;
int except;
- while ( _GetParamValue( szText, startPos, textLen, pszParam, paramlen, pszValue, valuelen, except))
+ while (_GetParamValue(szText, startPos, textLen, pszParam, paramlen, pszValue, valuelen, except))
{
- if ( except & EXCEPTION_NOT_EQUAL )
+ if (except & EXCEPTION_NOT_EQUAL)
param.bMaskParamFlag = MPF_NOT_EQUAL;
else
param.bMaskParamFlag = MPF_EQUAL;
//Get param name
- if ( pszParam && paramlen )
+ 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'
{
param.szName = _strdup("Module");
- param.dwId = mod_CalcHash( param.szName );
+ 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.dwValueHash = mod_CalcHash(param.szValue);
param.bMaskParamFlag |= MPF_HASHED;
}
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]),&param,sizeof(MASKPARAM));
+ memmove(&(mm->pl_Params[curParam]), &param, sizeof(MASKPARAM));
curParam++;
memset(&param, 0, sizeof(MASKPARAM));
}
@@ -395,13 +395,13 @@ BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate)
ph = p.dwId;
vh = p.dwValueHash;
pVal = 0;
- if ( p.bMaskParamFlag& MPF_HASHED ) //compare by hash
+ if (p.bMaskParamFlag& MPF_HASHED) //compare by hash
while (pVal < mmValue->dwParamCnt && mmValue->pl_Params[pVal].bMaskParamFlag != 0)
{
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++;
}
@@ -410,25 +410,27 @@ BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate)
{
if (mmValue->pl_Params[pVal].dwId == ph)
{
- if (wildcmp(mmValue->pl_Params[pVal].szValue,p.szValue)){finded = 1; break;}
- else {finded = 0; break;}
+ if (wildcmp(mmValue->pl_Params[pVal].szValue, p.szValue)){ finded = 1; break; }
+ else { finded = 0; break; }
}
pVal++;
}
- if (!((finded && !(p.bMaskParamFlag&MPF_DIFF)) || (!finded && (p.bMaskParamFlag&MPF_DIFF))))
- {res = FALSE; break;}
+ if (!((finded && !(p.bMaskParamFlag&MPF_DIFF)) || (!finded && (p.bMaskParamFlag&MPF_DIFF))))
+ {
+ res = FALSE; break;
+ }
pTemp++;
}
return res;
};
-BOOL CompareStrWithModernMask(char * szValue,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;
}
@@ -436,36 +438,29 @@ BOOL CompareStrWithModernMask(char * szValue,MODERNMASK *mmTemplate)
};
//AddingMask
-int AddStrModernMaskToList(DWORD maskID, char * szStr, char * objectName, LISTMODERNMASK * mmTemplateList, void * pObjectList)
+int AddStrModernMaskToList(DWORD maskID, char * szStr, char * objectName, LISTMODERNMASK * mmTemplateList)
{
if (!szStr || !mmTemplateList) return -1;
- MODERNMASK mm = {0};
- if (ParseToModernMask(&mm,szStr)) return -1;
+ 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;
- return AddModernMaskToList(&mm,mmTemplateList);
-}
-
-//Searching
-MODERNMASK * FindMaskByStr(char * szValue,LISTMODERNMASK * mmTemplateList)
-{
- //TODO
- return NULL;
+ return AddModernMaskToList(&mm, mmTemplateList);
}
-SKINOBJECTDESCRIPTOR * skin_FindObjectByMask (MODERNMASK *mm,LISTMODERNMASK * mmTemplateList)
+SKINOBJECTDESCRIPTOR * skin_FindObjectByMask(MODERNMASK *mm, LISTMODERNMASK * mmTemplateList)
{
SKINOBJECTDESCRIPTOR * res = NULL;
- DWORD i=0;
+ DWORD i = 0;
while (i < mmTemplateList->dwMaskCnt)
{
- if (CompareModernMask(mm,&(mmTemplateList->pl_Masks[i])))
+ if (CompareModernMask(mm, &(mmTemplateList->pl_Masks[i])))
{
- res = (SKINOBJECTDESCRIPTOR*) mmTemplateList->pl_Masks[i].pObject;
+ res = (SKINOBJECTDESCRIPTOR*)mmTemplateList->pl_Masks[i].pObject;
return res;
}
i++;
@@ -473,9 +468,9 @@ SKINOBJECTDESCRIPTOR * skin_FindObjectByMask (MODERNMASK *mm,LISTMODERNMASK * m
return res;
}
-SKINOBJECTDESCRIPTOR * skin_FindObjectByRequest(char * szValue,LISTMODERNMASK * mmTemplateList)
+SKINOBJECTDESCRIPTOR * skin_FindObjectByRequest(char * szValue, LISTMODERNMASK * mmTemplateList)
{
- MODERNMASK mm = {0};
+ MODERNMASK mm = { 0 };
SKINOBJECTDESCRIPTOR * res = NULL;
if (!mmTemplateList)
if (g_SkinObjectList.pMaskList)
@@ -484,26 +479,25 @@ SKINOBJECTDESCRIPTOR * skin_FindObjectByRequest(char * szValue,LISTMODERNMASK *
return NULL;
if (!mmTemplateList) return NULL;
- ParseToModernMask(&mm,szValue);
- res = skin_FindObjectByMask(&mm,mmTemplateList);
+ ParseToModernMask(&mm, szValue);
+ 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));
- GetParamN(string, ansibuf, buflen/sizeof(TCHAR), paramN, Delim, SkipSpaces);
- MultiByteToWideChar(CP_UTF8, 0, ansibuf,-1,buf,buflen);
+ 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(ansibuf);
return buf;
}
WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim, BOOL SkipSpaces)
{
- int i=0;
+ size_t i = 0;
DWORD start = 0;
- DWORD end = 0;
DWORD CurentCount = 0;
DWORD len;
while (i < mir_tstrlen(string))
@@ -511,7 +505,7 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim
if (string[i] == Delim)
{
if (CurentCount == paramN) break;
- start = i+1;
+ start = i + 1;
CurentCount++;
}
i++;
@@ -522,11 +516,11 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim
{ //remove spaces
while (string[start] == ' ' && (int)start < mir_tstrlen(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;
- _tcsncpy(buf, string+start, len);
+ len = ((int)(i - start) < buflen) ? i - start : buflen;
+ _tcsncpy(buf, string + start, len);
buf[len] = '\0';
}
else buf[0] = '\0';
@@ -535,9 +529,8 @@ WCHAR* GetParamN(WCHAR *string, WCHAR *buf, int buflen, BYTE paramN, WCHAR Delim
char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim, BOOL SkipSpaces)
{
- int i=0;
+ size_t i = 0;
DWORD start = 0;
- DWORD end = 0;
DWORD CurentCount = 0;
DWORD len;
while (i < mir_strlen(string))
@@ -545,7 +538,7 @@ char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim,
if (string[i] == Delim)
{
if (CurentCount == paramN) break;
- start = i+1;
+ start = i + 1;
CurentCount++;
}
i++;
@@ -556,11 +549,11 @@ char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim,
{ //remove spaces
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;
- strncpy(buf,string+start,len);
+ len = ((int)(i - start) < buflen) ? i - start : buflen;
+ strncpy(buf, string + start, len);
buf[len] = '\0';
}
else buf[0] = '\0';
@@ -570,51 +563,51 @@ char * GetParamN(char * string, char * buf, int buflen, BYTE paramN, char Delim,
//Parse DB string and add buttons
int RegisterButtonByParce(char * ObjectName, char * Params)
{
- char buf [255];
+ char buf[255];
int res;
- GetParamN(Params,buf, SIZEOF(buf), 0, ',',0);
+ 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};
- int Left, Top,Right,Bottom;
+ 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);
+ 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));
- 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));
- GetParamNT(Params,Hint, SIZEOF(Hint),a+9,',',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));
+ GetParamNT(Params, Hint, SIZEOF(Hint), a + 9, ',', 0);
if (a)
{
- GetParamN(Params,Section, SIZEOF(Section),2,',',0);
- GetParamN(Params,Type, SIZEOF(Type),3,',',0);
+ 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;
}
@@ -629,82 +622,82 @@ int RegisterObjectByParce(char * ObjectName, char * Params)
if (!ObjectName || !Params) return 0;
{
int res = 0;
- SKINOBJECTDESCRIPTOR obj = {0};
+ SKINOBJECTDESCRIPTOR obj = { 0 };
char buf[250];
obj.szObjectID = mir_strdup(ObjectName);
- GetParamN(Params,buf, SIZEOF(buf), 0, ',',0);
- if (mir_bool_strcmpi(buf,"Glyph"))
+ GetParamN(Params, buf, SIZEOF(buf), 0, ',', 0);
+ if (mir_bool_strcmpi(buf, "Glyph"))
obj.bType = OT_GLYPHOBJECT;
- else if (mir_bool_strcmpi(buf,"Font"))
+ else if (mir_bool_strcmpi(buf, "Font"))
obj.bType = OT_FONTOBJECT;
switch (obj.bType)
{
case OT_GLYPHOBJECT:
+ {
+ GLYPHOBJECT gl = { 0 };
+ GetParamN(Params, buf, SIZEOF(buf), 1, ',', 0);
+ if (mir_bool_strcmpi(buf, "Solid"))
{
- 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);
- }
- 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));
- 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;
- }
- 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));
- 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;
- }
- else
- {
- //None
- gl.Style = ST_SKIP;
- }
- obj.Data = &gl;
- res = ske_AddDescriptorToSkinObjectList(&obj,NULL);
- mir_free_and_nil(obj.szObjectID);
- mir_free_and_nil(gl.szFileName);
- return res;
+ //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);
}
- break;
+ 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));
+ 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;
+ }
+ 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));
+ 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;
+ }
+ else
+ {
+ //None
+ gl.Style = ST_SKIP;
+ }
+ obj.Data = &gl;
+ res = ske_AddDescriptorToSkinObjectList(&obj, NULL);
+ mir_free_and_nil(obj.szObjectID);
+ mir_free_and_nil(gl.szFileName);
+ return res;
+ }
+ break;
}
}
return 0;
@@ -719,29 +712,29 @@ int SkinDrawGlyphMask(HDC hdc, RECT *rcSize, RECT *rcClip, MODERNMASK *ModernMas
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);
+ strncpy(rq.szObjectID, "Masked draw", SIZEOF("Masked draw"));
+ return ske_Service_DrawGlyph((WPARAM)&rq, (LPARAM)ModernMask);
}
int __inline SkinDrawWindowBack(HWND hwndIn, HDC hdc, RECT *rcClip, char * objectID)
{
SKINDRAWREQUEST rq;
- POINT pt = {0};
- RECT rc,r1;
+ POINT pt = { 0 };
+ RECT rc, r1;
HWND hwnd = (HWND)CallService(MS_CLUI_GETHWND, 0, 0);
if (!objectID) return 0;
- GetWindowRect(hwndIn,&r1);
+ GetWindowRect(hwndIn, &r1);
pt.x = r1.left;
pt.y = r1.top;
//ClientToScreen(hwndIn,&pt);
- GetWindowRect(hwnd,&rc);
- OffsetRect(&rc,-pt.x ,-pt.y);
+ GetWindowRect(hwnd, &rc);
+ OffsetRect(&rc, -pt.x, -pt.y);
rq.hDC = hdc;
rq.rcDestRect = rc;
rq.rcClipRect = *rcClip;
- strncpy(rq.szObjectID,objectID,SIZEOF(rq.szObjectID));
+ strncpy(rq.szObjectID, objectID, SIZEOF(rq.szObjectID));
///ske_Service_DrawGlyph((WPARAM)&rq,0); //$$$
- return CallService(MS_SKIN_DRAWGLYPH,(WPARAM)&rq,0);
+ return CallService(MS_SKIN_DRAWGLYPH, (WPARAM)&rq, 0);
}
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index bf6a41ba6f..dea40a5ba3 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -13,8 +13,8 @@ POINT lastpnt;
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);
+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);
//int FindFrameID(HWND FrameHwnd);
COLORREF sttGetColor(char * module, char * color, COLORREF defColor);
@@ -42,7 +42,7 @@ struct ProtoItemData : public MZeroedObject
int iProtoPos;
int fullWidth;
RECT protoRect;
-
+
BYTE xStatusMode; // 0-only main, 1-xStatus, 2-main as overlay
bool bDoubleIcons;
bool bShowProtoIcon;
@@ -59,7 +59,7 @@ struct ProtoItemData : public MZeroedObject
static OBJLIST<ProtoItemData> ProtosData(5);
-STATUSBARDATA g_StatusBarData = {0};
+STATUSBARDATA g_StatusBarData = { 0 };
char* ApendSubSetting(char * buf, int size, char *first, char *second)
{
@@ -122,7 +122,7 @@ int LoadStatusBarData()
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);
return 1;
}
@@ -136,7 +136,7 @@ int BgStatusBarChange(WPARAM, LPARAM)
}
// ProtocolData;
-int NewStatusPaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData)
+int NewStatusPaintCallbackProc(HWND hWnd, HDC hDC, RECT *, HRGN, DWORD, void *)
{
return ModernDrawStatusBar(hWnd, hDC);
}
@@ -153,7 +153,7 @@ int ModernDrawStatusBar(HWND hwnd, HDC hDC)
int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
{
- int iconHeight = GetSystemMetrics(SM_CYSMICON)+2;
+ int iconHeight = GetSystemMetrics(SM_CYSMICON) + 2;
int i;
// Count visible protos
@@ -305,7 +305,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
rc.top += g_StatusBarData.rectBorders.top;
rc.bottom -= g_StatusBarData.rectBorders.bottom;
- int aligndx = 0, maxwidth = 0, xstatus = 0, SumWidth = 0;
+ int aligndx = 0, maxwidth = 0, SumWidth = 0;
int height = (rowheight*linecount);
if (height > (rc.bottom - rc.top)) {
@@ -315,7 +315,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
int rowsdy = ((rc.bottom - rc.top) - height) / 2;
if (rowheight*(line)+rowsdy < rc.top - rowheight) continue;
- if (rowheight*(line + 1) + rowsdy>rc.bottom + rowheight)
+ if (rowheight*(line + 1) + rowsdy > rc.bottom + rowheight)
break;
if (g_StatusBarData.VAlign == 0) { //top
@@ -439,7 +439,7 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
r.left += g_StatusBarData.rectBorders.left + aligndx;
for (i = 0; i < visProtoCount; i++) {
ProtoItemData& p = ProtosData[line*protosperline + i];
- HRGN rgn;
+ HRGN rgn = NULL;
HICON hIcon = NULL;
HICON hxIcon = NULL;
BOOL NeedDestroy = FALSE;
@@ -610,7 +610,7 @@ static BOOL _ModernStatus_OnExtraIconClick(ProtoItemData *p)
return FALSE;
// Show Moods
- #define PS_JABBER_MOOD "/AdvStatusSet/Mood"
+#define PS_JABBER_MOOD "/AdvStatusSet/Mood"
if (ProtoServiceExists(p->szAccountName, PS_JABBER_MOOD)) {
ProtoCallService(p->szAccountName, PS_JABBER_MOOD, 0, 0);
return TRUE;
@@ -690,16 +690,16 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_GETMINMAXINFO:
- {
- 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;
- }
- return 0;
+ {
+ 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;
+ }
+ return 0;
case WM_SHOWWINDOW:
if (tooltipshoing) {
@@ -763,7 +763,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
break;
case WM_SETCURSOR:
- if (g_CluiData.bBehindEdgeSettings) CLUI_UpdateTimer(0);
+ if (g_CluiData.bBehindEdgeSettings) CLUI_UpdateTimer();
{
POINT pt;
GetCursorPos(&pt);
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp
index 874f35f82c..f167784866 100644
--- a/plugins/Clist_modern/src/modern_statusbar_options.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp
@@ -41,28 +41,28 @@ typedef struct _StatusBarProtocolOptions
int PaddingRight;
} StatusBarProtocolOptions;
-static StatusBarProtocolOptions _GlobalOptions = {0};
+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, BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWBOTH),en && IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL));
+ if (IsDlgButtonChecked(hwndDlg, IDC_SHOWBOTH)) CheckDlgButton(hwndDlg, IDC_SHOWNORMAL, BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWBOTH), en && IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL));
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL)) CheckDlgButton(hwndDlg,IDC_SHOWBOTH, BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWNORMAL),en && IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg,IDC_SHOWBOTH));
+ if (IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL)) CheckDlgButton(hwndDlg, IDC_SHOWBOTH, BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWNORMAL), en && IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWBOTH));
- EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENTOVERLAY),en && IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg,IDC_SHOWBOTH));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), en && IsDlgButtonChecked(hwndDlg, IDC_SHOWXSTATUS) && IsDlgButtonChecked(hwndDlg, IDC_SHOWNORMAL) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWBOTH));
BYTE val = 0;
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWXSTATUS)) {
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWBOTH)) val = 3;
- else if (IsDlgButtonChecked(hwndDlg,IDC_SHOWNORMAL)) val = 2;
+ 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;
+ 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;
else
@@ -127,7 +127,7 @@ static void UpdateStatusBarOptionsDisplay(HWND hwndDlg)
if (!enableOptions) {
EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWNORMAL), enableOptions && enableIcons);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWBOTH), enableOptions && enableIcons );
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWBOTH), enableOptions && enableIcons);
EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENTOVERLAY), enableOptions && enableIcons);
}
@@ -309,36 +309,36 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
if ((LOWORD(wParam) == IDC_SBAR_VERT_ALIGN || (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);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSTATUS),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTSTATUS),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTMIRANDA),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_EQUALSECTIONS),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),en && en_icons);
- EnableWindow(GetDlgItem(hwndDlg,IDC_OFFSETSPIN),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_OFFSETICON),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_OFFSETSPIN2),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_OFFSETICON2),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_OFFSETSPIN3),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_OFFSETICON3),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SBAR_BORDER_TOP),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SBAR_BORDER_TOP_SPIN),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SBAR_BORDER_BOTTOM),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SBAR_BORDER_BOTTOM_SPIN),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SBAR_HORIZ_ALIGN),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWXSTATUSNAME),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWXSTATUS),en && en_icons);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWUNREADEMAIL),en);
-
- EnableWindow(GetDlgItem(hwndDlg,IDC_MULTI_COUNT),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MULTI_SPIN),en);
-
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATUSBAR_PER_PROTO),en);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATUSBAR_PROTO_LIST),en && IsDlgButtonChecked(hwndDlg,IDC_STATUSBAR_PER_PROTO));
- EnableWindow(GetDlgItem(hwndDlg,IDC_SBAR_USE_ACCOUNT_SETTINGS),en && IsDlgButtonChecked(hwndDlg,IDC_STATUSBAR_PER_PROTO));
+ 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);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_USECONNECTINGICON), en && en_icons);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_OFFSETSPIN), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_OFFSETICON), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_OFFSETSPIN2), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_OFFSETICON2), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_OFFSETSPIN3), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_OFFSETICON3), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SBAR_BORDER_TOP), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SBAR_BORDER_TOP_SPIN), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SBAR_BORDER_BOTTOM), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SBAR_BORDER_BOTTOM_SPIN), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SBAR_HORIZ_ALIGN), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWXSTATUSNAME), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWXSTATUS), en && en_icons);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWUNREADEMAIL), en);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MULTI_COUNT), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MULTI_SPIN), en);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSBAR_PER_PROTO), en);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATUSBAR_PROTO_LIST), en && IsDlgButtonChecked(hwndDlg, IDC_STATUSBAR_PER_PROTO));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SBAR_USE_ACCOUNT_SETTINGS), en && IsDlgButtonChecked(hwndDlg, IDC_STATUSBAR_PER_PROTO));
UpdateStatusBarOptionsDisplay(hwndDlg);
@@ -424,61 +424,61 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- {
- int count = db_get_dw(0, "Protocols", "ProtoCount", -1);
- db_set_b(NULL, "CLUI", "SBarPerProto", IsDlgButtonChecked(hwndDlg, IDC_STATUSBAR_PER_PROTO));
-
- for (int i = 0; i < count; i++) {
- StatusBarProtocolOptions sbpo = dat[i];
- char *defProto = sbpo.szName;
-
- char settingBuf[256];
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "SBarAccountIsCustom_%s", defProto);
- db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.AccountIsCustomized);
-
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "HideAccount_%s", defProto);
- db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.HideAccount);
-
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "SBarShow_%s", defProto);
- db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.SBarShow);
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "SBarRightClk_%s", defProto);
- db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.SBarRightClk);
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "UseConnectingIcon_%s", defProto);
- db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.UseConnectingIcon);
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "ShowUnreadEmails_%s", defProto);
- db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.ShowUnreadEmails);
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "ShowXStatus_%s", defProto);
- db_set_b(NULL, "CLUI", settingBuf, sbpo.ShowXStatus);
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "PaddingLeft_%s", defProto);
- db_set_dw(NULL, "CLUI", settingBuf, sbpo.PaddingLeft);
- mir_snprintf(settingBuf, SIZEOF(settingBuf), "PaddingRight_%s", defProto);
- db_set_dw(NULL, "CLUI", settingBuf, sbpo.PaddingRight);
- }
-
- db_set_b(NULL, "CLUI", "SBarShow", (BYTE)_GlobalOptions.SBarShow);
- db_set_b(NULL, "CLUI", "SBarRightClk", (BYTE)_GlobalOptions.SBarRightClk);
- db_set_b(NULL, "CLUI", "UseConnectingIcon", (BYTE)_GlobalOptions.UseConnectingIcon);
- db_set_b(NULL, "CLUI", "ShowUnreadEmails", (BYTE)_GlobalOptions.ShowUnreadEmails);
- db_set_b(NULL, "CLUI", "ShowXStatus", _GlobalOptions.ShowXStatus);
- db_set_dw(NULL, "CLUI", "PaddingLeft", _GlobalOptions.PaddingLeft);
- db_set_dw(NULL, "CLUI", "PaddingRight", _GlobalOptions.PaddingRight);
-
-
- db_set_b(NULL, "CLUI", "StatusBarProtosPerLine", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MULTI_SPIN, UDM_GETPOS, 0, 0));
- db_set_b(NULL, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
- db_set_b(NULL, "CLUI", "Align", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_GETCURSEL, 0, 0));
- db_set_b(NULL, "CLUI", "VAlign", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_GETCURSEL, 0, 0));
- db_set_dw(NULL, "CLUI", "LeftOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN, UDM_GETPOS, 0, 0));
- db_set_dw(NULL, "CLUI", "RightOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN2, UDM_GETPOS, 0, 0));
- db_set_dw(NULL, "CLUI", "TopOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_SBAR_BORDER_TOP_SPIN, UDM_GETPOS, 0, 0));
- db_set_dw(NULL, "CLUI", "BottomOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_SBAR_BORDER_BOTTOM_SPIN, UDM_GETPOS, 0, 0));
- db_set_dw(NULL, "CLUI", "SpaceBetween", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN3, UDM_GETPOS, 0, 0));
- db_set_b(NULL, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
-
- LoadStatusBarData();
- cliCluiProtocolStatusChanged(0, 0);
- return TRUE;
+ {
+ int count = db_get_dw(0, "Protocols", "ProtoCount", -1);
+ db_set_b(NULL, "CLUI", "SBarPerProto", IsDlgButtonChecked(hwndDlg, IDC_STATUSBAR_PER_PROTO));
+
+ for (int i = 0; i < count; i++) {
+ StatusBarProtocolOptions sbpo = dat[i];
+ char *defProto = sbpo.szName;
+
+ char settingBuf[256];
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "SBarAccountIsCustom_%s", defProto);
+ db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.AccountIsCustomized);
+
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "HideAccount_%s", defProto);
+ db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.HideAccount);
+
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "SBarShow_%s", defProto);
+ db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.SBarShow);
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "SBarRightClk_%s", defProto);
+ db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.SBarRightClk);
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "UseConnectingIcon_%s", defProto);
+ db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.UseConnectingIcon);
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "ShowUnreadEmails_%s", defProto);
+ db_set_b(NULL, "CLUI", settingBuf, (BYTE)sbpo.ShowUnreadEmails);
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "ShowXStatus_%s", defProto);
+ db_set_b(NULL, "CLUI", settingBuf, sbpo.ShowXStatus);
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "PaddingLeft_%s", defProto);
+ db_set_dw(NULL, "CLUI", settingBuf, sbpo.PaddingLeft);
+ mir_snprintf(settingBuf, SIZEOF(settingBuf), "PaddingRight_%s", defProto);
+ db_set_dw(NULL, "CLUI", settingBuf, sbpo.PaddingRight);
}
+
+ db_set_b(NULL, "CLUI", "SBarShow", (BYTE)_GlobalOptions.SBarShow);
+ db_set_b(NULL, "CLUI", "SBarRightClk", (BYTE)_GlobalOptions.SBarRightClk);
+ db_set_b(NULL, "CLUI", "UseConnectingIcon", (BYTE)_GlobalOptions.UseConnectingIcon);
+ db_set_b(NULL, "CLUI", "ShowUnreadEmails", (BYTE)_GlobalOptions.ShowUnreadEmails);
+ db_set_b(NULL, "CLUI", "ShowXStatus", _GlobalOptions.ShowXStatus);
+ db_set_dw(NULL, "CLUI", "PaddingLeft", _GlobalOptions.PaddingLeft);
+ db_set_dw(NULL, "CLUI", "PaddingRight", _GlobalOptions.PaddingRight);
+
+
+ db_set_b(NULL, "CLUI", "StatusBarProtosPerLine", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MULTI_SPIN, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLUI", "EqualSections", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
+ db_set_b(NULL, "CLUI", "Align", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SBAR_HORIZ_ALIGN, CB_GETCURSEL, 0, 0));
+ db_set_b(NULL, "CLUI", "VAlign", (BYTE)SendDlgItemMessage(hwndDlg, IDC_SBAR_VERT_ALIGN, CB_GETCURSEL, 0, 0));
+ db_set_dw(NULL, "CLUI", "LeftOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN, UDM_GETPOS, 0, 0));
+ db_set_dw(NULL, "CLUI", "RightOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN2, UDM_GETPOS, 0, 0));
+ db_set_dw(NULL, "CLUI", "TopOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_SBAR_BORDER_TOP_SPIN, UDM_GETPOS, 0, 0));
+ db_set_dw(NULL, "CLUI", "BottomOffset", (DWORD)SendDlgItemMessage(hwndDlg, IDC_SBAR_BORDER_BOTTOM_SPIN, UDM_GETPOS, 0, 0));
+ db_set_dw(NULL, "CLUI", "SpaceBetween", (DWORD)SendDlgItemMessage(hwndDlg, IDC_OFFSETSPIN3, UDM_GETPOS, 0, 0));
+ db_set_b(NULL, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+
+ LoadStatusBarData();
+ cliCluiProtocolStatusChanged(0, 0);
+ return TRUE;
+ }
}
break;
diff --git a/plugins/Clist_modern/src/modern_sync.cpp b/plugins/Clist_modern/src/modern_sync.cpp
index 2d17b932b2..68b0927bad 100644
--- a/plugins/Clist_modern/src/modern_sync.cpp
+++ b/plugins/Clist_modern/src/modern_sync.cpp
@@ -3,11 +3,11 @@
static INT_PTR SyncCaller(WPARAM proc, LPARAM lParam)
{
- typedef int (*P0PARAMFUNC)();
- typedef int (*P1PARAMFUNC)(WPARAM);
- typedef int (*P2PARAMFUNC)(WPARAM, LPARAM);
- typedef int (*P3PARAMFUNC)(WPARAM, LPARAM, LPARAM);
- typedef int (*P4PARAMFUNC)(WPARAM, LPARAM, LPARAM, LPARAM);
+ typedef int(*P0PARAMFUNC)();
+ typedef int(*P1PARAMFUNC)(WPARAM);
+ typedef int(*P2PARAMFUNC)(WPARAM, LPARAM);
+ typedef int(*P3PARAMFUNC)(WPARAM, LPARAM, LPARAM);
+ typedef int(*P4PARAMFUNC)(WPARAM, LPARAM, LPARAM, LPARAM);
LPARAM * params = (LPARAM *)lParam;
int count = params[0];
@@ -19,13 +19,13 @@ static INT_PTR SyncCaller(WPARAM proc, LPARAM lParam)
return ((P1PARAMFUNC)proc)((WPARAM)params[1]);
case 2:
- return ((P2PARAMFUNC)proc)((WPARAM)params[1],(LPARAM)params[2]);
+ return ((P2PARAMFUNC)proc)((WPARAM)params[1], (LPARAM)params[2]);
case 3:
- return ((P3PARAMFUNC)proc)((WPARAM)params[1],(LPARAM)params[2], (LPARAM)params[3]);
+ return ((P3PARAMFUNC)proc)((WPARAM)params[1], (LPARAM)params[2], (LPARAM)params[3]);
case 4:
- return ((P4PARAMFUNC)proc)((WPARAM)params[1],(LPARAM)params[2], (LPARAM)params[3], (LPARAM)params[4]);
+ return ((P4PARAMFUNC)proc)((WPARAM)params[1], (LPARAM)params[2], (LPARAM)params[3], (LPARAM)params[4]);
}
return 0;
}
@@ -38,7 +38,7 @@ struct SYNCCALLITEM
LPARAM lParam;
int nResult;
HANDLE hDoneEvent;
- PSYNCCALLBACKPROC pfnProc;
+ PSYNCCALLBACKPROC pfnProc;
};
static void CALLBACK _SyncCallerUserAPCProc(void* param)
@@ -50,7 +50,7 @@ static void CALLBACK _SyncCallerUserAPCProc(void* param)
static int SyncCallAPCProxy(PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lParam)
{
- if (pfnProc == NULL)
+ if (pfnProc == NULL)
return 0;
if (GetCurrentThreadId() == g_dwMainThreadID)
@@ -63,8 +63,8 @@ static int SyncCallAPCProxy(PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lPa
item.nResult = 0;
item.hDoneEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
- CallFunctionAsync(_SyncCallerUserAPCProc, &item);
-
+ CallFunctionAsync(_SyncCallerUserAPCProc, &item);
+
WaitForSingleObject(item.hDoneEvent, INFINITE);
CloseHandle(item.hDoneEvent);
return item.nResult;
@@ -72,21 +72,21 @@ static int SyncCallAPCProxy(PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lPa
/////////////////////////////////////////////////////////////////////////////////////////
-int DoCall( PSYNCCALLBACKPROC pfnProc, WPARAM wParam, LPARAM lParam)
+int DoCall(PSYNCCALLBACKPROC pfnProc, WPARAM, LPARAM lParam)
{
return SyncCallAPCProxy(pfnProc, 0, lParam);
}
-int SyncCall(void * vproc, int count, ... )
+int SyncCall(void * vproc, int count, ...)
{
LPARAM params[5];
va_list va;
int i;
params[0] = (LPARAM)count;
va_start(va, count);
- for (i=0; i < count && i < SIZEOF(params)-1; i++)
- params[i+1] = va_arg(va,LPARAM);
+ for (i = 0; i < count && i < SIZEOF(params) - 1; i++)
+ params[i + 1] = va_arg(va, LPARAM);
va_end(va);
- return SyncCallAPCProxy(SyncCaller, (WPARAM)vproc, (LPARAM) params);
+ return SyncCallAPCProxy(SyncCaller, (WPARAM)vproc, (LPARAM)params);
}
diff --git a/plugins/Clist_modern/src/modern_tbbutton.cpp b/plugins/Clist_modern/src/modern_tbbutton.cpp
index ee5d5c521d..a7b30af19f 100644
--- a/plugins/Clist_modern/src/modern_tbbutton.cpp
+++ b/plugins/Clist_modern/src/modern_tbbutton.cpp
@@ -36,7 +36,7 @@ static BOOL bThemed = FALSE;
static HANDLE hButtonWindowList = NULL;
-static int OnIconLibIconChanged(WPARAM wParam, LPARAM lParam)
+static int OnIconLibIconChanged(WPARAM, LPARAM)
{
WindowList_BroadcastAsync(hButtonWindowList, MBM_REFRESHICOLIBICON, 0, 0);
return 0;
@@ -44,15 +44,15 @@ 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;
- SendMessage(GetParent(hwndChild),WM_NOTIFY,(WPARAM)hwndChild,(LPARAM)&hdr);
+ SendMessage(GetParent(hwndChild), WM_NOTIFY, (WPARAM)hwndChild, (LPARAM)&hdr);
}
- else InvalidateRect(hwndChild,lpRect,fErase);
+ else InvalidateRect(hwndChild, lpRect, fErase);
}
static int TBStateConvert2Flat(int state)
@@ -72,7 +72,7 @@ static int TBStateConvert2Flat(int state)
return TS_NORMAL;
}
-static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset)
+static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint, POINT *pOffset)
{
if (!hdcPaint)
return; //early exit
@@ -85,34 +85,34 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset)
RECT rcClient;
GetClientRect(bct->hwnd, &rcClient);
- int width = rcClient.right - rcClient.left;
+ int width = rcClient.right - rcClient.left;
int height = rcClient.bottom - rcClient.top;
- HBITMAP hbmMem;
+ HBITMAP hbmMem = NULL;
HBITMAP hbmOld = NULL;
HDC hdcMem = pOffset ? hdcPaint : CreateCompatibleDC(hdcPaint);
HFONT hOldFont = (HFONT)SelectObject(hdcMem, bct->hFont);
if (!pOffset) {
hbmMem = ske_CreateDIB32(width, height);
- hbmOld = (HBITMAP)SelectObject(hdcMem, hbmMem);
+ hbmOld = (HBITMAP)SelectObject(hdcMem, hbmMem);
}
- else OffsetRect(&rcClient,offset.x,offset.y);
+ else OffsetRect(&rcClient, offset.x, offset.y);
if (!g_CluiData.fDisableSkinEngine) {
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",
bct->szButtonID, // ID
b2str(bct->stateId == PBS_HOT), // Hovered
b2str(bct->stateId == PBS_PRESSED || bct->bIsPushed == TRUE), // Pressed
b2str(bct->bFocused)); // Focused
- SkinDrawGlyph(hdcMem,&rcClient,&rcClient,szRequest);
+ SkinDrawGlyph(hdcMem, &rcClient, &rcClient, szRequest);
}
else if (xpt_IsThemed(bct->hThemeToolbar)) {
RECT *rc = &rcClient;
int state = IsWindowEnabled(bct->hwnd) ? /*(bct->stateId == PBS_PRESSED || bct->bIsPushed == TRUE) ? PBS_PRESSED :*/ (bct->stateId == PBS_NORMAL && bct->bIsDefault ? PBS_DEFAULTED : bct->stateId) : PBS_DISABLED;
- xpt_DrawTheme(bct->hThemeToolbar,bct->hwnd,hdcMem,TP_BUTTON, TBStateConvert2Flat(state), rc, rc);
+ xpt_DrawTheme(bct->hThemeToolbar, bct->hwnd, hdcMem, TP_BUTTON, TBStateConvert2Flat(state), rc, rc);
}
else {
HBRUSH hbr = NULL;
@@ -120,30 +120,30 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset)
if (bct->stateId == PBS_PRESSED || bct->stateId == PBS_HOT)
hbr = GetSysColorBrush(COLOR_3DLIGHT);
else {
- RECT btnRect;
- POINT pt = {0};
+ RECT btnRect;
+ POINT pt = { 0 };
int ret;
HWND hwndParent = GetParent(bct->hwnd);
HDC dc = CreateCompatibleDC(NULL);
HBITMAP memBM, oldBM;
- GetWindowRect(hwndParent,&btnRect);
- memBM = ske_CreateDIB32( btnRect.right-btnRect.left, btnRect.bottom-btnRect.top );
- oldBM = (HBITMAP)SelectObject ( dc, memBM );
- ret = SendMessage(hwndParent,WM_ERASEBKGND,(WPARAM)dc,0);
- GetWindowRect(bct->hwnd,&btnRect);
- ClientToScreen(hwndParent,&pt);
- OffsetRect(&btnRect,-pt.x,-pt.y);
+ GetWindowRect(hwndParent, &btnRect);
+ memBM = ske_CreateDIB32(btnRect.right - btnRect.left, btnRect.bottom - btnRect.top);
+ oldBM = (HBITMAP)SelectObject(dc, memBM);
+ ret = SendMessage(hwndParent, WM_ERASEBKGND, (WPARAM)dc, 0);
+ GetWindowRect(bct->hwnd, &btnRect);
+ ClientToScreen(hwndParent, &pt);
+ OffsetRect(&btnRect, -pt.x, -pt.y);
if (ret)
- BitBlt(hdcMem, 0, 0, btnRect.right-btnRect.left,btnRect.bottom-btnRect.top,dc,btnRect.left,btnRect.top,SRCCOPY);
- oldBM = (HBITMAP)SelectObject ( dc, oldBM );
+ BitBlt(hdcMem, 0, 0, btnRect.right - btnRect.left, btnRect.bottom - btnRect.top, dc, btnRect.left, btnRect.top, SRCCOPY);
+ oldBM = (HBITMAP)SelectObject(dc, oldBM);
DeleteObject(memBM);
DeleteDC(dc);
if (!ret) { //WM_ERASEBKG return false need to paint
HDC pdc = GetDC(hwndParent);
- HBRUSH oldBrush = (HBRUSH)GetCurrentObject( pdc, OBJ_BRUSH );
+ HBRUSH oldBrush = (HBRUSH)GetCurrentObject(pdc, OBJ_BRUSH);
hbr = (HBRUSH)SendMessage(hwndParent, WM_CTLCOLORDLG, (WPARAM)pdc, (LPARAM)hwndParent);
- SelectObject(pdc,oldBrush);
- ReleaseDC(hwndParent,pdc);
+ SelectObject(pdc, oldBrush);
+ ReleaseDC(hwndParent, pdc);
}
}
if (hbr) {
@@ -152,15 +152,15 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset)
}
if (bct->stateId == PBS_HOT || bct->bFocused) {
if (bct->bIsPushed)
- DrawEdge(hdcMem,&rcClient, EDGE_ETCHED,BF_RECT|BF_SOFT);
+ DrawEdge(hdcMem, &rcClient, EDGE_ETCHED, BF_RECT | BF_SOFT);
else
- DrawEdge(hdcMem,&rcClient, BDR_RAISEDOUTER,BF_RECT|BF_SOFT|BF_FLAT);
+ DrawEdge(hdcMem, &rcClient, BDR_RAISEDOUTER, BF_RECT | BF_SOFT | BF_FLAT);
}
else if (bct->stateId == PBS_PRESSED)
- DrawEdge(hdcMem, &rcClient, BDR_SUNKENOUTER,BF_RECT|BF_SOFT);
+ DrawEdge(hdcMem, &rcClient, BDR_SUNKENOUTER, BF_RECT | BF_SOFT);
}
- RECT rcTemp = rcClient; //content rect
+ RECT rcTemp = rcClient; //content rect
bool bPressed = (bct->stateId == PBS_PRESSED || bct->bIsPushed == TRUE);
bool bHasText = (bct->szText[0] != '\0');
@@ -168,7 +168,7 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset)
if (!g_CluiData.fDisableSkinEngine) {
/* correct rect according to rcMargins */
- rcTemp.left += bct->rcMargins.left;
+ rcTemp.left += bct->rcMargins.left;
rcTemp.top += bct->rcMargins.top;
rcTemp.bottom -= bct->rcMargins.bottom;
rcTemp.right -= bct->rcMargins.right;
@@ -178,46 +178,46 @@ static void PaintWorker(TBBUTTONDATA *bct, HDC hdcPaint , POINT *pOffset)
RECT rcIcon = rcTemp, rcText = rcTemp;
if (bct->hIcon) {
if (bHasText) {
- 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 {
- 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;
}
}
/* Check sizes*/
- if (bct->hIcon && (rcIcon.right>rcTemp.right || rcIcon.bottom>rcTemp.bottom || rcIcon.left < rcTemp.left || rcIcon.top < rcTemp.top))
+ if (bct->hIcon && (rcIcon.right > rcTemp.right || rcIcon.bottom > rcTemp.bottom || rcIcon.left < rcTemp.left || rcIcon.top < rcTemp.top))
bct->hIcon = NULL;
if (bHasText && (rcText.right>rcTemp.right || rcText.bottom>rcTemp.bottom || rcText.left < rcTemp.left || rcText.top < rcTemp.top))
- bHasText = FALSE;
+ bHasText = FALSE;
if (bct->hIcon) {
/* center icon vertically */
- rcIcon.top += (rcClient.bottom-rcClient.top)/2 - 8; /* CYSM_ICON/2 */
+ 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, bct->hIcon, 16, 16, 0, NULL, DI_NORMAL);
+ ske_DrawIconEx(hdcMem, rcIcon.left + bPressed, rcIcon.top + bPressed, bct->hIcon, 16, 16, 0, NULL, DI_NORMAL);
}
if (bHasText) {
BOOL bCentered = TRUE;
SetBkMode(hdcMem, TRANSPARENT);
if (bct->nFontID >= 0)
- g_clcPainter.ChangeToFont(hdcMem,NULL,bct->nFontID,NULL);
-
+ g_clcPainter.ChangeToFont(hdcMem, NULL, bct->nFontID, NULL);
+
RECT TextRequiredRect = rcText;
ske_DrawText(hdcMem, bct->szText, -1, &TextRequiredRect, DT_CENTER | DT_VCENTER | DT_CALCRECT | DT_SINGLELINE);
- if (TextRequiredRect.right-TextRequiredRect.left>rcText.right-rcText.left)
+ if (TextRequiredRect.right - TextRequiredRect.left > rcText.right - rcText.left)
bCentered = FALSE;
- ske_DrawText(hdcMem, bct->szText, -1, &rcText, (bCentered ? DT_CENTER: 0) | DT_VCENTER | DT_SINGLELINE);
+ ske_DrawText(hdcMem, bct->szText, -1, &rcText, (bCentered ? DT_CENTER : 0) | DT_VCENTER | DT_SINGLELINE);
ske_ResetTextEffect(hdcMem);
}
if (!pOffset)
- BitBlt(hdcPaint, 0, 0, width,height,hdcMem, 0, 0, SRCCOPY);
+ BitBlt(hdcPaint, 0, 0, width, height, hdcMem, 0, 0, SRCCOPY);
// better to use try/finally but looks like last one is Microsoft specific
SelectObject(hdcMem, hOldFont);
@@ -242,12 +242,12 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
_tcsncpy_s(bct->szText, (TCHAR*)lParam, _TRUNCATE);
break;
- case WM_SETFONT:
+ case WM_SETFONT:
// remember the font so we can use it later
- bct->hFont = (HFONT) wParam; // maybe we should redraw?
+ bct->hFont = (HFONT)wParam; // maybe we should redraw?
bct->nFontID = (int)lParam - 1;
break;
-
+
case BUTTONSETMARGINS:
if (!lParam) {
RECT nillRect = { 0 };
@@ -298,30 +298,30 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
return 0;
case WM_LBUTTONDOWN:
- {
- POINT ptMouse = UNPACK_POINT(lParam);
+ {
+ POINT ptMouse = UNPACK_POINT(lParam);
- RECT rcClient;
- GetClientRect(bct->hwnd, &rcClient);
- if (!PtInRect(&rcClient, ptMouse)) {
- bct->bHotMark = false;
- ReleaseCapture();
- }
- else {
- if (bct->stateId != PBS_DISABLED && bct->stateId != PBS_PRESSED) {
- bct->stateId = PBS_PRESSED;
- bct->bHotMark = true;
+ RECT rcClient;
+ GetClientRect(bct->hwnd, &rcClient);
+ if (!PtInRect(&rcClient, ptMouse)) {
+ bct->bHotMark = false;
+ ReleaseCapture();
+ }
+ else {
+ if (bct->stateId != PBS_DISABLED && bct->stateId != PBS_PRESSED) {
+ bct->stateId = PBS_PRESSED;
+ bct->bHotMark = true;
+ InvalidateParentRect(bct->hwnd, NULL, TRUE);
+ if (bct->bSendOnDown) {
+ SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM)hwndDlg);
+ bct->stateId = PBS_NORMAL;
InvalidateParentRect(bct->hwnd, NULL, TRUE);
- if (bct->bSendOnDown) {
- SendMessage(GetParent(hwndDlg), WM_COMMAND, MAKELONG(GetDlgCtrlID(hwndDlg), BN_CLICKED), (LPARAM)hwndDlg);
- bct->stateId = PBS_NORMAL;
- InvalidateParentRect(bct->hwnd, NULL, TRUE);
- }
}
- SetCapture(bct->hwnd);
}
+ SetCapture(bct->hwnd);
}
- return 0;
+ }
+ return 0;
case WM_LBUTTONUP:
if (GetCapture() == bct->hwnd) {
@@ -329,7 +329,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
RECT rcClient;
GetClientRect(bct->hwnd, &rcClient);
-
+
if (!PtInRect(&rcClient, ptMouse)) {
bct->bHotMark = false;
ReleaseCapture();
@@ -354,50 +354,50 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
InvalidateParentRect(bct->hwnd, NULL, TRUE);
}
return 0;
-
+
case WM_MOUSEMOVE:
- {
- BOOL bPressed = (wParam & MK_LBUTTON) != 0;
- if (bPressed && !bct->bHotMark)
- break;
-
- RECT rc;
- POINT pt;
- GetWindowRect(hwndDlg, &rc);
- GetCursorPos(&pt);
- BOOL inClient = PtInRect(&rc, pt);
- if (inClient) {
- SetCapture(bct->hwnd);
- if (bct->stateId == PBS_NORMAL) {
- bct->stateId = PBS_HOT;
- InvalidateParentRect(bct->hwnd, NULL, TRUE);
- }
+ {
+ BOOL bPressed = (wParam & MK_LBUTTON) != 0;
+ if (bPressed && !bct->bHotMark)
+ break;
+
+ RECT rc;
+ POINT pt;
+ GetWindowRect(hwndDlg, &rc);
+ GetCursorPos(&pt);
+ BOOL inClient = PtInRect(&rc, pt);
+ if (inClient) {
+ SetCapture(bct->hwnd);
+ if (bct->stateId == PBS_NORMAL) {
+ bct->stateId = PBS_HOT;
+ InvalidateParentRect(bct->hwnd, NULL, TRUE);
}
+ }
- if (!inClient && bct->stateId == PBS_PRESSED) {
- bct->stateId = PBS_HOT;
+ if (!inClient && bct->stateId == PBS_PRESSED) {
+ bct->stateId = PBS_HOT;
+ InvalidateParentRect(bct->hwnd, NULL, TRUE);
+ }
+ else if (inClient && bct->stateId == PBS_HOT && bPressed) {
+ if (bct->bHotMark) {
+ bct->stateId = PBS_PRESSED;
InvalidateParentRect(bct->hwnd, NULL, TRUE);
}
- else if (inClient && bct->stateId == PBS_HOT && bPressed) {
- if (bct->bHotMark) {
- bct->stateId = PBS_PRESSED;
- InvalidateParentRect(bct->hwnd, NULL, TRUE);
- }
- }
- else if (!inClient && !bPressed) {
- bct->bHotMark = false;
- ReleaseCapture();
- }
}
- return 0;
+ else if (!inClient && !bPressed) {
+ bct->bHotMark = false;
+ ReleaseCapture();
+ }
+ }
+ return 0;
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 || lr == HTBOTTOMLEFT || lr == HTBOTTOMRIGHT)
- return HTTRANSPARENT;
- }
- break;
+ {
+ LRESULT lr = SendMessage(GetParent(hwndDlg), WM_NCHITTEST, wParam, lParam);
+ if (lr == HTLEFT || lr == HTRIGHT || lr == HTBOTTOM || lr == HTTOP || lr == HTTOPLEFT || lr == HTTOPRIGHT || lr == HTBOTTOMLEFT || lr == HTBOTTOMRIGHT)
+ return HTTRANSPARENT;
+ }
+ break;
case BM_SETCHECK:
if (!bct->bIsPushBtn) break;
@@ -429,7 +429,7 @@ static LRESULT CALLBACK ToolbarButtonProc(HWND hwndDlg, UINT msg, WPARAM wParam
case MBM_REFRESHICOLIBICON:
if (bct->hIcolibHandle)
bct->hIcon = Skin_GetIconByHandle(bct->hIcolibHandle);
- else
+ else
bct->hIcon = NULL;
InvalidateRect(hwndDlg, NULL, TRUE);
pcli->pfnInvalidateRect(GetParent(GetParent(hwndDlg)), NULL, TRUE);
@@ -469,7 +469,7 @@ void MakeButtonSkinned(HWND hWnd)
/////////////////////////////////////////////////////////////////////////////////////////
-void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam)
+void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM)
{
if (ttbid == TTB_WINDOW_HANDLE) {
CustomizeToolbar(hWnd);
@@ -485,8 +485,8 @@ void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-int Buttons_OnSkinModeSettingsChanged(WPARAM wParam, LPARAM lParam)
-{
+int Buttons_OnSkinModeSettingsChanged(WPARAM, LPARAM)
+{
WindowList_BroadcastAsync(hButtonWindowList, MBM_UPDATETRANSPARENTFLAG, 0, 2);
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp
index 0529ddcb98..259bab3da2 100644
--- a/plugins/Clist_modern/src/modern_toolbar.cpp
+++ b/plugins/Clist_modern/src/modern_toolbar.cpp
@@ -40,15 +40,15 @@ struct
}
static BTNS[] =
{
- { "MainMenu", LPGEN("Main menu"), "CList/ShowMainMenu", LPGEN("Main menu"), NULL, 100 , IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
- { "StatusMenu", LPGEN("Status menu"), "CList/ShowStatusMenu", LPGEN("Status menu"), NULL, 105 , IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
- { "AccoMgr", LPGEN("Accounts"), MS_PROTO_SHOWACCMGR, LPGEN("Accounts..."), NULL, 282 , IDI_ACCMGR, IDI_ACCMGR, TRUE },
- { "ShowHideOffline",LPGEN("Show/Hide offline contacts"), MS_CLIST_TOGGLEHIDEOFFLINE, LPGEN("Hide offline contacts"), LPGEN("Show offline contacts"), 110, IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
- { "FindUser",LPGEN("Find user"), "FindAdd/FindAddCommand", LPGEN("Find user"), NULL, 140 , IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
- { "Options","Options", "Options/OptionsCommand", "Options", NULL, 150 , IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
- { "UseGroups",LPGEN("Use/Disable groups"), MS_CLIST_TOGGLEGROUPS, LPGEN("Use groups"), LPGEN("Disable groups"), 160, IDI_RESETVIEW, IDI_RESETVIEW, FALSE },
- { "EnableSounds",LPGEN("Enable/Disable sounds"), MS_CLIST_TOGGLESOUNDS, LPGEN("Enable sounds"), LPGEN("Disable sounds"), 170, IDI_RESETVIEW, IDI_RESETVIEW, FALSE },
- { "Minimize",LPGEN("Minimize"), "CList/ShowHide", LPGEN("Minimize"), NULL, 180 , IDI_RESETVIEW, IDI_RESETVIEW, FALSE }
+ { "MainMenu", LPGEN("Main menu"), "CList/ShowMainMenu", LPGEN("Main menu"), NULL, 100, IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
+ { "StatusMenu", LPGEN("Status menu"), "CList/ShowStatusMenu", LPGEN("Status menu"), NULL, 105, IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
+ { "AccoMgr", LPGEN("Accounts"), MS_PROTO_SHOWACCMGR, LPGEN("Accounts..."), NULL, 282, IDI_ACCMGR, IDI_ACCMGR, TRUE },
+ { "ShowHideOffline", LPGEN("Show/Hide offline contacts"), MS_CLIST_TOGGLEHIDEOFFLINE, LPGEN("Hide offline contacts"), LPGEN("Show offline contacts"), 110, IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
+ { "FindUser", LPGEN("Find user"), "FindAdd/FindAddCommand", LPGEN("Find user"), NULL, 140, IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
+ { "Options", "Options", "Options/OptionsCommand", "Options", NULL, 150, IDI_RESETVIEW, IDI_RESETVIEW, TRUE },
+ { "UseGroups", LPGEN("Use/Disable groups"), MS_CLIST_TOGGLEGROUPS, LPGEN("Use groups"), LPGEN("Disable groups"), 160, IDI_RESETVIEW, IDI_RESETVIEW, FALSE },
+ { "EnableSounds", LPGEN("Enable/Disable sounds"), MS_CLIST_TOGGLESOUNDS, LPGEN("Enable sounds"), LPGEN("Disable sounds"), 170, IDI_RESETVIEW, IDI_RESETVIEW, FALSE },
+ { "Minimize", LPGEN("Minimize"), "CList/ShowHide", LPGEN("Minimize"), NULL, 180, IDI_RESETVIEW, IDI_RESETVIEW, FALSE }
};
static void SetButtonPressed(int i, int state)
@@ -58,7 +58,7 @@ static void SetButtonPressed(int i, int state)
void Modern_InitButtons()
{
- for (int i=0; i < SIZEOF(BTNS); i++) {
+ for (int i = 0; i < SIZEOF(BTNS); i++) {
TTBButton tbb = { 0 };
tbb.cbSize = sizeof(tbb);
@@ -70,20 +70,20 @@ void Modern_InitButtons()
char buf[255];
if (i != 0) {
- mir_snprintf(buf,SIZEOF(buf),"%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_dn");
+ mir_snprintf(buf, SIZEOF(buf), "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_dn");
tbb.hIconHandleUp = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipUp, _T("icons\\toolbar_icons.dll"), BTNS[i].icoDefIdx, g_hInst, BTNS[i].defResource);
}
else tbb.hIconHandleUp = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipUp, NULL, 0, NULL, SKINICON_OTHER_MAINMENU);
if (BTNS[i].pszTooltipDn) {
- mir_snprintf(buf,SIZEOF(buf),"%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_up");
- tbb.hIconHandleDn = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipDn, _T("icons\\toolbar_icons.dll"), BTNS[i].icoDefIdx+1, g_hInst, BTNS[i].defResource2 );
+ mir_snprintf(buf, SIZEOF(buf), "%s%s%s", TTB_OPTDIR, BTNS[i].pszButtonID, "_up");
+ tbb.hIconHandleDn = RegisterIcolibIconHandle(buf, "Toolbar", BTNS[i].pszTooltipDn, _T("icons\\toolbar_icons.dll"), BTNS[i].icoDefIdx + 1, g_hInst, BTNS[i].defResource2);
}
else tbb.hIconHandleDn = NULL;
}
else tbb.dwFlags |= TTBBF_ISSEPARATOR;
- tbb.dwFlags |= (BTNS[i].bVisByDefault ? TTBBF_VISIBLE :0 );
+ tbb.dwFlags |= (BTNS[i].bVisByDefault ? TTBBF_VISIBLE : 0);
BTNS[i].hButton = TopToolbar_AddButton(&tbb);
}
@@ -118,21 +118,21 @@ static int ehhToolBarSettingsChanged(WPARAM hContact, LPARAM lParam)
if (hContact != NULL)
return 0;
- if (!mir_strcmp(cws->szModule,"CList")) {
- if (!mir_strcmp(cws->szSetting,"HideOffline"))
+ if (!mir_strcmp(cws->szModule, "CList")) {
+ if (!mir_strcmp(cws->szSetting, "HideOffline"))
SetButtonPressed(3, cws->value.bVal);
- else if (!mir_strcmp(cws->szSetting,"UseGroups"))
+ else if (!mir_strcmp(cws->szSetting, "UseGroups"))
SetButtonPressed(6, cws->value.bVal);
}
- else if (!mir_strcmp(cws->szModule,"Skin")) {
- if (!mir_strcmp(cws->szSetting,"UseSound"))
+ else if (!mir_strcmp(cws->szModule, "Skin")) {
+ if (!mir_strcmp(cws->szSetting, "UseSound"))
SetButtonPressed(7, cws->value.bVal);
}
return 0;
}
-static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
+static int ehhToolBarBackgroundSettingsChanged(WPARAM, LPARAM)
{
if (tbdat.mtb_hBmpBackground) {
DeleteObject(tbdat.mtb_hBmpBackground);
@@ -156,21 +156,21 @@ static int ehhToolBarBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT *rect, ModernToolbarCtrl* pMTBInfo)
{
- BOOL bFloat = (GetParent(hwnd)!=pcli->hwndContactList);
+ BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat) {
HBRUSH hbr;
RECT rc;
if (rect)
- rc=*rect;
+ rc = *rect;
else
- GetClientRect(hwnd,&rc);
+ GetClientRect(hwnd, &rc);
if (!(tbdat.mtb_backgroundBmpUse && tbdat.mtb_hBmpBackground) && tbdat.mtb_useWinColors) {
HRESULT hr = S_FALSE;
if (xpt_IsThemed(pMTBInfo->mtbXPTheme))
hr = xpt_DrawTheme(pMTBInfo->mtbXPTheme, pMTBInfo->hWnd, hdc, 0, 0, &rc, &rc);
-
+
if (hr == S_FALSE) {
hbr = GetSysColorBrush(COLOR_3DFACE);
FillRect(hdc, &rc, hbr);
@@ -188,7 +188,7 @@ static BOOL sttDrawToolBarBackground(HWND hwnd, HDC hdc, RECT *rect, ModernToolb
static void sttDrawNonLayeredSkinedBar(HWND hwnd, HDC hdc)
{
- RECT rc = {0};
+ RECT rc = { 0 };
GetClientRect(hwnd, &rc);
rc.right++;
rc.bottom++;
@@ -201,8 +201,8 @@ static void sttDrawNonLayeredSkinedBar(HWND hwnd, HDC hdc)
}
else ske_BltBackImage(hwnd, hdc2, &rc);
- SendMessage(hwnd, MTBM_LAYEREDPAINT, (WPARAM)hdc2, 0);
- BitBlt(hdc, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, hdc2, rc.left, rc.top, SRCCOPY);
+ SendMessage(hwnd, MTBM_LAYEREDPAINT, (WPARAM)hdc2, 0);
+ BitBlt(hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, hdc2, rc.left, rc.top, SRCCOPY);
SelectObject(hdc2, hbmpo);
DeleteObject(hbmp);
DeleteDC(hdc2);
@@ -215,52 +215,52 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
{
ModernToolbarCtrl* pMTBInfo = (ModernToolbarCtrl*)GetWindowLongPtr(hwnd, 0);
- switch( msg ) {
+ switch (msg) {
case WM_ERASEBKGND:
return (g_CluiData.fDisableSkinEngine) ? sttDrawToolBarBackground(hwnd, (HDC)wParam, NULL, pMTBInfo) : 0;
case WM_NCPAINT:
case WM_PAINT:
- {
- PAINTSTRUCT ps;
- BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
- if (g_CluiData.fDisableSkinEngine|| !g_CluiData.fLayered || bFloat ) {
- BeginPaint(hwnd,&ps);
- if ((!g_CluiData.fLayered || bFloat) && !g_CluiData.fDisableSkinEngine)
- sttDrawNonLayeredSkinedBar(hwnd, ps.hdc);
- else
- sttDrawToolBarBackground(hwnd, ps.hdc, &ps.rcPaint, pMTBInfo);
- EndPaint(hwnd,&ps);
- }
+ {
+ PAINTSTRUCT ps;
+ BOOL bFloat = (GetParent(hwnd) != pcli->hwndContactList);
+ if (g_CluiData.fDisableSkinEngine || !g_CluiData.fLayered || bFloat) {
+ BeginPaint(hwnd, &ps);
+ if ((!g_CluiData.fLayered || bFloat) && !g_CluiData.fDisableSkinEngine)
+ sttDrawNonLayeredSkinedBar(hwnd, ps.hdc);
+ else
+ sttDrawToolBarBackground(hwnd, ps.hdc, &ps.rcPaint, pMTBInfo);
+ EndPaint(hwnd, &ps);
}
- return DefWindowProc(hwnd, msg, wParam, lParam);
+ }
+ return DefWindowProc(hwnd, msg, 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:
- {
- RECT MyRect={0};
- HDC hDC=(HDC)wParam;
- GetWindowRect(hwnd,&MyRect);
-
- RECT rcClient;
- GetClientRect(hwnd, &rcClient);
- SkinDrawGlyph(hDC, &rcClient, &rcClient, "Bar,ID=ToolBar,Part=Background");
-
- for (int i=0; i < pMTBInfo->pButtonList->realCount; i++) {
- RECT childRect;
- POINT Offset;
- TTBCtrlButton* mtbi = (TTBCtrlButton*)pMTBInfo->pButtonList->items[i];
- GetWindowRect(mtbi->hWindow, &childRect);
- Offset.x = childRect.left - MyRect.left;
- Offset.y = childRect.top - MyRect.top;
- SendMessage(mtbi->hWindow, BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
- }
+ {
+ RECT MyRect = { 0 };
+ HDC hDC = (HDC)wParam;
+ GetWindowRect(hwnd, &MyRect);
+
+ RECT rcClient;
+ GetClientRect(hwnd, &rcClient);
+ SkinDrawGlyph(hDC, &rcClient, &rcClient, "Bar,ID=ToolBar,Part=Background");
+
+ for (int i = 0; i < pMTBInfo->pButtonList->realCount; i++) {
+ RECT childRect;
+ POINT Offset;
+ TTBCtrlButton* mtbi = (TTBCtrlButton*)pMTBInfo->pButtonList->items[i];
+ GetWindowRect(mtbi->hWindow, &childRect);
+ Offset.x = childRect.left - MyRect.left;
+ Offset.y = childRect.top - MyRect.top;
+ SendMessage(mtbi->hWindow, BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
}
- return 0;
+ }
+ return 0;
case WM_DESTROY:
xpt_FreeThemeForWindow(hwnd);
@@ -271,9 +271,9 @@ static LRESULT CALLBACK toolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
return mir_callNextSubclass(hwnd, toolbarWndProc, msg, wParam, lParam);
}
-static int ToolBar_LayeredPaintProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData)
+static int ToolBar_LayeredPaintProc(HWND hWnd, HDC hDC, RECT *, HRGN, DWORD, void *)
{
- return SendMessage(hWnd, MTBM_LAYEREDPAINT,(WPARAM)hDC,0);
+ return SendMessage(hWnd, MTBM_LAYEREDPAINT, (WPARAM)hDC, 0);
}
void CustomizeToolbar(HWND hwnd)
@@ -292,7 +292,7 @@ void CustomizeToolbar(HWND hwnd)
Frame.hIcon = LoadSkinnedIcon(SKINICON_OTHER_FRAME);
pMTBInfo->hFrame = (HANDLE)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&Frame, 0);
- CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)hwnd,(LPARAM)ToolBar_LayeredPaintProc);
+ CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)hwnd, (LPARAM)ToolBar_LayeredPaintProc);
pMTBInfo->mtbXPTheme = xpt_AddThemeHandle(hwnd, L"TOOLBAR");
pMTBInfo->bHardUpdate = TRUE;
@@ -308,14 +308,14 @@ static TCHAR szWarning[] = LPGENT("To view a toolbar in Clist_modern you need th
static void CopySettings(const char* to, const char* from, int defValue)
{
- db_set_b(NULL, TTB_OPTDIR, to, db_get_b(NULL,"ModernToolBar",from, defValue));
+ db_set_b(NULL, TTB_OPTDIR, to, db_get_b(NULL, "ModernToolBar", from, defValue));
}
/////////////////////////////////////////////////////////////////////////////////////////
void CustomizeButton(HANDLE ttbid, HWND hWnd, LPARAM lParam);
-static int Toolbar_ModuleReloaded(WPARAM wParam, LPARAM lParam)
+static int Toolbar_ModuleReloaded(WPARAM wParam, LPARAM)
{
PLUGININFOEX *pInfo = (PLUGININFOEX*)wParam;
if (!_stricmp(pInfo->shortName, "TopToolBar"))
@@ -326,7 +326,7 @@ static int Toolbar_ModuleReloaded(WPARAM wParam, LPARAM lParam)
static int Toolbar_ModulesLoaded(WPARAM, LPARAM)
{
- CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)(LPGEN("Toolbar background")"/ToolBar"),0);
+ CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)(LPGEN("Toolbar background")"/ToolBar"), 0);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ehhToolBarSettingsChanged);
@@ -335,11 +335,11 @@ static int Toolbar_ModulesLoaded(WPARAM, LPARAM)
BYTE bOldSetting = 0;
if (!db_get_b(NULL, "Compatibility", "TTB_Upgrade", 0)) {
if (bOldSetting = db_get_b(NULL, "CLUI", "ShowButtonBar", 1)) {
- CopySettings("BUTTWIDTH", "option_Bar0_BtnWidth", 20);
- CopySettings("BUTTHEIGHT", "option_Bar0_BtnHeight", 20);
- CopySettings("BUTTGAP", "option_Bar0_BtnSpace", 1);
- CopySettings("BUTTAUTOSIZE", "option_Bar0_Autosize", 1);
- CopySettings("BUTTMULTI", "option_Bar0_Multiline", 1);
+ CopySettings("BUTTWIDTH", "option_Bar0_BtnWidth", 20);
+ CopySettings("BUTTHEIGHT", "option_Bar0_BtnHeight", 20);
+ CopySettings("BUTTGAP", "option_Bar0_BtnSpace", 1);
+ CopySettings("BUTTAUTOSIZE", "option_Bar0_Autosize", 1);
+ CopySettings("BUTTMULTI", "option_Bar0_Multiline", 1);
db_unset(NULL, "CLUI", "ShowButtonBar");
@@ -348,7 +348,7 @@ static int Toolbar_ModulesLoaded(WPARAM, LPARAM)
db_set_b(NULL, "Compatibility", "TTB_Upgrade", 1);
}
- if (!ServiceExists( MS_TTB_REMOVEBUTTON) && bOldSetting == 1)
+ if (!ServiceExists(MS_TTB_REMOVEBUTTON) && bOldSetting == 1)
if (IDYES == MessageBox(NULL, TranslateTS(szWarning), TranslateT("Toolbar upgrade"), MB_ICONQUESTION | MB_YESNO))
CallService(MS_UTILS_OPENURL, 0, (LPARAM)szUrl);
diff --git a/plugins/Clist_modern/src/modern_utils.cpp b/plugins/Clist_modern/src/modern_utils.cpp
index f0f3f532a5..1dbd55bb5d 100644
--- a/plugins/Clist_modern/src/modern_utils.cpp
+++ b/plugins/Clist_modern/src/modern_utils.cpp
@@ -2,39 +2,39 @@
BYTE gl_TrimText = 1;
-char * __cdecl strstri( char *a, const char *b)
+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);
- char * pos = strstr(x,y);
- if ( pos )
- {
- char * retval = a + ( pos - x );
- free(x);
- free(y);
- return retval;
- }
- free(x);
- free(y);
- return NULL;
+ char * x, *y;
+ if (!a || !b) return FALSE;
+ x = _strdup(a);
+ y = _strdup(b);
+ x = _strupr(x);
+ y = _strupr(y);
+ char * pos = strstr(x, y);
+ if (pos)
+ {
+ char * retval = a + (pos - x);
+ free(x);
+ free(y);
+ return retval;
+ }
+ free(x);
+ free(y);
+ return NULL;
}
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 _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:_T(""),b?b:_T("")) == 0;
- return _tcsicmp(a,b) == 0;
+ if (a == NULL || b == NULL) return _tcsicmp(a ? a : _T(""), b ? b : _T("")) == 0;
+ return _tcsicmp(a, b) == 0;
}
#ifdef strlen
@@ -45,13 +45,13 @@ BOOL __cdecl mir_bool_tstrcmpi(const TCHAR *a, const TCHAR *b)
//copy len symbols from string - do not check is it null terminated or len is more then actual
char * strdupn(const char * src, int len)
{
- char * p;
- if (src == NULL) return NULL;
- p = (char*)malloc(len+1);
- if (!p) return 0;
- memcpy(p,src,len);
- p[len] = '\0';
- return p;
+ char * p;
+ if (src == NULL) return NULL;
+ p = (char*)malloc(len + 1);
+ if (!p) return 0;
+ memcpy(p, src, len);
+ p[len] = '\0';
+ return p;
}
DWORD exceptFunction(LPEXCEPTION_POINTERS EP)
@@ -63,7 +63,7 @@ DWORD exceptFunction(LPEXCEPTION_POINTERS EP)
EP->ExceptionRecord->ExceptionAddress);
TRACE(buf);
- MessageBoxA(0, buf,"clist_mw Exception",0);
+ MessageBoxA(0, buf, "clist_mw Exception", 0);
return EXCEPTION_EXECUTE_HANDLER;
}
@@ -82,18 +82,18 @@ void TRACE_ERROR()
NULL,
t,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language
- (LPTSTR) &lpMsgBuf,
- 0,
- NULL ))
+ (LPTSTR)&lpMsgBuf,
+ 0,
+ NULL))
{
// Handle the error.
- return ;
+ return;
}
#ifdef _DEBUG
- MessageBox( NULL, (LPCTSTR)lpMsgBuf, _T("Error"), MB_OK | MB_ICONINFORMATION );
+ MessageBox(NULL, (LPCTSTR)lpMsgBuf, _T("Error"), MB_OK | MB_ICONINFORMATION);
DebugBreak();
#endif
- LocalFree( lpMsgBuf );
+ LocalFree(lpMsgBuf);
}
BOOL DebugDeleteObject(HGDIOBJ a)
@@ -110,11 +110,11 @@ BOOL DebugDeleteObject(HGDIOBJ a)
// load small icon (not shared) it IS NEED to be destroyed
HICON LoadSmallIcon(HINSTANCE hInstance, int index)
{
- TCHAR filename[MAX_PATH] = {0};
+ TCHAR filename[MAX_PATH] = { 0 };
GetModuleFileName(hInstance, filename, MAX_PATH);
HICON hIcon = NULL;
- ExtractIconEx(filename, index, NULL, &hIcon, 1);
+ ExtractIconEx(filename, index, NULL, &hIcon, 1);
return hIcon;
}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index 6d075bb8eb..45a9130888 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -33,7 +33,7 @@ $Id: viewmodes.c 2998 2006-06-01 07:11:52Z nightwish2004 $
#define TIMERID_VIEWMODEEXPIRE 100
-typedef int (__cdecl *pfnEnumCallback)(char *szName);
+typedef int(__cdecl *pfnEnumCallback)(char *szName);
static HWND clvmHwnd = 0;
static int clvm_curItem = 0;
HMENU hViewModeMenu = 0;
@@ -47,41 +47,41 @@ static char g_szModename[2048];
static int g_ViewModeOptDlg = FALSE;
-static UINT _page1Controls[] = {IDC_STATIC1, IDC_STATIC2, IDC_STATIC3, IDC_STATIC5, IDC_STATIC4,
- IDC_STATIC8, IDC_ADDVIEWMODE, IDC_DELETEVIEWMODE, IDC_NEWVIEMODE, IDC_GROUPS, IDC_PROTOCOLS,
- IDC_VIEWMODES, IDC_STATUSMODES, IDC_STATIC12, IDC_STATIC13, IDC_STATIC14, IDC_PROTOGROUPOP, IDC_GROUPSTATUSOP,
- IDC_AUTOCLEAR, IDC_AUTOCLEARVAL, IDC_AUTOCLEARSPIN, IDC_STATIC15, IDC_STATIC16,
- IDC_LASTMESSAGEOP, IDC_LASTMESSAGEUNIT, IDC_LASTMSG, IDC_LASTMSGVALUE, IDC_USEGROUPS, 0};
+static UINT _page1Controls[] = { IDC_STATIC1, IDC_STATIC2, IDC_STATIC3, IDC_STATIC5, IDC_STATIC4,
+IDC_STATIC8, IDC_ADDVIEWMODE, IDC_DELETEVIEWMODE, IDC_NEWVIEMODE, IDC_GROUPS, IDC_PROTOCOLS,
+IDC_VIEWMODES, IDC_STATUSMODES, IDC_STATIC12, IDC_STATIC13, IDC_STATIC14, IDC_PROTOGROUPOP, IDC_GROUPSTATUSOP,
+IDC_AUTOCLEAR, IDC_AUTOCLEARVAL, IDC_AUTOCLEARSPIN, IDC_STATIC15, IDC_STATIC16,
+IDC_LASTMESSAGEOP, IDC_LASTMESSAGEUNIT, IDC_LASTMSG, IDC_LASTMSGVALUE, IDC_USEGROUPS, 0 };
-static UINT _page2Controls[] = {IDC_CLIST, IDC_STATIC9, IDC_STATIC8, IDC_CLEARALL, IDC_CURVIEWMODE2, 0};
+static UINT _page2Controls[] = { IDC_CLIST, IDC_STATIC9, IDC_STATIC8, IDC_CLEARALL, IDC_CURVIEWMODE2, 0 };
-void ApplyViewMode(const char *Name, bool onlySelector = false );
-static UINT _buttons[] = {IDC_RESETMODES, IDC_SELECTMODE, IDC_CONFIGUREMODES, 0};
+void ApplyViewMode(const char *Name, bool onlySelector = false);
+static UINT _buttons[] = { IDC_RESETMODES, IDC_SELECTMODE, IDC_CONFIGUREMODES, 0 };
static BOOL sttDrawViewModeBackground(HWND hwnd, HDC hdc, RECT *rect);
-static void DeleteViewMode( char * szName );
+static void DeleteViewMode(char * szName);
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)
+static int ViewModePaintCallbackProc(HWND hWnd, HDC hDC, RECT *, HRGN, DWORD, void *)
{
int i;
- RECT MyRect = {0};
- GetWindowRect(hWnd,&MyRect);
- DrawViewModeBar(hWnd,hDC);
- for (i=0; _buttons[i] != 0; i++)
+ RECT MyRect = { 0 };
+ GetWindowRect(hWnd, &MyRect);
+ DrawViewModeBar(hWnd, hDC);
+ 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;
+ GetWindowRect(GetDlgItem(hWnd, _buttons[i]), &childRect);
+ Offset.x = childRect.left - MyRect.left;
+ Offset.y = childRect.top - MyRect.top;
SendDlgItemMessage(hWnd, _buttons[i], BUTTONDRAWINPARENT, (WPARAM)hDC, (LPARAM)&Offset);
}
@@ -119,7 +119,7 @@ int FillModes(char *szsetting)
return 1;
TCHAR * temp;
- mir_utf8decode(szsetting,&temp);
+ mir_utf8decode(szsetting, &temp);
if (temp) {
SendDlgItemMessage(clvmHwnd, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)temp);
mir_free(temp);
@@ -130,7 +130,7 @@ int FillModes(char *szsetting)
static void ShowPage(HWND hwnd, int page)
{
- int i=0;
+ int i = 0;
int pageChange = 0;
if (page == 0 && IsWindowVisible(GetDlgItem(hwnd, _page2Controls[0])))
@@ -142,19 +142,19 @@ static void ShowPage(HWND hwnd, int page)
if (pageChange)
SendMessage(hwnd, WM_SETREDRAW, FALSE, 0);
- switch(page) {
+ switch (page) {
case 0:
- while(_page1Controls[i] != 0)
+ while (_page1Controls[i] != 0)
ShowWindow(GetDlgItem(hwnd, _page1Controls[i++]), SW_SHOW);
- i=0;
- while(_page2Controls[i] != 0)
+ i = 0;
+ while (_page2Controls[i] != 0)
ShowWindow(GetDlgItem(hwnd, _page2Controls[i++]), SW_HIDE);
break;
case 1:
- while(_page1Controls[i] != 0)
+ while (_page1Controls[i] != 0)
ShowWindow(GetDlgItem(hwnd, _page1Controls[i++]), SW_HIDE);
- i=0;
- while(_page2Controls[i] != 0)
+ i = 0;
+ while (_page2Controls[i] != 0)
ShowWindow(GetDlgItem(hwnd, _page2Controls[i++]), SW_SHOW);
break;
}
@@ -177,7 +177,7 @@ static DWORD GetMaskForItem(HANDLE hItem)
{
DWORD dwMask = 0;
- for (int i=0; i <= ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE; i++)
+ 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;
@@ -199,21 +199,21 @@ static void UpdateStickies()
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));
- HANDLE 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) {
+ HANDLE 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);
+ hItem = (HANDLE)SendDlgItemMessage(clvmHwnd, IDC_CLIST, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hItem);
}
ShowPage(clvmHwnd, 0);
}
static int FillDialog(HWND hwnd)
{
- LVCOLUMN lvc = {0};
+ LVCOLUMN lvc = { 0 };
HWND hwndList = GetDlgItem(hwnd, IDC_PROTOCOLS);
- LVITEMA item = {0};
+ LVITEMA item = { 0 };
int protoCount = 0, i, newItem;
PROTOACCOUNT **accs;
@@ -224,11 +224,11 @@ static int FillDialog(HWND hwnd)
ListView_InsertColumn(GetDlgItem(hwnd, IDC_PROTOCOLS), 0, &lvc);
// fill protocols...
- ProtoEnumAccounts( &protoCount, &accs );
+ ProtoEnumAccounts(&protoCount, &accs);
item.mask = LVIF_TEXT;
item.iItem = 1000;
- for (i=0; i < protoCount; i++)
+ for (i = 0; i < protoCount; i++)
{
item.pszText = accs[i]->szModuleName;
newItem = SendMessageA(hwndList, LVM_INSERTITEMA, 0, (LPARAM)&item);
@@ -246,7 +246,7 @@ static int FillDialog(HWND hwnd)
lvc.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;
ListView_InsertColumn(hwndList, 0, &lvc);
- LVITEM item = {0};
+ LVITEM item = { 0 };
item.mask = LVIF_TEXT;
item.iItem = 1000;
@@ -254,7 +254,7 @@ static int FillDialog(HWND hwnd)
newItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
TCHAR *szGroup;
- for (int i=1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++) {
+ for (int i = 1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++) {
item.pszText = szGroup;
newItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
}
@@ -268,7 +268,7 @@ static int FillDialog(HWND hwnd)
ListView_InsertColumn(hwndList, 0, &lvc);
for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
{
- LVITEM item = {0};
+ LVITEM item = { 0 };
item.mask = LVIF_TEXT;
item.pszText = pcli->pfnGetStatusModeDescription(i, 0);
item.iItem = i - ID_STATUS_OFFLINE;
@@ -294,73 +294,73 @@ static int FillDialog(HWND hwnd)
return 0;
}
-static void SetAllChildIcons(HWND hwndList,HANDLE hFirstItem,int iColumn,int iImage)
+static void SetAllChildIcons(HWND hwndList, HANDLE hFirstItem, int iColumn, int iImage)
{
- int typeOfFirst,iOldIcon;
- HANDLE hItem,hChildItem;
+ 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);
- while(hItem)
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTGROUP, (LPARAM)hFirstItem);
+ while (hItem)
{
- hChildItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
+ 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);
+ SetAllChildIcons(hwndList, hChildItem, iColumn, iImage);
+ 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);
- while(hItem) {
- iOldIcon = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
- if (iOldIcon != EMPTY_EXTRA_ICON && iOldIcon != iImage) SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_NEXTCONTACT,(LPARAM)hItem);
+ else hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hFirstItem);
+ while (hItem) {
+ iOldIcon = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
+ if (iOldIcon != EMPTY_EXTRA_ICON && iOldIcon != iImage) SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_NEXTCONTACT, (LPARAM)hItem);
}
}
-static void SetIconsForColumn(HWND hwndList,HANDLE hItem,HANDLE hItemAll,int iColumn,int iImage)
+static void SetIconsForColumn(HWND hwndList, HANDLE hItem, HANDLE hItemAll, int iColumn, int iImage)
{
int itemType;
- itemType = SendMessage(hwndList,CLM_GETITEMTYPE,(WPARAM)hItem,0);
+ itemType = SendMessage(hwndList, CLM_GETITEMTYPE, (WPARAM)hItem, 0);
if (itemType == CLCIT_CONTACT) {
- int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
+ int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
}
else if (itemType == CLCIT_INFO) {
- int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
+ int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
if (hItem == hItemAll)
- SetAllChildIcons(hwndList,hItem,iColumn,iImage);
+ SetAllChildIcons(hwndList, hItem, iColumn, iImage);
else
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage)); //hItemUnknown
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage)); //hItemUnknown
}
else if (itemType == CLCIT_GROUP) {
- int oldiImage = SendMessage(hwndList,CLM_GETEXTRAIMAGE,(WPARAM)hItem,iColumn);
+ int oldiImage = SendMessage(hwndList, CLM_GETEXTRAIMAGE, (WPARAM)hItem, iColumn);
if (oldiImage != EMPTY_EXTRA_ICON && oldiImage != iImage)
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(iColumn,iImage));
- hItem = (HANDLE)SendMessage(hwndList,CLM_GETNEXTITEM,CLGN_CHILD,(LPARAM)hItem);
+ SendMessage(hwndList, CLM_SETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(iColumn, iImage));
+ hItem = (HANDLE)SendMessage(hwndList, CLM_GETNEXTITEM, CLGN_CHILD, (LPARAM)hItem);
if (hItem)
- SetAllChildIcons(hwndList,hItem,iColumn,iImage);
+ SetAllChildIcons(hwndList, hItem, iColumn, iImage);
}
}
static int DeleteAutoModesCallback(char *szsetting)
{
- if ( szsetting[0] == (char)13 )
- DeleteViewMode( szsetting );
+ if (szsetting[0] == (char)13)
+ DeleteViewMode(szsetting);
return 1;
}
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)
+ unsigned int stickies, unsigned int operators, unsigned int lmdat)
{
- CLVM_EnumModes( DeleteAutoModesCallback );
+ CLVM_EnumModes(DeleteAutoModesCallback);
char szSetting[512];
mir_snprintf(szSetting, SIZEOF(szSetting), "%c%s_PF", 246, name);
@@ -394,11 +394,11 @@ void SaveState()
return;
{
- LVITEMA item = {0};
+ LVITEMA item = { 0 };
char szTemp[256];
HWND hwndList = GetDlgItem(clvmHwnd, IDC_PROTOCOLS);
- for (int i=0; i < ListView_GetItemCount(hwndList); i++) {
+ for (int i = 0; i < ListView_GetItemCount(hwndList); i++) {
if (ListView_GetCheckState(hwndList, i)) {
item.mask = LVIF_TEXT;
item.pszText = szTemp;
@@ -412,14 +412,14 @@ void SaveState()
}
}
{
- LVITEM item = {0};
+ LVITEM item = { 0 };
TCHAR szTemp[256];
HWND hwndList = GetDlgItem(clvmHwnd, IDC_GROUPS);
operators |= ListView_GetCheckState(hwndList, 0) ? CLVM_INCLUDED_UNGROUPED : 0;
- for (int i=0; i < ListView_GetItemCount(hwndList); i++) {
+ for (int i = 0; i < ListView_GetItemCount(hwndList); i++) {
if (ListView_GetCheckState(hwndList, i)) {
item.mask = LVIF_TEXT;
item.pszText = szTemp;
@@ -469,8 +469,8 @@ void SaveState()
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_LASTMSG) ? CLVM_USELASTMSG : 0) |
+ (IsDlgButtonChecked(clvmHwnd, IDC_USEGROUPS) == BST_CHECKED ? CLVM_USEGROUPS : 0) |
(IsDlgButtonChecked(clvmHwnd, IDC_USEGROUPS) == BST_UNCHECKED ? CLVM_DONOTUSEGROUPS : 0)
);
@@ -497,13 +497,13 @@ void SaveState()
static void UpdateFilters()
{
- DBVARIANT dbv_pf = {0};
- DBVARIANT dbv_gf = {0};
+ 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 statusMask = 0;
DWORD dwFlags;
DWORD opt;
TCHAR szTemp[100];
@@ -513,7 +513,7 @@ static void UpdateFilters()
iLen = SendDlgItemMessageA(clvmHwnd, IDC_VIEWMODES, LB_GETTEXTLEN, clvm_curItem, 0);
- if ( iLen == 0 )
+ if (iLen == 0)
return;
szTempBuf = (TCHAR *)mir_alloc((iLen + 1)*sizeof(TCHAR));
@@ -541,7 +541,7 @@ static void UpdateFilters()
stickyStatusMask = db_get_dw(NULL, CLVM_MODULE, szSetting, -1);
dwFlags = db_get_dw(NULL, CLVM_MODULE, szBuf, 0);
{
- LVITEMA item = {0};
+ LVITEMA item = { 0 };
char szTemp[256];
char szMask[256];
int i;
@@ -551,7 +551,7 @@ static void UpdateFilters()
item.pszText = szTemp;
item.cchTextMax = SIZEOF(szTemp);
- for (i=0; i < ListView_GetItemCount(hwndList); i++)
+ for (i = 0; i < ListView_GetItemCount(hwndList); i++)
{
item.iItem = i;
SendMessageA(hwndList, LVM_GETITEMA, 0, (LPARAM)&item);
@@ -563,7 +563,7 @@ static void UpdateFilters()
}
}
{
- LVITEM item = {0};
+ LVITEM item = { 0 };
TCHAR szTemp[256];
TCHAR szMask[256];
int i;
@@ -604,7 +604,7 @@ static void UpdateFilters()
{
int useLastMsg = dwFlags & CLVM_USELASTMSG;
- int useGroupsState = (dwFlags & CLVM_USEGROUPS) ? BST_CHECKED : (dwFlags & CLVM_DONOTUSEGROUPS) ? BST_UNCHECKED : BST_INDETERMINATE ;
+ int useGroupsState = (dwFlags & CLVM_USEGROUPS) ? BST_CHECKED : (dwFlags & CLVM_DONOTUSEGROUPS) ? BST_UNCHECKED : BST_INDETERMINATE;
DWORD lmdat;
BYTE bTmp;
@@ -634,7 +634,7 @@ cleanup:
mir_free(szTempBuf);
}
-void DeleteViewMode( char * szName )
+void DeleteViewMode(char * szName)
{
char szSetting[256];
@@ -665,7 +665,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
clvmHwnd = hwndDlg;
- switch(msg) {
+ switch (msg) {
case WM_INITDIALOG:
xpt_EnableThemeDialogTexture(hwndDlg, ETDT_ENABLETAB);
himlViewModes = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 12, 0);
@@ -699,9 +699,9 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
FillDialog(hwndDlg);
EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), FALSE);
{
- LONG_PTR style = GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST),GWL_STYLE);
+ LONG_PTR style = GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE);
style &= (~CLS_SHOWHIDDEN);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST),GWL_STYLE,style);
+ SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE, style);
}
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)himlViewModes);
@@ -745,7 +745,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
return TRUE;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_PROTOGROUPOP:
case IDC_GROUPSTATUSOP:
case IDC_LASTMESSAGEUNIT:
@@ -763,14 +763,14 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
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;
+ {
+ 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:
@@ -783,12 +783,12 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
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));
+ 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 );
+ 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) {
@@ -807,43 +807,43 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case IDC_ADDVIEWMODE:
- {
- TCHAR szBuf[256];
- szBuf[0] = 0;
- GetDlgItemText(hwndDlg, IDC_NEWVIEMODE, szBuf, SIZEOF(szBuf));
- szBuf[255] = 0;
-
- if (szBuf[0] != 0) {
- char *szUTF8Buf = mir_utf8encodeT(szBuf);
-
- if (db_get_dw(NULL, CLVM_MODULE, szUTF8Buf, -1) != -1)
- MessageBox(0, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK);
- else {
- 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);
- }
+ {
+ TCHAR szBuf[256];
+ szBuf[0] = 0;
+ GetDlgItemText(hwndDlg, IDC_NEWVIEMODE, szBuf, SIZEOF(szBuf));
+ szBuf[255] = 0;
+
+ if (szBuf[0] != 0) {
+ char *szUTF8Buf = mir_utf8encodeT(szBuf);
+
+ if (db_get_dw(NULL, CLVM_MODULE, szUTF8Buf, -1) != -1)
+ MessageBox(0, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK);
+ else {
+ 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;
+ SetDlgItemText(hwndDlg, IDC_NEWVIEMODE, _T(""));
+ mir_free(szUTF8Buf);
}
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ADDVIEWMODE), FALSE);
+ UpdateFilters();
+ break;
+ }
case IDC_CLEARALL:
- {
- for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
- if (hItem)
- SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);
- }
+ {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
+ if (hItem)
+ SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 0);
}
+ }
case IDOK:
case IDC_APPLY:
SaveState();
@@ -870,12 +870,12 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
case WM_NOTIFY:
- switch (((LPNMHDR) lParam)->idFrom) {
+ 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)
+ if (((LPNMHDR)lParam)->code == NM_CLICK || ((LPNMHDR)lParam)->code == CLN_CHECKCHANGED)
EnableWindow(GetDlgItem(hwndDlg, IDC_APPLY), TRUE);
if (((LPNMHDR)lParam)->code == NM_CLICK) {
@@ -884,24 +884,24 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP
break;
DWORD hitFlags;
- HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
+ HANDLE 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;
- int iImage = SendDlgItemMessage(hwndDlg,IDC_CLIST,CLM_GETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(nm->iColumn,0));
+ int iImage = SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
if (iImage == nullImage)
iImage = nm->iColumn;
else if (iImage != EMPTY_EXTRA_ICON)
iImage = nullImage;
- SetIconsForColumn(GetDlgItem(hwndDlg,IDC_CLIST),hItem,hInfoItem,nm->iColumn,iImage);
+ SetIconsForColumn(GetDlgItem(hwndDlg, IDC_CLIST), hItem, hInfoItem, nm->iColumn, iImage);
}
break;
case IDC_TAB:
- if (((LPNMHDR) lParam)->code == TCN_SELCHANGE) {
+ if (((LPNMHDR)lParam)->code == TCN_SELCHANGE) {
int id = TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_TAB));
if (id == 0)
ShowPage(hwndDlg, 0);
@@ -959,58 +959,58 @@ void BuildViewModeMenu()
LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch(msg) {
+ switch (msg) {
case WM_CREATE:
- {
- RECT rcMargins = {12, 0, 2,0};
- hwndSelector = CreateWindow( MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP , 0, 0, 20, 20,
- hwnd, (HMENU) IDC_SELECTMODE, g_hInst, NULL);
- MakeButtonSkinned(hwndSelector);
- SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), BATF_TCHAR);
- SendMessage(hwndSelector, BUTTONSETMARGINS,0 ,(LPARAM) &rcMargins);
- SendMessage(hwndSelector, BUTTONSETID,0 ,(LPARAM) "ViewMode.Select");
- SendMessage(hwndSelector, WM_SETFONT,0 ,(LPARAM) FONTID_VIEMODES+1 );
- SendMessage(hwndSelector, BUTTONSETASFLATBTN, TRUE, 0 );
- SendMessage(hwndSelector, MBM_UPDATETRANSPARENTFLAG, 0, 2);
- SendMessage(hwndSelector, BUTTONSETSENDONDOWN, 0 ,(LPARAM) 1 );
-
- //SendMessage(hwndSelector, BM_SETASMENUACTION, 1, 0);
- HWND hwndButton = CreateWindow( MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU) IDC_CONFIGUREMODES, g_hInst, NULL);
- MakeButtonSkinned(hwndButton);
- SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), BATF_TCHAR);
- SendMessage(hwndButton, BUTTONSETID,0 ,(LPARAM) "ViewMode.Setup");
- SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0 );
- SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
-
- hwndButton = CreateWindow( MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU) IDC_RESETMODES, g_hInst, NULL);
- MakeButtonSkinned(hwndButton);
- SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), BATF_TCHAR);
- SendMessage(hwndButton, BUTTONSETID,0 ,(LPARAM) "ViewMode.Clear");
- SendMessage(hwnd, WM_USER + 100, 0, 0);
- SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0 );
- SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
- }
- return FALSE;
+ {
+ RECT rcMargins = { 12, 0, 2, 0 };
+ hwndSelector = CreateWindow(MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
+ hwnd, (HMENU)IDC_SELECTMODE, g_hInst, NULL);
+ MakeButtonSkinned(hwndSelector);
+ SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), BATF_TCHAR);
+ SendMessage(hwndSelector, BUTTONSETMARGINS, 0, (LPARAM)&rcMargins);
+ SendMessage(hwndSelector, BUTTONSETID, 0, (LPARAM) "ViewMode.Select");
+ SendMessage(hwndSelector, WM_SETFONT, 0, (LPARAM)FONTID_VIEMODES + 1);
+ SendMessage(hwndSelector, BUTTONSETASFLATBTN, TRUE, 0);
+ SendMessage(hwndSelector, MBM_UPDATETRANSPARENTFLAG, 0, 2);
+ SendMessage(hwndSelector, BUTTONSETSENDONDOWN, 0, (LPARAM)1);
+
+ //SendMessage(hwndSelector, BM_SETASMENUACTION, 1, 0);
+ HWND hwndButton = CreateWindow(MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
+ hwnd, (HMENU)IDC_CONFIGUREMODES, g_hInst, NULL);
+ MakeButtonSkinned(hwndButton);
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), BATF_TCHAR);
+ SendMessage(hwndButton, BUTTONSETID, 0, (LPARAM) "ViewMode.Setup");
+ SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0);
+ SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
+
+ hwndButton = CreateWindow(MIRANDABUTTONCLASS, _T(""), BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
+ hwnd, (HMENU)IDC_RESETMODES, g_hInst, NULL);
+ MakeButtonSkinned(hwndButton);
+ SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), BATF_TCHAR);
+ SendMessage(hwndButton, BUTTONSETID, 0, (LPARAM) "ViewMode.Clear");
+ SendMessage(hwnd, WM_USER + 100, 0, 0);
+ SendMessage(hwndButton, BUTTONSETASFLATBTN, TRUE, 0);
+ SendMessage(hwndButton, MBM_UPDATETRANSPARENTFLAG, 0, 2);
+ }
+ return FALSE;
case WM_NCCALCSIZE:
return 18;// FrameNCCalcSize(hwnd, DefWindowProc, wParam, lParam, hasTitleBar);
case WM_SIZE:
- {
- RECT rcCLVMFrame;
- HDWP PosBatch = BeginDeferWindowPos(3);
- GetClientRect(hwnd, &rcCLVMFrame);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), 0,
- rcCLVMFrame.right - 23, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), 0,
- rcCLVMFrame.right - 45, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), 0,
- 1, 1, rcCLVMFrame.right - 46, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- EndDeferWindowPos(PosBatch);
- }
- break;
+ {
+ RECT rcCLVMFrame;
+ HDWP PosBatch = BeginDeferWindowPos(3);
+ GetClientRect(hwnd, &rcCLVMFrame);
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), 0,
+ rcCLVMFrame.right - 23, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), 0,
+ rcCLVMFrame.right - 45, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), 0,
+ 1, 1, rcCLVMFrame.right - 46, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
+ EndDeferWindowPos(PosBatch);
+ }
+ break;
case WM_USER + 100:
SendDlgItemMessage(hwnd, IDC_RESETMODES, MBM_SETICOLIBHANDLE, 0,
@@ -1020,7 +1020,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
(LPARAM)RegisterIcolibIconHandle("CLN_CLVM_set", LPGEN("Contact list"), LPGEN("Setup view modes"), NULL, 0, g_hInst, IDI_SETVIEW));
{
- for (int i=0; _buttons[i] != 0; i++) {
+ for (int i = 0; _buttons[i] != 0; i++) {
SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwnd, _buttons[i], BUTTONSETASFLATBTN + 10, 0, 0);
}
@@ -1040,7 +1040,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_NCPAINT:
case WM_PAINT:
if (GetParent(hwnd) == pcli->hwndContactList && g_CluiData.fLayered)
- ValidateRect(hwnd,NULL);
+ ValidateRect(hwnd, NULL);
else if (GetParent(hwnd) != pcli->hwndContactList || !g_CluiData.fLayered) {
RECT rc = { 0 };
@@ -1111,7 +1111,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case WM_COMMAND:
- switch(LOWORD(wParam)) {
+ switch (LOWORD(wParam)) {
case IDC_SELECTMODE:
BuildViewModeMenu();
{
@@ -1139,15 +1139,15 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case IDC_RESETMODES:
-clvm_reset_command:
+ clvm_reset_command :
ApplyViewMode("");
- break;
+ break;
case IDC_CONFIGUREMODES:
-clvm_config_command:
+ clvm_config_command :
if (!g_ViewModeOptDlg)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
- break;
+ break;
}
default:
@@ -1166,11 +1166,11 @@ struct view_mode_t
int useWinColors;
int backgroundBmpUse;
- view_mode_t():
- hBmpBackground( NULL),
- bkColour( CLCDEFAULT_BKCOLOUR ),
- useWinColors( CLCDEFAULT_USEWINDOWSCOLOURS ),
- backgroundBmpUse( CLCDEFAULT_USEBITMAP )
+ view_mode_t() :
+ hBmpBackground(NULL),
+ bkColour(CLCDEFAULT_BKCOLOUR),
+ useWinColors(CLCDEFAULT_USEWINDOWSCOLOURS),
+ backgroundBmpUse(CLCDEFAULT_USEBITMAP)
{}
};
@@ -1198,7 +1198,7 @@ static BOOL sttDrawViewModeBackground(HWND hwnd, HDC hdc, RECT *rect)
COLORREF sttGetColor(char * module, char * color, COLORREF defColor); //clcutils
-static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
+static int ehhViewModeBackgroundSettingsChanged(WPARAM, LPARAM)
{
if (view_mode.hBmpBackground) {
DeleteObject(view_mode.hBmpBackground);
@@ -1223,8 +1223,8 @@ static int ehhViewModeBackgroundSettingsChanged(WPARAM wParam, LPARAM lParam)
void CreateViewModeFrame()
{
- CallService(MS_BACKGROUNDCONFIG_REGISTER,(WPARAM)(LPGEN("View mode background")"/ViewMode"),0);
- HookEvent(ME_BACKGROUNDCONFIG_CHANGED,ehhViewModeBackgroundSettingsChanged);
+ CallService(MS_BACKGROUNDCONFIG_REGISTER, (WPARAM)(LPGEN("View mode background")"/ViewMode"), 0);
+ HookEvent(ME_BACKGROUNDCONFIG_CHANGED, ehhViewModeBackgroundSettingsChanged);
ehhViewModeBackgroundSettingsChanged(0, 0);
WNDCLASS wndclass = { 0 };
@@ -1252,19 +1252,17 @@ void CreateViewModeFrame()
hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
- CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)frame.hWnd,(LPARAM)ViewModePaintCallbackProc); //$$$$$ register sub for frame
+ CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)frame.hWnd, (LPARAM)ViewModePaintCallbackProc); //$$$$$ register sub for frame
ApplyViewMode(NULL); //Apply last selected view mode
}
const char *MakeVariablesString(const char *src, const char *UIN);
-void ApplyViewMode(const char *Name, bool onlySelector )
+void ApplyViewMode(const char *Name, bool onlySelector)
{
char szSetting[256];
- DBVARIANT dbv = {0};
-
- BOOL wasNotViewMode = ( Name != NULL && g_CluiData.current_viewmode[0] == '\0' );
+ DBVARIANT dbv = { 0 };
g_CluiData.bFilterEffective = 0;
@@ -1354,7 +1352,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
BYTE bSaved = g_CluiData.bSortByOrder[0];
g_CluiData.bSortByOrder[0] = SORTBY_LASTMSG;
- for (int i=0; i < clistCache.getCount(); i++) {
+ for (int i = 0; i < clistCache.getCount(); i++) {
ClcCacheEntry *pdnce = clistCache[i];
pdnce->dwLastMsgTime = CompareContacts2_getLMTime(pdnce->hContact);
}
@@ -1367,17 +1365,17 @@ void ApplyViewMode(const char *Name, bool onlySelector )
g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_NEWERTHAN;
else
g_CluiData.bFilterEffective |= CLVM_FILTER_LASTMSG_OLDERTHAN;
-
+
DWORD unit = LOWORD(g_CluiData.lastMsgFilter);
- switch(HIBYTE(HIWORD(g_CluiData.lastMsgFilter))) {
+ switch (HIBYTE(HIWORD(g_CluiData.lastMsgFilter))) {
case 0:
- unit *= 60;
+ unit *= 60;
break;
case 1:
- unit *= 3600;
+ unit *= 3600;
break;
case 2:
- unit *= 86400;
+ unit *= 86400;
break;
}
g_CluiData.lastMsgFilter = unit;
@@ -1393,7 +1391,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
CallService(MS_CLIST_SETHIDEOFFLINE, 0, 0);
}
- else if ( g_CluiData.boldHideOffline != (BYTE)-1 )
+ else if (g_CluiData.boldHideOffline != (BYTE)-1)
{
CallService(MS_CLIST_SETHIDEOFFLINE, g_CluiData.boldHideOffline, 0);
g_CluiData.boldHideOffline = -1;
@@ -1427,7 +1425,7 @@ void ApplyViewMode(const char *Name, bool onlySelector )
static int SkinSetViewMode(WPARAM wParam /*char * name*/, LPARAM lParam /*int index*/)
{
if (wParam == 0 && lParam == 0)
- ApplyViewMode( NULL );
+ ApplyViewMode(NULL);
else if (wParam && !IsBadStringPtrA((const char*)wParam, -1))
ApplyViewMode((const char*)wParam);
return 0;
diff --git a/plugins/Clist_modern/src/modern_xptheme.cpp b/plugins/Clist_modern/src/modern_xptheme.cpp
index e81b968e8f..ac8cecae7c 100644
--- a/plugins/Clist_modern/src/modern_xptheme.cpp
+++ b/plugins/Clist_modern/src/modern_xptheme.cpp
@@ -7,9 +7,9 @@
typedef struct _tagXPTObject
{
- HANDLE hThemeHandle;
- HWND hOwnerWindow;
- LPCWSTR lpcwClassObject;
+ HANDLE hThemeHandle;
+ HWND hOwnerWindow;
+ LPCWSTR lpcwClassObject;
} XPTObject;
static OBJLIST<XPTObject> xptObjectList(1);