From 84820a7338aa363c94db86833c146e1bea872815 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 Nov 2018 22:39:10 +0300 Subject: Std* modules -> g_plugin --- src/core/stdmsg/src/globals.cpp | 4 ++-- src/core/stdmsg/src/msgdialog.cpp | 16 ++++++++-------- src/core/stdmsg/src/msglog.cpp | 2 +- src/core/stdmsg/src/msgoptions.cpp | 14 +++++++------- 4 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/core/stdmsg') diff --git a/src/core/stdmsg/src/globals.cpp b/src/core/stdmsg/src/globals.cpp index 98279aafb2..6d2b062c35 100644 --- a/src/core/stdmsg/src/globals.cpp +++ b/src/core/stdmsg/src/globals.cpp @@ -148,10 +148,10 @@ GlobalMessageData::GlobalMessageData() : void InitGlobals() { - int iOldValue = db_get_b(0, SRMMMOD, "HideNames", -1); + int iOldValue = g_plugin.getByte("HideNames", -1); if (iOldValue != -1) { g_dat.bShowNames = !iOldValue; - db_unset(0, SRMMMOD, "HideNames"); + g_plugin.delSetting("HideNames"); } if (!g_dat.bSendOnEnter && !g_dat.bSendOnDblEnter) diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index aef616e342..ba633deb1d 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -129,7 +129,7 @@ bool CSrmmWindow::OnInitDialog() SetTimer(m_hwnd, TIMERID_TYPE, 1000, nullptr); GetWindowRect(m_message.GetHwnd(), &m_minEditInit); - m_iSplitterY = (int)db_get_dw(g_dat.bSavePerContact ? m_hContact : 0, SRMMMOD, "splitterPos", m_minEditInit.bottom - m_minEditInit.top); + m_iSplitterY = g_plugin.getDword(g_dat.bSavePerContact ? m_hContact : 0, "splitterPos", m_minEditInit.bottom - m_minEditInit.top); SendMessage(m_hwnd, DM_UPDATESIZEBAR, 0, 0); m_avatar.Enable(false); @@ -280,7 +280,7 @@ void CSrmmWindow::OnDestroy() m_cmdList.destroy(); MCONTACT hContact = (g_dat.bSavePerContact) ? m_hContact : 0; - db_set_dw(hContact ? m_hContact : 0, SRMMMOD, "splitterPos", m_iSplitterY); + g_plugin.setDword(hContact ? m_hContact : 0, "splitterPos", m_iSplitterY); if (m_hFont) { DeleteObject(m_hFont); @@ -290,11 +290,11 @@ void CSrmmWindow::OnDestroy() WINDOWPLACEMENT wp = { sizeof(wp) }; GetWindowPlacement(m_hwnd, &wp); if (!m_windowWasCascaded) { - db_set_dw(hContact, SRMMMOD, "x", wp.rcNormalPosition.left); - db_set_dw(hContact, SRMMMOD, "y", wp.rcNormalPosition.top); + g_plugin.setDword(hContact, "x", wp.rcNormalPosition.left); + g_plugin.setDword(hContact, "y", wp.rcNormalPosition.top); } - db_set_dw(hContact, SRMMMOD, "width", wp.rcNormalPosition.right - wp.rcNormalPosition.left); - db_set_dw(hContact, SRMMMOD, "height", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top); + g_plugin.setDword(hContact, "width", wp.rcNormalPosition.right - wp.rcNormalPosition.left); + g_plugin.setDword(hContact, "height", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top); NotifyEvent(MSG_WINDOW_EVT_CLOSE); @@ -389,7 +389,7 @@ void CSrmmWindow::OnOptionsApplied(bool bUpdateAvatar) if (m_hBkgBrush) DeleteObject(m_hBkgBrush); - COLORREF colour = db_get_dw(0, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR); + COLORREF colour = g_plugin.getDword(SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR); m_hBkgBrush = CreateSolidBrush(colour); m_log.SendMsg(EM_SETBKGNDCOLOR, 0, colour); m_message.SendMsg(EM_SETBKGNDCOLOR, 0, colour); @@ -470,7 +470,7 @@ void CSrmmWindow::NotifyTyping(int mode) // Don't send to protocols that are offline // Don't send to users who are not visible and // Don't send to users who are not on the visible list when you are in invisible mode. - if (!db_get_b(m_hContact, SRMMMOD, SRMSGSET_TYPING, g_dat.bTypingNew)) + if (!g_plugin.getByte(m_hContact, SRMSGSET_TYPING, g_dat.bTypingNew)) return; if (!m_szProto) diff --git a/src/core/stdmsg/src/msglog.cpp b/src/core/stdmsg/src/msglog.cpp index 1fba3ccc7f..31454ddf13 100644 --- a/src/core/stdmsg/src/msglog.cpp +++ b/src/core/stdmsg/src/msglog.cpp @@ -488,7 +488,7 @@ void CSrmmWindow::StreamInEvents(MEVENT hDbEventFirst, int count, bool bAppend) #define RTFPICTHEADERMAXSIZE 78 void LoadMsgLogIcons(void) { - HBRUSH hBkgBrush = CreateSolidBrush(db_get_dw(0, SRMMMOD, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR)); + HBRUSH hBkgBrush = CreateSolidBrush(g_plugin.getDword(SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR)); BITMAPINFOHEADER bih = { sizeof(bih) }; bih.biBitCount = 24; diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index c410ccab8e..43c82f4885 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -61,16 +61,16 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) if (colour) { mir_snprintf(str, "SRMFont%dCol", i); - *colour = db_get_dw(0, SRMMMOD, str, fontOptionsList[i].defColour); + *colour = g_plugin.getDword(str, fontOptionsList[i].defColour); } if (lf) { mir_snprintf(str, "SRMFont%dSize", i); - lf->lfHeight = (char)db_get_b(0, SRMMMOD, str, fontOptionsList[i].defSize); + lf->lfHeight = (char)g_plugin.getByte(str, fontOptionsList[i].defSize); lf->lfWidth = 0; lf->lfEscapement = 0; lf->lfOrientation = 0; mir_snprintf(str, "SRMFont%dSty", i); - int style = db_get_b(0, SRMMMOD, str, fontOptionsList[i].defStyle); + int style = g_plugin.getByte(str, fontOptionsList[i].defStyle); lf->lfWeight = style & DBFONTF_BOLD ? FW_BOLD : FW_NORMAL; lf->lfItalic = style & DBFONTF_ITALIC ? 1 : 0; lf->lfUnderline = 0; @@ -81,14 +81,14 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) lf->lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE; mir_snprintf(str, "SRMFont%d", i); - ptrW wszFontFace(db_get_wsa(0, SRMMMOD, str)); + ptrW wszFontFace(g_plugin.getWStringA(str)); if (wszFontFace == nullptr) wcsncpy_s(lf->lfFaceName, fontOptionsList[i].szDefFace, _TRUNCATE); else mir_wstrncpy(lf->lfFaceName, wszFontFace, _countof(lf->lfFaceName)); mir_snprintf(str, "SRMFont%dSet", i); - lf->lfCharSet = db_get_b(0, SRMMMOD, str, MsgDlgGetFontDefaultCharset(lf->lfFaceName)); + lf->lfCharSet = g_plugin.getByte(str, MsgDlgGetFontDefaultCharset(lf->lfFaceName)); } return true; } @@ -458,7 +458,7 @@ public: for (auto &hContact : Contacts()) { HANDLE hItem = clist.FindContact(hContact); - if (hItem && db_get_b(hContact, SRMMMOD, SRMSGSET_TYPING, defType)) + if (hItem && g_plugin.getByte(hContact, SRMSGSET_TYPING, defType)) clist.SetCheck(hItem, 1); } } @@ -474,7 +474,7 @@ public: for (auto &hContact : Contacts()) { HANDLE hItem = clist.FindContact(hContact); if (hItem) - db_set_b(hContact, SRMMMOD, SRMSGSET_TYPING, clist.GetCheck(hItem)); + g_plugin.setByte(hContact, SRMSGSET_TYPING, clist.GetCheck(hItem)); } } -- cgit v1.2.3