diff options
author | George Hazan <ghazan@miranda.im> | 2017-03-23 18:13:02 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-03-23 18:13:02 +0300 |
commit | 70a63279d9c0ae624e8d5689745faf962868ceea (patch) | |
tree | bcdf186a58ae17eadab6eae45187dca712b6b8a6 | |
parent | 8581cf96fc02be7fdf5fc32b389038ec33dd6822 (diff) |
stubs for the message entry, log & nicklist window procedures
-rw-r--r-- | include/m_chat_int.h | 4 | ||||
-rw-r--r-- | libs/win32/mir_app.lib | bin | 114164 -> 115580 bytes | |||
-rw-r--r-- | libs/win64/mir_app.lib | bin | 109710 -> 111196 bytes | |||
-rw-r--r-- | src/mir_app/src/mir_app.def | 4 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 4 | ||||
-rw-r--r-- | src/mir_app/src/srmm_base.cpp | 63 |
6 files changed, 74 insertions, 1 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h index a43327e6a0..d2d1e3ef72 100644 --- a/include/m_chat_int.h +++ b/include/m_chat_int.h @@ -446,6 +446,10 @@ public: virtual void UpdateStatusBar() {}
virtual void UpdateTitle() PURE;
+ virtual LRESULT WndProc_Log(UINT msg, WPARAM wParam, LPARAM lParam);
+ virtual LRESULT WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam);
+ virtual LRESULT WndProc_Nicklist(UINT msg, WPARAM wParam, LPARAM lParam);
+
__forceinline bool isChat() const { return m_si != nullptr; }
__inline void* operator new(size_t size){ return calloc(1, size); }
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 9513d41ade..438911e680 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 7164b8202d..1cc3c53c4b 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index d4f666b55d..d92766b9dd 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -432,3 +432,7 @@ Chat_UpdateOptions @418 NONAME ?ProcessHotkeys@CSrmmBaseDialog@@IAE_NH_N00@Z @434 NONAME
?onClick_History@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @435 NONAME
?onClick_ChanMgr@CSrmmBaseDialog@@IAEXPAVCCtrlButton@@@Z @436 NONAME
+?WndProc_Log@CSrmmBaseDialog@@UAEJIIJ@Z @437 NONAME
+?WndProc_Message@CSrmmBaseDialog@@UAEJIIJ@Z @438 NONAME
+?WndProc_Nicklist@CSrmmBaseDialog@@UAEJIIJ@Z @439 NONAME
+?onDblClick_List@CSrmmBaseDialog@@IAEXPAVCCtrlListBox@@@Z @440 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index bfced357d5..e7152de5cb 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -432,3 +432,7 @@ Chat_UpdateOptions @418 NONAME ?ProcessHotkeys@CSrmmBaseDialog@@IEAA_NH_N00@Z @434 NONAME
?onClick_History@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @435 NONAME
?onClick_ChanMgr@CSrmmBaseDialog@@IEAAXPEAVCCtrlButton@@@Z @436 NONAME
+?WndProc_Log@CSrmmBaseDialog@@UEAA_JI_K_J@Z @437 NONAME
+?WndProc_Message@CSrmmBaseDialog@@UEAA_JI_K_J@Z @438 NONAME
+?WndProc_Nicklist@CSrmmBaseDialog@@UEAA_JI_K_J@Z @439 NONAME
+?onDblClick_List@CSrmmBaseDialog@@IEAAXPEAVCCtrlListBox@@@Z @440 NONAME
diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index fa37d7153f..f9d68536e0 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -124,8 +124,67 @@ static LRESULT CALLBACK Srmm_ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wPar return mir_callNextSubclass(hwnd, Srmm_ButtonSubclassProc, msg, wParam, lParam); } +///////////////////////////////////////////////////////////////////////////////////////// + +LRESULT CSrmmBaseDialog::WndProc_Log(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/) +{ + return 0; +} + +static LRESULT CALLBACK stubLogProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if (pDlg != nullptr) + pDlg->WndProc_Log(msg, wParam, lParam); + + return mir_callNextSubclass(hwnd, stubLogProc, msg, wParam, lParam); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +LRESULT CSrmmBaseDialog::WndProc_Message(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/) +{ + return 0; +} + +static LRESULT CALLBACK stubMessageProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if (pDlg != nullptr) + pDlg->WndProc_Message(msg, wParam, lParam); + + return mir_callNextSubclass(hwnd, stubMessageProc, msg, wParam, lParam); +} + +///////////////////////////////////////////////////////////////////////////////////////// + +LRESULT CSrmmBaseDialog::WndProc_Nicklist(UINT /*msg*/, WPARAM /*wParam*/, LPARAM /*lParam*/) +{ + return 0; +} + +static LRESULT CALLBACK stubNicklistProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) +{ + CSrmmBaseDialog *pDlg = (CSrmmBaseDialog*)GetWindowLongPtr(hwnd, GWLP_USERDATA); + if (pDlg != nullptr) + pDlg->WndProc_Nicklist(msg, wParam, lParam); + + return mir_callNextSubclass(hwnd, stubNicklistProc, msg, wParam, lParam); +} + +///////////////////////////////////////////////////////////////////////////////////////// + void CSrmmBaseDialog::OnInitDialog() { + SetWindowLongPtr(m_pLog->GetHwnd(), GWLP_USERDATA, LPARAM(this)); + mir_subclassWindow(m_pLog->GetHwnd(), stubLogProc); + + SetWindowLongPtr(m_pEntry->GetHwnd(), GWLP_USERDATA, LPARAM(this)); + mir_subclassWindow(m_pEntry->GetHwnd(), stubMessageProc); + + SetWindowLongPtr(m_nickList.GetHwnd(), GWLP_USERDATA, LPARAM(this)); + mir_subclassWindow(m_nickList.GetHwnd(), stubNicklistProc); + mir_subclassWindow(m_btnFilter.GetHwnd(), Srmm_ButtonSubclassProc); mir_subclassWindow(m_btnColor.GetHwnd(), Srmm_ButtonSubclassProc); mir_subclassWindow(m_btnBkColor.GetHwnd(), Srmm_ButtonSubclassProc); @@ -133,6 +192,8 @@ void CSrmmBaseDialog::OnInitDialog() LoadSettings(); } +///////////////////////////////////////////////////////////////////////////////////////// + INT_PTR CSrmmBaseDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -433,7 +494,7 @@ void CSrmmBaseDialog::RefreshButtonStatus(void) CHARFORMAT2 cf; cf.cbSize = sizeof(CHARFORMAT2); cf.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_BACKCOLOR | CFM_COLOR; - SendMessage(m_pEntry->GetHwnd(), EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); + m_pEntry->SendMsg(EM_GETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); MODULEINFO *mi = chatApi.MM_FindModule(m_si->pszModule); if (mi == nullptr) |