summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-08-17 19:39:01 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-08-17 19:39:01 +0000
commit4a6b3a2acf91421a958b9946e15a149cac29e7b5 (patch)
tree88860b2bf9b9a85c932c7dd2c2e73445d200745c /plugins/Clist_modern
parentd0ceb5768ff3146499a0318ffe03c867c0845592 (diff)
warning fixes
git-svn-id: http://svn.miranda-ng.org/main/trunk@14980 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r--plugins/Clist_modern/src/modern_aniavatars.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_awaymsg.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clc.cpp5
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp2
-rw-r--r--plugins/Clist_modern/src/modern_clcpaint.cpp110
-rw-r--r--plugins/Clist_modern/src/modern_clcutils.cpp6
-rw-r--r--plugins/Clist_modern/src/modern_gdiplus.cpp8
-rw-r--r--plugins/Clist_modern/src/modern_skinbutton.cpp150
-rw-r--r--plugins/Clist_modern/src/modern_skinengine.cpp47
-rw-r--r--plugins/Clist_modern/src/modern_skinopt.cpp28
-rw-r--r--plugins/Clist_modern/src/modern_statusbar.cpp50
-rw-r--r--plugins/Clist_modern/src/modern_viewmodebar.cpp45
12 files changed, 197 insertions, 258 deletions
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp
index 679f5283fa..7c15a343a6 100644
--- a/plugins/Clist_modern/src/modern_aniavatars.cpp
+++ b/plugins/Clist_modern/src/modern_aniavatars.cpp
@@ -491,7 +491,7 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent = NULL,
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 };
+ BLENDFUNCTION bf = { AC_SRC_OVER, 0, BYTE(g_CluiData.bCurrentAlpha * dat->bAlpha / 256), AC_SRC_ALPHA };
POINT pt_from = { 0, 0 };
HDC hDC_animation = GetDC(NULL);
HDC copyFromDC;
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp
index f9a4510d83..1e6cff2dca 100644
--- a/plugins/Clist_modern/src/modern_awaymsg.cpp
+++ b/plugins/Clist_modern/src/modern_awaymsg.cpp
@@ -66,7 +66,7 @@ static MCONTACT amGetCurrentChain()
if (amItems.getCount() == 0)
return NULL;
- MCONTACT res = (MCONTACT)amItems[0];
+ MCONTACT res = (DWORD_PTR)amItems[0];
amItems.remove(0);
return res;
}
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp
index deadd91373..a465b90bd1 100644
--- a/plugins/Clist_modern/src/modern_clc.cpp
+++ b/plugins/Clist_modern/src/modern_clc.cpp
@@ -1070,7 +1070,6 @@ static LRESULT clcOnMouseMove(ClcData *dat, HWND hwnd, UINT, WPARAM wParam, LPAR
ClcGroup *group = NULL;
cliGetRowByIndex(dat, dat->iDragItem, NULL, &group);
if (group && group->parent) {
- ClcContact *contSour;
cliGetRowByIndex(dat, dat->iDragItem, &contSour, NULL);
if (!contSour->isSubcontact)
hNewCursor = LoadCursor(g_hMirApp, MAKEINTRESOURCE(IDC_DROPUSER));
@@ -1389,7 +1388,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam
if (!pcli->pfnFindItem(hwnd, dat, wParam, &contact, &group, NULL)) {
if (shouldShow && CallService(MS_DB_CONTACT_IS, wParam, 0)) {
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (MCONTACT)pcli->pfnContactToHItem(selcontact);
+ hSelItem = (DWORD_PTR)pcli->pfnContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, wParam, (style & CLS_CONTACTLIST) == 0, 0);
recalcScrollBar = 1;
needRepaint = TRUE;
@@ -1412,7 +1411,7 @@ static LRESULT clcOnIntmIconChanged(ClcData *dat, HWND hwnd, UINT, WPARAM wParam
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && ((style & CLS_HIDEOFFLINE) || group->hideOffline || g_CluiData.bFilterEffective)) { // CLVM changed
if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) != -1)
- hSelItem = (MCONTACT)pcli->pfnContactToHItem(selcontact);
+ hSelItem = (DWORD_PTR)pcli->pfnContactToHItem(selcontact);
pcli->pfnRemoveItemFromGroup(hwnd, group, contact, (style & CLS_CONTACTLIST) == 0);
needRepaint = TRUE;
recalcScrollBar = 1;
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 58843ea517..c4102c68a5 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -301,7 +301,7 @@ MCONTACT SaveSelection(ClcData *dat)
if (pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, NULL) == -1)
return NULL;
- return (MCONTACT)pcli->pfnContactToHItem(selcontact);
+ return (DWORD_PTR)pcli->pfnContactToHItem(selcontact);
}
int RestoreSelection(ClcData *dat, MCONTACT hSelected)
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp
index bf337c1282..03552d3690 100644
--- a/plugins/Clist_modern/src/modern_clcpaint.cpp
+++ b/plugins/Clist_modern/src/modern_clcpaint.cpp
@@ -663,7 +663,6 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
// Let calc placeholder
int minheight = dat->row_min_heigh;
int mode2 = -1;
- COLORREF colourFg = RGB(0, 0, 0);
BOOL InClistWindow = (dat->hWnd == pcli->hwndContactTree);
ClcCacheEntry *pdnce = NULL;
int height = RowHeight_CalcRowHeight(dat, hwnd, Drawing, -1);
@@ -779,7 +778,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
//3 draw text
{
SIZE text_size = { 0 };
- TCHAR * szCounts = NULL;
+ TCHAR *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;
@@ -797,7 +796,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
RECT count_rc = { 0 };
SIZE count_size = { 0 };
int space_width = 0;
- TCHAR * szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
+ szCounts = pcli->pfnGetGroupCountsText(dat, Drawing);
// Has to draw the count?
if (szCounts && mir_tstrlen(szCounts) > 0) {
// calc width and height
@@ -813,16 +812,16 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
}
// modify text rect
{
- SIZE text_size = { 0 };
+ SIZE grp_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);
+ GetTextSize(&grp_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 > grp_size.cx) {
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 - (grp_size.cx + count_size.cx)) >> 1 : 0;
nameRect.left += x;
- nameRect.right = nameRect.left + text_size.cx;
+ nameRect.right = nameRect.left + grp_size.cx;
countRect.left = nameRect.right + space_width;
countRect.right = countRect.left + count_size.cx - space_width;
}
@@ -830,7 +829,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
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;
+ nameRect.left = nameRect.right - grp_size.cx;
}
}
else {
@@ -1042,16 +1041,16 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
}
// modify text rect
{
- SIZE text_size = { 0 };
+ SIZE grp_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);
+ GetTextSize(&grp_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 > grp_size.cx) {
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 - (grp_size.cx + count_size.cx)) >> 1 : 0;
nameRect.left += x;
- nameRect.right = nameRect.left + text_size.cx;
+ nameRect.right = nameRect.left + grp_size.cx;
countRect.left = nameRect.right + space_width;
countRect.right = countRect.left + count_size.cx - space_width;
}
@@ -1059,7 +1058,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
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;
+ nameRect.left = nameRect.right - grp_size.cx;
}
}
else {
@@ -1235,13 +1234,12 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
}
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;
+ int ava_width = p_rect.right - p_rect.left;
+ int ava_height = p_rect.bottom - p_rect.top;
// Store pos
Drawing->pos_avatar = p_rect;
- oldrgn = CreateRectRgn(0, 0, 0, 0);
+ HRGN oldrgn = CreateRectRgn(0, 0, 0, 0);
GetClipRgn(hdcMem, oldrgn);
// Round corners
@@ -1249,7 +1247,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
if (dat->avatars_use_custom_corner_size)
round_radius = dat->avatars_custom_corner_size;
else
- round_radius = min(width, height) / 5;
+ round_radius = min(ava_width, ava_height) / 5;
}
else round_radius = 0;
@@ -1336,11 +1334,10 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
(!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++) {
+ for (int iImage = 0; iImage < dat->extraColumnsCount; iImage++) {
COLORREF colourFg = dat->selBkColour;
int mode = BlendedInActiveState ? BlendValue : ILD_NORMAL;
if (Drawing->iExtraImage[iImage] == EMPTY_EXTRA_ICON) {
@@ -1390,6 +1387,7 @@ void CLCPaint::_PaintRowItemsEx(HWND hwnd, HDC hdcMem, ClcData *dat, ClcContact
int eNum = gl_RowTabAccess[i]->type - TC_EXTRA1;
if (eNum < dat->extraColumnsCount) {
if (Drawing->iExtraImage[eNum] != EMPTY_EXTRA_ICON) {
+ COLORREF colourFg = RGB(0, 0, 0);
int mode = 0;
int BlendedInActiveState = dat->dbbBlendInActiveState;
int BlendValue = dat->dbbBlend25 ? ILD_BLEND25 : ILD_BLEND50;
@@ -2024,7 +2022,6 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
switch (dat->row_items[item]) {
case ITEM_AVATAR: ///////////////////////////////////////////////////////////////////////////////////////////////////
{
- RECT rc;
int max_width;
int width;
int height;
@@ -2044,14 +2041,10 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
// Has to draw icon instead?
if (dat->icon_hide_on_avatar && dat->icon_draw_on_avatar_space && Drawing->iImage != -1) {
- 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);
-
+ RECT 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 */
+ // 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);
@@ -2063,8 +2056,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
// 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);
+ // RECT 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 );
@@ -2089,8 +2081,7 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
}
// Make rectangle
- rc = _GetRectangle(dat, &row_rc, &free_row_rc, &left_pos, &right_pos,
- left, width, max_width, height, HORIZONTAL_SPACE);
+ RECT 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);
@@ -2103,7 +2094,6 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
case ITEM_ICON: /////////////////////////////////////////////////////////////////////////////////////////////////////
{
- RECT rc;
int iImage = -1;
BOOL has_avatar = Drawing->avatar_data != NULL && !CheckMiniMode(dat, selected);
@@ -2114,13 +2104,9 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
&& !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)) {
- 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
+ RECT 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);
- }
}
break;
}
@@ -2128,10 +2114,10 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
&& 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 < _countof(g_pAvatarOverlayIcons)
- && dat->avatars_overlay_type == SETTING_AVATAR_OVERLAY_TYPE_CONTACT))) {
+ (dat->avatars_draw_overlay
+ && dat->avatars_maxheight_size >= ICON_HEIGHT + (dat->avatars_draw_border ? 2 : 0)
+ && GetContactCachedStatus(Drawing->hContact) - ID_STATUS_OFFLINE < _countof(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;
}
@@ -2146,13 +2132,9 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
// 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
+ RECT 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);
- }
}
}
break;
@@ -2164,23 +2146,19 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
TCHAR szResult[80];
if (!TimeZone_PrintDateTime(pdnce->hTimeZone, _T("t"), szResult, _countof(szResult), 0)) {
- SIZE text_size;
- RECT rc;
-
// Select font
ChangeToFont(hdcMem, dat, FONTID_CONTACT_TIME, NULL);
// Get text size
+ RECT rc;
+ SIZE text_size;
text_size.cy = ske_DrawText(hdcMem, szResult, (int)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);
-
- if (rc.left < rc.right) {
- // Store pos
+ 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);
}
@@ -2205,16 +2183,14 @@ void CLCPaint::_CalcItemsPos(HDC hdcMem, ClcData *dat, ClcContact *Drawing, RECT
if (!Drawing->isSubcontact || dat->dbbMetaHideExtra == 0 && dat->extraColumnsCount > 0) {
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);
+ RECT 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;
+ // Drawing->pos_extra[iImage] = rc;
count++;
}
}
@@ -2695,15 +2671,15 @@ void CLCPaint::_DrawContactAvatar(HDC hdcMem, ClcData *dat, ClcContact *Drawing,
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);
+ 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);
+ ptOverlay.x, ptOverlay.y, ICON_HEIGHT, ICON_HEIGHT,
+ CLR_NONE, CLR_NONE, (blendmode == 255) ? ILD_NORMAL : (blendmode == 128) ? ILD_BLEND50 : ILD_BLEND25);
break;
}
}
@@ -2845,7 +2821,7 @@ void CLCPaint::_DrawContactExtraIcon(HDC hdcMem, ClcData *dat, ClcContact *Drawi
_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);
+ rc->left, rc->top, 0, 0, CLR_NONE, colourFg, mode);
}
}
diff --git a/plugins/Clist_modern/src/modern_clcutils.cpp b/plugins/Clist_modern/src/modern_clcutils.cpp
index 8949cc7457..71c0ac597e 100644
--- a/plugins/Clist_modern/src/modern_clcutils.cpp
+++ b/plugins/Clist_modern/src/modern_clcutils.cpp
@@ -232,9 +232,9 @@ void cliRecalcScrollBar(HWND hwnd, ClcData *dat)
}
-static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- switch (msg) {
+ switch (uMsg) {
case WM_KEYDOWN:
switch (wParam) {
case VK_RETURN:
@@ -257,7 +257,7 @@ static LRESULT CALLBACK RenameEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
return 0;
}
- return mir_callNextSubclass(hwnd, RenameEditSubclassProc, msg, wParam, lParam);
+ return mir_callNextSubclass(hwnd, RenameEditSubclassProc, uMsg, wParam, lParam);
}
void cliBeginRenameSelection(HWND hwnd, ClcData *dat)
diff --git a/plugins/Clist_modern/src/modern_gdiplus.cpp b/plugins/Clist_modern/src/modern_gdiplus.cpp
index e514870b7d..e7d414125f 100644
--- a/plugins/Clist_modern/src/modern_gdiplus.cpp
+++ b/plugins/Clist_modern/src/modern_gdiplus.cpp
@@ -86,7 +86,7 @@ void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD heigh
else bm = new Bitmap(hbmp, NULL);
ImageAttributes attr;
- ColorMatrix ClrMatrix =
+ ColorMatrix Matrix =
{
1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
@@ -94,7 +94,7 @@ void DrawAvatarImageWithGDIp(HDC hDestDC, int x, int y, DWORD width, DWORD heigh
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(&Matrix, 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);
@@ -116,7 +116,7 @@ BOOL GDIPlus_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWi
else bm = new Bitmap(hbmp, NULL);
ImageAttributes attr;
- ColorMatrix ClrMatrix =
+ ColorMatrix Matrix =
{
1.0f, 0.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
@@ -124,7 +124,7 @@ BOOL GDIPlus_AlphaBlend(HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWi
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(&Matrix, ColorMatrixFlagsDefault, ColorAdjustTypeBitmap);
if (bf->BlendFlags & 128 && nWidthDest < nWidthSrc && nHeightDest < nHeightSrc) {
g.SetInterpolationMode(InterpolationModeHighQualityBicubic);
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp
index 6666b7e55f..8215b7e1fc 100644
--- a/plugins/Clist_modern/src/modern_skinbutton.cpp
+++ b/plugins/Clist_modern/src/modern_skinbutton.cpp
@@ -100,8 +100,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
if (!whdc && !g_CluiData.fLayered) InvalidateRect(hwnd, NULL, FALSE);
if (whdc && g_CluiData.fLayered) hdc = whdc;
- else
- {
+ else {
//sdc = GetWindowDC(GetParent(hwnd));
hdc = CreateCompatibleDC(NULL);
}
@@ -116,8 +115,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
//HBRUSH br = CreateSolidBrush(RGB(255,255,255));
char * Value = NULL;
{
- if (bct->ValueDBSection && bct->ValueTypeDef)
- {
+ if (bct->ValueDBSection && bct->ValueTypeDef) {
char * key;
char * section;
DWORD defval = 0;
@@ -126,20 +124,18 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
section = key;
if (bct->ValueTypeDef[0] != 's')
defval = (DWORD)atol(bct->ValueTypeDef + 1);
- do
- {
+ do {
if (key[0] == '/') { key[0] = '\0'; key++; break; }
key++;
} while (key[0] != '\0');
- switch (bct->ValueTypeDef[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, _countof(buf)));
@@ -171,23 +167,20 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
// DeleteObject(br);
}
- if (!whdc && g_CluiData.fLayered)
- {
+ if (!whdc && g_CluiData.fLayered) {
RECT r;
SetRect(&r, bct->Left, bct->Top, bct->Right, bct->Bottom);
ske_DrawImageAt(hdc, &r);
//CallingService to immeadeately update window with new image.
}
- if (whdc && !g_CluiData.fLayered)
- {
+ if (whdc && !g_CluiData.fLayered) {
RECT r = { 0 };
GetClientRect(bct->hwnd, &r);
BitBlt(whdc, 0, 0, r.right, r.bottom, hdc, 0, 0, SRCCOPY);
}
SelectObject(hdc, oldbmp);
DeleteObject(bmp);
- if (!whdc || !g_CluiData.fLayered)
- {
+ if (!whdc || !g_CluiData.fLayered) {
SelectObject(hdc, GetStockObject(DEFAULT_GUI_FONT));
DeleteDC(hdc);
}
@@ -198,8 +191,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc)
static int ModernSkinButtonToggleDBValue(char * ValueDBSection, char *ValueTypeDef)
{
- if (ValueDBSection && ValueTypeDef)
- {
+ if (ValueDBSection && ValueTypeDef) {
char * key;
char * section;
char * val;
@@ -209,22 +201,19 @@ static int ModernSkinButtonToggleDBValue(char * ValueDBSection, char *ValueTypeD
// char buf[20];
key = mir_strdup(ValueDBSection);
section = key;
- do
- {
+ do {
if (key[0] == '/') { key[0] = '\0'; key++; break; }
key++;
} while (key[0] != '\0');
val = mir_strdup(ValueTypeDef + 1);
val2 = val;
- do
- {
+ do {
if (val2[0] == '/') { val2[0] = '\0'; val2++; break; }
val2++;
} while (val2[0] != '\0');
- if (ValueTypeDef[0] != 's')
- {
+ if (ValueTypeDef[0] != 's') {
l1 = (DWORD)atol(val);
l2 = (DWORD)atol(val2);
}
@@ -269,8 +258,7 @@ static char *_skipblank(char * str) //str will be modified;
char * endstr = str + mir_strlen(str);
while ((*str == ' ' || *str == '\t') && *str != '\0') str++;
while ((*endstr == ' ' || *endstr == '\t') && *endstr != '\0' && endstr < str) endstr--;
- if (*endstr != '\0')
- {
+ if (*endstr != '\0') {
endstr++;
*endstr = '\0';
}
@@ -290,8 +278,7 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
return 0;
}
char *param2 = strrchr(pszService, '%');
- if (param2)
- {
+ if (param2) {
paramCount++;
*param2 = '\0'; param2++;
_skipblank(param2);
@@ -299,42 +286,35 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return)
param2 = NULL;
}
char *param1 = strrchr(pszService, '%');
- if (param1)
- {
+ if (param1) {
paramCount++;
*param1 = '\0'; param1++;
_skipblank(param1);
if (mir_strlen(param1) == 0)
param1 = NULL;
}
- if (param1 && *param1 == '\"')
- {
+ if (param1 && *param1 == '\"') {
param1++;
*(param1 + mir_strlen(param1)) = '\0';
}
- else if (param1)
- {
+ else if (param1) {
param1 = (char*)atoi(param1);
}
- if (param2 && *param2 == '\"')
- {
+ if (param2 && *param2 == '\"') {
param2++;
*(param2 + mir_strlen(param2)) = '\0';
}
else if (param2)
param2 = (char*)atoi(param2);
- if (paramCount == 1)
- {
+ if (paramCount == 1) {
param1 = param2;
param2 = NULL;
}
- if (!ServiceExists(pszService))
- {
+ if (!ServiceExists(pszService)) {
result = 0;
}
- else
- {
+ else {
result = 1;
int ret = CallService(pszService, (WPARAM)param1, (WPARAM)param2);
if (Return) *Return = ret;
@@ -399,12 +379,12 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w
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))
@@ -472,8 +452,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w
if (bct->CommandService && IsBadStringPtrA(bct->CommandService, 255))
bct->CommandService = NULL;
if (bct->CommandService)
- if (_CallServiceStrParams(bct->CommandService, NULL))
- {
+ if (_CallServiceStrParams(bct->CommandService, NULL)) {
}
else if (bct->ValueDBSection && bct->ValueTypeDef)
ModernSkinButtonToggleDBValue(bct->ValueDBSection, bct->ValueTypeDef);
@@ -611,20 +590,16 @@ static int ModernSkinButtonErase(int l, int t, int r, int b)
if (!g_CluiData.fLayered) return 0;
if (!g_pCachedWindow) return 0;
if (!g_pCachedWindow->hImageDC || !g_pCachedWindow->hBackDC) return 0;
- if (!(l || r || t || b))
- {
- for (i = 0; i < ButtonsCount; i++)
- {
- if (pcli->hwndContactList && Buttons[i].hwnd != NULL)
- {
+ if (!(l || r || t || b)) {
+ 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);
}
}
}
- else
- {
+ else {
BitBlt(g_pCachedWindow->hImageDC, l, t, r - l, b - t, g_pCachedWindow->hBackDC, l, t, SRCCOPY);
}
return 0;
@@ -652,8 +627,7 @@ 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);
@@ -676,23 +650,20 @@ int ModernSkinButtonDeleteAll()
return 0;
}
-int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r)
+int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *pRect)
{
- DWORD i;
- RECT rc;
- RECT clr;
- RECT rd;
+ RECT rc, clr, rd;
BOOL altDraw = FALSE;
static SIZE oldWndSize = { 0 };
if (!ModernSkinButtonModuleIsLoaded) return 0;
GetWindowRect(parent, &rd);
GetClientRect(parent, &clr);
- if (!r)
+ if (!pRect)
GetWindowRect(parent, &rc);
else
- rc = *r;
- if (g_CluiData.fLayered && (draw & SBRF_DO_ALT_DRAW))
- {
+ rc = *pRect;
+
+ if (g_CluiData.fLayered && (draw & SBRF_DO_ALT_DRAW)) {
int sx, sy;
sx = rd.right - rd.left;
sy = rd.bottom - rd.top;
@@ -705,44 +676,39 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r)
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;
+ for (DWORD i = 0; i < ButtonsCount; i++) {
int sbFlags = Buttons[i].ConstrainPositionFrom;
- if (parent && Buttons[i].hwnd == NULL)
- {
+ if (parent && Buttons[i].hwnd == NULL) {
Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct, parent);
altDraw = FALSE;
}
- l = (sbFlags & SBF_ALIGN_TL_RIGHT) ? (rc.right + Buttons[i].OrL) :
+ int 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) :
+ int 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) :
+ int 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) :
+ int 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*/))
+ if (rc.right - rc.left < Buttons[i].minW || rc.bottom - rc.top < Buttons[i].minH)
CLUI_ShowWindowMod(Buttons[i].hwnd, SW_HIDE);
else
CLUI_ShowWindowMod(Buttons[i].hwnd, SW_SHOW);
if ((1 || altDraw) &&
(Buttons[i].bct->Left != l ||
- Buttons[i].bct->Top != t ||
- Buttons[i].bct->Right != r ||
- Buttons[i].bct->Bottom != b))
- {
+ Buttons[i].bct->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);
}
@@ -751,9 +717,9 @@ int ModernSkinButton_ReposButtons(HWND parent, BYTE draw, RECT *r)
Buttons[i].bct->Top = t;
Buttons[i].bct->Right = r;
Buttons[i].bct->Bottom = b;
-
-
}
- if (draw & SBRF_DO_REDRAW_ALL) ModernSkinButtonRedrawAll();
+
+ 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 22b8d32f59..2078d05f6f 100644
--- a/plugins/Clist_modern/src/modern_skinengine.cpp
+++ b/plugins/Clist_modern/src/modern_skinengine.cpp
@@ -115,7 +115,7 @@ 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 = { 0xFF, { 0 }, 0, 0 };
//////////////////////////////////////////////////////////////////////////
// Ini file parser
@@ -713,21 +713,21 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
}
else {
- BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf2 = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
int dy = (wr.top - rFill->top) % h;
if (dy >= 0) {
y = wr.top;
int ht = (y + h - dy <= wr.bottom) ? (h - dy) : (wr.bottom - wr.top);
- ske_AlphaBlend(hDest, wr.left, y, w, ht, mem2dc, 0, dy, w, ht, bf);
+ ske_AlphaBlend(hDest, wr.left, y, w, ht, mem2dc, 0, dy, w, ht, bf2);
}
y = wr.top + h - dy;
while (y < wr.bottom - h) {
- ske_AlphaBlend(hDest, wr.left, y, w, h, mem2dc, 0, 0, w, h, bf);
+ ske_AlphaBlend(hDest, wr.left, y, w, h, mem2dc, 0, 0, w, h, bf2);
y += h;
}
if (y <= wr.bottom)
- ske_AlphaBlend(hDest, wr.left, y, w, wr.bottom - y, mem2dc, 0, 0, w, wr.bottom - y, bf);
+ ske_AlphaBlend(hDest, wr.left, y, w, wr.bottom - y, mem2dc, 0, 0, w, wr.bottom - y, bf2);
}
}
}
@@ -787,21 +787,20 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
}
else {
- BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf2 = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
int dx = (wr.left - rFill->left) % w;
if (dx >= 0) {
x = wr.left;
int wt = (x + w - dx <= wr.right) ? (w - dx) : (wr.right - wr.left);
- ske_AlphaBlend(hDest, x, wr.top, wt, h, mem2dc, dx, 0, wt, h, bf);
+ ske_AlphaBlend(hDest, x, wr.top, wt, h, mem2dc, dx, 0, wt, h, bf2);
}
x = wr.left + w - dx;
while (x < wr.right - w) {
- ske_AlphaBlend(hDest, x, wr.top, w, h, mem2dc, 0, 0, w, h, bf);
+ ske_AlphaBlend(hDest, x, wr.top, w, h, mem2dc, 0, 0, w, h, bf2);
x += w;
}
if (x <= wr.right)
- ske_AlphaBlend(hDest, x, wr.top, wr.right - x, h, mem2dc, 0, 0, wr.right - x, h, bf);
-
+ ske_AlphaBlend(hDest, x, wr.top, wr.right - x, h, mem2dc, 0, 0, wr.right - x, h, bf2);
}
}
}
@@ -867,24 +866,22 @@ static BOOL ske_SkinFillRectByGlyph(HDC hDest, HDC hSource, RECT *rFill, RECT *r
}
else {
- BLENDFUNCTION bf = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
+ BLENDFUNCTION bf2 = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
int dx = (wr.left - rFill->left) % w;
if (dx >= 0) {
x = wr.left;
int wt = (x + w - dx <= wr.right) ? (w - dx) : (wr.right - wr.left);
- ske_AlphaBlend(hDest, x, wr.top, wt, h, mem2dc, dx, 0, wt, h, bf);
+ ske_AlphaBlend(hDest, x, wr.top, wt, h, mem2dc, dx, 0, wt, h, bf2);
}
x = wr.left + w - dx;
while (x < wr.right - w) {
- ske_AlphaBlend(hDest, x, wr.top, w, h, mem2dc, 0, 0, w, h, bf);
+ ske_AlphaBlend(hDest, x, wr.top, w, h, mem2dc, 0, 0, w, h, bf2);
x += w;
}
if (x <= wr.right)
- ske_AlphaBlend(hDest, x, wr.top, wr.right - x, h, mem2dc, 0, 0, wr.right - x, h, bf);
-
+ ske_AlphaBlend(hDest, x, wr.top, wr.right - x, h, mem2dc, 0, 0, wr.right - x, h, bf2);
}
}
-
}
SelectObject(mem2dc, oldbmp);
DeleteObject(mem2bmp);
@@ -1251,7 +1248,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj)
if ((k > 0 || k == -1) && mode == 2) {
{
- BLENDFUNCTION bf = { AC_SRC_OVER, 0, /*(bm.bmBitsPixel == 32)?255:*/pobj->dwAlpha, (pobj->bmBitsPixel == 32 && pobj->Style != ST_BRUSH) ? AC_SRC_ALPHA : 0 };
+ BLENDFUNCTION bf = { AC_SRC_OVER, 0, pobj->dwAlpha, BYTE(pobj->bmBitsPixel == 32 && pobj->Style != ST_BRUSH ? AC_SRC_ALPHA : 0) };
if (mode == 2)
OffsetRect(&PRect, mode2offset.x, mode2offset.y);
ske_AlphaBlend(preq->hDC, PRect.left, PRect.top, PRect.right - PRect.left, PRect.bottom - PRect.top,
@@ -1604,12 +1601,12 @@ static HBITMAP ske_LoadGlyphImage_TGA(const TCHAR *szFilename)
DWORD size = SizeofResource(g_hInst, hRSrc);
BYTE *mem = (BYTE*)LockResource(hRes);
if (size > sizeof(header)) {
- tga_header_t * header = (tga_header_t *)mem;
- if (header->pixel_depth == 32 && (header->image_type == 2 || header->image_type == 10)) {
- colormap = (BYTE*)malloc(header->width*header->height * 4);
- cx = header->width;
- cy = header->height;
- ske_ReadTGAImageData((void*)(mem + sizeof(tga_header_t) + header->id_lenght + header->cm_length), size - (sizeof(tga_header_t) + header->id_lenght + header->cm_length), colormap, cx*cy * 4, header->image_type == 10);
+ tga_header_t *tgahdr = (tga_header_t*)mem;
+ if (tgahdr->pixel_depth == 32 && (tgahdr->image_type == 2 || tgahdr->image_type == 10)) {
+ colormap = (BYTE*)malloc(tgahdr->width*tgahdr->height * 4);
+ cx = tgahdr->width;
+ cy = tgahdr->height;
+ ske_ReadTGAImageData((void*)(mem + sizeof(tga_header_t) + tgahdr->id_lenght + tgahdr->cm_length), size - (sizeof(tga_header_t) + tgahdr->id_lenght + tgahdr->cm_length), colormap, cx*cy * 4, tgahdr->image_type == 10);
}
}
FreeResource(hRes);
@@ -1773,8 +1770,8 @@ int ske_UnloadSkin(SKINOBJECTSLIST * Skin)
mir_free_and_nil(dt->szFileName);
if (dt->plTextList && dt->plTextList->realCount > 0) {
- for (int i = 0; i < dt->plTextList->realCount; i++) {
- GLYPHTEXT *gt = (GLYPHTEXT *)dt->plTextList->items[i];
+ for (int k = 0; k < dt->plTextList->realCount; k++) {
+ GLYPHTEXT *gt = (GLYPHTEXT *)dt->plTextList->items[k];
if (gt) {
mir_free(gt->stText);
mir_free(gt->stValueText);
diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp
index 34ca2187cb..4e95804f4e 100644
--- a/plugins/Clist_modern/src/modern_skinopt.cpp
+++ b/plugins/Clist_modern/src/modern_skinopt.cpp
@@ -262,7 +262,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
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;
+ SkinListData* sd2 = NULL;
HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1));
if (hti == 0) return 0;
{
@@ -270,17 +270,17 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara
tvi.hItem = hti;
tvi.mask = TVIF_HANDLE | TVIF_PARAM;
TreeView_GetItem(GetDlgItem(hwndDlg, IDC_TREE1), &tvi);
- sd = (SkinListData*)(tvi.lParam);
+ sd2 = (SkinListData*)(tvi.lParam);
}
- if (!sd) return 0;
+ if (!sd2) return 0;
- if (sd->File && !_tcschr(sd->File, _T('%'))) {
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, _countof(Author), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, _countof(URL), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, _countof(Contact), sd->File);
- GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, _countof(Description), sd->File);
+ if (sd2->File && !_tcschr(sd2->File, _T('%'))) {
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Author"), TranslateT("( unknown )"), Author, _countof(Author), sd2->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("URL"), _T(""), URL, _countof(URL), sd2->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Contact"), _T(""), Contact, _countof(Contact), sd2->File);
+ GetPrivateProfileString(_T("Skin_Description_Section"), _T("Description"), _T(""), Description, _countof(Description), sd2->File);
mir_sntprintf(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);
+ sd2->Name, Description, Author, Contact, URL);
}
else {
mir_sntprintf(text, TranslateT("%s\n\n%s\n\nAUTHORS:\n%s\n\nCONTACT:\n%s\n\nWEB:\n%s\n\n\n"),
@@ -443,11 +443,11 @@ HTREEITEM FindChild(HWND hTree, HTREEITEM Parent, TCHAR * Caption, void * data)
if (!data)
return tmp;
- TVITEM tvi = { 0 };
- tvi.hItem = tmp;
- tvi.mask = TVIF_HANDLE | TVIF_PARAM;
- TreeView_GetItem(hTree, &tvi);
- SkinListData *sd = (SkinListData*)tvi.lParam;
+ TVITEM tvi2 = { 0 };
+ tvi2.hItem = tmp;
+ tvi2.mask = TVIF_HANDLE | TVIF_PARAM;
+ TreeView_GetItem(hTree, &tvi2);
+ SkinListData *sd = (SkinListData*)tvi2.lParam;
if (sd)
if (!mir_tstrcmpi(sd->File, ((SkinListData*)data)->File))
return tmp;
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp
index b3d6537c91..8fc3333cff 100644
--- a/plugins/Clist_modern/src/modern_statusbar.cpp
+++ b/plugins/Clist_modern/src/modern_statusbar.cpp
@@ -243,9 +243,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
if (p->bShowProtoEmails == 1 && ProtoServiceExists(szProto, PS_GETUNREADEMAILCOUNT)) {
int nEmails = (int)CallProtoService(szProto, PS_GETUNREADEMAILCOUNT, 0, 0);
if (nEmails > 0) {
- TCHAR buf[40];
- mir_sntprintf(buf, _T("[%d]"), nEmails);
- p->szProtoEMailCount = mir_tstrdup(buf);
+ TCHAR str[40];
+ mir_sntprintf(str, _T("[%d]"), nEmails);
+ p->szProtoEMailCount = mir_tstrdup(str);
}
}
@@ -364,25 +364,25 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
}
}
- SIZE textSize;
+ SIZE txtSize;
if (p.bShowProtoName) {
- GetTextExtentPoint32(hDC, p.tszProtoHumanName, (int)mir_tstrlen(p.tszProtoHumanName), &textSize);
- w += textSize.cx + 3 + spaceWidth;
+ GetTextExtentPoint32(hDC, p.tszProtoHumanName, (int)mir_tstrlen(p.tszProtoHumanName), &txtSize);
+ w += txtSize.cx + 3 + spaceWidth;
}
if (p.bShowProtoEmails && p.szProtoEMailCount) {
- GetTextExtentPoint32(hDC, p.szProtoEMailCount, (int)mir_tstrlen(p.szProtoEMailCount), &textSize);
- w += textSize.cx + 3 + spaceWidth;
+ GetTextExtentPoint32(hDC, p.szProtoEMailCount, (int)mir_tstrlen(p.szProtoEMailCount), &txtSize);
+ w += txtSize.cx + 3 + spaceWidth;
}
if (p.bShowStatusName) {
- GetTextExtentPoint32(hDC, p.tszProtoStatusText, (int)mir_tstrlen(p.tszProtoStatusText), &textSize);
- w += textSize.cx + 3 + spaceWidth;
+ GetTextExtentPoint32(hDC, p.tszProtoStatusText, (int)mir_tstrlen(p.tszProtoStatusText), &txtSize);
+ w += txtSize.cx + 3 + spaceWidth;
}
if ((p.xStatusMode & 8) && p.tszProtoXStatus) {
- GetTextExtentPoint32(hDC, p.tszProtoXStatus, (int)mir_tstrlen(p.tszProtoXStatus), &textSize);
- w += textSize.cx + 3 + spaceWidth;
+ GetTextExtentPoint32(hDC, p.tszProtoXStatus, (int)mir_tstrlen(p.tszProtoXStatus), &txtSize);
+ w += txtSize.cx + 3 + spaceWidth;
}
if (p.bShowProtoName || (p.bShowProtoEmails && p.szProtoEMailCount) || p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus))
@@ -527,9 +527,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
ske_DrawText(hDC, p.tszProtoHumanName, cbLen, &rt, 0);
if ((p.bShowProtoEmails && p.szProtoEMailCount != NULL) || p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus)) {
- SIZE textSize;
- GetTextExtentPoint32(hDC, p.tszProtoHumanName, cbLen, &textSize);
- x += textSize.cx + 3;
+ SIZE txtSize;
+ GetTextExtentPoint32(hDC, p.tszProtoHumanName, cbLen, &txtSize);
+ x += txtSize.cx + 3;
}
}
@@ -540,9 +540,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
rt.top = textY;
ske_DrawText(hDC, p.szProtoEMailCount, cbLen, &rt, 0);
if (p.bShowStatusName || ((p.xStatusMode & 8) && p.tszProtoXStatus)) {
- SIZE textSize;
- GetTextExtentPoint32(hDC, p.szProtoEMailCount, cbLen, &textSize);
- x += textSize.cx + 3;
+ SIZE txtSize;
+ GetTextExtentPoint32(hDC, p.szProtoEMailCount, cbLen, &txtSize);
+ x += txtSize.cx + 3;
}
}
@@ -553,9 +553,9 @@ int ModernDrawStatusBarWorker(HWND hWnd, HDC hDC)
rt.top = textY;
ske_DrawText(hDC, p.tszProtoStatusText, cbLen, &rt, 0);
if (((p.xStatusMode & 8) && p.tszProtoXStatus)) {
- SIZE textSize;
- GetTextExtentPoint32(hDC, p.tszProtoStatusText, cbLen, &textSize);
- x += textSize.cx + 3;
+ SIZE txtSize;
+ GetTextExtentPoint32(hDC, p.tszProtoStatusText, cbLen, &txtSize);
+ x += txtSize.cx + 3;
}
}
@@ -804,16 +804,16 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
bool first = true;
for (int pos = 0; pos < protoCount; pos++) {
- int i = pcli->pfnGetAccountIndexByPos(pos);
- if (i < 0 || i >= protoCount)
+ int k = pcli->pfnGetAccountIndexByPos(pos);
+ if (k < 0 || k >= protoCount)
continue;
char protoF[sizeof(g_CluiData.protoFilter)];
- mir_snprintf(protoF, _countof(protoF), "%s|", accs[i]->szModuleName);
+ mir_snprintf(protoF, _countof(protoF), "%s|", accs[k]->szModuleName);
if (strstri(g_CluiData.protoFilter, protoF)) {
if (!first)
mir_strncat(filterName, "; ", _countof(filterName) - mir_strlen(filterName));
- mir_strncat(filterName, T2Utf(accs[i]->tszAccountName), _countof(filterName) - mir_strlen(filterName));
+ mir_strncat(filterName, T2Utf(accs[k]->tszAccountName), _countof(filterName) - mir_strlen(filterName));
first = false;
}
}
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp
index bec68bae1d..f3d98a0056 100644
--- a/plugins/Clist_modern/src/modern_viewmodebar.cpp
+++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp
@@ -205,9 +205,6 @@ static int FillDialog(HWND hwnd)
{
LVCOLUMN lvc = { 0 };
HWND hwndList = GetDlgItem(hwnd, IDC_PROTOCOLS);
- LVITEMA item = { 0 };
- int protoCount = 0, i, newItem;
- PROTOACCOUNT **accs;
CLVM_EnumModes(FillModes);
ListView_SetExtendedListViewStyle(GetDlgItem(hwnd, IDC_PROTOCOLS), LVS_EX_CHECKBOXES);
@@ -216,13 +213,17 @@ static int FillDialog(HWND hwnd)
ListView_InsertColumn(GetDlgItem(hwnd, IDC_PROTOCOLS), 0, &lvc);
// fill protocols...
+ int protoCount;
+ PROTOACCOUNT **accs;
Proto_EnumAccounts(&protoCount, &accs);
-
- item.mask = LVIF_TEXT;
- item.iItem = 1000;
- for (i = 0; i < protoCount; i++) {
- item.pszText = accs[i]->szModuleName;
- newItem = SendMessageA(hwndList, LVM_INSERTITEMA, 0, (LPARAM)&item);
+ {
+ LVITEMA item = { 0 };
+ item.mask = LVIF_TEXT;
+ item.iItem = 1000;
+ for (int i = 0; i < protoCount; i++) {
+ item.pszText = accs[i]->szModuleName;
+ SendMessageA(hwndList, LVM_INSERTITEMA, 0, (LPARAM)&item);
+ }
}
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
@@ -242,12 +243,12 @@ static int FillDialog(HWND hwnd)
item.iItem = 1000;
item.pszText = TranslateT("Ungrouped contacts");
- newItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
+ SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
TCHAR *szGroup;
for (int i = 1; (szGroup = pcli->pfnGetGroupName(i, NULL)) != NULL; i++) {
item.pszText = szGroup;
- newItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
+ SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
}
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP);
@@ -257,12 +258,12 @@ static int FillDialog(HWND hwnd)
lvc.mask = LVCF_FMT;
lvc.fmt = LVCFMT_IMAGE | LVCFMT_LEFT;
ListView_InsertColumn(hwndList, 0, &lvc);
- for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
+ for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
LVITEM item = { 0 };
item.mask = LVIF_TEXT;
item.pszText = pcli->pfnGetStatusModeDescription(i, 0);
item.iItem = i - ID_STATUS_OFFLINE;
- newItem = SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
+ SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
}
ListView_SetColumnWidth(hwndList, 0, LVSCW_AUTOSIZE);
ListView_Arrange(hwndList, LVA_ALIGNLEFT | LVA_ALIGNTOP);
@@ -343,8 +344,8 @@ static int DeleteAutoModesCallback(char *szsetting)
}
-void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD statusMask, DWORD stickyStatusMask, unsigned int options,
- unsigned int stickies, unsigned int operators, unsigned int lmdat)
+void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szProtoFilter, DWORD dwStatusMask, DWORD dwStickyStatusMask,
+ unsigned int options, unsigned int stickies, unsigned int operators, unsigned int lmdat)
{
CLVM_EnumModes(DeleteAutoModesCallback);
@@ -354,9 +355,9 @@ void SaveViewMode(const char *name, const TCHAR *szGroupFilter, const char *szPr
mir_snprintf(szSetting, "%c%s_GF", 246, name);
db_set_ws(NULL, CLVM_MODULE, szSetting, szGroupFilter);
mir_snprintf(szSetting, "%c%s_SM", 246, name);
- db_set_dw(NULL, CLVM_MODULE, szSetting, statusMask);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, dwStatusMask);
mir_snprintf(szSetting, "%c%s_SSM", 246, name);
- db_set_dw(NULL, CLVM_MODULE, szSetting, stickyStatusMask);
+ db_set_dw(NULL, CLVM_MODULE, szSetting, dwStickyStatusMask);
mir_snprintf(szSetting, "%c%s_OPT", 246, name);
db_set_dw(NULL, CLVM_MODULE, szSetting, options);
mir_snprintf(szSetting, "%c%s_LM", 246, name);
@@ -486,7 +487,6 @@ static void UpdateFilters()
char szSetting[128];
DWORD dwFlags;
DWORD opt;
- TCHAR szTemp[100];
if (clvm_curItem == LB_ERR)
return;
@@ -500,10 +500,11 @@ static void UpdateFilters()
T2Utf szBuf(szTempBuf);
mir_strncpy(g_szModename, szBuf, _countof(g_szModename));
-
- mir_sntprintf(szTemp, TranslateT("Configuring view mode: %s"), szTempBuf);
- SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
-
+ {
+ TCHAR szTemp[100];
+ mir_sntprintf(szTemp, TranslateT("Configuring view mode: %s"), szTempBuf);
+ SetDlgItemText(clvmHwnd, IDC_CURVIEWMODE2, szTemp);
+ }
mir_snprintf(szSetting, "%c%s_PF", 246, szBuf);
ptrA szPF(db_get_sa(NULL, CLVM_MODULE, szSetting));
if (szPF == NULL)