summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-06-27 15:34:33 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-06-27 15:34:33 +0000
commitb48741c8d0ed916d2cdd41956667ec4082ab245a (patch)
tree1d0e149514343e602495e85861649e173324fd01
parentb1d29a5793fc80dd1c0d26e4ba900853fad41809 (diff)
obsolete helpers removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@5152 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/TabSRMM/src/TSButton.cpp10
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp28
-rw-r--r--plugins/TabSRMM/src/chat/clist.cpp26
-rw-r--r--plugins/TabSRMM/src/chat/log.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/main.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/manager.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/muchighlight.cpp32
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp176
-rw-r--r--plugins/TabSRMM/src/chat/services.cpp34
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp36
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp78
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp20
-rw-r--r--plugins/TabSRMM/src/container.cpp122
-rw-r--r--plugins/TabSRMM/src/containeroptions.cpp10
-rw-r--r--plugins/TabSRMM/src/controls.cpp18
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp122
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp93
-rw-r--r--plugins/TabSRMM/src/globals.cpp116
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp22
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp68
-rw-r--r--plugins/TabSRMM/src/mim.cpp241
-rw-r--r--plugins/TabSRMM/src/mim.h205
-rw-r--r--plugins/TabSRMM/src/modplus.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp92
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp76
-rw-r--r--plugins/TabSRMM/src/msglog.cpp12
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp238
-rw-r--r--plugins/TabSRMM/src/msgoptions_plus.cpp12
-rw-r--r--plugins/TabSRMM/src/msgs.cpp56
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp2
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp26
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp30
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp14
-rw-r--r--plugins/TabSRMM/src/srmm.cpp7
-rw-r--r--plugins/TabSRMM/src/tabctrl.cpp64
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp6
-rw-r--r--plugins/TabSRMM/src/templates.cpp38
-rw-r--r--plugins/TabSRMM/src/themeio.cpp48
-rw-r--r--plugins/TabSRMM/src/themes.cpp58
-rw-r--r--plugins/TabSRMM/src/trayicon.cpp8
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp42
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp108
-rw-r--r--plugins/TabSRMM/src/utils.cpp20
43 files changed, 1152 insertions, 1272 deletions
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp
index e721fe6e0d..fc8a8df426 100644
--- a/plugins/TabSRMM/src/TSButton.cpp
+++ b/plugins/TabSRMM/src/TSButton.cpp
@@ -82,7 +82,7 @@ int TSAPI LoadTSButtonModule(void)
static void TSAPI DestroyTheme(MButtonCtrl *ctl)
{
- if (M->isVSAPIState()) {
+ if (M.isVSAPIState()) {
if (ctl->hThemeButton) {
CMimAPI::m_pfnCloseThemeData(ctl->hThemeButton);
ctl->hThemeButton = NULL;
@@ -96,10 +96,10 @@ static void TSAPI DestroyTheme(MButtonCtrl *ctl)
static void TSAPI LoadTheme(MButtonCtrl *ctl)
{
- if (M->isVSAPIState()) {
+ if (M.isVSAPIState()) {
DestroyTheme(ctl);
ctl->hThemeButton = CMimAPI::m_pfnOpenThemeData(ctl->hwnd, L"BUTTON");
- ctl->hThemeToolbar = (M->isAero() || IsWinVerVistaPlus()) ? CMimAPI::m_pfnOpenThemeData(ctl->hwnd, L"MENU") : CMimAPI::m_pfnOpenThemeData(ctl->hwnd, L"TOOLBAR");
+ ctl->hThemeToolbar = (M.isAero() || IsWinVerVistaPlus()) ? CMimAPI::m_pfnOpenThemeData(ctl->hwnd, L"MENU") : CMimAPI::m_pfnOpenThemeData(ctl->hwnd, L"TOOLBAR");
ctl->bThemed = TRUE;
}
}
@@ -162,8 +162,8 @@ static void PaintWorker(MButtonCtrl *ctl, HDC hdcPaint)
HBITMAP hbmMem, hOld;
RECT rcClient;
RECT rcContent;
- bool fAero = M->isAero();
- bool fVSThemed = (!CSkin::m_skinEnabled && M->isVSThemed());
+ bool fAero = M.isAero();
+ bool fVSThemed = (!CSkin::m_skinEnabled && M.isVSThemed());
HANDLE hbp = 0;
TWindowData *dat = (TWindowData *)GetWindowLongPtr(GetParent(ctl->hwnd), GWLP_USERDATA);
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 379c01ba03..f0449c61d5 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -139,7 +139,7 @@ void CB_InitCustomButtons()
LButtonsList = List_Create(0, 1);
RButtonsList = List_Create(0, 1);
InitializeCriticalSection(&ToolBarCS);
- dwSepCount = M->GetDword("TabSRMM_Toolbar", "SeparatorsCount", 0);
+ dwSepCount = M.GetDword("TabSRMM_Toolbar", "SeparatorsCount", 0);
//dwSepCount = db_get_dw(NULL, "TabSRMM_Toolbar", "SeparatorsCount", 0);
@@ -246,13 +246,13 @@ void CB_ReInitCustomButtons()
i--;
}
}
- M->BroadcastMessage(DM_BBNEEDUPDATE, 0, 0);
- M->BroadcastMessage(DM_LOADBUTTONBARICONS, 0, 0);
+ M.BroadcastMessage(DM_BBNEEDUPDATE, 0, 0);
+ M.BroadcastMessage(DM_LOADBUTTONBARICONS, 0, 0);
}
void CB_HardReInit()
{
- M->BroadcastMessage(DM_CBDESTROY, 0, 0);
+ M.BroadcastMessage(DM_CBDESTROY, 0, 0);
EnterCriticalSection(&ToolBarCS);
li_ListDestruct(LButtonsList, listdestructor);
li_ListDestruct(RButtonsList, listdestructor);
@@ -322,7 +322,7 @@ static INT_PTR CB_AddButton(WPARAM wParam, LPARAM lParam)
if (cbd->dwArrowCID == LastCID)
LastCID++;
- M->BroadcastMessage(DM_BBNEEDUPDATE, 0, 0);
+ M.BroadcastMessage(DM_BBNEEDUPDATE, 0, 0);
return 0;
}
@@ -351,7 +351,7 @@ static INT_PTR CB_GetButtonState(WPARAM wParam, LPARAM lParam)
}
if (!realbutton) return 1;
- hwndDlg = M->FindWindow((HANDLE)wParam);
+ hwndDlg = M.FindWindow((HANDLE)wParam);
bbdi->bbbFlags = (IsDlgButtonChecked(hwndDlg, tempCID) ? BBSF_PUSHED : BBSF_RELEASED) | (IsWindowVisible(GetDlgItem(hwndDlg, tempCID)) ? 0 : BBSF_HIDDEN) | (IsWindowEnabled(GetDlgItem(hwndDlg, tempCID)) ? 0 : BBSF_DISABLED);
return 0;
}
@@ -382,7 +382,7 @@ static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam)
if (!realbutton || !wParam) return 1;
- hwndDlg = M->FindWindow((HANDLE)wParam);
+ hwndDlg = M.FindWindow((HANDLE)wParam);
if (hwndDlg && realbutton && bbdi->hIcon)
SendMessage(GetDlgItem(hwndDlg, tempCID), BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIconByHandle(bbdi->hIcon));
if (hwndDlg && realbutton && bbdi->pszTooltip) {
@@ -434,7 +434,7 @@ static INT_PTR CB_RemoveButton(WPARAM wParam, LPARAM lParam)
LeaveCriticalSection(&ToolBarCS);
if (tempCID)
- M->BroadcastMessage(DM_CBDESTROY, (WPARAM)tempCID, (LPARAM)dwFlags);
+ M.BroadcastMessage(DM_CBDESTROY, (WPARAM)tempCID, (LPARAM)dwFlags);
return 0;
}
@@ -486,7 +486,7 @@ static INT_PTR CB_ModifyButton(WPARAM wParam, LPARAM lParam)
}
LeaveCriticalSection(&ToolBarCS);
if (bFound)
- M->BroadcastMessage(DM_BBNEEDUPDATE, 0, (LPARAM)cbd);
+ M.BroadcastMessage(DM_BBNEEDUPDATE, 0, (LPARAM)cbd);
return 0;
}
@@ -1186,7 +1186,7 @@ static int SaveTree(HWND hToolBarTree)
tvi.hItem = hItem;
}
LeaveCriticalSection(&ToolBarCS);
- M->WriteDword("TabSRMM_Toolbar", "SeparatorsCount", loc_sepcout);
+ db_set_dw(0, "TabSRMM_Toolbar", "SeparatorsCount", loc_sepcout);
dwSepCount = loc_sepcout;
bNeedResort = TRUE;
return 1;
@@ -1417,7 +1417,7 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
switch (((LPNMHDR)lParam)->code) {
case PSN_RESET:
CB_ReInitCustomButtons();
- dwSepCount = M->GetDword("TabSRMM_Toolbar", "SeparatorsCount", 0);
+ dwSepCount = M.GetDword("TabSRMM_Toolbar", "SeparatorsCount", 0);
return 1;
case PSN_APPLY:
@@ -1442,10 +1442,10 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
CB_ReInitCustomButtons();
PluginConfig.g_iButtonsBarGap = (BYTE)SendDlgItemMessage(hwndDlg, IDC_SPIN1, UDM_GETPOS, 0, 0);
- if (PluginConfig.g_iButtonsBarGap != M->GetByte("ButtonsBarGap", 1))
- M->BroadcastMessageAsync(WM_SIZE, 0, 0);
+ if (PluginConfig.g_iButtonsBarGap != M.GetByte("ButtonsBarGap", 1))
+ M.BroadcastMessageAsync(WM_SIZE, 0, 0);
- M->WriteByte(SRMSGMOD_T, "ButtonsBarGap", PluginConfig.g_iButtonsBarGap);
+ db_set_b(0, SRMSGMOD_T, "ButtonsBarGap", PluginConfig.g_iButtonsBarGap);
BuildMenuObjectsTree((HWND)hToolBarTree);
Utils::enableDlgControl(hwndDlg, IDC_IMCHECK, FALSE);
diff --git a/plugins/TabSRMM/src/chat/clist.cpp b/plugins/TabSRMM/src/chat/clist.cpp
index cab020142b..0d3efc5358 100644
--- a/plugins/TabSRMM/src/chat/clist.cpp
+++ b/plugins/TabSRMM/src/chat/clist.cpp
@@ -47,7 +47,7 @@ static HANDLE Clist_GroupExists(TCHAR *tszGroup)
do {
_itoa(i, str, 10);
- result = M->GetTString(0, "CListGroups", str, &dbv);
+ result = db_get_ts(0, "CListGroups", str, &dbv);
if (!result) {
match = (!_tcscmp(tszGroup, &dbv.ptszVal[1]) && (lstrlen(tszGroup) == lstrlen(&dbv.ptszVal[1])));
db_free(&dbv);
@@ -67,7 +67,7 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p
TCHAR pszGroup[50];
*pszGroup = '\0';
- if (!M->GetTString(NULL, "Chat", "AddToGroup", &dbv)) {
+ if (!db_get_ts(NULL, "Chat", "AddToGroup", &dbv)) {
if (lstrlen(dbv.ptszVal) > 0)
lstrcpyn(pszGroup, dbv.ptszVal, 50);
db_free(&dbv);
@@ -91,9 +91,9 @@ HANDLE CList_AddRoom(const char* pszModule, const TCHAR* pszRoom, const TCHAR* p
else
db_unset(hContact, "CList", "Group");
- M->WriteTString(hContact, pszModule, "Nick", pszDisplayName);
- M->WriteTString(hContact, pszModule, "ChatRoomID", pszRoom);
- M->WriteByte(hContact, pszModule, "ChatRoom", (BYTE)iType);
+ db_set_ts(hContact, pszModule, "Nick", pszDisplayName);
+ db_set_ts(hContact, pszModule, "ChatRoomID", pszRoom);
+ db_set_b(hContact, pszModule, "ChatRoom", (BYTE)iType);
db_set_w(hContact, pszModule, "Status", ID_STATUS_OFFLINE);
return hContact;
}
@@ -105,7 +105,7 @@ BOOL CList_SetOffline(HANDLE hContact, BOOL bHide)
if (szProto == NULL)
return FALSE;
- int i = M->GetByte(hContact, szProto, "ChatRoom", 0);
+ int i = db_get_b(hContact, szProto, "ChatRoom", 0);
db_set_w(hContact, szProto, "ApparentMode", (LPARAM)0);
db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return TRUE;
@@ -119,7 +119,7 @@ BOOL CList_SetAllOffline(BOOL bHide, const char *pszModule)
char *szProto = GetContactProto(hContact);
if (MM_FindModule(szProto)) {
if (!pszModule || (pszModule && !strcmp(pszModule, szProto))) {
- int i = M->GetByte(hContact, szProto, "ChatRoom", 0);
+ int i = db_get_b(hContact, szProto, "ChatRoom", 0);
if (i != 0) {
db_set_w(hContact, szProto, "ApparentMode", (LPARAM)(WORD) 0);
db_set_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -143,15 +143,15 @@ int CList_RoomDoubleclicked(WPARAM wParam, LPARAM lParam)
szProto = GetContactProto(hContact);
if (MM_FindModule(szProto)) {
- if (M->GetByte(hContact, szProto, "ChatRoom", 0) == 0)
+ if (db_get_b(hContact, szProto, "ChatRoom", 0) == 0)
return 0;
- if (!M->GetTString(hContact, szProto, "ChatRoomID", &dbv)) {
+ if (!db_get_ts(hContact, szProto, "ChatRoomID", &dbv)) {
SESSION_INFO* si = SM_FindSession(dbv.ptszVal, szProto);
if (si) {
// is the "toggle visibility option set, so we need to close the window?
if (si->hWnd != NULL
- && M->GetByte("Chat", "ToggleVisibility", 0) == 1
+ && M.GetByte("Chat", "ToggleVisibility", 0) == 1
&& !CallService(MS_CLIST_GETEVENT, (WPARAM)hContact, 0)
&& IsWindowVisible(si->hWnd)
&& !IsIconic(si->pContainer->hwnd)) {
@@ -218,7 +218,7 @@ int CList_PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
char *szProto = GetContactProto(hContact);
if ( szProto ) {
// display this menu item only for chats
- if ( M->GetByte(hContact, szProto, "ChatRoom", 0 )) {
+ if ( db_get_b(hContact, szProto, "ChatRoom", 0 )) {
// still hide it for offline protos
if (CallProtoService( szProto, PS_GETSTATUS, 0, 0 ) != ID_STATUS_OFFLINE) {
CLISTMENUITEM clmi = { sizeof(clmi) };
@@ -292,11 +292,11 @@ BOOL CList_AddEvent(HANDLE hContact, HICON Icon, HANDLE event, int type, const T
HANDLE CList_FindRoom(const char* pszModule, const TCHAR* pszRoom)
{
for (HANDLE hContact = db_find_first(pszModule); hContact; hContact = db_find_next(hContact, pszModule)) {
- if ( !M->GetByte(hContact, pszModule, "ChatRoom", 0))
+ if ( !db_get_b(hContact, pszModule, "ChatRoom", 0))
continue;
DBVARIANT dbv;
- if (!M->GetTString(hContact, pszModule, "ChatRoomID", &dbv)) {
+ if (!db_get_ts(hContact, pszModule, "ChatRoomID", &dbv)) {
if (!lstrcmpi(dbv.ptszVal, pszRoom)) {
db_free(&dbv);
return hContact;
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp
index 0001d7e2cb..3cc58f65b8 100644
--- a/plugins/TabSRMM/src/chat/log.cpp
+++ b/plugins/TabSRMM/src/chat/log.cpp
@@ -1266,7 +1266,7 @@ void LoadMsgLogBitmaps(void)
else
iIconSize = sizeX;
- hBkgBrush = CreateSolidBrush(M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR));
+ hBkgBrush = CreateSolidBrush(M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR));
bih.biSize = sizeof(bih);
bih.biBitCount = 24;
bih.biCompression = BI_RGB;
diff --git a/plugins/TabSRMM/src/chat/main.cpp b/plugins/TabSRMM/src/chat/main.cpp
index c3ffc5e0e9..8fbcdf565d 100644
--- a/plugins/TabSRMM/src/chat/main.cpp
+++ b/plugins/TabSRMM/src/chat/main.cpp
@@ -54,7 +54,7 @@ char *pszActiveWndModule = 0;
int Chat_Load()
{
- if (M->GetByte("forceDisableMUC", 0)) {
+ if (M.GetByte("forceDisableMUC", 0)) {
PluginConfig.m_chat_enabled = false;
return 0;
}
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp
index 88931e8b73..f87b52962a 100644
--- a/plugins/TabSRMM/src/chat/manager.cpp
+++ b/plugins/TabSRMM/src/chat/manager.cpp
@@ -121,7 +121,7 @@ int SM_RemoveSession(const TCHAR* pszID, const char* pszModule, bool removeConta
if (pTemp->hContact) {
CList_SetOffline(pTemp->hContact, pTemp->iType == GCW_CHATROOM ? TRUE : FALSE);
//if (pTemp->iType != GCW_SERVER)
- //db_set_b(pTemp->hContact, "CList", "Hidden", 1);
+ //db_set_b(0, pTemp->hContact, "CList", "Hidden", 1);
}
db_set_s(pTemp->hContact, pTemp->pszModule , "Topic", "");
db_set_s(pTemp->hContact, pTemp->pszModule, "StatusBar", "");
diff --git a/plugins/TabSRMM/src/chat/muchighlight.cpp b/plugins/TabSRMM/src/chat/muchighlight.cpp
index 79752fa472..c860988b25 100644
--- a/plugins/TabSRMM/src/chat/muchighlight.cpp
+++ b/plugins/TabSRMM/src/chat/muchighlight.cpp
@@ -59,17 +59,17 @@ void CMUCHighlight::init()
m_fInitialized = true;
- if (0 == M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
+ if (0 == db_get_ts(0, "Chat", "HighlightWords", &dbv)) {
m_TextPatternString = dbv.ptszVal;
_wsetlocale(LC_ALL, L"");
wcslwr(m_TextPatternString);
}
- if (0 == M->GetTString(0, "Chat", "HighlightNames", &dbv))
+ if (0 == db_get_ts(0, "Chat", "HighlightNames", &dbv))
m_NickPatternString = dbv.ptszVal;
- m_dwFlags = M->GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
- m_fHighlightMe = (M->GetByte("Chat", "HighlightMe", 1) ? true : false);
+ m_dwFlags = M.GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
+ m_fHighlightMe = (M.GetByte("Chat", "HighlightMe", 1) ? true : false);
__try {
tokenize(m_TextPatternString, m_TextPatterns, m_iTextPatterns);
@@ -136,7 +136,7 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
#ifdef __HLT_PERFSTATS
int words = 0;
- M->startTimer();
+ M.startTimer();
#endif
TCHAR *tszCleaned = ::RemoveFormatting(pgce->ptszText, true, true);
TCHAR *p = tszCleaned;
@@ -187,9 +187,9 @@ int CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dwF
skip_textpatterns:
#ifdef __HLT_PERFSTATS
- M->stopTimer(0);
+ M.stopTimer(0);
if (psi && psi->dat) {
- mir_sntprintf(psi->dat->szStatusBar, 100, _T("PERF text match: %d ticks = %f msec (%d words, %d patterns)"), (int)M->getTicks(), M->getMsec(), words, m_iTextPatterns);
+ mir_sntprintf(psi->dat->szStatusBar, 100, _T("PERF text match: %d ticks = %f msec (%d words, %d patterns)"), (int)M.getTicks(), M.getMsec(), words, m_iTextPatterns);
if (psi->dat->pContainer->hwndStatus)
::SendMessage(psi->dat->pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)psi->dat->szStatusBar);
}
@@ -267,22 +267,22 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
TranslateDialogDefault(hwndDlg);
{
DBVARIANT dbv = {0};
- if ( !M->GetTString(0, "Chat", "HighlightWords", &dbv)) {
+ if ( !db_get_ts(0, "Chat", "HighlightWords", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, dbv.ptszVal);
::db_free(&dbv);
}
- if ( !M->GetTString(0, "Chat", "HighlightNames", &dbv)) {
+ if ( !db_get_ts(0, "Chat", "HighlightNames", &dbv)) {
::SetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, dbv.ptszVal);
::db_free(&dbv);
}
- DWORD dwFlags = M->GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
+ DWORD dwFlags = M.GetByte("Chat", "HighlightEnabled", MATCH_TEXT);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTNICKENABLE, dwFlags & MATCH_NICKNAME ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTNICKUID, dwFlags & MATCH_UIN ? BST_CHECKED : BST_UNCHECKED);
::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTTEXTENABLE, dwFlags & MATCH_TEXT ? BST_CHECKED : BST_UNCHECKED);
- ::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTME, M->GetByte("Chat", "HighlightMe", 1) ? BST_CHECKED : BST_UNCHECKED);
+ ::CheckDlgButton(hwndDlg, IDC_HIGHLIGHTME, M.GetByte("Chat", "HighlightMe", 1) ? BST_CHECKED : BST_UNCHECKED);
::SendMessage(hwndDlg, WM_USER + 100, 0, 0);
}
@@ -324,16 +324,16 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (iLen) {
szBuf = reinterpret_cast<wchar_t *>(mir_alloc((iLen + 2) * sizeof(wchar_t)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTNICKPATTERN, szBuf, iLen + 1);
- M->WriteTString(0, "Chat", "HighlightNames",szBuf);
+ db_set_ts(0, "Chat", "HighlightNames",szBuf);
}
iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN));
if (iLen) {
szBuf = reinterpret_cast<TCHAR *>(mir_realloc(szBuf, sizeof(wchar_t) * (iLen + 2)));
::GetDlgItemText(hwndDlg, IDC_HIGHLIGHTTEXTPATTERN, szBuf, iLen + 1);
- M->WriteTString(0, "Chat", "HighlightWords", szBuf);
+ db_set_ts(0, "Chat", "HighlightWords", szBuf);
}
- else M->WriteTString(0, "Chat", "HighlightWords", L"");
+ else db_set_ts(0, "Chat", "HighlightWords", L"");
mir_free(szBuf);
BYTE dwFlags = (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKENABLE) ? MATCH_NICKNAME : 0) |
@@ -342,8 +342,8 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (dwFlags & MATCH_NICKNAME)
dwFlags |= (::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTNICKUID) ? MATCH_UIN : 0);
- M->WriteByte("Chat", "HighlightEnabled", dwFlags);
- M->WriteByte("Chat", "HighlightMe", ::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTME) ? 1 : 0);
+ db_set_b(0, "Chat", "HighlightEnabled", dwFlags);
+ db_set_b(0, "Chat", "HighlightMe", ::IsDlgButtonChecked(hwndDlg, IDC_HIGHLIGHTME) ? 1 : 0);
g_Settings.Highlight->init();
}
return TRUE;
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index 2004b5e9a4..0acd694435 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -231,17 +231,17 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
if (colour) {
wsprintfA(str, "Font%dCol", i);
- *colour = M->GetDword(szMod, str, fol[j].defColour);
+ *colour = M.GetDword(szMod, str, fol[j].defColour);
}
if (lf) {
wsprintfA(str, "Font%dSize", i);
- lf->lfHeight = (char) M->GetByte(szMod, str, fol[j].defSize);
+ lf->lfHeight = (char) M.GetByte(szMod, str, fol[j].defSize);
lf->lfWidth = 0;
lf->lfEscapement = 0;
lf->lfOrientation = 0;
wsprintfA(str, "Font%dSty", i);
- style = M->GetByte(szMod, str, fol[j].defStyle);
- if (i == MSGFONTID_MESSAGEAREA && section == FONTSECTION_IM && M->GetByte(0, SRMSGMOD_T, "inputFontFix", 1) == 1) {
+ style = M.GetByte(szMod, str, fol[j].defStyle);
+ if (i == MSGFONTID_MESSAGEAREA && section == FONTSECTION_IM && M.GetByte("inputFontFix", 1) == 1) {
lf->lfWeight = FW_NORMAL;
lf->lfItalic = 0;
lf->lfUnderline = 0;
@@ -254,7 +254,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
lf->lfStrikeOut = style & FONTF_STRIKEOUT ? 1 : 0;
}
wsprintfA(str, "Font%dSet", i);
- lf->lfCharSet = M->GetByte(szMod, str, fol[j].defCharset);
+ lf->lfCharSet = M.GetByte(szMod, str, fol[j].defCharset);
lf->lfOutPrecision = OUT_DEFAULT_PRECIS;
lf->lfClipPrecision = CLIP_DEFAULT_PRECIS;
lf->lfQuality = DEFAULT_QUALITY;
@@ -264,7 +264,7 @@ void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szM
lf->lfCharSet = SYMBOL_CHARSET;
lstrcpyn(lf->lfFaceName, _T("Webdings"), SIZEOF(lf->lfFaceName));
} else {
- if (M->GetTString(NULL, szMod, str, &dbv)) {
+ if (db_get_ts(NULL, szMod, str, &dbv)) {
lstrcpy(lf->lfFaceName, fol[j].szDefFace);
} else {
lstrcpyn(lf->lfFaceName, dbv.ptszVal, SIZEOF(lf->lfFaceName));
@@ -302,9 +302,9 @@ static void FillBranch(HWND hwndTree, HTREEITEM hParent, struct branch_t *branch
tvis.item.pszText = TranslateTS(branch[i].szDescr);
tvis.item.stateMask = TVIS_STATEIMAGEMASK;
if (branch[i].iMode)
- iState = ((M->GetDword("Chat", branch[i].szDBName, defaultval) & branch[i].iMode) & branch[i].iMode) != 0 ? 3 : 2;
+ iState = ((M.GetDword("Chat", branch[i].szDBName, defaultval) & branch[i].iMode) & branch[i].iMode) != 0 ? 3 : 2;
else
- iState = M->GetByte("Chat", branch[i].szDBName, branch[i].bDefault) != 0 ? 3 : 2;
+ iState = M.GetByte("Chat", branch[i].szDBName, branch[i].bDefault) != 0 ? 3 : 2;
tvis.item.state = INDEXTOSTATEIMAGEMASK(iState);
branch[i].hItem = TreeView_InsertItem(hwndTree, &tvis);
}
@@ -326,8 +326,8 @@ static void SaveBranch(HWND hwndTree, struct branch_t *branch, int nValues)
iState |= branch[i].iMode;
if (iState & GC_EVENT_ADDSTATUS)
iState |= GC_EVENT_REMOVESTATUS;
- M->WriteDword("Chat", branch[i].szDBName, (DWORD)iState);
- } else M->WriteByte("Chat", branch[i].szDBName, bChecked);
+ db_set_dw(0, "Chat", branch[i].szDBName, (DWORD)iState);
+ } else db_set_b(0, "Chat", branch[i].szDBName, bChecked);
}
}
@@ -386,7 +386,7 @@ static INT CALLBACK BrowseCallbackProc(HWND hwnd, UINT uMsg, LPARAM lp, LPARAM p
char szDir[MAX_PATH];
switch (uMsg) {
case BFFM_INITIALIZED:
- SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)M->getUserDir());
+ SendMessage(hwnd, BFFM_SETSELECTION, TRUE, (LPARAM)M.getUserDir());
break;
case BFFM_SELCHANGED:
@@ -455,7 +455,7 @@ HICON LoadIconEx(int iIndex, char * pszIcoLibName, int iX, int iY)
static void InitSetting(TCHAR** ppPointer, char* pszSetting, TCHAR* pszDefault)
{
DBVARIANT dbv;
- if (!M->GetTString(NULL, "Chat", pszSetting, &dbv)) {
+ if (!db_get_ts(NULL, "Chat", pszSetting, &dbv)) {
replaceStr(ppPointer, dbv.ptszVal);
db_free(&dbv);
} else
@@ -588,16 +588,16 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (iLen > 0) {
pszText = (TCHAR *)realloc(pszText, (iLen + 2) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
- M->WriteTString(NULL, "Chat", "AddToGroup", pszText);
+ db_set_ts(NULL, "Chat", "AddToGroup", pszText);
} else
- M->WriteTString(NULL, "Chat", "AddToGroup", _T(""));
+ db_set_ts(NULL, "Chat", "AddToGroup", _T(""));
g_Settings.hGroup = 0;
if (pszText)
free(pszText);
- b = M->GetByte("Chat", "Tabs", 1);
+ b = M.GetByte("Chat", "Tabs", 1);
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch1, sizeof(branch1) / sizeof(branch1[0]));
SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch2, sizeof(branch2) / sizeof(branch2[0]));
@@ -615,9 +615,9 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
case WM_DESTROY:
BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
- M->WriteByte("Chat", "Branch1Exp", b);
+ db_set_b(0, "Chat", "Branch1Exp", b);
b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
- M->WriteByte("Chat", "Branch2Exp", b);
+ db_set_b(0, "Chat", "Branch2Exp", b);
}
return FALSE;
}
@@ -833,7 +833,7 @@ int FontServiceFontsChanged(WPARAM,LPARAM)
DeleteObject(hFont);
g_Settings.LogTextIndent = iText;
g_Settings.LogTextIndent = g_Settings.LogTextIndent * 12 / 10;
- g_Settings.LogIndentEnabled = (M->GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
+ g_Settings.LogIndentEnabled = (M.GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
LoadGlobalSettings();
MM_FontsChanged();
@@ -848,7 +848,7 @@ int FontServiceFontsChanged(WPARAM,LPARAM)
FreeTabConfig();
ReloadTabConfig();
Skin->setupAeroSkins();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
+ M.BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
return 0;
}
@@ -869,7 +869,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_SETRANGE, 0, MAKELONG(5000, 0));
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN2, UDM_SETPOS, 0, MAKELONG(db_get_w(NULL, "Chat", "LogLimit", 100), 0));
SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETRANGE, 0, MAKELONG(255, 10));
- SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETPOS, 0, MAKELONG(M->GetByte("Chat", "NicklistRowDist", 12), 0));
+ SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_SETPOS, 0, MAKELONG(M.GetByte("Chat", "NicklistRowDist", 12), 0));
SetDlgItemText(hwndDlg, IDC_LOGTIMESTAMP, g_Settings.pszTimeStampLog);
SetDlgItemText(hwndDlg, IDC_TIMESTAMP, g_Settings.pszTimeStamp);
SetDlgItemText(hwndDlg, IDC_OUTSTAMP, g_Settings.pszOutgoingNick);
@@ -961,11 +961,11 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
*p1 = 0;
}
- mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s%s"), M->getChatLogPath(), p);
+ mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s%s"), M.getChatLogPath(), p);
if (PathFileExists(tszInitialDir))
ofn.lpstrInitialDir = tszInitialDir;
else {
- mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s"), M->getChatLogPath());
+ mir_sntprintf(tszInitialDir, MAX_PATH, _T("%s"), M.getChatLogPath());
ofn.lpstrInitialDir = tszInitialDir;
}
@@ -1001,10 +1001,10 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
idList = SHBrowseForFolder(&bi);
if (idList) {
- const TCHAR *szUserDir = M->getUserDir();
+ const TCHAR *szUserDir = M.getUserDir();
SHGetPathFromIDList(idList, tszDirectory);
lstrcat(tszDirectory, _T("\\"));
- M->pathToRelative(tszDirectory, tszTemp, const_cast<TCHAR *>(szUserDir));
+ M.pathToRelative(tszDirectory, tszTemp, const_cast<TCHAR *>(szUserDir));
SetWindowText(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), lstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
@@ -1039,13 +1039,13 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (iLen > 0) {
TCHAR *pszText1 = (TCHAR *)malloc(iLen*sizeof(TCHAR) + 2);
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1);
- M->WriteTString(NULL, "Chat", "LogDirectory", pszText1);
+ db_set_ts(NULL, "Chat", "LogDirectory", pszText1);
free(pszText1);
g_Settings.LoggingEnabled = IsDlgButtonChecked(hwndDlg, IDC_LOGGING) == BST_CHECKED ? TRUE : FALSE;
- M->WriteByte("Chat", "LoggingEnabled", (BYTE)g_Settings.LoggingEnabled);
+ db_set_b(0, "Chat", "LoggingEnabled", (BYTE)g_Settings.LoggingEnabled);
} else {
db_unset(NULL, "Chat", "LogDirectory");
- M->WriteByte("Chat", "LoggingEnabled", 0);
+ db_set_b(0, "Chat", "LoggingEnabled", 0);
}
SM_InvalidateLogDirectories();
@@ -1054,7 +1054,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
iLen = SendDlgItemMessage(hwndDlg, IDC_CHAT_SPIN3, UDM_GETPOS, 0, 0);
if (iLen > 0)
- M->WriteByte("Chat", "NicklistRowDist", (BYTE)iLen);
+ db_set_b(0, "Chat", "NicklistRowDist", (BYTE)iLen);
else
db_unset(NULL, "Chat", "NicklistRowDist");
@@ -1094,7 +1094,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
free(pszText);
if (hListBkgBrush)
DeleteObject(hListBkgBrush);
- hListBkgBrush = CreateSolidBrush(M->GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
+ hListBkgBrush = CreateSolidBrush(M.GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
if (PluginConfig.m_chat_enabled) {
LoadLogFonts();
@@ -1108,7 +1108,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
DeleteObject(hFont);
g_Settings.LogTextIndent = iText;
g_Settings.LogTextIndent = g_Settings.LogTextIndent * 12 / 10;
- g_Settings.LogIndentEnabled = (M->GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
+ g_Settings.LogIndentEnabled = (M.GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
LoadGlobalSettings();
MM_FontsChanged();
@@ -1172,10 +1172,10 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
TranslateDialogDefault(hwndDlg);
if (PluginConfig.m_chat_enabled) {
- DWORD dwFilterFlags = M->GetDword("Chat", "FilterFlags", GC_EVENT_ALL);
- DWORD dwTrayFlags = M->GetDword("Chat", "TrayIconFlags", GC_EVENT_ALL);
- DWORD dwPopupFlags = M->GetDword("Chat", "PopupFlags", GC_EVENT_ALL);
- DWORD dwLogFlags = M->GetDword("Chat", "DiskLogFlags", GC_EVENT_ALL);
+ DWORD dwFilterFlags = M.GetDword("Chat", "FilterFlags", GC_EVENT_ALL);
+ DWORD dwTrayFlags = M.GetDword("Chat", "TrayIconFlags", GC_EVENT_ALL);
+ DWORD dwPopupFlags = M.GetDword("Chat", "PopupFlags", GC_EVENT_ALL);
+ DWORD dwLogFlags = M.GetDword("Chat", "DiskLogFlags", GC_EVENT_ALL);
for (int i = 0; _eventorder[i]; i++) {
if (_eventorder[i] != GC_EVENT_HIGHLIGHT) {
@@ -1191,8 +1191,8 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SendDlgItemMessage(hwndDlg, IDC_LOGICONTYPE, CB_SETCURSEL, (g_Settings.LogSymbols ? 2 : (g_Settings.dwIconFlags ? 1 : 0)), 0);
- CheckDlgButton(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS, M->GetByte("Chat", "SkipWhenNoWindow", 0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TRAYONLYFORINACTIVE, M->GetByte("Chat", "TrayIconInactiveOnly", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS, M.GetByte("Chat", "SkipWhenNoWindow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TRAYONLYFORINACTIVE, M.GetByte("Chat", "TrayIconInactiveOnly", 0) ? BST_CHECKED : BST_UNCHECKED);
}
break;
@@ -1217,18 +1217,18 @@ INT_PTR CALLBACK DlgProcOptions3(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
dwPopupFlags |= (IsDlgButtonChecked(hwndDlg, IDC_P1 + i) ? _eventorder[i] : 0);
dwTrayFlags |= (IsDlgButtonChecked(hwndDlg, IDC_T1 + i) ? _eventorder[i] : 0);
}
- M->WriteDword("Chat", "FilterFlags", dwFilterFlags);
- M->WriteDword("Chat", "PopupFlags", dwPopupFlags);
- M->WriteDword("Chat", "TrayIconFlags", dwTrayFlags);
- M->WriteDword("Chat", "DiskLogFlags", dwLogFlags);
+ db_set_dw(0, "Chat", "FilterFlags", dwFilterFlags);
+ db_set_dw(0, "Chat", "PopupFlags", dwPopupFlags);
+ db_set_dw(0, "Chat", "TrayIconFlags", dwTrayFlags);
+ db_set_dw(0, "Chat", "DiskLogFlags", dwLogFlags);
LRESULT lr = SendDlgItemMessage(hwndDlg, IDC_LOGICONTYPE, CB_GETCURSEL, 0, 0);
- M->WriteDword("Chat", "IconFlags", lr == 1 ? 1 : 0);
- M->WriteByte("Chat", "LogSymbols", lr == 2 ? 1 : 0);
+ db_set_dw(0, "Chat", "IconFlags", lr == 1 ? 1 : 0);
+ db_set_b(0, "Chat", "LogSymbols", lr == 2 ? 1 : 0);
- M->WriteByte("Chat", "SkipWhenNoWindow", IsDlgButtonChecked(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS) ? 1 : 0);
- M->WriteByte("Chat", "TrayIconInactiveOnly", IsDlgButtonChecked(hwndDlg, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
+ db_set_b(0, "Chat", "SkipWhenNoWindow", IsDlgButtonChecked(hwndDlg, IDC_NOPOPUPSFORCLOSEDWINDOWS) ? 1 : 0);
+ db_set_b(0, "Chat", "TrayIconInactiveOnly", IsDlgButtonChecked(hwndDlg, IDC_TRAYONLYFORINACTIVE) ? 1 : 0);
LoadGlobalSettings();
MM_FontsChanged();
SM_BroadcastMessage(NULL, GC_SETWNDPROPS, 0, 0, TRUE);
@@ -1246,53 +1246,53 @@ void LoadGlobalSettings(void)
LOGFONT lf;
char szBuf[40];
- g_Settings.LogLimitNames = M->GetByte("Chat", "LogLimitNames", 1);
- g_Settings.ShowTime = M->GetByte("Chat", "ShowTimeStamp", 1);
- g_Settings.ShowTimeIfChanged = (BOOL)M->GetByte("Chat", "ShowTimeStampIfChanged", 0);
- g_Settings.TimeStampEventColour = (BOOL)M->GetByte("Chat", "TimeStampEventColour", 0);
+ g_Settings.LogLimitNames = M.GetByte("Chat", "LogLimitNames", 1);
+ g_Settings.ShowTime = M.GetByte("Chat", "ShowTimeStamp", 1);
+ g_Settings.ShowTimeIfChanged = (BOOL)M.GetByte("Chat", "ShowTimeStampIfChanged", 0);
+ g_Settings.TimeStampEventColour = (BOOL)M.GetByte("Chat", "TimeStampEventColour", 0);
g_Settings.iEventLimit = db_get_w(NULL, "Chat", "LogLimit", 100);
g_Settings.iEventLimitThreshold = db_get_w(NULL, "Chat", "LogLimitThreshold", 20);
- g_Settings.dwIconFlags = M->GetDword("Chat", "IconFlags", 0x0000);
+ g_Settings.dwIconFlags = M.GetDword("Chat", "IconFlags", 0x0000);
g_Settings.LoggingLimit = (size_t)db_get_w(NULL, "Chat", "LoggingLimit", 100);
- g_Settings.LoggingEnabled = (BOOL)M->GetByte("Chat", "LoggingEnabled", 0);
- g_Settings.OpenInDefault = (BOOL)M->GetByte("Chat", "DefaultContainer", 1);
- g_Settings.FlashWindow = (BOOL)M->GetByte("Chat", "FlashWindow", 0);
- g_Settings.FlashWindowHightlight = (BOOL)M->GetByte("Chat", "FlashWindowHighlight", 0);
- g_Settings.HighlightEnabled = (BOOL)M->GetByte("Chat", "HighlightEnabled", 1);
- g_Settings.crUserListColor = (BOOL)M->GetDword(CHAT_FONTMODULE, "Font18Col", RGB(0, 0, 0));
- g_Settings.crUserListBGColor = (BOOL)M->GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR);
- g_Settings.crUserListHeadingsColor = (BOOL)M->GetDword(CHAT_FONTMODULE, "Font19Col", RGB(170, 170, 170));
- g_Settings.StripFormat = (BOOL)M->GetByte("Chat", "StripFormatting", 0);
- g_Settings.TrayIconInactiveOnly = (BOOL)M->GetByte("Chat", "TrayIconInactiveOnly", 1);
- g_Settings.BBCodeInPopups = (BOOL)M->GetByte("Chat", "BBCodeInPopups", 0);
- g_Settings.AddColonToAutoComplete = (BOOL)M->GetByte("Chat", "AddColonToAutoComplete", 1);
- g_Settings.iPopupStyle = M->GetByte("Chat", "PopupStyle", 1);
+ g_Settings.LoggingEnabled = (BOOL)M.GetByte("Chat", "LoggingEnabled", 0);
+ g_Settings.OpenInDefault = (BOOL)M.GetByte("Chat", "DefaultContainer", 1);
+ g_Settings.FlashWindow = (BOOL)M.GetByte("Chat", "FlashWindow", 0);
+ g_Settings.FlashWindowHightlight = (BOOL)M.GetByte("Chat", "FlashWindowHighlight", 0);
+ g_Settings.HighlightEnabled = (BOOL)M.GetByte("Chat", "HighlightEnabled", 1);
+ g_Settings.crUserListColor = (BOOL)M.GetDword(CHAT_FONTMODULE, "Font18Col", RGB(0, 0, 0));
+ g_Settings.crUserListBGColor = (BOOL)M.GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR);
+ g_Settings.crUserListHeadingsColor = (BOOL)M.GetDword(CHAT_FONTMODULE, "Font19Col", RGB(170, 170, 170));
+ g_Settings.StripFormat = (BOOL)M.GetByte("Chat", "StripFormatting", 0);
+ g_Settings.TrayIconInactiveOnly = (BOOL)M.GetByte("Chat", "TrayIconInactiveOnly", 1);
+ g_Settings.BBCodeInPopups = (BOOL)M.GetByte("Chat", "BBCodeInPopups", 0);
+ g_Settings.AddColonToAutoComplete = (BOOL)M.GetByte("Chat", "AddColonToAutoComplete", 1);
+ g_Settings.iPopupStyle = M.GetByte("Chat", "PopupStyle", 1);
g_Settings.iPopupTimeout = db_get_w(NULL, "Chat", "PopupTimeout", 3);
- g_Settings.crPUBkgColour = M->GetDword("Chat", "PopupColorBG", GetSysColor(COLOR_WINDOW));
- g_Settings.crPUTextColour = M->GetDword("Chat", "PopupColorText", 0);
- g_Settings.ClassicIndicators = M->GetByte("Chat", "ClassicIndicators", 0);
+ g_Settings.crPUBkgColour = M.GetDword("Chat", "PopupColorBG", GetSysColor(COLOR_WINDOW));
+ g_Settings.crPUTextColour = M.GetDword("Chat", "PopupColorText", 0);
+ g_Settings.ClassicIndicators = M.GetByte("Chat", "ClassicIndicators", 0);
//MAD
- g_Settings.LogClassicIndicators = M->GetByte("Chat", "LogClassicIndicators", 0);
- g_Settings.AlternativeSorting = M->GetByte("Chat", "AlternativeSorting", 1);
- g_Settings.AnnoyingHighlight = M->GetByte("Chat", "AnnoyingHighlight", 0);
- g_Settings.CreateWindowOnHighlight = M->GetByte("Chat", "CreateWindowOnHighlight", 1);
+ g_Settings.LogClassicIndicators = M.GetByte("Chat", "LogClassicIndicators", 0);
+ g_Settings.AlternativeSorting = M.GetByte("Chat", "AlternativeSorting", 1);
+ g_Settings.AnnoyingHighlight = M.GetByte("Chat", "AnnoyingHighlight", 0);
+ g_Settings.CreateWindowOnHighlight = M.GetByte("Chat", "CreateWindowOnHighlight", 1);
//MAD_
- g_Settings.LogSymbols = M->GetByte("Chat", "LogSymbols", 1);
- g_Settings.ClickableNicks = M->GetByte("Chat", "ClickableNicks", 1);
- g_Settings.ColorizeNicks = M->GetByte("Chat", "ColorizeNicks", 1);
- g_Settings.ColorizeNicksInLog = M->GetByte("Chat", "ColorizeNicksInLog", 1);
- g_Settings.ScaleIcons = M->GetByte("Chat", "ScaleIcons", 1);
- g_Settings.UseDividers = M->GetByte("Chat", "UseDividers", 1);
- g_Settings.DividersUsePopupConfig = M->GetByte("Chat", "DividersUsePopupConfig", 1);
- g_Settings.MathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M->GetByte("Chat", "MathModSupport", 0);
-
- g_Settings.DoubleClick4Privat = (BOOL)M->GetByte("Chat", "DoubleClick4Privat", 0);
- g_Settings.ShowContactStatus = M->GetByte("Chat", "ShowContactStatus", 1);
- g_Settings.ContactStatusFirst = M->GetByte("Chat", "ContactStatusFirst", 0);
+ g_Settings.LogSymbols = M.GetByte("Chat", "LogSymbols", 1);
+ g_Settings.ClickableNicks = M.GetByte("Chat", "ClickableNicks", 1);
+ g_Settings.ColorizeNicks = M.GetByte("Chat", "ColorizeNicks", 1);
+ g_Settings.ColorizeNicksInLog = M.GetByte("Chat", "ColorizeNicksInLog", 1);
+ g_Settings.ScaleIcons = M.GetByte("Chat", "ScaleIcons", 1);
+ g_Settings.UseDividers = M.GetByte("Chat", "UseDividers", 1);
+ g_Settings.DividersUsePopupConfig = M.GetByte("Chat", "DividersUsePopupConfig", 1);
+ g_Settings.MathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M.GetByte("Chat", "MathModSupport", 0);
+
+ g_Settings.DoubleClick4Privat = (BOOL)M.GetByte("Chat", "DoubleClick4Privat", 0);
+ g_Settings.ShowContactStatus = M.GetByte("Chat", "ShowContactStatus", 1);
+ g_Settings.ContactStatusFirst = M.GetByte("Chat", "ContactStatusFirst", 0);
if (hListBkgBrush)
DeleteObject(hListBkgBrush);
- hListBkgBrush = CreateSolidBrush(M->GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
+ hListBkgBrush = CreateSolidBrush(M.GetDword("Chat", "ColorNicklistBG", SRMSGDEFSET_BKGCOLOUR));
InitSetting(&g_Settings.pszTimeStamp, "HeaderTime", _T("[%H:%M]"));
InitSetting(&g_Settings.pszTimeStampLog, "LogTimestamp", _T("[%d %b %y %H:%M]"));
@@ -1301,7 +1301,7 @@ void LoadGlobalSettings(void)
DBVARIANT dbv;
- if (!M->GetTString(NULL, "Chat", "LogDirectory", &dbv)) {
+ if (!db_get_ts(NULL, "Chat", "LogDirectory", &dbv)) {
lstrcpyn(g_Settings.pszLogDir, dbv.ptszVal, MAX_PATH);
db_free(&dbv);
}
@@ -1309,7 +1309,7 @@ void LoadGlobalSettings(void)
g_Settings.pszLogDir[MAX_PATH - 1] = 0;
- g_Settings.LogIndentEnabled = (M->GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
+ g_Settings.LogIndentEnabled = (M.GetByte("Chat", "LogIndentEnabled", 1) != 0) ? TRUE : FALSE;
// nicklist
@@ -1329,14 +1329,14 @@ void LoadGlobalSettings(void)
ih = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListFont, FALSE);
ih2 = GetTextPixelSize(_T("AQGglo"), g_Settings.UserListHeadingsFont, FALSE);
- g_Settings.iNickListFontHeight = max(M->GetByte("Chat", "NicklistRowDist", 12), (ih > ih2 ? ih : ih2));
+ g_Settings.iNickListFontHeight = max(M.GetByte("Chat", "NicklistRowDist", 12), (ih > ih2 ? ih : ih2));
for (int i=0; i < 7; i++) {
mir_snprintf(szBuf, 20, "NickColor%d", i);
- g_Settings.nickColors[i] = M->GetDword("Chat", szBuf, g_Settings.crUserListColor);
+ g_Settings.nickColors[i] = M.GetDword("Chat", szBuf, g_Settings.crUserListColor);
}
- g_Settings.nickColors[5] = M->GetDword("Chat", "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
- g_Settings.nickColors[6] = M->GetDword("Chat", "NickColor6", GetSysColor(COLOR_HIGHLIGHTTEXT));
+ g_Settings.nickColors[5] = M.GetDword("Chat", "NickColor5", GetSysColor(COLOR_HIGHLIGHT));
+ g_Settings.nickColors[6] = M.GetDword("Chat", "NickColor6", GetSysColor(COLOR_HIGHLIGHTTEXT));
if (g_Settings.SelectionBGBrush)
DeleteObject(g_Settings.SelectionBGBrush);
g_Settings.SelectionBGBrush = CreateSolidBrush(g_Settings.nickColors[5]);
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp
index 2c656a335b..7ffaa7da02 100644
--- a/plugins/TabSRMM/src/chat/services.cpp
+++ b/plugins/TabSRMM/src/chat/services.cpp
@@ -82,7 +82,7 @@ int Chat_ModulesLoaded(WPARAM wParam, LPARAM lParam)
CList_SetAllOffline(TRUE, NULL);
- g_Settings.MathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M->GetByte("Chat", "MathModSupport", 0);
+ g_Settings.MathMod = ServiceExists(MATH_RTF_REPLACE_FORMULAE) && M.GetByte("Chat", "MathModSupport", 0);
return 0;
}
@@ -226,8 +226,8 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
si->ptszName = a2tf(gcw->ptszName, gcw->dwFlags);
si->ptszStatusbarText = a2tf(gcw->ptszStatusbarText, gcw->dwFlags);
si->iSplitterX = g_Settings.iSplitterX;
- si->bFilterEnabled = M->GetByte(si->hContact, "Chat", "FilterEnabled", M->GetByte("Chat", "FilterEnabled", 0));
- si->bNicklistEnabled = M->GetByte("Chat", "ShowNicklist", 1);
+ si->bFilterEnabled = db_get_b(si->hContact, "Chat", "FilterEnabled", M.GetByte("Chat", "FilterEnabled", 0));
+ si->bNicklistEnabled = M.GetByte("Chat", "ShowNicklist", 1);
if (!(gcw->dwFlags & GC_UNICODE)) {
si->pszID = mir_strdup(gcw->pszID);
si->pszName = mir_strdup(gcw->pszName);
@@ -249,7 +249,7 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
db_set_s(si->hContact, si->pszModule , "Topic", "");
db_unset(si->hContact, "CList", "StatusMsg");
if (si->ptszStatusbarText)
- M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
if (si->hContact)
@@ -305,7 +305,7 @@ static int DoControl(GCEVENT * gce, WPARAM wp)
si = SM_FindSession(gce->pDest->ptszID, gce->pDest->pszModule);
if (si) {
si->bInitDone = TRUE;
- if (wp != SESSION_INITDONE || M->GetByte("Chat", "PopupOnJoin", 0) == 0)
+ if (wp != SESSION_INITDONE || M.GetByte("Chat", "PopupOnJoin", 0) == 0)
ShowRoom(si, wp, TRUE);
return 0;
}
@@ -369,7 +369,7 @@ static int DoControl(GCEVENT * gce, WPARAM wp)
if (si) {
replaceStr(&si->ptszStatusbarText, gce->ptszText);
if (si->ptszStatusbarText)
- M->WriteTString(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
+ db_set_ts(si->hContact, si->pszModule, "StatusBar", si->ptszStatusbarText);
else
db_set_s(si->hContact, si->pszModule, "StatusBar", "");
if (si->hWnd)
@@ -423,10 +423,10 @@ static void AddUser(GCEVENT * gce)
HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateTab, BOOL bPopupContainer, BOOL bWantPopup)
{
HANDLE hContact = si->hContact;
- if (M->FindWindow(hContact) != 0)
+ if (M.FindWindow(hContact) != 0)
return 0;
- if (hContact != 0 && M->GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
+ if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
if ((pContainer = FindMatchingContainer(_T("default"), hContact)) == NULL) {
TCHAR szName[CONTAINER_NAMELEN + 1];
@@ -449,7 +449,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
TCHAR newcontactname[128];
if ( lstrlen(contactName) > 0) {
- if (M->GetByte("cuttitle", 0))
+ if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, SIZEOF(newcontactname));
else {
lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname));
@@ -473,7 +473,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
ShowWindow(pContainer->hwndActive, SW_HIDE);
{
- int iTabIndex_wanted = M->GetDword(hContact, "tabindex", pContainer->iChilds * 100);
+ int iTabIndex_wanted = M.GetDword(hContact, "tabindex", pContainer->iChilds * 100);
int iCount = TabCtrl_GetItemCount(hwndTab);
TCITEM item = {0};
HWND hwnd;
@@ -489,7 +489,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
hwnd = (HWND)item.lParam;
dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat) {
- relPos = M->GetDword(dat->hContact, "tabindex", i * 100);
+ relPos = M.GetDword(dat->hContact, "tabindex", i * 100);
if (iTabIndex_wanted <= relPos)
pContainer->iTabIndex = i;
}
@@ -555,7 +555,7 @@ HWND CreateNewRoom(TContainerData *pContainer, SESSION_INFO *si, BOOL bActivateT
}
}
- if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled && !M->GetByte("forceAeroPeek", 0))
+ if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled && !M.GetByte("forceAeroPeek", 0))
CWarning::show(CWarning::WARN_AEROPEEK_SKIN, MB_ICONWARNING|MB_OK);
return hwndNew; // return handle of the new dialog
}
@@ -664,9 +664,9 @@ INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
if (si) {
if (gce->pszText) {
replaceStr(&si->ptszTopic, RemoveFormatting(gce->ptszText));
- M->WriteTString(si->hContact, si->pszModule , "Topic", /*RemoveFormatting*/(si->ptszTopic));
- if (M->GetByte("Chat", "TopicOnClist", 1))
- M->WriteTString(si->hContact, "CList" , "StatusMsg", /*RemoveFormatting*/(si->ptszTopic));
+ db_set_ts(si->hContact, si->pszModule , "Topic", /*RemoveFormatting*/(si->ptszTopic));
+ if (M.GetByte("Chat", "TopicOnClist", 1))
+ db_set_ts(si->hContact, "CList" , "StatusMsg", /*RemoveFormatting*/(si->ptszTopic));
if (si->hWnd)
SendMessage(si->hWnd, DM_INVALIDATEPANEL, 0, 0);
}
@@ -691,7 +691,7 @@ INT_PTR Service_AddEvent(WPARAM wParam, LPARAM lParam)
if (!(gce->dwFlags & GC_UNICODE)) {
fFreeText = TRUE;
if (si)
- gce->ptszText = a2tf(gce->ptszText, gce->dwFlags, M->GetDword(si->hContact, "ANSIcodepage", 0));
+ gce->ptszText = a2tf(gce->ptszText, gce->dwFlags, M.GetDword(si->hContact, "ANSIcodepage", 0));
else
gce->ptszText = a2tf(gce->ptszText, gce->dwFlags);
}
@@ -830,7 +830,7 @@ int CreateServiceFunctions(void)
if (ServiceExists(MS_GC_REGISTER)) {
LRESULT result = CWarning::show(CWarning::WARN_CHAT_ENABLED, CWarning::CWF_NOALLOWHIDE | MB_YESNOCANCEL | MB_ICONQUESTION);
if (result == IDYES)
- M->WriteByte("PluginDisable", "chat.dll", 1);
+ db_set_b(0, "PluginDisable", "chat.dll", 1);
return 0;
}
PluginConfig.m_chat_enabled = true;
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 5c0c745013..29ca57c044 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -220,7 +220,7 @@ static int ShowPopup(HANDLE hContact, SESSION_INFO* si, HICON hIcon, char* pszP
pd.colorBack = g_Settings.crPUBkgColour;
pd.colorText = g_Settings.crPUTextColour;
} else {
- pd.colorBack = M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR);
+ pd.colorBack = M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR);
pd.colorText = crBkg;
}
@@ -537,7 +537,7 @@ BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO* si, GCEVENT * gce, BOOL bHighligh
if (bHighlight) {
gce->pDest->iType |= GC_EVENT_HIGHLIGHT;
params->sound = "ChatHighlight";
- if (M->GetByte(si->hContact, "CList", "Hidden", 0) != 0)
+ if (db_get_b(si->hContact, "CList", "Hidden", 0) != 0)
db_unset(si->hContact, "CList", "Hidden");
if (params->bInactive) {
fFlagUnread = true;
@@ -705,7 +705,7 @@ void CheckColorsInModule(const char* pszModule)
{
MODULEINFO * pMod = MM_FindModule(pszModule);
COLORREF crFG;
- COLORREF crBG = (COLORREF)M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
+ COLORREF crBG = (COLORREF)M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
LoadLogfont(MSGFONTID_MESSAGEAREA, NULL, &crFG, FONTMODULE);
@@ -925,7 +925,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
GCMENUITEMS gcmi = {0};
int i;
HMENU hSubMenu = 0;
- DWORD codepage = M->GetDword(si->hContact, "ANSIcodepage", 0);
+ DWORD codepage = M.GetDword(si->hContact, "ANSIcodepage", 0);
int pos;
*hMenu = GetSubMenu(g_hMenu, iIndex);
@@ -1052,7 +1052,7 @@ BOOL DoEventHookAsync(HWND hwnd, const TCHAR* pszID, const char* pszModule, int
return FALSE;
if (!(si->dwFlags & GC_UNICODE)) {
- DWORD dwCP = M->GetDword(si->hContact, "ANSIcodepage", 0);
+ DWORD dwCP = M.GetDword(si->hContact, "ANSIcodepage", 0);
gcd->pszID = t2a(pszID, 0);
gch->pszUID = t2a(pszUID, 0);
gch->pszText = t2a(pszText, dwCP);
@@ -1079,7 +1079,7 @@ BOOL DoEventHook(const TCHAR* pszID, const char* pszModule, int iType, const TCH
return FALSE;
if (!(si->dwFlags & GC_UNICODE)) {
- DWORD dwCP = M->GetDword(si->hContact, "ANSIcodepage", 0);
+ DWORD dwCP = M.GetDword(si->hContact, "ANSIcodepage", 0);
gcd.pszID = t2a(pszID, 0);
gch.pszUID = t2a(pszUID, 0);
gch.pszText = t2a(pszText, dwCP);
@@ -1212,18 +1212,18 @@ void Chat_SetFilters(SESSION_INFO *si)
if (si == NULL)
return;
- dwFlags_default = M->GetDword("Chat", "FilterFlags", 0x03E0);
- dwFlags_local = M->GetDword(si->hContact, "Chat", "FilterFlags", 0x03E0);
- dwMask = M->GetDword(si->hContact, "Chat", "FilterMask", 0);
+ dwFlags_default = M.GetDword("Chat", "FilterFlags", 0x03E0);
+ dwFlags_local = db_get_dw(si->hContact, "Chat", "FilterFlags", 0x03E0);
+ dwMask = db_get_dw(si->hContact, "Chat", "FilterMask", 0);
si->iLogFilterFlags = dwFlags_default;
for (int i=0; i < 32; i++)
if (dwMask & (1 << i))
si->iLogFilterFlags = (dwFlags_local & (1 << i) ? si->iLogFilterFlags | (1 << i) : si->iLogFilterFlags & ~(1 << i));
- dwFlags_default = M->GetDword("Chat", "PopupFlags", 0x03E0);
- dwFlags_local = M->GetDword(si->hContact, "Chat", "PopupFlags", 0x03E0);
- dwMask = M->GetDword(si->hContact, "Chat", "PopupMask", 0);
+ dwFlags_default = M.GetDword("Chat", "PopupFlags", 0x03E0);
+ dwFlags_local = db_get_dw(si->hContact, "Chat", "PopupFlags", 0x03E0);
+ dwMask = db_get_dw(si->hContact, "Chat", "PopupMask", 0);
si->iLogPopupFlags = dwFlags_default;
for (i=0; i < 32; i++) {
@@ -1231,9 +1231,9 @@ void Chat_SetFilters(SESSION_INFO *si)
si->iLogPopupFlags = (dwFlags_local & (1 << i) ? si->iLogPopupFlags | (1 << i) : si->iLogPopupFlags & ~(1 << i));
}
- dwFlags_default = M->GetDword("Chat", "TrayIconFlags", 0x03E0);
- dwFlags_local = M->GetDword(si->hContact, "Chat", "TrayIconFlags", 0x03E0);
- dwMask = M->GetDword(si->hContact, "Chat", "TrayIconMask", 0);
+ dwFlags_default = M.GetDword("Chat", "TrayIconFlags", 0x03E0);
+ dwFlags_local = db_get_dw(si->hContact, "Chat", "TrayIconFlags", 0x03E0);
+ dwMask = db_get_dw(si->hContact, "Chat", "TrayIconMask", 0);
si->iLogTrayFlags = dwFlags_default;
for (i=0; i < 32; i++) {
@@ -1241,7 +1241,7 @@ void Chat_SetFilters(SESSION_INFO *si)
si->iLogTrayFlags = (dwFlags_local & (1 << i) ? si->iLogTrayFlags | (1 << i) : si->iLogTrayFlags & ~(1 << i));
}
- dwFlags_default = M->GetDword("Chat", "DiskLogFlags", 0xFFFF);
+ dwFlags_default = M.GetDword("Chat", "DiskLogFlags", 0xFFFF);
si->iDiskLogFlags = dwFlags_default;
@@ -1318,8 +1318,8 @@ TCHAR* GetChatLogsFilename(SESSION_INFO *si, time_t tTime)
dat.variables = rva;
tszParsedName = (TCHAR*) CallService(MS_UTILS_REPLACEVARS, (WPARAM)g_Settings.pszLogDir, (LPARAM)&dat);
- if (!M->pathIsAbsolute(tszParsedName))
- mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s%s"), M->getChatLogPath(), tszParsedName);
+ if (!M.pathIsAbsolute(tszParsedName))
+ mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s%s"), M.getChatLogPath(), tszParsedName);
else
mir_sntprintf(si->pszLogFileName, MAX_PATH, _T("%s"), tszParsedName);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 6f9beeffd2..ae8aff8aee 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -70,7 +70,7 @@ static const CLSID IID_ITextDocument= { 0x8CC497C0,0xA1DF,0x11CE, { 0x80,0x98, 0
static void Chat_SetMessageLog(TWindowData *dat)
{
- unsigned int iLogMode = M->GetByte("Chat", "useIEView", 0);
+ unsigned int iLogMode = M.GetByte("Chat", "useIEView", 0);
if (iLogMode == WANT_IEVIEW_LOG && dat->hwndIEView == 0) {
IEVIEWWINDOW ieWindow;
@@ -335,7 +335,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg)
dat->wParam = dat->lParam = 0;
}
}
- if (M->isAero())
+ if (M.isAero())
InvalidateRect(hwndTab, NULL, FALSE);
if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->setActiveItem(dat);
@@ -351,7 +351,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg)
static void InitButtons(HWND hwndDlg, SESSION_INFO* si)
{
- BOOL isFlat = M->GetByte("tbflat", 1);
+ BOOL isFlat = M.GetByte("tbflat", 1);
BOOL isThemed = PluginConfig.m_bIsXP;
MODULEINFO *pInfo = si ? MM_FindModule(si->pszModule) : NULL;
BOOL bFilterEnabled = si ? si->bFilterEnabled : FALSE;
@@ -659,7 +659,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
MODULEINFO* mi = MM_FindModule(Parentsi->pszModule);
CHARRANGE sel, all = { 0, -1};
int iSelection;
- int iPrivateBG = M->GetByte(mwdat->hContact, "private_bg", 0);
+ int iPrivateBG = M.GetByte(mwdat->hContact, "private_bg", 0);
MessageWindowPopupData mwpd;
POINT pt;
int idFrom = IDC_CHAT_MESSAGE;
@@ -1062,7 +1062,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
if (mi && mi->bBkgColor) {
int index = Chat_GetColorIndex(Parentsi->pszModule, cf.crBackColor);
- COLORREF crB = (COLORREF)M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
+ COLORREF crB = (COLORREF)M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
u = IsDlgButtonChecked(hwndParent, IDC_BKGCOLOR);
if (index >= 0) {
@@ -1156,14 +1156,14 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
case WM_INITDIALOG:
{
si = (SESSION_INFO *)lParam;
- DWORD dwMask = M->GetDword(si->hContact, "Chat", "FilterMask", 0);
- DWORD dwFlags = M->GetDword(si->hContact, "Chat", "FilterFlags", 0);
+ DWORD dwMask = db_get_dw(si->hContact, "Chat", "FilterMask", 0);
+ DWORD dwFlags = db_get_dw(si->hContact, "Chat", "FilterFlags", 0);
- DWORD dwPopupMask = M->GetDword(si->hContact, "Chat", "PopupMask", 0);
- DWORD dwPopupFlags = M->GetDword(si->hContact, "Chat", "PopupFlags", 0);
+ DWORD dwPopupMask = db_get_dw(si->hContact, "Chat", "PopupMask", 0);
+ DWORD dwPopupFlags = db_get_dw(si->hContact, "Chat", "PopupFlags", 0);
- DWORD dwTrayMask = M->GetDword(si->hContact, "Chat", "TrayIconMask", 0);
- DWORD dwTrayFlags = M->GetDword(si->hContact, "Chat", "TrayIconFlags", 0);
+ DWORD dwTrayMask = db_get_dw(si->hContact, "Chat", "TrayIconMask", 0);
+ DWORD dwTrayFlags = db_get_dw(si->hContact, "Chat", "TrayIconFlags", 0);
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)si);
@@ -1201,8 +1201,8 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
db_unset(si->hContact, "Chat", "FilterFlags");
db_unset(si->hContact, "Chat", "FilterMask");
} else {
- M->WriteDword(si->hContact, "Chat", "FilterFlags", iFlags);
- M->WriteDword(si->hContact, "Chat", "FilterMask", dwMask);
+ db_set_dw(si->hContact, "Chat", "FilterFlags", iFlags);
+ db_set_dw(si->hContact, "Chat", "FilterMask", dwMask);
}
}
@@ -1222,8 +1222,8 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
db_unset(si->hContact, "Chat", "PopupFlags");
db_unset(si->hContact, "Chat", "PopupMask");
} else {
- M->WriteDword(si->hContact, "Chat", "PopupFlags", iFlags);
- M->WriteDword(si->hContact, "Chat", "PopupMask", dwMask);
+ db_set_dw(si->hContact, "Chat", "PopupFlags", iFlags);
+ db_set_dw(si->hContact, "Chat", "PopupMask", dwMask);
}
}
@@ -1242,8 +1242,8 @@ static INT_PTR CALLBACK FilterWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
db_unset(si->hContact, "Chat", "TrayIconFlags");
db_unset(si->hContact, "Chat", "TrayIconMask");
} else {
- M->WriteDword(si->hContact, "Chat", "TrayIconFlags", iFlags);
- M->WriteDword(si->hContact, "Chat", "TrayIconMask", dwMask);
+ db_set_dw(si->hContact, "Chat", "TrayIconFlags", iFlags);
+ db_set_dw(si->hContact, "Chat", "TrayIconMask", dwMask);
}
Chat_SetFilters(si);
SendMessage(si->hWnd, GC_CHANGEFILTERFLAG, 0, (LPARAM)iFlags);
@@ -1274,7 +1274,7 @@ static LRESULT CALLBACK ButtonSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, L
HWND hColor = GetDlgItem(hwndParent, IDC_COLOR);
HWND hBGColor = GetDlgItem(hwndParent, IDC_BKGCOLOR);
- if (M->GetByte("Chat", "RightClickFilter", 0) != 0) {
+ if (M.GetByte("Chat", "RightClickFilter", 0) != 0) {
if (hFilter == hwnd)
SendMessage(hwndParent, GC_SHOWFILTERMENU, 0, 0);
if (hColor == hwnd)
@@ -1332,7 +1332,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
POINT pt={LOWORD(lParam), HIWORD(lParam)};
CheckCustomLink(hwnd, &pt, msg, wParam, lParam, TRUE);
}
- if (M->GetByte("autocopy", 1)) {
+ if (M.GetByte("autocopy", 1)) {
CHARRANGE sel;
SendMessage(hwnd, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin != sel.cpMax) {
@@ -1782,7 +1782,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
else
nItemUnderMouse &= 0xFFFF;
- if (M->GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
+ if (M.GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
if ((int)nItemUnderMouse == currentHovered) break;
currentHovered = (int)nItemUnderMouse;
@@ -1800,7 +1800,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
}
else
{
- if (M->GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
+ if (M.GetByte("adv_TipperTooltip", 1) && ServiceExists("mToolTip/HideTip")) {
KillTimer(hwnd, 1);
if (isToolTip) {
CallService("mToolTip/HideTip", 0, 0);
@@ -1940,7 +1940,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
if (!dat->pContainer->settings->fPrivate)
psi->iSplitterY = g_Settings.iSplitterY;
else {
- if (M->GetByte("Chat", "SyncSplitter", 0))
+ if (M.GetByte("Chat", "SyncSplitter", 0))
psi->iSplitterY = dat->pContainer->settings->splitterPos - DPISCALEY_S(23);
else
psi->iSplitterY = g_Settings.iSplitterY;
@@ -1954,10 +1954,10 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->fInsertMode = FALSE;
- dat->codePage = M->GetDword(dat->hContact, "ANSIcodepage", CP_ACP);
+ dat->codePage = M.GetDword(dat->hContact, "ANSIcodepage", CP_ACP);
dat->Panel->getVisibility();
dat->Panel->Configure();
- M->AddWindow(hwndDlg, dat->hContact);
+ M.AddWindow(hwndDlg, dat->hContact);
BroadCastContainer(dat->pContainer, DM_REFRESHTABINDEX, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETOLECALLBACK, 0, (LPARAM)mREOLECallback);
@@ -2049,7 +2049,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
case GC_SETWNDPROPS: {
//HICON hIcon;
- COLORREF colour = M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
+ COLORREF colour = M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR);
InitButtons(hwndDlg, si);
ConfigureSmileyButton(dat);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_SETBKGNDCOLOR, 0, colour);
@@ -2082,7 +2082,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
dat->wStatus = si->wStatus;
if (lstrlen(szNick) > 0) {
- if (M->GetByte("cuttitle", 0))
+ if (M.GetByte("cuttitle", 0))
CutContactName(szNick, dat->newtitle, SIZEOF(dat->newtitle));
else {
lstrcpyn(dat->newtitle, szNick, SIZEOF(dat->newtitle));
@@ -2493,7 +2493,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
goto LABEL_SHOWWINDOW;
case SESSION_INITDONE:
- if (M->GetByte("Chat", "PopupOnJoin", 0) != 0)
+ if (M.GetByte("Chat", "PopupOnJoin", 0) != 0)
return TRUE;
// fall through
case WINDOW_VISIBLE:
@@ -2564,7 +2564,7 @@ LABEL_SHOWWINDOW:
dat->Panel->setHeight(pt.y + 2);
dat->panelWidth = -1;
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
- if (M->isAero())
+ if (M.isAero())
InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
SendMessage(hwndDlg, WM_SIZE, DM_SPLITTERMOVED, 0);
break;
@@ -2787,7 +2787,7 @@ LABEL_SHOWWINDOW:
if ((uID > 800 && uID < 1400) || uID == CP_UTF8 || uID == 20866) {
dat->codePage = uID;
- M->WriteDword(dat->hContact, SRMSGMOD_T, "ANSIcodepage", dat->codePage);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "ANSIcodepage", dat->codePage);
}
else if (uID == 500) {
dat->codePage = CP_ACP;
@@ -3233,13 +3233,13 @@ LABEL_SHOWWINDOW:
SendDlgItemMessage(hwndDlg, IDC_FILTER, BUTTONSETOVERLAYICON,
(LPARAM)(si->bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
- if (si->bFilterEnabled && M->GetByte("Chat", "RightClickFilter", 0) == 0) {
+ if (si->bFilterEnabled && M.GetByte("Chat", "RightClickFilter", 0) == 0) {
SendMessage(hwndDlg, GC_SHOWFILTERMENU, 0, 0);
break;
}
SendMessage(hwndDlg, GC_REDRAWLOG, 0, 0);
SendMessage(hwndDlg, GC_UPDATETITLE, 0, 0);
- M->WriteByte(si->hContact, "Chat", "FilterEnabled", (BYTE)si->bFilterEnabled);
+ db_set_b(si->hContact, "Chat", "FilterEnabled", (BYTE)si->bFilterEnabled);
break;
case IDC_BKGCOLOR: {
@@ -3252,7 +3252,7 @@ LABEL_SHOWWINDOW:
break;
if (IsDlgButtonChecked(hwndDlg, IDC_BKGCOLOR)) {
- if (M->GetByte("Chat", "RightClickFilter", 0) == 0)
+ if (M.GetByte("Chat", "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_BKGCOLOR);
else if (si->bBGSet) {
cf.dwMask = CFM_BACKCOLOR;
@@ -3261,7 +3261,7 @@ LABEL_SHOWWINDOW:
}
} else {
cf.dwMask = CFM_BACKCOLOR;
- cf.crBackColor = (COLORREF)M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
+ cf.crBackColor = (COLORREF)M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
}
}
@@ -3276,7 +3276,7 @@ LABEL_SHOWWINDOW:
break;
if (IsDlgButtonChecked(hwndDlg, IDC_COLOR)) {
- if (M->GetByte("Chat", "RightClickFilter", 0) == 0)
+ if (M.GetByte("Chat", "RightClickFilter", 0) == 0)
SendMessage(hwndDlg, GC_SHOWCOLORCHOOSER, 0, (LPARAM)IDC_COLOR);
else if (si->bFGSet) {
cf.dwMask = CFM_COLOR;
@@ -3335,7 +3335,7 @@ LABEL_SHOWWINDOW:
UINT item_ids[3] = {ID_EXTBKUSERLIST, ID_EXTBKHISTORY, ID_EXTBKINPUTAREA};
UINT ctl_ids[3] = {IDC_LIST, IDC_CHAT_LOG, IDC_CHAT_MESSAGE};
int i;
- bool fAero = M->isAero();
+ bool fAero = M.isAero();
bool fInfoPanel = dat->Panel->isActive();
HANDLE hbp = 0;
HDC hdcMem = 0;
@@ -3374,7 +3374,7 @@ LABEL_SHOWWINDOW:
else {
CSkin::FillBack(hdcMem, &rcClient);
- if (M->isAero()) {
+ if (M.isAero()) {
LONG temp = rcClient.bottom;
rcClient.bottom = dat->Panel->isActive() ? dat->Panel->getHeight() + 5 : 5;
FillRect(hdcMem, &rcClient, (HBRUSH)GetStockObject(BLACK_BRUSH));
@@ -3447,7 +3447,7 @@ LABEL_SHOWWINDOW:
char *szKey = "TAB_ContainersW";
_snprintf(szIndex, 8, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
+ if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -3490,7 +3490,7 @@ LABEL_SHOWWINDOW:
pNewContainer = FindContainerByName(szNewName);
if (pNewContainer == NULL)
pNewContainer = CreateContainer(szNewName, FALSE, dat->hContact);
- M->WriteTString(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
+ db_set_ts(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_DOCREATETAB_CHAT, (WPARAM)pNewContainer, (LPARAM)hwndDlg);
if (iOldItems > 1) // there were more than 1 tab, container is still valid
SendMessage(dat->pContainer->hwndActive, WM_SIZE, 0, 0);
@@ -3763,7 +3763,7 @@ LABEL_SHOWWINDOW:
dat->pWnd = 0;
}
//MAD
- M->RemoveWindow(hwndDlg);
+ M.RemoveWindow(hwndDlg);
TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CLOSE, 0);
break;
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index d93afc5fbd..3dc6d73fe4 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -80,8 +80,8 @@ void CContactCache::initPhaseTwo()
m_Valid = (m_szProto != 0 && m_szAccount != 0) ? true : false;
if (m_Valid) {
- m_isMeta = (PluginConfig.bMetaEnabled && !strcmp(m_szProto, PluginConfig.szMetaName)) ? true : false;
- m_isSubcontact = (M->GetByte(m_hContact, PluginConfig.szMetaName, "IsSubcontact", 0) ? true : false);
+ m_isMeta = PluginConfig.bMetaEnabled && !strcmp(m_szProto, PluginConfig.szMetaName);
+ m_isSubcontact = db_get_b(m_hContact, PluginConfig.szMetaName, "IsSubcontact", 0) != 0;
if (m_isMeta)
updateMeta(true);
updateState();
@@ -397,7 +397,7 @@ void CContactCache::inputHistoryEvent(WPARAM wParam)
*/
void CContactCache::allocHistory()
{
- m_iHistorySize = M->GetByte("historysize", 15);
+ m_iHistorySize = M.GetByte("historysize", 15);
if (m_iHistorySize < 10)
m_iHistorySize = 10;
m_history = (TInputHistory *)malloc(sizeof(TInputHistory) * (m_iHistorySize + 1));
@@ -458,8 +458,8 @@ void CContactCache::deletedHandler()
*/
void CContactCache::updateFavorite()
{
- m_isFavorite = M->GetByte(m_hContact, SRMSGMOD_T, "isFavorite", 0) ? true : false;
- m_isRecent = M->GetDword(m_hContact, "isRecent", 0) ? true : false;
+ m_isFavorite = db_get_b(m_hContact, SRMSGMOD_T, "isFavorite", 0) != 0;
+ m_isRecent = M.GetDword(m_hContact, "isRecent", 0) ? true : false;
}
/**
@@ -480,7 +480,7 @@ void CContactCache::updateStatusMsg(const char *szKey)
if (m_szStatusMsg)
mir_free(m_szStatusMsg);
m_szStatusMsg = 0;
- res = M->GetTString(m_hContact, "CList", "StatusMsg", &dbv);
+ res = db_get_ts(m_hContact, "CList", "StatusMsg", &dbv);
if (res == 0) {
m_szStatusMsg = (lstrlen(dbv.ptszVal) > 0 ? getNormalizedStatusMsg(dbv.ptszVal) : 0);
db_free(&dbv);
@@ -490,7 +490,7 @@ void CContactCache::updateStatusMsg(const char *szKey)
if (m_ListeningInfo)
mir_free(m_ListeningInfo);
m_ListeningInfo = 0;
- res = M->GetTString(m_hContact, m_szProto, "ListeningTo", &dbv);
+ res = db_get_ts(m_hContact, m_szProto, "ListeningTo", &dbv);
if (res == 0) {
m_ListeningInfo = (lstrlen(dbv.ptszVal) > 0 ? mir_tstrdup(dbv.ptszVal) : 0);
db_free(&dbv);
@@ -500,13 +500,13 @@ void CContactCache::updateStatusMsg(const char *szKey)
if (m_xStatusMsg)
mir_free(m_xStatusMsg);
m_xStatusMsg = 0;
- res = M->GetTString(m_hContact, m_szProto, "XStatusMsg", &dbv);
+ res = db_get_ts(m_hContact, m_szProto, "XStatusMsg", &dbv);
if (res == 0) {
m_xStatusMsg = (lstrlen(dbv.ptszVal) > 0 ? mir_tstrdup(dbv.ptszVal) : 0);
db_free(&dbv);
}
}
- m_xStatus = M->GetByte(m_hContact, m_szProto, "XStatusId", 0);
+ m_xStatus = db_get_b(m_hContact, m_szProto, "XStatusId", 0);
}
/**
@@ -621,7 +621,7 @@ int CContactCache::getMaxMessageLength()
m_nMax = CallProtoService(szProto, PS_GETCAPS, PFLAG_MAXLENOFMESSAGE, reinterpret_cast<LPARAM>(hContact));
if (m_nMax) {
- if (M->GetByte("autosplit", 0)) {
+ if (M.GetByte("autosplit", 0)) {
if (m_hwnd)
::SendDlgItemMessage(m_hwnd, IDC_MESSAGE, EM_EXLIMITTEXT, 0, 20000);
}
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 931ac22915..907bc53c3e 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -60,7 +60,7 @@ static int ServiceParamsOK(ButtonItem *item, WPARAM *wParam, LPARAM *lParam, HAN
void TSAPI SetAeroMargins(TContainerData *pContainer)
{
- if ( !M->isAero() || !pContainer || CSkin::m_skinEnabled) {
+ if ( !M.isAero() || !pContainer || CSkin::m_skinEnabled) {
pContainer->MenuBar->setAero(false);
return;
}
@@ -146,26 +146,26 @@ TContainerData* TSAPI CreateContainer(const TCHAR *name, int iTemp, HANDLE hCont
_tcsncpy(pContainer->szName, name, CONTAINER_NAMELEN + 1);
AppendToContainerList(pContainer);
- if (M->GetByte("limittabs", 0) && !_tcscmp(name, _T("default")))
+ if (M.GetByte("limittabs", 0) && !_tcscmp(name, _T("default")))
iTemp |= CNT_CREATEFLAG_CLONED;
/*
* save container name to the db
*/
int i = 0;
- if (!M->GetByte("singlewinmode", 0)) {
+ if (!M.GetByte("singlewinmode", 0)) {
do {
char szCounter[10];
_snprintf(szCounter, 8, "%d", i);
DBVARIANT dbv;
- if (M->GetTString(NULL, szKey, szCounter, &dbv)) {
+ if (db_get_ts(NULL, szKey, szCounter, &dbv)) {
if (iFirstFree != -1) {
pContainer->iContainerIndex = iFirstFree;
_snprintf(szCounter, 8, "%d", iFirstFree);
}
else pContainer->iContainerIndex = i;
- M->WriteTString(NULL, szKey, szCounter, name);
+ db_set_ts(NULL, szKey, szCounter, name);
BuildContainerMenu();
break;
}
@@ -572,12 +572,12 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
int i = 0;
ButtonItem *pbItem;
HWND hwndButton = 0;
- bool fAero = M->isAero();
- BOOL isFlat = M->GetByte("tbflat", 1);
- BOOL isThemed = !M->GetByte("nlflat", 0);
+ bool fAero = M.isAero();
+ BOOL isFlat = M.GetByte("tbflat", 1);
+ BOOL isThemed = !M.GetByte("nlflat", 0);
fHaveTipper = ServiceExists("mToolTip/ShowTip");
- fForceOverlayIcons = M->GetByte("forceTaskBarStatusOverlays", 0) ? true : false;
+ fForceOverlayIcons = M.GetByte("forceTaskBarStatusOverlays", 0) ? true : false;
pContainer = (TContainerData*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR) pContainer);
@@ -650,8 +650,8 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
ws = GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_EXSTYLE);
SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_EXSTYLE, ws | WS_EX_CONTROLPARENT);
- LONG x_pad = M->GetByte("x-pad", 3) + (pContainer->dwFlagsEx & TCF_CLOSEBUTTON ? 7 : 0);
- LONG y_pad = M->GetByte("y-pad", 3) + ((pContainer->dwFlags & CNT_TABSBOTTOM) ? 1 : 0);
+ LONG x_pad = M.GetByte("x-pad", 3) + (pContainer->dwFlagsEx & TCF_CLOSEBUTTON ? 7 : 0);
+ LONG y_pad = M.GetByte("y-pad", 3) + ((pContainer->dwFlags & CNT_TABSBOTTOM) ? 1 : 0);
if (pContainer->dwFlagsEx & TCF_FLAT)
y_pad += 1; //(pContainer->dwFlags & CNT_TABSBOTTOM ? 1 : 2);
@@ -669,7 +669,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
/*
* tab tooltips...
*/
- if (!fHaveTipper || M->GetByte("d_tooltips", 0) == 0) {
+ if (!fHaveTipper || M.GetByte("d_tooltips", 0) == 0) {
pContainer->hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT, hwndDlg, NULL, g_hInst, (LPVOID) NULL);
@@ -705,7 +705,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
/*
* prevent ugly back background being visible while tabbed clients are created
*/
- if (M->isAero()) {
+ if (M.isAero()) {
MARGINS m = {-1};
CMimAPI::m_pfnDwmExtendFrameIntoClientArea(hwndDlg, &m);
}
@@ -833,7 +833,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
}
pContainer->SideBar->scrollIntoView();
- if (!M->isAero()) { // aero mode uses buffered paint, no forced redraw needed
+ if (!M.isAero()) { // aero mode uses buffered paint, no forced redraw needed
RedrawWindow(hwndTab, NULL, NULL, RDW_INVALIDATE | (pContainer->bSizingLoop ? RDW_ERASE : 0));
RedrawWindow(hwndDlg, NULL, NULL, (bSkinned ? RDW_FRAME : 0) | RDW_INVALIDATE | ((pContainer->bSizingLoop || wParam == SIZE_RESTORED ) ? RDW_ERASE : 0));
}
@@ -992,7 +992,7 @@ panel_found:
char *szKey = "TAB_ContainersW";
mir_snprintf(szIndex, 8, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
+ if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
SendMessage((HWND)item.lParam, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -1010,7 +1010,7 @@ panel_found:
CloseOtherTabs(hwndTab, *dat);
break;
case ID_TABMENU_SAVETABPOSITION:
- M->WriteDword(dat->hContact, SRMSGMOD_T, "tabindex", dat->iTabID * 100);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "tabindex", dat->iTabID * 100);
break;
case ID_TABMENU_CLEARSAVEDTABPOSITION:
db_unset(dat->hContact, SRMSGMOD_T, "tabindex");
@@ -1262,7 +1262,7 @@ panel_found:
dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
}
else {
- HWND hwnd = M->FindWindow((HANDLE)wParam);
+ HWND hwnd = M.FindWindow((HANDLE)wParam);
if (hwnd == 0) {
SESSION_INFO *si = SM_FindSessionByHCONTACT((HANDLE)wParam);
if (si) {
@@ -1517,7 +1517,7 @@ panel_found:
break;
case WM_PAINT:
- if (bSkinned || M->isAero()) {
+ if (bSkinned || M.isAero()) {
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hwndDlg, &ps);
EndPaint(hwndDlg, &ps);
@@ -1534,7 +1534,7 @@ panel_found:
RECT rc;
GetClientRect(hwndDlg, &rc);
- if (M->isAero()) {
+ if (M.isAero()) {
HDC hdcMem;
HANDLE hbp = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rc, BPBF_TOPDOWNDIB, 0, &hdcMem);
FillRect(hdcMem, &rc, CSkin::m_BrushBack);
@@ -1585,21 +1585,21 @@ panel_found:
pContainer->szRelThemeFile[0] = pContainer->szAbsThemeFile[0] = 0;
mir_snprintf(szCname, 40, "%s_theme", szSetting);
- if (!M->GetTString(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
+ if (!db_get_ts(pContainer->hContactFrom, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
else {
Utils::ReadPrivateContainerSettings(pContainer);
if (szThemeName == NULL) {
mir_snprintf(szCname, 40, "%s%d_theme", szSetting, pContainer->iContainerIndex);
- if (!M->GetTString(NULL, SRMSGMOD_T, szCname, &dbv))
+ if (!db_get_ts(NULL, SRMSGMOD_T, szCname, &dbv))
szThemeName = dbv.ptszVal;
}
}
Utils::SettingsToContainer(pContainer);
if (szThemeName != NULL) {
- M->pathToAbsolute(szThemeName, pContainer->szAbsThemeFile);
+ M.pathToAbsolute(szThemeName, pContainer->szAbsThemeFile);
mir_sntprintf(pContainer->szRelThemeFile, MAX_PATH, _T("%s"), szThemeName);
db_free(&dbv);
}
@@ -1630,7 +1630,7 @@ panel_found:
HANDLE hContact = 0;
int i = 0;
UINT sBarHeight;
- bool fAero = M->isAero();
+ bool fAero = M.isAero();
ws = wsold = GetWindowLongPtr(hwndDlg, GWL_STYLE);
if (!CSkin::m_frameSkins) {
@@ -1641,12 +1641,12 @@ panel_found:
SetWindowLongPtr(hwndDlg, GWL_STYLE, ws);
- pContainer->tBorder = M->GetByte((bSkinned ? "S_tborder" : "tborder"), 2);
- pContainer->tBorder_outer_left = g_ButtonSet.left + M->GetByte((bSkinned ? "S_tborder_outer_left" : "tborder_outer_left"), 2);
- pContainer->tBorder_outer_right = g_ButtonSet.right + M->GetByte((bSkinned ? "S_tborder_outer_right" : "tborder_outer_right"), 2);
- pContainer->tBorder_outer_top = g_ButtonSet.top + M->GetByte((bSkinned ? "S_tborder_outer_top" : "tborder_outer_top"), 2);
- pContainer->tBorder_outer_bottom = g_ButtonSet.bottom + M->GetByte((bSkinned ? "S_tborder_outer_bottom" : "tborder_outer_bottom"), 2);
- sBarHeight = (UINT)M->GetByte((bSkinned ? "S_sbarheight" : "sbarheight"), 0);
+ pContainer->tBorder = M.GetByte((bSkinned ? "S_tborder" : "tborder"), 2);
+ pContainer->tBorder_outer_left = g_ButtonSet.left + M.GetByte((bSkinned ? "S_tborder_outer_left" : "tborder_outer_left"), 2);
+ pContainer->tBorder_outer_right = g_ButtonSet.right + M.GetByte((bSkinned ? "S_tborder_outer_right" : "tborder_outer_right"), 2);
+ pContainer->tBorder_outer_top = g_ButtonSet.top + M.GetByte((bSkinned ? "S_tborder_outer_top" : "tborder_outer_top"), 2);
+ pContainer->tBorder_outer_bottom = g_ButtonSet.bottom + M.GetByte((bSkinned ? "S_tborder_outer_bottom" : "tborder_outer_bottom"), 2);
+ sBarHeight = (UINT)M.GetByte((bSkinned ? "S_sbarheight" : "sbarheight"), 0);
if (LOBYTE(LOWORD(GetVersion())) >= 5 && CMimAPI::m_pSetLayeredWindowAttributes != NULL) {
BOOL fTransAllowed = !bSkinned || PluginConfig.m_WinVerMajor >= 6;
@@ -1998,29 +1998,29 @@ panel_found:
item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, TabCtrl_GetCurSel(hwndTab), &item);
SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
- M->WriteByte(hContact, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd==SW_SHOWMAXIMIZED)?1:0));
+ db_set_b(hContact, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd==SW_SHOWMAXIMIZED)?1:0));
for (i=0; i < TabCtrl_GetItemCount(hwndTab); i++) {
if (TabCtrl_GetItem(hwndTab, i, &item)) {
SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
- M->WriteDword(hContact, SRMSGMOD_T, "splitx", wp.rcNormalPosition.left);
- M->WriteDword(hContact, SRMSGMOD_T, "splity", wp.rcNormalPosition.top);
- M->WriteDword(hContact, SRMSGMOD_T, "splitwidth", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- M->WriteDword(hContact, SRMSGMOD_T, "splitheight", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
+ db_set_dw(hContact, SRMSGMOD_T, "splitx", wp.rcNormalPosition.left);
+ db_set_dw(hContact, SRMSGMOD_T, "splity", wp.rcNormalPosition.top);
+ db_set_dw(hContact, SRMSGMOD_T, "splitwidth", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
+ db_set_dw(hContact, SRMSGMOD_T, "splitheight", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
}
}
}
else {
_snprintf(szCName, 40, "%s%dx", szSetting, pContainer->iContainerIndex);
- M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.left);
+ db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.left);
_snprintf(szCName, 40, "%s%dy", szSetting, pContainer->iContainerIndex);
- M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.top);
+ db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.top);
_snprintf(szCName, 40, "%s%dwidth", szSetting, pContainer->iContainerIndex);
- M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
+ db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
_snprintf(szCName, 40, "%s%dheight", szSetting, pContainer->iContainerIndex);
- M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
+ db_set_dw(0, SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
- M->WriteByte(SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd==SW_SHOWMAXIMIZED)?1:0));
+ db_set_b(0, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd==SW_SHOWMAXIMIZED)?1:0));
}
}
}
@@ -2041,8 +2041,8 @@ panel_found:
mir_snprintf(szCName, 40, "%s_theme", szSetting);
if (lstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
- M->pathToRelative(pContainer->szRelThemeFile, pContainer->szAbsThemeFile);
- M->WriteTString(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
+ M.pathToRelative(pContainer->szRelThemeFile, pContainer->szAbsThemeFile);
+ db_set_ts(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
pContainer->fPrivateThemeChanged = FALSE;
}
}
@@ -2232,7 +2232,7 @@ TContainerData* TSAPI FindContainerByName(const TCHAR *name)
if (name == NULL || lstrlen(name) == 0)
return 0;
- if (M->GetByte("singlewinmode", 0)) // single window mode - always return 0 and force a new container
+ if (M.GetByte("singlewinmode", 0)) // single window mode - always return 0 and force a new container
return NULL;
for (TContainerData *p = pFirstContainer; p; p = p->pNext)
@@ -2340,13 +2340,13 @@ void TSAPI AdjustTabClientRect(TContainerData *pContainer, RECT *rc)
int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLen)
{
DBVARIANT dbv;
- if (M->GetByte("singlewinmode", 0)) { // single window mode using cloned (temporary) containers
+ if (M.GetByte("singlewinmode", 0)) { // single window mode using cloned (temporary) containers
_tcsncpy(szName, _T("Message Session"), iNameLen);
return 0;
}
- if (M->GetByte("useclistgroups", 0)) { // use clist group names for containers...
- if (M->GetTString(hContact, "CList", "Group", &dbv)) {
+ if (M.GetByte("useclistgroups", 0)) { // use clist group names for containers...
+ if (db_get_ts(hContact, "CList", "Group", &dbv)) {
_tcsncpy(szName, _T("default"), iNameLen);
return 0;
}
@@ -2360,7 +2360,7 @@ int TSAPI GetContainerNameForContact(HANDLE hContact, TCHAR *szName, int iNameLe
}
}
- if (M->GetTString(hContact, SRMSGMOD_T, "containerW", &dbv)) {
+ if (db_get_ts(hContact, SRMSGMOD_T, "containerW", &dbv)) {
_tcsncpy(szName, _T("default"), iNameLen);
return 0;
}
@@ -2383,14 +2383,14 @@ void TSAPI DeleteContainer(int iIndex)
_snprintf(szIndex, 8, "%d", iIndex);
DBVARIANT dbv;
- if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
+ if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
TCHAR *wszContainerName = dbv.ptszVal;
- M->WriteTString(NULL, szKey, szIndex, _T("**free**"));
+ db_set_ts(NULL, szKey, szIndex, _T("**free**"));
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
DBVARIANT dbv_c;
- if (!M->GetTString(hContact, SRMSGMOD_T, szSubKey, &dbv_c)) {
+ if (!db_get_ts(hContact, SRMSGMOD_T, szSubKey, &dbv_c)) {
TCHAR *wszString = dbv_c.ptszVal;
if (_tcscmp(wszString, wszContainerName) && lstrlen(wszString) == lstrlen(wszContainerName))
db_unset(hContact, SRMSGMOD_T, "containerW");
@@ -2423,18 +2423,18 @@ void TSAPI RenameContainer(int iIndex, const TCHAR *szNew)
char szIndex[10];
_snprintf(szIndex, 8, "%d", iIndex);
- if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
+ if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
if (szNew != NULL)
if (lstrlen(szNew) != 0)
- M->WriteTString(NULL, szKey, szIndex, szNew);
+ db_set_ts(NULL, szKey, szIndex, szNew);
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
DBVARIANT dbv_c;
- if (!M->GetTString(hContact, SRMSGMOD_T, szSubKey, &dbv_c)) {
+ if (!db_get_ts(hContact, SRMSGMOD_T, szSubKey, &dbv_c)) {
if (!_tcscmp(dbv.ptszVal, dbv_c.ptszVal) && lstrlen(dbv_c.ptszVal) == lstrlen(dbv.ptszVal)) {
if (szNew != NULL) {
if (lstrlen(szNew) != 0)
- M->WriteTString(hContact, SRMSGMOD_T, szSubKey, szNew);
+ db_set_ts(hContact, SRMSGMOD_T, szSubKey, szNew);
}
}
db_free(&dbv_c);
@@ -2461,13 +2461,13 @@ HMENU TSAPI BuildContainerMenu()
}
// no container attach menu, if we are using the "clist group mode"
- if (M->GetByte("useclistgroups", 0) || M->GetByte("singlewinmode", 0))
+ if (M.GetByte("useclistgroups", 0) || M.GetByte("singlewinmode", 0))
return NULL;
hMenu = CreateMenu();
do {
_snprintf(szCounter, 8, "%d", i);
- if (M->GetTString(NULL, szKey, szCounter, &dbv))
+ if (db_get_ts(NULL, szKey, szCounter, &dbv))
break;
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
@@ -2516,7 +2516,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg)
iDefaultProtoByNum = (int)CallService(MS_MC_GETDEFAULTCONTACTNUM, (WPARAM)dat->hContact, 0);
hContactMostOnline = (HANDLE)CallService(MS_MC_GETMOSTONLINECONTACT, (WPARAM)dat->hContact, 0);
szProtoMostOnline = GetContactProto(hContactMostOnline);
- isForced = M->GetDword(dat->hContact, "tabSRMM_forced", -1);
+ isForced = M.GetDword(dat->hContact, "tabSRMM_forced", -1);
for (i=0; i < iNumProtos; i++) {
mir_snprintf(szTemp, sizeof(szTemp), "Protocol%d", i);
@@ -2528,7 +2528,7 @@ HMENU TSAPI BuildMCProtocolMenu(HWND hwndDlg)
if (acc && acc->tszAccountName) {
mir_snprintf(szTemp, sizeof(szTemp), "Handle%d", i);
- if ((handle = (HANDLE)M->GetDword(dat->hContact, PluginConfig.szMetaName, szTemp, 0)) != 0) {
+ if ((handle = (HANDLE)db_get_dw(dat->hContact, PluginConfig.szMetaName, szTemp, 0)) != 0) {
nick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)handle, GCDNF_TCHAR);
mir_snprintf(szTemp, sizeof(szTemp), "Status%d", i);
wStatus = (WORD)db_get_w(dat->hContact, PluginConfig.szMetaName, szTemp, 0);
@@ -2575,8 +2575,8 @@ void TSAPI FlashContainer(TContainerData *pContainer, int iMode, int iCount) {
if (pContainer->dwFlags & CNT_FLASHALWAYS)
fwi.dwFlags |= FLASHW_TIMER;
else
- fwi.uCount = (iCount == 0) ? M->GetByte("nrflash", 4) : iCount;
- fwi.dwTimeout = M->GetDword("flashinterval", 1000);
+ fwi.uCount = (iCount == 0) ? M.GetByte("nrflash", 4) : iCount;
+ fwi.dwTimeout = M.GetDword("flashinterval", 1000);
}
else fwi.dwFlags = FLASHW_STOP;
@@ -2600,9 +2600,9 @@ void TSAPI ReflashContainer(TContainerData *pContainer)
FlashContainer(pContainer, 1, 0);
else {
// recalc the remaining flashes
- DWORD dwInterval = M->GetDword("flashinterval", 1000);
+ DWORD dwInterval = M.GetDword("flashinterval", 1000);
int iFlashesElapsed = (GetTickCount() - dwStartTime) / dwInterval;
- DWORD dwFlashesDesired = M->GetByte("nrflash", 4);
+ DWORD dwFlashesDesired = M.GetByte("nrflash", 4);
if (iFlashesElapsed < (int)dwFlashesDesired)
FlashContainer(pContainer, 1, dwFlashesDesired - iFlashesElapsed);
else {
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp
index 38da7faf18..0f4048bf92 100644
--- a/plugins/TabSRMM/src/containeroptions.cpp
+++ b/plugins/TabSRMM/src/containeroptions.cpp
@@ -302,10 +302,10 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
wp.length = sizeof(wp);
if (GetWindowPlacement(pContainer->hwnd, &wp)) {
- M->WriteDword(SRMSGMOD_T, "splitx", wp.rcNormalPosition.left);
- M->WriteDword(SRMSGMOD_T, "splity", wp.rcNormalPosition.top);
- M->WriteDword(SRMSGMOD_T, "splitwidth", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- M->WriteDword(SRMSGMOD_T, "splitheight", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
+ db_set_dw(0, SRMSGMOD_T, "splitx", wp.rcNormalPosition.left);
+ db_set_dw(0, SRMSGMOD_T, "splity", wp.rcNormalPosition.top);
+ db_set_dw(0, SRMSGMOD_T, "splitwidth", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
+ db_set_dw(0, SRMSGMOD_T, "splitheight", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
}
break;
}
@@ -351,7 +351,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
GetDlgItemText(hwndDlg, IDC_THEME, szFilename, MAX_PATH);
szFilename[MAX_PATH - 1] = 0;
- M->pathToAbsolute(szFilename, szFinalThemeFile);
+ M.pathToAbsolute(szFilename, szFinalThemeFile);
if (_tcscmp(szFilename, pContainer->szRelThemeFile))
pContainer->fPrivateThemeChanged = TRUE;
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index 4c996bb5b4..9f32e0fc4b 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -78,7 +78,7 @@ CMenuBar::CMenuBar(HWND hwndParent, const TContainerData *pContainer)
m_activeMenu = 0;
m_activeID = 0;
- m_isAero = M->isAero();
+ m_isAero = M.isAero();
m_mustAutoHide = false;
m_activeSubMenu = 0;
m_fTracking = false;
@@ -241,14 +241,14 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
m_rcItem.bottom -= 4;
m_hbmDraw = CSkin::CreateAeroCompatibleBitmap(m_rcItem, nmtb->nmcd.hdc);
m_hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(m_hdcDraw, m_hbmDraw));
- m_hTheme = M->isAero() || M->isVSThemed() ? CMimAPI::m_pfnOpenThemeData(m_hwndToolbar, L"REBAR") : 0;
+ m_hTheme = M.isAero() || M.isVSThemed() ? CMimAPI::m_pfnOpenThemeData(m_hwndToolbar, L"REBAR") : 0;
m_hOldFont = reinterpret_cast<HFONT>(::SelectObject(m_hdcDraw, reinterpret_cast<HFONT>(::GetStockObject(DEFAULT_GUI_FONT))));
if (m_isAero) {
nm->rc.bottom--;
CSkin::ApplyAeroEffect(m_hdcDraw, &m_rcItem, CSkin::AERO_EFFECT_AREA_MENUBAR);
nm->rc.bottom++;
}
- else if ((PluginConfig.m_fillColor || M->isVSThemed()) && !CSkin::m_skinEnabled) {
+ else if ((PluginConfig.m_fillColor || M.isVSThemed()) && !CSkin::m_skinEnabled) {
if (PluginConfig.m_fillColor && PluginConfig.m_tbBackgroundHigh && PluginConfig.m_tbBackgroundLow) {
::DrawAlpha(m_hdcDraw, &m_rcItem, PluginConfig.m_tbBackgroundHigh, 100, PluginConfig.m_tbBackgroundLow, 0,
GRADIENT_TB, 0, 0, 0);
@@ -257,8 +257,8 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
m_rcItem.bottom--;
if (PluginConfig.m_fillColor)
CSkin::FillBack(m_hdcDraw, &m_rcItem);
- else if (M->isVSThemed())
- M->m_pfnDrawThemeBackground(m_hTheme, m_hdcDraw, 6, 1, &m_rcItem, &m_rcItem);
+ else if (M.isVSThemed())
+ M.m_pfnDrawThemeBackground(m_hTheme, m_hdcDraw, 6, 1, &m_rcItem, &m_rcItem);
else
FillRect(m_hdcDraw, &m_rcItem, GetSysColorBrush(COLOR_3DFACE));
}
@@ -769,7 +769,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
CSkinItem * item = &SkinItems[ID_EXTBKSTATUSBARPANEL];
COLORREF clr = 0;
- BOOL fAero = M->isAero();
+ BOOL fAero = M.isAero();
HANDLE hTheme = fAero ? CMimAPI::m_pfnOpenThemeData(hWnd, L"ButtonStyle") : 0;
TWindowData* dat = 0;
@@ -1016,7 +1016,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
pContainer->dwFlags & CNT_NOSOUND ? TranslateT("disabled") : TranslateT("enabled"));
else if (sid->dwId == MSG_ICON_UTN && dat && dat->bType == SESSIONTYPE_IM) {
- int mtnStatus = (int)M->GetByte(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M->GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
+ int mtnStatus = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
mir_sntprintf(wBuf, SIZEOF(wBuf), TranslateT("Sending typing notifications is %s."),
mtnStatus ? TranslateT("enabled") : TranslateT("disabled"));
}
@@ -1035,7 +1035,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
if (dat && PtInRect(&rc, pt)) {
int iLength = 0;
GETTEXTLENGTHEX gtxl = {0};
- int iQueued = M->GetDword(dat->hContact, "SendLater", "count", 0);
+ int iQueued = db_get_dw(dat->hContact, "SendLater", "count", 0);
gtxl.codepage = CP_UTF8;
gtxl.flags = GTL_DEFAULT | GTL_PRECISE | GTL_NUMBYTES;
iLength = SendDlgItemMessage(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE, EM_GETTEXTLENGTHEX, (WPARAM)& gtxl, 0);
@@ -1058,7 +1058,7 @@ LONG_PTR CALLBACK StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM wParam, LPAR
DBVARIANT dbv={0};
if (dat->bType == SESSIONTYPE_CHAT)
- M->GetTString(dat->hContact,dat->szProto,"Topic",&dbv);
+ db_get_ts(dat->hContact,dat->szProto,"Topic",&dbv);
tooltip_active = TRUE;
CallService("mToolTip/ShowTipW", (WPARAM)dbv.ptszVal, (LPARAM)&ti);
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index 8e81baebc5..4b8f8dff85 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -85,78 +85,78 @@ static void PU_CleanUp()
static void CheckForRemoveMask()
{
- if (!M->GetByte(MODULE, "firsttime", 0) && (nen_options.maskActL & MASK_REMOVE || nen_options.maskActR & MASK_REMOVE || nen_options.maskActTE & MASK_REMOVE)) {
+ if (!M.GetByte(MODULE, "firsttime", 0) && (nen_options.maskActL & MASK_REMOVE || nen_options.maskActR & MASK_REMOVE || nen_options.maskActTE & MASK_REMOVE)) {
MessageBoxA(0, Translate("One of your popup actions is set to DISMISS EVENT.\nNote that this options may have unwanted side effects as it REMOVES the event from the unread queue.\nThis may lead to events not showing up as \"new\". If you don't want this behaviour, please review the Event Notifications settings page."), "tabSRMM Warning Message", MB_OK | MB_ICONSTOP);
- M->WriteByte(MODULE, "firsttime", 1);
+ db_set_b(0, MODULE, "firsttime", 1);
}
}
int TSAPI NEN_ReadOptions(NEN_OPTIONS *options)
{
- options->bPreview = (BOOL)M->GetByte(MODULE, OPT_PREVIEW, TRUE);
- options->bDefaultColorMsg = (BOOL)M->GetByte(MODULE, OPT_COLDEFAULT_MESSAGE, TRUE);
- options->bDefaultColorOthers = (BOOL)M->GetByte(MODULE, OPT_COLDEFAULT_OTHERS, TRUE);
- options->bDefaultColorErr = (BOOL)M->GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE);
- options->colBackMsg = (COLORREF)M->GetDword(MODULE, OPT_COLBACK_MESSAGE, DEFAULT_COLBACK);
- options->colTextMsg = (COLORREF)M->GetDword(MODULE, OPT_COLTEXT_MESSAGE, DEFAULT_COLTEXT);
- options->colBackOthers = (COLORREF)M->GetDword(MODULE, OPT_COLBACK_OTHERS, DEFAULT_COLBACK);
- options->colTextOthers = (COLORREF)M->GetDword(MODULE, OPT_COLTEXT_OTHERS, DEFAULT_COLTEXT);
- options->colBackErr = (COLORREF)M->GetDword(MODULE, OPT_COLBACK_ERR, DEFAULT_COLBACK);
- options->colTextErr = (COLORREF)M->GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT);
- options->maskActL = (UINT)M->GetByte(MODULE, OPT_MASKACTL, DEFAULT_MASKACTL);
- options->maskActR = (UINT)M->GetByte(MODULE, OPT_MASKACTR, DEFAULT_MASKACTR);
- options->maskActTE = (UINT)M->GetByte(MODULE, OPT_MASKACTTE, DEFAULT_MASKACTR) & (MASK_OPEN | MASK_DISMISS);
- options->bMergePopup = (BOOL)M->GetByte(MODULE, OPT_MERGEPOPUP, 0);
- options->iDelayMsg = (int)M->GetDword(MODULE, OPT_DELAY_MESSAGE, (DWORD)DEFAULT_DELAY);
- options->iDelayOthers = (int)M->GetDword(MODULE, OPT_DELAY_OTHERS, (DWORD)DEFAULT_DELAY);
- options->iDelayErr = (int)M->GetDword(MODULE, OPT_DELAY_ERR, (DWORD)DEFAULT_DELAY);
+ options->bPreview = (BOOL)M.GetByte(MODULE, OPT_PREVIEW, TRUE);
+ options->bDefaultColorMsg = (BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_MESSAGE, TRUE);
+ options->bDefaultColorOthers = (BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_OTHERS, TRUE);
+ options->bDefaultColorErr = (BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE);
+ options->colBackMsg = (COLORREF)M.GetDword(MODULE, OPT_COLBACK_MESSAGE, DEFAULT_COLBACK);
+ options->colTextMsg = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_MESSAGE, DEFAULT_COLTEXT);
+ options->colBackOthers = (COLORREF)M.GetDword(MODULE, OPT_COLBACK_OTHERS, DEFAULT_COLBACK);
+ options->colTextOthers = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_OTHERS, DEFAULT_COLTEXT);
+ options->colBackErr = (COLORREF)M.GetDword(MODULE, OPT_COLBACK_ERR, DEFAULT_COLBACK);
+ options->colTextErr = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT);
+ options->maskActL = (UINT)M.GetByte(MODULE, OPT_MASKACTL, DEFAULT_MASKACTL);
+ options->maskActR = (UINT)M.GetByte(MODULE, OPT_MASKACTR, DEFAULT_MASKACTR);
+ options->maskActTE = (UINT)M.GetByte(MODULE, OPT_MASKACTTE, DEFAULT_MASKACTR) & (MASK_OPEN | MASK_DISMISS);
+ options->bMergePopup = (BOOL)M.GetByte(MODULE, OPT_MERGEPOPUP, 0);
+ options->iDelayMsg = (int)M.GetDword(MODULE, OPT_DELAY_MESSAGE, (DWORD)DEFAULT_DELAY);
+ options->iDelayOthers = (int)M.GetDword(MODULE, OPT_DELAY_OTHERS, (DWORD)DEFAULT_DELAY);
+ options->iDelayErr = (int)M.GetDword(MODULE, OPT_DELAY_ERR, (DWORD)DEFAULT_DELAY);
options->iDelayDefault = (int)DBGetContactSettingRangedWord(NULL, "Popup", "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX);
- options->bShowHeaders = (BYTE)M->GetByte(MODULE, OPT_SHOW_HEADERS, FALSE);
- options->bNoRSS = (BOOL)M->GetByte(MODULE, OPT_NORSS, FALSE);
- options->iDisable = (BYTE)M->GetByte(MODULE, OPT_DISABLE, 0);
- options->iMUCDisable = (BYTE)M->GetByte(MODULE, OPT_MUCDISABLE, 0);
- options->dwStatusMask = (DWORD)M->GetDword(MODULE, "statusmask", (DWORD) - 1);
- options->bTraySupport = (BOOL)M->GetByte(MODULE, "traysupport", 0);
- options->bWindowCheck = (BOOL)M->GetByte(MODULE, OPT_WINDOWCHECK, 0);
- options->bNoRSS = (BOOL)M->GetByte(MODULE, OPT_NORSS, 0);
- options->iLimitPreview = (int)M->GetDword(MODULE, OPT_LIMITPREVIEW, 0);
+ options->bShowHeaders = (BYTE)M.GetByte(MODULE, OPT_SHOW_HEADERS, FALSE);
+ options->bNoRSS = (BOOL)M.GetByte(MODULE, OPT_NORSS, FALSE);
+ options->iDisable = (BYTE)M.GetByte(MODULE, OPT_DISABLE, 0);
+ options->iMUCDisable = (BYTE)M.GetByte(MODULE, OPT_MUCDISABLE, 0);
+ options->dwStatusMask = (DWORD)M.GetDword(MODULE, "statusmask", (DWORD) - 1);
+ options->bTraySupport = (BOOL)M.GetByte(MODULE, "traysupport", 0);
+ options->bWindowCheck = (BOOL)M.GetByte(MODULE, OPT_WINDOWCHECK, 0);
+ options->bNoRSS = (BOOL)M.GetByte(MODULE, OPT_NORSS, 0);
+ options->iLimitPreview = (int)M.GetDword(MODULE, OPT_LIMITPREVIEW, 0);
options->wMaxFavorites = 15;
options->wMaxRecent = 15;
- options->dwRemoveMask = M->GetDword(MODULE, OPT_REMOVEMASK, 0);
- options->bDisableNonMessage = M->GetByte(MODULE, "disablenonmessage", 0);
+ options->dwRemoveMask = M.GetDword(MODULE, OPT_REMOVEMASK, 0);
+ options->bDisableNonMessage = M.GetByte(MODULE, "disablenonmessage", 0);
CheckForRemoveMask();
return 0;
}
int TSAPI NEN_WriteOptions(NEN_OPTIONS *options)
{
- M->WriteByte(MODULE, OPT_PREVIEW, (BYTE)options->bPreview);
- M->WriteByte(MODULE, OPT_COLDEFAULT_MESSAGE, (BYTE)options->bDefaultColorMsg);
- M->WriteByte(MODULE, OPT_COLDEFAULT_OTHERS, (BYTE)options->bDefaultColorOthers);
- M->WriteByte(MODULE, OPT_COLDEFAULT_ERR, (BYTE)options->bDefaultColorErr);
- M->WriteDword(MODULE, OPT_COLBACK_MESSAGE, (DWORD)options->colBackMsg);
- M->WriteDword(MODULE, OPT_COLTEXT_MESSAGE, (DWORD)options->colTextMsg);
- M->WriteDword(MODULE, OPT_COLBACK_OTHERS, (DWORD)options->colBackOthers);
- M->WriteDword(MODULE, OPT_COLTEXT_OTHERS, (DWORD)options->colTextOthers);
- M->WriteDword(MODULE, OPT_COLBACK_ERR, (DWORD)options->colBackErr);
- M->WriteDword(MODULE, OPT_COLTEXT_ERR, (DWORD)options->colTextErr);
- M->WriteByte(MODULE, OPT_MASKACTL, (BYTE)options->maskActL);
- M->WriteByte(MODULE, OPT_MASKACTR, (BYTE)options->maskActR);
- M->WriteByte(MODULE, OPT_MASKACTTE, (BYTE)options->maskActTE);
- M->WriteByte(MODULE, OPT_MERGEPOPUP, (BYTE)options->bMergePopup);
- M->WriteDword(MODULE, OPT_DELAY_MESSAGE, (DWORD)options->iDelayMsg);
- M->WriteDword(MODULE, OPT_DELAY_OTHERS, (DWORD)options->iDelayOthers);
- M->WriteDword(MODULE, OPT_DELAY_ERR, (DWORD)options->iDelayErr);
- M->WriteByte(MODULE, OPT_SHOW_HEADERS, (BYTE)options->bShowHeaders);
- M->WriteByte(MODULE, OPT_DISABLE, (BYTE)options->iDisable);
- M->WriteByte(MODULE, OPT_MUCDISABLE, (BYTE)options->iMUCDisable);
- M->WriteByte(MODULE, "traysupport", (BYTE)options->bTraySupport);
- M->WriteByte(MODULE, OPT_WINDOWCHECK, (BYTE)options->bWindowCheck);
- M->WriteByte(MODULE, OPT_NORSS, (BYTE)options->bNoRSS);
- M->WriteDword(MODULE, OPT_LIMITPREVIEW, options->iLimitPreview);
- M->WriteDword(MODULE, OPT_REMOVEMASK, options->dwRemoveMask);
- M->WriteByte(MODULE, "disablenonmessage", options->bDisableNonMessage);
+ db_set_b(0, MODULE, OPT_PREVIEW, (BYTE)options->bPreview);
+ db_set_b(0, MODULE, OPT_COLDEFAULT_MESSAGE, (BYTE)options->bDefaultColorMsg);
+ db_set_b(0, MODULE, OPT_COLDEFAULT_OTHERS, (BYTE)options->bDefaultColorOthers);
+ db_set_b(0, MODULE, OPT_COLDEFAULT_ERR, (BYTE)options->bDefaultColorErr);
+ db_set_dw(0, MODULE, OPT_COLBACK_MESSAGE, (DWORD)options->colBackMsg);
+ db_set_dw(0, MODULE, OPT_COLTEXT_MESSAGE, (DWORD)options->colTextMsg);
+ db_set_dw(0, MODULE, OPT_COLBACK_OTHERS, (DWORD)options->colBackOthers);
+ db_set_dw(0, MODULE, OPT_COLTEXT_OTHERS, (DWORD)options->colTextOthers);
+ db_set_dw(0, MODULE, OPT_COLBACK_ERR, (DWORD)options->colBackErr);
+ db_set_dw(0, MODULE, OPT_COLTEXT_ERR, (DWORD)options->colTextErr);
+ db_set_b(0, MODULE, OPT_MASKACTL, (BYTE)options->maskActL);
+ db_set_b(0, MODULE, OPT_MASKACTR, (BYTE)options->maskActR);
+ db_set_b(0, MODULE, OPT_MASKACTTE, (BYTE)options->maskActTE);
+ db_set_b(0, MODULE, OPT_MERGEPOPUP, (BYTE)options->bMergePopup);
+ db_set_dw(0, MODULE, OPT_DELAY_MESSAGE, (DWORD)options->iDelayMsg);
+ db_set_dw(0, MODULE, OPT_DELAY_OTHERS, (DWORD)options->iDelayOthers);
+ db_set_dw(0, MODULE, OPT_DELAY_ERR, (DWORD)options->iDelayErr);
+ db_set_b(0, MODULE, OPT_SHOW_HEADERS, (BYTE)options->bShowHeaders);
+ db_set_b(0, MODULE, OPT_DISABLE, (BYTE)options->iDisable);
+ db_set_b(0, MODULE, OPT_MUCDISABLE, (BYTE)options->iMUCDisable);
+ db_set_b(0, MODULE, "traysupport", (BYTE)options->bTraySupport);
+ db_set_b(0, MODULE, OPT_WINDOWCHECK, (BYTE)options->bWindowCheck);
+ db_set_b(0, MODULE, OPT_NORSS, (BYTE)options->bNoRSS);
+ db_set_dw(0, MODULE, OPT_LIMITPREVIEW, options->iLimitPreview);
+ db_set_dw(0, MODULE, OPT_REMOVEMASK, options->dwRemoveMask);
+ db_set_b(0, MODULE, "disablenonmessage", options->bDisableNonMessage);
return 0;
}
@@ -264,7 +264,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
return TRUE;
case DM_STATUSMASKSET:
- M->WriteDword(MODULE, "statusmask", (DWORD)lParam);
+ db_set_dw(0, MODULE, "statusmask", (DWORD)lParam);
options->dwStatusMask = (int)lParam;
break;
@@ -277,7 +277,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
break;
case IDC_POPUPSTATUSMODES:
- hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHOOSESTATUSMODES), hWnd, DlgProcSetupStatusModes, M->GetDword(MODULE, "statusmask", (DWORD) - 1));
+ hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHOOSESTATUSMODES), hWnd, DlgProcSetupStatusModes, M.GetDword(MODULE, "statusmask", (DWORD) - 1));
SendMessage(hwndNew, DM_SETPARENTDIALOG, 0, (LPARAM)hWnd);
break;
@@ -390,13 +390,13 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
}
}
- M->WriteByte("Chat", "PopupStyle", (BYTE)g_Settings.iPopupStyle);
+ db_set_b(0, "Chat", "PopupStyle", (BYTE)g_Settings.iPopupStyle);
db_set_w(NULL, "Chat", "PopupTimeout", g_Settings.iPopupTimeout);
g_Settings.crPUBkgColour = SendDlgItemMessage(hWnd, IDC_COLBACK_MUC, CPM_GETCOLOUR, 0, 0);
- M->WriteDword("Chat", "PopupColorBG", (DWORD)g_Settings.crPUBkgColour);
+ db_set_dw(0, "Chat", "PopupColorBG", (DWORD)g_Settings.crPUBkgColour);
g_Settings.crPUTextColour = SendDlgItemMessage(hWnd, IDC_COLTEXT_MUC, CPM_GETCOLOUR, 0, 0);
- M->WriteDword("Chat", "PopupColorText", (DWORD)g_Settings.crPUTextColour);
+ db_set_dw(0, "Chat", "PopupColorText", (DWORD)g_Settings.crPUTextColour);
NEN_WriteOptions(&nen_options);
CheckForRemoveMask();
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index a5e884004a..456462c8a2 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -64,7 +64,7 @@ void TSAPI DM_SaveLogAsRTF(const TWindowData* dat)
Utils::sanitizeFilename(szFilename);
- mir_sntprintf(szInitialDir, MAX_PATH, _T("%s%s\\"), M->getDataPath(), _T("\\Saved message logs"));
+ mir_sntprintf(szInitialDir, MAX_PATH, _T("%s%s\\"), M.getDataPath(), _T("\\Saved message logs"));
CreateDirectoryTreeT(szInitialDir);
ofn.lStructSize = sizeof(ofn);
ofn.hwndOwner = dat->hwnd;
@@ -269,12 +269,12 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL);
if (iSelection == ID_FONT_CLEARALLFORMATTING) {
cf.dwMask = CFM_BOLD | CFM_COLOR | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT;
- cf.crTextColor = M->GetDword(FONTMODULE, "Font16Col", 0);
+ cf.crTextColor = M.GetDword(FONTMODULE, "Font16Col", 0);
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
break;
}
if (iSelection == ID_FONT_DEFAULTCOLOR) {
- cf.crTextColor = M->GetDword(FONTMODULE, "Font16Col", 0);
+ cf.crTextColor = M.GetDword(FONTMODULE, "Font16Col", 0);
for (int i=0; i < Utils::rtf_ctable_size; i++)
if (Utils::rtf_ctable[i].clr == cf.crTextColor)
cf.crTextColor = RGB(GetRValue(cf.crTextColor), GetGValue(cf.crTextColor), GetBValue(cf.crTextColor) == 0 ? GetBValue(cf.crTextColor) + 1 : GetBValue(cf.crTextColor) - 1);
@@ -348,7 +348,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
if (dat->hContact) {
submenu = GetSubMenu(m_pContainer->hMenuContext, 4);
int iOldGlobalSendFormat = PluginConfig.m_SendFormat;
- int iLocalFormat = M->GetDword(dat->hContact, "sendformat", 0);
+ int iLocalFormat = M.GetDword(dat->hContact, "sendformat", 0);
int iNewLocalFormat = iLocalFormat;
GetWindowRect(GetDlgItem(hwndDlg, IDC_PROTOCOL), &rc);
@@ -371,7 +371,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
switch (iSelection) {
case ID_MODE_GLOBAL:
dat->dwFlagsEx &= ~(MWF_SHOW_SPLITTEROVERRIDE);
- M->WriteByte(dat->hContact, SRMSGMOD_T, "splitoverride", 0);
+ db_set_b(dat->hContact, SRMSGMOD_T, "splitoverride", 0);
LoadSplitter(dat);
AdjustBottomAvatarDisplay(dat);
DM_RecalcPictureSize(dat);
@@ -379,7 +379,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
break;
case ID_MODE_PRIVATE:
dat->dwFlagsEx |= MWF_SHOW_SPLITTEROVERRIDE;
- M->WriteByte(dat->hContact, SRMSGMOD_T, "splitoverride", 1);
+ db_set_b(dat->hContact, SRMSGMOD_T, "splitoverride", 1);
LoadSplitter(dat);
AdjustBottomAvatarDisplay(dat);
DM_RecalcPictureSize(dat);
@@ -404,15 +404,15 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
if (iNewLocalFormat == 0)
db_unset(dat->hContact, SRMSGMOD_T, "sendformat");
else if (iNewLocalFormat != iLocalFormat)
- M->WriteDword(dat->hContact, SRMSGMOD_T, "sendformat", iNewLocalFormat);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "sendformat", iNewLocalFormat);
if (PluginConfig.m_SendFormat != iOldGlobalSendFormat)
- M->WriteByte(SRMSGMOD_T, "sendformat", (BYTE)PluginConfig.m_SendFormat);
+ db_set_b(0, SRMSGMOD_T, "sendformat", (BYTE)PluginConfig.m_SendFormat);
if (iNewLocalFormat != iLocalFormat || PluginConfig.m_SendFormat != iOldGlobalSendFormat) {
- dat->SendFormat = M->GetDword(dat->hContact, "sendformat", PluginConfig.m_SendFormat);
+ dat->SendFormat = M.GetDword(dat->hContact, "sendformat", PluginConfig.m_SendFormat);
if (dat->SendFormat == -1) // per contact override to disable it..
dat->SendFormat = 0;
- M->BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
+ M.BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
}
}
break;
@@ -497,13 +497,13 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
case ID_SENDMENU_SENDWITHOUTTIMEOUTS:
dat->sendMode ^= SMODE_NOACK;
if (dat->sendMode & SMODE_NOACK)
- M->WriteByte(dat->hContact, SRMSGMOD_T, "no_ack", 1);
+ db_set_b(dat->hContact, SRMSGMOD_T, "no_ack", 1);
else
db_unset(dat->hContact, SRMSGMOD_T, "no_ack");
break;
}
- M->WriteByte(dat->hContact, SRMSGMOD_T, "no_ack", (BYTE)(dat->sendMode & SMODE_NOACK ? 1 : 0));
- M->WriteByte(dat->hContact, SRMSGMOD_T, "forceansi", (BYTE)(dat->sendMode & SMODE_FORCEANSI ? 1 : 0));
+ db_set_b(dat->hContact, SRMSGMOD_T, "no_ack", (BYTE)(dat->sendMode & SMODE_NOACK ? 1 : 0));
+ db_set_b(dat->hContact, SRMSGMOD_T, "forceansi", (BYTE)(dat->sendMode & SMODE_FORCEANSI ? 1 : 0));
SetWindowPos(GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
if (dat->sendMode & SMODE_MULTIPLE || dat->sendMode & SMODE_CONTAINER) {
SetWindowPos(GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
@@ -548,7 +548,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
DBVARIANT dbv = {0};
- if (0 == M->GetTString(dat->hContact, "UserInfo", "MyNotes", &dbv)) {
+ if (0 == db_get_ts(dat->hContact, "UserInfo", "MyNotes", &dbv)) {
SetDlgItemText(hwndDlg, IDC_MESSAGE, dbv.ptszVal);
mir_free(dbv.ptszVal);
}
@@ -558,7 +558,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
TCHAR *buf = (TCHAR *)mir_alloc((iLen + 2) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_MESSAGE, buf, iLen + 1);
- M->WriteTString(dat->hContact, "UserInfo", "MyNotes", buf);
+ db_set_ts(dat->hContact, "UserInfo", "MyNotes", buf);
SetDlgItemText(hwndDlg, IDC_MESSAGE, _T(""));
if (!dat->fIsAutosizingInput) {
@@ -608,13 +608,13 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
case IDC_SELFTYPING:
if (dat->hContact) {
- int iCurrentTypingMode = M->GetByte(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M->GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
+ int iCurrentTypingMode = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW));
if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON && iCurrentTypingMode) {
DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
dat->nTypeMode = PROTOTYPE_SELFTYPING_OFF;
}
- M->WriteByte(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)!iCurrentTypingMode);
+ db_set_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, (BYTE)!iCurrentTypingMode);
}
break;
@@ -662,11 +662,11 @@ LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARA
break;
case ID_VIEW_BOTTOMTOOLBAR:
ApplyContainerSetting(pContainer, CNT_BOTTOMTOOLBAR, pContainer->dwFlags & CNT_BOTTOMTOOLBAR ? 0 : 1, false);
- M->BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
+ M.BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
return 0;
case ID_VIEW_SHOWTOOLBAR:
ApplyContainerSetting(pContainer, CNT_HIDETOOLBAR, pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1, false);
- M->BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
+ M.BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
return 0;
case ID_VIEW_SHOWMENUBAR:
ApplyContainerSetting(pContainer, CNT_NOMENUBAR, pContainer->dwFlags & CNT_NOMENUBAR ? 0 : 1, true);
@@ -717,10 +717,10 @@ LRESULT TSAPI DM_ContainerCmdHandler(TContainerData *pContainer, UINT cmd, WPARA
WINDOWPLACEMENT wp = {0};
wp.length = sizeof(wp);
if (GetWindowPlacement(hwndDlg, &wp)) {
- M->WriteDword(SRMSGMOD_T, "splitx", wp.rcNormalPosition.left);
- M->WriteDword(SRMSGMOD_T, "splity", wp.rcNormalPosition.top);
- M->WriteDword(SRMSGMOD_T, "splitwidth", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- M->WriteDword(SRMSGMOD_T, "splitheight", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
+ db_set_dw(0, SRMSGMOD_T, "splitx", wp.rcNormalPosition.left);
+ db_set_dw(0, SRMSGMOD_T, "splity", wp.rcNormalPosition.top);
+ db_set_dw(0, SRMSGMOD_T, "splitwidth", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
+ db_set_dw(0, SRMSGMOD_T, "splitheight", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
}
}
return 0;
@@ -770,8 +770,8 @@ void TSAPI DM_InitRichEdit(TWindowData *dat)
HWND hwndEdit= GetDlgItem(dat->hwnd, !fIsChat ? IDC_MESSAGE : IDC_CHAT_MESSAGE);
HWND hwndDlg = dat->hwnd;
- dat->inputbg = fIsChat ? M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR) : dat->pContainer->theme.inputbg;
- COLORREF colour = fIsChat ? M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR) : dat->pContainer->theme.bg;
+ dat->inputbg = fIsChat ? M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR) : dat->pContainer->theme.inputbg;
+ COLORREF colour = fIsChat ? M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR_MUC, SRMSGDEFSET_BKGCOLOUR) : dat->pContainer->theme.bg;
COLORREF inputcharcolor;
if (!fIsChat && GetWindowTextLengthA(hwndEdit) > 0)
@@ -920,7 +920,7 @@ void TSAPI DM_SetDBButtonStates(HWND hwndChild, struct TWindowData *dat)
} else {
switch (buttonItem->type) {
case DBVT_BYTE: {
- BYTE val = M->GetByte(hFinalContact, szModule, szSetting, 0);
+ BYTE val = db_get_b(hFinalContact, szModule, szSetting, 0);
result = (val == buttonItem->bValuePush[0]);
break;
}
@@ -930,7 +930,7 @@ void TSAPI DM_SetDBButtonStates(HWND hwndChild, struct TWindowData *dat)
break;
}
case DBVT_DWORD: {
- DWORD val = M->GetDword(hFinalContact, szModule, szSetting, 0);
+ DWORD val = db_get_dw(hFinalContact, szModule, szSetting, 0);
result = (val == *((DWORD *) & buttonItem->bValuePush));
break;
}
@@ -984,7 +984,7 @@ void TSAPI DM_ScrollToBottom(TWindowData *dat, WPARAM wParam, LPARAM lParam)
static void LoadKLThread(LPVOID _param)
{
DBVARIANT dbv;
- if (!M->GetTString(_param, SRMSGMOD_T, "locale", &dbv)) {
+ if (!db_get_ts(_param, SRMSGMOD_T, "locale", &dbv)) {
HKL hkl = LoadKeyboardLayout(dbv.ptszVal, 0);
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SETLOCALE, (WPARAM)_param, (LPARAM)hkl);
db_free(&dbv);
@@ -1008,11 +1008,11 @@ void TSAPI DM_LoadLocale(TWindowData *dat)
TCHAR szBuf[20];
GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, LOCALE_ILANGUAGE, szBuf, 20);
mir_sntprintf(szKLName, KL_NAMELENGTH, _T("0000%s"), szBuf);
- M->WriteTString(dat->hContact, SRMSGMOD_T, "locale", szKLName);
+ db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName);
}
else {
GetKeyboardLayoutName(szKLName);
- M->WriteTString(dat->hContact, SRMSGMOD_T, "locale", szKLName);
+ db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName);
}
}
@@ -1081,7 +1081,7 @@ void TSAPI DM_SaveLocale(TWindowData *dat, WPARAM wParam, LPARAM lParam)
dat->hkl = (HKL)lParam;
ActivateKeyboardLayout(dat->hkl, 0);
GetKeyboardLayoutName(szKLName);
- M->WriteTString(dat->hContact, SRMSGMOD_T, "locale", szKLName);
+ db_set_ts(dat->hContact, SRMSGMOD_T, "locale", szKLName);
GetLocaleID(dat, szKLName);
UpdateReadChars(dat);
}
@@ -1147,11 +1147,11 @@ HWND TSAPI DM_CreateClist(TWindowData *dat)
if (hItem)
SendMessage(hwndClist, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
- if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !M->GetByte("CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
+ if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !M.GetByte("CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
SendMessage(hwndClist, CLM_SETUSEGROUPS, (WPARAM)FALSE, 0);
else
SendMessage(hwndClist, CLM_SETUSEGROUPS, (WPARAM)TRUE, 0);
- if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_HIDEEMPTYGROUPS && M->GetByte("CList", "HideEmptyGroups", SETTING_USEGROUPS_DEFAULT))
+ if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_HIDEEMPTYGROUPS && M.GetByte("CList", "HideEmptyGroups", SETTING_USEGROUPS_DEFAULT))
SendMessage(hwndClist, CLM_SETHIDEEMPTYGROUPS, (WPARAM)TRUE, 0);
else
SendMessage(hwndClist, CLM_SETHIDEEMPTYGROUPS, (WPARAM)FALSE, 0);
@@ -1204,7 +1204,7 @@ LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, struct TWindowDat
if (hwnd == 0)
hwnd = WindowFromPoint(pt);
- if (LOWORD(wParam) & MK_SHIFT || M->GetByte("fastscroll", 0)) {
+ if (LOWORD(wParam) & MK_SHIFT || M.GetByte("fastscroll", 0)) {
if (wDirection < 0)
SendMessage(hwnd, WM_VSCROLL, MAKEWPARAM(SB_PAGEDOWN, 0), 0);
else if (wDirection > 0)
@@ -1253,7 +1253,7 @@ LRESULT TSAPI DM_ThemeChanged(TWindowData *dat)
HWND hwnd = dat->hwnd;
- dat->hTheme = (M->isVSAPIState() && CMimAPI::m_pfnOpenThemeData) ? CMimAPI::m_pfnOpenThemeData(hwnd, L"EDIT") : 0;
+ dat->hTheme = (M.isVSAPIState() && CMimAPI::m_pfnOpenThemeData) ? CMimAPI::m_pfnOpenThemeData(hwnd, L"EDIT") : 0;
if (dat->bType == SESSIONTYPE_IM) {
if (dat->hTheme != 0 || (CSkin::m_skinEnabled && !item_log->IGNORED))
@@ -1268,8 +1268,8 @@ LRESULT TSAPI DM_ThemeChanged(TWindowData *dat)
if (dat->hTheme != 0 || (CSkin::m_skinEnabled && !item_msg->IGNORED))
SetWindowLongPtr(GetDlgItem(hwnd, IDC_CHAT_MESSAGE), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(hwnd, IDC_CHAT_MESSAGE), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
}
- dat->hThemeIP = M->isAero() ? CMimAPI::m_pfnOpenThemeData(hwnd, L"ButtonStyle") : 0;
- dat->hThemeToolbar = (M->isAero() || (!CSkin::m_skinEnabled && M->isVSThemed())) ? CMimAPI::m_pfnOpenThemeData(hwnd, L"REBAR") : 0;
+ dat->hThemeIP = M.isAero() ? CMimAPI::m_pfnOpenThemeData(hwnd, L"ButtonStyle") : 0;
+ dat->hThemeToolbar = (M.isAero() || (!CSkin::m_skinEnabled && M.isVSThemed())) ? CMimAPI::m_pfnOpenThemeData(hwnd, L"REBAR") : 0;
return 0;
}
@@ -1309,7 +1309,7 @@ void TSAPI DM_NotifyTyping(struct TWindowData *dat, int mode)
/*
* allow supression of sending out TN for the contact (NOTE: for metacontacts, do NOT use the subcontact handle)
*/
- if (!M->GetByte(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M->GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)))
+ if (!db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)))
return;
if (!dat->szProto) // should not, but who knows...
@@ -1341,8 +1341,7 @@ void TSAPI DM_NotifyTyping(struct TWindowData *dat, int mode)
* don't send to contacts which are not permanently added to the contact list,
* unless the option to ignore added status is set.
*/
- if (M->GetByte(dat->hContact, "CList", "NotOnList", 0)
- && !M->GetByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
+ if (db_get_b(dat->hContact, "CList", "NotOnList", 0) && !M.GetByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
return;
// End user check
dat->nTypeMode = mode;
@@ -1369,12 +1368,12 @@ void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM wParam, LPARAM lParam)
if (dat->hContact && dat->szProto != NULL && dat->bIsMeta) {
DWORD dwForcedContactNum = 0;
CallService(MS_MC_GETFORCESTATE, (WPARAM)dat->hContact, (LPARAM)&dwForcedContactNum);
- M->WriteDword(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", dwForcedContactNum);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", dwForcedContactNum);
}
dat->showUIElements = m_pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
- dat->dwFlagsEx = M->GetByte(dat->hContact, "splitoverride", 0) ? MWF_SHOW_SPLITTEROVERRIDE : 0;
+ dat->dwFlagsEx = M.GetByte(dat->hContact, "splitoverride", 0) ? MWF_SHOW_SPLITTEROVERRIDE : 0;
dat->Panel->getVisibility();
// small inner margins (padding) for the text areas
@@ -1532,7 +1531,7 @@ int TSAPI DM_SplitterGlobalEvent(TWindowData *dat, WPARAM wParam, LPARAM lParam)
if (fCntGlobal) {
g_Settings.iSplitterY = si->iSplitterY;
if (PluginConfig.lastSPlitterPos.bSync)
- M->WriteDword(SRMSGMOD_T, "splitsplity", (DWORD)si->iSplitterY + DPISCALEY_S(23));
+ db_set_dw(0, SRMSGMOD_T, "splitsplity", (DWORD)si->iSplitterY + DPISCALEY_S(23));
}
}
}
@@ -1726,7 +1725,7 @@ void TSAPI DM_HandleAutoSizeRequest(TWindowData *dat, REQRESIZE* rr)
{
if (dat && rr && GetForegroundWindow() == dat->pContainer->hwnd) {
if (dat->fIsAutosizingInput && dat->iInputAreaHeight != -1) {
- LONG heightLimit = M->GetDword("autoSplitMinLimit", 0);
+ LONG heightLimit = M.GetDword("autoSplitMinLimit", 0);
LONG iNewHeight = rr->rc.bottom - rr->rc.top;
if (CSkin::m_skinEnabled && !SkinItems[ID_EXTBKINPUTAREA].IGNORED)
@@ -1907,9 +1906,9 @@ static int OnSrmmIconChanged(WPARAM wParam, LPARAM)
{
HANDLE hContact = (HANDLE)wParam;
if (hContact == NULL)
- M->BroadcastMessage(DM_STATUSICONCHANGE, 0, 0);
+ M.BroadcastMessage(DM_STATUSICONCHANGE, 0, 0);
else {
- HWND hwnd = M->FindWindow(hContact);
+ HWND hwnd = M.FindWindow(hContact);
if (hwnd)
PostMessage(hwnd, DM_STATUSICONCHANGE, 0, 0);
}
@@ -1941,7 +1940,7 @@ void DrawStatusIcons(struct TWindowData *dat, HDC hDC, RECT r, int gap)
if (dat->bType == SESSIONTYPE_IM) {
DrawIconEx(hDC, x, y, PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING], cx_icon, cy_icon, 0, NULL, DI_NORMAL);
- DrawIconEx(hDC, x, y, M->GetByte(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M->GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)) ?
+ DrawIconEx(hDC, x, y, db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_TYPING, M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW)) ?
PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled, cx_icon, cy_icon, 0, NULL, DI_NORMAL);
}
else CSkin::DrawDimmedIcon(hDC, x, y, cx_icon, cy_icon, PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING], 50);
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index fb8d333562..160c3104d0 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -170,15 +170,15 @@ void CGlobals::reloadSystemModulesChanged()
bIEView = ServiceExists(MS_IEVIEW_WINDOW);
if (bIEView) {
- BOOL bOldIEView = M->GetByte("ieview_installed", 0);
+ BOOL bOldIEView = M.GetByte("ieview_installed", 0);
if (bOldIEView != bIEView)
- M->WriteByte(SRMSGMOD_T, "default_ieview", 1);
- M->WriteByte(SRMSGMOD_T, "ieview_installed", 1);
+ db_set_b(0, SRMSGMOD_T, "default_ieview", 1);
+ db_set_b(0, SRMSGMOD_T, "ieview_installed", 1);
HookEvent(ME_IEVIEW_OPTIONSCHANGED, ::IEViewOptionsChanged);
}
- else M->WriteByte(SRMSGMOD_T, "ieview_installed", 0);
+ else db_set_b(0, SRMSGMOD_T, "ieview_installed", 0);
- g_iButtonsBarGap = M->GetByte("ButtonsBarGap", 1);
+ g_iButtonsBarGap = M.GetByte("ButtonsBarGap", 1);
m_hwndClist = (HWND)CallService(MS_CLUI_GETHWND, 0, 0);
m_MathModAvail = (ServiceExists(MATH_RTF_REPLACE_FORMULAE) ? 1 : 0);
if (m_MathModAvail) {
@@ -194,7 +194,7 @@ void CGlobals::reloadSystemModulesChanged()
if (g_MetaContactsAvail) {
mir_snprintf(szMetaName, 256, "%s", (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0));
- bMetaEnabled = abs(M->GetByte(0, szMetaName, "Enabled", -1));
+ bMetaEnabled = abs(M.GetByte(szMetaName, "Enabled", -1));
}
else {
szMetaName[0] = 0;
@@ -211,7 +211,7 @@ void CGlobals::reloadSystemModulesChanged()
mi.pszService = MS_MSG_SENDMESSAGE;
PluginConfig.m_hMenuItem = Menu_AddContactMenuItem(&mi);
- m_useAeroPeek = M->GetByte("useAeroPeek", 1);
+ m_useAeroPeek = M.GetByte("useAeroPeek", 1);
}
/**
@@ -223,69 +223,69 @@ void CGlobals::reloadSettings(bool fReloadSkins)
m_ncm.cbSize = sizeof(NONCLIENTMETRICS);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &m_ncm, 0);
- DWORD dwFlags = M->GetDword("mwflags", MWF_LOG_DEFAULT);
+ DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
- m_SendOnShiftEnter = M->GetByte("sendonshiftenter", 0);
- m_SendOnEnter = M->GetByte(SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER);
- m_SendOnDblEnter = M->GetByte("SendOnDblEnter", 0);
- m_AutoLocaleSupport = M->GetByte("al", 0);
- m_AutoSwitchTabs = M->GetByte("autoswitchtabs", 1);
+ m_SendOnShiftEnter = M.GetByte("sendonshiftenter", 0);
+ m_SendOnEnter = M.GetByte(SRMSGSET_SENDONENTER, SRMSGDEFSET_SENDONENTER);
+ m_SendOnDblEnter = M.GetByte("SendOnDblEnter", 0);
+ m_AutoLocaleSupport = M.GetByte("al", 0);
+ m_AutoSwitchTabs = M.GetByte("autoswitchtabs", 1);
m_CutContactNameTo = db_get_w(NULL, SRMSGMOD_T, "cut_at", 15);
- m_CutContactNameOnTabs = M->GetByte("cuttitle", 0);
- m_StatusOnTabs = M->GetByte("tabstatus", 1);
- m_LogStatusChanges = M->GetByte("logstatuschanges", 0);
- m_UseDividers = M->GetByte("usedividers", 0);
- m_DividersUsePopupConfig = M->GetByte("div_popupconfig", 0);
- m_MsgTimeout = M->GetDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
+ m_CutContactNameOnTabs = M.GetByte("cuttitle", 0);
+ m_StatusOnTabs = M.GetByte("tabstatus", 1);
+ m_LogStatusChanges = M.GetByte("logstatuschanges", 0);
+ m_UseDividers = M.GetByte("usedividers", 0);
+ m_DividersUsePopupConfig = M.GetByte("div_popupconfig", 0);
+ m_MsgTimeout = M.GetDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, SRMSGDEFSET_MSGTIMEOUT);
if (m_MsgTimeout < SRMSGSET_MSGTIMEOUT_MIN)
m_MsgTimeout = SRMSGSET_MSGTIMEOUT_MIN;
- m_EscapeCloses = M->GetByte("escmode", 0);
+ m_EscapeCloses = M.GetByte("escmode", 0);
- m_HideOnClose = M->GetByte("hideonclose", 0);
- m_AllowTab = M->GetByte("tabmode", 0);
+ m_HideOnClose = M.GetByte("hideonclose", 0);
+ m_AllowTab = M.GetByte("tabmode", 0);
- m_FlashOnClist = M->GetByte("flashcl", 0);
- m_AlwaysFullToolbarWidth = M->GetByte("alwaysfulltoolbar", 1);
- m_LimitStaticAvatarHeight = M->GetDword("avatarheight", 96);
- m_SendFormat = M->GetByte("sendformat", 0);
+ m_FlashOnClist = M.GetByte("flashcl", 0);
+ m_AlwaysFullToolbarWidth = M.GetByte("alwaysfulltoolbar", 1);
+ m_LimitStaticAvatarHeight = M.GetDword("avatarheight", 96);
+ m_SendFormat = M.GetByte("sendformat", 0);
m_FormatWholeWordsOnly = 1;
- m_RTLDefault = M->GetByte("rtldefault", 0);
- m_TabAppearance = M->GetDword("tabconfig", TCF_FLASHICON | TCF_SINGLEROWTABCONTROL);
- m_panelHeight = (DWORD)M->GetDword("panelheight", CInfoPanel::DEGRADE_THRESHOLD);
- m_MUCpanelHeight = M->GetDword("Chat", "panelheight", CInfoPanel::DEGRADE_THRESHOLD);
- m_IdleDetect = M->GetByte("dimIconsForIdleContacts", 1);
+ m_RTLDefault = M.GetByte("rtldefault", 0);
+ m_TabAppearance = M.GetDword("tabconfig", TCF_FLASHICON | TCF_SINGLEROWTABCONTROL);
+ m_panelHeight = (DWORD)M.GetDword("panelheight", CInfoPanel::DEGRADE_THRESHOLD);
+ m_MUCpanelHeight = M.GetDword("Chat", "panelheight", CInfoPanel::DEGRADE_THRESHOLD);
+ m_IdleDetect = M.GetByte("dimIconsForIdleContacts", 1);
m_smcxicon = 16;
m_smcyicon = 16;
- m_PasteAndSend = M->GetByte("pasteandsend", 1);
+ m_PasteAndSend = M.GetByte("pasteandsend", 1);
m_szNoStatus = TranslateT("No status message");
m_LangPackCP = ServiceExists(MS_LANGPACK_GETCODEPAGE) ? CallService(MS_LANGPACK_GETCODEPAGE, 0, 0) : CP_ACP;
- m_visualMessageSizeIndicator = M->GetByte("msgsizebar", 0);
- m_autoSplit = M->GetByte("autosplit", 0);
- m_FlashOnMTN = M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
+ m_visualMessageSizeIndicator = M.GetByte("msgsizebar", 0);
+ m_autoSplit = M.GetByte("autosplit", 0);
+ m_FlashOnMTN = M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
if (m_MenuBar == 0) {
m_MenuBar = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENUBAR));
TranslateMenu(m_MenuBar);
}
- m_ipBackgroundGradient = M->GetDword(FONTMODULE, "ipfieldsbg", 0x62caff);
+ m_ipBackgroundGradient = M.GetDword(FONTMODULE, "ipfieldsbg", 0x62caff);
if (0 == m_ipBackgroundGradient)
m_ipBackgroundGradient = 0x62caff;
- m_ipBackgroundGradientHigh = M->GetDword(FONTMODULE, "ipfieldsbgHigh", 0xf0f0f0);
+ m_ipBackgroundGradientHigh = M.GetDword(FONTMODULE, "ipfieldsbgHigh", 0xf0f0f0);
if (0 == m_ipBackgroundGradientHigh)
m_ipBackgroundGradientHigh = 0xf0f0f0;
- m_tbBackgroundHigh = M->GetDword(FONTMODULE, "tbBgHigh", 0);
- m_tbBackgroundLow = M->GetDword(FONTMODULE, "tbBgLow", 0);
- m_fillColor = M->GetDword(FONTMODULE, "fillColor", 0);
+ m_tbBackgroundHigh = M.GetDword(FONTMODULE, "tbBgHigh", 0);
+ m_tbBackgroundLow = M.GetDword(FONTMODULE, "tbBgLow", 0);
+ m_fillColor = M.GetDword(FONTMODULE, "fillColor", 0);
if (CSkin::m_BrushFill) {
::DeleteObject(CSkin::m_BrushFill);
CSkin::m_BrushFill = 0;
}
- m_genericTxtColor = M->GetDword(FONTMODULE, "genericTxtClr", GetSysColor(COLOR_BTNTEXT));
- m_cRichBorders = M->GetDword(FONTMODULE, "cRichBorders", 0);
+ m_genericTxtColor = M.GetDword(FONTMODULE, "genericTxtClr", GetSysColor(COLOR_BTNTEXT));
+ m_cRichBorders = M.GetDword(FONTMODULE, "cRichBorders", 0);
::CopyMemory(&globalContainerSettings, &_cnt_default, sizeof(TContainerSettings));
Utils::ReadContainerSettingsFromDB(0, &globalContainerSettings);
@@ -299,15 +299,15 @@ void CGlobals::reloadSettings(bool fReloadSkins)
*/
void CGlobals::reloadAdv()
{
- g_bDisableAniAvatars = M->GetByte("adv_DisableAniAvatars", 0);
- g_bSoundOnTyping = M->GetByte("adv_soundontyping", 0);
- m_dontUseDefaultKbd = M->GetByte("adv_leaveKeyboardAlone", 1);
+ g_bDisableAniAvatars = M.GetByte("adv_DisableAniAvatars", 0);
+ g_bSoundOnTyping = M.GetByte("adv_soundontyping", 0);
+ m_dontUseDefaultKbd = M.GetByte("adv_leaveKeyboardAlone", 1);
if (g_bSoundOnTyping && m_TypingSoundAdded == false) {
SkinAddNewSoundEx("SoundOnTyping", LPGEN("Other"), LPGEN("TABSRMM: Typing"));
m_TypingSoundAdded = true;
}
- m_AllowOfflineMultisend = M->GetByte("AllowOfflineMultisend", 0);
+ m_AllowOfflineMultisend = M.GetByte("AllowOfflineMultisend", 0);
}
const HMENU CGlobals::getMenuBar()
@@ -345,7 +345,7 @@ void CGlobals::hookSystemEvents()
int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
{
- M->configureCustomFolders();
+ M.configureCustomFolders();
Skin->Init(true);
CSkin::initAeroEffect();
@@ -371,8 +371,8 @@ int CGlobals::ModulesLoaded(WPARAM wParam, LPARAM lParam)
::ModPlus_Init(wParam, lParam);
::NotifyEventHooks(hHookToolBarLoadedEvt, 0, 0);
- if (M->GetByte("avatarmode", -1) == -1)
- M->WriteByte(SRMSGMOD_T, "avatarmode", 2);
+ if (M.GetByte("avatarmode", -1) == -1)
+ db_set_b(0, SRMSGMOD_T, "avatarmode", 2);
PluginConfig.g_hwndHotkeyHandler = CreateWindowEx(0, _T("TSHK"), _T(""), WS_POPUP,
0, 0, 40, 40, 0, 0, g_hInst, NULL);
@@ -434,7 +434,7 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam)
CContactCache* c = 0;
bool fChanged = false, fNickChanged = false, fExtendedStatusChange = false;
- hwnd = M->FindWindow((HANDLE)wParam);
+ hwnd = M.FindWindow((HANDLE)wParam);
if (hwnd == 0 && wParam != 0) { // we are not interested in this event if there is no open message window/tab
if (!strcmp(setting, "Status") || !strcmp(setting, "MyHandle") || !strcmp(setting, "Nick") || !strcmp(cws->szModule, SRMSGMOD_T)) {
@@ -451,7 +451,7 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam)
}
if (wParam == 0 && !strcmp("Nick", setting)) {
- M->BroadcastMessage(DM_OWNNICKCHANGED, 0, (LPARAM)cws->szModule);
+ M.BroadcastMessage(DM_OWNNICKCHANGED, 0, (LPARAM)cws->szModule);
return 0;
}
@@ -468,7 +468,7 @@ int CGlobals::DBSettingChanged(WPARAM wParam, LPARAM lParam)
if (wParam == 0 && !lstrcmpA(setting, "Enabled")) {
if (PluginConfig.g_MetaContactsAvail && !lstrcmpA(cws->szModule, PluginConfig.szMetaName)) { // catch the disabled meta contacts
- PluginConfig.bMetaEnabled = abs(M->GetByte(0, PluginConfig.szMetaName, "Enabled", -1));
+ PluginConfig.bMetaEnabled = abs(M.GetByte(PluginConfig.szMetaName, "Enabled", -1));
cacheUpdateMetaChanged();
}
}
@@ -577,7 +577,7 @@ int CGlobals::PreshutdownSendRecv(WPARAM wParam, LPARAM lParam)
}
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
- M->WriteDword(hContact, SRMSGMOD_T, "messagecount", 0);
+ db_set_dw(hContact, SRMSGMOD_T, "messagecount", 0);
::SI_DeinitStatusIcons();
::CB_DeInitCustomButtons();
@@ -642,7 +642,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
cle.flags = CLEF_TCHAR;
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- if (M->GetDword(hContact, "SendLater", "count", 0))
+ if (db_get_dw(hContact, "SendLater", "count", 0))
sendLater->addContact(hContact);
HANDLE hDbEvent = db_event_firstUnread(hContact);
@@ -650,7 +650,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get(hDbEvent, &dbei);
if (!(dbei.flags & (DBEF_SENT | DBEF_READ)) && dbei.eventType == EVENTTYPE_MESSAGE) {
- if (M->FindWindow(hContact) != NULL)
+ if (M.FindWindow(hContact) != NULL)
continue;
cle.hContact = hContact;
@@ -675,10 +675,10 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
HANDLE hContact = c->getContact();
bool fGlobal = PluginConfig.m_LogStatusChanges ? true : false;
- DWORD dwMask = M->GetDword(hContact, SRMSGMOD_T, "mwmask", 0);
- DWORD dwFlags = M->GetDword(hContact, SRMSGMOD_T, "mwflags", 0);
+ DWORD dwMask = db_get_dw(hContact, SRMSGMOD_T, "mwmask", 0);
+ DWORD dwFlags = db_get_dw(hContact, SRMSGMOD_T, "mwflags", 0);
- BYTE fLocal = M->GetByte(hContact, "logstatuschanges", 0);
+ BYTE fLocal = M.GetByte(hContact, "logstatuschanges", 0);
if (fGlobal || fLocal) {
/*
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index 4fc0bd95f5..5aefa2287c 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -97,7 +97,7 @@ static INT_PTR HotkeyProcessor(WPARAM wParam, LPARAM lParam)
void TSAPI HandleMenuEntryFromhContact(int iSelection)
{
- HWND hWnd = M->FindWindow((HANDLE)iSelection);
+ HWND hWnd = M.FindWindow((HANDLE)iSelection);
SESSION_INFO *si = NULL;
if (iSelection == 0)
@@ -207,7 +207,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
return TRUE;
}
else if (dis->CtlType == ODT_MENU) {
- HWND hWnd = M->FindWindow((HANDLE)dis->itemID);
+ HWND hWnd = M.FindWindow((HANDLE)dis->itemID);
DWORD idle = 0;
if (hWnd == NULL) {
@@ -392,7 +392,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case DM_DOCREATETAB:
{
- HWND hWnd = M->FindWindow((HANDLE)lParam);
+ HWND hWnd = M.FindWindow((HANDLE)lParam);
if (hWnd && IsWindow(hWnd)) {
TContainerData *pContainer = 0;
SendMessage(hWnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
@@ -453,7 +453,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
HKL hkl = (HKL)lParam;
HANDLE hContact = (HANDLE)wParam;
- HWND hWnd = M->FindWindow(hContact);
+ HWND hWnd = M.FindWindow(hContact);
if (hWnd) {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(hWnd, GWLP_USERDATA);
if (dat) {
@@ -463,7 +463,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
DBVARIANT dbv;
- if (0 == M->GetTString(hContact, SRMSGMOD_T, "locale", &dbv)) {
+ if (0 == db_get_ts(hContact, SRMSGMOD_T, "locale", &dbv)) {
GetLocaleID(dat, dbv.ptszVal);
db_free(&dbv);
UpdateReadChars(dat);
@@ -479,7 +479,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
*/
case WM_DWMCOMPOSITIONCHANGED:
{
- bool fNewAero = M->getAeroState(); // refresh dwm state
+ bool fNewAero = M.getAeroState(); // refresh dwm state
SendMessage(hwndDlg, WM_THEMECHANGED, 0, 0);
for (p = pFirstContainer; p; p = p->pNext) {
@@ -487,15 +487,15 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SetAeroMargins(p);
else {
MARGINS m = {0};
- if (M->m_pfnDwmExtendFrameIntoClientArea)
- M->m_pfnDwmExtendFrameIntoClientArea(p->hwnd, &m);
+ if (M.m_pfnDwmExtendFrameIntoClientArea)
+ M.m_pfnDwmExtendFrameIntoClientArea(p->hwnd, &m);
}
if (p->SideBar->isActive())
RedrawWindow(GetDlgItem(p->hwnd, 5000), NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); // the container for the sidebar buttons
RedrawWindow(p->hwnd, NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
}
- M->BroadcastMessage(WM_DWMCOMPOSITIONCHANGED, 0, 0);
+ M.BroadcastMessage(WM_DWMCOMPOSITIONCHANGED, 0, 0);
break;
/*
@@ -505,7 +505,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
* tabs and buttons to match the new desktop color theme.
*/
case WM_DWMCOLORIZATIONCOLORCHANGED:
- M->getAeroState();
+ M.getAeroState();
Skin->setupAeroSkins();
CSkin::initAeroEffect();
break;
@@ -515,7 +515,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
* classic Windows theme
*/
case WM_THEMECHANGED:
- M->getAeroState();
+ M.getAeroState();
Skin->setupTabCloseBitmap();
CSkin::initAeroEffect();
PluginConfig.m_ncm.cbSize = sizeof(NONCLIENTMETRICS);
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 61ebf1e4a8..903c6e8107 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -55,7 +55,7 @@ int CInfoPanel::setPanelHandler(TWindowData *dat, WPARAM wParam, LPARAM lParam)
dat->Panel->loadHeight();
else {
if (srcDat && lParam && dat != srcDat && !dat->Panel->isPrivateHeight()) {
- if (srcDat->bType != dat->bType && M->GetByte("syncAllPanels", 0) == 0)
+ if (srcDat->bType != dat->bType && M.GetByte("syncAllPanels", 0) == 0)
return 0;
if (dat->pContainer->settings->fPrivate && srcDat->pContainer != dat->pContainer)
@@ -79,9 +79,9 @@ void CInfoPanel::setActive(const int newActive)
*/
void CInfoPanel::loadHeight()
{
- BYTE bSync = M->GetByte("syncAllPanels", 0); // sync muc <> im panels
+ BYTE bSync = M.GetByte("syncAllPanels", 0); // sync muc <> im panels
- m_height = M->GetDword(m_dat->hContact, "panelheight", -1);
+ m_height = M.GetDword(m_dat->hContact, "panelheight", -1);
if (m_height == -1 || HIWORD(m_height) == 0) {
if (m_dat->pContainer->settings->fPrivate)
@@ -106,7 +106,7 @@ void CInfoPanel::loadHeight()
*/
void CInfoPanel::saveHeight(bool fFlush)
{
- BYTE bSync = M->GetByte("syncAllPanels", 0);
+ BYTE bSync = M.GetByte("syncAllPanels", 0);
if (m_height < 110 && m_height >= MIN_PANELHEIGHT) { // only save valid panel splitter positions
if (!m_fPrivateHeight) {
@@ -117,7 +117,7 @@ void CInfoPanel::saveHeight(bool fFlush)
PluginConfig.m_panelHeight = m_height;
m_defaultHeight = m_height;
if (fFlush)
- M->WriteDword(SRMSGMOD_T, "panelheight", m_height);
+ db_set_dw(0, SRMSGMOD_T, "panelheight", m_height);
}
}
else if (m_isChat && !bSync) {
@@ -127,12 +127,12 @@ void CInfoPanel::saveHeight(bool fFlush)
PluginConfig.m_MUCpanelHeight = m_height;
m_defaultMUCHeight = m_height;
if (fFlush)
- M->WriteDword("Chat", "panelheight", m_height);
+ db_set_dw(0, "Chat", "panelheight", m_height);
}
}
}
else
- M->WriteDword(m_dat->hContact, SRMSGMOD_T, "panelheight", MAKELONG(m_height, 0xffff));
+ db_set_dw(m_dat->hContact, SRMSGMOD_T, "panelheight", MAKELONG(m_height, 0xffff));
}
}
@@ -154,7 +154,7 @@ void CInfoPanel::setHeight(LONG newHeight, bool fBroadcast)
if (fBroadcast) {
if (!m_fPrivateHeight) {
if (!m_dat->pContainer->settings->fPrivate)
- M->BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)newHeight);
+ M.BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)newHeight);
else
::BroadCastContainer(m_dat->pContainer, DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)newHeight);
}
@@ -194,7 +194,7 @@ void CInfoPanel::showHide() const
::SendMessage(hwndDlg, WM_SIZE, 0, 0);
::InvalidateRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), NULL, TRUE);
::SetAeroMargins(m_dat->pContainer);
- if (M->isAero())
+ if (M.isAero())
::InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
::DM_ScrollToBottom(m_dat, 0, 1);
}
@@ -208,7 +208,7 @@ void CInfoPanel::showHide() const
::SendMessage(hwndDlg, WM_SIZE, 0, 0);
::SetAeroMargins(m_dat->pContainer);
- if (M->isAero())
+ if (M.isAero())
::InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
::DM_ScrollToBottom(m_dat, 0, 1);
}
@@ -229,7 +229,7 @@ bool CInfoPanel::getVisibility()
}
BYTE bDefault = (m_dat->pContainer->dwFlags & CNT_INFOPANEL) ? 1 : 0;
- BYTE bContact = M->GetByte(m_dat->hContact, "infopanel", 0);
+ BYTE bContact = M.GetByte(m_dat->hContact, "infopanel", 0);
BYTE visible = (bContact == 0 ? bDefault : (bContact == (BYTE)-1 ? 0 : 1));
setActive(visible);
@@ -511,10 +511,10 @@ void CInfoPanel::RenderIPUIN(const HDC hdc, RECT& rcItem)
}
else _tcscpy_s (szBuf, 256, tszUin);
- if (M->GetByte("ShowClientDescription",1)) {
+ if (M.GetByte("ShowClientDescription",1)) {
TCHAR temp[256];
DBVARIANT dbv = {0};
- if ( !M->GetTString(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
+ if ( !db_get_ts(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
mir_sntprintf(temp, SIZEOF(temp), TranslateT(" Client: %s"), dbv.ptszVal);
::db_free(&dbv);
}
@@ -935,7 +935,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
if ((xStatus = m_dat->cache->getXStatusId())) {
TCHAR *tszXStatusName = 0;
- if (0 == M->GetTString(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
+ if (0 == db_get_ts(m_dat->cache->getContact(), m_dat->cache->getProto(), "XStatusName", &dbv))
tszXStatusName = dbv.ptszVal;
else if (xStatus > 0 && xStatus <= 31)
tszXStatusName = xStatusDescr[xStatus - 1];
@@ -955,7 +955,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
str->append(temp);
}
- if (0 == M->GetTString(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
+ if (0 == db_get_ts(m_dat->cache->getActiveContact(), m_dat->cache->getActiveProto(), "MirVer", &dbv)) {
mir_sntprintf(temp, 1024, TranslateT("\\par\\par\\ul\\b Client:\\ul0\\b0 %s"), dbv.ptszVal);
::db_free(&dbv);
str->append(temp);
@@ -1036,7 +1036,7 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP
HDC dcWin = (HDC)wParam;
- if (M->isAero()) {
+ if (M.isAero()) {
HDC hdc;
HBITMAP hbm, hbmOld;
LONG cx = rcItem.right - rcItem.left;
@@ -1067,7 +1067,7 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP
else {
rc.bottom += 2;
rc.left -= 3; rc.right += 3;
- dat->Panel->renderBG(dcWin, rc, &SkinItems[ID_EXTBKINFOPANELBG], M->isAero(), false);
+ dat->Panel->renderBG(dcWin, rc, &SkinItems[ID_EXTBKINFOPANELBG], M.isAero(), false);
}
if (CSkin::m_bAvatarBorderType == 1) {
HRGN clipRgn = 0;
@@ -1138,7 +1138,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always off"));
::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always on"));
- BYTE v = M->GetByte(m_dat->hContact, "infopanel", 0);
+ BYTE v = M.GetByte(m_dat->hContact, "infopanel", 0);
::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_SETCURSEL, (WPARAM)(v == 0 ? 0 : (v == (BYTE)-1 ? 1 : 2)), 0);
::SendDlgItemMessage(hwnd, IDC_PANELSIZE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Use default size"));
@@ -1146,12 +1146,12 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
::SendDlgItemMessage(hwnd, IDC_PANELSIZE, CB_SETCURSEL, (WPARAM)(m_fPrivateHeight ? 1 : 0), 0);
- ::CheckDlgButton(hwnd, IDC_NOSYNC, M->GetByte("syncAllPanels", 0) ? BST_UNCHECKED : BST_CHECKED);
+ ::CheckDlgButton(hwnd, IDC_NOSYNC, M.GetByte("syncAllPanels", 0) ? BST_UNCHECKED : BST_CHECKED);
Utils::showDlgControl(hwnd, IDC_IPCONFIG_PRIVATECONTAINER, m_dat->pContainer->settings->fPrivate ? SW_SHOW : SW_HIDE);
if (!m_isChat) {
- v = M->GetByte(m_dat->hContact, SRMSGMOD_T, "hideavatar", -1);
+ v = db_get_b(m_dat->hContact, SRMSGMOD_T, "hideavatar", -1);
::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Use Global Setting"));
::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Show always (if present)"));
::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Never show it at all"));
@@ -1202,13 +1202,13 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
LRESULT iResult = ::SendDlgItemMessage(hwnd, IDC_PANELSIZE, CB_GETCURSEL, 0, 0);
if (iResult == 0) {
if (m_fPrivateHeight) {
- M->WriteDword(m_dat->hContact, SRMSGMOD_T, "panelheight", m_height);
+ db_set_dw(m_dat->hContact, SRMSGMOD_T, "panelheight", m_height);
loadHeight();
}
}
else if (iResult == 1) {
- M->WriteDword(m_dat->hContact, SRMSGMOD_T, "panelheight",
- MAKELONG(M->GetDword(m_dat->hContact, "panelheight", m_height), 0xffff));
+ db_set_dw(m_dat->hContact, SRMSGMOD_T, "panelheight",
+ MAKELONG(M.GetDword(m_dat->hContact, "panelheight", m_height), 0xffff));
loadHeight();
}
}
@@ -1216,7 +1216,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
case IDC_PANELPICTUREVIS:
{
- BYTE vOld = M->GetByte(m_dat->hContact, SRMSGMOD_T, "hideavatar", -1);
+ BYTE vOld = db_get_b(m_dat->hContact, SRMSGMOD_T, "hideavatar", -1);
LRESULT iResult = ::SendDlgItemMessage(hwnd, IDC_PANELPICTUREVIS, CB_GETCURSEL, 0, 0);
BYTE vNew = (iResult == 0 ? (BYTE)-1 : (iResult == 1 ? 1 : 0));
@@ -1224,7 +1224,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
if (vNew == (BYTE)-1)
db_unset(m_dat->hContact, SRMSGMOD_T, "hideavatar");
else
- M->WriteByte(m_dat->hContact, SRMSGMOD_T, "hideavatar", vNew);
+ db_set_b(m_dat->hContact, SRMSGMOD_T, "hideavatar", vNew);
m_dat->panelWidth = -1;
::ShowPicture(m_dat, FALSE);
::SendMessage(m_dat->hwnd, WM_SIZE, 0, 0);
@@ -1235,12 +1235,12 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
case IDC_PANELVISIBILITY:
{
- BYTE vOld = M->GetByte(m_dat->hContact, SRMSGMOD_T, "infopanel", 0);
+ BYTE vOld = db_get_b(m_dat->hContact, SRMSGMOD_T, "infopanel", 0);
LRESULT iResult = ::SendDlgItemMessage(hwnd, IDC_PANELVISIBILITY, CB_GETCURSEL, 0, 0);
BYTE vNew = (iResult == 0 ? 0 : (iResult == 1 ? (BYTE)-1 : 1));
if (vNew != vOld) {
- M->WriteByte(m_dat->hContact, SRMSGMOD_T, "infopanel", vNew);
+ db_set_b(m_dat->hContact, SRMSGMOD_T, "infopanel", vNew);
getVisibility();
showHide();
}
@@ -1260,16 +1260,16 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
break;
case IDC_NOSYNC:
- M->WriteByte(SRMSGMOD_T, "syncAllPanels", ::IsDlgButtonChecked(hwnd, IDC_NOSYNC) ? 0 : 1);
+ db_set_b(0, SRMSGMOD_T, "syncAllPanels", ::IsDlgButtonChecked(hwnd, IDC_NOSYNC) ? 0 : 1);
if (!IsDlgButtonChecked(hwnd, IDC_NOSYNC)) {
loadHeight();
if (!m_dat->pContainer->settings->fPrivate)
- M->BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)m_defaultHeight);
+ M.BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)m_defaultHeight);
else
::BroadCastContainer(m_dat->pContainer, DM_SETINFOPANEL, (WPARAM)m_dat, (LPARAM)m_defaultHeight);
} else {
if (!m_dat->pContainer->settings->fPrivate)
- M->BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, 0);
+ M.BroadcastMessage(DM_SETINFOPANEL, (WPARAM)m_dat, 0);
else
::BroadCastContainer(m_dat->pContainer,DM_SETINFOPANEL, (WPARAM)m_dat, 0);
}
@@ -1380,7 +1380,7 @@ void CInfoPanel::dismissConfig(bool fForced)
*/
CTip::CTip(const HWND hwndParent, const HANDLE hContact, const TCHAR *pszText, const CInfoPanel* panel)
{
- m_hwnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, _T("RichEditTipClass"), _T(""), (M->isAero() ? WS_THICKFRAME : WS_BORDER)|WS_POPUPWINDOW|WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
+ m_hwnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, _T("RichEditTipClass"), _T(""), (M.isAero() ? WS_THICKFRAME : WS_BORDER)|WS_POPUPWINDOW|WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
0, 0, 40, 40, 0, 0, g_hInst, this);
m_hRich = ::CreateWindowEx(0, RICHEDIT_CLASS, _T(""), WS_CHILD | ES_MULTILINE | ES_AUTOVSCROLL | ES_NOHIDESEL | ES_READONLY | WS_VSCROLL | WS_TABSTOP,
@@ -1423,8 +1423,8 @@ void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const TCHAR *szTit
int xBorder, yBorder;
m_leftWidth = (m_panel->getDat()->hClientIcon || m_panel->getDat()->hXStatusIcon ? LEFT_BAR_WIDTH : 0);
- xBorder = M->isAero() ? GetSystemMetrics(SM_CXSIZEFRAME) : 1;
- yBorder = M->isAero() ? GetSystemMetrics(SM_CYSIZEFRAME) : 1;
+ xBorder = M.isAero() ? GetSystemMetrics(SM_CXSIZEFRAME) : 1;
+ yBorder = M.isAero() ? GetSystemMetrics(SM_CYSIZEFRAME) : 1;
m_hIcon = hIcon;
m_szTitle = szTitle;
@@ -1591,7 +1591,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
rc.bottom += 2;
rc.left -= 4;rc.right += 4;
HBRUSH br = ::CreateSolidBrush(PluginConfig.m_ipBackgroundGradientHigh);
- if (M->isAero()) {
+ if (M.isAero()) {
::FillRect(hdcMem, &rc, reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)));
CSkin::ApplyAeroEffect(hdcMem, &rcText, CSkin::AERO_EFFECT_AREA_MENUBAR, 0);
::FillRect(hdcMem, &m_rcRich, br);
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index fd8ab5c693..292303ae91 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -76,107 +76,6 @@ void CMimAPI::timerMsg(const char *szMsg)
mir_snprintf(m_timerMsg, 256, "%s: %d ticks = %f msec", szMsg, (int)(m_tStop - m_tStart), 1000 * ((double)(m_tStop - m_tStart) * m_dFreq));
_DebugTraceA(m_timerMsg);
}
-/*
- * read a setting for a contact
- */
-
-DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD uDefault = 0) const
-{
- return((DWORD)db_get_dw(hContact, szModule, szSetting, uDefault));
-}
-
-/*
- * read a setting from our default module (Tab_SRMSG)
- */
-
-DWORD CMimAPI::GetDword(const char *szSetting = 0, DWORD uDefault = 0) const
-{
- return((DWORD)db_get_dw(0, SRMSGMOD_T, szSetting, uDefault));
-}
-
-/*
- * read a contact setting with our default module name (Tab_SRMSG)
- */
-
-DWORD CMimAPI::GetDword(const HANDLE hContact = 0, const char *szSetting = 0, DWORD uDefault = 0) const
-{
- return((DWORD)db_get_dw(hContact, SRMSGMOD_T, szSetting, uDefault));
-}
-
-/*
- * read a setting from module only
- */
-
-DWORD CMimAPI::GetDword(const char *szModule, const char *szSetting, DWORD uDefault) const
-{
- return((DWORD)db_get_dw(0, szModule, szSetting, uDefault));
-}
-
-/*
- * same for bytes now
- */
-int CMimAPI::GetByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, int uDefault = 0) const
-{
- return(db_get_b(hContact, szModule, szSetting, uDefault));
-}
-
-int CMimAPI::GetByte(const char *szSetting = 0, int uDefault = 0) const
-{
- return(db_get_b(0, SRMSGMOD_T, szSetting, uDefault));
-}
-
-int CMimAPI::GetByte(const HANDLE hContact = 0, const char *szSetting = 0, int uDefault = 0) const
-{
- return(db_get_b(hContact, SRMSGMOD_T, szSetting, uDefault));
-}
-
-int CMimAPI::GetByte(const char *szModule, const char *szSetting, int uDefault) const
-{
- return(db_get_b(0, szModule, szSetting, uDefault));
-}
-
-INT_PTR CMimAPI::GetTString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const
-{
- return(db_get_ts(hContact, szModule, szSetting, dbv));
-}
-
-INT_PTR CMimAPI::GetString(const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const
-{
- return(db_get_s(hContact, szModule, szSetting, dbv));
-}
-
-/*
- * writer functions
- */
-
-INT_PTR CMimAPI::WriteDword(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, DWORD value = 0) const
-{
- return(db_set_dw(hContact, szModule, szSetting, value));
-}
-
-/*
- * write non-contact setting
-*/
-
-INT_PTR CMimAPI::WriteDword(const char *szModule = 0, const char *szSetting = 0, DWORD value = 0) const
-{
- return(db_set_dw(0, szModule, szSetting, value));
-}
-
-INT_PTR CMimAPI::WriteByte(const HANDLE hContact = 0, const char *szModule = 0, const char *szSetting = 0, BYTE value = 0) const
-{
- return(db_set_b(hContact, szModule, szSetting, value));
-}
-
-INT_PTR CMimAPI::WriteByte(const char *szModule = 0, const char *szSetting = 0, BYTE value = 0) const
-{
- return(db_set_b(0, szModule, szSetting, value));
-}
-
-INT_PTR CMimAPI::WriteTString(const HANDLE hContact, const char *szModule = 0, const char *szSetting = 0, const TCHAR *str = 0) const
-{
- return(db_set_ts(hContact, szModule, szSetting, str));
-}
/**
* Case insensitive _tcsstr
@@ -191,25 +90,24 @@ const TCHAR* CMimAPI::StriStr(const TCHAR *szString, const TCHAR *szSearchFor)
{
assert(szString != 0 && szSearchFor != 0);
- if (szString && *szString) {
- if (0 == szSearchFor || 0 == *szSearchFor)
- return(szString);
+ if (!szString || *szString == 0)
+ return NULL;
- for (; *szString; ++szString) {
- if (_totupper(*szString) == _totupper(*szSearchFor)) {
- const TCHAR *h, *n;
- for (h = szString, n = szSearchFor; *h && *n; ++h, ++n) {
- if (_totupper(*h) != _totupper(*n))
- break;
- }
- if (!*n)
- return(szString);
- }
+ if (!szSearchFor || *szSearchFor == 0)
+ return szString;
+
+ for (; *szString; ++szString) {
+ if (_totupper(*szString) == _totupper(*szSearchFor)) {
+ const TCHAR *h, *n;
+ for (h = szString, n = szSearchFor; *h && *n; ++h, ++n)
+ if (_totupper(*h) != _totupper(*n))
+ break;
+
+ if (!*n)
+ return szString;
}
- return 0;
}
- else
- return 0;
+ return NULL;
}
int CMimAPI::pathIsAbsolute(const TCHAR *path) const
@@ -231,23 +129,22 @@ size_t CMimAPI::pathToRelative(const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBa
if (!pathIsAbsolute(pSrc)) {
mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc);
return lstrlen(pOut);
- } else {
- TCHAR szTmp[MAX_PATH];
-
- mir_sntprintf(szTmp, SIZEOF(szTmp), _T("%s"), pSrc);
- if (StriStr(szTmp, tszBase)) {
- if (tszBase[lstrlen(tszBase) - 1] == '\\')
- mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + lstrlen(tszBase));
- else {
- mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + lstrlen(tszBase) + 1 );
- //pOut[0]='.';
- }
- return(lstrlen(pOut));
- } else {
- mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc);
- return(lstrlen(pOut));
+ }
+
+ TCHAR szTmp[MAX_PATH];
+ mir_sntprintf(szTmp, SIZEOF(szTmp), _T("%s"), pSrc);
+ if (StriStr(szTmp, tszBase)) {
+ if (tszBase[lstrlen(tszBase) - 1] == '\\')
+ mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + lstrlen(tszBase));
+ else {
+ mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc + lstrlen(tszBase) + 1 );
+ //pOut[0]='.';
}
+ return(lstrlen(pOut));
}
+
+ mir_sntprintf(pOut, MAX_PATH, _T("%s"), pSrc);
+ return(lstrlen(pOut));
}
/**
@@ -282,34 +179,34 @@ size_t CMimAPI::pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBa
* window list functions
*/
-void CMimAPI::BroadcastMessage(UINT msg = 0, WPARAM wParam = 0, LPARAM lParam = 0)
+void CMimAPI::BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam)
{
WindowList_Broadcast(m_hMessageWindowList, msg, wParam, lParam);
}
-void CMimAPI::BroadcastMessageAsync(UINT msg = 0, WPARAM wParam = 0, LPARAM lParam = 0)
+void CMimAPI::BroadcastMessageAsync(UINT msg, WPARAM wParam, LPARAM lParam)
{
WindowList_BroadcastAsync(m_hMessageWindowList, msg, wParam, lParam);
}
-HWND CMimAPI::FindWindow(HANDLE h = 0) const
+HWND CMimAPI::FindWindow(HANDLE h) const
{
- return(WindowList_Find(m_hMessageWindowList, h));
+ return WindowList_Find(m_hMessageWindowList, h);
}
-INT_PTR CMimAPI::AddWindow(HWND hWnd = 0, HANDLE h = 0)
+INT_PTR CMimAPI::AddWindow(HWND hWnd, HANDLE h)
{
- return(WindowList_Add(m_hMessageWindowList, hWnd, h));
+ return WindowList_Add(m_hMessageWindowList, hWnd, h);
}
-INT_PTR CMimAPI::RemoveWindow(HWND hWnd = 0)
+INT_PTR CMimAPI::RemoveWindow(HWND hWnd)
{
- return(WindowList_Remove(m_hMessageWindowList, hWnd));
+ return WindowList_Remove(m_hMessageWindowList, hWnd);
}
int CMimAPI::FoldersPathChanged(WPARAM wParam, LPARAM lParam)
{
- return(M->foldersPathChanged());
+ return M.foldersPathChanged();
}
void CMimAPI::configureCustomFolders()
@@ -380,7 +277,7 @@ const TCHAR* CMimAPI::getUserDir()
Utils::ensureTralingBackslash(m_userDir);
}
- return(m_userDir);
+ return m_userDir;
}
void CMimAPI::InitPaths()
@@ -417,7 +314,7 @@ bool CMimAPI::getAeroState()
}
m_isVsThemed = (m_VsAPI && m_pfnIsThemeActive && m_pfnIsThemeActive());
- return(m_isAero);
+ return m_isAero;
}
/**
@@ -516,7 +413,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
BOOL fShowOnClist = TRUE;
if (wParam) {
- if ((hwnd = M->FindWindow((HANDLE)wParam)) && M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING))
+ if ((hwnd = M.FindWindow((HANDLE)wParam)) && M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING))
preTyping = SendMessage(hwnd, DM_TYPING, 0, lParam);
if (hwnd && IsWindowVisible(hwnd))
@@ -531,10 +428,10 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
return 0; // should never happen
}
- if ( M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) {
- if (!hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1))
+ if ( M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST)) {
+ if (!hwnd && !M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1))
fShowOnClist = FALSE;
- if (hwnd && !M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1))
+ if (hwnd && !M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1))
fShowOnClist = FALSE;
}
else fShowOnClist = FALSE;
@@ -542,9 +439,9 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
if ((!foundWin || !(pContainer->dwFlags&CNT_NOSOUND)) && preTyping != (lParam != 0))
SkinPlaySound((lParam) ? "TNStart" : "TNStop");
- if (M->GetByte(SRMSGMOD, "ShowTypingPopup", 0)) {
+ if (M.GetByte(SRMSGMOD, "ShowTypingPopup", 0)) {
BOOL fShow = FALSE;
- int iMode = M->GetByte("MTN_PopupMode", 0);
+ int iMode = M.GetByte("MTN_PopupMode", 0);
switch(iMode) {
case 0:
@@ -559,7 +456,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
fShow = TRUE;
else {
if (PluginConfig.m_HideOnClose) {
- struct TContainerData *pContainer = 0;
+ TContainerData *pContainer = 0;
SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
if (pContainer && pContainer->fHidden)
fShow = TRUE;
@@ -575,7 +472,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
TCHAR szTip[256];
_sntprintf(szTip, SIZEOF(szTip), TranslateT("%s is typing a message."), (TCHAR *) CallService(MS_CLIST_GETCONTACTDISPLAYNAME, wParam, GCDNF_TCHAR));
- if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M->GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) {
+ if (fShowOnClist && ServiceExists(MS_CLIST_SYSTRAY_NOTIFY) && M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0)) {
MIRANDASYSTRAYNOTIFY tn;
tn.szProto = NULL;
tn.cbSize = sizeof(tn);
@@ -586,10 +483,7 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM)& tn);
}
if (fShowOnClist) {
- CLISTEVENT cle;
-
- ZeroMemory(&cle, sizeof(cle));
- cle.cbSize = sizeof(cle);
+ CLISTEVENT cle = { sizeof(cle) };
cle.hContact = (HANDLE) wParam;
cle.hDbEvent = (HANDLE) 1;
cle.flags = CLEF_ONLYAFEW | CLEF_TCHAR;
@@ -614,13 +508,12 @@ int CMimAPI::TypingMessage(WPARAM wParam, LPARAM lParam)
int CMimAPI::ProtoAck(WPARAM wParam, LPARAM lParam)
{
- ACKDATA *pAck = (ACKDATA *) lParam;
- HWND hwndDlg = 0;
- int i = 0, j, iFound = SendQueue::NR_SENDJOBS;
-
+ ACKDATA *pAck = (ACKDATA*)lParam;
if (lParam == 0)
return 0;
+ HWND hwndDlg = 0;
+ int i = 0, j, iFound = SendQueue::NR_SENDJOBS;
SendJob *jobs = sendQueue->getJobByIndex(0);
if (pAck->type == ACKTYPE_MESSAGE) {
@@ -663,7 +556,7 @@ int CMimAPI::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
char *szProto = GetContactProto(hContact);
if (szProto) {
// leave this menu item hidden for chats
- if ( !M->GetByte(hContact, szProto, "ChatRoom", 0 ))
+ if ( !db_get_b(hContact, szProto, "ChatRoom", 0 ))
if ( CallProtoService( szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND )
bEnabled = true;
}
@@ -684,7 +577,7 @@ int CMimAPI::PrebuildContactMenu(WPARAM wParam, LPARAM lParam)
int CMimAPI::DispatchNewEvent(WPARAM wParam, LPARAM lParam)
{
if (wParam) {
- HWND h = M->FindWindow((HANDLE)wParam);
+ HWND h = M.FindWindow((HANDLE)wParam);
if (h)
PostMessage(h, HM_DBEVENTADDED, wParam, lParam); // was SENDMESSAGE !!! XXX
}
@@ -710,7 +603,7 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam)
DBEVENTINFO dbei = { sizeof(dbei) };
db_event_get((HANDLE)lParam, &dbei);
- HWND hwnd = M->FindWindow((HANDLE)wParam);
+ HWND hwnd = M.FindWindow((HANDLE)wParam);
BOOL isCustomEvent = IsCustomEvent(dbei.eventType);
BOOL isShownCustomEvent = DbEventIsForMsgWindow(&dbei);
@@ -729,10 +622,10 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam)
GetWindowPlacement(pTargetContainer->hwnd, &wp);
GetContainerNameForContact((HANDLE) wParam, szName, CONTAINER_NAMELEN);
- bAutoPopup = M->GetByte(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP);
- bAutoCreate = M->GetByte("autotabs", 1);
- bAutoContainer = M->GetByte("autocontainer", 1);
- dwStatusMask = M->GetDword("autopopupmask", -1);
+ bAutoPopup = M.GetByte(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP);
+ bAutoCreate = M.GetByte("autotabs", 1);
+ bAutoContainer = M.GetByte("autocontainer", 1);
+ dwStatusMask = M.GetDword("autopopupmask", -1);
bAllowAutoCreate = FALSE;
@@ -747,7 +640,7 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam)
}
else {
bActivate = FALSE;
- bPopup = (BOOL) M->GetByte("cpopup", 0);
+ bPopup = (BOOL) M.GetByte("cpopup", 0);
pContainer = FindContainerByName(szName);
if (pContainer != NULL) {
if (bAutoContainer) {
@@ -791,10 +684,10 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam)
GetContainerNameForContact((HANDLE) wParam, szName, CONTAINER_NAMELEN);
- bAutoPopup = M->GetByte(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP);
- bAutoCreate = M->GetByte("autotabs", 1);
- bAutoContainer = M->GetByte("autocontainer", 1);
- dwStatusMask = M->GetDword("autopopupmask", -1);
+ bAutoPopup = M.GetByte(SRMSGSET_AUTOPOPUP, SRMSGDEFSET_AUTOPOPUP);
+ bAutoCreate = M.GetByte("autotabs", 1);
+ bAutoContainer = M.GetByte("autocontainer", 1);
+ dwStatusMask = M.GetDword("autopopupmask", -1);
bAllowAutoCreate = FALSE;
@@ -824,12 +717,12 @@ int CMimAPI::MessageEventAdded(WPARAM wParam, LPARAM lParam)
return 0;
} else {
bActivate = FALSE;
- bPopup = (BOOL) M->GetByte("cpopup", 0);
+ bPopup = (BOOL) M.GetByte("cpopup", 0);
pContainer = FindContainerByName(szName);
if (pContainer != NULL) {
//if ((IsIconic(pContainer->hwnd)) && PluginConfig.haveAutoSwitch())
// pContainer->dwFlags |= CNT_DEFERREDTABSELECT;
- if (M->GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) {
+ if (M.GetByte("limittabs", 0) && !wcsncmp(pContainer->szName, L"default", 6)) {
if ((pContainer = FindMatchingContainer(L"default", (HANDLE)wParam)) != NULL) {
CreateNewTabForContact(pContainer, (HANDLE) wParam, 0, NULL, bActivate, bPopup, TRUE, (HANDLE)lParam);
return 0;
@@ -881,5 +774,5 @@ nowindowcreate:
return 0;
}
-CMimAPI *M = 0;
+CMimAPI M;
FI_INTERFACE *FIF = 0;
diff --git a/plugins/TabSRMM/src/mim.h b/plugins/TabSRMM/src/mim.h
index 42beca34b2..9fcc2c6408 100644
--- a/plugins/TabSRMM/src/mim.h
+++ b/plugins/TabSRMM/src/mim.h
@@ -34,7 +34,6 @@
#ifndef __MIM_H
#define __MIM_H
-
extern FI_INTERFACE *FIF;
/*
@@ -123,66 +122,59 @@ public:
* database functions
*/
- DWORD FASTCALL GetDword (const HANDLE hContact, const char *szModule, const char *szSetting, DWORD uDefault) const;
-
- DWORD FASTCALL GetDword (const char *szModule, const char *szSetting, DWORD uDefault) const;
- DWORD FASTCALL GetDword (const char *szSetting, DWORD uDefault) const;
- DWORD FASTCALL GetDword (const HANDLE hContact, const char *szSetting, DWORD uDefault) const;
-
- int FASTCALL GetByte (const HANDLE hContact, const char *szModule, const char *szSetting, int uDefault) const;
- int FASTCALL GetByte (const char *szModule, const char *szSetting, int uDefault) const;
- int FASTCALL GetByte (const char *szSetting, int uDefault) const;
- int FASTCALL GetByte (const HANDLE hContact, const char *szSetting, int uDefault) const;
-
- INT_PTR FASTCALL GetTString (const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const;
- INT_PTR FASTCALL GetString (const HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv) const;
-
- INT_PTR FASTCALL WriteDword (const HANDLE hContact, const char *szModule, const char *szSetting, DWORD value) const;
- INT_PTR FASTCALL WriteDword (const char *szModule, const char *szSetting, DWORD value) const;
+ static DWORD __forceinline GetDword(const char *szModule, const char *szSetting, DWORD uDefault)
+ { return db_get_dw(0, szModule, szSetting, uDefault); }
+ static DWORD __forceinline GetDword(const char *szSetting, DWORD uDefault)
+ { return db_get_dw(0, SRMSGMOD_T, szSetting, uDefault); }
+ static DWORD __forceinline GetDword(const HANDLE hContact, const char *szSetting, DWORD uDefault)
+ { return db_get_dw(hContact, SRMSGMOD_T, szSetting, uDefault); }
- INT_PTR FASTCALL WriteByte (const HANDLE hContact, const char *szModule, const char *szSetting, BYTE value) const;
- INT_PTR FASTCALL WriteByte (const char *szModule, const char *szSetting, BYTE value) const;
-
- INT_PTR FASTCALL WriteTString (const HANDLE hContact, const char *szModule, const char *szSetting, const TCHAR *st) const;
+ static int __forceinline GetByte(const char *szSetting, int uDefault)
+ { return db_get_b(0, SRMSGMOD_T, szSetting, uDefault); }
+ static int __forceinline GetByte(const char *szModule, const char *szSetting, int uDefault)
+ { return(db_get_b(0, szModule, szSetting, uDefault)); }
+ static int __forceinline GetByte(const HANDLE hContact, const char *szSetting, int uDefault)
+ { return db_get_b(hContact, SRMSGMOD_T, szSetting, uDefault); }
/*
* path utilities
*/
- int pathIsAbsolute (const TCHAR *path) const;
- size_t pathToAbsolute (const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBase = 0) const;
- size_t pathToRelative (const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBase = 0) const;
+ int pathIsAbsolute(const TCHAR *path) const;
+ size_t pathToAbsolute(const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBase = 0) const;
+ size_t pathToRelative(const TCHAR *pSrc, TCHAR *pOut, const TCHAR *szBase = 0) const;
+
+ __forceinline LPCTSTR getDataPath() const { return(m_szProfilePath); }
+ __forceinline LPCTSTR getSkinPath() const { return(m_szSkinsPath); }
+ __forceinline LPCTSTR getSavedAvatarPath() const { return(m_szSavedAvatarsPath); }
+ __forceinline LPCTSTR getChatLogPath() const { return(m_szChatLogsPath); }
- const TCHAR* getDataPath() const { return(m_szProfilePath); }
- const TCHAR* getSkinPath() const { return(m_szSkinsPath); }
- const TCHAR* getSavedAvatarPath() const { return(m_szSavedAvatarsPath); }
- const TCHAR* getChatLogPath() const { return(m_szChatLogsPath); }
+ LPCTSTR getUserDir();
+ void configureCustomFolders();
+ INT_PTR foldersPathChanged();
- const TCHAR* getUserDir();
- void configureCustomFolders();
- INT_PTR foldersPathChanged();
+ void startTimer();
+ void stopTimer(const char *szMsg = 0);
+ void timerMsg(const char *szMsg);
- void startTimer();
- void stopTimer (const char *szMsg = 0);
- void timerMsg (const char *szMsg);
- __int64 getTimerStart() const { return(m_tStart); }
- __int64 getTimerStop() const { return(m_tStop); }
- __int64 getTicks() const { return(m_tStop - m_tStart); }
- double getFreq() const { return(m_dFreq); }
- double getMsec() const { return(1000 * ((double)(m_tStop - m_tStart) * m_dFreq)); }
+ __forceinline __int64 getTimerStart() const { return m_tStart; }
+ __forceinline __int64 getTimerStop() const { return m_tStop; }
+ __forceinline __int64 getTicks() const { return m_tStop - m_tStart; }
+ __forceinline double getFreq() const { return m_dFreq; }
+ __forceinline double getMsec() const { return 1000 * ((double)(m_tStop - m_tStart) * m_dFreq); }
/*
* os dependant stuff (aero, visual styles etc.)
*/
- const bool isVSAPIState() const { return m_VsAPI; }
+ const bool isVSAPIState() const { return m_VsAPI; }
/**
* return status of Vista Aero
*
* @return bool: true if aero active, false otherwise
*/
- const bool isAero() const { return(m_isAero); }
- const bool isDwmActive() const { return(m_DwmActive); }
+ const bool isAero() const { return(m_isAero); }
+ const bool isDwmActive() const { return(m_DwmActive); }
/**
* Refresh Aero status.
@@ -192,92 +184,91 @@ public:
*
* @return
*/
- bool getAeroState();
+ bool getAeroState();
/**
* return status of visual styles theming engine (Windows XP+)
*
* @return bool: themes are enabled
*/
- bool isVSThemed()
+ bool isVSThemed()
{
- return(m_isVsThemed);
+ return m_isVsThemed;
}
/*
* window lists
*/
- void BroadcastMessage (UINT msg, WPARAM wParam, LPARAM lParam);
- void BroadcastMessageAsync (UINT msg, WPARAM wParam, LPARAM lParam);
- INT_PTR AddWindow (HWND hWnd, HANDLE h);
- INT_PTR RemoveWindow (HWND hWnd);
- HWND FindWindow (HANDLE h) const;
-
- static int FoldersPathChanged(WPARAM wParam, LPARAM lParam); // hook subscriber for folders plugin
- static const TCHAR* TSAPI StriStr(const TCHAR *szString, const TCHAR *szSearchFor);
- static int TypingMessage(WPARAM wParam, LPARAM lParam);
- static int ProtoAck(WPARAM wParam, LPARAM lParam);
- static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam);
- static int DispatchNewEvent(WPARAM wParam, LPARAM lParam);
- static int MessageEventAdded(WPARAM wParam, LPARAM lParam);
+ void BroadcastMessage(UINT msg, WPARAM wParam, LPARAM lParam);
+ void BroadcastMessageAsync(UINT msg, WPARAM wParam, LPARAM lParam);
+ INT_PTR AddWindow(HWND hWnd, HANDLE h);
+ INT_PTR RemoveWindow(HWND hWnd);
+ HWND FindWindow(HANDLE h) const;
+
+ static LPCTSTR StriStr(const TCHAR *szString, const TCHAR *szSearchFor);
+
+ static int FoldersPathChanged(WPARAM wParam, LPARAM lParam); // hook subscriber for folders plugin
+ static int TypingMessage(WPARAM wParam, LPARAM lParam);
+ static int ProtoAck(WPARAM wParam, LPARAM lParam);
+ static int PrebuildContactMenu(WPARAM wParam, LPARAM lParam);
+ static int DispatchNewEvent(WPARAM wParam, LPARAM lParam);
+ static int MessageEventAdded(WPARAM wParam, LPARAM lParam);
+
public:
- HANDLE m_hMessageWindowList;
+ HANDLE m_hMessageWindowList;
/*
various function pointers
*/
- static PITA m_pfnIsThemeActive;
- static POTD m_pfnOpenThemeData;
- static PDTB m_pfnDrawThemeBackground;
- static PCTD m_pfnCloseThemeData;
- static PDTT m_pfnDrawThemeText;
- static PDTTE m_pfnDrawThemeTextEx;
- static PITBPT m_pfnIsThemeBackgroundPartiallyTransparent;
- static PDTPB m_pfnDrawThemeParentBackground;
- static PGTBCR m_pfnGetThemeBackgroundContentRect;
- static ETDT m_pfnEnableThemeDialogTexture;
- static PSLWA m_pSetLayeredWindowAttributes;
- static PFWEX m_MyFlashWindowEx;
- static PAB m_MyAlphaBlend;
- static PGF m_MyGradientFill;
- static DEFICA m_pfnDwmExtendFrameIntoClientArea;
- static DICE m_pfnDwmIsCompositionEnabled;
- static MMFW m_pfnMonitorFromWindow;
- static GMIA m_pfnGetMonitorInfoA;
- static DRT m_pfnDwmRegisterThumbnail;
- static BPI m_pfnBufferedPaintInit;
- static BPU m_pfnBufferedPaintUninit;
- static BBP m_pfnBeginBufferedPaint;
- static EBP m_pfnEndBufferedPaint;
- static BBW m_pfnDwmBlurBehindWindow;
- static DGC m_pfnDwmGetColorizationColor;
- static BPSA m_pfnBufferedPaintSetAlpha;
- static GLIX m_pfnGetLocaleInfoEx;
- static DWMSWA m_pfnDwmSetWindowAttribute;
- static DWMIIB m_pfnDwmInvalidateIconicBitmaps;
- static DWMUT m_pfnDwmUpdateThumbnailProperties;
- static DURT m_pfnDwmUnregisterThumbnail;
- static DSIT m_pfnDwmSetIconicThumbnail;
- static DSILP m_pfnDwmSetIconicLivePreviewBitmap;
- static bool m_shutDown, m_haveBufferedPaint;
+ static PITA m_pfnIsThemeActive;
+ static POTD m_pfnOpenThemeData;
+ static PDTB m_pfnDrawThemeBackground;
+ static PCTD m_pfnCloseThemeData;
+ static PDTT m_pfnDrawThemeText;
+ static PDTTE m_pfnDrawThemeTextEx;
+ static PITBPT m_pfnIsThemeBackgroundPartiallyTransparent;
+ static PDTPB m_pfnDrawThemeParentBackground;
+ static PGTBCR m_pfnGetThemeBackgroundContentRect;
+ static ETDT m_pfnEnableThemeDialogTexture;
+ static PSLWA m_pSetLayeredWindowAttributes;
+ static PFWEX m_MyFlashWindowEx;
+ static PAB m_MyAlphaBlend;
+ static PGF m_MyGradientFill;
+ static DEFICA m_pfnDwmExtendFrameIntoClientArea;
+ static DICE m_pfnDwmIsCompositionEnabled;
+ static MMFW m_pfnMonitorFromWindow;
+ static GMIA m_pfnGetMonitorInfoA;
+ static DRT m_pfnDwmRegisterThumbnail;
+ static BPI m_pfnBufferedPaintInit;
+ static BPU m_pfnBufferedPaintUninit;
+ static BBP m_pfnBeginBufferedPaint;
+ static EBP m_pfnEndBufferedPaint;
+ static BBW m_pfnDwmBlurBehindWindow;
+ static DGC m_pfnDwmGetColorizationColor;
+ static BPSA m_pfnBufferedPaintSetAlpha;
+ static GLIX m_pfnGetLocaleInfoEx;
+ static DWMSWA m_pfnDwmSetWindowAttribute;
+ static DWMIIB m_pfnDwmInvalidateIconicBitmaps;
+ static DWMUT m_pfnDwmUpdateThumbnailProperties;
+ static DURT m_pfnDwmUnregisterThumbnail;
+ static DSIT m_pfnDwmSetIconicThumbnail;
+ static DSILP m_pfnDwmSetIconicLivePreviewBitmap;
+ static bool m_shutDown, m_haveBufferedPaint;
private:
- TCHAR m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2];
- HMODULE m_hUxTheme, m_hDwmApi;
- bool m_VsAPI;
- bool m_isAero;
- bool m_DwmActive;
- bool m_isVsThemed;
- HANDLE m_hDataPath, m_hSkinsPath, m_hAvatarsPath, m_hChatLogsPath;
- __int64 m_tStart, m_tStop, m_tFreq;
- double m_dFreq;
- char m_timerMsg[256];
- bool m_haveFolders;
- HANDLE m_hChatLogLock;
+ TCHAR m_szProfilePath[MAX_PATH + 2], m_szSkinsPath[MAX_PATH + 2], m_szSavedAvatarsPath[MAX_PATH + 2], m_szChatLogsPath[MAX_PATH + 2];
+ HMODULE m_hUxTheme, m_hDwmApi;
+ bool m_VsAPI, m_isAero, m_DwmActive, m_isVsThemed;
+ HANDLE m_hDataPath, m_hSkinsPath, m_hAvatarsPath, m_hChatLogsPath;
+ __int64 m_tStart, m_tStop, m_tFreq;
+ double m_dFreq;
+ char m_timerMsg[256];
+ bool m_hasFolders;
+ HANDLE m_hChatLogLock;
void InitAPI();
void InitPaths();
private:
- static TCHAR m_userDir[MAX_PATH + 2];
+ static TCHAR m_userDir[MAX_PATH + 2];
};
inline void CMimAPI::startTimer()
@@ -293,6 +284,6 @@ inline void CMimAPI::stopTimer(const char *szMsg)
timerMsg(szMsg);
}
-extern CMimAPI *M;
+extern CMimAPI M;
#endif /* __MIM_H */
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp
index 7288c5b986..ef2ba6b72d 100644
--- a/plugins/TabSRMM/src/modplus.cpp
+++ b/plugins/TabSRMM/src/modplus.cpp
@@ -56,7 +56,7 @@ static TCHAR* getMenuEntry(int i)
DBVARIANT dbv = {0};
mir_snprintf(MEntry, 255, "MenuEntry_%u", i);
- if ( !M->GetTString(NULL, "tabmodplus",MEntry, &dbv)) {
+ if ( !db_get_ts(NULL, "tabmodplus",MEntry, &dbv)) {
msg = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -127,7 +127,7 @@ static int CustomButtonPressed(WPARAM wParam,LPARAM lParam)
int menulimit;
HMENU hMenu=NULL;
- menulimit = M->GetByte("tabmodplus","MenuCount", 0);
+ menulimit = M.GetByte("tabmodplus","MenuCount", 0);
if ( menulimit ) {
hMenu = CreatePopupMenu();
//pszMenu=malloc(menulimit*sizeof(TCHAR*));
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index 3e109d2a20..93fca151f3 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -114,7 +114,7 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt)
CHARRANGE sel, all = { 0, -1};
int iSelection;
unsigned oldCodepage = dat->codePage;
- int iPrivateBG = M->GetByte(dat->hContact, "private_bg", 0);
+ int iPrivateBG = M.GetByte(dat->hContact, "private_bg", 0);
MessageWindowPopupData mwpd;
HWND hwndDlg = dat->hwnd;
@@ -177,7 +177,7 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt)
if (((iSelection > 800 && iSelection < 1400) || iSelection == 20866) && idFrom == IDC_LOG) {
dat->codePage = iSelection;
- M->WriteDword(dat->hContact, SRMSGMOD_T, "ANSIcodepage", dat->codePage);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "ANSIcodepage", dat->codePage);
} else if (iSelection == 500 && idFrom == IDC_LOG) {
dat->codePage = CP_ACP;
db_unset(dat->hContact, SRMSGMOD_T, "ANSIcodepage");
@@ -215,8 +215,8 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt)
break;
case ID_EDITOR_SHOWMESSAGELENGTHINDICATOR:
PluginConfig.m_visualMessageSizeIndicator = !PluginConfig.m_visualMessageSizeIndicator;
- M->WriteByte(SRMSGMOD_T, "msgsizebar", (BYTE)PluginConfig.m_visualMessageSizeIndicator);
- M->BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 0);
+ db_set_b(0, SRMSGMOD_T, "msgsizebar", (BYTE)PluginConfig.m_visualMessageSizeIndicator);
+ M.BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 0);
SendMessage(hwndDlg, WM_SIZE, 0, 0);
if (dat->pContainer->hwndStatus)
RedrawWindow(dat->pContainer->hwndStatus, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW);
@@ -418,7 +418,7 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg)
pt.x = rcRTF.left;
pt.y = rcRTF.top;
if (dat->hwndIEView) {
- if (M->GetByte("subclassIEView", 0)) {
+ if (M.GetByte("subclassIEView", 0)) {
mir_subclassWindow(dat->hwndIEView, IEViewSubclassProc);
SetWindowPos(dat->hwndIEView, 0, 0, 0, 0, 0, SWP_FRAMECHANGED|SWP_NOMOVE|SWP_NOSIZE|SWP_NOZORDER|SWP_DRAWFRAME);
RedrawWindow(dat->hwndIEView, 0, 0, RDW_FRAME|RDW_INVALIDATE|RDW_UPDATENOW);
@@ -438,7 +438,7 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg)
PostMessage(hwndDlg, DM_UPDATEPICLAYOUT, 0, 0);
}
BB_SetButtonsPos(dat);
- if (M->isAero())
+ if (M.isAero())
InvalidateRect(hwndTab, NULL, FALSE);
if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->setActiveItem(dat);
@@ -464,7 +464,7 @@ void TSAPI SetDialogToType(HWND hwndDlg)
showToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
if (dat->hContact) {
- if (M->GetByte(dat->hContact, "CList", "NotOnList", 0)) {
+ if (db_get_b(dat->hContact, "CList", "NotOnList", 0)) {
dat->bNotOnList = TRUE;
ShowMultipleControls(hwndDlg, addControls, 2, SW_SHOW);
Utils::showDlgControl(hwndDlg, IDC_LOGFROZENTEXT, SW_SHOW);
@@ -686,7 +686,7 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
if (hClip = GetClipboardData(CF_TEXT)) {
if (lstrlenA((char *)hClip) > mwdat->nMax) {
TCHAR szBuffer[512];
- if (M->GetByte("autosplit", 0))
+ if (M.GetByte("autosplit", 0))
_sntprintf(szBuffer, 512, TranslateT("WARNING: The message you are trying to paste exceeds the message size limit for the active protocol. It will be sent in chunks of max %d characters"), mwdat->nMax - 10);
else
_sntprintf(szBuffer, 512, TranslateT("The message you are trying to paste exceeds the message size limit for the active protocol. Only the first %d characters will be sent."), mwdat->nMax);
@@ -951,7 +951,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
if (dat && CSkin::m_skinEnabled)
CSkin::SkinDrawBG(hwnd, dat->pContainer->hwnd, dat->pContainer, &rc, dc);
- else if (M->isAero() || M->isVSThemed()) {
+ else if (M.isAero() || M.isVSThemed()) {
if (ctrlId == IDC_PANELSPLITTER) {
EndPaint(hwnd, &ps);
return 0;
@@ -1000,7 +1000,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
HWND hwndParent = GetParent(hwnd);
dat->dwFlagsEx |= MWF_SHOW_SPLITTEROVERRIDE;
- M->WriteByte(dat->hContact, SRMSGMOD_T, "splitoverride", 1);
+ db_set_b(dat->hContact, SRMSGMOD_T, "splitoverride", 1);
if (dat->bType == SESSIONTYPE_IM)
SaveSplitter(dat);
}
@@ -1019,7 +1019,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case ID_SPLITTERCONTEXT_SAVEGLOBALFORALLSESSIONS:
{
RECT rcWin;
- BYTE bSync = M->GetByte("Chat", "SyncSplitter", 0);
+ BYTE bSync = M.GetByte("Chat", "SyncSplitter", 0);
DWORD dwOff_IM = 0, dwOff_CHAT = 0;
dwOff_CHAT = -(2 + (PluginConfig.g_DPIscaleY > 1.0 ? 1 : 0));
@@ -1035,7 +1035,7 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
PluginConfig.lastSPlitterPos.off_im = dwOff_IM;
PluginConfig.lastSPlitterPos.bSync = bSync;
SendMessage(dat->hwnd, DM_SPLITTERGLOBALEVENT, 0, 0);
- M->BroadcastMessage(DM_SPLITTERGLOBALEVENT, 0, 0);
+ M.BroadcastMessage(DM_SPLITTERGLOBALEVENT, 0, 0);
}
break;
@@ -1308,7 +1308,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dat->cache = CContactCache::getContactCache(dat->hContact);
dat->cache->updateState();
dat->cache->setWindowData(hwndDlg, dat);
- M->AddWindow(hwndDlg, dat->hContact);
+ M.AddWindow(hwndDlg, dat->hContact);
BroadCastContainer(m_pContainer, DM_REFRESHTABINDEX, 0, 0);
dat->pWnd = 0;
CProxyWindow::add(dat);
@@ -1333,9 +1333,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
mir_subclassWindow(dat->hwndPanelPicParent, CInfoPanel::avatarParentSubclass);
dat->showUIElements = m_pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
- dat->sendMode |= M->GetByte(dat->hContact, "forceansi", 0) ? SMODE_FORCEANSI : 0;
+ dat->sendMode |= M.GetByte(dat->hContact, "forceansi", 0) ? SMODE_FORCEANSI : 0;
dat->sendMode |= dat->hContact == 0 ? SMODE_MULTIPLE : 0;
- dat->sendMode |= M->GetByte(dat->hContact, "no_ack", 0) ? SMODE_NOACK : 0;
+ dat->sendMode |= M.GetByte(dat->hContact, "no_ack", 0) ? SMODE_NOACK : 0;
dat->hQueuedEvents = (HANDLE*)calloc(sizeof(HANDLE), EVENT_QUEUE_SIZE);
dat->iEventQueueSize = EVENT_QUEUE_SIZE;
@@ -1346,7 +1346,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
* hHistoryEvents holds up to n event handles
*/
- dat->maxHistory = M->GetDword(dat->hContact, "maxhist", M->GetDword("maxhist", 0));
+ dat->maxHistory = M.GetDword(dat->hContact, "maxhist", M.GetDword("maxhist", 0));
dat->curHistory = 0;
if (dat->maxHistory)
dat->hHistoryEvents = (HANDLE *)malloc(dat->maxHistory * sizeof(HANDLE));
@@ -1361,7 +1361,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dat->mayFlashTab = FALSE;
GetMyNick(dat);
- dat->multiSplitterX = (int) M->GetDword(SRMSGMOD, "multisplit", 150);
+ dat->multiSplitterX = (int) M.GetDword(SRMSGMOD, "multisplit", 150);
dat->nTypeMode = PROTOTYPE_SELFTYPING_OFF;
SetTimer(hwndDlg, TIMERID_TYPE, 1000, NULL);
dat->iLastEventType = 0xffffffff;
@@ -1373,7 +1373,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
* consider per-contact message setting overrides
*/
- if (M->GetDword(dat->hContact, "mwmask", 0))
+ if (M.GetDword(dat->hContact, "mwmask", 0))
if (dat->hContact)
LoadLocalFlags(hwndDlg, dat);
@@ -1381,20 +1381,20 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
* allow disabling emoticons per contact (note: currently unused feature)
*/
- dwLocalSmAdd = (int)M->GetByte(dat->hContact, "doSmileys", 0xff);
+ dwLocalSmAdd = (int)M.GetByte(dat->hContact, "doSmileys", 0xff);
if (dwLocalSmAdd != 0xffffffff)
dat->doSmileys = dwLocalSmAdd;
DM_InitTip(dat);
dat->Panel->getVisibility();
- dat->dwFlagsEx |= M->GetByte(dat->hContact, "splitoverride", 0) ? MWF_SHOW_SPLITTEROVERRIDE : 0;
+ dat->dwFlagsEx |= M.GetByte(dat->hContact, "splitoverride", 0) ? MWF_SHOW_SPLITTEROVERRIDE : 0;
dat->fIsAutosizingInput = IsAutoSplitEnabled(dat);
dat->iInputAreaHeight = -1;
SetMessageLog(dat);
dat->panelWidth = -1;
if (dat->hContact) {
- dat->codePage = M->GetDword(dat->hContact, "ANSIcodepage", CP_ACP);
+ dat->codePage = M.GetDword(dat->hContact, "ANSIcodepage", CP_ACP);
dat->Panel->loadHeight();
}
@@ -1460,7 +1460,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
#else
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_SCROLL | ENM_KEYEVENTS | ENM_CHANGE);
#endif
- dat->bActualHistory = M->GetByte(dat->hContact, "ActualHistory", 0);
+ dat->bActualHistory = M.GetByte(dat->hContact, "ActualHistory", 0);
/* OnO: higligh lines to their end */
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
@@ -1634,7 +1634,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
bool fInfoPanel = dat->Panel->isActive();
- bool fAero = M->isAero();
+ bool fAero = M.isAero();
if (CSkin::m_skinEnabled) {
CSkinItem *item;
@@ -1674,7 +1674,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
else {
CSkin::FillBack(hdcMem, &rcClient);
- if (M->isAero()) {
+ if (M.isAero()) {
LONG temp = rcClient.bottom;
rcClient.bottom = dat->Panel->isActive() ? dat->Panel->getHeight() + 5 : 5;
FillRect(hdcMem, &rcClient, (HBRUSH)GetStockObject(BLACK_BRUSH));
@@ -1921,10 +1921,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
return(_dlgReturn(hwndDlg, 1));
case TABSRMM_HK_TOGGLERTL:
{
- DWORD dwGlobal = M->GetDword("mwflags", MWF_LOG_DEFAULT);
+ DWORD dwGlobal = M.GetDword("mwflags", MWF_LOG_DEFAULT);
DWORD dwOldFlags = dat->dwFlags;
- DWORD dwMask = M->GetDword(dat->hContact, "mwmask", 0);
- DWORD dwFlags = M->GetDword(dat->hContact, "mwflags", 0);
+ DWORD dwMask = M.GetDword(dat->hContact, "mwmask", 0);
+ DWORD dwFlags = M.GetDword(dat->hContact, "mwflags", 0);
dat->dwFlags ^= MWF_LOG_RTL;
if ((dwGlobal & MWF_LOG_RTL) != (dat->dwFlags & MWF_LOG_RTL)) {
@@ -1936,8 +1936,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dwFlags &= ~MWF_LOG_RTL;
}
if (dwMask) {
- M->WriteDword(dat->hContact, SRMSGMOD_T, "mwmask", dwMask);
- M->WriteDword(dat->hContact, SRMSGMOD_T, "mwflags", dwFlags);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "mwmask", dwMask);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "mwflags", dwFlags);
}
else {
db_unset(dat->hContact, SRMSGMOD_T, "mwmask");
@@ -2192,7 +2192,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_EXGETSEL, 0, (LPARAM)&cr);
if (cr.cpMax != cr.cpMin) {
cr.cpMin = cr.cpMax;
- if (isCtrl && M->GetByte("autocopy", 1)) {
+ if (isCtrl && M.GetByte("autocopy", 1)) {
SETTEXTEX stx = {ST_KEEPUNDO | ST_SELECTION, CP_UTF8};
char *streamOut = NULL;
if (isAlt)
@@ -2205,7 +2205,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
free(streamOut);
}
SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
- } else if (M->GetByte("autocopy", 1) && !isShift) {
+ } else if (M.GetByte("autocopy", 1) && !isShift) {
SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_COPY, 0, 0);
SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
if (m_pContainer->hwndStatus)
@@ -2333,7 +2333,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (szProto) {
dat->hTabIcon = dat->hTabStatusIcon = MY_GetContactIcon(dat);
- if (M->GetByte("use_xicons", 1))
+ if (M.GetByte("use_xicons", 1))
dat->hXStatusIcon = GetXStatusIcon(dat);
SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, BUTTONSETASDIMMED, (dat->dwFlagsEx & MWF_SHOW_ISIDLE) != 0, 0);
SendDlgItemMessage(hwndDlg, IDC_PROTOCOL, BM_SETIMAGE, IMAGE_ICON, (LPARAM)(dat->hXStatusIcon ? dat->hXStatusIcon : dat->hTabIcon));
@@ -2513,7 +2513,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
dat->panelWidth = -1;
//SetAeroMargins(dat->pContainer);
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE);
- if (M->isAero())
+ if (M.isAero())
InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
break;
}
@@ -2530,7 +2530,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if ((HWND) wParam == hwndDlg)
SendMessage(hwndDlg, DM_REMAKELOG, 0, 0);
else {
- if (M->GetByte(dat->hContact, "mwoverride", 0) == 0) {
+ if (M.GetByte(dat->hContact, "mwoverride", 0) == 0) {
dat->dwFlags &= ~(MWF_LOG_ALL);
dat->dwFlags |= (lParam & MWF_LOG_ALL);
dat->dwFlags |= MWF_DEFERREDREMAKELOG;
@@ -2884,7 +2884,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
_snprintf(szIndex, 8, "%d", iSelection - IDM_CONTAINERMENU);
if (iSelection - IDM_CONTAINERMENU >= 0) {
- if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
+ if (!db_get_ts(NULL, szKey, szIndex, &dbv)) {
SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -3055,7 +3055,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
DeletePopupsForContact(dat->hContact, PU_REMOVE_ON_SEND);
- if (M->GetByte("allow_sendhook", 0)) {
+ if (M.GetByte("allow_sendhook", 0)) {
int result = TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_CUSTOM, MAKELONG(flags, tabMSG_WINDOW_EVT_CUSTOM_BEFORESEND));
if (result)
return TRUE;
@@ -3070,7 +3070,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TCHAR* szQuoted, *szText;
char* szFromStream = NULL;
HANDLE hDBEvent = 0;
- int iCharsPerLine = M->GetDword("quoteLineLength", 64);
+ int iCharsPerLine = M.GetDword("quoteLineLength", 64);
TCHAR *szConverted;
int iAlloced = 0;
unsigned int iSize = 0;
@@ -3167,7 +3167,7 @@ quote_from_last:
acs.handleType = HANDLE_CONTACT;
acs.szProto = 0;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)hwndDlg, (LPARAM)& acs);
- if (!M->GetByte(dat->hContact, "CList", "NotOnList", 0)) {
+ if (!db_get_b(dat->hContact, "CList", "NotOnList", 0)) {
dat->bNotOnList = FALSE;
ShowMultipleControls(hwndDlg, addControls, 2, SW_HIDE);
if (!(dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED))
@@ -3240,12 +3240,12 @@ quote_from_last:
if (iSelection < 1000 && iSelection >= 100) { // the "force" submenu...
if (iSelection == 999) { // un-force
if (CallService(MS_MC_UNFORCESENDCONTACT, (WPARAM)dat->hContact, 0) == 0)
- M->WriteDword(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", -1);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", -1);
else
_DebugPopup(dat->hContact, TranslateT("Unforce failed"));
} else {
if (CallService(MS_MC_FORCESENDCONTACTNUM, (WPARAM)dat->hContact, (LPARAM)(iSelection - 100)) == 0)
- M->WriteDword(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", (DWORD)(iSelection - 100));
+ db_set_dw(dat->hContact, SRMSGMOD_T, "tabSRMM_forced", (DWORD)(iSelection - 100));
else
_DebugPopup(dat->hContact, TranslateT("The selected protocol cannot be forced at this time"));
}
@@ -3296,7 +3296,7 @@ quote_from_last:
pNewContainer = FindContainerByName(szNewName);
if (pNewContainer == NULL)
pNewContainer = CreateContainer(szNewName, FALSE, dat->hContact);
- M->WriteTString(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
+ db_set_ts(dat->hContact, SRMSGMOD_T, "containerW", szNewName);
dat->fIsReattach = TRUE;
PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_DOCREATETAB, (WPARAM)pNewContainer, (LPARAM)dat->hContact);
if (iOldItems > 1) // there were more than 1 tab, container is still valid
@@ -3354,7 +3354,7 @@ quote_from_last:
case DM_UPDATEMETACONTACTINFO: // update the icon in the statusbar for the "most online" protocol
{
DWORD isForced;
- if ((isForced = M->GetDword(dat->hContact, "tabSRMM_forced", -1)) >= 0) {
+ if ((isForced = M.GetDword(dat->hContact, "tabSRMM_forced", -1)) >= 0) {
char szTemp[64];
mir_snprintf(szTemp, sizeof(szTemp), "Status%d", isForced);
if (db_get_w(dat->hContact, PluginConfig.szMetaName, szTemp, 0) == ID_STATUS_OFFLINE) {
@@ -3694,10 +3694,10 @@ quote_from_last:
UpdateTrayMenuState(dat, FALSE); // remove me from the tray menu (if still there)
if (PluginConfig.g_hMenuTrayUnread)
DeleteMenu(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->hContact, MF_BYCOMMAND);
- M->RemoveWindow(hwndDlg);
+ M.RemoveWindow(hwndDlg);
if (dat->cache->isValid())
- M->WriteDword(SRMSGMOD, "multisplit", dat->multiSplitterX);
+ db_set_dw(0, SRMSGMOD, "multisplit", dat->multiSplitterX);
{
HFONT hFont = (HFONT) SendDlgItemMessage(hwndDlg, IDC_MESSAGE, WM_GETFONT, 0, 0);
@@ -3763,8 +3763,8 @@ quote_from_last:
if (m_pContainer->dwFlags & CNT_SIDEBAR)
m_pContainer->SideBar->removeSession(dat);
dat->cache->setWindowData();
- if (dat->cache->isValid() && !dat->fIsReattach && dat->hContact && M->GetByte("deletetemp", 0))
- if (M->GetByte(dat->hContact, "CList", "NotOnList", 0))
+ if (dat->cache->isValid() && !dat->fIsReattach && dat->hContact && M.GetByte("deletetemp", 0))
+ if (db_get_b(dat->hContact, "CList", "NotOnList", 0))
CallService(MS_DB_CONTACT_DELETE, (WPARAM)dat->hContact, 0);
delete dat->Panel;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 7b03ab7480..9c3ccb7127 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -105,7 +105,7 @@ void TSAPI RearrangeTab(HWND hwndDlg, const TWindowData *dat, int iMode, BOOL fS
BroadCastContainer(dat->pContainer, DM_REFRESHTABINDEX, 0, 0);
ActivateTabFromHWND(hwndTab, hwndDlg);
if (fSavePos)
- M->WriteDword(dat->hContact, SRMSGMOD_T, "tabindex", newIndex * 100);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "tabindex", newIndex * 100);
}
}
@@ -157,7 +157,7 @@ static void SaveAvatarToFile(TWindowData *dat, HBITMAP hbm, int isOwnPic)
TCHAR *szProto = mir_a2t(dat->cache->getActiveProto());
- mir_sntprintf(szFinalPath, MAX_PATH, _T("%s\\%s"), M->getSavedAvatarPath(), szProto);
+ mir_sntprintf(szFinalPath, MAX_PATH, _T("%s\\%s"), M.getSavedAvatarPath(), szProto);
mir_free(szProto);
if (CreateDirectory(szFinalPath, 0) == 0) {
@@ -282,7 +282,7 @@ void TSAPI CalcDynamicAvatarSize(TWindowData *dat, BITMAP *bminfo)
if (PluginConfig.m_LimitStaticAvatarHeight > 0)
dat->iRealAvatarHeight = min(dat->iRealAvatarHeight, PluginConfig.m_LimitStaticAvatarHeight);
- if (M->GetByte(dat->hContact, "dontscaleavatars", M->GetByte("dontscaleavatars", 0)))
+ if (M.GetByte(dat->hContact, "dontscaleavatars", M.GetByte("dontscaleavatars", 0)))
dat->iRealAvatarHeight = min(bminfo->bmHeight, dat->iRealAvatarHeight);
if (bminfo->bmHeight != 0)
@@ -306,12 +306,12 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID)
SESSION_INFO *si = (SESSION_INFO *)dat->si;
int iTabs = TabCtrl_GetItemCount(GetParent(hwndDlg));
- EnableMenuItem(submenu, ID_TABMENU_ATTACHTOCONTAINER, M->GetByte("useclistgroups", 0) || M->GetByte("singlewinmode", 0) ? MF_GRAYED : MF_ENABLED);
- EnableMenuItem(submenu, ID_TABMENU_CLEARSAVEDTABPOSITION, (M->GetDword(dat->hContact, "tabindex", -1) != -1) ? MF_ENABLED : MF_GRAYED);
+ EnableMenuItem(submenu, ID_TABMENU_ATTACHTOCONTAINER, M.GetByte("useclistgroups", 0) || M.GetByte("singlewinmode", 0) ? MF_GRAYED : MF_ENABLED);
+ EnableMenuItem(submenu, ID_TABMENU_CLEARSAVEDTABPOSITION, (M.GetDword(dat->hContact, "tabindex", -1) != -1) ? MF_ENABLED : MF_GRAYED);
} else if (menuID == MENU_PICMENU) {
MENUITEMINFO mii = {0};
TCHAR *szText = NULL;
- char avOverride = (char)M->GetByte(dat->hContact, "hideavatar", -1);
+ char avOverride = (char)M.GetByte(dat->hContact, "hideavatar", -1);
HMENU visMenu = GetSubMenu(submenu, 0);
BOOL picValid = fInfoPanel ? (dat->hOwnPic != 0) : (dat->ace && dat->ace->hbmPic && dat->ace->hbmPic != PluginConfig.g_hbmUnknown);
mii.cbSize = sizeof(mii);
@@ -338,7 +338,7 @@ int TSAPI MsgWindowUpdateMenu(TWindowData *dat, HMENU submenu, int menuID)
SetMenuItemInfo(submenu, ID_PICMENU_SETTINGS, FALSE, &mii);
} else if (menuID == MENU_PANELPICMENU) {
HMENU visMenu = GetSubMenu(submenu, 0);
- char avOverride = (char)M->GetByte(dat->hContact, "hideavatar", -1);
+ char avOverride = (char)M.GetByte(dat->hContact, "hideavatar", -1);
CheckMenuItem(visMenu, ID_VISIBILITY_DEFAULT, MF_BYCOMMAND | (avOverride == -1 ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(visMenu, ID_VISIBILITY_HIDDENFORTHISCONTACT, MF_BYCOMMAND | (avOverride == 0 ? MF_CHECKED : MF_UNCHECKED));
@@ -373,7 +373,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId)
SendMessage(hwndDlg, WM_CLOSE, 1, 0);
return 1;
case ID_TABMENU_SAVETABPOSITION:
- M->WriteDword(dat->hContact, SRMSGMOD_T, "tabindex", dat->iTabID * 100);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "tabindex", dat->iTabID * 100);
break;
case ID_TABMENU_CLEARSAVEDTABPOSITION:
db_unset(dat->hContact, SRMSGMOD_T, "tabindex");
@@ -400,7 +400,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId)
avOverrideMode = 0;
else if (selection == ID_VISIBILITY_VISIBLEFORTHISCONTACT)
avOverrideMode = 1;
- M->WriteByte(dat->hContact, SRMSGMOD_T, "hideavatar", avOverrideMode);
+ db_set_b(dat->hContact, SRMSGMOD_T, "hideavatar", avOverrideMode);
dat->panelWidth = -1;
ShowPicture(dat, FALSE);
SendMessage(hwndDlg, WM_SIZE, 0, 0);
@@ -409,8 +409,8 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId)
}
case ID_PICMENU_ALWAYSKEEPTHEBUTTONBARATFULLWIDTH:
PluginConfig.m_AlwaysFullToolbarWidth = !PluginConfig.m_AlwaysFullToolbarWidth;
- M->WriteByte(SRMSGMOD_T, "alwaysfulltoolbar", (BYTE)PluginConfig.m_AlwaysFullToolbarWidth);
- M->BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
+ db_set_b(0, SRMSGMOD_T, "alwaysfulltoolbar", (BYTE)PluginConfig.m_AlwaysFullToolbarWidth);
+ M.BroadcastMessage(DM_CONFIGURETOOLBAR, 0, 1);
break;
case ID_PICMENU_SAVETHISPICTUREAS:
if (dat->Panel->isActive()) {
@@ -441,8 +441,8 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId)
}
else if (menuId == MENU_LOGMENU) {
int iLocalTime = 0;
- int iRtl = (PluginConfig.m_RTLDefault == 0 ? M->GetByte(dat->hContact, "RTL", 0) : M->GetByte(dat->hContact, "RTL", 1));
- int iLogStatus = (PluginConfig.m_LogStatusChanges != 0) && M->GetByte(dat->hContact, "logstatuschanges", 0);
+ int iRtl = (PluginConfig.m_RTLDefault == 0 ? M.GetByte(dat->hContact, "RTL", 0) : M.GetByte(dat->hContact, "RTL", 1));
+ int iLogStatus = (PluginConfig.m_LogStatusChanges != 0) && M.GetByte(dat->hContact, "logstatuschanges", 0);
DWORD dwOldFlags = dat->dwFlags;
@@ -451,7 +451,7 @@ int TSAPI MsgWindowMenuHandler(TWindowData *dat, int selection, int menuId)
{
OPENOPTIONSDIALOG ood = { sizeof(ood) };
ood.pszPage = "Message Sessions";
- M->WriteByte(SRMSGMOD_T, "opage", 3); // force 3th tab to appear
+ db_set_b(0, SRMSGMOD_T, "opage", 3); // force 3th tab to appear
Options_Open(&ood);
}
return 1;
@@ -577,7 +577,7 @@ int TSAPI GetAvatarVisibility(HWND hwndDlg, struct TWindowData *dat)
{
BYTE bAvatarMode = dat->pContainer->avatarMode;
BYTE bOwnAvatarMode = dat->pContainer->ownAvatarMode;
- char hideOverride = (char)M->GetByte(dat->hContact, "hideavatar", -1);
+ char hideOverride = (char)M.GetByte(dat->hContact, "hideavatar", -1);
// infopanel visible, consider own avatar display
dat->showPic = 0;
@@ -1254,14 +1254,14 @@ UINT TSAPI GetIEViewMode(HWND hwndDlg, HANDLE hContact)
if (g_HPPAvail == -1)
g_HPPAvail = ServiceExists("History++/ExtGrid/NewWindow");
- PluginConfig.g_WantIEView = g_IEViewAvail && M->GetByte("default_ieview", 0);
- PluginConfig.g_WantHPP = g_HPPAvail && M->GetByte("default_hpp", 0);
+ PluginConfig.g_WantIEView = g_IEViewAvail && M.GetByte("default_ieview", 0);
+ PluginConfig.g_WantHPP = g_HPPAvail && M.GetByte("default_hpp", 0);
- iWantIEView = (PluginConfig.g_WantIEView) || (M->GetByte(hContact, "ieview", 0) == 1 && g_IEViewAvail);
- iWantIEView = (M->GetByte(hContact, "ieview", 0) == (BYTE) - 1) ? 0 : iWantIEView;
+ iWantIEView = (PluginConfig.g_WantIEView) || (M.GetByte(hContact, "ieview", 0) == 1 && g_IEViewAvail);
+ iWantIEView = (M.GetByte(hContact, "ieview", 0) == (BYTE) - 1) ? 0 : iWantIEView;
- iWantHPP = (PluginConfig.g_WantHPP) || (M->GetByte(hContact, "hpplog", 0) == 1 && g_HPPAvail);
- iWantHPP = (M->GetByte(hContact, "hpplog", 0) == (BYTE) - 1) ? 0 : iWantHPP;
+ iWantHPP = (PluginConfig.g_WantHPP) || (M.GetByte(hContact, "hpplog", 0) == 1 && g_HPPAvail);
+ iWantHPP = (M.GetByte(hContact, "hpplog", 0) == (BYTE) - 1) ? 0 : iWantHPP;
return iWantHPP ? WANT_HPP_LOG : (iWantIEView ? WANT_IEVIEW_LOG : 0);
}
@@ -1377,7 +1377,7 @@ void TSAPI SwitchMessageLog(TWindowData *dat, int iMode)
SendMessage(hwndDlg, WM_SIZE, 0, 0);
if (dat->hwndIEView) {
- if (M->GetByte("subclassIEView", 0)&&dat->oldIEViewProc == 0) {
+ if (M.GetByte("subclassIEView", 0)&&dat->oldIEViewProc == 0) {
WNDPROC wndProc = (WNDPROC)SetWindowLongPtr(dat->hwndIEView, GWLP_WNDPROC, (LONG_PTR)IEViewSubclassProc);
dat->oldIEViewProc = wndProc;
}
@@ -1392,9 +1392,9 @@ void TSAPI SwitchMessageLog(TWindowData *dat, int iMode)
void TSAPI FindFirstEvent(TWindowData *dat)
{
- int historyMode = (int)M->GetByte(dat->hContact, SRMSGMOD, SRMSGSET_LOADHISTORY, -1);
+ int historyMode = db_get_b(dat->hContact, SRMSGMOD, SRMSGSET_LOADHISTORY, -1);
if (historyMode == -1)
- historyMode = (int)M->GetByte(SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY);
+ historyMode = (int)M.GetByte(SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY);
dat->hDbEventFirst = db_event_firstUnread(dat->hContact);
@@ -1473,12 +1473,12 @@ void TSAPI SaveSplitter(TWindowData *dat)
dat->splitterY = DPISCALEY_S(MINSPLITTERY);
if (dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE)
- M->WriteDword(dat->hContact, SRMSGMOD_T, "splitsplity", dat->splitterY);
+ db_set_dw(dat->hContact, SRMSGMOD_T, "splitsplity", dat->splitterY);
else {
if (dat->pContainer->settings->fPrivate)
dat->pContainer->settings->splitterPos = dat->splitterY;
else
- M->WriteDword(SRMSGMOD_T, "splitsplity", dat->splitterY);
+ db_set_dw(0, SRMSGMOD_T, "splitsplity", dat->splitterY);
}
}
@@ -1492,11 +1492,11 @@ void TSAPI LoadSplitter(TWindowData *dat)
#endif
if (!(dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE))
if (!dat->pContainer->settings->fPrivate)
- dat->splitterY = (int)M->GetDword("splitsplity", (DWORD) 60);
+ dat->splitterY = (int)M.GetDword("splitsplity", (DWORD) 60);
else
dat->splitterY = dat->pContainer->settings->splitterPos;
else
- dat->splitterY = (int)M->GetDword(dat->hContact, "splitsplity", M->GetDword("splitsplity", (DWORD) 70));
+ dat->splitterY = (int)M.GetDword(dat->hContact, "splitsplity", M.GetDword("splitsplity", (DWORD) 70));
if (dat->splitterY < MINSPLITTERY || dat->splitterY < 0)
dat->splitterY = 150;
@@ -1525,7 +1525,7 @@ void TSAPI GetSendFormat(TWindowData *dat, int mode)
int i;
if (mode) {
- dat->SendFormat = M->GetDword(dat->hContact, "sendformat", PluginConfig.m_SendFormat);
+ dat->SendFormat = M.GetDword(dat->hContact, "sendformat", PluginConfig.m_SendFormat);
if (dat->SendFormat == -1) // per contact override to disable it..
dat->SendFormat = 0;
else if (dat->SendFormat == 0)
@@ -1692,7 +1692,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat)
if (!dat)
return 0;
- bool fAero = M->isAero();
+ bool fAero = M.isAero();
HWND hwndDlg = dat->hwnd;
if (dis->CtlType == ODT_MENU && dis->hwndItem == (HWND)GetSubMenu(PluginConfig.g_hMenuContext, 7)) {
@@ -1880,7 +1880,7 @@ int TSAPI MsgWindowDrawHandler(WPARAM wParam, LPARAM lParam, TWindowData *dat)
hbmDraw = CreateCompatibleBitmap(dis->hDC, cx, cy);
hbmOld = (HBITMAP)SelectObject(hdcDraw, hbmDraw);
- bool fAero = M->isAero();
+ bool fAero = M.isAero();
hOldBrush = (HBRUSH)SelectObject(hdcDraw, fAero ? (HBRUSH)GetStockObject(HOLLOW_BRUSH) : GetSysColorBrush(COLOR_3DFACE));
rcFrame = rcClient;
@@ -2062,20 +2062,20 @@ void TSAPI LoadThemeDefaults(TContainerData *pContainer)
COLORREF colour;
ZeroMemory(&pContainer->theme, sizeof(TLogTheme));
- pContainer->theme.bg = M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, GetSysColor(COLOR_WINDOW));
+ pContainer->theme.bg = M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, GetSysColor(COLOR_WINDOW));
pContainer->theme.statbg = PluginConfig.crStatus;
pContainer->theme.oldinbg = PluginConfig.crOldIncoming;
pContainer->theme.oldoutbg = PluginConfig.crOldOutgoing;
pContainer->theme.inbg = PluginConfig.crIncoming;
pContainer->theme.outbg = PluginConfig.crOutgoing;
- pContainer->theme.hgrid = M->GetDword(FONTMODULE, "hgrid", RGB(224, 224, 224));
- pContainer->theme.left_indent = M->GetDword("IndentAmount", 20) * 15;
- pContainer->theme.right_indent = M->GetDword("RightIndent", 20) * 15;
- pContainer->theme.inputbg = M->GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
+ pContainer->theme.hgrid = M.GetDword(FONTMODULE, "hgrid", RGB(224, 224, 224));
+ pContainer->theme.left_indent = M.GetDword("IndentAmount", 20) * 15;
+ pContainer->theme.right_indent = M.GetDword("RightIndent", 20) * 15;
+ pContainer->theme.inputbg = M.GetDword(FONTMODULE, "inputbg", SRMSGDEFSET_BKGCOLOUR);
for (i = 1; i <= 5; i++) {
_snprintf(szTemp, 10, "cc%d", i);
- colour = M->GetDword(szTemp, RGB(224, 224, 224));
+ colour = M.GetDword(szTemp, RGB(224, 224, 224));
if (colour == 0)
colour = RGB(1, 1, 1);
pContainer->theme.custom_colors[i - 1] = colour;
@@ -2085,7 +2085,7 @@ void TSAPI LoadThemeDefaults(TContainerData *pContainer)
pContainer->theme.rtfFonts = NULL;
pContainer->ltr_templates = &LTR_Active;
pContainer->rtl_templates = &RTL_Active;
- pContainer->theme.dwFlags = (M->GetDword("mwflags", MWF_LOG_DEFAULT) & MWF_LOG_ALL);
+ pContainer->theme.dwFlags = (M.GetDword("mwflags", MWF_LOG_DEFAULT) & MWF_LOG_ALL);
pContainer->theme.isPrivate = false;
}
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 83cad550e6..119f632355 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -177,11 +177,11 @@ void TSAPI CacheLogFonts()
ReleaseDC(PluginConfig.g_hwndHotkeyHandler, hdc);
PluginConfig.hFontCaption = CInfoPanel::m_ipConfig.hFonts[IPFONTCOUNT - 1];
- PluginConfig.crIncoming = M->GetDword(FONTMODULE, "inbg", SRMSGDEFSET_BKGINCOLOUR);
- PluginConfig.crOutgoing = M->GetDword(FONTMODULE, "outbg", SRMSGDEFSET_BKGOUTCOLOUR);
- PluginConfig.crStatus = M->GetDword(FONTMODULE, "statbg", SRMSGDEFSET_BKGCOLOUR);
- PluginConfig.crOldIncoming = M->GetDword(FONTMODULE, "oldinbg", SRMSGDEFSET_BKGINCOLOUR);
- PluginConfig.crOldOutgoing = M->GetDword(FONTMODULE, "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR);
+ PluginConfig.crIncoming = M.GetDword(FONTMODULE, "inbg", SRMSGDEFSET_BKGINCOLOUR);
+ PluginConfig.crOutgoing = M.GetDword(FONTMODULE, "outbg", SRMSGDEFSET_BKGOUTCOLOUR);
+ PluginConfig.crStatus = M.GetDword(FONTMODULE, "statbg", SRMSGDEFSET_BKGCOLOUR);
+ PluginConfig.crOldIncoming = M.GetDword(FONTMODULE, "oldinbg", SRMSGDEFSET_BKGINCOLOUR);
+ PluginConfig.crOldOutgoing = M.GetDword(FONTMODULE, "oldoutbg", SRMSGDEFSET_BKGOUTCOLOUR);
}
void FreeLogFonts()
@@ -1417,7 +1417,7 @@ static void ReplaceIcons(HWND hwndDlg, struct TWindowData *dat, LONG startAt, in
COLORREF crDefault;
struct TLogIcon theIcon;
char trbuffer[40];
- DWORD dwScale = M->GetDword("iconscale", 0);
+ DWORD dwScale = M.GetDword("iconscale", 0);
tr.lpstrText = trbuffer;
hwndrtf = GetDlgItem(hwndDlg, IDC_LOG);
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 4206a0c6ad..1ce7e66d1f 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -138,7 +138,7 @@ static int TSAPI ScanSkinDir(const TCHAR* tszFolder, HWND hwndCombobox)
mir_sntprintf(szBuf, 255, _T("%s"), fd.cFileName);
}
- M->pathToRelative(tszFinalName, tszRel, M->getSkinPath());
+ M.pathToRelative(tszFinalName, tszRel, M.getSkinPath());
if ((lr = SendMessage(hwndCombobox, CB_INSERTSTRING, -1, (LPARAM)szBuf)) != CB_ERR) {
TCHAR *idata = (TCHAR *)malloc((lstrlen(tszRel) + 1) * sizeof(TCHAR));
@@ -165,7 +165,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
DBVARIANT dbv = {0};
- mir_sntprintf(tszSkinRoot, MAX_PATH, _T("%s"), M->getSkinPath());
+ mir_sntprintf(tszSkinRoot, MAX_PATH, _T("%s"), M.getSkinPath());
SetDlgItemText(GetParent(hwndCombobox), IDC_SKINROOTFOLDER, tszSkinRoot);
mir_sntprintf(tszFindMask, MAX_PATH, _T("%s*.*"), tszSkinRoot);
@@ -188,7 +188,7 @@ static int TSAPI RescanSkins(HWND hwndCombobox)
SendMessage(hwndCombobox, CB_SETCURSEL, 0, 0);
- if (0 == M->GetTString(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
+ if (0 == db_get_ts(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
LRESULT lr = SendMessage(hwndCombobox, CB_GETCOUNT, 0, 0);
for (int i = 1; i < lr; i++) {
@@ -232,10 +232,10 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (msg) {
case WM_INITDIALOG: {
RescanSkins(GetDlgItem(hwndDlg, IDC_SKINNAME));
- BYTE loadMode = M->GetByte("skin_loadmode", 0);
+ BYTE loadMode = M.GetByte("skin_loadmode", 0);
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_USESKIN, M->GetByte("useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USESKIN, M.GetByte("useskin", 0) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_SKIN_LOADFONTS, loadMode & THEME_READ_FONTS);
CheckDlgButton(hwndDlg, IDC_SKIN_LOADTEMPLATES, loadMode & THEME_READ_TEMPLATES);
@@ -277,20 +277,20 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_USESKIN:
- M->WriteByte(SRMSGMOD_T, "useskin", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_USESKIN) ? 1 : 0));
+ db_set_b(0, SRMSGMOD_T, "useskin", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_USESKIN) ? 1 : 0));
break;
case IDC_SKIN_LOADFONTS: {
- BYTE loadMode = M->GetByte("skin_loadmode", 0);
+ BYTE loadMode = M.GetByte("skin_loadmode", 0);
loadMode = IsDlgButtonChecked(hwndDlg, IDC_SKIN_LOADFONTS) ? loadMode | THEME_READ_FONTS : loadMode & ~THEME_READ_FONTS;
- M->WriteByte(SRMSGMOD_T, "skin_loadmode", loadMode);
+ db_set_b(0, SRMSGMOD_T, "skin_loadmode", loadMode);
break;
}
case IDC_SKIN_LOADTEMPLATES: {
- BYTE loadMode = M->GetByte("skin_loadmode", 0);
+ BYTE loadMode = M.GetByte("skin_loadmode", 0);
loadMode = IsDlgButtonChecked(hwndDlg, IDC_SKIN_LOADTEMPLATES) ? loadMode | THEME_READ_TEMPLATES : loadMode & ~THEME_READ_TEMPLATES;
- M->WriteByte(SRMSGMOD_T, "skin_loadmode", loadMode);
+ db_set_b(0, SRMSGMOD_T, "skin_loadmode", loadMode);
break;
}
@@ -346,8 +346,8 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CacheMsgLogIcons();
PluginConfig.reloadSettings();
CSkin::setAeroEffect(-1);
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
- M->BroadcastMessage(DM_FORCEDREMAKELOG, 0, 0);
+ M.BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
+ M.BroadcastMessage(DM_FORCEDREMAKELOG, 0, 0);
SendMessage(GetParent(hwndDlg), WM_COMMAND, IDCANCEL, 0);
}
break;
@@ -375,7 +375,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (lr != CB_ERR && lr > 0) {
TCHAR *tszRelPath = (TCHAR *)SendDlgItemMessage(hwndDlg, IDC_SKINNAME, CB_GETITEMDATA, lr, 0);
if (tszRelPath && tszRelPath != (TCHAR *)CB_ERR)
- M->WriteTString(0, SRMSGMOD_T, "ContainerSkin", tszRelPath);
+ db_set_ts(0, SRMSGMOD_T, "ContainerSkin", tszRelPath);
SendMessage(hwndDlg, WM_COMMAND, IDC_RELOADSKIN, 0);
}
else if (lr == 0) { // selected the <no skin> entry
@@ -453,12 +453,12 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tvi.item.lParam = i;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
if (defaultItems[i].uType == LOI_TYPE_SETTING)
- tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)defaultItems[i].lParam, (BYTE)defaultItems[i].id) ? 3 : 2);
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(M.GetByte((char *)defaultItems[i].lParam, (BYTE)defaultItems[i].id) ? 3 : 2);
defaultItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), &tvi);
}
- SetDlgItemInt(hwndDlg, IDC_MAXAVATARHEIGHT, M->GetDword("avatarheight", 100), FALSE);
- CheckDlgButton(hwndDlg, IDC_PRESERVEAVATARSIZE, M->GetByte("dontscaleavatars", 0) ? BST_CHECKED : BST_UNCHECKED);
+ SetDlgItemInt(hwndDlg, IDC_MAXAVATARHEIGHT, M.GetDword("avatarheight", 100), FALSE);
+ CheckDlgButton(hwndDlg, IDC_PRESERVEAVATARSIZE, M.GetByte("dontscaleavatars", 0) ? BST_CHECKED : BST_UNCHECKED);
SendDlgItemMessage(hwndDlg, IDC_AVATARSPIN, UDM_SETRANGE, 0, MAKELONG(150, 0));
SendDlgItemMessage(hwndDlg, IDC_AVATARSPIN, UDM_SETPOS, 0, GetDlgItemInt(hwndDlg, IDC_MAXAVATARHEIGHT, &translated, FALSE));
return TRUE;
@@ -478,8 +478,8 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://wiki.miranda.or.at/TabSRMM/GeneralSettings");
break;
case IDC_RESETWARNINGS:
- M->WriteDword(SRMSGMOD_T, "cWarningsL", 0);
- M->WriteDword(SRMSGMOD_T, "cWarningsH", 0);
+ db_set_dw(0, SRMSGMOD_T, "cWarningsL", 0);
+ db_set_dw(0, SRMSGMOD_T, "cWarningsH", 0);
break;
}
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -523,9 +523,9 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
BOOL translated;
TVITEM item = {0};
- M->WriteDword(SRMSGMOD_T, "avatarheight", GetDlgItemInt(hwndDlg, IDC_MAXAVATARHEIGHT, &translated, FALSE));
+ db_set_dw(0, SRMSGMOD_T, "avatarheight", GetDlgItemInt(hwndDlg, IDC_MAXAVATARHEIGHT, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, "dontscaleavatars", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PRESERVEAVATARSIZE) ? 1 : 0));
+ db_set_b(0, SRMSGMOD_T, "dontscaleavatars", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PRESERVEAVATARSIZE) ? 1 : 0));
/*
* scan the tree view and obtain the options...
@@ -539,10 +539,10 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessageA(hwndDlg, IDC_WINDOWOPTIONS, TVM_GETITEMA, 0, (LPARAM)&item);
if (defaultItems[i].uType == LOI_TYPE_SETTING)
- M->WriteByte(SRMSGMOD_T, (char *)defaultItems[i].lParam, (BYTE)((item.state >> 12) == 3 ? 1 : 0));
+ db_set_b(0, SRMSGMOD_T, (char *)defaultItems[i].lParam, (BYTE)((item.state >> 12) == 3 ? 1 : 0));
}
PluginConfig.reloadSettings();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
+ M.BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
return TRUE;
}
}
@@ -560,17 +560,17 @@ static UINT __ctrls[] = { IDC_INDENTSPIN, IDC_RINDENTSPIN, IDC_INDENTAMOUNT, IDC
static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
BOOL translated;
- DWORD dwFlags = M->GetDword("mwflags", MWF_LOG_DEFAULT);
+ DWORD dwFlags = M.GetDword("mwflags", MWF_LOG_DEFAULT);
switch (msg) {
case WM_INITDIALOG:
{
TVINSERTSTRUCT tvi = {0};
int i;
- DWORD maxhist = M->GetDword("maxhist", 0);
+ DWORD maxhist = M.GetDword("maxhist", 0);
TranslateDialogDefault(hwndDlg);
- switch (M->GetByte(SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
+ switch (M.GetByte(SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
case LOADHISTORY_UNREAD:
CheckDlgButton(hwndDlg, IDC_LOADUNREAD, BST_CHECKED);
break;
@@ -617,7 +617,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
if (lvItems[i].uType == LOI_TYPE_FLAG)
tvi.item.state = INDEXTOSTATEIMAGEMASK((dwFlags & (UINT)lvItems[i].lParam) ? 3 : 2);
else if (lvItems[i].uType == LOI_TYPE_SETTING)
- tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)lvItems[i].lParam, lvItems[i].id) ? 3 : 2); // NOTE: was 2 : 1 without state image mask
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(M.GetByte((char *)lvItems[i].lParam, lvItems[i].id) ? 3 : 2); // NOTE: was 2 : 1 without state image mask
lvItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_LOGOPTIONS), &tvi);
}
@@ -626,11 +626,11 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_SETRANGE, 0, MAKELONG(24 * 60, 0));
SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_SETPOS, 0, db_get_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, SRMSGDEFSET_LOADTIME));
- SetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, M->GetDword("IndentAmount", 20), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, M.GetDword("IndentAmount", 20), FALSE);
SendDlgItemMessage(hwndDlg, IDC_INDENTSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 0));
SendDlgItemMessage(hwndDlg, IDC_INDENTSPIN, UDM_SETPOS, 0, GetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, &translated, FALSE));
- SetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, M->GetDword("RightIndent", 20), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, M.GetDword("RightIndent", 20), FALSE);
SendDlgItemMessage(hwndDlg, IDC_RINDENTSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 0));
SendDlgItemMessage(hwndDlg, IDC_RINDENTSPIN, UDM_SETPOS, 0, GetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, &translated, FALSE));
SendMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_INDENT, 0), 0);
@@ -650,14 +650,14 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
{
if (have_ieview) {
SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_INSERTSTRING, -1, (LPARAM)TranslateT("IEView plugin"));
- if (M->GetByte("default_ieview", 0))
+ if (M.GetByte("default_ieview", 0))
SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_SETCURSEL, 1, 0);
}
if (have_hpp) {
SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_INSERTSTRING, -1, (LPARAM)TranslateT("History++ plugin"));
- if (M->GetByte("default_ieview", 0))
+ if (M.GetByte("default_ieview", 0))
SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_SETCURSEL, 1, 0);
- else if (M->GetByte("default_hpp", 0))
+ else if (M.GetByte("default_hpp", 0))
SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_SETCURSEL, have_ieview ? 2 : 1, 0);
}
}
@@ -773,30 +773,30 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
dwFlags &= ~(MWF_LOG_ALL);
if (IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT))
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
+ db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
else if (IsDlgButtonChecked(hwndDlg, IDC_LOADTIME))
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
+ db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
else
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
+ db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
- M->WriteDword(SRMSGMOD_T, "IndentAmount", (DWORD) GetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, &translated, FALSE));
- M->WriteDword(SRMSGMOD_T, "RightIndent", (DWORD) GetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, &translated, FALSE));
+ db_set_dw(0, SRMSGMOD_T, "IndentAmount", (DWORD) GetDlgItemInt(hwndDlg, IDC_INDENTAMOUNT, &translated, FALSE));
+ db_set_dw(0, SRMSGMOD_T, "RightIndent", (DWORD) GetDlgItemInt(hwndDlg, IDC_RIGHTINDENT, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, "default_ieview", 0);
- M->WriteByte(SRMSGMOD_T, "default_hpp", 0);
+ db_set_b(0, SRMSGMOD_T, "default_ieview", 0);
+ db_set_b(0, SRMSGMOD_T, "default_hpp", 0);
switch(msglogmode) {
case 0:
break;
case 1:
if (have_ieview)
- M->WriteByte(SRMSGMOD_T, "default_ieview", 1);
+ db_set_b(0, SRMSGMOD_T, "default_ieview", 1);
else
- M->WriteByte(SRMSGMOD_T, "default_hpp", 1);
+ db_set_b(0, SRMSGMOD_T, "default_hpp", 1);
break;
case 2:
- M->WriteByte(SRMSGMOD_T, "default_hpp", 1);
+ db_set_b(0, SRMSGMOD_T, "default_hpp", 1);
break;
}
@@ -814,16 +814,16 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
if (lvItems[i].uType == LOI_TYPE_FLAG)
dwFlags |= (item.state >> 12) == 3/*2*/ ? lvItems[i].lParam : 0;
else if (lvItems[i].uType == LOI_TYPE_SETTING)
- M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)((item.state >> 12) == 3/*2*/ ? 1 : 0)); // NOTE: state image masks changed
+ db_set_b(0, SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)((item.state >> 12) == 3/*2*/ ? 1 : 0)); // NOTE: state image masks changed
}
- M->WriteDword(SRMSGMOD_T, "mwflags", dwFlags);
+ db_set_dw(0, SRMSGMOD_T, "mwflags", dwFlags);
if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM))
- M->WriteDword(SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
+ db_set_dw(0, SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
else
- M->WriteDword(SRMSGMOD_T, "maxhist", 0);
+ db_set_dw(0, SRMSGMOD_T, "maxhist", 0);
PluginConfig.reloadSettings();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
+ M.BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
return TRUE;
}
}
@@ -836,7 +836,7 @@ static void ResetCList(HWND hwndDlg)
{
int i;
- if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !M->GetByte("CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
+ if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !M.GetByte("CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM)FALSE, 0);
else
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM)TRUE, 0);
@@ -852,16 +852,16 @@ static void ResetCList(HWND hwndDlg)
static void RebuildList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
{
- BYTE defType = M->GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW);
+ BYTE defType = M.GetByte(SRMSGMOD, SRMSGSET_TYPINGNEW, SRMSGDEFSET_TYPINGNEW);
if (hItemNew && defType)
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemNew, 1);
- if (hItemUnknown && M->GetByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
+ if (hItemUnknown && M.GetByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, SRMSGDEFSET_TYPINGUNKNOWN))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItemUnknown, 1);
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
- if (hItem && M->GetByte(hContact, SRMSGMOD, SRMSGSET_TYPING, defType))
+ if (hItem && db_get_b(hContact, SRMSGMOD, SRMSGSET_TYPING, defType))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
}
}
@@ -869,10 +869,10 @@ static void RebuildList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
static void SaveList(HWND hwndDlg, HANDLE hItemNew, HANDLE hItemUnknown)
{
if (hItemNew)
- M->WriteByte(SRMSGMOD, SRMSGSET_TYPINGNEW, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemNew, 0) ? 1 : 0));
+ db_set_b(0, SRMSGMOD, SRMSGSET_TYPINGNEW, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemNew, 0) ? 1 : 0));
if (hItemUnknown)
- M->WriteByte(SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 1 : 0));
+ db_set_b(0, SRMSGMOD, SRMSGSET_TYPINGUNKNOWN, (BYTE)(SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItemUnknown, 0) ? 1 : 0));
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
@@ -901,15 +901,15 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
ResetCList(hwndDlg);
RebuildList(hwndDlg, hItemNew, hItemUnknown);
- CheckDlgButton(hwndDlg, IDC_SHOWNOTIFY, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING));
- CheckDlgButton(hwndDlg, IDC_TYPEFLASHWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH));
+ CheckDlgButton(hwndDlg, IDC_SHOWNOTIFY, M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPING, SRMSGDEFSET_SHOWTYPING));
+ CheckDlgButton(hwndDlg, IDC_TYPEFLASHWIN, M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH));
- CheckDlgButton(hwndDlg, IDC_TYPENOWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1));
- CheckDlgButton(hwndDlg, IDC_TYPEWIN, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1));
- CheckDlgButton(hwndDlg, IDC_NOTIFYTRAY, M->GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST));
- CheckDlgButton(hwndDlg, IDC_NOTIFYBALLOON, M->GetByte(SRMSGMOD, "ShowTypingBalloon", 0));
+ CheckDlgButton(hwndDlg, IDC_TYPENOWIN, M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, 1));
+ CheckDlgButton(hwndDlg, IDC_TYPEWIN, M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, 1));
+ CheckDlgButton(hwndDlg, IDC_NOTIFYTRAY, M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, SRMSGDEFSET_SHOWTYPINGCLIST));
+ CheckDlgButton(hwndDlg, IDC_NOTIFYBALLOON, M.GetByte(SRMSGMOD, "ShowTypingBalloon", 0));
- CheckDlgButton(hwndDlg, IDC_NOTIFYPOPUP, M->GetByte(SRMSGMOD, "ShowTypingPopup", 0));
+ CheckDlgButton(hwndDlg, IDC_NOTIFYPOPUP, M.GetByte(SRMSGMOD, "ShowTypingPopup", 0));
Utils::enableDlgControl(hwndDlg, IDC_TYPEWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
Utils::enableDlgControl(hwndDlg, IDC_TYPENOWIN, IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
@@ -928,7 +928,7 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always, but no popup when window is focused"));
SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Only when no message window is open"));
- SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_SETCURSEL, (WPARAM)M->GetByte("MTN_PopupMode", 0), 0);
+ SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_SETCURSEL, (WPARAM)M.GetByte("MTN_PopupMode", 0), 0);
if (!PluginConfig.g_PopupAvail) {
Utils::showDlgControl(hwndDlg, IDC_NOTIFYPOPUP, SW_HIDE);
@@ -978,14 +978,14 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
switch (((LPNMHDR) lParam)->code) {
case PSN_APPLY:
SaveList(hwndDlg, hItemNew, hItemUnknown);
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPING, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWNOTIFY));
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPEFLASHWIN));
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPENOWIN));
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPEWIN));
- M->WriteByte(SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
- M->WriteByte(SRMSGMOD, "ShowTypingBalloon", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYBALLOON));
- M->WriteByte(SRMSGMOD, "ShowTypingPopup",(BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYPOPUP));
- M->WriteByte(SRMSGMOD_T, "MTN_PopupMode", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
+ db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPING, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWNOTIFY));
+ db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPEFLASHWIN));
+ db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGNOWINOPEN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPENOWIN));
+ db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGWINOPEN, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TYPEWIN));
+ db_set_b(0, SRMSGMOD, SRMSGSET_SHOWTYPINGCLIST, (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY));
+ db_set_b(0, SRMSGMOD, "ShowTypingBalloon", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYBALLOON));
+ db_set_b(0, SRMSGMOD, "ShowTypingPopup",(BYTE) IsDlgButtonChecked(hwndDlg, IDC_NOTIFYPOPUP));
+ db_set_b(0, SRMSGMOD_T, "MTN_PopupMode", (BYTE)SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_GETCURSEL, 0, 0));
PluginConfig.reloadSettings();
}
}
@@ -1034,11 +1034,11 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
tvi.item.lParam = i;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
if (tabItems[i].uType == LOI_TYPE_SETTING)
- tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)tabItems[i].lParam, (BYTE)tabItems[i].id) ? 3 : 2/*2 : 1*/);
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(M.GetByte((char *)tabItems[i].lParam, (BYTE)tabItems[i].id) ? 3 : 2/*2 : 1*/);
tabItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), &tvi);
}
- CheckDlgButton(hwndDlg, IDC_CUT_TABTITLE, M->GetByte("cuttitle", 0));
+ CheckDlgButton(hwndDlg, IDC_CUT_TABTITLE, M.GetByte("cuttitle", 0));
SendDlgItemMessage(hwndDlg, IDC_CUT_TITLEMAXSPIN, UDM_SETRANGE, 0, MAKELONG(20, 5));
SendDlgItemMessage(hwndDlg, IDC_CUT_TITLEMAXSPIN, UDM_SETPOS, 0, (WPARAM)db_get_w(NULL, SRMSGMOD_T, "cut_at", 15));
@@ -1058,7 +1058,7 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
return TRUE;
break;
case IDC_SETUPAUTOCREATEMODES: {
- HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHOOSESTATUSMODES), hwndDlg, DlgProcSetupStatusModes, M->GetDword("autopopupmask", -1));
+ HWND hwndNew = CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CHOOSESTATUSMODES), hwndDlg, DlgProcSetupStatusModes, M.GetDword("autopopupmask", -1));
SendMessage(hwndNew, DM_SETPARENTDIALOG, 0, (LPARAM)hwndDlg);
break;
}
@@ -1070,7 +1070,7 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
case DM_STATUSMASKSET:
- M->WriteDword(SRMSGMOD_T, "autopopupmask", (DWORD)lParam);
+ db_set_dw(0, SRMSGMOD_T, "autopopupmask", (DWORD)lParam);
break;
case WM_NOTIFY:
switch (((LPNMHDR) lParam)->idFrom) {
@@ -1110,7 +1110,7 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
switch (((LPNMHDR) lParam)->code) {
case PSN_APPLY: {
TVITEM item = {0};
- M->WriteByte(SRMSGMOD_T, "cuttitle", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CUT_TABTITLE));
+ db_set_b(0, SRMSGMOD_T, "cuttitle", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CUT_TABTITLE));
db_set_w(NULL, SRMSGMOD_T, "cut_at", (WORD)SendDlgItemMessage(hwndDlg, IDC_CUT_TITLEMAXSPIN, UDM_GETPOS, 0, 0));
/*
@@ -1125,13 +1125,13 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
SendDlgItemMessageA(hwndDlg, IDC_TABMSGOPTIONS, TVM_GETITEMA, 0, (LPARAM)&item);
if (tabItems[i].uType == LOI_TYPE_SETTING)
- M->WriteByte(SRMSGMOD_T, (char *)tabItems[i].lParam, (BYTE)((item.state >> 12) == 3/*2*/ ? 1 : 0));
+ db_set_b(0, SRMSGMOD_T, (char *)tabItems[i].lParam, (BYTE)((item.state >> 12) == 3/*2*/ ? 1 : 0));
}
PluginConfig.m_EscapeCloses = (int)SendDlgItemMessage(hwndDlg, IDC_ESCMODE, CB_GETCURSEL, 0, 0);
- M->WriteByte(SRMSGMOD_T, "escmode", (BYTE)PluginConfig.m_EscapeCloses);
+ db_set_b(0, SRMSGMOD_T, "escmode", (BYTE)PluginConfig.m_EscapeCloses);
PluginConfig.reloadSettings();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 0, 0);
+ M.BroadcastMessage(DM_OPTIONSAPPLIED, 0, 0);
return TRUE;
}
}
@@ -1146,26 +1146,26 @@ static INT_PTR CALLBACK DlgProcContainerSettings(HWND hwndDlg, UINT msg, WPARAM
switch (msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_CONTAINERGROUPMODE, M->GetByte("useclistgroups", 0));
- CheckDlgButton(hwndDlg, IDC_LIMITTABS, M->GetByte("limittabs", 0));
+ CheckDlgButton(hwndDlg, IDC_CONTAINERGROUPMODE, M.GetByte("useclistgroups", 0));
+ CheckDlgButton(hwndDlg, IDC_LIMITTABS, M.GetByte("limittabs", 0));
SendDlgItemMessage(hwndDlg, IDC_TABLIMITSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 1));
- SendDlgItemMessage(hwndDlg, IDC_TABLIMITSPIN, UDM_SETPOS, 0, (int)M->GetDword("maxtabs", 1));
- SetDlgItemInt(hwndDlg, IDC_TABLIMIT, (int)M->GetDword("maxtabs", 1), FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_TABLIMITSPIN, UDM_SETPOS, 0, (int)M.GetDword("maxtabs", 1));
+ SetDlgItemInt(hwndDlg, IDC_TABLIMIT, (int)M.GetDword("maxtabs", 1), FALSE);
Utils::enableDlgControl(hwndDlg, IDC_TABLIMIT, IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS));
- CheckDlgButton(hwndDlg, IDC_SINGLEWINDOWMODE, M->GetByte("singlewinmode", 0));
+ CheckDlgButton(hwndDlg, IDC_SINGLEWINDOWMODE, M.GetByte("singlewinmode", 0));
CheckDlgButton(hwndDlg, IDC_DEFAULTCONTAINERMODE, !(IsDlgButtonChecked(hwndDlg, IDC_CONTAINERGROUPMODE) || IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS) || IsDlgButtonChecked(hwndDlg, IDC_SINGLEWINDOWMODE)));
- SetDlgItemInt(hwndDlg, IDC_NRFLASH, M->GetByte("nrflash", 4), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_NRFLASH, M.GetByte("nrflash", 4), FALSE);
SendDlgItemMessage(hwndDlg, IDC_NRFLASHSPIN, UDM_SETRANGE, 0, MAKELONG(255, 1));
- SendDlgItemMessage(hwndDlg, IDC_NRFLASHSPIN, UDM_SETPOS, 0, (int)M->GetByte("nrflash", 4));
+ SendDlgItemMessage(hwndDlg, IDC_NRFLASHSPIN, UDM_SETPOS, 0, (int)M.GetByte("nrflash", 4));
- SetDlgItemInt(hwndDlg, IDC_FLASHINTERVAL, M->GetDword("flashinterval", 1000), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_FLASHINTERVAL, M.GetDword("flashinterval", 1000), FALSE);
SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETRANGE, 0, MAKELONG(10000, 500));
- SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETPOS, 0, (int)M->GetDword("flashinterval", 1000));
- SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETACCEL, 0, (int)M->GetDword("flashinterval", 1000));
- CheckDlgButton(hwndDlg, IDC_USEAERO, M->GetByte("useAero", 1));
- CheckDlgButton(hwndDlg, IDC_USEAEROPEEK, M->GetByte("useAeroPeek", 1));
+ SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETPOS, 0, (int)M.GetDword("flashinterval", 1000));
+ SendDlgItemMessage(hwndDlg, IDC_FLASHINTERVALSPIN, UDM_SETACCEL, 0, (int)M.GetDword("flashinterval", 1000));
+ CheckDlgButton(hwndDlg, IDC_USEAERO, M.GetByte("useAero", 1));
+ CheckDlgButton(hwndDlg, IDC_USEAEROPEEK, M.GetByte("useAeroPeek", 1));
for (int i = 0; i < CSkin::AERO_EFFECT_LAST; i++)
SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_INSERTSTRING, -1, (LPARAM)TranslateTS(CSkin::m_aeroEffects[i].tszName));
@@ -1205,18 +1205,18 @@ static INT_PTR CALLBACK DlgProcContainerSettings(HWND hwndDlg, UINT msg, WPARAM
switch (((LPNMHDR) lParam)->code) {
case PSN_APPLY:
BOOL translated;
- bool fOldAeroState = M->getAeroState();
- M->WriteByte(SRMSGMOD_T, "useclistgroups", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CONTAINERGROUPMODE)));
- M->WriteByte(SRMSGMOD_T, "limittabs", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS)));
- M->WriteDword(SRMSGMOD_T, "maxtabs", GetDlgItemInt(hwndDlg, IDC_TABLIMIT, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, "singlewinmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SINGLEWINDOWMODE)));
- M->WriteDword(SRMSGMOD_T, "flashinterval", GetDlgItemInt(hwndDlg, IDC_FLASHINTERVAL, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, "nrflash", (BYTE)(GetDlgItemInt(hwndDlg, IDC_NRFLASH, &translated, FALSE)));
- M->WriteByte(0, SRMSGMOD_T, "useAero", IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
- M->WriteByte(0, SRMSGMOD_T, "useAeroPeek", IsDlgButtonChecked(hwndDlg, IDC_USEAEROPEEK) ? 1 : 0);
+ bool fOldAeroState = M.getAeroState();
+ db_set_b(0, SRMSGMOD_T, "useclistgroups", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_CONTAINERGROUPMODE)));
+ db_set_b(0, SRMSGMOD_T, "limittabs", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_LIMITTABS)));
+ db_set_dw(0, SRMSGMOD_T, "maxtabs", GetDlgItemInt(hwndDlg, IDC_TABLIMIT, &translated, FALSE));
+ db_set_b(0, SRMSGMOD_T, "singlewinmode", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_SINGLEWINDOWMODE)));
+ db_set_dw(0, SRMSGMOD_T, "flashinterval", GetDlgItemInt(hwndDlg, IDC_FLASHINTERVAL, &translated, FALSE));
+ db_set_b(0, SRMSGMOD_T, "nrflash", (BYTE)(GetDlgItemInt(hwndDlg, IDC_NRFLASH, &translated, FALSE)));
+ db_set_b(0, SRMSGMOD_T, "useAero", IsDlgButtonChecked(hwndDlg, IDC_USEAERO) ? 1 : 0);
+ db_set_b(0, SRMSGMOD_T, "useAeroPeek", IsDlgButtonChecked(hwndDlg, IDC_USEAEROPEEK) ? 1 : 0);
CSkin::setAeroEffect(SendDlgItemMessage(hwndDlg, IDC_AEROEFFECT, CB_GETCURSEL, 0, 0));
- if (M->getAeroState() != fOldAeroState) {
+ if (M.getAeroState() != fOldAeroState) {
SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOMPOSITIONCHANGED, 0, 0); // simulate aero state change
SendMessage(PluginConfig.g_hwndHotkeyHandler, WM_DWMCOLORIZATIONCOLORCHANGED, 0, 0); // simulate aero state change
}
@@ -1388,11 +1388,11 @@ DWORD OptCheckBox_LoadValue(struct OptCheckBox *cb)
case CBVT_NONE:
switch (cb->dbType) {
case DBVT_BYTE:
- return M->GetByte(cb->dbModule, cb->dbSetting, cb->defValue);
+ return M.GetByte(cb->dbModule, cb->dbSetting, cb->defValue);
case DBVT_WORD:
return db_get_w(NULL, cb->dbModule, cb->dbSetting, cb->defValue);
case DBVT_DWORD:
- return M->GetDword(cb->dbModule, cb->dbSetting, cb->defValue);
+ return M.GetDword(cb->dbModule, cb->dbSetting, cb->defValue);
}
break;
@@ -1429,13 +1429,13 @@ void OptCheckBox_Save(HWND hwnd, struct OptCheckBox *cb)
switch (cb->dbType) {
case DBVT_BYTE:
- M->WriteByte(cb->dbModule, cb->dbSetting, (BYTE)value);
+ db_set_b(0, cb->dbModule, cb->dbSetting, (BYTE)value);
break;
case DBVT_WORD:
db_set_w(NULL, cb->dbModule, cb->dbSetting, (WORD)value);
break;
case DBVT_DWORD:
- M->WriteDword(cb->dbModule, cb->dbSetting, (DWORD)value);
+ db_set_dw(0, cb->dbModule, cb->dbSetting, (DWORD)value);
break;
}
@@ -1484,7 +1484,7 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- DWORD maxhist = M->GetDword("maxhist", 0);
+ DWORD maxhist = M.GetDword("maxhist", 0);
bInit = TRUE;
@@ -1494,7 +1494,7 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR
// Always on!
CheckDlgButton(hwndDlg, IDC_SENDCTRLENTER, BST_CHECKED);
- switch (M->GetByte(SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
+ switch (M.GetByte(SRMSGMOD, SRMSGSET_LOADHISTORY, SRMSGDEFSET_LOADHISTORY)) {
case LOADHISTORY_UNREAD:
CheckDlgButton(hwndDlg, IDC_LOADUNREAD, BST_CHECKED);
break;
@@ -1522,9 +1522,9 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR
Utils::enableDlgControl(hwndDlg, IDC_TRIM, maxhist != 0);
CheckDlgButton(hwndDlg, IDC_ALWAYSTRIM, maxhist != 0);
- BOOL bTabOptGroups = M->GetByte("useclistgroups", 0);
- BOOL bTabOptLimit = M->GetByte("limittabs", 0);
- BOOL bTabOptSingle = M->GetByte("singlewinmode", 0);
+ BOOL bTabOptGroups = M.GetByte("useclistgroups", 0);
+ BOOL bTabOptLimit = M.GetByte("limittabs", 0);
+ BOOL bTabOptSingle = M.GetByte("singlewinmode", 0);
if (bTabOptSingle && !bTabOptGroups && !bTabOptLimit)
CheckDlgButton(hwndDlg, IDC_USETABS, BST_UNCHECKED);
@@ -1576,33 +1576,33 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR
OptCheckBox_Save(hwndDlg, opts+i);
if (IsDlgButtonChecked(hwndDlg, IDC_LOADCOUNT))
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
+ db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_COUNT);
else if (IsDlgButtonChecked(hwndDlg, IDC_LOADTIME))
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
+ db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_TIME);
else
- M->WriteByte(SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
+ db_set_b(0, SRMSGMOD, SRMSGSET_LOADHISTORY, LOADHISTORY_UNREAD);
db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADCOUNT, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_GETPOS, 0, 0));
db_set_w(NULL, SRMSGMOD, SRMSGSET_LOADTIME, (WORD) SendDlgItemMessage(hwndDlg, IDC_LOADTIMESPIN, UDM_GETPOS, 0, 0));
if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM))
- M->WriteDword(SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
+ db_set_dw(0, SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
else
- M->WriteDword(SRMSGMOD_T, "maxhist", 0);
+ db_set_dw(0, SRMSGMOD_T, "maxhist", 0);
switch (IsDlgButtonChecked(hwndDlg, IDC_USETABS)) {
case BST_UNCHECKED:
- M->WriteByte(SRMSGMOD_T, "useclistgroups", 0);
- M->WriteByte(SRMSGMOD_T, "limittabs", 0);
- M->WriteByte(SRMSGMOD_T, "singlewinmode", 1);
+ db_set_b(0, SRMSGMOD_T, "useclistgroups", 0);
+ db_set_b(0, SRMSGMOD_T, "limittabs", 0);
+ db_set_b(0, SRMSGMOD_T, "singlewinmode", 1);
break;
case BST_CHECKED:
- M->WriteByte(SRMSGMOD_T, "useclistgroups", 0);
- M->WriteByte(SRMSGMOD_T, "limittabs", 0);
- M->WriteByte(SRMSGMOD_T, "singlewinmode", 0);
+ db_set_b(0, SRMSGMOD_T, "useclistgroups", 0);
+ db_set_b(0, SRMSGMOD_T, "limittabs", 0);
+ db_set_b(0, SRMSGMOD_T, "singlewinmode", 0);
break;
}
PluginConfig.reloadSettings();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
+ M.BroadcastMessage(DM_OPTIONSAPPLIED, 1, 0);
return TRUE;
}
}
diff --git a/plugins/TabSRMM/src/msgoptions_plus.cpp b/plugins/TabSRMM/src/msgoptions_plus.cpp
index 7c505e0866..43c24a9f8f 100644
--- a/plugins/TabSRMM/src/msgoptions_plus.cpp
+++ b/plugins/TabSRMM/src/msgoptions_plus.cpp
@@ -60,7 +60,7 @@ static void FillDialog(HWND hwndDlg)
tvi.item.lParam = i;
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
if (lvItems[i].uType == LOI_TYPE_SETTING)
- tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)lvItems[i].lParam, lvItems[i].id) ? 3 : 2); // NOTE: was 2 : 1 without state image mask
+ tvi.item.state = INDEXTOSTATEIMAGEMASK(M.GetByte((char *)lvItems[i].lParam, lvItems[i].id) ? 3 : 2); // NOTE: was 2 : 1 without state image mask
lvItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), &tvi);
}
@@ -68,7 +68,7 @@ static void FillDialog(HWND hwndDlg)
SendDlgItemMessage(hwndDlg, IDC_TIMEOUTSPIN, UDM_SETPOS, 0, PluginConfig.m_MsgTimeout / 1000);
SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_SETRANGE, 0, MAKELONG(255, 15));
- SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_SETPOS, 0, (int)M->GetByte("historysize", 0));
+ SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_SETPOS, 0, (int)M.GetByte("historysize", 0));
}
INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lParam)
@@ -131,14 +131,14 @@ INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar
SendDlgItemMessageA(hwndDlg, IDC_PLUS_CHECKTREE, TVM_GETITEMA, 0, (LPARAM)&item);
if (lvItems[i].uType == LOI_TYPE_SETTING)
- M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)((item.state >> 12) == 3/*2*/ ? 1 : 0)); // NOTE: state image masks changed
+ db_set_b(0, SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)((item.state >> 12) == 3/*2*/ ? 1 : 0)); // NOTE: state image masks changed
}
int msgTimeout = 1000 * GetDlgItemInt(hwndDlg, IDC_SECONDS, NULL, FALSE);
PluginConfig.m_MsgTimeout = msgTimeout >= SRMSGSET_MSGTIMEOUT_MIN ? msgTimeout : SRMSGSET_MSGTIMEOUT_MIN;
- M->WriteDword(SRMSGMOD, SRMSGSET_MSGTIMEOUT, PluginConfig.m_MsgTimeout);
+ db_set_dw(0, SRMSGMOD, SRMSGSET_MSGTIMEOUT, PluginConfig.m_MsgTimeout);
- M->WriteByte(SRMSGMOD_T, "historysize", (BYTE)SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_GETPOS, 0, 0));
+ db_set_b(0, SRMSGMOD_T, "historysize", (BYTE)SendDlgItemMessage(hwndDlg, IDC_HISTORYSIZESPIN, UDM_GETPOS, 0, 0));
PluginConfig.reloadAdv();
return TRUE;
}
@@ -155,7 +155,7 @@ INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar
for (int i=0; lvItems[i].szName; i++)
if (lvItems[i].uType == LOI_TYPE_SETTING)
- M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)lvItems[i].id);
+ db_set_b(0, SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)lvItems[i].id);
TreeView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE));
FillDialog(hwndDlg);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index d83b9ac409..60c932de1c 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -52,7 +52,7 @@ int Chat_PreShutdown(WPARAM wParam, LPARAM lParam);
int IEViewOptionsChanged(WPARAM,LPARAM)
{
- M->BroadcastMessage(DM_IEVIEWOPTIONSCHANGED, 0, 0);
+ M.BroadcastMessage(DM_IEVIEWOPTIONSCHANGED, 0, 0);
return 0;
}
@@ -62,7 +62,7 @@ int IEViewOptionsChanged(WPARAM,LPARAM)
int SmileyAddOptionsChanged(WPARAM,LPARAM)
{
- M->BroadcastMessage(DM_SMILEYOPTIONSCHANGED, 0, 0);
+ M.BroadcastMessage(DM_SMILEYOPTIONSCHANGED, 0, 0);
if (PluginConfig.m_chat_enabled)
SM_BroadcastMessage(NULL, DM_SMILEYOPTIONSCHANGED, 0, 0, FALSE);
return 0;
@@ -101,7 +101,7 @@ static INT_PTR GetWindowData(WPARAM wParam, LPARAM lParam)
return 1;
if (mwid->uFlags != MSG_WINDOW_UFLAG_MSG_BOTH)
return 1;
- HWND hwnd = M->FindWindow(mwid->hContact);
+ HWND hwnd = M.FindWindow(mwid->hContact);
if (hwnd) {
mwod->uFlags = MSG_WINDOW_UFLAG_MSG_BOTH;
mwod->hwndWindow = hwnd;
@@ -139,7 +139,7 @@ static INT_PTR SetStatusText(WPARAM wParam, LPARAM lParam)
{
TContainerData *pContainer;
- HWND hwnd = M->FindWindow((HANDLE)wParam);
+ HWND hwnd = M.FindWindow((HANDLE)wParam);
if (hwnd != NULL) {
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat == NULL || (pContainer = dat->pContainer) == NULL)
@@ -203,7 +203,7 @@ static INT_PTR GetMessageWindowFlags(WPARAM wParam, LPARAM lParam)
HWND hwndTarget = (HWND)lParam;
if (hwndTarget == 0)
- hwndTarget = M->FindWindow((HANDLE)wParam);
+ hwndTarget = M.FindWindow((HANDLE)wParam);
if (hwndTarget) {
struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwndTarget, GWLP_USERDATA);
@@ -243,7 +243,7 @@ INT_PTR MessageWindowOpened(WPARAM wParam, LPARAM lParam)
TContainerData *pContainer = NULL;
if (wParam)
- hwnd = M->FindWindow((HANDLE)wParam);
+ hwnd = M.FindWindow((HANDLE)wParam);
else if (lParam)
hwnd = (HWND) lParam;
else
@@ -282,7 +282,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam)
{
HANDLE hContact = ((CLISTEVENT *) lParam)->hContact;
- HWND hwndExisting = M->FindWindow(hContact);
+ HWND hwndExisting = M.FindWindow(hContact);
if (hwndExisting != 0)
SendMessage(hwndExisting, DM_ACTIVATEME, 0, 0);
else {
@@ -335,7 +335,7 @@ INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam)
return 0;
}
- HWND hwnd = M->FindWindow(hContact);
+ HWND hwnd = M.FindWindow(hContact);
if (hwnd) {
if (lParam) {
HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
@@ -392,7 +392,7 @@ INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam)
return 0;
}
- HWND hwnd = M->FindWindow(hContact);
+ HWND hwnd = M.FindWindow(hContact);
if (hwnd) {
if (lParam) {
HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
@@ -484,10 +484,10 @@ int MyAvatarChanged(WPARAM wParam, LPARAM lParam)
int AvatarChanged(WPARAM wParam, LPARAM lParam)
{
struct avatarCacheEntry *ace = (struct avatarCacheEntry *)lParam;
- HWND hwnd = M->FindWindow((HANDLE)wParam);
+ HWND hwnd = M.FindWindow((HANDLE)wParam);
if (wParam == 0) { // protocol picture has changed...
- M->BroadcastMessage(DM_PROTOAVATARCHANGED, wParam, lParam);
+ M.BroadcastMessage(DM_PROTOAVATARCHANGED, wParam, lParam);
return 0;
}
if (hwnd) {
@@ -528,8 +528,8 @@ int IconsChanged(WPARAM wParam, LPARAM lParam)
{
CreateImageList(FALSE);
CacheMsgLogIcons();
- M->BroadcastMessage(DM_OPTIONSAPPLIED, 0, 0);
- M->BroadcastMessage(DM_UPDATEWINICON, 0, 0);
+ M.BroadcastMessage(DM_OPTIONSAPPLIED, 0, 0);
+ M.BroadcastMessage(DM_UPDATEWINICON, 0, 0);
if (PluginConfig.m_chat_enabled)
Chat_IconsChanged(wParam, lParam);
@@ -590,7 +590,7 @@ int LoadSendRecvMessageModule(void)
Win7Taskbar->updateMetrics();
ZeroMemory((void*)&nen_options, sizeof(nen_options));
- M->m_hMessageWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+ M.m_hMessageWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
PluginConfig.hUserPrefsWindowList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
sendQueue = new SendQueue;
Skin = new CSkin;
@@ -604,7 +604,7 @@ int LoadSendRecvMessageModule(void)
ReloadTabConfig();
NEN_ReadOptions(&nen_options);
- M->WriteByte(TEMPLATES_MODULE, "setup", 2);
+ db_set_b(0, TEMPLATES_MODULE, "setup", 2);
LoadDefaultTemplates();
BuildCodePageList();
@@ -692,12 +692,12 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i
int newItem;
DBVARIANT dbv = {0};
- if (M->FindWindow(hContact) != 0) {
+ if (M.FindWindow(hContact) != 0) {
_DebugPopup(hContact, _T("Warning: trying to create duplicate window"));
return 0;
}
// if we have a max # of tabs/container set and want to open something in the default container...
- if (hContact != 0 && M->GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
+ if (hContact != 0 && M.GetByte("limittabs", 0) && !_tcsncmp(pContainer->szName, _T("default"), 6)) {
if ((pContainer = FindMatchingContainer(_T("default"), hContact)) == NULL) {
TCHAR szName[CONTAINER_NAMELEN + 1];
@@ -722,7 +722,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i
*/
if (contactName && lstrlen(contactName) > 0) {
- if (M->GetByte("cuttitle", 0))
+ if (M.GetByte("cuttitle", 0))
CutContactName(contactName, newcontactname, SIZEOF(newcontactname));
else {
lstrcpyn(newcontactname, contactName, SIZEOF(newcontactname));
@@ -736,7 +736,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i
WORD wStatus = (szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE));
TCHAR *szStatus = (TCHAR *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(newData.hContact, szProto, "Status", ID_STATUS_OFFLINE), GSMDF_TCHAR);
- if (M->GetByte("tabstatus", 1))
+ if (M.GetByte("tabstatus", 1))
mir_sntprintf(tabtitle, SIZEOF(tabtitle), _T("%s (%s) "), newcontactname, szStatus);
else
mir_sntprintf(tabtitle, SIZEOF(tabtitle), _T("%s "), newcontactname);
@@ -752,7 +752,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i
ShowWindow(pContainer->hwndActive, SW_HIDE);
{
- int iTabIndex_wanted = M->GetDword(hContact, "tabindex", pContainer->iChilds * 100);
+ int iTabIndex_wanted = M.GetDword(hContact, "tabindex", pContainer->iChilds * 100);
int iCount = TabCtrl_GetItemCount(hwndTab);
TCITEM item = {0};
int relPos;
@@ -766,7 +766,7 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i
HWND hwnd = (HWND)item.lParam;
struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
if (dat) {
- relPos = M->GetDword(dat->hContact, "tabindex", i * 100);
+ relPos = M.GetDword(dat->hContact, "tabindex", i * 100);
if (iTabIndex_wanted <= relPos)
pContainer->iTabIndex = i;
}
@@ -839,12 +839,12 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i
}
SendMessage(pContainer->hwndActive, WM_SIZE, 0, 0);
}
- if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled) // && !M->GetByte("forceAeroPeek", 0))
+ if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek && CSkin::m_skinEnabled) // && !M.GetByte("forceAeroPeek", 0))
CWarning::show(CWarning::WARN_AEROPEEK_SKIN, MB_ICONWARNING|MB_OK);
- if (ServiceExists(MS_HPP_EG_EVENT) && ServiceExists(MS_IEVIEW_EVENT) && M->GetByte(0, "HistoryPlusPlus", "IEViewAPI", 0)) {
+ if (ServiceExists(MS_HPP_EG_EVENT) && ServiceExists(MS_IEVIEW_EVENT) && db_get_b(0, "HistoryPlusPlus", "IEViewAPI", 0)) {
if (IDYES == CWarning::show(CWarning::WARN_HPP_APICHECK, MB_ICONWARNING|MB_YESNO))
- M->WriteByte(0, "HistoryPlusPlus", "IEViewAPI", 0);
+ db_set_b(0, "HistoryPlusPlus", "IEViewAPI", 0);
}
return hwndNew; // return handle of the new dialog
}
@@ -857,8 +857,8 @@ HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, HANDLE hContact, i
TContainerData* TSAPI FindMatchingContainer(const TCHAR *szName, HANDLE hContact)
{
- int iMaxTabs = M->GetDword("maxtabs", 0);
- if (iMaxTabs > 0 && M->GetByte("limittabs", 0) && !_tcsncmp(szName, _T("default"), 6)) {
+ int iMaxTabs = M.GetDword("maxtabs", 0);
+ if (iMaxTabs > 0 && M.GetByte("limittabs", 0) && !_tcsncmp(szName, _T("default"), 6)) {
// search a "default" with less than iMaxTabs opened...
for (TContainerData *p = pFirstContainer; p; p = p->pNext)
if (!_tcsncmp(p->szName, _T("default"), 6) && p->iChilds < iMaxTabs)
@@ -905,7 +905,7 @@ void TSAPI CreateImageList(BOOL bInitial)
int TABSRMM_FireEvent(HANDLE hContact, HWND hwnd, unsigned int type, unsigned int subType)
{
- if (hContact == NULL || hwnd == NULL || !M->GetByte("_eventapi", 1))
+ if (hContact == NULL || hwnd == NULL || !M.GetByte("_eventapi", 1))
return 0;
struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(hwnd, GWLP_USERDATA);
@@ -1118,7 +1118,7 @@ static int TSAPI LoadFromIconLib()
PluginConfig.g_iconClock = Skin_GetIcon("tabSRMM_clock_symbol");
CacheMsgLogIcons();
- M->BroadcastMessage(DM_LOADBUTTONBARICONS, 0, 0);
+ M.BroadcastMessage(DM_LOADBUTTONBARICONS, 0, 0);
return 0;
}
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index 269d3380bf..884dea27e8 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -184,7 +184,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
TContainerData *pContainer = 0;
do {
_snprintf(szValue, 8, "%d", iCounter);
- if (M->GetTString(NULL, szKey, szValue, &dbv))
+ if (db_get_ts(NULL, szKey, szValue, &dbv))
break; // end of list
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR) {
if (_tcsncmp(dbv.ptszVal, _T("**free**"), CONTAINER_NAMELEN)) {
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index 317e4d6aa1..36c98becab 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -75,10 +75,10 @@ void CSendLaterJob::cleanDB()
char szKey[100];
db_unset(hContact, "SendLater", szId);
- int iCount = M->GetDword(hContact, "SendLater", "count", 0);
+ int iCount = db_get_dw(hContact, "SendLater", "count", 0);
if (iCount)
iCount--;
- M->WriteDword(hContact, "SendLater", "count", iCount);
+ db_set_dw(hContact, "SendLater", "count", iCount);
/*
* delete flags
*/
@@ -98,7 +98,7 @@ void CSendLaterJob::readFlags()
DWORD localFlags;
mir_snprintf(szKey, 100, "$%s", szId);
- localFlags = M->GetDword(hContact, "SendLater", szKey, 0);
+ localFlags = db_get_dw(hContact, "SendLater", szKey, 0);
if (localFlags & SLF_SUSPEND)
bCode = JOB_HOLD;
@@ -116,7 +116,7 @@ void CSendLaterJob::writeFlags()
char szKey[100];
mir_snprintf(szKey, 100, "$%s", szId);
- M->WriteDword(hContact, "SendLater", szKey, localFlags);
+ db_set_dw(hContact, "SendLater", szKey, localFlags);
}
}
@@ -174,12 +174,12 @@ CSendLater::CSendLater()
{
m_sendLaterContactList.clear();
m_sendLaterJobList.clear();
- m_fAvail = M->GetByte("sendLaterAvail", 0) ? true : false;
+ m_fAvail = M.GetByte("sendLaterAvail", 0) != 0;
m_last_sendlater_processed = time(0);
m_hwndDlg = 0;
m_fIsInteractive = false;
- m_fErrorPopups = M->GetByte(0, SRMSGMOD_T, "qmgrErrorPopups", 0) ? true : false;
- m_fSuccessPopups = M->GetByte(0, SRMSGMOD_T, "qmgrSuccessPopups", 0) ? true : false;
+ m_fErrorPopups = M.GetByte("qmgrErrorPopups", 0) != 0;
+ m_fSuccessPopups = M.GetByte("qmgrSuccessPopups", 0) != 0;
}
/**
@@ -262,7 +262,7 @@ int _cdecl CSendLater::addStub(const char *szSetting, LPARAM lParam)
*/
void CSendLater::processSingleContact(const HANDLE hContact)
{
- int iCount = M->GetDword(hContact, "SendLater", "count", 0);
+ int iCount = db_get_dw(hContact, "SendLater", "count", 0);
if (iCount) {
DBCONTACTENUMSETTINGS ces = {0};
@@ -712,7 +712,7 @@ void CSendLater::qMgrSetupColumns()
::GetWindowRect(m_hwndList, &rcList);
cxList = rcList.right - rcList.left;
- if (0 == M->GetString(0, SRMSGMOD_T, "qmgrListColumns", &dbv)) {
+ if (0 == db_get_s(0, SRMSGMOD_T, "qmgrListColumns", &dbv)) {
sscanf(dbv.pszVal, szColFormat, &nWidths[0], &nWidths[1], &nWidths[2], &nWidths[3], &nWidths[4]);
db_free(&dbv);
}
@@ -783,7 +783,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
TranslateDialogDefault(hwnd);
m_hwndList = ::GetDlgItem(m_hwndDlg, IDC_QMGR_LIST);
m_hwndFilter = ::GetDlgItem(m_hwndDlg, IDC_QMGR_FILTER);
- m_hFilter = reinterpret_cast<HANDLE>(M->GetDword(0, SRMSGMOD_T, "qmgrFilterContact", 0));
+ m_hFilter = reinterpret_cast<HANDLE>(db_get_dw(0, SRMSGMOD_T, "qmgrFilterContact", 0));
::SetWindowLongPtr(m_hwndList, GWL_STYLE, ::GetWindowLongPtr(m_hwndList, GWL_STYLE) | LVS_SHOWSELALWAYS);
::SendMessage(m_hwndList, LVM_SETEXTENDEDLISTVIEWSTYLE, 0, LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES|LVS_EX_LABELTIP|LVS_EX_DOUBLEBUFFER);
@@ -857,12 +857,12 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case IDC_QMGR_SUCCESSPOPUPS:
m_fSuccessPopups = ::IsDlgButtonChecked(m_hwndDlg, IDC_QMGR_SUCCESSPOPUPS) ? true : false;
- M->WriteByte(0, SRMSGMOD_T, "qmgrSuccessPopups", m_fSuccessPopups ? 1 : 0);
+ db_set_b(0, SRMSGMOD_T, "qmgrSuccessPopups", m_fSuccessPopups ? 1 : 0);
break;
case IDC_QMGR_ERRORPOPUPS:
m_fErrorPopups = ::IsDlgButtonChecked(m_hwndDlg, IDC_QMGR_ERRORPOPUPS) ? true : false;
- M->WriteByte(0, SRMSGMOD_T, "qmgrErrorPopups", m_fErrorPopups ? 1 : 0);
+ db_set_b(0, SRMSGMOD_T, "qmgrErrorPopups", m_fErrorPopups ? 1 : 0);
break;
case IDC_QMGR_HELP:
@@ -934,7 +934,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_NCDESTROY:
m_hwndDlg = 0;
- M->WriteDword(0, SRMSGMOD_T, "qmgrFilterContact", reinterpret_cast<DWORD>(m_hFilter));
+ db_set_dw(0, SRMSGMOD_T, "qmgrFilterContact", reinterpret_cast<DWORD>(m_hFilter));
break;
}
return FALSE;
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index 95b864f06d..6256e89e70 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -358,12 +358,12 @@ int SendQueue::sendQueued(TWindowData *dat, const int iEntry)
dat->nMax = dat->cache->getMaxMessageLength(); // refresh length info
- if (dat->sendMode & SMODE_FORCEANSI && M->GetByte(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "UnicodeSend", 1))
- M->WriteByte(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "UnicodeSend", 0);
- else if (!(dat->sendMode & SMODE_FORCEANSI) && !M->GetByte(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "UnicodeSend", 0))
- M->WriteByte(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "UnicodeSend", 1);
+ if (dat->sendMode & SMODE_FORCEANSI && db_get_b(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "UnicodeSend", 1))
+ db_set_b(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "UnicodeSend", 0);
+ else if (!(dat->sendMode & SMODE_FORCEANSI) && !db_get_b(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "UnicodeSend", 0))
+ db_set_b(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "UnicodeSend", 1);
- if (M->GetByte("autosplit", 0) && !(dat->sendMode & SMODE_SENDLATER)) {
+ if (M.GetByte("autosplit", 0) && !(dat->sendMode & SMODE_SENDLATER)) {
BOOL fSplit = FALSE;
DWORD dwOldFlags;
@@ -439,7 +439,7 @@ send_unsplitted:
if (!(dat->sendMode & SMODE_NOACK))
::HandleIconFeedback(dat, PluginConfig.g_IconSend);
- if (M->GetByte(SRMSGSET_AUTOMIN, SRMSGDEFSET_AUTOMIN))
+ if (M.GetByte(SRMSGSET_AUTOMIN, SRMSGDEFSET_AUTOMIN))
::SendMessage(dat->pContainer->hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
return 0;
}
@@ -613,7 +613,7 @@ void SendQueue::UpdateSaveAndSendButton(TWindowData *dat)
void SendQueue::NotifyDeliveryFailure(const TWindowData *dat)
{
- if (M->GetByte("adv_noErrorPopups", 0))
+ if (M.GetByte("adv_noErrorPopups", 0))
return;
if ( CallService(MS_POPUP_QUERY, PUQS_GETSTATUS, 0) != 1)
@@ -624,16 +624,16 @@ void SendQueue::NotifyDeliveryFailure(const TWindowData *dat)
lstrcpyn(ppd.lptzContactName, dat->cache->getNick(), MAX_CONTACTNAME);
lstrcpyn(ppd.lptzText, TranslateT("A message delivery has failed.\nClick to open the message window."), MAX_SECONDLINE);
- if (!(BOOL)M->GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE)) {
- ppd.colorText = (COLORREF)M->GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT);
- ppd.colorBack = (COLORREF)M->GetDword(MODULE, OPT_COLBACK_ERR, DEFAULT_COLBACK);
+ if (!(BOOL)M.GetByte(MODULE, OPT_COLDEFAULT_ERR, TRUE)) {
+ ppd.colorText = (COLORREF)M.GetDword(MODULE, OPT_COLTEXT_ERR, DEFAULT_COLTEXT);
+ ppd.colorBack = (COLORREF)M.GetDword(MODULE, OPT_COLBACK_ERR, DEFAULT_COLBACK);
}
else ppd.colorText = ppd.colorBack = 0;
ppd.PluginWindowProc = reinterpret_cast<WNDPROC>(Utils::PopupDlgProcError);
ppd.lchIcon = PluginConfig.g_iconErr;
ppd.PluginData = (void*)dat->hContact;
- ppd.iSeconds = (int)M->GetDword(MODULE, OPT_DELAY_ERR, (DWORD)DEFAULT_DELAY);
+ ppd.iSeconds = (int)M.GetDword(MODULE, OPT_DELAY_ERR, (DWORD)DEFAULT_DELAY);
PUAddPopupT(&ppd);
}
@@ -774,8 +774,8 @@ inform_and_discard:
handleError(dat, iNextFailed);
//MAD: close on send mode
else {
- if (M->GetByte("AutoClose", 0)) {
- if (M->GetByte("adv_AutoClose_2", 0))
+ if (M.GetByte("AutoClose", 0)) {
+ if (M.GetByte("adv_AutoClose_2", 0))
SendMessage(dat->hwnd, WM_CLOSE, 0, 1);
else
SendMessage(dat->pContainer->hwnd, WM_CLOSE, 0, 0);
@@ -892,9 +892,9 @@ int SendQueue::doSendLater(int iJobIndex, TWindowData *dat, HANDLE hContact, boo
mir_free(tszMsg);
}
if (fIsSendLater) {
- int iCount = M->GetDword(hContact ? hContact : job->hOwner, "SendLater", "count", 0);
+ int iCount = db_get_dw(hContact ? hContact : job->hOwner, "SendLater", "count", 0);
iCount++;
- M->WriteDword(hContact ? hContact : job->hOwner, "SendLater", "count", iCount);
+ db_set_dw(hContact ? hContact : job->hOwner, "SendLater", "count", iCount);
sendLater->addContact(hContact ? hContact : job->hOwner);
}
return(iJobIndex);
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp
index 035d32cd43..76d0bc4ea5 100644
--- a/plugins/TabSRMM/src/sidebar.cpp
+++ b/plugins/TabSRMM/src/sidebar.cpp
@@ -932,7 +932,7 @@ LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
else
CSkin::DrawItem(hdc, &rc, item);
}
- else if (M->isAero() || M->isVSThemed()) {
+ else if (M.isAero() || M.isVSThemed()) {
HDC hdcMem;
HANDLE hbp = 0;
HBITMAP hbm, hbmOld;
@@ -945,7 +945,7 @@ LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcMem, hbm));
}
- if (M->isAero())
+ if (M.isAero())
::FillRect(hdcMem, &rc, CSkin::m_BrushBack);
else
CSkin::FillBack(hdcMem, &rc);
@@ -1011,9 +1011,9 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT
CSkin::SkinDrawBG(hwnd, pContainer->hwnd, pContainer, const_cast<RECT *>(rc), hdc);
CSkin::DrawItem(hdc, rc, skinItem);
}
- else if (M->isAero() || PluginConfig.m_fillColor) {
+ else if (M.isAero() || PluginConfig.m_fillColor) {
if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
- if (M->isAero())
+ if (M.isAero())
::FillRect(hdc, const_cast<RECT *>(rc), CSkin::m_BrushBack);
else
CSkin::FillBack(hdc, const_cast<RECT *>(rc));
@@ -1042,7 +1042,7 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT
}
}
}
- else if (M->isVSThemed()) {
+ else if (M.isVSThemed()) {
RECT *rcDraw = const_cast<RECT *>(rc);
if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
::FillRect(hdc, rc, stateId == PBS_HOT ? ::GetSysColorBrush(COLOR_HOTLIGHT) : ::GetSysColorBrush(COLOR_3DFACE));
@@ -1055,7 +1055,7 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT
if (CMimAPI::m_pfnIsThemeBackgroundPartiallyTransparent(item->m_buttonControl->hThemeToolbar, TP_BUTTON, stateId))
CMimAPI::m_pfnDrawThemeParentBackground(item->getHwnd(), hdc, rcDraw);
- if (M->isAero() || PluginConfig.m_WinVerMajor >= 6) {
+ if (M.isAero() || PluginConfig.m_WinVerMajor >= 6) {
stateId = (fIsActiveItem ? PBS_PRESSED : PBS_HOT);
CMimAPI::m_pfnDrawThemeBackground(item->m_buttonControl->hThemeToolbar, hdc, 8, RBStateConvert2Flat(stateId), rcDraw, rcDraw);
}
@@ -1093,7 +1093,7 @@ void __fastcall CSideBar::m_DefaultContentRenderer(const HDC hdc, const RECT *rc
if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
::DrawIconEx(hdc, (rcBox->left + rcBox->right) / 2 - 8, (rcBox->top + rcBox->bottom) / 2 - 8, id == IDC_SIDEBARUP ? PluginConfig.g_buttonBarIcons[26] : PluginConfig.g_buttonBarIcons[16],
16, 16, 0, 0, DI_NORMAL);
- if (!M->isAero() && stateID == PBS_HOT)
+ if (!M.isAero() && stateID == PBS_HOT)
::DrawEdge(hdc, const_cast<RECT *>(rcBox), BDR_INNER, BF_RECT | BF_SOFT | BF_FLAT);
}
else if (dat)
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index 3012fe6334..c3efa5aaf1 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -79,8 +79,6 @@ extern "C" int __declspec(dllexport) Load(void)
mir_getTMI(&tmi);
mir_getLP(&pluginInfo);
- M = new CMimAPI();
-
SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfDefault), &lfDefault, FALSE);
Chat_Load();
@@ -104,7 +102,6 @@ extern "C" int __declspec(dllexport) Unload(void)
DestroyServiceFunction(hTypingNotify);
delete sendLater;
delete sendQueue;
- delete M;
#if defined(__USE_EX_HANDLERS)
}
__except(CGlobals::Ex_ShowDialog(GetExceptionInformation(), __FILE__, __LINE__, L"SHUTDOWN_STAGE_UNLOAD", false)) {
@@ -256,8 +253,8 @@ INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPar
CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://miranda.or.at/");
break;
case IDC_RESETWARNINGS:
- M->WriteDword(SRMSGMOD_T, "cWarningsL", 0);
- M->WriteDword(SRMSGMOD_T, "cWarningsH", 0);
+ db_set_dw(0, SRMSGMOD_T, "cWarningsL", 0);
+ db_set_dw(0, SRMSGMOD_T, "cWarningsH", 0);
break;
}
break;
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp
index e79bbad25c..213ad28360 100644
--- a/plugins/TabSRMM/src/tabctrl.cpp
+++ b/plugins/TabSRMM/src/tabctrl.cpp
@@ -267,7 +267,7 @@ static void DrawItemRect(struct TabControlData *tabdat, HDC dc, RECT *rcItem, in
rcItem->right += 6;
if (tabdat->fAeroTabs) {
- if (M->isAero()) {
+ if (M.isAero()) {
InflateRect(rcItem, 2, 0);
FillRect(dc, rcItem, CSkin::m_BrushBack);
}
@@ -312,7 +312,7 @@ b_nonskinned:
DrawEdge(dc, rcItem, EDGE_RAISED, BF_RECT | BF_SOFT);
}
} else {
- if (M->isAero() && !(dwStyle & TCS_BOTTOM))
+ if (M.isAero() && !(dwStyle & TCS_BOTTOM))
FillRect(dc, rcItem, CSkin::m_BrushBack);
else
CSkin::FillBack(dc, rcItem);
@@ -403,13 +403,13 @@ static int DWordAlign(int n)
static HRESULT DrawThemesPartWithAero(const TabControlData *tabdat, HDC hDC, int iPartId, int iStateId, LPRECT prcBox, TWindowData* dat)
{
HRESULT hResult = 0;
- bool fAero = M->isAero();
+ bool fAero = M.isAero();
if (tabdat->fAeroTabs) {
if (tabdat->dwStyle & TCS_BOTTOM)
- prcBox->top += (fAero ? 2 : iStateId == PBS_PRESSED ? (M->isVSThemed() ? 1 : -1) : 0);
+ prcBox->top += (fAero ? 2 : iStateId == PBS_PRESSED ? (M.isVSThemed() ? 1 : -1) : 0);
else if (!fAero)
- prcBox->bottom -= (iStateId == PBS_PRESSED ? (M->isVSThemed() ? 1 : -1) : 0);
+ prcBox->bottom -= (iStateId == PBS_PRESSED ? (M.isVSThemed() ? 1 : -1) : 0);
if (fAero)
FillRect(hDC, prcBox, CSkin::m_BrushBack);
@@ -636,7 +636,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat)
UINT uiBottom = 0;
TCHITTESTINFO hti;
HBITMAP bmpMem, bmpOld;
- bool isAero = M->isAero();
+ bool isAero = M.isAero();
HANDLE hpb = 0;
BOOL bClassicDraw = !isAero && (tabdat->m_VisualStyles == FALSE || CSkin::m_skinEnabled);
if ( GetUpdateRect(hwnd, NULL, TRUE) == 0)
@@ -1005,9 +1005,9 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
return TRUE;
case EM_THEMECHANGED:
- tabdat->m_xpad = M->GetByte("x-pad", 3);
+ tabdat->m_xpad = M.GetByte("x-pad", 3);
tabdat->m_VisualStyles = FALSE;
- if (PluginConfig.m_bIsXP && M->isVSAPIState()) {
+ if (PluginConfig.m_bIsXP && M.isVSAPIState()) {
if (CMimAPI::m_pfnIsThemeActive != 0)
if (CMimAPI::m_pfnIsThemeActive()) {
tabdat->m_VisualStyles = TRUE;
@@ -1300,7 +1300,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
break;
case WM_ERASEBKGND:
- if (tabdat->pContainer && (CSkin::m_skinEnabled || M->isAero()))
+ if (tabdat->pContainer && (CSkin::m_skinEnabled || M.isAero()))
return TRUE;
return 0;
@@ -1309,7 +1309,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
return 0;
case WM_TIMER:
- if (wParam == TIMERID_HOVER_T && M->GetByte("d_tooltips", 0)) {
+ if (wParam == TIMERID_HOVER_T && M.GetByte("d_tooltips", 0)) {
POINT pt;
CLCINFOTIP ti = {0};
ti.cbSize = sizeof(ti);
@@ -1381,7 +1381,7 @@ void TSAPI ReloadTabConfig()
PluginConfig.tabConfig.m_hMenuFont = CreateFontIndirect(&nclim.lfMessageFont);
while (tabcolors[i].szKey != NULL) {
- PluginConfig.tabConfig.colors[i] = M->GetDword(CSkin::m_skinEnabled ? tabcolors[i].szSkinnedKey : tabcolors[i].szKey, GetSysColor(tabcolors[i].defclr));
+ PluginConfig.tabConfig.colors[i] = M.GetDword(CSkin::m_skinEnabled ? tabcolors[i].szSkinnedKey : tabcolors[i].szKey, GetSysColor(tabcolors[i].defclr));
i++;
}
PluginConfig.tabConfig.m_brushes[0] = CreateSolidBrush(PluginConfig.tabConfig.colors[4]);
@@ -1389,8 +1389,8 @@ void TSAPI ReloadTabConfig()
PluginConfig.tabConfig.m_brushes[2] = CreateSolidBrush(PluginConfig.tabConfig.colors[6]);
PluginConfig.tabConfig.m_brushes[3] = CreateSolidBrush(PluginConfig.tabConfig.colors[7]);
- PluginConfig.tabConfig.m_bottomAdjust = (int)M->GetDword("bottomadjust", 0);
- PluginConfig.tabConfig.m_fixedwidth = M->GetDword("fixedwidth", FIXED_TAB_SIZE);
+ PluginConfig.tabConfig.m_bottomAdjust = (int)M.GetDword("bottomadjust", 0);
+ PluginConfig.tabConfig.m_fixedwidth = M.GetDword("fixedwidth", FIXED_TAB_SIZE);
PluginConfig.tabConfig.m_fixedwidth = (PluginConfig.tabConfig.m_fixedwidth < 60 ? 60 : PluginConfig.tabConfig.m_fixedwidth);
}
@@ -1436,8 +1436,8 @@ INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
case WM_USER + 100:
SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPIN, UDM_SETRANGE, 0, MAKELONG(10, 0));
- SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPIN, UDM_SETPOS, 0, (int)M->GetByte(CSkin::m_skinEnabled ? "S_tborder" : "tborder", 2));
- SetDlgItemInt(hwndDlg, IDC_TABBORDER, (int)M->GetByte(CSkin::m_skinEnabled ? "S_tborder" : "tborder", 2), FALSE);;
+ SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPIN, UDM_SETPOS, 0, (int)M.GetByte(CSkin::m_skinEnabled ? "S_tborder" : "tborder", 2));
+ SetDlgItemInt(hwndDlg, IDC_TABBORDER, (int)M.GetByte(CSkin::m_skinEnabled ? "S_tborder" : "tborder", 2), FALSE);;
SendDlgItemMessage(hwndDlg, IDC_BOTTOMTABADJUSTSPIN, UDM_SETRANGE, 0, MAKELONG(3, -3));
SendDlgItemMessage(hwndDlg, IDC_BOTTOMTABADJUSTSPIN, UDM_SETPOS, 0, PluginConfig.tabConfig.m_bottomAdjust);
@@ -1452,17 +1452,17 @@ INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTERTOP, UDM_SETRANGE, 0, MAKELONG(40, 0));
SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTERBOTTOM, UDM_SETRANGE, 0, MAKELONG(40, 0));
- SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTER, UDM_SETPOS, 0, (int)M->GetByte(CSkin::m_skinEnabled ? "S_tborder_outer_left" : "tborder_outer_left", 2));
- SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTERRIGHT, UDM_SETPOS, 0, (int)M->GetByte(CSkin::m_skinEnabled ? "S_tborder_outer_right" : "tborder_outer_right", 2));
- SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTERTOP, UDM_SETPOS, 0, (int)M->GetByte(CSkin::m_skinEnabled ? "S_tborder_outer_top" : "tborder_outer_top", 2));
- SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTERBOTTOM, UDM_SETPOS, 0, (int)M->GetByte(CSkin::m_skinEnabled ? "S_tborder_outer_bottom" : "tborder_outer_bottom", 2));
+ SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTER, UDM_SETPOS, 0, (int)M.GetByte(CSkin::m_skinEnabled ? "S_tborder_outer_left" : "tborder_outer_left", 2));
+ SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTERRIGHT, UDM_SETPOS, 0, (int)M.GetByte(CSkin::m_skinEnabled ? "S_tborder_outer_right" : "tborder_outer_right", 2));
+ SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTERTOP, UDM_SETPOS, 0, (int)M.GetByte(CSkin::m_skinEnabled ? "S_tborder_outer_top" : "tborder_outer_top", 2));
+ SendDlgItemMessage(hwndDlg, IDC_TABBORDERSPINOUTERBOTTOM, UDM_SETPOS, 0, (int)M.GetByte(CSkin::m_skinEnabled ? "S_tborder_outer_bottom" : "tborder_outer_bottom", 2));
SendDlgItemMessage(hwndDlg, IDC_SPIN1, UDM_SETRANGE, 0, MAKELONG(10, 1));
SendDlgItemMessage(hwndDlg, IDC_SPIN3, UDM_SETRANGE, 0, MAKELONG(10, 1));
- SendDlgItemMessage(hwndDlg, IDC_SPIN1, UDM_SETPOS, 0, (LPARAM)M->GetByte("y-pad", 3));
- SendDlgItemMessage(hwndDlg, IDC_SPIN3, UDM_SETPOS, 0, (LPARAM)M->GetByte("x-pad", 4));
- SetDlgItemInt(hwndDlg, IDC_TABPADDING, (int)M->GetByte("y-pad", 3), FALSE);;
- SetDlgItemInt(hwndDlg, IDC_HTABPADDING, (int)M->GetByte("x-pad", 4), FALSE);;
+ SendDlgItemMessage(hwndDlg, IDC_SPIN1, UDM_SETPOS, 0, (LPARAM)M.GetByte("y-pad", 3));
+ SendDlgItemMessage(hwndDlg, IDC_SPIN3, UDM_SETPOS, 0, (LPARAM)M.GetByte("x-pad", 4));
+ SetDlgItemInt(hwndDlg, IDC_TABPADDING, (int)M.GetByte("y-pad", 3), FALSE);;
+ SetDlgItemInt(hwndDlg, IDC_HTABPADDING, (int)M.GetByte("x-pad", 4), FALSE);;
return 0;
case WM_NOTIFY:
@@ -1473,18 +1473,18 @@ INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
{
BOOL translated;
- M->WriteByte(SRMSGMOD_T, "y-pad", (BYTE)(GetDlgItemInt(hwndDlg, IDC_TABPADDING, NULL, FALSE)));
- M->WriteByte(SRMSGMOD_T, "x-pad", (BYTE)(GetDlgItemInt(hwndDlg, IDC_HTABPADDING, NULL, FALSE)));
- M->WriteByte(SRMSGMOD_T, "tborder", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDER, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, CSkin::m_skinEnabled ? "S_tborder_outer_left" : "tborder_outer_left", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDEROUTER, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, CSkin::m_skinEnabled ? "S_tborder_outer_right" : "tborder_outer_right", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDEROUTERRIGHT, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, CSkin::m_skinEnabled ? "S_tborder_outer_top" : "tborder_outer_top", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDEROUTERTOP, &translated, FALSE));
- M->WriteByte(SRMSGMOD_T, CSkin::m_skinEnabled ? "S_tborder_outer_bottom" : "tborder_outer_bottom", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDEROUTERBOTTOM, &translated, FALSE));
- M->WriteDword(SRMSGMOD_T, "bottomadjust", GetDlgItemInt(hwndDlg, IDC_BOTTOMTABADJUST, &translated, TRUE));
+ db_set_b(0, SRMSGMOD_T, "y-pad", (BYTE)(GetDlgItemInt(hwndDlg, IDC_TABPADDING, NULL, FALSE)));
+ db_set_b(0, SRMSGMOD_T, "x-pad", (BYTE)(GetDlgItemInt(hwndDlg, IDC_HTABPADDING, NULL, FALSE)));
+ db_set_b(0, SRMSGMOD_T, "tborder", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDER, &translated, FALSE));
+ db_set_b(0, SRMSGMOD_T, CSkin::m_skinEnabled ? "S_tborder_outer_left" : "tborder_outer_left", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDEROUTER, &translated, FALSE));
+ db_set_b(0, SRMSGMOD_T, CSkin::m_skinEnabled ? "S_tborder_outer_right" : "tborder_outer_right", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDEROUTERRIGHT, &translated, FALSE));
+ db_set_b(0, SRMSGMOD_T, CSkin::m_skinEnabled ? "S_tborder_outer_top" : "tborder_outer_top", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDEROUTERTOP, &translated, FALSE));
+ db_set_b(0, SRMSGMOD_T, CSkin::m_skinEnabled ? "S_tborder_outer_bottom" : "tborder_outer_bottom", (BYTE) GetDlgItemInt(hwndDlg, IDC_TABBORDEROUTERBOTTOM, &translated, FALSE));
+ db_set_dw(0, SRMSGMOD_T, "bottomadjust", GetDlgItemInt(hwndDlg, IDC_BOTTOMTABADJUST, &translated, TRUE));
int fixedWidth = GetDlgItemInt(hwndDlg, IDC_TABWIDTH, &translated, FALSE);
fixedWidth = (fixedWidth < 60 ? 60 : fixedWidth);
- M->WriteDword(SRMSGMOD_T, "fixedwidth", fixedWidth);
+ db_set_dw(0, SRMSGMOD_T, "fixedwidth", fixedWidth);
FreeTabConfig();
ReloadTabConfig();
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 272db8b295..2b8c01a55c 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -194,7 +194,7 @@ void CTaskbarInteract::SetTabActive(const HWND hwndTab, const HWND hwndGroup) co
*/
void CProxyWindow::add(TWindowData *dat)
{
- if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek) // && (!CSkin::m_skinEnabled || M->GetByte("forceAeroPeek", 0)))
+ if (PluginConfig.m_bIsWin7 && PluginConfig.m_useAeroPeek) // && (!CSkin::m_skinEnabled || M.GetByte("forceAeroPeek", 0)))
dat->pWnd = new CProxyWindow(dat);
else
dat->pWnd = 0;
@@ -279,7 +279,7 @@ CProxyWindow::~CProxyWindow()
*/
void CProxyWindow::verifyDwmState()
{
- if (!M->isDwmActive()) {
+ if (!M.isDwmActive()) {
if (m_thumb) {
delete m_thumb;
m_thumb = 0;
@@ -405,7 +405,7 @@ void CProxyWindow::sendPreview()
HBITMAP hbmRich = CSkin::CreateAeroCompatibleBitmap(rcRich, hdcRich);
HBITMAP hbmRichOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcRich, hbmRich));
- COLORREF clr = fIsChat ? M->GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR) : m_dat->pContainer->theme.inbg;
+ COLORREF clr = fIsChat ? M.GetDword(FONTMODULE, SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR) : m_dat->pContainer->theme.inbg;
HBRUSH br = ::CreateSolidBrush(clr);
::FillRect(hdcRich, &rcRich, br);
::DeleteObject(br);
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 5daaf164cb..b52f7d1878 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -87,7 +87,7 @@ static void LoadTemplatesFrom(TTemplateSet *tSet, HANDLE hContact, int rtl)
int i;
for (i=0; i <= TMPL_ERRMSG; i++) {
- if (M->GetTString(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv))
+ if (db_get_ts(hContact, rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[i], &dbv))
continue;
if (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR)
mir_sntprintf(tSet->szTemplates[i], TEMPLATE_LENGTH, _T("%s"), dbv.ptszVal);
@@ -102,15 +102,15 @@ void LoadDefaultTemplates()
LTR_Active = LTR_Default;
RTL_Active = RTL_Default;
- if (M->GetByte(RTLTEMPLATES_MODULE, "setup", 0) < 2) {
+ if (M.GetByte(RTLTEMPLATES_MODULE, "setup", 0) < 2) {
for (i=0; i <= TMPL_ERRMSG; i++)
- M->WriteTString(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], RTL_Default.szTemplates[i]);
- M->WriteByte(RTLTEMPLATES_MODULE, "setup", 2);
+ db_set_ts(NULL, RTLTEMPLATES_MODULE, TemplateNames[i], RTL_Default.szTemplates[i]);
+ db_set_b(0, RTLTEMPLATES_MODULE, "setup", 2);
}
- if (M->GetByte(TEMPLATES_MODULE, "setup", 0) < 2) {
+ if (M.GetByte(TEMPLATES_MODULE, "setup", 0) < 2) {
for (i=0; i <= TMPL_ERRMSG; i++)
- M->WriteTString(NULL, TEMPLATES_MODULE, TemplateNames[i], LTR_Default.szTemplates[i]);
- M->WriteByte(TEMPLATES_MODULE, "setup", 2);
+ db_set_ts(NULL, TEMPLATES_MODULE, TemplateNames[i], LTR_Default.szTemplates[i]);
+ db_set_b(0, TEMPLATES_MODULE, "setup", 2);
}
LoadTemplatesFrom(&LTR_Active, (HANDLE)0, 0);
LoadTemplatesFrom(&RTL_Active, (HANDLE)0, 1);
@@ -188,11 +188,11 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
Utils::enableDlgControl(teInfo->hwndParent, IDC_MODIFY, FALSE);
Utils::enableDlgControl(teInfo->hwndParent, IDC_RTLMODIFY, FALSE);
- SendDlgItemMessage(hwndDlg, IDC_COLOR1, CPM_SETCOLOUR, 0, M->GetDword("cc1", SRMSGDEFSET_BKGCOLOUR));
- SendDlgItemMessage(hwndDlg, IDC_COLOR2, CPM_SETCOLOUR, 0, M->GetDword("cc2", SRMSGDEFSET_BKGCOLOUR));
- SendDlgItemMessage(hwndDlg, IDC_COLOR3, CPM_SETCOLOUR, 0, M->GetDword("cc3", SRMSGDEFSET_BKGCOLOUR));
- SendDlgItemMessage(hwndDlg, IDC_COLOR4, CPM_SETCOLOUR, 0, M->GetDword("cc4", SRMSGDEFSET_BKGCOLOUR));
- SendDlgItemMessage(hwndDlg, IDC_COLOR5, CPM_SETCOLOUR, 0, M->GetDword("cc5", SRMSGDEFSET_BKGCOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_COLOR1, CPM_SETCOLOUR, 0, M.GetDword("cc1", SRMSGDEFSET_BKGCOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_COLOR2, CPM_SETCOLOUR, 0, M.GetDword("cc2", SRMSGDEFSET_BKGCOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_COLOR3, CPM_SETCOLOUR, 0, M.GetDword("cc3", SRMSGDEFSET_BKGCOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_COLOR4, CPM_SETCOLOUR, 0, M.GetDword("cc4", SRMSGDEFSET_BKGCOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_COLOR5, CPM_SETCOLOUR, 0, M.GetDword("cc5", SRMSGDEFSET_BKGCOLOUR));
SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
}
return TRUE;
@@ -206,7 +206,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case IDC_RESETALLTEMPLATES:
if (MessageBox(0, TranslateT("This will reset the template set to the default built-in templates. Are you sure you want to do this?"),
TranslateT("Template Set Editor"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
- M->WriteByte(teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, "setup", 0);
+ db_set_b(0, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, "setup", 0);
LoadDefaultTemplates();
MessageBox(0, TranslateT("Template set was successfully reset, please close and reopen all message windows. This template editor window will now close."),
TranslateT("Template Set Editor"), MB_OK);
@@ -271,7 +271,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
Utils::enableDlgControl(hwndDlg, IDC_TEMPLATELIST, TRUE);
Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE);
InvalidateRect(GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
- M->WriteTString(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit], newTemplate);
+ db_set_ts(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit], newTemplate);
SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
}
break;
@@ -384,11 +384,11 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (dat)
free(dat);
- M->WriteDword(SRMSGMOD_T, "cc1", SendDlgItemMessage(hwndDlg, IDC_COLOR1, CPM_GETCOLOUR, 0, 0));
- M->WriteDword(SRMSGMOD_T, "cc2", SendDlgItemMessage(hwndDlg, IDC_COLOR2, CPM_GETCOLOUR, 0, 0));
- M->WriteDword(SRMSGMOD_T, "cc3", SendDlgItemMessage(hwndDlg, IDC_COLOR3, CPM_GETCOLOUR, 0, 0));
- M->WriteDword(SRMSGMOD_T, "cc4", SendDlgItemMessage(hwndDlg, IDC_COLOR4, CPM_GETCOLOUR, 0, 0));
- M->WriteDword(SRMSGMOD_T, "cc5", SendDlgItemMessage(hwndDlg, IDC_COLOR5, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(0, SRMSGMOD_T, "cc1", SendDlgItemMessage(hwndDlg, IDC_COLOR1, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(0, SRMSGMOD_T, "cc2", SendDlgItemMessage(hwndDlg, IDC_COLOR2, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(0, SRMSGMOD_T, "cc3", SendDlgItemMessage(hwndDlg, IDC_COLOR3, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(0, SRMSGMOD_T, "cc4", SendDlgItemMessage(hwndDlg, IDC_COLOR4, CPM_GETCOLOUR, 0, 0));
+ db_set_dw(0, SRMSGMOD_T, "cc5", SendDlgItemMessage(hwndDlg, IDC_COLOR5, CPM_GETCOLOUR, 0, 0));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
break;
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index 8165b5432d..17827c4454 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -144,7 +144,7 @@ static void TSAPI LoadLogfontFromINI(int i, char *szKey, LOGFONTA *lf, COLORREF
* filter out font attributes from the message input area font
* (can be disabled by db tweak)
*/
- if (!strcmp(szKey, "Font16") && M->GetByte(0, SRMSGMOD_T, "inputFontFix", 1) == 1) {
+ if (!strcmp(szKey, "Font16") && M.GetByte("inputFontFix", 1) == 1) {
lf->lfWeight = FW_NORMAL;
lf->lfItalic = 0;
lf->lfUnderline = 0;
@@ -199,13 +199,13 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, struct TWindowData *dat)
db_free(&dbv);
}
sprintf(szTemp, "Font%dCol", firstIndex + i);
- WritePrivateProfileStringA(szAppname, "Color", _itoa(M->GetDword(szModule, szTemp, 0), szBuf, 10), szIniFilename);
+ WritePrivateProfileStringA(szAppname, "Color", _itoa(M.GetDword(szModule, szTemp, 0), szBuf, 10), szIniFilename);
sprintf(szTemp, "Font%dSty", firstIndex + i);
- WritePrivateProfileStringA(szAppname, "Style", _itoa(M->GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
+ WritePrivateProfileStringA(szAppname, "Style", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
sprintf(szTemp, "Font%dSize", firstIndex + i);
- WritePrivateProfileStringA(szAppname, "Size", _itoa(M->GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
+ WritePrivateProfileStringA(szAppname, "Size", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
sprintf(szTemp, "Font%dSet", firstIndex + i);
- WritePrivateProfileStringA(szAppname, "Set", _itoa(M->GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
+ WritePrivateProfileStringA(szAppname, "Set", _itoa(M.GetByte(szModule, szTemp, 0), szBuf, 10), szIniFilename);
}
n++;
}
@@ -213,16 +213,16 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, struct TWindowData *dat)
for (i=0; i < SIZEOF(_extSettings); i++) {
WritePrivateProfileStringA(_extSettings[i].szIniSection, _extSettings[i].szIniName,
- _itoa(M->GetDword(_extSettings[i].szDbModule, _extSettings[i].szDbSetting, _extSettings[i].dwDef), szBuf, 10), szIniFilename);
+ _itoa(M.GetDword(_extSettings[i].szDbModule, _extSettings[i].szDbSetting, _extSettings[i].dwDef), szBuf, 10), szIniFilename);
}
for (i=0; i < SIZEOF(_extSettings_v5); i++) {
WritePrivateProfileStringA(_extSettings_v5[i].szIniSection, _extSettings_v5[i].szIniName,
- _itoa(M->GetDword(_extSettings_v5[i].szDbModule, _extSettings_v5[i].szDbSetting, _extSettings_v5[i].dwDef), szBuf, 10), szIniFilename);
+ _itoa(M.GetDword(_extSettings_v5[i].szDbModule, _extSettings_v5[i].szDbSetting, _extSettings_v5[i].dwDef), szBuf, 10), szIniFilename);
}
- WritePrivateProfileStringA("Message Log", "VGrid", _itoa(M->GetByte("wantvgrid", 0), szBuf, 10), szIniFilename);
- WritePrivateProfileStringA("Message Log", "ExtraMicroLF", _itoa(M->GetByte("extramicrolf", 0), szBuf, 10), szIniFilename);
+ WritePrivateProfileStringA("Message Log", "VGrid", _itoa(M.GetByte("wantvgrid", 0), szBuf, 10), szIniFilename);
+ WritePrivateProfileStringA("Message Log", "ExtraMicroLF", _itoa(M.GetByte("extramicrolf", 0), szBuf, 10), szIniFilename);
for (i=0; i <= TMPL_ERRMSG; i++) {
char *encoded;
@@ -242,7 +242,7 @@ void TSAPI WriteThemeToINI(const TCHAR *szIniFilenameT, struct TWindowData *dat)
for (i=0; i < CUSTOM_COLORS; i++) {
sprintf(szTemp, "cc%d", i + 1);
if (dat == 0)
- WritePrivateProfileStringA("Custom Colors", szTemp, _itoa(M->GetDword(szTemp, 0), szBuf, 10), szIniFilename);
+ WritePrivateProfileStringA("Custom Colors", szTemp, _itoa(M.GetDword(szTemp, 0), szBuf, 10), szIniFilename);
else
WritePrivateProfileStringA("Custom Colors", szTemp, _itoa(dat->pContainer->theme.custom_colors[i], szBuf, 10), szIniFilename);
}
@@ -292,22 +292,22 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
}
sprintf(szTemp, "Font%dCol", firstIndex + i);
- M->WriteDword(szModule, szTemp, GetPrivateProfileIntA(szAppname, "Color", GetSysColor(COLOR_WINDOWTEXT), szIniFilename));
+ db_set_dw(0, szModule, szTemp, GetPrivateProfileIntA(szAppname, "Color", GetSysColor(COLOR_WINDOWTEXT), szIniFilename));
sprintf(szTemp, "Font%dSty", firstIndex + i);
- M->WriteByte(szModule, szTemp, (BYTE)(GetPrivateProfileIntA(szAppname, "Style", 0, szIniFilename)));
+ db_set_b(0, szModule, szTemp, (BYTE)(GetPrivateProfileIntA(szAppname, "Style", 0, szIniFilename)));
sprintf(szTemp, "Font%dSize", firstIndex + i);
bSize = (char)GetPrivateProfileIntA(szAppname, "Size", -10, szIniFilename);
if (bSize > 0)
bSize = -MulDiv(bSize, GetDeviceCaps(hdc, LOGPIXELSY), 72);
- M->WriteByte(szModule, szTemp, bSize);
+ db_set_b(0, szModule, szTemp, bSize);
sprintf(szTemp, "Font%dSet", firstIndex + i);
charset = GetPrivateProfileIntA(szAppname, "Set", 0, szIniFilename);
if (i == MSGFONTID_SYMBOLS_IN || i == MSGFONTID_SYMBOLS_OUT)
charset = 0;
- M->WriteByte(szModule, szTemp, (BYTE)charset);
+ db_set_b(0, szModule, szTemp, (BYTE)charset);
}
n++;
}
@@ -318,24 +318,24 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
COLORREF defclr;
for (i=0; i < SIZEOF(_extSettings); i++) {
- M->WriteDword(_extSettings[i].szDbModule, _extSettings[i].szDbSetting,
+ db_set_dw(0, _extSettings[i].szDbModule, _extSettings[i].szDbSetting,
GetPrivateProfileIntA(_extSettings[i].szIniSection, _extSettings[i].szIniName, _extSettings[i].dwDef, szIniFilename));
}
if (version >= 5) {
for (i=0; i < SIZEOF(_extSettings_v5); i++) {
- M->WriteDword(_extSettings_v5[i].szDbModule, _extSettings_v5[i].szDbSetting,
+ db_set_dw(0, _extSettings_v5[i].szDbModule, _extSettings_v5[i].szDbSetting,
GetPrivateProfileIntA(_extSettings_v5[i].szIniSection, _extSettings_v5[i].szIniName, _extSettings_v5[i].dwDef, szIniFilename));
}
}
- M->WriteByte(SRMSGMOD_T, "wantvgrid", (BYTE)(GetPrivateProfileIntA("Message Log", "VGrid", 0, szIniFilename)));
- M->WriteByte(SRMSGMOD_T, "extramicrolf", (BYTE)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
+ db_set_b(0, SRMSGMOD_T, "wantvgrid", (BYTE)(GetPrivateProfileIntA("Message Log", "VGrid", 0, szIniFilename)));
+ db_set_b(0, SRMSGMOD_T, "extramicrolf", (BYTE)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
for (i=0; i < CUSTOM_COLORS; i++) {
sprintf(szTemp, "cc%d", i + 1);
if (dat == 0)
- M->WriteDword(SRMSGMOD_T, szTemp, GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename));
+ db_set_dw(0, SRMSGMOD_T, szTemp, GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename));
else
dat->theme.custom_colors[i] = GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename);
}
@@ -348,7 +348,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
defclr = g_Settings.crUserListColor;
g_Settings.nickColors[i] = GetPrivateProfileIntA("Nick Colors", _itoa(i, szTemp, 10), defclr, szIniFilename);
sprintf(szTemp, "NickColor%d", i);
- M->WriteDword("Chat", szTemp, g_Settings.nickColors[i]);
+ db_set_dw(0, "Chat", szTemp, g_Settings.nickColors[i]);
}
}
} else {
@@ -374,8 +374,8 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
dat->theme.inputbg = GetPrivateProfileIntA("Message Log", "InputBG", RGB(224, 224, 224), szIniFilename);
dat->theme.hgrid = GetPrivateProfileIntA("Message Log", "HgridColor", RGB(224, 224, 224), szIniFilename);
dat->theme.dwFlags = GetPrivateProfileIntA("Message Log", "DWFlags", MWF_LOG_DEFAULT, szIniFilename);
- M->WriteByte(SRMSGMOD_T, "wantvgrid", (BYTE)(GetPrivateProfileIntA("Message Log", "VGrid", 0, szIniFilename)));
- M->WriteByte(SRMSGMOD_T, "extramicrolf", (BYTE)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
+ db_set_b(0, SRMSGMOD_T, "wantvgrid", (BYTE)(GetPrivateProfileIntA("Message Log", "VGrid", 0, szIniFilename)));
+ db_set_b(0, SRMSGMOD_T, "extramicrolf", (BYTE)(GetPrivateProfileIntA("Message Log", "ExtraMicroLF", 0, szIniFilename)));
dat->theme.left_indent = GetPrivateProfileIntA("Message Log", "LeftIndent", 0, szIniFilename);
dat->theme.right_indent = GetPrivateProfileIntA("Message Log", "RightIndent", 0, szIniFilename);
@@ -383,7 +383,7 @@ void TSAPI ReadThemeFromINI(const TCHAR *szIniFilenameT, TContainerData *dat, in
for (i=0; i < CUSTOM_COLORS; i++) {
sprintf(szTemp, "cc%d", i + 1);
if (dat == 0)
- M->WriteDword(SRMSGMOD_T, szTemp, GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename));
+ db_set_dw(0, SRMSGMOD_T, szTemp, GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename));
else
dat->theme.custom_colors[i] = GetPrivateProfileIntA("Custom Colors", szTemp, RGB(224, 224, 224), szIniFilename);
}
@@ -437,7 +437,7 @@ const TCHAR* TSAPI GetThemeFileName(int iMode)
OPENFILENAME ofn = {0};
TCHAR szInitialDir[MAX_PATH];
- mir_sntprintf(szInitialDir, MAX_PATH, _T("%s"), M->getSkinPath());
+ mir_sntprintf(szInitialDir, MAX_PATH, _T("%s"), M.getSkinPath());
szFilename[0] = 0;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 4e439fff18..e628e00525 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -1041,15 +1041,15 @@ HBITMAP TSAPI CImageItem::LoadPNG(const TCHAR *szFilename)
void CSkin::setFileName()
{
DBVARIANT dbv;
- if (0 == M->GetTString(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
- M->pathToAbsolute(dbv.ptszVal, m_tszFileName, M->getSkinPath());
+ if (0 == db_get_ts(0, SRMSGMOD_T, "ContainerSkin", &dbv)) {
+ M.pathToAbsolute(dbv.ptszVal, m_tszFileName, M.getSkinPath());
m_tszFileName[MAX_PATH - 1] = 0;
db_free(&dbv);
}
else
m_tszFileName[0] = 0;
- m_fLoadOnStartup = M->GetByte("useskin", 0) ? true : false;
+ m_fLoadOnStartup = M.GetByte("useskin", 0) ? true : false;
}
/**
* initialize the skin object
@@ -1070,10 +1070,10 @@ void CSkin::Init(bool fStartup)
* read current skin name from db
*/
- m_DisableScrollbars = M->GetByte("disableVScroll", 0) ? true : false;
+ m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
setFileName();
- m_aeroEffect = M->GetDword("aerostyle", AERO_EFFECT_MILK);
+ m_aeroEffect = M.GetDword("aerostyle", AERO_EFFECT_MILK);
if (m_fLoadOnStartup && fStartup)
Load();
}
@@ -1217,7 +1217,7 @@ void CSkin::Unload()
::DestroyIcon(*(m_skinIcons[i].phIcon));
mir_free(m_skinIcons);
- M->getAeroState(); // refresh after unload
+ M.getAeroState(); // refresh after unload
::FreeTabConfig();
::ReloadTabConfig();
@@ -1225,7 +1225,7 @@ void CSkin::Unload()
m_avatarBorderClr = ::GetSysColor(COLOR_3DDKSHADOW);
m_sideBarContainerBG = ::GetSysColor(COLOR_3DFACE);
- m_DisableScrollbars = M->GetByte("disableVScroll", 0) ? true : false;
+ m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
}
void CSkin::LoadIcon(const TCHAR *szSection, const TCHAR *name, HICON *hIcon)
@@ -1419,10 +1419,10 @@ void CSkin::Load(void)
_tagSettings[i].defaultval, m_tszFileName);
switch (_tagSettings[i].size) {
case 1:
- M->WriteByte(SRMSGMOD_T, _tagSettings[i].szSetting, (BYTE)data);
+ db_set_b(0, SRMSGMOD_T, _tagSettings[i].szSetting, (BYTE)data);
break;
case 4:
- M->WriteDword(SRMSGMOD_T, _tagSettings[i].szSetting, data);
+ db_set_dw(0, SRMSGMOD_T, _tagSettings[i].szSetting, data);
break;
case 2:
db_set_w(NULL, SRMSGMOD_T, _tagSettings[i].szSetting, (WORD)data);
@@ -1430,13 +1430,13 @@ void CSkin::Load(void)
case 5:
GetPrivateProfileString(_tagSettings[i].szIniKey, _tagSettings[i].szIniName, _T("000000"),
buffer, 10, m_tszFileName);
- M->WriteDword(SRMSGMOD_T, _tagSettings[i].szSetting, HexStringToLong(buffer));
+ db_set_dw(0, SRMSGMOD_T, _tagSettings[i].szSetting, HexStringToLong(buffer));
break;
}
i++;
}
- m_DisableScrollbars = M->GetByte("disableVScroll", 0) ? true : false;
+ m_DisableScrollbars = M.GetByte("disableVScroll", 0) ? true : false;
ZeroMemory(szSections, 6000);
p = szSections;
@@ -1460,7 +1460,7 @@ void CSkin::Load(void)
if (j > 0) {
m_skinEnabled = true;
- M->getAeroState(); // refresh aero state (set to false when a skin is successfully loaded and active)
+ M.getAeroState(); // refresh aero state (set to false when a skin is successfully loaded and active)
}
GetPrivateProfileString(_T("Avatars"), _T("BorderColor"), _T("000000"), buffer, 20, m_tszFileName);
@@ -1516,7 +1516,7 @@ void CSkin::Load(void)
_tsplitpath(m_tszFileName, szDrive, szPath, NULL, NULL);
mir_sntprintf(szFinalName, MAX_PATH, _T("%s\\%s\\%s"), szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
- ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M->GetByte("skin_loadmode", 0));
+ ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
CacheLogFonts();
CacheMsgLogIcons();
}
@@ -1651,15 +1651,15 @@ void CSkin::setupTabCloseBitmap(bool fDeleteOnly)
HDC dc = ::GetDC(PluginConfig.g_hwndHotkeyHandler);
m_tabCloseHDC = ::CreateCompatibleDC(dc);
- if (M->isAero())
+ if (M.isAero())
m_tabCloseBitmap = CreateAeroCompatibleBitmap(rc, m_tabCloseHDC);
else
m_tabCloseBitmap = ::CreateCompatibleBitmap(dc, 20, 20);
m_tabCloseOldBitmap = reinterpret_cast<HBITMAP>(::SelectObject(m_tabCloseHDC, m_tabCloseBitmap));
- if (M->isVSThemed() || M->isAero()) {
- ::FillRect(m_tabCloseHDC, &rc, M->isAero() ? reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)) : ::GetSysColorBrush(COLOR_3DFACE));
+ if (M.isVSThemed() || M.isAero()) {
+ ::FillRect(m_tabCloseHDC, &rc, M.isAero() ? reinterpret_cast<HBRUSH>(::GetStockObject(BLACK_BRUSH)) : ::GetSysColorBrush(COLOR_3DFACE));
HANDLE hTheme = CMimAPI::m_pfnOpenThemeData(PluginConfig.g_hwndHotkeyHandler, L"BUTTON");
rc.left--; rc.right++;
@@ -1706,7 +1706,7 @@ void CSkin::setupAeroSkins()
{
TCHAR tszFilename[MAX_PATH], tszBasePath[MAX_PATH];
- M->getAeroState();
+ M.getAeroState();
UnloadAeroTabs();
BOOL isOpaque;
@@ -1716,7 +1716,7 @@ void CSkin::setupAeroSkins()
if (!m_fAeroSkinsValid)
return;
- mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M->getDataPath());
+ mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M.getDataPath());
if (tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
_tcscat(tszBasePath, _T("\\"));
@@ -1739,7 +1739,7 @@ void CSkin::setupAeroSkins()
if (!PathFileExists(tszFilename))
mir_sntprintf(tszFilename, MAX_PATH, _T("%stabskin_aero.png"), tszBasePath);
- if (CMimAPI::m_pfnDwmGetColorizationColor && M->isAero())
+ if (CMimAPI::m_pfnDwmGetColorizationColor && M.isAero())
CMimAPI::m_pfnDwmGetColorizationColor(&m_dwmColor, &isOpaque);
else
m_dwmColor = PluginConfig.m_fillColor;
@@ -1828,7 +1828,7 @@ void CSkin::setupAeroSkins()
fib = (FIBITMAP *)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_TCHAR | IMGL_RETURNDIB);
- COLORREF glowColor = M->GetDword(FONTMODULE, "aeroGlow", RGB(40, 40, 255));
+ COLORREF glowColor = M.GetDword(FONTMODULE, "aeroGlow", RGB(40, 40, 255));
hbm = FIF->FI_CreateHBITMAPFromDIB(fib);
CImageItem::Colorize(hbm, GetRValue(glowColor), GetGValue(glowColor), GetBValue(glowColor));
CImageItem::PreMultiply(hbm, 1);
@@ -2160,7 +2160,7 @@ int CSkin::RenderText(HDC hdc, HANDLE hTheme, const TCHAR *szText, RECT *rc, DWO
if ((PluginConfig.m_bIsVista && !CSkin::m_skinEnabled && hTheme) || fForceAero) {
DTTOPTS dto = {0};
dto.dwSize = sizeof(dto);
- if (iGlowSize && (M->isAero() || fForceAero)) {
+ if (iGlowSize && (M.isAero() || fForceAero)) {
dto.iGlowSize = iGlowSize;
dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
}
@@ -2301,10 +2301,10 @@ void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindo
if (dat->pContainer->dwFlags & CNT_HIDETOOLBAR)
return;
- bool fAero = M->isAero();
+ bool fAero = M.isAero();
bool fTbColorsValid = PluginConfig.m_tbBackgroundHigh && PluginConfig.m_tbBackgroundLow;
BYTE bAlphaOffset = 0;
- BOOL fMustDrawNonThemed = ((fAero || fTbColorsValid) && !M->GetByte(SRMSGMOD_T, "forceThemedToolbar", 0));
+ BOOL fMustDrawNonThemed = ((fAero || fTbColorsValid) && !M.GetByte(SRMSGMOD_T, "forceThemedToolbar", 0));
RECT rc, rcToolbar;;
POINT pt;
@@ -2364,13 +2364,13 @@ void CSkin::RenderToolbarBG(const TWindowData *dat, HDC hdc, const RECT &rcWindo
dat->pContainer->szOldToolbarSize.cx = cx;
dat->pContainer->szOldToolbarSize.cy = cy;
- if (!fMustDrawNonThemed && M->isVSThemed()) {
+ if (!fMustDrawNonThemed && M.isVSThemed()) {
CMimAPI::m_pfnDrawThemeBackground(dat->hThemeToolbar, dat->pContainer->cachedToolbarDC, 6, 1,
&rcCachedToolbar, &rcCachedToolbar);
dat->pContainer->bTBRenderingMode = 1; // tell TSButton how to render the tool bar buttons
}
else {
- dat->pContainer->bTBRenderingMode = (M->isVSThemed() ? 1 : 0);
+ dat->pContainer->bTBRenderingMode = (M.isVSThemed() ? 1 : 0);
m_tmp_tb_high = PluginConfig.m_tbBackgroundHigh ? PluginConfig.m_tbBackgroundHigh :
((fAero && m_pCurrentAeroEffect) ? m_pCurrentAeroEffect->m_clrToolbar : ::GetSysColor(COLOR_3DFACE));
m_tmp_tb_low = PluginConfig.m_tbBackgroundLow ? PluginConfig.m_tbBackgroundLow :
@@ -2526,7 +2526,7 @@ void CSkin::initAeroEffect()
void CSkin::setAeroEffect(LRESULT effect)
{
if (effect == -1)
- effect = static_cast<LRESULT>(M->GetDword(SRMSGMOD_T, "aerostyle", AERO_EFFECT_NONE));
+ effect = static_cast<LRESULT>(M.GetDword(SRMSGMOD_T, "aerostyle", AERO_EFFECT_NONE));
if (effect >= 0 && effect < AERO_EFFECT_LAST)
m_aeroEffect = (UINT)effect;
@@ -2534,7 +2534,7 @@ void CSkin::setAeroEffect(LRESULT effect)
m_aeroEffect = AERO_EFFECT_NONE;
initAeroEffect();
- M->WriteDword(SRMSGMOD_T, "aerostyle", m_aeroEffect);
+ db_set_dw(0, SRMSGMOD_T, "aerostyle", m_aeroEffect);
}
/**
@@ -2545,7 +2545,7 @@ void CSkin::setAeroEffect(LRESULT effect)
void CSkin::extractSkinsAndLogo(bool fForceOverwrite) const
{
TCHAR tszBasePath[MAX_PATH];
- mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M->getDataPath());
+ mir_sntprintf(tszBasePath, MAX_PATH, _T("%s"), M.getDataPath());
if (tszBasePath[lstrlen(tszBasePath) - 1] != '\\')
_tcscat(tszBasePath, _T("\\"));
@@ -2586,7 +2586,7 @@ void CSkin::UpdateToolbarBG(TWindowData* dat, DWORD dwRdwOptFlags)
rcUpdate.right = rcTmp.right;
rcUpdate.bottom = rcTmp.bottom;
- if (M->isAero() || M->isDwmActive())
+ if (M.isAero() || M.isDwmActive())
dat->fLimitedUpdate = true; // skip unrelevant window updates when we have buffered paint avail
::RedrawWindow(dat->hwnd, &rcUpdate, 0, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW);
::BB_RedrawButtons(dat);
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp
index 5739275cbb..d3b8006543 100644
--- a/plugins/TabSRMM/src/trayicon.cpp
+++ b/plugins/TabSRMM/src/trayicon.cpp
@@ -274,11 +274,11 @@ void TSAPI AddContactToFavorites(HANDLE hContact, const TCHAR *szNickname, const
UINT uid = GetMenuItemID(hMenu, 0);
if (uid) {
DeleteMenu(hMenu, (UINT_PTR)0, MF_BYPOSITION);
- M->WriteDword((HANDLE)uid, SRMSGMOD_T, "isRecent", 0);
+ db_set_dw((HANDLE)uid, SRMSGMOD_T, "isRecent", 0);
}
}
addnew:
- M->WriteDword(hContact, SRMSGMOD_T, "isRecent", time(NULL));
+ db_set_dw(hContact, SRMSGMOD_T, "isRecent", time(NULL));
AppendMenu(hMenu, MF_BYCOMMAND, (UINT_PTR)hContact, szMenuEntry);
}
else if (hMenu == PluginConfig.g_hMenuFavorites) { // insert the item sorted...
@@ -338,9 +338,9 @@ void TSAPI LoadFavoritesAndRecent()
return;
for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
- if (M->GetByte(hContact, SRMSGMOD_T, "isFavorite", 0))
+ if (M.GetByte(hContact, "isFavorite", 0))
AddContactToFavorites(hContact, NULL, NULL, NULL, 0, 0, 1, PluginConfig.g_hMenuFavorites);
- if ((dwRecent = M->GetDword(hContact, "isRecent", 0)) != 0 && iIndex < nen_options.wMaxRecent) {
+ if ((dwRecent = M.GetDword(hContact, "isRecent", 0)) != 0 && iIndex < nen_options.wMaxRecent) {
recentEntries[iIndex].dwTimestamp = dwRecent;
recentEntries[iIndex++].hContact = hContact;
}
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index 81e55921f3..c673ae2689 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -92,7 +92,7 @@ static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
void TN_TypingMessage(HANDLE hContact, int iMode)
{
// hidden & ignored contacts check
- if (M->GetByte(hContact, "CList", "Hidden", 0) || (M->GetDword(hContact, "Ignore", "Mask1",0) & 1)) // 9 - online notification
+ if (db_get_b(hContact, "CList", "Hidden", 0) || (db_get_dw(hContact, "Ignore", "Mask1",0) & 1)) // 9 - online notification
return;
if (!PluginConfig.g_PopupAvail || Disabled)
@@ -470,7 +470,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
case PSN_APPLY:
for (i=0; i < sizeof(colorPicker) / sizeof(colorPicker[0]); i++) {
colorPicker[i].color = SendDlgItemMessage(hwndDlg, colorPicker[i].res, CPM_GETCOLOUR, 0, 0);
- M->WriteDword(Module, colorPicker[i].desc, colorPicker[i].color);
+ db_set_dw(0, Module, colorPicker[i].desc, colorPicker[i].color);
}
Timeout = newTimeout; TimeoutMode = newTimeoutMode;
@@ -485,14 +485,14 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
OnePopup = IsDlgButtonChecked(hwndDlg, IDC_ONEPOPUP);
ShowMenu = IsDlgButtonChecked(hwndDlg, IDC_SHOWMENU);
- M->WriteByte(Module, SET_ONEPOPUP, OnePopup);
- M->WriteByte(Module, SET_SHOWDISABLEMENU, ShowMenu);
- M->WriteByte(Module, SET_DISABLED, (BYTE) (StartDisabled | StopDisabled));
- M->WriteByte(Module, SET_COLOR_MODE, ColorMode);
- M->WriteByte(Module, SET_TIMEOUT_MODE, TimeoutMode);
- M->WriteByte(Module, SET_TIMEOUT, (BYTE) Timeout);
- M->WriteByte(Module, SET_TIMEOUT_MODE2, TimeoutMode2);
- M->WriteByte(Module, SET_TIMEOUT2, (BYTE) Timeout2);
+ db_set_b(0, Module, SET_ONEPOPUP, OnePopup);
+ db_set_b(0, Module, SET_SHOWDISABLEMENU, ShowMenu);
+ db_set_b(0, Module, SET_DISABLED, (BYTE) (StartDisabled | StopDisabled));
+ db_set_b(0, Module, SET_COLOR_MODE, ColorMode);
+ db_set_b(0, Module, SET_TIMEOUT_MODE, TimeoutMode);
+ db_set_b(0, Module, SET_TIMEOUT, (BYTE) Timeout);
+ db_set_b(0, Module, SET_TIMEOUT_MODE2, TimeoutMode2);
+ db_set_b(0, Module, SET_TIMEOUT2, (BYTE) Timeout2);
return TRUE;
}
}
@@ -522,23 +522,23 @@ int TN_ModuleInit()
{
hPopupsList = (HANDLE) CallService(MS_UTILS_ALLOCWINDOWLIST,0,0);
- OnePopup = M->GetByte(Module,SET_ONEPOPUP,DEF_ONEPOPUP);
- ShowMenu = M->GetByte(Module,SET_SHOWDISABLEMENU,DEF_SHOWDISABLEMENU);
+ OnePopup = M.GetByte(Module,SET_ONEPOPUP,DEF_ONEPOPUP);
+ ShowMenu = M.GetByte(Module,SET_SHOWDISABLEMENU,DEF_SHOWDISABLEMENU);
- int i = M->GetByte(Module,SET_DISABLED,DEF_DISABLED);
+ int i = M.GetByte(Module,SET_DISABLED,DEF_DISABLED);
Disabled = i & 1;
StartDisabled = i & 2;
StopDisabled = i & 4;
- ColorMode = M->GetByte(Module,SET_COLOR_MODE,DEF_COLOR_MODE);
- TimeoutMode = M->GetByte(Module,SET_TIMEOUT_MODE,DEF_TIMEOUT_MODE);
- Timeout = M->GetByte(Module,SET_TIMEOUT,DEF_TIMEOUT);
- TimeoutMode2 = M->GetByte(Module,SET_TIMEOUT_MODE2,DEF_TIMEOUT_MODE2);
- Timeout2 = M->GetByte(Module,SET_TIMEOUT2,DEF_TIMEOUT2);
+ ColorMode = M.GetByte(Module,SET_COLOR_MODE,DEF_COLOR_MODE);
+ TimeoutMode = M.GetByte(Module,SET_TIMEOUT_MODE,DEF_TIMEOUT_MODE);
+ Timeout = M.GetByte(Module,SET_TIMEOUT,DEF_TIMEOUT);
+ TimeoutMode2 = M.GetByte(Module,SET_TIMEOUT_MODE2,DEF_TIMEOUT_MODE2);
+ Timeout2 = M.GetByte(Module,SET_TIMEOUT2,DEF_TIMEOUT2);
- if (!(M->GetDword(Module, colorPicker[0].desc, 1) && !M->GetDword(Module, colorPicker[0].desc, 0)))
+ if (!(M.GetDword(Module, colorPicker[0].desc, 1) && !M.GetDword(Module, colorPicker[0].desc, 0)))
for (i=0; i < SIZEOF(colorPicker); i++)
- colorPicker[i].color = M->GetDword(Module,colorPicker[i].desc,0);
+ colorPicker[i].color = M.GetDword(Module,colorPicker[i].desc,0);
mir_sntprintf(szStart, sizeof(szStart), TranslateT("...is typing a message."));
mir_sntprintf(szStop, sizeof(szStop), TranslateT("...has stopped typing."));
@@ -567,6 +567,6 @@ int TN_ModuleInit()
int TN_ModuleDeInit()
{
- M->WriteByte(Module, SET_DISABLED, (BYTE) (Disabled | StartDisabled | StopDisabled));
+ db_set_b(0, Module, SET_DISABLED, (BYTE) (Disabled | StartDisabled | StopDisabled));
return 0;
}
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index b479210602..8916de6c3d 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -67,15 +67,15 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
DWORD sCodePage;
int i;
hContact = (HANDLE)lParam;
- DWORD maxhist = M->GetDword(hContact, "maxhist", 0);
- BYTE bIEView = M->GetByte(hContact, "ieview", 0);
- BYTE bHPP = M->GetByte(hContact, "hpplog", 0);
- int iLocalFormat = M->GetDword(hContact, "sendformat", 0);
- BYTE bRTL = M->GetByte(hContact, "RTL", 0);
- BYTE bLTR = M->GetByte(hContact, "RTL", 1);
- BYTE bSplit = M->GetByte(hContact, "splitoverride", 0);
- BYTE bInfoPanel = M->GetByte(hContact, "infopanel", 0);
- BYTE bAvatarVisible = M->GetByte(hContact, "hideavatar", -1);
+ DWORD maxhist = M.GetDword(hContact, "maxhist", 0);
+ BYTE bIEView = M.GetByte(hContact, "ieview", 0);
+ BYTE bHPP = M.GetByte(hContact, "hpplog", 0);
+ int iLocalFormat = M.GetDword(hContact, "sendformat", 0);
+ BYTE bRTL = M.GetByte(hContact, "RTL", 0);
+ BYTE bLTR = M.GetByte(hContact, "RTL", 1);
+ BYTE bSplit = M.GetByte(hContact, "splitoverride", 0);
+ BYTE bInfoPanel = M.GetByte(hContact, "infopanel", 0);
+ BYTE bAvatarVisible = M.GetByte(hContact, "hideavatar", -1);
char *szProto = GetContactProto(hContact);
int def_log_index = 1, hpp_log_index = 1, ieview_log_index = 1;
@@ -134,11 +134,11 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
CheckDlgButton(hwndDlg, IDC_ISFAVORITE, TRUE);
CheckDlgButton(hwndDlg, IDC_PRIVATESPLITTER, bSplit);
- CheckDlgButton(hwndDlg, IDC_TEMPLOVERRIDE, M->GetByte(hContact, TEMPLATES_MODULE, "enabled", 0));
- CheckDlgButton(hwndDlg, IDC_RTLTEMPLOVERRIDE, M->GetByte(hContact, RTLTEMPLATES_MODULE, "enabled", 0));
+ CheckDlgButton(hwndDlg, IDC_TEMPLOVERRIDE, db_get_b(hContact, TEMPLATES_MODULE, "enabled", 0));
+ CheckDlgButton(hwndDlg, IDC_RTLTEMPLOVERRIDE, db_get_b(hContact, RTLTEMPLATES_MODULE, "enabled", 0));
//MAD
- CheckDlgButton(hwndDlg, IDC_LOADONLYACTUAL, M->GetByte(hContact, "ActualHistory", 0));
+ CheckDlgButton(hwndDlg, IDC_LOADONLYACTUAL, M.GetByte(hContact, "ActualHistory", 0));
//
SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_SETRANGE, 0, MAKELONG(1000, 5));
SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_SETPOS, 0, maxhist);
@@ -147,7 +147,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
CheckDlgButton(hwndDlg, IDC_ALWAYSTRIM2, maxhist != 0);
hCpCombo = GetDlgItem(hwndDlg, IDC_CODEPAGES);
- sCodePage = M->GetDword(hContact, "ANSIcodepage", 0);
+ sCodePage = M.GetDword(hContact, "ANSIcodepage", 0);
EnumSystemCodePages((CODEPAGE_ENUMPROC)FillCpCombo, CP_INSTALLED);
SendDlgItemMessage(hwndDlg, IDC_CODEPAGES, CB_INSERTSTRING, 0, (LPARAM)TranslateT("Use default codepage"));
if (sCodePage == 0)
@@ -158,8 +158,8 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
SendDlgItemMessage(hwndDlg, IDC_CODEPAGES, CB_SETCURSEL, (WPARAM)i, 0);
}
}
- CheckDlgButton(hwndDlg, IDC_FORCEANSI, M->GetByte(hContact, "forceansi", 0) ? 1 : 0);
- CheckDlgButton(hwndDlg, IDC_IGNORETIMEOUTS, M->GetByte(hContact, "no_ack", 0));
+ CheckDlgButton(hwndDlg, IDC_FORCEANSI, M.GetByte(hContact, "forceansi", 0) ? 1 : 0);
+ CheckDlgButton(hwndDlg, IDC_IGNORETIMEOUTS, M.GetByte(hContact, "no_ack", 0));
ShowWindow(hwndDlg, SW_SHOW);
return TRUE;
@@ -176,9 +176,9 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
int iIndex = CB_ERR, iMode = -1;
DWORD newCodePage;
unsigned int iOldIEView;
- HWND hWnd = M->FindWindow(hContact);
- DWORD sCodePage = M->GetDword(hContact, "ANSIcodepage", 0);
- BYTE bInfoPanel, bOldInfoPanel = M->GetByte(hContact, "infopanel", 0);
+ HWND hWnd = M.FindWindow(hContact);
+ DWORD sCodePage = M.GetDword(hContact, "ANSIcodepage", 0);
+ BYTE bInfoPanel, bOldInfoPanel = M.GetByte(hContact, "infopanel", 0);
BYTE bAvatarVisible = 0;
if (hWnd) {
@@ -194,20 +194,20 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
switch (iMode) {
case 0:
- M->WriteByte(hContact, SRMSGMOD_T, "ieview", 0);
- M->WriteByte(hContact, SRMSGMOD_T, "hpplog", 0);
+ db_set_b(hContact, SRMSGMOD_T, "ieview", 0);
+ db_set_b(hContact, SRMSGMOD_T, "hpplog", 0);
break;
case 1:
- M->WriteByte(hContact, SRMSGMOD_T, "ieview", -1);
- M->WriteByte(hContact, SRMSGMOD_T, "hpplog", -1);
+ db_set_b(hContact, SRMSGMOD_T, "ieview", -1);
+ db_set_b(hContact, SRMSGMOD_T, "hpplog", -1);
break;
case 2:
- M->WriteByte(hContact, SRMSGMOD_T, "ieview", -1);
- M->WriteByte(hContact, SRMSGMOD_T, "hpplog", 1);
+ db_set_b(hContact, SRMSGMOD_T, "ieview", -1);
+ db_set_b(hContact, SRMSGMOD_T, "hpplog", 1);
break;
case 3:
- M->WriteByte(hContact, SRMSGMOD_T, "ieview", 1);
- M->WriteByte(hContact, SRMSGMOD_T, "hpplog", -1);
+ db_set_b(hContact, SRMSGMOD_T, "ieview", 1);
+ db_set_b(hContact, SRMSGMOD_T, "hpplog", -1);
break;
}
if (hWnd && dat) {
@@ -222,62 +222,62 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
if (iIndex == 0)
db_unset(hContact, SRMSGMOD_T, "sendformat");
else
- M->WriteDword(hContact, SRMSGMOD_T, "sendformat", iIndex == 2 ? -1 : 1);
+ db_set_dw(hContact, SRMSGMOD_T, "sendformat", iIndex == 2 ? -1 : 1);
}
iIndex = SendDlgItemMessage(hwndDlg, IDC_CODEPAGES, CB_GETCURSEL, 0, 0);
if ((newCodePage = (DWORD)SendDlgItemMessage(hwndDlg, IDC_CODEPAGES, CB_GETITEMDATA, (WPARAM)iIndex, 0)) != sCodePage) {
- M->WriteDword(hContact, SRMSGMOD_T, "ANSIcodepage", (DWORD)newCodePage);
+ db_set_dw(hContact, SRMSGMOD_T, "ANSIcodepage", (DWORD)newCodePage);
if (hWnd && dat) {
dat->codePage = newCodePage;
SendMessage(hWnd, DM_UPDATETITLE, 0, 1);
}
}
- if ((IsDlgButtonChecked(hwndDlg, IDC_FORCEANSI) ? 1 : 0) != M->GetByte(hContact, "forceansi", 0)) {
- M->WriteByte(hContact, SRMSGMOD_T, "forceansi", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FORCEANSI) ? 1 : 0));
+ if ((IsDlgButtonChecked(hwndDlg, IDC_FORCEANSI) ? 1 : 0) != M.GetByte(hContact, "forceansi", 0)) {
+ db_set_b(hContact, SRMSGMOD_T, "forceansi", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_FORCEANSI) ? 1 : 0));
if (hWnd && dat)
dat->sendMode = IsDlgButtonChecked(hwndDlg, IDC_FORCEANSI) ? dat->sendMode | SMODE_FORCEANSI : dat->sendMode & ~SMODE_FORCEANSI;
}
if (IsDlgButtonChecked(hwndDlg, IDC_ISFAVORITE)) {
- if (!M->GetByte(hContact, SRMSGMOD_T, "isFavorite", 0))
+ if (!M.GetByte(hContact, "isFavorite", 0))
AddContactToFavorites(hContact, NULL, NULL, NULL, 0, 0, 1, PluginConfig.g_hMenuFavorites);
} else
DeleteMenu(PluginConfig.g_hMenuFavorites, (UINT_PTR)hContact, MF_BYCOMMAND);
- M->WriteByte(hContact, SRMSGMOD_T, "isFavorite", (WORD)(IsDlgButtonChecked(hwndDlg, IDC_ISFAVORITE) ? 1 : 0));
- M->WriteByte(hContact, SRMSGMOD_T, "splitoverride", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PRIVATESPLITTER) ? 1 : 0));
+ db_set_b(hContact, SRMSGMOD_T, "isFavorite", (WORD)(IsDlgButtonChecked(hwndDlg, IDC_ISFAVORITE) ? 1 : 0));
+ db_set_b(hContact, SRMSGMOD_T, "splitoverride", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_PRIVATESPLITTER) ? 1 : 0));
- M->WriteByte(hContact, TEMPLATES_MODULE, "enabled", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_TEMPLOVERRIDE)));
- M->WriteByte(hContact, RTLTEMPLATES_MODULE, "enabled", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_RTLTEMPLOVERRIDE)));
+ db_set_b(hContact, TEMPLATES_MODULE, "enabled", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_TEMPLOVERRIDE)));
+ db_set_b(hContact, RTLTEMPLATES_MODULE, "enabled", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_RTLTEMPLOVERRIDE)));
bAvatarVisible = (BYTE)SendDlgItemMessage(hwndDlg, IDC_SHOWAVATAR, CB_GETCURSEL, 0, 0);
if (bAvatarVisible == 0)
db_unset(hContact, SRMSGMOD_T, "hideavatar");
else
- M->WriteByte(hContact, SRMSGMOD_T, "hideavatar", (BYTE)(bAvatarVisible == 1 ? 1 : 0));
+ db_set_b(hContact, SRMSGMOD_T, "hideavatar", (BYTE)(bAvatarVisible == 1 ? 1 : 0));
bInfoPanel = (BYTE)SendDlgItemMessage(hwndDlg, IDC_INFOPANEL, CB_GETCURSEL, 0, 0);
if (bInfoPanel != bOldInfoPanel) {
- M->WriteByte(hContact, SRMSGMOD_T, "infopanel", (BYTE)(bInfoPanel == 0 ? 0 : (bInfoPanel == 1 ? 1 : -1)));
+ db_set_b(hContact, SRMSGMOD_T, "infopanel", (BYTE)(bInfoPanel == 0 ? 0 : (bInfoPanel == 1 ? 1 : -1)));
if (hWnd && dat)
SendMessage(hWnd, DM_SETINFOPANEL, 0, 0);
}
if (IsDlgButtonChecked(hwndDlg, IDC_ALWAYSTRIM2))
- M->WriteDword(hContact, SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
+ db_set_dw(hContact, SRMSGMOD_T, "maxhist", (DWORD)SendDlgItemMessage(hwndDlg, IDC_TRIMSPIN, UDM_GETPOS, 0, 0));
else
- M->WriteDword(hContact, SRMSGMOD_T, "maxhist", 0);
+ db_set_dw(hContact, SRMSGMOD_T, "maxhist", 0);
//MAD
if (IsDlgButtonChecked(hwndDlg, IDC_LOADONLYACTUAL)) {
- M->WriteByte(hContact, SRMSGMOD_T, "ActualHistory", 1);
+ db_set_b(hContact, SRMSGMOD_T, "ActualHistory", 1);
if (hWnd && dat) dat->bActualHistory=TRUE;
}else{
- M->WriteByte(hContact, SRMSGMOD_T, "ActualHistory", 0);
+ db_set_b(hContact, SRMSGMOD_T, "ActualHistory", 0);
if (hWnd && dat) dat->bActualHistory=FALSE;
}
//
if (IsDlgButtonChecked(hwndDlg, IDC_IGNORETIMEOUTS)) {
- M->WriteByte(hContact, SRMSGMOD_T, "no_ack", 1);
+ db_set_b(hContact, SRMSGMOD_T, "no_ack", 1);
if (hWnd && dat)
dat->sendMode |= SMODE_NOACK;
} else {
@@ -333,9 +333,9 @@ static struct _checkboxes {
int TSAPI LoadLocalFlags(HWND hwnd, struct TWindowData *dat)
{
int i = 0;
- DWORD dwMask = M->GetDword(dat->hContact, "mwmask", 0);
- DWORD dwLocal = M->GetDword(dat->hContact, "mwflags", 0);
- DWORD dwGlobal = M->GetDword("mwflags", 0);
+ DWORD dwMask = M.GetDword(dat->hContact, "mwmask", 0);
+ DWORD dwLocal = M.GetDword(dat->hContact, "mwflags", 0);
+ DWORD dwGlobal = M.GetDword("mwflags", 0);
DWORD maskval;
if (dat) {
@@ -381,8 +381,8 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA
DWORD dwLocalFlags, dwLocalMask, maskval;
int i = 0;
- dwLocalFlags = M->GetDword(hContact, "mwflags", 0);
- dwLocalMask = M->GetDword(hContact, "mwmask", 0);
+ dwLocalFlags = M.GetDword(hContact, "mwflags", 0);
+ dwLocalMask = M.GetDword(hContact, "mwmask", 0);
while(checkboxes[i].uId) {
maskval = checkboxes[i].uFlag;
@@ -393,16 +393,16 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA
CheckDlgButton(hwndDlg, checkboxes[i].uId, BST_INDETERMINATE);
i++;
}
- if (M->GetByte("logstatuschanges", 0) == M->GetByte(hContact, "logstatuschanges", 0))
+ if (M.GetByte("logstatuschanges", 0) == M.GetByte(hContact, "logstatuschanges", 0))
CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, BST_INDETERMINATE);
else
- CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, M->GetByte(hContact, "logstatuschanges", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_UPREFS_LOGSTATUS, M.GetByte(hContact, "logstatuschanges", 0) ? BST_CHECKED : BST_UNCHECKED);
break;
}
case WM_USER + 100: {
int i = 0;
LRESULT state;
- HWND hwnd = M->FindWindow(hContact);
+ HWND hwnd = M.FindWindow(hContact);
struct TWindowData *dat = NULL;
DWORD *dwActionToTake = (DWORD *)lParam, dwMask = 0, dwFlags = 0, maskval;
@@ -421,11 +421,11 @@ static INT_PTR CALLBACK DlgProcUserPrefsLogOptions(HWND hwndDlg, UINT msg, WPARA
}
state = IsDlgButtonChecked(hwndDlg, IDC_UPREFS_LOGSTATUS);
if (state != BST_INDETERMINATE) {
- M->WriteByte(hContact, SRMSGMOD_T, "logstatuschanges", (BYTE)state);
+ db_set_b(hContact, SRMSGMOD_T, "logstatuschanges", (BYTE)state);
}
if (dwMask) {
- M->WriteDword(hContact, SRMSGMOD_T, "mwmask", dwMask);
- M->WriteDword(hContact, SRMSGMOD_T, "mwflags", dwFlags);
+ db_set_dw(hContact, SRMSGMOD_T, "mwmask", dwMask);
+ db_set_dw(hContact, SRMSGMOD_T, "mwflags", dwFlags);
}
else {
db_unset(hContact, SRMSGMOD_T, "mwmask");
@@ -534,7 +534,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCITEM tci;
int i, count;
DWORD dwActionToTake = 0; // child pages request which action to take
- HWND hwnd = M->FindWindow(hContact);
+ HWND hwnd = M.FindWindow(hContact);
tci.mask = TCIF_PARAM;
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index c26bc17a5b..07aafdf478 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -406,7 +406,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
DBVARIANT dbv = {0};
- if (!M->GetTString(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
+ if (!db_get_ts(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
_tcsncpy(szTemp, dbv.ptszVal, 500);
szTemp[500] = 0;
db_free(&dbv);
@@ -428,7 +428,7 @@ const TCHAR* Utils::FormatTitleBar(const TWindowData *dat, const TCHAR *szFormat
if (dat->wStatus != ID_STATUS_OFFLINE && xStatus > 0 && xStatus <= 31) {
DBVARIANT dbv = {0};
- if (!M->GetTString(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
+ if (!db_get_ts(dat->hContact, (char *)dat->szProto, "XStatusName", &dbv)) {
_tcsncpy(szTemp, dbv.ptszVal, 500);
szTemp[500] = 0;
db_free(&dbv);
@@ -656,7 +656,7 @@ void Utils::CreateColorMap(TCHAR *Text)
for (i=0; i < RTF_CTABLE_DEFSIZE; i++)
rtf_ctable[i].index = 0;
- default_color = (COLORREF)M->GetDword(FONTMODULE, "Font16Col", 0);
+ default_color = (COLORREF)M.GetDword(FONTMODULE, "Font16Col", 0);
while (p2 && p2 < pEnd) {
if (_stscanf(p2, lpszFmt, &szRed, &szGreen, &szBlue) > 0) {
@@ -796,8 +796,8 @@ void Utils::SaveContainerSettings(TContainerData *pContainer, const char *szSett
mir_snprintf(szCName, 40, "%s%d_theme", szSetting, pContainer->iContainerIndex);
if (lstrlen(pContainer->szRelThemeFile) > 1) {
if (pContainer->fPrivateThemeChanged == TRUE) {
- M->pathToRelative(pContainer->szRelThemeFile, pContainer->szAbsThemeFile);
- M->WriteTString(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
+ M.pathToRelative(pContainer->szRelThemeFile, pContainer->szAbsThemeFile);
+ db_set_ts(NULL, SRMSGMOD_T, szCName, pContainer->szAbsThemeFile);
pContainer->fPrivateThemeChanged = FALSE;
}
}
@@ -882,7 +882,7 @@ HICON Utils::iconFromAvatar(const TWindowData *dat)
LONG ix = (lIconSize - (LONG)dNewWidth) / 2;
LONG iy = (lIconSize - (LONG)dNewHeight) / 2;
- CSkin::m_default_bf.SourceConstantAlpha = M->GetByte("taskBarIconAlpha", 255);
+ CSkin::m_default_bf.SourceConstantAlpha = M.GetByte("taskBarIconAlpha", 255);
CMimAPI::m_MyAlphaBlend(dc, ix, iy, (LONG)dNewWidth, (LONG)dNewHeight, dcResized,
0, 0, (LONG)dNewWidth, (LONG)dNewHeight, CSkin::m_default_bf);
@@ -1237,8 +1237,8 @@ __int64 CWarning::getMask()
{
__int64 mask = 0;
- DWORD dwLow = M->GetDword("cWarningsL", 0);
- DWORD dwHigh = M->GetDword("cWarningsH", 0);
+ DWORD dwLow = M.GetDword("cWarningsL", 0);
+ DWORD dwHigh = M.GetDword("cWarningsH", 0);
mask = ((((__int64)dwHigh) << 32) & 0xffffffff00000000) | dwLow;
@@ -1497,9 +1497,9 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
if (::IsDlgButtonChecked(hwnd, IDC_DONTSHOWAGAIN)) {
DWORD val = (DWORD)(newVal & 0x00000000ffffffff);
- M->WriteDword(SRMSGMOD_T, "cWarningsL", val);
+ db_set_dw(0, SRMSGMOD_T, "cWarningsL", val);
val = (DWORD)((newVal >> 32) & 0x00000000ffffffff);
- M->WriteDword(SRMSGMOD_T, "cWarningsH", val);
+ db_set_dw(0, SRMSGMOD_T, "cWarningsH", val);
}
}
break;