summaryrefslogtreecommitdiff
path: root/plugins/Popup
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Popup')
-rw-r--r--plugins/Popup/src/main.cpp3
-rw-r--r--plugins/Popup/src/popup_wnd2.cpp31
-rw-r--r--plugins/Popup/src/popup_wnd2.h2
-rw-r--r--plugins/Popup/src/services.cpp104
-rw-r--r--plugins/Popup/src/services.h2
5 files changed, 18 insertions, 124 deletions
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 4de24b0646..b68a7e54f6 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -392,9 +392,8 @@ MIRAPI int Load(void)
CreateServiceFunction(MS_POPUP_ADDPOPUPW, PopUp_AddPopUpW);
CreateServiceFunction(MS_POPUP_ADDPOPUP2, PopUp_AddPopUp2);
- CreateServiceFunction(MS_POPUP_CHANGETEXT, PopUp_ChangeText);
CreateServiceFunction(MS_POPUP_CHANGETEXTW, PopUp_ChangeTextW);
- CreateServiceFunction(MS_POPUP_CHANGE, PopUp_Change);
+
CreateServiceFunction(MS_POPUP_CHANGEW, PopUp_ChangeW);
CreateServiceFunction(MS_POPUP_CHANGEPOPUP2, PopUp_Change2);
diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp
index cc4a55d55b..7ab564817b 100644
--- a/plugins/Popup/src/popup_wnd2.cpp
+++ b/plugins/Popup/src/popup_wnd2.cpp
@@ -749,36 +749,6 @@ void PopupWnd2::setIcon(HICON hNewIcon)
}
}
-void PopupWnd2::updateData(POPUPDATAEX_V2 *ppd)
-{
- m_hContact = ppd->lchContact;
-
- m_clBack = ppd->colorBack;
- m_clClock = m_clTitle = m_clText = ppd->colorText;
- m_iTimeout = ppd->iSeconds ? ppd->iSeconds : m_options->Seconds;
-
- if (m_textType == TT_NONE) m_textType = TT_ANSI;
- mir_free(m_lpzText); mir_free(m_lpzTitle);
- mir_free(m_lpwzText); mir_free(m_lpwzTitle);
- m_lpzTitle = mir_strdup(ppd->lpzContactName);
- m_lpzText = mir_strdup(ppd->lpzText);
- m_lpwzTitle = m_lpwzText = NULL;
- setIcon(ppd->lchIcon);
- m_hNotification = ppd->hNotification;
-
- m_PluginData = ppd->PluginData;
- m_PluginWindowProc = ppd->PluginWindowProc;
-
- if (m_options->DisplayTime)
- GetTimeFormatA(LOCALE_USER_DEFAULT, 0, NULL,"HH':'mm", m_time, SIZEOF(m_time));
- else m_time[0] = 0;
-
- fixDefaults();
- fixActions(ppd->lpActions, ppd->actionCount);
-
- if (m_textType == TT_MTEXT) buildMText();
-}
-
void PopupWnd2::updateData(POPUPDATAW_V2 *ppd)
{
m_hContact = ppd->lchContact;
@@ -1418,7 +1388,6 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara
case CPT_TEXTW: updateText((WCHAR *)lParam); mir_free((void *)lParam); break;
case CPT_TITLE: updateTitle((char *)lParam); mir_free((void *)lParam); break;
case CPT_TITLEW: updateTitle((WCHAR *)lParam); mir_free((void *)lParam); break;
- case CPT_DATAEX: updateData((POPUPDATAEX_V2 *)lParam); mir_free((void *)lParam); break;
case CPT_DATAW: updateData((POPUPDATAW_V2 *)lParam); mir_free((void *)lParam); break;
}
update();
diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h
index 6fcd148707..ef4760d496 100644
--- a/plugins/Popup/src/popup_wnd2.h
+++ b/plugins/Popup/src/popup_wnd2.h
@@ -130,7 +130,6 @@ public:
void setIcon(HICON);
- void updateData(POPUPDATAEX_V2 *ppd);
void updateData(POPUPDATAW_V2 *ppd);
void updateData(POPUPDATA2 *ppd);
void buildMText();
@@ -215,7 +214,6 @@ public:
SendMessage(m_hwnd, UM_CALLMETHOD, (WPARAM)method_copy, (LPARAM)lParam);
}
- LRESULT m_updateData_POPUPDATAEX_V2(LPARAM arg) { updateData((POPUPDATAEX_V2 *)arg); update(); return 0; }
LRESULT m_updateData_POPUPDATAW_V2(LPARAM arg) { updateData((POPUPDATAW_V2 *)arg); update(); return 0; }
LRESULT m_updateData_POPUPDATA2(LPARAM arg) { updateData((POPUPDATA2 *)arg); update(); return 0; }
LRESULT m_updateText(LPARAM arg) { updateText((char *)arg); update(); return 0; }
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index 74301c89bb..191cb42e47 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -89,7 +89,7 @@ INT_PTR PopUp_AddPopUp(WPARAM wParam, LPARAM lParam)
{
if (!gbPopupLoaded) return -1;
- POPUPDATAEX_V2 *ppd = (POPUPDATAEX_V2*)wParam;
+ POPUPDATA *ppd = (POPUPDATA*)wParam;
if (!ppd) return -1;
POPUPDATA2 ppd2 = { sizeof(ppd2) };
@@ -103,26 +103,7 @@ INT_PTR PopUp_AddPopUp(WPARAM wParam, LPARAM lParam)
ppd2.PluginWindowProc = ppd->PluginWindowProc;
ppd2.PluginData = ppd->PluginData;
ppd2.iSeconds = ppd->iSeconds;
-
- if (lParam&APF_NEWDATA)
- {
- ppd2.lchNotification = ppd->hNotification;
- ppd2.actionCount = ppd->actionCount;
- ppd2.lpActions = ppd->lpActions;
-// ppd2.hbmAvatar = ppd->hbmAvatar;
- }
-
return PopUp_AddPopUp2((WPARAM)&ppd2, lParam);
-
-/*
- if (lParam & APF_RETURN_HWND)
- {
- while (!wnd->bWindowCreated) Sleep(1);
- return (int)wnd->getHwnd();
- }
-
- return 1;
-*/
}
//===== PopUp/AddPopupW
@@ -146,25 +127,13 @@ INT_PTR PopUp_AddPopUpW(WPARAM wParam, LPARAM lParam)
ppd2.PluginData = ppd->PluginData;
ppd2.iSeconds = ppd->iSeconds;
- if (lParam&APF_NEWDATA)
- {
+ if (lParam & APF_NEWDATA) {
ppd2.lchNotification = ppd->hNotification;
ppd2.actionCount = ppd->actionCount;
ppd2.lpActions = ppd->lpActions;
-// ppd2.hbmAvatar = ppd->hbmAvatar;
}
return PopUp_AddPopUp2((WPARAM)&ppd2, lParam);
-
-/*
- if (lParam & APF_RETURN_HWND)
- {
- while (!wnd->bWindowCreated) Sleep(1);
- return (int)wnd->getHwnd();
- }
-
- return 1;
-*/
}
//===== PopUp/AddPopup2
@@ -284,11 +253,12 @@ INT_PTR PopUp_GetContact(WPARAM wParam, LPARAM lParam)
//===== PopUp/GetPluginData
INT_PTR PopUp_GetPluginData(WPARAM wParam, LPARAM lParam)
{
- if (!gbPopupLoaded) return -1;
+ if (!gbPopupLoaded || !wParam)
+ return -1;
- HWND hwnd = (HWND)wParam;
- PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (wnd && IsValidPopupObject(wnd)) return (INT_PTR)wnd->getData();
+ PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
+ if (wnd && IsValidPopupObject(wnd))
+ return (INT_PTR)wnd->getData();
return (INT_PTR)(-1);
}
@@ -298,71 +268,31 @@ INT_PTR PopUp_IsSecondLineShown(WPARAM wParam, LPARAM lParam)
return 1;
}
-//===== PopUp/ChangeText
-INT_PTR PopUp_ChangeText(WPARAM wParam, LPARAM lParam)
-{
- if (!gbPopupLoaded) return -1;
-
- if (!wParam) return -1;
- PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
- if (!wnd || !IsValidPopupObject(wnd)) return -1;
- wnd->callMethodSync(&PopupWnd2::m_updateText, lParam);
-/*
- char *str = (char *)mir_alloc(sizeof(char) * (strlen((char *)lParam) + 1));
- strcpy(str, (char *)lParam);
- PostMessage((HWND)wParam, UM_CHANGEPOPUP, CPT_TEXT, (LPARAM)str);
-*/
- return 0;
-}
-
//===== PopUp/ChangeTextW
INT_PTR PopUp_ChangeTextW(WPARAM wParam, LPARAM lParam)
{
- if (!gbPopupLoaded) return -1;
+ if (!gbPopupLoaded || !wParam)
+ return -1;
- if (!wParam) return -1;
PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
- if (!wnd || !IsValidPopupObject(wnd)) return -1;
- wnd->callMethodSync(&PopupWnd2::m_updateTextW, lParam);
-/*
- WCHAR *str = (WCHAR *)mir_alloc(sizeof(WCHAR) * (wcslen((WCHAR *)lParam) + 1));
- wcscpy(str, (WCHAR *)lParam);
- PostMessage((HWND)wParam, UM_CHANGEPOPUP, CPT_TEXTW, (LPARAM)str);
-*/
- return 0;
-}
-
-//===== PopUp/Change
-INT_PTR PopUp_Change(WPARAM wParam, LPARAM lParam)
-{
- if (!gbPopupLoaded) return -1;
+ if (!wnd || !IsValidPopupObject(wnd))
+ return -1;
- if (!wParam) return -1;
- PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
- if (!wnd || !IsValidPopupObject(wnd)) return -1;
- wnd->callMethodSync(&PopupWnd2::m_updateData_POPUPDATAEX_V2, lParam);
-/*
- POPUPDATAEX_V2 *ppdx = (POPUPDATAEX_V2 *)mir_alloc(sizeof(POPUPDATAEX_V2));
- memcpy(ppdx, (POPUPDATAEX_V2 *)lParam, sizeof(POPUPDATAEX_V2));
- PostMessage((HWND)wParam, UM_CHANGEPOPUP, CPT_DATA, (LPARAM)ppdx);
-*/
+ wnd->callMethodSync(&PopupWnd2::m_updateTextW, lParam);
return 0;
}
//===== PopUp/ChangeW
INT_PTR PopUp_ChangeW(WPARAM wParam, LPARAM lParam)
{
- if (!gbPopupLoaded) return -1;
+ if (!gbPopupLoaded || !wParam)
+ return -1;
- if (!wParam) return -1;
PopupWnd2 *wnd = (PopupWnd2 *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
- if (!wnd || !IsValidPopupObject(wnd)) return -1;
+ if (!wnd || !IsValidPopupObject(wnd))
+ return -1;
+
wnd->callMethodSync(&PopupWnd2::m_updateData_POPUPDATAW_V2, lParam);
-/*
- POPUPDATAW_V2 *ppdw = (POPUPDATAW_V2 *)mir_alloc(sizeof(POPUPDATAW_V2));
- memcpy(ppdw, (POPUPDATAW_V2 *)lParam, sizeof(POPUPDATAW_V2));
- PostMessage((HWND)wParam, UM_CHANGEPOPUP, CPT_DATA, (LPARAM)ppdw);
-*/
return 0;
}
diff --git a/plugins/Popup/src/services.h b/plugins/Popup/src/services.h
index ab0f0ddb43..30258db64a 100644
--- a/plugins/Popup/src/services.h
+++ b/plugins/Popup/src/services.h
@@ -34,10 +34,8 @@ INT_PTR PopUp_AddPopUp2(WPARAM, LPARAM);
INT_PTR PopUp_GetContact(WPARAM, LPARAM);
INT_PTR PopUp_IsSecondLineShown(WPARAM, LPARAM);
-INT_PTR PopUp_ChangeText(WPARAM, LPARAM);
INT_PTR PopUp_ChangeTextW(WPARAM, LPARAM);
-INT_PTR PopUp_Change(WPARAM, LPARAM);
INT_PTR PopUp_ChangeW(WPARAM, LPARAM);
INT_PTR PopUp_Change2(WPARAM, LPARAM);