From 87fff9deac0941da4e87728f14c917700d5bbdec Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 27 Aug 2015 17:07:10 +0000 Subject: name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@15046 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Clist_nicer/src/clui.cpp | 20 ++--- plugins/Clist_nicer/src/cluiframes.cpp | 4 +- plugins/Clist_nicer/src/cluiservices.cpp | 3 +- plugins/MyDetails/src/frame.cpp | 134 ++++++++++++++----------------- plugins/Utils/mir_smileys.cpp | 6 +- 5 files changed, 78 insertions(+), 89 deletions(-) (limited to 'plugins') diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 59a506a4f1..752cc0c8c2 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -659,13 +659,14 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) HDC hdc = nmcsbcd->hdc; StatusItems_t *item = 0, *arrowItem = 0; UINT uItemID = ID_EXTBKSCROLLBACK; - RECT rcWindow; - POINT pt; - DWORD dfcFlags; HRGN rgn = 0; - GetWindowRect(pcli->hwndContactTree, &rcWindow); - pt.x = rcWindow.left; - pt.y = rcWindow.top; + + RECT rc; + GetWindowRect(pcli->hwndContactTree, &rc); + + POINT pt; + pt.x = rc.left; + pt.y = rc.top; ScreenToClient(pcli->hwndContactList, &pt); hdcScroll = hdc; BitBlt(hdcScroll, nmcsbcd->rect.left, nmcsbcd->rect.top, nmcsbcd->rect.right - nmcsbcd->rect.left, @@ -697,9 +698,8 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) DrawAlpha(hdcScroll, &nmcsbcd->rect, item->COLOR, alpha, item->COLOR2, item->COLOR2_TRANSPARENT, item->GRADIENT, item->CORNER, item->BORDERSTYLE, item->imageItem); } - dfcFlags = DFCS_FLAT | (nmcsbcd->uState == CDIS_DISABLED ? DFCS_INACTIVE : - (nmcsbcd->uState == CDIS_HOT ? DFCS_HOT : - (nmcsbcd->uState == CDIS_SELECTED ? DFCS_PUSHED : 0))); + DWORD dfcFlags = DFCS_FLAT | (nmcsbcd->uState == CDIS_DISABLED ? DFCS_INACTIVE : + (nmcsbcd->uState == CDIS_HOT ? DFCS_HOT : (nmcsbcd->uState == CDIS_SELECTED ? DFCS_PUSHED : 0))); if (nmcsbcd->uItem == HTSCROLL_UP) arrowItem = arStatusItems[ID_EXTBKSCROLLARROWUP - ID_STATUS_OFFLINE]; @@ -707,7 +707,7 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) arrowItem = arStatusItems[ID_EXTBKSCROLLARROWDOWN - ID_STATUS_OFFLINE]; if (arrowItem && !arrowItem->IGNORED) DrawAlpha(hdcScroll, &nmcsbcd->rect, arrowItem->COLOR, arrowItem->ALPHA, arrowItem->COLOR2, arrowItem->COLOR2_TRANSPARENT, - arrowItem->GRADIENT, arrowItem->CORNER, arrowItem->BORDERSTYLE, arrowItem->imageItem); + arrowItem->GRADIENT, arrowItem->CORNER, arrowItem->BORDERSTYLE, arrowItem->imageItem); else if (arrowItem) DrawFrameControl(hdcScroll, &nmcsbcd->rect, DFC_SCROLL, (nmcsbcd->uItem == HTSCROLL_UP ? DFCS_SCROLLUP : DFCS_SCROLLDOWN) | dfcFlags); diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index ace31e1037..bbf7b4f8e0 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -1409,7 +1409,6 @@ static int UpdateTBToolTip(int framepos) int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BOOL hasTitleBar) { - HDC hdc; RECT rcWindow, rc; HWND hwndParent = GetParent(hwnd); LRESULT result = 0; @@ -1457,7 +1456,7 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO } if (GetWindowLongPtr(hwnd, GWL_STYLE) & WS_BORDER) { - hdc = GetWindowDC(hwnd); + HDC hdc = GetWindowDC(hwnd); HPEN hPenOld = reinterpret_cast(SelectObject(hdc, g_hPenCLUIFrames)); GetWindowRect(hwnd, &rcWindow); rc.left = rc.top = 0; @@ -2812,7 +2811,6 @@ LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wParam, L CLUIFrameResizeFloatingFrame(framepos); - RECT rect; GetWindowRect(Frames[framepos].ContainerWnd, &rect); Frames[framepos].FloatingPos.x = rect.left; Frames[framepos].FloatingPos.y = rect.top; diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index cda2e1b583..e5e059f787 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -164,7 +164,8 @@ void CluiProtocolStatusChanged(int, const char*) // count down since built in ones tend to go at the end char *szMaxProto = NULL; - for (int i = 0, partCount = 0; i < protoCount; i++) { + partCount = 0; + for (int i = 0; i < protoCount; i++) { int idx = pcli->pfnGetAccountIndexByPos(i); if (idx == -1) continue; diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index f54aa50a94..8bf2303ab8 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -372,15 +372,15 @@ LRESULT CALLBACK FrameContainerWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LP break; case WM_SIZE: - { - HWND child = (HWND)GetWindowLongPtr(hwnd, GWLP_USERDATA); - RECT r; - GetClientRect(hwnd, &r); + { + HWND child = (HWND)GetWindowLongPtr(hwnd, GWLP_USERDATA); + RECT r; + GetClientRect(hwnd, &r); - SetWindowPos(child, 0, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOZORDER | SWP_NOACTIVATE); - InvalidateRect(child, NULL, TRUE); - } - return TRUE; + SetWindowPos(child, 0, r.left, r.top, r.right - r.left, r.bottom - r.top, SWP_NOZORDER | SWP_NOACTIVATE); + InvalidateRect(child, NULL, TRUE); + } + return TRUE; case WM_CLOSE: db_set_b(0, MODULE_NAME, SETTING_FRAME_VISIBLE, 0); @@ -1441,7 +1441,7 @@ void ShowProtocolStatusMenu(HWND hwnd, MyDetailsFrameData *data, Protocol *proto } else { // Well, lets do it by hand - static int statusModePf2List[] = { 0xFFFFFFFF, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND, PF2_HEAVYDND, PF2_FREECHAT, + static unsigned statusModePf2List[] = { 0xFFFFFFFF, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND, PF2_HEAVYDND, PF2_FREECHAT, PF2_INVISIBLE, PF2_ONTHEPHONE, PF2_OUTTOLUNCH }; menu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_MENU1)); @@ -1523,10 +1523,10 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar { MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd, GWLP_USERDATA); Protocol *proto; + RECT r; switch (msg) { case WM_CREATE: - { data = new MyDetailsFrameData(); memset(data, 0, sizeof(MyDetailsFrameData)); SetWindowLongPtr(hwnd, GWLP_USERDATA, (LONG_PTR)data); @@ -1541,23 +1541,21 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar SetCycleTime(hwnd); SetStatusMessageRefreshTime(hwnd); - - TRACKMOUSEEVENT tme; - tme.cbSize = sizeof(TRACKMOUSEEVENT); - tme.dwFlags = TME_HOVER | TME_LEAVE; - tme.hwndTrack = hwnd; - tme.dwHoverTime = HOVER_DEFAULT; - TrackMouseEvent(&tme); - } - return TRUE; + { + TRACKMOUSEEVENT tme; + tme.cbSize = sizeof(TRACKMOUSEEVENT); + tme.dwFlags = TME_HOVER | TME_LEAVE; + tme.hwndTrack = hwnd; + tme.dwHoverTime = HOVER_DEFAULT; + TrackMouseEvent(&tme); + } + return TRUE; case WM_PRINTCLIENT: Draw(hwnd, (HDC)wParam); return TRUE; case WM_PAINT: - { - RECT r; if (GetUpdateRect(hwnd, &r, FALSE)) { PAINTSTRUCT ps; @@ -1565,8 +1563,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar Draw(hwnd, hdc); EndPaint(hwnd, &ps); } - } - return TRUE; + return TRUE; case WM_SIZE: data->recalc_rectangles = true; @@ -2048,14 +2045,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_NCMOUSELEAVE: case WM_MOUSELEAVE: - { - TRACKMOUSEEVENT tme; - tme.cbSize = sizeof(TRACKMOUSEEVENT); - tme.dwFlags = TME_HOVER; - tme.hwndTrack = hwnd; - tme.dwHoverTime = HOVER_DEFAULT; - TrackMouseEvent(&tme); - } + { + TRACKMOUSEEVENT tme; + tme.cbSize = sizeof(TRACKMOUSEEVENT); + tme.dwFlags = TME_HOVER; + tme.hwndTrack = hwnd; + tme.dwHoverTime = HOVER_DEFAULT; + TrackMouseEvent(&tme); + } case WM_NCMOUSEMOVE: MakeHover(hwnd, data->draw_img, &data->mouse_over_img, NULL, NULL); MakeHover(hwnd, data->draw_nick, &data->mouse_over_nick, NULL, NULL); @@ -2066,14 +2063,14 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar break; case WM_MOUSEHOVER: - { - TRACKMOUSEEVENT tme; - tme.cbSize = sizeof(TRACKMOUSEEVENT); - tme.dwFlags = TME_LEAVE; - tme.hwndTrack = hwnd; - tme.dwHoverTime = HOVER_DEFAULT; - TrackMouseEvent(&tme); - } + { + TRACKMOUSEEVENT tme; + tme.cbSize = sizeof(TRACKMOUSEEVENT); + tme.dwFlags = TME_LEAVE; + tme.hwndTrack = hwnd; + tme.dwHoverTime = HOVER_DEFAULT; + TrackMouseEvent(&tme); + } case WM_MOUSEMOVE: proto = protocols->Get(data->protocol_number); if (proto != NULL) { @@ -2088,36 +2085,32 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar break; case WM_NOTIFY: - { - LPNMHDR lpnmhdr = (LPNMHDR)lParam; - - switch (lpnmhdr->code) { - case TTN_GETDISPINFO: { - MyDetailsFrameData *data = (MyDetailsFrameData *)GetWindowLongPtr(hwnd, GWLP_USERDATA); - proto = protocols->Get(data->protocol_number); - - LPNMTTDISPINFO lpttd = (LPNMTTDISPINFO)lpnmhdr; - SendMessage(lpnmhdr->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 300); - - if (lpnmhdr->hwndFrom == data->nick_tt_hwnd) - lpttd->lpszText = proto->nickname; - else if (lpnmhdr->hwndFrom == data->status_tt_hwnd) - lpttd->lpszText = proto->status_name; - else if (lpnmhdr->hwndFrom == data->away_msg_tt_hwnd) - lpttd->lpszText = proto->status_message; - else if (lpnmhdr->hwndFrom == data->listening_to_tt_hwnd) - lpttd->lpszText = proto->listening_to; - else if (lpnmhdr->hwndFrom == data->next_proto_tt_hwnd) - lpttd->lpszText = TranslateT("Show next account"); - else if (lpnmhdr->hwndFrom == data->prev_proto_tt_hwnd) - lpttd->lpszText = TranslateT("Show previous account"); - - return 0; - } + LPNMHDR lpnmhdr = (LPNMHDR)lParam; + switch (lpnmhdr->code) { + case TTN_GETDISPINFO: + proto = protocols->Get(data->protocol_number); + + LPNMTTDISPINFO lpttd = (LPNMTTDISPINFO)lpnmhdr; + SendMessage(lpnmhdr->hwndFrom, TTM_SETMAXTIPWIDTH, 0, 300); + + if (lpnmhdr->hwndFrom == data->nick_tt_hwnd) + lpttd->lpszText = proto->nickname; + else if (lpnmhdr->hwndFrom == data->status_tt_hwnd) + lpttd->lpszText = proto->status_name; + else if (lpnmhdr->hwndFrom == data->away_msg_tt_hwnd) + lpttd->lpszText = proto->status_message; + else if (lpnmhdr->hwndFrom == data->listening_to_tt_hwnd) + lpttd->lpszText = proto->listening_to; + else if (lpnmhdr->hwndFrom == data->next_proto_tt_hwnd) + lpttd->lpszText = TranslateT("Show next account"); + else if (lpnmhdr->hwndFrom == data->prev_proto_tt_hwnd) + lpttd->lpszText = TranslateT("Show previous account"); + + return 0; + } } - } - break; + break; case WM_DESTROY: KillTimer(hwnd, ID_FRAME_TIMER); @@ -2128,7 +2121,7 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar } break; - // Custom Messages ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + // Custom Messages ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// case MWM_REFRESH: KillTimer(hwnd, ID_RECALC_TIMER); SetTimer(hwnd, ID_RECALC_TIMER, RECALC_TIME, NULL); @@ -2148,7 +2141,6 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar proto->GetNick(); RefreshFrame(); } - break; case MWM_STATUS_CHANGED: @@ -2160,7 +2152,6 @@ LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar RefreshFrame(); } - break; case MWM_STATUS_MSG_CHANGED: @@ -2400,8 +2391,7 @@ int SettingsChangedHook(WPARAM wParam, LPARAM lParam) || !mir_strcmp(cws->szSetting, "FirstName") || !mir_strcmp(cws->szSetting, "e-mail") || !mir_strcmp(cws->szSetting, "LastName") - || !mir_strcmp(cws->szSetting, "JID")) - { + || !mir_strcmp(cws->szSetting, "JID")) { // Name changed if (proto != NULL) PostMessage(hwnd_frame, MWM_NICK_CHANGED, (WPARAM)proto->name, 0); diff --git a/plugins/Utils/mir_smileys.cpp b/plugins/Utils/mir_smileys.cpp index 1c27bd67fc..6ecd7ce27b 100644 --- a/plugins/Utils/mir_smileys.cpp +++ b/plugins/Utils/mir_smileys.cpp @@ -236,10 +236,10 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SortedList *plText, UINT uText TextPiece *piece = (TextPiece *)plText->items[i]; if (piece->type == TEXT_PIECE_TYPE_TEXT) { - RECT text_rc = { 0, 0, 0x7FFFFFFF, 0x7FFFFFFF }; + RECT rc = { 0, 0, 0x7FFFFFFF, 0x7FFFFFFF }; - DrawText(hdcMem, &szText[piece->start_pos], piece->len, &text_rc, DT_CALCRECT | uTextFormat); - text_size.cx = text_size.cx + text_rc.right - text_rc.left; + DrawText(hdcMem, &szText[piece->start_pos], piece->len, &rc, DT_CALCRECT | uTextFormat); + text_size.cx = text_size.cx + rc.right - rc.left; } else { double factor; -- cgit v1.2.3