diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-02 15:55:48 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-02 15:55:48 +0000 |
commit | ab53b72bf7067feb9dede0fd76b5a3cbc13863b9 (patch) | |
tree | 677a18bc997d1cf118379b288a7c2dd2c160d9b1 /plugins/Popup/src/popup_wnd2.cpp | |
parent | 1c229f90bfc6c8032bd2d20e297e97f321eb4db7 (diff) |
- old PNG conversion code (png2dib, dib2png) removed;
- m_png.h also removed;
- all calls of LoadImage replaced with CallService(MS_IMG_LOAD);
- four invalid CloseHandle() calls removed;
- massive code cleaning for Popup, HistoryStats & SplashScreen plugins
git-svn-id: http://svn.miranda-ng.org/main/trunk@13974 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Popup/src/popup_wnd2.cpp')
-rw-r--r-- | plugins/Popup/src/popup_wnd2.cpp | 198 |
1 files changed, 99 insertions, 99 deletions
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index aad7891cbb..1dd02de909 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -968,16 +968,16 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara break;
case ACT_DEF_ADD:
- {
- ADDCONTACTSTRUCT acs = { 0 };
- acs.hContact = m_hContact;
- acs.handleType = HANDLE_CONTACT;
- acs.szProto = 0;
- CallServiceSync(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
- PUDeletePopup(m_hwnd);
- }
- break;
+ {
+ ADDCONTACTSTRUCT acs = { 0 };
+ acs.hContact = m_hContact;
+ acs.handleType = HANDLE_CONTACT;
+ acs.szProto = 0;
+ CallServiceSync(MS_ADDCONTACT_SHOW, NULL, (LPARAM)&acs);
+ if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ PUDeletePopup(m_hwnd);
+ }
+ break;
case ACT_DEF_PIN:
if (m_bIsPinned)
@@ -1018,57 +1018,57 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara break;
case UM_POPUPMODIFYACTIONICON:
- {
- LPPOPUPACTIONID actionId = (LPPOPUPACTIONID)wParam;
- for (int i = 0; i < m_actionCount; ++i)
- if ((m_actions[i].actionA.wParam == actionId->wParam) &&
- (m_actions[i].actionA.lParam == actionId->lParam)) {
- m_actions[i].actionA.lchIcon = (HICON)lParam;
- animate();
- break;
- }
- }
- break;
+ {
+ LPPOPUPACTIONID actionId = (LPPOPUPACTIONID)wParam;
+ for (int i = 0; i < m_actionCount; ++i)
+ if ((m_actions[i].actionA.wParam == actionId->wParam) &&
+ (m_actions[i].actionA.lParam == actionId->lParam)) {
+ m_actions[i].actionA.lchIcon = (HICON)lParam;
+ animate();
+ break;
+ }
+ }
+ break;
case UM_MENUDONE:
- {
- unlock();
- if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
- PUDeletePopup(m_hwnd);
- break;
- }
+ {
+ unlock();
+ if (!(PopupOptions.actions&ACT_DEF_KEEPWND))
+ PUDeletePopup(m_hwnd);
+ break;
+ }
case WM_LBUTTONUP:
- {
- int i;
- for (i = 0; i < m_actionCount; ++i)
- if (m_actions[i].hover) {
- SendMessage(m_hwnd, UM_POPUPACTION, m_actions[i].actionA.wParam, m_actions[i].actionA.lParam);
- break;
- }
+ {
+ int i;
+ for (i = 0; i < m_actionCount; ++i)
+ if (m_actions[i].hover) {
+ SendMessage(m_hwnd, UM_POPUPACTION, m_actions[i].actionA.wParam, m_actions[i].actionA.lParam);
+ break;
+ }
- if (i == m_actionCount) {
- if (PopupOptions.overrideLeft != false && (m_hContact != NULL || PopupOptions.overrideLeft == 5 || PopupOptions.overrideLeft == 6)) {
- switch (PopupOptions.overrideLeft) {
- default:
- case 1:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_MESSAGE); break;
- case 2:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_REPLY); break;
- case 3:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_DETAILS); break;
- case 4:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_MENU); break;
- case 5:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_DISMISS); break;
- case 6:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_PIN); break;
- case 7:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_COPY); break;
+ if (i == m_actionCount) {
+ if (PopupOptions.overrideLeft != false && (m_hContact != NULL || PopupOptions.overrideLeft == 5 || PopupOptions.overrideLeft == 6)) {
+ switch (PopupOptions.overrideLeft) {
+ default:
+ case 1:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_MESSAGE); break;
+ case 2:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_REPLY); break;
+ case 3:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_DETAILS); break;
+ case 4:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_MENU); break;
+ case 5:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_DISMISS); break;
+ case 6:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_PIN); break;
+ case 7:SendMessage(m_hwnd, UM_POPUPACTION, 0, ACT_DEF_COPY); break;
+ }
+ }
+ else {
+ lock();
+ if (!PerformAction(m_hNotification, m_hwnd, message, wParam, lParam))
+ SendMessage(m_hwnd, WM_COMMAND, 0, 0);
+ unlock();
}
}
- else {
- lock();
- if (!PerformAction(m_hNotification, m_hwnd, message, wParam, lParam))
- SendMessage(m_hwnd, WM_COMMAND, 0, 0);
- unlock();
- }
+ break;
}
- break;
- }
case WM_MBUTTONUP:
if (PopupOptions.overrideMiddle != false && (m_hContact != NULL || PopupOptions.overrideMiddle == 5 || PopupOptions.overrideMiddle == 6)) {
@@ -1123,16 +1123,16 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara break;
case AVATAR_TIMER:
- {
- int newDelay = m_avatar->activeFrameDelay();
- animate();
- if ((newDelay <= 0) || (newDelay != m_avatarFrameDelay)) KillTimer(m_hwnd, AVATAR_TIMER);
- if (newDelay > 0) {
- SetTimer(m_hwnd, AVATAR_TIMER, newDelay, 0);
- m_avatarFrameDelay = newDelay;
+ {
+ int newDelay = m_avatar->activeFrameDelay();
+ animate();
+ if ((newDelay <= 0) || (newDelay != m_avatarFrameDelay)) KillTimer(m_hwnd, AVATAR_TIMER);
+ if (newDelay > 0) {
+ SetTimer(m_hwnd, AVATAR_TIMER, newDelay, 0);
+ m_avatarFrameDelay = newDelay;
+ }
}
- }
- break;
+ break;
case CURSOR_TIMER:
POINT pt; GetCursorPos(&pt);
@@ -1161,12 +1161,12 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara break;
case UM_CALLMETHOD:
- {
- MethodPtr *method_copy = (MethodPtr *)wParam;
- (this->*(*method_copy))(lParam);
- delete method_copy;
- }
- break;
+ {
+ MethodPtr *method_copy = (MethodPtr *)wParam;
+ (this->*(*method_copy))(lParam);
+ delete method_copy;
+ }
+ break;
case WM_PAINT:
if (GetUpdateRect(m_hwnd, 0, FALSE)) {
@@ -1184,44 +1184,44 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara break;
case WM_MOUSEMOVE:
- {
- const PopupSkin *skin = skins.getSkin(m_lpzSkin ? m_lpzSkin : m_options->SkinPack);
- if (skin)
- if (skin->onMouseMove(this, LOWORD(lParam), HIWORD(lParam)))
- animate();
-
- if (m_bIsHovered) break;
- TRACKMOUSEEVENT tme;
- tme.cbSize = sizeof(tme);
- tme.dwFlags = TME_LEAVE;
- tme.dwHoverTime = HOVER_DEFAULT;
- tme.hwndTrack = m_hwnd;
- _TrackMouseEvent(&tme);
- if (!m_customPopup) PopupThreadLock();
+ {
+ const PopupSkin *skin = skins.getSkin(m_lpzSkin ? m_lpzSkin : m_options->SkinPack);
+ if (skin)
+ if (skin->onMouseMove(this, LOWORD(lParam), HIWORD(lParam)))
+ animate();
+
+ if (m_bIsHovered) break;
+ TRACKMOUSEEVENT tme;
+ tme.cbSize = sizeof(tme);
+ tme.dwFlags = TME_LEAVE;
+ tme.dwHoverTime = HOVER_DEFAULT;
+ tme.hwndTrack = m_hwnd;
+ _TrackMouseEvent(&tme);
+ if (!m_customPopup) PopupThreadLock();
- if (m_options->OpaqueOnHover)
- updateLayered(255);
+ if (m_options->OpaqueOnHover)
+ updateLayered(255);
- m_bIsHovered = true;
- }
- break;
+ m_bIsHovered = true;
+ }
+ break;
case WM_MOUSELEAVE:
- {
- const PopupSkin *skin = skins.getSkin(m_lpzSkin ? m_lpzSkin : m_options->SkinPack);
- if (skin)
- if (skin->onMouseMove(this, LOWORD(lParam), HIWORD(lParam)))
- animate();
+ {
+ const PopupSkin *skin = skins.getSkin(m_lpzSkin ? m_lpzSkin : m_options->SkinPack);
+ if (skin)
+ if (skin->onMouseMove(this, LOWORD(lParam), HIWORD(lParam)))
+ animate();
- if (!m_bIsHovered) break;
+ if (!m_bIsHovered) break;
- if (m_options->OpaqueOnHover)
- updateLayered(m_options->UseTransparency ? m_options->Alpha : 255);
+ if (m_options->OpaqueOnHover)
+ updateLayered(m_options->UseTransparency ? m_options->Alpha : 255);
- if (!m_customPopup) PopupThreadUnlock();
- m_bIsHovered = false;
- }
- break;
+ if (!m_customPopup) PopupThreadUnlock();
+ m_bIsHovered = false;
+ }
+ break;
case WM_CLOSE:
hide();
|