From 16dae6bd7df08d11cf9175239fb9b27f88c6f12c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 2 Aug 2023 14:11:40 +0300 Subject: =?UTF-8?q?fixes=20#2373=20(NewStory:=20=D0=BD=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B0=D1=8E=D1=82=20=D1=84=D0=B8=D0=BB?= =?UTF-8?q?=D1=8C=D1=82=D1=80=D1=8B)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/m_srmm_int.h | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h index 767fbe3d13..8f824846dc 100644 --- a/include/m_srmm_int.h +++ b/include/m_srmm_int.h @@ -103,6 +103,7 @@ MIR_APP_DLL(void) Srmm_ClickToolbarIcon(MCONTACT hContact, int idFrom, HWND hwnd // SRMM log window container class CMsgDialog; +struct LOGINFO; class MIR_APP_EXPORT CSrmmLogWindow { @@ -112,7 +113,7 @@ class MIR_APP_EXPORT CSrmmLogWindow protected: CMsgDialog &m_pDlg; - CSrmmLogWindow(CMsgDialog &pDlg) : + __forceinline CSrmmLogWindow(CMsgDialog &pDlg) : m_pDlg(pDlg) {} @@ -128,14 +129,14 @@ public: virtual HWND GetHwnd() = 0; virtual wchar_t* GetSelection() = 0; virtual void LogEvents(MEVENT hDbEventFirst, int count, bool bAppend) = 0; - virtual void LogEvents(const struct LOGINFO *lin) = 0; + virtual void LogChatEvents(const LOGINFO *lin) = 0; virtual void Resize() = 0; virtual void ScrollToBottom() = 0; virtual void UpdateOptions() {}; virtual INT_PTR Notify(WPARAM, LPARAM) { return 0; } - __inline CMsgDialog& GetDialog() const + __forceinline CMsgDialog& GetDialog() const { return m_pDlg; } }; @@ -145,6 +146,24 @@ typedef CSrmmLogWindow *(MIR_CDECL *pfnSrmmLogCreator)(CMsgDialog &pDlg); MIR_APP_DLL(HANDLE) RegisterSrmmLog(CMPlugin *pPlugin, const char *pszShortName, const wchar_t *pwszScreenName, pfnSrmmLogCreator fnBuilder); MIR_APP_DLL(void) UnregisterSrmmLog(HANDLE); +///////////////////////////////////////////////////////////////////////////////////////// +// Simple single-event based logger + +class MIR_APP_EXPORT CSimpleLogWindow : public CSrmmLogWindow +{ + CSimpleLogWindow(const CSimpleLogWindow &) = delete; + CSimpleLogWindow &operator=(const CSimpleLogWindow &) = delete; + + void LogChatEvents(const struct LOGINFO *lin) override; + +protected: + __forceinline CSimpleLogWindow(CMsgDialog &pDlg) : + CSrmmLogWindow(pDlg) + {} + + virtual void LogChatEvent(const LOGINFO &lin) = 0; +}; + ///////////////////////////////////////////////////////////////////////////////////////// // Standard built-in RTF logger class @@ -300,6 +319,7 @@ public: CTimer timerFlash, timerType, timerNickList, timerRedraw; void ClearLog(); + bool IsSuitableEvent(const LOGINFO &lin) const; void RedrawLog(); void ScheduleRedrawLog(); void ShowColorChooser(int iCtrlId); -- cgit v1.2.3