summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2023-04-18 15:00:44 +0300
committerGeorge Hazan <ghazan@miranda.im>2023-04-18 15:00:44 +0300
commitb38f2534004135415ae8d576c7f3bb41785ca7e7 (patch)
tree895e89ce5da30f91995943686ef558a6ca8cd2ca /include
parentcd5679ac850cd43c1b681de6485c8ec30a9e8e1d (diff)
- further group chats unification;
- LOGSTREAMDATA / GCLogStreamDataBase removed from g_chatApi; - CRtfLogWindow now in charge of all RTF processing - Srmm_LogStreamCallback is also removed and hidden inside the core
Diffstat (limited to 'include')
-rw-r--r--include/m_chat_int.h17
-rw-r--r--include/m_srmm_int.h30
2 files changed, 19 insertions, 28 deletions
diff --git a/include/m_chat_int.h b/include/m_chat_int.h
index 807845380b..92c166dfa4 100644
--- a/include/m_chat_int.h
+++ b/include/m_chat_int.h
@@ -74,7 +74,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
struct SESSION_INFO;
struct MODULEINFO;
-struct LOGSTREAMDATA;
class CMsgDialog;
@@ -94,7 +93,6 @@ struct MIR_APP_EXPORT GCModuleInfoBase : public MZeroedObject, public MNonCopyab
char* pszModule;
wchar_t* ptszModDispName;
- char* pszHeader;
bool bBold, bItalics, bUnderline;
bool bColor, bBkgColor;
@@ -190,16 +188,6 @@ struct MIR_APP_EXPORT SESSION_INFO : public MZeroedObject, public MNonCopyable
const char* getSoundName(int iEventType) const;
};
-struct GCLogStreamDataBase
-{
- char* buffer;
- int bufferOffset, bufferLen;
- int iStartEvent;
- bool bStripFormat, bRedraw;
- HWND hwnd;
- SESSION_INFO *si;
-};
-
struct GlobalLogSettingsBase
{
bool bShowTime;
@@ -245,7 +233,6 @@ struct GlobalLogSettingsBase
/////////////////////////////////////////////////////////////////////////////////////////
#ifndef SRMM_OWN_STRUCTURES
-struct LOGSTREAMDATA : public GCLogStreamDataBase {};
struct MODULEINFO : public GCModuleInfoBase {};
#endif
@@ -280,7 +267,6 @@ struct CHAT_MANAGER
void (*SM_InvalidateLogDirectories)(void);
MODULEINFO* (*MM_CreateModule)(void);
- void (*MM_FontsChanged)(void);
void (*MM_IconsChanged)(void);
BOOL (*MM_RemoveAll)(void);
@@ -296,13 +282,10 @@ struct CHAT_MANAGER
USERINFO* (*UM_SetContactStatus)(SESSION_INFO *si, const wchar_t *pszUID, uint16_t status);
USERINFO* (*UM_TakeStatus)(SESSION_INFO *si, const wchar_t *pszUID, uint16_t status);
wchar_t* (*UM_FindUserAutoComplete)(SESSION_INFO *si, const wchar_t* pszOriginal, const wchar_t* pszCurrent);
- BOOL (*UM_RemoveUser)(SESSION_INFO *si, const wchar_t *pszUID);
BOOL (*SetOffline)(MCONTACT hContact, BOOL bHide);
BOOL (*SetAllOffline)(BOOL bHide, const char *pszModule);
- char* (*Log_CreateRTF)(LOGSTREAMDATA *streamData);
- char* (*Log_CreateRtfHeader)(void);
void (*LoadMsgDlgFont)(int i, LOGFONT *lf, COLORREF *color);
wchar_t* (*MakeTimeStamp)(wchar_t *pszStamp, time_t time);
diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h
index 9163536e5c..97e132e0a8 100644
--- a/include/m_srmm_int.h
+++ b/include/m_srmm_int.h
@@ -150,17 +150,27 @@ EXTERN_C MIR_APP_DLL(void) UnregisterSrmmLog(HANDLE);
struct RtfLogStreamBase
{
- int stage;
+ int iStage;
MCONTACT hContact;
MEVENT hDbEvent, hDbEventLast;
int eventsToInsert;
- int isFirst, isEmpty;
+ bool isFirst, isEmpty;
CMStringA buf;
DB::EventInfo *dbei;
class CRtfLogWindow *pLog;
};
+struct RtfChatLogStreamData
+{
+ int iStage = 0, iStartEvent = 0;
+ bool bStripFormat, bAppend = false, bIsFirst = false;
+
+ CMStringA buf;
+ struct SESSION_INFO *si;
+ class CRtfLogWindow *pLog;
+};
+
#ifdef SRMM_OWN_STRUCTURES
struct RtfLogStreamData;
#else
@@ -180,13 +190,17 @@ public:
virtual void AppendUnicodeString(CMStringA &str, const wchar_t *pwszBuf) = 0;
+ void StreamRtfEvents(RtfLogStreamData *dat, bool bAppend);
virtual void CreateRtfHeader(RtfLogStreamData *dat) = 0;
virtual bool CreateRtfEvent(RtfLogStreamData *dat, DB::EventInfo &dbei) = 0;
virtual void CreateRtfTail(RtfLogStreamData *dat);
- virtual INT_PTR WndProc(UINT msg, WPARAM wParam, LPARAM lParam);
+ void StreamChatRtfEvents(RtfChatLogStreamData *dat, bool bAppend);
+ virtual void CreateChatRtfHeader(RtfChatLogStreamData *dat);
+ virtual void CreateChatRtfEvent(RtfChatLogStreamData *dat, const struct LOGINFO &lin);
+ virtual void CreateChatRtfTail(RtfChatLogStreamData *dat);
- void StreamRtfEvents(RtfLogStreamData *dat, bool bAppend);
+ virtual INT_PTR WndProc(UINT msg, WPARAM wParam, LPARAM lParam);
////////////////////////////////////////////////////////////////////////////////////////
void Attach() override;
@@ -315,13 +329,7 @@ class CMsgDialog : public CSrmmBaseDialog {};
#endif
/////////////////////////////////////////////////////////////////////////////////////////
-// receives LOGSTREAMDATA* as the first parameter
-
-#ifdef _WINDOWS
-EXTERN_C MIR_APP_DLL(DWORD) CALLBACK Srmm_LogStreamCallback(DWORD_PTR dwCookie, uint8_t *pbBuff, LONG cb, LONG *pcb);
-#endif
-
-/////////////////////////////////////////////////////////////////////////////////////////
+// adds an event to SRMM message log
MIR_APP_DLL(void) Srmm_AddEvent(MCONTACT hContact, MEVENT hDbEvent);