summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-07-25 12:27:51 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-07-25 12:27:51 +0300
commit6e63bcacce1a62e7662c7fe8195634fb18d654ab (patch)
tree78895ff79700b4f10b1a3f7ba15b0d69c01b006a /src
parenta92db8555c61dba89b68862097d54b6bdf11895c (diff)
bunch of unused junk removed from StdPopup
Diffstat (limited to 'src')
-rw-r--r--src/core/stdpopup/res/resource.rc15
-rw-r--r--src/core/stdpopup/src/message_pump.cpp12
-rw-r--r--src/core/stdpopup/src/message_pump.h2
-rw-r--r--src/core/stdpopup/src/notify.h6
-rw-r--r--src/core/stdpopup/src/notify_imp.cpp126
-rw-r--r--src/core/stdpopup/src/popwin.cpp32
-rw-r--r--src/core/stdpopup/src/popwin.h4
-rw-r--r--src/core/stdpopup/src/resource.h1
-rw-r--r--src/core/stdpopup/src/stdafx.h5
-rw-r--r--src/core/stdpopup/src/yapp.cpp5
10 files changed, 1 insertions, 207 deletions
diff --git a/src/core/stdpopup/res/resource.rc b/src/core/stdpopup/res/resource.rc
index 27facda6fd..cc5b9a5072 100644
--- a/src/core/stdpopup/res/resource.rc
+++ b/src/core/stdpopup/res/resource.rc
@@ -109,13 +109,6 @@ BEGIN
CONTROL "Round corners (avatar)",IDC_CHK_ROUNDCORNERSAV,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,25,149,121,10
END
-IDD_OPT_NOTIFY DIALOGEX 0, 0, 187, 91
-STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD
-EXSTYLE WS_EX_CONTROLPARENT
-FONT 8, "MS Shell Dlg", 0, 0, 0x1
-BEGIN
-END
-
IDD_CLASSES DIALOGEX 0, 0, 294, 223
STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD
EXSTYLE WS_EX_CONTROLPARENT
@@ -149,14 +142,6 @@ BEGIN
BOTTOMMARGIN, 211
END
- IDD_OPT_NOTIFY, DIALOG
- BEGIN
- LEFTMARGIN, 7
- RIGHTMARGIN, 180
- TOPMARGIN, 7
- BOTTOMMARGIN, 84
- END
-
IDD_CLASSES, DIALOG
BEGIN
LEFTMARGIN, 7
diff --git a/src/core/stdpopup/src/message_pump.cpp b/src/core/stdpopup/src/message_pump.cpp
index e93ab0094a..0b7fe9f519 100644
--- a/src/core/stdpopup/src/message_pump.cpp
+++ b/src/core/stdpopup/src/message_pump.cpp
@@ -30,10 +30,8 @@ unsigned __stdcall MessagePumpThread(void *param)
PopupData *pd = (PopupData *)hwndMsg.lParam;
if (enabled && num_popups < MAX_POPUPS) {
- HWND hwnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, POP_WIN_CLASS, L"Popup", WS_POPUP, 0, 0, 0, 0, nullptr, nullptr, g_plugin.getInst(), (LPVOID)hwndMsg.lParam);
+ CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, POP_WIN_CLASS, L"Popup", WS_POPUP, 0, 0, 0, 0, nullptr, nullptr, g_plugin.getInst(), (LPVOID)hwndMsg.lParam);
num_popups++;
- if (hwndMsg.wParam) // set notifyer handle
- SendMessage(hwnd, PUM_SETNOTIFYH, hwndMsg.wParam, 0);
}
else if (pd) {
mir_free(pd->pwszTitle);
@@ -53,14 +51,6 @@ unsigned __stdcall MessagePumpThread(void *param)
}
break;
- case MUM_NMUPDATE:
- BroadcastMessage(PUM_UPDATENOTIFY, hwndMsg.wParam, 0);
- break;
-
- case MUM_NMREMOVE:
- BroadcastMessage(PUM_KILLNOTIFY, hwndMsg.wParam, 0);
- break;
-
case MUM_NMAVATAR:
RepositionWindows();
break;
diff --git a/src/core/stdpopup/src/message_pump.h b/src/core/stdpopup/src/message_pump.h
index c72a3eb47a..7b897bc44a 100644
--- a/src/core/stdpopup/src/message_pump.h
+++ b/src/core/stdpopup/src/message_pump.h
@@ -7,8 +7,6 @@ void PostMPMessage(UINT msg, WPARAM, LPARAM);
#define MUM_CREATEPOPUP (WM_USER + 0x011)
#define MUM_DELETEPOPUP (WM_USER + 0x012)
-#define MUM_NMUPDATE (WM_USER + 0x013)
-#define MUM_NMREMOVE (WM_USER + 0x014)
#define MUM_NMAVATAR (WM_USER + 0x015)
struct PopupData
diff --git a/src/core/stdpopup/src/notify.h b/src/core/stdpopup/src/notify.h
deleted file mode 100644
index 014670a963..0000000000
--- a/src/core/stdpopup/src/notify.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef _NOTIFY_IMP_INC
-#define _NOTIFY_IMP_INC
-
-void InitNotify();
-
-#endif
diff --git a/src/core/stdpopup/src/notify_imp.cpp b/src/core/stdpopup/src/notify_imp.cpp
deleted file mode 100644
index e9fe03a621..0000000000
--- a/src/core/stdpopup/src/notify_imp.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-#include "stdafx.h"
-
-//struct
-
-int Popup2Show(WPARAM, LPARAM lParam)
-{
-
- HANDLE hNotify = (HANDLE)lParam;
-
- PopupData *pd_out = (PopupData *)mir_alloc(sizeof(PopupData));
- memset(pd_out, 0, sizeof(PopupData));
-
- PostMPMessage(MUM_CREATEPOPUP, (WPARAM)hNotify, (LPARAM)pd_out);
- PostMPMessage(MUM_NMUPDATE, (WPARAM)hNotify, 0);
- return 0;
-}
-
-INT_PTR svcPopup2Show(WPARAM wParam, LPARAM lParam)
-{
- return Popup2Show(wParam, lParam);
-}
-
-int Popup2Update(WPARAM, LPARAM lParam)
-{
- HANDLE hNotify = (HANDLE)lParam;
- PostMPMessage(MUM_NMUPDATE, (WPARAM)hNotify, 0);
- return 0;
-}
-
-int AvatarChanged(WPARAM, LPARAM)
-{
- PostMPMessage(MUM_NMAVATAR, 0, 0);
- return 0;
-}
-
-INT_PTR svcPopup2Update(WPARAM wParam, LPARAM lParam)
-{
- return Popup2Update(wParam, lParam);
-}
-
-int Popup2Remove(WPARAM, LPARAM lParam)
-{
- HANDLE hNotify = (HANDLE)lParam;
- PostMPMessage(MUM_NMREMOVE, (WPARAM)hNotify, 0);
- return 0;
-}
-
-INT_PTR svcPopup2Remove(WPARAM wParam, LPARAM lParam)
-{
- return Popup2Remove(wParam, lParam);
-}
-
-INT_PTR svcPopup2DefaultActions(WPARAM wParam, LPARAM)
-{
- //PopupWindow *wnd = (PopupWindow *)MNotifyGetDWord((HANDLE)lParam, "Popup2/data", (DWORD)NULL);
- //if (!wnd) return 0;
- switch (wParam) {
- case 0:
- { // send message
- //if (wnd->lchContact) CallServiceSync(MS_MSG_SENDMESSAGE, (WPARAM)wnd->lchContact, 0);
- //SendMessage(wnd->lchMain, UM_DESTROYPOPUP, 0, 0);
- break;
- }
- case 1:
- { // dismiss popup
- //SendMessage(wnd->lchMain, UM_DESTROYPOPUP, 0, 0);
- break;
- }
- }
- return 0;
-}
-
-INT_PTR CALLBACK DlgProcPopups(HWND hwnd, UINT msg, WPARAM, LPARAM lParam)
-{
- /* To change options use MNotifySet*(hNotify, ....) Apply/Cancel is implemented in notify.dll */
- HANDLE hNotify = (HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA);
- switch (msg) {
- case WM_USER + 100:
- {
- // This will be extendet to handle array of handles for multiselect lParam
- // will be HANDLE * and wParam wil; store amount of handles passed
- hNotify = (HANDLE)lParam;
- SetWindowLongPtr(hwnd, GWLP_USERDATA, lParam);
- return TRUE;
- }
-
- case WM_COMMAND:
- // This in different from Miranda options!
- SendMessage(GetParent(GetParent(hwnd)), PSM_CHANGED, 0, 0);
- break;
- }
- return FALSE;
-}
-
-int NotifyOptionsInitialize(WPARAM wParam, LPARAM)
-{
- OPTIONSDIALOGPAGE odp = {};
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFY);
- odp.szTitle.a = LPGEN("Popups");
- odp.flags = ODPF_BOLDGROUPS;
- odp.pfnDlgProc = DlgProcPopups;
- CallService(MS_NOTIFY_OPT_ADDPAGE, wParam, (LPARAM)&odp);
- return 0;
-}
-
-int NotifyModulesLoaded(WPARAM, LPARAM)
-{
- HookEvent(ME_NOTIFY_OPT_INITIALISE, NotifyOptionsInitialize);
- HookEvent(ME_AV_AVATARCHANGED, AvatarChanged);
- return 0;
-}
-
-void InitNotify()
-{
- HookEvent(ME_NOTIFY_SHOW, Popup2Show);
- HookEvent(ME_NOTIFY_UPDATE, Popup2Update);
- HookEvent(ME_NOTIFY_REMOVE, Popup2Remove);
-
- CreateServiceFunction("Popup2/DefaultActions", svcPopup2DefaultActions);
-
- CreateServiceFunction(MS_POPUP2_SHOW, svcPopup2Show);
- CreateServiceFunction(MS_POPUP2_UPDATE, svcPopup2Update);
- CreateServiceFunction(MS_POPUP2_REMOVE, svcPopup2Remove);
-
- HookEvent(ME_SYSTEM_MODULESLOADED, NotifyModulesLoaded);
-}
diff --git a/src/core/stdpopup/src/popwin.cpp b/src/core/stdpopup/src/popwin.cpp
index aeaaa150f8..a314f61730 100644
--- a/src/core/stdpopup/src/popwin.cpp
+++ b/src/core/stdpopup/src/popwin.cpp
@@ -193,7 +193,6 @@ struct PopupWindowData
int tb_height, av_height, text_height, time_height, time_width;
int real_av_width, real_av_height;
bool have_av;
- HANDLE hNotify;
};
LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
@@ -209,7 +208,6 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
pwd = (PopupWindowData *)mir_alloc(sizeof(PopupWindowData));
pd = (PopupData *)cs->lpCreateParams;
pwd->pd = pd;
- pwd->hNotify = nullptr;
trimW(pwd->pd->pwszTitle);
trimW(pwd->pd->pwszText);
@@ -689,36 +687,6 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa
}
return TRUE;
- case PUM_SETNOTIFYH:
- pwd->hNotify = (HANDLE)wParam;
- return TRUE;
-
- case PUM_UPDATENOTIFY:
- if (pwd->hNotify == (HANDLE)wParam) {
- pd->colorBack = MNotifyGetDWord(pwd->hNotify, NFOPT_BACKCOLOR, colBg);
- pd->colorText = MNotifyGetDWord(pwd->hNotify, NFOPT_TEXTCOLOR, colSecondLine);
- pd->timeout = MNotifyGetDWord(pwd->hNotify, NFOPT_TIMEOUT, options.default_timeout);
- pd->hContact = (MCONTACT)MNotifyGetDWord(pwd->hNotify, NFOPT_CONTACT, 0);
- pd->hIcon = (HICON)MNotifyGetDWord(pwd->hNotify, NFOPT_ICON, 0);
-
- const wchar_t *swzName = MNotifyGetWString(pwd->hNotify, NFOPT_TITLEW, nullptr);
- mir_free(pd->pwszTitle);
- pd->pwszTitle = mir_wstrdup(swzName);
-
- const wchar_t *swzText = MNotifyGetWString(pwd->hNotify, NFOPT_TEXTW, nullptr);
- mir_free(pd->pwszText);
- pd->pwszText = mir_wstrdup(swzText);
-
- InvalidateRect(hwnd, nullptr, TRUE);
- RepositionWindows();
- }
- return TRUE;
-
- case PUM_KILLNOTIFY:
- if (pwd->hNotify != (HANDLE)wParam)
- return TRUE;
- // drop through
-
case UM_DESTROYPOPUP:
PostMPMessage(MUM_DELETEPOPUP, 0, (LPARAM)hwnd);
return TRUE;
diff --git a/src/core/stdpopup/src/popwin.h b/src/core/stdpopup/src/popwin.h
index fe60d64737..8ab19fca5f 100644
--- a/src/core/stdpopup/src/popwin.h
+++ b/src/core/stdpopup/src/popwin.h
@@ -11,10 +11,6 @@
#define PUM_GETHEIGHT (WM_USER + 0x025)
#define PUM_UPDATERGN (WM_USER + 0x026)
-#define PUM_SETNOTIFYH (WM_USER + 0x030)
-#define PUM_KILLNOTIFY (WM_USER + 0x031)
-#define PUM_UPDATENOTIFY (WM_USER + 0x032)
-
#define ANIMATE_NO 0
#define ANIMATE_HORZ 1
#define ANIMATE_VERT 2
diff --git a/src/core/stdpopup/src/resource.h b/src/core/stdpopup/src/resource.h
index 0ac6564fec..87140dfdbd 100644
--- a/src/core/stdpopup/src/resource.h
+++ b/src/core/stdpopup/src/resource.h
@@ -3,7 +3,6 @@
// Used by D:\Development\Miranda NG\plugins\YAPP\res\yapp.rc
//
#define IDD_OPT1 101
-#define IDD_OPT_NOTIFY 103
#define IDD_LST_HISTORY 104
#define IDI_POPUP 105
#define IDI_NOPOPUP 106
diff --git a/src/core/stdpopup/src/stdafx.h b/src/core/stdpopup/src/stdafx.h
index bd39b6d852..063f31acc9 100644
--- a/src/core/stdpopup/src/stdafx.h
+++ b/src/core/stdpopup/src/stdafx.h
@@ -26,15 +26,12 @@
#include <m_toptoolbar.h>
#include <win2k.h>
-#include <m_notify.h>
-#include <m_yapp.h>
#include <m_ieview.h> //need this for special renderers
#include "version.h"
#include "message_pump.h"
#include "options.h"
#include "popwin.h"
-#include "notify.h"
#include "services.h"
#include "resource.h"
#include "yapp_history.h"
@@ -55,8 +52,6 @@ extern bool bShutdown;
extern HFONT hFontFirstLine, hFontSecondLine, hFontTime;
extern COLORREF colFirstLine, colSecondLine, colBg, colTime, colBorder, colSidebar, colTitleUnderline;
-extern MNOTIFYLINK *notifyLink;
-
// work around a bug in neweventnotify, possibly httpserver
// ignore the address passed to the 'get plugin data' service
extern bool ignore_gpd_passed_addy;
diff --git a/src/core/stdpopup/src/yapp.cpp b/src/core/stdpopup/src/yapp.cpp
index ad0074fd94..951be5588a 100644
--- a/src/core/stdpopup/src/yapp.cpp
+++ b/src/core/stdpopup/src/yapp.cpp
@@ -6,8 +6,6 @@
CMPlugin g_plugin;
bool bShutdown = false;
-MNOTIFYLINK *notifyLink = nullptr;
-
// used to work around a bug in neweventnotify and others with the address passed in the GetPluginData function
bool ignore_gpd_passed_addy = false;
@@ -182,8 +180,6 @@ static void InitMenuItems(void)
static int ModulesLoaded(WPARAM, LPARAM)
{
- MNotifyGetLink();
-
if (ServiceExists(MS_HPP_EG_WINDOW))
lstPopupHistory.SetRenderer(RENDER_HISTORYPP);
@@ -209,7 +205,6 @@ int CMPlugin::Load()
{
InitMessagePump();
InitOptions();
- InitNotify();
InitFonts();
InitIcons();
InitMenuItems();