summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/clist/clc.cpp8
-rw-r--r--src/modules/clist/clcfiledrop.cpp2
-rw-r--r--src/modules/clist/clcitems.cpp8
-rw-r--r--src/modules/clist/clcmsgs.cpp4
-rw-r--r--src/modules/clist/clcutils.cpp4
-rw-r--r--src/modules/clist/clistevents.cpp8
-rw-r--r--src/modules/clist/clistmenus.cpp4
-rw-r--r--src/modules/clist/clistmod.cpp6
-rw-r--r--src/modules/clist/clistsettings.cpp4
-rw-r--r--src/modules/clist/clisttray.cpp43
-rw-r--r--src/modules/clist/clui.cpp2
-rw-r--r--src/modules/clist/cluiservices.cpp6
-rw-r--r--src/modules/clist/contact.cpp6
-rw-r--r--src/modules/clist/contacts.cpp15
-rw-r--r--src/modules/clist/keyboard.cpp2
-rw-r--r--src/modules/clist/protocolorder.cpp137
-rw-r--r--src/modules/database/dbini.cpp11
-rw-r--r--src/modules/database/mdatabasecache.cpp13
-rw-r--r--src/modules/extraicons/DefaultExtraIcons.cpp2
-rw-r--r--src/modules/extraicons/ExtraIconGroup.cpp6
-rw-r--r--src/modules/extraicons/IcolibExtraIcon.cpp8
-rw-r--r--src/modules/extraicons/extraicons.cpp8
-rw-r--r--src/modules/findadd/findadd.cpp2
-rw-r--r--src/modules/findadd/searchresults.cpp6
-rw-r--r--src/modules/fonts/FontOptions.cpp163
-rw-r--r--src/modules/icolib/skin2icons.cpp15
-rw-r--r--src/modules/netlib/netlib.cpp12
-rw-r--r--src/modules/options/filter.cpp4
-rw-r--r--src/modules/options/filter.h2
-rw-r--r--src/modules/options/headerbar.cpp4
-rw-r--r--src/modules/options/iconheader.cpp6
-rw-r--r--src/modules/options/options.cpp2
-rw-r--r--src/modules/protocols/protoopts.cpp13
-rw-r--r--src/modules/skin/hotkeys.cpp6
-rw-r--r--src/modules/skin/skinicons.cpp4
-rw-r--r--src/modules/utils/colourpicker.cpp65
-rw-r--r--src/modules/utils/imgconv.cpp155
-rw-r--r--src/modules/utils/openurl.cpp9
-rw-r--r--src/modules/utils/timezones.cpp10
-rw-r--r--src/modules/visibility/visibility.cpp2
-rw-r--r--src/modules/xml/xmlParser.h21
41 files changed, 376 insertions, 432 deletions
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index 3c530cff57..81e0fe8ce3 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -196,7 +196,7 @@ static INT_PTR SetInfoTipHoverTime(WPARAM wParam, LPARAM)
static INT_PTR GetInfoTipHoverTime(WPARAM, LPARAM)
{
- return DBGetContactSettingWord(NULL, "CLC", "InfoTipHoverTime", 750);
+ return db_get_w(NULL, "CLC", "InfoTipHoverTime", 750);
}
static void SortClcByTimer(HWND hwnd)
@@ -283,7 +283,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
dat->iInsertionMark = -1;
dat->insertionMarkHitHeight = 5;
dat->iHotTrack = -1;
- dat->infoTipTimeout = DBGetContactSettingWord(NULL, "CLC", "InfoTipHoverTime", 750);
+ dat->infoTipTimeout = db_get_w(NULL, "CLC", "InfoTipHoverTime", 750);
dat->extraColumnSpacing = 20;
dat->list.cl.increment = 30;
dat->needsResort = 1;
@@ -515,7 +515,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (szProto == NULL)
status = ID_STATUS_OFFLINE;
else
- status = DBGetContactSettingWord((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
+ status = db_get_w((HANDLE)wParam, szProto, "Status", ID_STATUS_OFFLINE);
// this means an offline msg is flashing, so the contact should be shown
DWORD style = GetWindowLongPtr(hwnd, GWL_STYLE);
@@ -610,7 +610,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
if (szProto == NULL)
break;
- WORD apparentMode = DBGetContactSettingWord((HANDLE)wParam, szProto, "ApparentMode", 0);
+ WORD apparentMode = db_get_w((HANDLE)wParam, szProto, "ApparentMode", 0);
contact->flags &= ~(CONTACTF_INVISTO | CONTACTF_VISTO);
if (apparentMode == ID_STATUS_OFFLINE)
contact->flags |= CONTACTF_INVISTO;
diff --git a/src/modules/clist/clcfiledrop.cpp b/src/modules/clist/clcfiledrop.cpp
index aedf412c02..1993936a01 100644
--- a/src/modules/clist/clcfiledrop.cpp
+++ b/src/modules/clist/clcfiledrop.cpp
@@ -83,7 +83,7 @@ static HANDLE HContactFromPoint(HWND hwnd, struct ClcData *dat, int x, int y, in
DWORD protoCaps = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
if ( !(protoCaps & PF1_FILESEND))
return NULL;
- if (ID_STATUS_OFFLINE == DBGetContactSettingWord(contact->hContact, szProto, "Status", ID_STATUS_OFFLINE))
+ if (ID_STATUS_OFFLINE == db_get_w(contact->hContact, szProto, "Status", ID_STATUS_OFFLINE))
return NULL;
if (hitLine)
*hitLine = hit;
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp
index 16587acc02..e9d280b96f 100644
--- a/src/modules/clist/clcitems.cpp
+++ b/src/modules/clist/clcitems.cpp
@@ -189,9 +189,9 @@ int fnAddContactToGroup(struct ClcData *dat, ClcGroup *group, HANDLE hContact)
group->cl.items[i]->iImage = CallService(MS_CLIST_GETCONTACTICON, (WPARAM) hContact, 0);
group->cl.items[i]->hContact = hContact;
group->cl.items[i]->proto = szProto;
- if (szProto != NULL && !cli.pfnIsHiddenMode(dat, DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
+ if (szProto != NULL && !cli.pfnIsHiddenMode(dat, db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
group->cl.items[i]->flags |= CONTACTF_ONLINE;
- WORD apparentMode = szProto != NULL ? DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0) : 0;
+ WORD apparentMode = szProto != NULL ? db_get_w(hContact, szProto, "ApparentMode", 0) : 0;
if (apparentMode == ID_STATUS_OFFLINE)
group->cl.items[i]->flags |= CONTACTF_INVISTO;
else if (apparentMode == ID_STATUS_ONLINE)
@@ -225,7 +225,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int upd
checkHideOffline = 0;
if (checkHideOffline)
if (szProto != NULL)
- status = DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
if (DBGetContactSettingTString(hContact, "CList", "Group", &dbv))
group = &dat->list;
@@ -397,7 +397,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat)
if ( !cli.pfnIsHiddenMode(dat, ID_STATUS_OFFLINE))
cli.pfnAddContactToGroup(dat, group, hContact);
}
- else if ( !cli.pfnIsHiddenMode(dat, DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
+ else if ( !cli.pfnIsHiddenMode(dat, db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE)))
cli.pfnAddContactToGroup(dat, group, hContact);
}
else cli.pfnAddContactToGroup(dat, group, hContact);
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp
index d6245b49cb..3492ef3438 100644
--- a/src/modules/clist/clcmsgs.cpp
+++ b/src/modules/clist/clcmsgs.cpp
@@ -236,7 +236,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
if (++i >= group->cl.count)
return NULL;
}
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ while (group->cl.items[i]->type == CLCIT_DIVIDER);
return (LRESULT)cli.pfnContactToHItem(group->cl.items[i]);
case CLGN_PREVIOUS:
@@ -244,7 +244,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
if (--i < 0)
return NULL;
}
- while (group->cl.items[i]->type == CLCIT_DIVIDER);
+ while (group->cl.items[i]->type == CLCIT_DIVIDER);
return (LRESULT)cli.pfnContactToHItem(group->cl.items[i]);
case CLGN_NEXTCONTACT:
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index a6326e05fa..8b237e7d8f 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -748,7 +748,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat)
dat->leftMargin = db_get_b(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN);
dat->exStyle = db_get_dw(NULL, "CLC", "ExStyle", cli.pfnGetDefaultExStyle());
- dat->scrollTime = DBGetContactSettingWord(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME);
+ dat->scrollTime = db_get_w(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME);
dat->groupIndent = db_get_b(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT);
dat->gammaCorrection = db_get_b(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT);
dat->showIdle = db_get_b(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE);
@@ -768,7 +768,7 @@ void fnLoadClcOptions(HWND hwnd, struct ClcData *dat)
mir_free(dbv.pszVal);
}
}
- dat->backgroundBmpUse = DBGetContactSettingWord(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
+ dat->backgroundBmpUse = db_get_w(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
dat->greyoutFlags = db_get_dw(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS);
dat->offlineModes = db_get_dw(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES);
diff --git a/src/modules/clist/clistevents.cpp b/src/modules/clist/clistevents.cpp
index 7dae6a7713..5f85903d1d 100644
--- a/src/modules/clist/clistevents.cpp
+++ b/src/modules/clist/clistevents.cpp
@@ -188,7 +188,7 @@ struct CListEvent* fnAddEvent(CLISTEVENT *cle)
else
szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)cle->hContact, 0);
iconsOn = 1;
- flashTimerId = SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550), IconFlashTimer);
+ flashTimerId = SetTimer(NULL, 0, db_get_w(NULL, "CList", "IconFlashTime", 550), IconFlashTimer);
cli.pfnTrayIconUpdateWithImageList(p->imlIconIndex, p->cle.ptszTooltip, szProto);
}
cli.pfnChangeContactIcon(cle->hContact, p->imlIconIndex, 1);
@@ -423,10 +423,8 @@ struct CListEvent* fnCreateEvent(void)
void fnFreeEvent(struct CListEvent* p)
{
- if (p->cle.pszService)
- mir_free(p->cle.pszService);
- if (p->cle.pszTooltip)
- mir_free(p->cle.pszTooltip);
+ mir_free(p->cle.pszService);
+ mir_free(p->cle.pszTooltip);
mir_free(p);
}
diff --git a/src/modules/clist/clistmenus.cpp b/src/modules/clist/clistmenus.cpp
index 094baafc67..5e33c150ce 100644
--- a/src/modules/clist/clistmenus.cpp
+++ b/src/modules/clist/clistmenus.cpp
@@ -336,7 +336,7 @@ static INT_PTR BuildContactMenu(WPARAM wParam, LPARAM)
BuildContactParam bcp;
bcp.szProto = szProto;
bcp.isOnList = (db_get_b(hContact, "CList", "NotOnList", 0) == 0);
- bcp.isOnline = (szProto != NULL && ID_STATUS_OFFLINE != DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE));
+ bcp.isOnline = (szProto != NULL && ID_STATUS_OFFLINE != db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE));
ListParam param = { 0 };
param.MenuObjectHandle = hContactMenuObject;
@@ -1379,7 +1379,7 @@ void InitCustomMenus(void)
HookEvent(ME_HOTKEYS_CHANGED, sttRebuildHotkeys);
- // add exit command to menu
+ // add exit command to menu
{
CLISTMENUITEM mi = { 0 };
mi.cbSize = sizeof(mi);
diff --git a/src/modules/clist/clistmod.cpp b/src/modules/clist/clistmod.cpp
index 60ce86d46d..962b733987 100644
--- a/src/modules/clist/clistmod.cpp
+++ b/src/modules/clist/clistmod.cpp
@@ -191,7 +191,7 @@ static INT_PTR GetContactIcon(WPARAM wParam, LPARAM)
HANDLE hContact = (HANDLE)wParam;
return cli.pfnIconFromStatusMode(szProto,
- szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact);
+ szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact);
}
static void AddProtoIconIndex(PROTOACCOUNT* pa)
@@ -446,8 +446,8 @@ static INT_PTR CompareContacts(WPARAM wParam, LPARAM lParam)
szProto1 = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) a, 0);
szProto2 = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) b, 0);
- statusa = DBGetContactSettingWord((HANDLE) a, SAFESTRING(szProto1), "Status", ID_STATUS_OFFLINE);
- statusb = DBGetContactSettingWord((HANDLE) b, SAFESTRING(szProto2), "Status", ID_STATUS_OFFLINE);
+ statusa = db_get_w((HANDLE) a, SAFESTRING(szProto1), "Status", ID_STATUS_OFFLINE);
+ statusb = db_get_w((HANDLE) b, SAFESTRING(szProto2), "Status", ID_STATUS_OFFLINE);
if (sortByProto) {
/* deal with statuses, online contacts have to go above offline */
diff --git a/src/modules/clist/clistsettings.cpp b/src/modules/clist/clistsettings.cpp
index 00b85a2194..504511acd2 100644
--- a/src/modules/clist/clistsettings.cpp
+++ b/src/modules/clist/clistsettings.cpp
@@ -270,7 +270,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
if ( !strcmp(cws->szSetting, "Hidden")) {
if (cws->value.type == DBVT_DELETED || cws->value.bVal == 0) {
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
- cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(szProto, szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 1);
+ cli.pfnChangeContactIcon(hContact, cli.pfnIconFromStatusMode(szProto, szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE), hContact), 1);
}
else
CallService(MS_CLUI_CONTACTDELETED, wParam, 0);
@@ -288,7 +288,7 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam)
szProto = cws->value.pszVal;
cli.pfnChangeContactIcon(hContact,
cli.pfnIconFromStatusMode(szProto,
- szProto == NULL ? ID_STATUS_OFFLINE : DBGetContactSettingWord(hContact, szProto, "Status",
+ szProto == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto, "Status",
ID_STATUS_OFFLINE), hContact), 0);
}
}
diff --git a/src/modules/clist/clisttray.cpp b/src/modules/clist/clisttray.cpp
index 65ca28a352..ae9e9e7da0 100644
--- a/src/modules/clist/clisttray.cpp
+++ b/src/modules/clist/clisttray.cpp
@@ -275,7 +275,6 @@ int fnTrayIconInit(HWND hwnd)
cli.trayIcon = (trayIconInfo_t *) mir_calloc(sizeof(trayIconInfo_t) * accounts.getCount());
int trayIconSetting = db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
-
if (trayIconSetting == SETTING_TRAYICON_SINGLE) {
DBVARIANT dbv = { DBVT_DELETED };
char *szProto;
@@ -288,8 +287,7 @@ int fnTrayIconInit(HWND hwnd)
cli.pfnTrayIconAdd(hwnd, NULL, szProto, szProto ? CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0));
DBFreeVariant(&dbv);
}
- else if (trayIconSetting == SETTING_TRAYICON_MULTI &&
- (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
+ else if (trayIconSetting == SETTING_TRAYICON_MULTI && (averageMode < 0 || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
{
cli.trayIconCount = netProtoCount;
for (int i=0; i < accounts.getCount(); i++) {
@@ -298,14 +296,14 @@ int fnTrayIconInit(HWND hwnd)
PROTOACCOUNT* pa = accounts[j];
if (cli.pfnGetProtocolVisibility(pa->szModuleName))
cli.pfnTrayIconAdd(hwnd, pa->szModuleName, NULL, CallProtoServiceInt(NULL,pa->szModuleName, PS_GETSTATUS, 0, 0));
- }
+ }
}
- }
+ }
else {
cli.pfnTrayIconAdd(hwnd, NULL, NULL, averageMode);
if (trayIconSetting == SETTING_TRAYICON_CYCLE && averageMode < 0)
- cli.cycleTimerId = SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
+ cli.cycleTimerId = SetTimer(NULL, 0, db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
}
}
else {
@@ -423,8 +421,8 @@ int fnTrayIconUpdate(HICON hNewIcon, const TCHAR *szNewTip, const char *szPrefer
cli.trayIcon[i].isBase = isBase;
if (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI) {
- DWORD time1 = DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
- DWORD time2 = DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550)+1000;
+ DWORD time1 = db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT)*200;
+ DWORD time2 = db_get_w(NULL, "CList", "IconFlashTime", 550)+1000;
DWORD time = max(max(2000, time1), time2);
if (RefreshTimerId) {KillTimer(NULL, RefreshTimerId); RefreshTimerId = 0;}
RefreshTimerId = SetTimer(NULL, 0, time, RefreshTimerProc); // if unknown base was changed - than show preffered proto icon for 2 sec and reset it to original one after timeout
@@ -452,10 +450,10 @@ int fnTrayIconSetBaseInfo(HICON hIcon, const char *szPreferredProto)
cli.trayIcon[i].hBaseIcon = hIcon;
ulock; return i;
}
- if ((cli.pfnGetProtocolVisibility(szPreferredProto))
- && (GetAverageMode() == -1)
- && (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI)
- && !(db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
+ if ((cli.pfnGetProtocolVisibility(szPreferredProto)) &&
+ (GetAverageMode() == -1) &&
+ (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI) &&
+ !(db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)))
goto LBL_Error;
}
@@ -519,10 +517,9 @@ void fnTrayIconUpdateBase(const char *szChangedProto)
cli.cycleTimerId = 0;
}
- for (i=0; i < accounts.getCount(); i++) {
+ for (i=0; i < accounts.getCount(); i++)
if ( !lstrcmpA(szChangedProto, accounts[i]->szModuleName))
cycleStep = i - 1;
- }
if (netProtoCount > 0) {
int trayIconSetting = db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT);
@@ -552,22 +549,24 @@ void fnTrayIconUpdateBase(const char *szChangedProto)
szProto = NULL;
else
szProto = dbv.pszVal;
- changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szProto, szProto ? CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
+ changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szProto, szProto ?
+ CallProtoServiceInt(NULL,szProto, PS_GETSTATUS, 0, 0) :
+ CallService(MS_CLIST_GETSTATUSMODE, 0, 0)), szProto);
DBFreeVariant(&dbv);
- break;
}
+ break;
+
case SETTING_TRAYICON_CYCLE:
- cli.cycleTimerId =
- SetTimer(NULL, 0, DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
+ cli.cycleTimerId = SetTimer(NULL, 0, db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cli.pfnTrayCycleTimerProc);
changed =
cli.pfnTrayIconSetBaseInfo(ImageList_GetIcon
(hCListImages, cli.pfnIconFromStatusMode(szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0), NULL),
ILD_NORMAL), NULL);
break;
+
case SETTING_TRAYICON_MULTI:
- if ( !cli.trayIcon) {
+ if ( !cli.trayIcon)
cli.pfnTrayIconRemove(NULL, NULL);
- }
else if ((cli.trayIconCount > 1 || netProtoCount == 1) || db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT))
changed = cli.pfnTrayIconSetBaseInfo(cli.pfnGetIconFromStatusMode(NULL, szChangedProto, CallProtoServiceInt(NULL,szChangedProto, PS_GETSTATUS, 0, 0)), (char*)szChangedProto);
else {
@@ -643,7 +642,7 @@ int fnTrayIconPauseAutoHide(WPARAM, LPARAM)
if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (GetActiveWindow() != cli.hwndContactList) {
KillTimer(NULL, autoHideTimerId);
- autoHideTimerId = SetTimer(NULL, 0, 1000 * DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
+ autoHideTimerId = SetTimer(NULL, 0, 1000 * db_get_w(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
}
}
ulock; return 0;
@@ -721,7 +720,7 @@ INT_PTR fnTrayIconProcessMessage(WPARAM wParam, LPARAM lParam)
case WM_ACTIVATE:
if (db_get_b(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT)) {
if (LOWORD(msg->wParam) == WA_INACTIVE)
- autoHideTimerId = SetTimer(NULL, 0, 1000 * DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
+ autoHideTimerId = SetTimer(NULL, 0, 1000 * db_get_w(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), TrayIconAutoHideTimer);
else
KillTimer(NULL, autoHideTimerId);
}
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index 983ff73007..1a0c9e9410 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -523,7 +523,7 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case M_RESTORESTATUS:
#ifndef _DEBUG
{
- int nStatus = DBGetContactSettingWord(NULL, "CList", "Status", ID_STATUS_OFFLINE);
+ int nStatus = db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE);
if (nStatus != ID_STATUS_OFFLINE) CallService(MS_CLIST_SETSTATUSMODE, nStatus, 0);
}
#endif
diff --git a/src/modules/clist/cluiservices.cpp b/src/modules/clist/cluiservices.cpp
index 7f33bc0a3a..6fe9fb8b6f 100644
--- a/src/modules/clist/cluiservices.cpp
+++ b/src/modules/clist/cluiservices.cpp
@@ -159,11 +159,11 @@ void fnCluiProtocolStatusChanged(int, const char*)
int borders[3];
int flags = 0;
- if (cli.menuProtoCount == 0) {
- SendMessage(cli.hwndStatus, SB_SETPARTS, 0, 0);
+ if (cli.menuProtoCount == 0) {
+ SendMessage(cli.hwndStatus, SB_SETPARTS, 0, 0);
SendMessage(cli.hwndStatus, SB_SETTEXT, SBT_OWNERDRAW, 0);
return;
- }
+ }
SendMessage(cli.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
diff --git a/src/modules/clist/contact.cpp b/src/modules/clist/contact.cpp
index 574ea53bb8..becd06f2a3 100644
--- a/src/modules/clist/contact.cpp
+++ b/src/modules/clist/contact.cpp
@@ -48,7 +48,7 @@ static int GetContactStatus(HANDLE hContact)
char* szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szProto == NULL)
return ID_STATUS_OFFLINE;
- return DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
}
void fnChangeContactIcon(HANDLE hContact, int iIcon, int add)
@@ -99,8 +99,8 @@ int fnCompareContacts(const ClcContact* c1, const ClcContact* c2)
int statusa, statusb;
int rc;
- statusa = DBGetContactSettingWord((HANDLE) a, c1->proto, "Status", ID_STATUS_OFFLINE);
- statusb = DBGetContactSettingWord((HANDLE) b, c2->proto, "Status", ID_STATUS_OFFLINE);
+ statusa = db_get_w((HANDLE) a, c1->proto, "Status", ID_STATUS_OFFLINE);
+ statusb = db_get_w((HANDLE) b, c2->proto, "Status", ID_STATUS_OFFLINE);
if (sortByProto) {
/* deal with statuses, online contacts have to go above offline */
diff --git a/src/modules/clist/contacts.cpp b/src/modules/clist/contacts.cpp
index 38fb4d0788..60a2a3d443 100644
--- a/src/modules/clist/contacts.cpp
+++ b/src/modules/clist/contacts.cpp
@@ -35,14 +35,13 @@ BYTE nameOrder[NAMEORDERCOUNT];
static int GetDatabaseString(CONTACTINFO *ci, const char* setting, DBVARIANT* dbv)
{
- if (strcmp(ci->szProto, "CList") && CallProtoService(ci->szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC)
- {
- DBCONTACTGETSETTING cgs = { ci->szProto, setting, dbv };
- dbv->type = (ci->dwFlag & CNF_UNICODE) ? DBVT_WCHAR : DBVT_ASCIIZ;
-
- int res = CallProtoService(ci->szProto, PS_GETINFOSETTING, (WPARAM)ci->hContact, (LPARAM)&cgs);
- if (res != CALLSERVICE_NOTFOUND) return res;
- }
+ if (strcmp(ci->szProto, "CList") && CallProtoService(ci->szProto, PS_GETCAPS, PFLAGNUM_4, 0) & PF4_INFOSETTINGSVC) {
+ DBCONTACTGETSETTING cgs = { ci->szProto, setting, dbv };
+ dbv->type = (ci->dwFlag & CNF_UNICODE) ? DBVT_WCHAR : DBVT_ASCIIZ;
+
+ int res = CallProtoService(ci->szProto, PS_GETINFOSETTING, (WPARAM)ci->hContact, (LPARAM)&cgs);
+ if (res != CALLSERVICE_NOTFOUND) return res;
+ }
if (ci->dwFlag & CNF_UNICODE)
return DBGetContactSettingWString(ci->hContact, ci->szProto, setting, dbv);
diff --git a/src/modules/clist/keyboard.cpp b/src/modules/clist/keyboard.cpp
index 95df7f4ae2..6da22a5fb7 100644
--- a/src/modules/clist/keyboard.cpp
+++ b/src/modules/clist/keyboard.cpp
@@ -62,7 +62,7 @@ static INT_PTR hkCloseMiranda(WPARAM wParam, LPARAM lParam)
INT_PTR hkRestoreStatus(WPARAM wParam, LPARAM lParam)
{
- int nStatus = DBGetContactSettingWord(NULL, "CList", "Status", ID_STATUS_OFFLINE);
+ int nStatus = db_get_w(NULL, "CList", "Status", ID_STATUS_OFFLINE);
CallService(MS_CLIST_SETSTATUSMODE, nStatus, 0);
return 0;
}
diff --git a/src/modules/clist/protocolorder.cpp b/src/modules/clist/protocolorder.cpp
index cebda085cb..25e1556c56 100644
--- a/src/modules/clist/protocolorder.cpp
+++ b/src/modules/clist/protocolorder.cpp
@@ -58,74 +58,58 @@ int isProtoSuitable(PROTO_INTERFACE* ppi)
bool CheckProtocolOrder(void)
{
- bool changed = false;
- int i, id = 0;
-
- for (;;)
- {
- // Find account with this id
- for (i=0; i < accounts.getCount(); i++)
- if (accounts[i]->iOrder == id) break;
-
- // Account with id not found
- if (i == accounts.getCount())
- {
- // Check if this is skipped id, if it is decrement all other ids
- bool found = false;
- for (i=0; i < accounts.getCount(); i++)
- {
- if (accounts[i]->iOrder < 1000000 && accounts[i]->iOrder > id)
- {
- --accounts[i]->iOrder;
- found = true;
- }
- }
- if (found) changed = true;
- else break;
- }
- else
- ++id;
- }
-
- if (id < accounts.getCount())
- {
- // Remove huge ids
- for (i=0; i < accounts.getCount(); i++)
- {
- if (accounts[i]->iOrder >= 1000000)
- accounts[i]->iOrder = id++;
- }
- changed = true;
- }
-
- if (id < accounts.getCount())
- {
- // Remove duplicate ids
- for (i=0; i < accounts.getCount(); i++)
- {
- bool found = false;
- for (int j = 0; j < accounts.getCount(); j++)
- {
- if (accounts[j]->iOrder == i)
- {
- if (found) accounts[j]->iOrder = id++;
- else found = true;
- }
- }
- }
- changed = true;
- }
-
- return changed;
-}
+ bool changed = false;
+ int i, id = 0;
+
+ for (;;) {
+ // Find account with this id
+ for (i=0; i < accounts.getCount(); i++)
+ if (accounts[i]->iOrder == id) break;
+
+ // Account with id not found
+ if (i == accounts.getCount()) {
+ // Check if this is skipped id, if it is decrement all other ids
+ bool found = false;
+ for (i=0; i < accounts.getCount(); i++) {
+ if (accounts[i]->iOrder < 1000000 && accounts[i]->iOrder > id) {
+ --accounts[i]->iOrder;
+ found = true;
+ }
+ }
+ if (found) changed = true;
+ else break;
+ }
+ else id++;
+ }
+ if (id < accounts.getCount()) {
+ // Remove huge ids
+ for (i=0; i < accounts.getCount(); i++)
+ if (accounts[i]->iOrder >= 1000000)
+ accounts[i]->iOrder = id++;
+
+ changed = true;
+ }
+
+ if (id < accounts.getCount()) {
+ // Remove duplicate ids
+ for (i=0; i < accounts.getCount(); i++) {
+ bool found = false;
+ for (int j = 0; j < accounts.getCount(); j++) {
+ if (accounts[j]->iOrder == i) {
+ if (found) accounts[j]->iOrder = id++;
+ else found = true;
+ }
+ }
+ }
+ changed = true;
+ }
+
+ return changed;
+}
int FillTree(HWND hwnd)
{
- ProtocolData *PD;
- int i;
- PROTOACCOUNT* pa;
-
TVINSERTSTRUCT tvis;
tvis.hParent = NULL;
tvis.hInsertAfter = TVI_LAST;
@@ -135,14 +119,14 @@ int FillTree(HWND hwnd)
if (accounts.getCount() == 0)
return FALSE;
- for (i=0; i < accounts.getCount(); i++) {
+ for (int i=0; i < accounts.getCount(); i++) {
int idx = cli.pfnGetAccountIndexByPos(i);
if (idx == -1)
continue;
- pa = accounts[idx];
+ PROTOACCOUNT *pa = accounts[idx];
- PD = (ProtocolData*)mir_alloc(sizeof(ProtocolData));
+ ProtocolData *PD = (ProtocolData*)mir_alloc(sizeof(ProtocolData));
PD->RealName = pa->szModuleName;
PD->protopos = pa->iOrder;
PD->enabled = Proto_IsAccountEnabled(pa) && isProtoSuitable(pa->ppro);
@@ -159,11 +143,10 @@ int FillTree(HWND hwnd)
INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HWND hwndProtoOrder = GetDlgItem(hwndDlg, IDC_PROTOCOLORDER);
+ HWND hwndProtoOrder = GetDlgItem(hwndDlg, IDC_PROTOCOLORDER);
struct ProtocolOrderData *dat = (ProtocolOrderData*)GetWindowLongPtr(hwndProtoOrder, GWLP_USERDATA);
- switch (msg)
- {
+ switch (msg) {
case WM_DESTROY:
ImageList_Destroy(TreeView_GetImageList(hwndProtoOrder, TVSIL_NORMAL));
mir_free(dat);
@@ -187,14 +170,13 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
return TRUE;
case WM_COMMAND:
- if (LOWORD(wParam) == IDC_RESETPROTOCOLDATA && HIWORD(wParam) == BN_CLICKED)
- {
+ if (LOWORD(wParam) == IDC_RESETPROTOCOLDATA && HIWORD(wParam) == BN_CLICKED) {
for (int i=0; i < accounts.getCount(); i++)
accounts[i]->iOrder = i;
FillTree(hwndProtoOrder);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, (WPARAM)hwndDlg, 0);
- }
+ }
break;
case WM_NOTIFY:
@@ -281,8 +263,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
ClientToScreen(hwndDlg, &hti.pt);
ScreenToClient(hwndProtoOrder, &hti.pt);
TreeView_HitTest(hwndProtoOrder, &hti);
- if (hti.flags & (TVHT_ONITEM|TVHT_ONITEMRIGHT))
- {
+ if (hti.flags & (TVHT_ONITEM|TVHT_ONITEMRIGHT)) {
HTREEITEM it = hti.hItem;
hti.pt.y -= TreeView_GetItemHeight(hwndProtoOrder) / 2;
TreeView_HitTest(hwndProtoOrder, &hti);
@@ -295,7 +276,8 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
if (hti.flags&TVHT_ABOVE) SendMessage(hwndProtoOrder, WM_VSCROLL, MAKEWPARAM(SB_LINEUP, 0), 0);
if (hti.flags&TVHT_BELOW) SendMessage(hwndProtoOrder, WM_VSCROLL, MAKEWPARAM(SB_LINEDOWN, 0), 0);
TreeView_SetInsertMark(hwndProtoOrder, NULL, 0);
- } }
+ }
+ }
break;
case WM_LBUTTONUP:
@@ -318,8 +300,7 @@ INT_PTR CALLBACK ProtocolOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
tvi.mask = TVIF_HANDLE|TVIF_PARAM;
tvi.hItem = dat->hDragItem;
TreeView_GetItem(hwndProtoOrder, &tvi);
- if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST))
- {
+ if (hti.flags & (TVHT_ONITEM | TVHT_ONITEMRIGHT) || (hti.hItem == TVI_FIRST)) {
TVINSERTSTRUCT tvis;
TCHAR name[128];
ProtocolData * lpOldData;
diff --git a/src/modules/database/dbini.cpp b/src/modules/database/dbini.cpp
index 0ef7b261b4..775352cf99 100644
--- a/src/modules/database/dbini.cpp
+++ b/src/modules/database/dbini.cpp
@@ -36,10 +36,10 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
TranslateDialogDefault(hwndDlg);
SetDlgItemText(hwndDlg, IDC_ININAME, (TCHAR*)lParam);
{
- TCHAR szSecurity[11];
- const TCHAR *pszSecurityInfo;
-
- GetPrivateProfileString(_T("AutoExec"), _T("Warn"), _T("notsafe"), szSecurity, SIZEOF(szSecurity), mirandabootini);
+ TCHAR szSecurity[11];
+ const TCHAR *pszSecurityInfo;
+
+ GetPrivateProfileString(_T("AutoExec"), _T("Warn"), _T("notsafe"), szSecurity, SIZEOF(szSecurity), mirandabootini);
if ( !lstrcmpi(szSecurity, _T("all")))
pszSecurityInfo = LPGENT("Security systems to prevent malicious changes are in place and you will be warned before every change that is made.");
else if ( !lstrcmpi(szSecurity, _T("onlyunsafe")))
@@ -50,6 +50,7 @@ static INT_PTR CALLBACK InstallIniDlgProc(HWND hwndDlg, UINT message, WPARAM wPa
if (pszSecurityInfo) SetDlgItemText(hwndDlg, IDC_SECURITYINFO, TranslateTS(pszSecurityInfo));
}
return TRUE;
+
case WM_COMMAND:
switch(LOWORD(wParam)) {
case IDC_VIEWINI:
@@ -401,7 +402,7 @@ static void DoAutoExec(void)
GetPrivateProfileString(_T("AutoExec"), _T("OverrideSecurityFilename"), _T(""), szOverrideSecurityFilename, SIZEOF(szOverrideSecurityFilename), mirandabootini);
GetPrivateProfileString(_T("AutoExec"), _T("OnCreateFilename"), _T(""), szOnCreateFilename, SIZEOF(szOnCreateFilename), mirandabootini);
GetPrivateProfileString(_T("AutoExec"), _T("Glob"), _T("autoexec_*.ini"), szFindPath, SIZEOF(szFindPath), mirandabootini);
-
+
if (dbCreated && szOnCreateFilename[0]) {
str2 = Utils_ReplaceVarsT(szOnCreateFilename);
PathToAbsoluteT(str2, szIniPath, NULL);
diff --git a/src/modules/database/mdatabasecache.cpp b/src/modules/database/mdatabasecache.cpp
index 04edbc66c2..91c95ee656 100644
--- a/src/modules/database/mdatabasecache.cpp
+++ b/src/modules/database/mdatabasecache.cpp
@@ -132,19 +132,10 @@ void MDatabaseCache::SetCachedVariant(DBVARIANT* s /* new */, DBVARIANT* d /* ca
d->pszVal = (char*)HeapAlloc(m_hCacheHeap,0,strlen(s->pszVal)+1);
strcpy(d->pszVal,s->pszVal);
}
- else if ( szSave != NULL )
+ else if ( szSave != NULL ) {
HeapFree(m_hCacheHeap,0,szSave);
-
-#ifdef DBLOGGING
- switch( d->type ) {
- case DBVT_BYTE: log1( "set cached byte: %d", d->bVal ); break;
- case DBVT_WORD: log1( "set cached word: %d", d->wVal ); break;
- case DBVT_DWORD: log1( "set cached dword: %d", d->dVal ); break;
- case DBVT_UTF8:
- case DBVT_ASCIIZ: log1( "set cached string: '%s'", d->pszVal ); break;
- default: log1( "set cached crap: %d", d->type ); break;
+ d->pszVal = NULL;
}
-#endif
}
void MDatabaseCache::FreeCachedVariant(DBVARIANT* V)
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp
index 8115e50b07..70b7acc089 100644
--- a/src/modules/extraicons/DefaultExtraIcons.cpp
+++ b/src/modules/extraicons/DefaultExtraIcons.cpp
@@ -67,7 +67,7 @@ static void SetVisibility(HANDLE hContact, int apparentMode, BOOL clear)
return;
if (apparentMode <= 0)
- apparentMode = DBGetContactSettingWord(hContact, proto, "ApparentMode", 0);
+ apparentMode = db_get_w(hContact, proto, "ApparentMode", 0);
const char *ico = NULL;
diff --git a/src/modules/extraicons/ExtraIconGroup.cpp b/src/modules/extraicons/ExtraIconGroup.cpp
index c38aed8bf7..5d26f8488c 100644
--- a/src/modules/extraicons/ExtraIconGroup.cpp
+++ b/src/modules/extraicons/ExtraIconGroup.cpp
@@ -23,11 +23,11 @@
#include "ExtraIconGroup.h"
#include "extraicons.h"
-ExtraIconGroup::ExtraIconGroup(const char *name) :
- ExtraIcon(name), setValidExtraIcon(false), insideApply(false)
+ExtraIconGroup::ExtraIconGroup(const char *_name) :
+ ExtraIcon(_name), setValidExtraIcon(false), insideApply(false)
{
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "%s/%s", MODULE_NAME, name);
+ mir_snprintf(setting, SIZEOF(setting), "%s/%s", MODULE_NAME, _name);
CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (WPARAM) setting);
}
diff --git a/src/modules/extraicons/IcolibExtraIcon.cpp b/src/modules/extraicons/IcolibExtraIcon.cpp
index 8f69a77a5b..8ea4f51512 100644
--- a/src/modules/extraicons/IcolibExtraIcon.cpp
+++ b/src/modules/extraicons/IcolibExtraIcon.cpp
@@ -24,12 +24,12 @@
#include "extraicons.h"
#include "usedIcons.h"
-IcolibExtraIcon::IcolibExtraIcon(int id, const char *name, const TCHAR *description, const char *descIcon,
- MIRANDAHOOKPARAM OnClick, LPARAM param) :
- BaseExtraIcon(id, name, description, descIcon, OnClick, param)
+IcolibExtraIcon::IcolibExtraIcon(int _id, const char *_name, const TCHAR *_description, const char *_descIcon,
+ MIRANDAHOOKPARAM _OnClick, LPARAM _param) :
+ BaseExtraIcon(_id, _name, _description, _descIcon, _OnClick, _param)
{
char setting[512];
- mir_snprintf(setting, SIZEOF(setting), "%s/%s", MODULE_NAME, name);
+ mir_snprintf(setting, SIZEOF(setting), "%s/%s", MODULE_NAME, _name);
CallService(MS_DB_SETSETTINGRESIDENT, TRUE, (WPARAM) setting);
}
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp
index 667d46f5d3..45a81235e6 100644
--- a/src/modules/extraicons/extraicons.cpp
+++ b/src/modules/extraicons/extraicons.cpp
@@ -132,11 +132,11 @@ BaseExtraIcon* GetExtraIconByName(const char *name)
static void LoadGroups(vector<ExtraIconGroup *> &groups)
{
- unsigned int count = DBGetContactSettingWord(NULL, MODULE_NAME "Groups", "Count", 0);
+ unsigned int count = db_get_w(NULL, MODULE_NAME "Groups", "Count", 0);
for (unsigned int i = 0; i < count; i++) {
char setting[512];
mir_snprintf(setting, SIZEOF(setting), "%d_count", i);
- unsigned int items = DBGetContactSettingWord(NULL, MODULE_NAME "Groups", setting, 0);
+ unsigned int items = db_get_w(NULL, MODULE_NAME "Groups", setting, 0);
if (items < 1)
continue;
@@ -406,10 +406,10 @@ INT_PTR ExtraIcon_Register(WPARAM wParam, LPARAM lParam)
char setting[512];
mir_snprintf(setting, SIZEOF(setting), "Position_%s", ei->name);
- extra->setPosition(DBGetContactSettingWord(NULL, MODULE_NAME, setting, 1000));
+ extra->setPosition(db_get_w(NULL, MODULE_NAME, setting, 1000));
mir_snprintf(setting, SIZEOF(setting), "Slot_%s", ei->name);
- int slot = DBGetContactSettingWord(NULL, MODULE_NAME, setting, 1);
+ int slot = db_get_w(NULL, MODULE_NAME, setting, 1);
if (slot == (WORD) -1)
slot = -1;
extra->setSlot(slot);
diff --git a/src/modules/findadd/findadd.cpp b/src/modules/findadd/findadd.cpp
index 7809a8bbd8..b7c6f0e368 100644
--- a/src/modules/findadd/findadd.cpp
+++ b/src/modules/findadd/findadd.cpp
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "..\..\core\commonheaders.h"
#include "findadd.h"
-#define TIMERID_THROBBER 111
+#define TIMERID_THROBBER 111
#define HM_SEARCHACK (WM_USER+10)
#define M_SETGROUPVISIBILITIES (WM_USER+11)
diff --git a/src/modules/findadd/searchresults.cpp b/src/modules/findadd/searchresults.cpp
index f0a6bdea2c..8804df5b22 100644
--- a/src/modules/findadd/searchresults.cpp
+++ b/src/modules/findadd/searchresults.cpp
@@ -94,7 +94,7 @@ void LoadColumnSizes(HWND hwndResults, const char *szProto)
}
else lvc.mask &= ~LVCF_TEXT;
mir_snprintf(szSetting, SIZEOF(szSetting), "ColWidth%d", i);
- lvc.cx = DBGetContactSettingWord(NULL, "FindAdd", szSetting, defaultColumnSizes[i]);
+ lvc.cx = db_get_w(NULL, "FindAdd", szSetting, defaultColumnSizes[i]);
ListView_InsertColumn(hwndResults, i, (LPARAM)&lvc);
if (bNeedsFree)
@@ -197,8 +197,8 @@ static void BeginSearchFailed(void * arg)
if (arg != NULL) {
const TCHAR* protoName = (TCHAR*)arg;
mir_sntprintf(buf, SIZEOF(buf),
- TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"),
- protoName, protoName);
+ TranslateT("Could not start a search on '%s', there was a problem - is %s connected?"),
+ protoName, protoName);
mir_free((char*)arg);
}
else lstrcpyn(buf, TranslateT("Could not search on any of the protocols, are you online?"), SIZEOF(buf));
diff --git a/src/modules/fonts/FontOptions.cpp b/src/modules/fonts/FontOptions.cpp
index 9651e22a43..3b1c218107 100644
--- a/src/modules/fonts/FontOptions.cpp
+++ b/src/modules/fonts/FontOptions.cpp
@@ -59,30 +59,29 @@ OBJLIST<ColourInternal> colour_id_list(10, sttCompareColour), colour_id_list_w2(
static int sttCompareEffect(const EffectInternal* p1, const EffectInternal* p2)
{
- int result = _tcscmp(p1->group, p2->group);
- if (result != 0)
- return result;
+ int result = _tcscmp(p1->group, p2->group);
+ if (result != 0)
+ return result;
- result = p1->order - p2->order;
- if (result != 0)
- return result;
+ result = p1->order - p2->order;
+ if (result != 0)
+ return result;
- return _tcscmp( p1->getName(), p2->getName());
+ return _tcscmp( p1->getName(), p2->getName());
}
OBJLIST<EffectInternal> effect_id_list(10, sttCompareEffect), effect_id_list_w2(10, sttCompareEffect), effect_id_list_w3(10, sttCompareEffect);
-typedef struct DrawTextWithEffectParam_tag
+struct DrawTextWithEffectParam
{
- int cbSize;
- HDC hdc; // handle to DC
- LPCTSTR lpchText; // text to draw
- int cchText; // length of text to draw
- LPRECT lprc; // rectangle coordinates
- UINT dwDTFormat; // formatting options
- FONTEFFECT * pEffect; // effect to be drawn on
-
-} DrawTextWithEffectParam;
+ int cbSize;
+ HDC hdc; // handle to DC
+ LPCTSTR lpchText; // text to draw
+ int cchText; // length of text to draw
+ LPRECT lprc; // rectangle coordinates
+ UINT dwDTFormat; // formatting options
+ FONTEFFECT * pEffect; // effect to be drawn on
+};
#define MS_DRAW_TEXT_WITH_EFFECTA "Modern/SkinEngine/DrawTextWithEffectA"
#define MS_DRAW_TEXT_WITH_EFFECTW "Modern/SkinEngine/DrawTextWithEffectW"
@@ -92,27 +91,26 @@ typedef struct DrawTextWithEffectParam_tag
// Helper
int __inline DrawTextWithEffect(HDC hdc, LPCTSTR lpchText, int cchText, RECT * lprc, UINT dwDTFormat, FONTEFFECT * pEffect)
{
- DrawTextWithEffectParam params;
- static BYTE bIfServiceExists = ServiceExists(MS_DRAW_TEXT_WITH_EFFECT) ? 1 : 0;
-
- if (pEffect == NULL || pEffect->effectIndex == 0)
- return DrawText (hdc, lpchText, cchText, lprc, dwDTFormat); // If no effect specified draw by GDI it just more careful with ClearType
-
- if (bIfServiceExists == 0)
- return DrawText (hdc, lpchText, cchText, lprc, dwDTFormat);
-
- // else
- params.cbSize = sizeof(DrawTextWithEffectParam);
- params.hdc = hdc;
- params.lpchText = lpchText;
- params.cchText = cchText;
- params.lprc = lprc;
- params.dwDTFormat = dwDTFormat;
- params.pEffect = pEffect;
- return CallService(MS_DRAW_TEXT_WITH_EFFECT, (WPARAM)&params, 0);
+ DrawTextWithEffectParam params;
+ static BYTE bIfServiceExists = ServiceExists(MS_DRAW_TEXT_WITH_EFFECT) ? 1 : 0;
+
+ if (pEffect == NULL || pEffect->effectIndex == 0)
+ return DrawText (hdc, lpchText, cchText, lprc, dwDTFormat); // If no effect specified draw by GDI it just more careful with ClearType
+
+ if (bIfServiceExists == 0)
+ return DrawText (hdc, lpchText, cchText, lprc, dwDTFormat);
+
+ // else
+ params.cbSize = sizeof(DrawTextWithEffectParam);
+ params.hdc = hdc;
+ params.lpchText = lpchText;
+ params.cchText = cchText;
+ params.lprc = lprc;
+ params.dwDTFormat = dwDTFormat;
+ params.pEffect = pEffect;
+ return CallService(MS_DRAW_TEXT_WITH_EFFECT, (WPARAM)&params, 0);
}
-
#define UM_SETFONTGROUP (WM_USER + 101)
#define TIMER_ID 11015
@@ -222,23 +220,22 @@ BOOL ExportSettings(HWND hwndDlg, TCHAR *filename, OBJLIST<FontInternal>& flist,
WriteLine(fhand, buff);
}
- header[0] = 0;
- for (i=0; i < elist.getCount(); i++) {
- EffectInternal& E = elist[i];
-
- mir_snprintf(buff, SIZEOF(buff), "\r\n[%s]", E.dbSettingsGroup);
- if (strcmp(buff, header) != 0) {
- strcpy(header, buff);
- WriteLine(fhand, buff);
- }
- mir_snprintf(buff, SIZEOF(buff), "%sEffect = b%d", E.setting, E.value.effectIndex);
- WriteLine(fhand, buff);
- mir_snprintf(buff, SIZEOF(buff), "%sEffectCol1 = d%d", E.setting, E.value.baseColour);
- WriteLine(fhand, buff);
- mir_snprintf(buff, SIZEOF(buff), "%sEffectCol2 = d%d", E.setting, E.value.secondaryColour);
- WriteLine(fhand, buff);
- }
+ header[0] = 0;
+ for (i=0; i < elist.getCount(); i++) {
+ EffectInternal& E = elist[i];
+ mir_snprintf(buff, SIZEOF(buff), "\r\n[%s]", E.dbSettingsGroup);
+ if (strcmp(buff, header) != 0) {
+ strcpy(header, buff);
+ WriteLine(fhand, buff);
+ }
+ mir_snprintf(buff, SIZEOF(buff), "%sEffect = b%d", E.setting, E.value.effectIndex);
+ WriteLine(fhand, buff);
+ mir_snprintf(buff, SIZEOF(buff), "%sEffectCol1 = d%d", E.setting, E.value.baseColour);
+ WriteLine(fhand, buff);
+ mir_snprintf(buff, SIZEOF(buff), "%sEffectCol2 = d%d", E.setting, E.value.secondaryColour);
+ WriteLine(fhand, buff);
+ }
CloseHandle(fhand);
return TRUE;
@@ -276,10 +273,9 @@ struct FSUIListItemData
{
int font_id;
int colour_id;
- int effect_id;
+ int effect_id;
};
-
static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const TCHAR *name, const TCHAR *backgroundGroup, const TCHAR *backgroundName, int colourId)
{
int i;
@@ -303,24 +299,21 @@ static BOOL sttFsuiBindColourIdToFonts(HWND hwndList, const TCHAR *name, const T
return res;
}
-static BOOL sttFsuiBindEffectIdToFonts(HWND hwndList, const TCHAR *name, int effectId)
+static bool sttFsuiBindEffectIdToFonts(HWND hwndList, const TCHAR *name, int effectId)
{
- int i;
- BOOL res = FALSE;
- for (i = SendMessage(hwndList, LB_GETCOUNT, 0, 0); i--;)
- {
- FSUIListItemData *itemData = (FSUIListItemData *)SendMessage(hwndList, LB_GETITEMDATA, i, 0);
- if (itemData && itemData->font_id >= 0) {
- FontInternal& F = font_id_list_w2[itemData->font_id];
-
- if (name && !_tcscmp(F.name, name)) {
- itemData->effect_id = effectId;
- res = TRUE;
- }
-
- } }
-
- return res;
+ for (int i = SendMessage(hwndList, LB_GETCOUNT, 0, 0); i--;) {
+ FSUIListItemData *itemData = (FSUIListItemData *)SendMessage(hwndList, LB_GETITEMDATA, i, 0);
+ if (itemData && itemData->font_id >= 0) {
+ FontInternal& F = font_id_list_w2[itemData->font_id];
+
+ if (name && !_tcscmp(F.name, name)) {
+ itemData->effect_id = effectId;
+ return true;
+ }
+ }
+ }
+
+ return false;
}
static HTREEITEM sttFindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name)
@@ -444,28 +437,24 @@ static void sttSaveCollapseState(HWND hwndTree)
static void sttFreeListItems(HWND hList)
{
- int idx = 0;
- LRESULT res;
- FSUIListItemData *itemData;
int count = SendMessage(hList, LB_GETCOUNT, 0, 0);
if (count > 0) {
- while (idx < count) {
- res = SendMessage(hList, LB_GETITEMDATA, idx++, 0);
- itemData = (FSUIListItemData *)res;
+ for (int idx = 0; idx < count; idx++) {
+ LRESULT res = SendMessage(hList, LB_GETITEMDATA, idx, 0);
+ FSUIListItemData *itemData = (FSUIListItemData *)res;
if (itemData && res != LB_ERR)
mir_free(itemData);
}
}
}
-static BOOL ShowEffectButton(HWND hwndDlg, BOOL bShow)
+static void ShowEffectButton(HWND hwndDlg, BOOL bShow)
{
- ShowWindow( GetDlgItem(hwndDlg, IDC_BKGCOLOUR), bShow ? SW_HIDE : SW_SHOW);
- ShowWindow( GetDlgItem(hwndDlg, IDC_BKGCOLOUR_STATIC), bShow ? SW_HIDE : SW_SHOW);
+ ShowWindow( GetDlgItem(hwndDlg, IDC_BKGCOLOUR), bShow ? SW_HIDE : SW_SHOW);
+ ShowWindow( GetDlgItem(hwndDlg, IDC_BKGCOLOUR_STATIC), bShow ? SW_HIDE : SW_SHOW);
- ShowWindow( GetDlgItem(hwndDlg, IDC_EFFECT), bShow ? SW_SHOW : SW_HIDE);
- ShowWindow( GetDlgItem(hwndDlg, IDC_EFFECT_STATIC), bShow ? SW_SHOW : SW_HIDE);
- return TRUE;
+ ShowWindow( GetDlgItem(hwndDlg, IDC_EFFECT), bShow ? SW_SHOW : SW_HIDE);
+ ShowWindow( GetDlgItem(hwndDlg, IDC_EFFECT_STATIC), bShow ? SW_SHOW : SW_HIDE);
}
TCHAR* ModernEffectNames[] = { _T("<none>"), _T("Shadow at left"), _T("Shadow at right"), _T("Outline"), _T("Outline smooth"), _T("Smooth bump"), _T("Contour thin"), _T("Contour heavy") };
@@ -645,8 +634,8 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
int first_font_index = -1;
int colourId = 0;
int first_colour_index = -1;
- int effectId = 0;
- int first_effect_index = -1;
+ int effectId = 0;
+ int first_effect_index = -1;
SendDlgItemMessage(hwndDlg, IDC_FONTLIST, WM_SETREDRAW, FALSE, 0);
@@ -655,7 +644,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
if (_tcsncmp(F.group, group_buff, 64) == 0) {
FSUIListItemData *itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData));
itemData->colour_id = -1;
- itemData->effect_id = -1;
+ itemData->effect_id = -1;
itemData->font_id = fontId;
if (first_font_index == -1)
@@ -683,7 +672,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
itemData = (FSUIListItemData*)mir_alloc(sizeof(FSUIListItemData));
itemData->colour_id = colourId;
itemData->font_id = -1;
- itemData->effect_id = -1;
+ itemData->effect_id = -1;
itemId = SendDlgItemMessage(hwndDlg, IDC_FONTLIST, LB_ADDSTRING, (WPARAM)-1, (LPARAM)itemData);
}
diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp
index fd16b4c391..ba76622f2a 100644
--- a/src/modules/icolib/skin2icons.cpp
+++ b/src/modules/icolib/skin2icons.cpp
@@ -30,8 +30,9 @@ HANDLE hIcons2ChangedEvent, hIconsChangedEvent;
HICON hIconBlank = NULL;
-static HANDLE hIcoLib_AddNewIcon, hIcoLib_RemoveIcon, hIcoLib_GetIcon, hIcoLib_GetIcon2,
- hIcoLib_GetIconHandle, hIcoLib_IsManaged, hIcoLib_AddRef, hIcoLib_ReleaseIcon;
+static HANDLE
+ hIcoLib_AddNewIcon, hIcoLib_RemoveIcon, hIcoLib_GetIcon, hIcoLib_GetIcon2,
+ hIcoLib_GetIconHandle, hIcoLib_IsManaged, hIcoLib_AddRef, hIcoLib_ReleaseIcon;
int iconEventActive = 0;
@@ -110,11 +111,11 @@ IconSourceFile* IconSourceFile_Get(const TCHAR* file, bool isPath)
if ( !file)
return NULL;
- if (isPath)
- PathToAbsoluteT(file, fileFull, NULL);
- /// TODO: convert path to long - eliminate duplicate items
- else
- _tcscpy(fileFull, file);
+ if (isPath)
+ PathToAbsoluteT(file, fileFull, NULL);
+ /// TODO: convert path to long - eliminate duplicate items
+ else
+ _tcscpy(fileFull, file);
IconSourceFile key = { fileFull };
int ix;
diff --git a/src/modules/netlib/netlib.cpp b/src/modules/netlib/netlib.cpp
index 4c4328b6d7..2c799ffa2e 100644
--- a/src/modules/netlib/netlib.cpp
+++ b/src/modules/netlib/netlib.cpp
@@ -421,9 +421,9 @@ INT_PTR NetlibHttpUrlEncode(WPARAM, LPARAM lParam)
}
for (outputLen = 0, pszIn = szInput;*pszIn;pszIn++) {
if ((48 <= *pszIn && *pszIn <= 57) || //0-9
- (65 <= *pszIn && *pszIn <= 90) || //ABC...XYZ
- (97 <= *pszIn && *pszIn <= 122) || //abc...xyz
- *pszIn == '-' || *pszIn == '_' || *pszIn == '.' || *pszIn == ' ') outputLen++;
+ (65 <= *pszIn && *pszIn <= 90) || //ABC...XYZ
+ (97 <= *pszIn && *pszIn <= 122) || //abc...xyz
+ *pszIn == '-' || *pszIn == '_' || *pszIn == '.' || *pszIn == ' ') outputLen++;
else outputLen+=3;
}
szOutput = (unsigned char*)HeapAlloc(GetProcessHeap(), 0, outputLen+1);
@@ -433,9 +433,9 @@ INT_PTR NetlibHttpUrlEncode(WPARAM, LPARAM lParam)
}
for (pszOut = szOutput, pszIn = szInput;*pszIn;pszIn++) {
if ((48 <= *pszIn && *pszIn <= 57) ||
- (65 <= *pszIn && *pszIn <= 90) ||
- (97 <= *pszIn && *pszIn <= 122) ||
- *pszIn == '-' || *pszIn == '_' || *pszIn == '.') *pszOut++=*pszIn;
+ (65 <= *pszIn && *pszIn <= 90) ||
+ (97 <= *pszIn && *pszIn <= 122) ||
+ *pszIn == '-' || *pszIn == '_' || *pszIn == '.') *pszOut++=*pszIn;
else if (*pszIn == ' ') *pszOut++='+';
else {
*pszOut++='%';
diff --git a/src/modules/options/filter.cpp b/src/modules/options/filter.cpp
index 4d75ba55aa..f931012ad5 100644
--- a/src/modules/options/filter.cpp
+++ b/src/modules/options/filter.cpp
@@ -42,7 +42,7 @@ void AddFilterString(const PageHash key, TCHAR *data)
void ClearFilterStrings()
{
- filterStrings.destroy();
+ filterStrings.destroy();
}
BOOL ContainsFilterString(const PageHash key, TCHAR *data)
@@ -155,7 +155,7 @@ static INT_PTR CALLBACK DlgProcOptSearch(HWND hWnd, UINT msg, WPARAM wParam, LPA
case WM_INITDIALOG:
TranslateDialogDefault(hWnd);
- CheckDlgButton(hWnd, IDC_ENABLE_KEYWORDFILTERING, DBGetContactSettingWord(NULL, "Options", "EnableKeywordFiltering", TRUE) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hWnd, IDC_ENABLE_KEYWORDFILTERING, db_get_w(NULL, "Options", "EnableKeywordFiltering", TRUE) ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
case WM_COMMAND:
diff --git a/src/modules/options/filter.h b/src/modules/options/filter.h
index 39c16698f2..a0ee0f8851 100644
--- a/src/modules/options/filter.h
+++ b/src/modules/options/filter.h
@@ -50,7 +50,7 @@ class CPageKeywords
static int _KeyWordsSortFunc(const TCHAR* p1, const TCHAR* p2) { return _tcscmp(p1, p2); };
public:
- CPageKeywords(PageHash pageHashKey) : _pageHashKey(pageHashKey), _pageKeyWords(1, _KeyWordsSortFunc) {};
+ CPageKeywords(PageHash pageHashKey) : _pageHashKey(pageHashKey), _pageKeyWords(1, _KeyWordsSortFunc) {};
~CPageKeywords()
{
for (int j = 0; j < _pageKeyWords.getCount(); j++)
diff --git a/src/modules/options/headerbar.cpp b/src/modules/options/headerbar.cpp
index 3f2cca1a26..3eddace9e1 100644
--- a/src/modules/options/headerbar.cpp
+++ b/src/modules/options/headerbar.cpp
@@ -56,7 +56,7 @@ struct MHeaderbarCtrl : public MZeroedObject
// UI info
RECT rc;
int width, height;
- HICON hIcon;
+ HICON hIcon;
// control colors
RGBQUAD rgbBkgTop, rgbBkgBottom;
@@ -339,7 +339,7 @@ static LRESULT CALLBACK MHeaderbarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam
SendMessage(GetParent(hwndDlg), WM_SYSCOMMAND, 0xF012, 0);
return 0;
- case WM_SETICON:
+ case WM_SETICON:
if (wParam < 3) {
itc->hIcon = (HICON)lParam;
InvalidateRect(hwndDlg, NULL, FALSE);
diff --git a/src/modules/options/iconheader.cpp b/src/modules/options/iconheader.cpp
index aeb0bbd833..49fe2e1fe8 100644
--- a/src/modules/options/iconheader.cpp
+++ b/src/modules/options/iconheader.cpp
@@ -88,7 +88,7 @@ static void MITListDestructor(void * adr)
mir_free(mit->tcsName);
if (mit->hIcon && !(mit->flag&MITCF_SHAREDICON))
DestroyIcon(mit->hIcon);
- mir_free(adr);
+ mir_free(adr);
}
void li_ListDestruct(LIST<MIcoTab> &pList, ItemDestuctor pItemDestructor)
@@ -245,9 +245,9 @@ static void MIcoTab_DrawItem(HWND hwnd, HDC hdc, MIcoTabCtrl *dat, MIcoTab *tab,
dto.dwFlags = DTT_COMPOSITED|DTT_GLOWSIZE;
dto.iGlowSize = 10;
HANDLE hTheme = openThemeData(hwnd, L"Window");
- wchar_t *tcsNameW = mir_t2u(tab->tcsName);
+ wchar_t *tcsNameW = mir_t2u(tab->tcsName);
drawThemeTextEx(hTheme, hdc, WP_CAPTION, CS_ACTIVE, tcsNameW, -1, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS, &textRect, &dto);
- mir_free(tcsNameW);
+ mir_free(tcsNameW);
closeThemeData(hTheme);
}
else DrawText(hdc, tab->tcsName, -1, &textRect, DT_VCENTER|DT_CENTER|DT_END_ELLIPSIS);
diff --git a/src/modules/options/options.cpp b/src/modules/options/options.cpp
index 43ee3f6571..b1d5e2ac3b 100644
--- a/src/modules/options/options.cpp
+++ b/src/modules/options/options.cpp
@@ -767,7 +767,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hdlg, UINT message, WPARAM wParam, L
MapWindowPoints(NULL, hdlg, (LPPOINT)&dat->rcTab, 2);
TabCtrl_AdjustRect( GetDlgItem(hdlg, IDC_TAB), FALSE, &dat->rcTab);
- //!!!!!!!!!! int enableKeywordFiltering = DBGetContactSettingWord(NULL, "Options", "EnableKeywordFiltering", TRUE);
+ //!!!!!!!!!! int enableKeywordFiltering = db_get_w(NULL, "Options", "EnableKeywordFiltering", TRUE);
FillFilterCombo(0, hdlg, dat); //!!!!!!!!!! enableKeywordFiltering,
SendMessage(hdlg, DM_REBUILDPAGETREE, 0, 0);
diff --git a/src/modules/protocols/protoopts.cpp b/src/modules/protocols/protoopts.cpp
index 123c93bada..52bd819123 100644
--- a/src/modules/protocols/protoopts.cpp
+++ b/src/modules/protocols/protoopts.cpp
@@ -697,13 +697,12 @@ INT_PTR CALLBACK AccMgrDlgProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM
POINT ptItem = pt;
ScreenToClient(hwndList, &ptItem);
iItem = (short)LOWORD(SendMessage(hwndList, LB_ITEMFROMPOINT, 0, MAKELPARAM(ptItem.x, ptItem.y)));
- if (iItem != LB_ERR)
- {
- ListBox_SetCurSel(hwndList, iItem);
- sttUpdateAccountInfo(hwndDlg, dat);
- sttSelectItem(dat, hwndList, iItem);
- SetFocus(hwndList);
- }
+ if (iItem != LB_ERR) {
+ ListBox_SetCurSel(hwndList, iItem);
+ sttUpdateAccountInfo(hwndDlg, dat);
+ sttSelectItem(dat, hwndList, iItem);
+ SetFocus(hwndList);
+ }
}
if (iItem != LB_ERR) {
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp
index 613ab96bd6..bafb4f5d42 100644
--- a/src/modules/skin/hotkeys.cpp
+++ b/src/modules/skin/hotkeys.cpp
@@ -171,7 +171,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
item->pszService = desc->pszService ? mir_strdup(desc->pszService) : 0;
item->DefHotkey = desc->DefHotKey & ~HKF_MIRANDA_LOCAL;
- item->Hotkey = DBGetContactSettingWord(NULL, DBMODULENAME, item->pszName, item->DefHotkey);
+ item->Hotkey = db_get_w(NULL, DBMODULENAME, item->pszName, item->DefHotkey);
item->type = item->pszService ?
(THotkeyType)db_get_b(NULL, DBMODULENAME "Types", item->pszName,
(desc->DefHotKey & HKF_MIRANDA_LOCAL) ? HKT_LOCAL : HKT_GLOBAL) : HKT_MANUAL;
@@ -196,7 +196,7 @@ static INT_PTR svcHotkeyRegister(WPARAM wParam, LPARAM lParam)
count = (int)db_get_dw(NULL, DBMODULENAME, buf, -1);
for (i=0; i < count; i++) {
mir_snprintf(buf, SIZEOF(buf), "%s$%d", item->pszName, i);
- if ( !DBGetContactSettingWord(NULL, DBMODULENAME, buf, 0))
+ if ( !db_get_w(NULL, DBMODULENAME, buf, 0))
continue;
svcHotkeyRegister(wParam, lParam);
@@ -374,7 +374,7 @@ int LoadSkinHotkeys(void)
mir_snprintf(szSetting, SIZEOF(szSetting), "HK%s", oldSettings[i]);
WORD key;
- if ((key = DBGetContactSettingWord(NULL, "Clist", szSetting, 0))) {
+ if ((key = db_get_w(NULL, "Clist", szSetting, 0))) {
DBDeleteContactSetting(NULL, "Clist", szSetting);
DBWriteContactSettingWord(NULL, DBMODULENAME, newSettings[i], key);
}
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp
index b948151dac..44e911c468 100644
--- a/src/modules/skin/skinicons.cpp
+++ b/src/modules/skin/skinicons.cpp
@@ -412,7 +412,7 @@ int LoadSkinIcons(void)
SKINICONDESC sid;
int i, j = 0;
char iconName[MAX_PATH], moduleName[MAX_PATH];
- TCHAR modulePath[MAX_PATH];
+ TCHAR modulePath[MAX_PATH];
DBVARIANT dbv;
//
@@ -461,7 +461,7 @@ int LoadSkinIcons(void)
sid.cbSize = sizeof(sid);
GetModuleFileName(NULL, modulePath, SIZEOF(modulePath));
sid.ptszDefaultFile = modulePath;
- sid.flags = SIDF_PATH_TCHAR;
+ sid.flags = SIDF_PATH_TCHAR;
sid.pszName = iconName;
//
diff --git a/src/modules/utils/colourpicker.cpp b/src/modules/utils/colourpicker.cpp
index badfcb712e..fccd240660 100644
--- a/src/modules/utils/colourpicker.cpp
+++ b/src/modules/utils/colourpicker.cpp
@@ -25,45 +25,46 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
switch(message) {
- case WM_CREATE:
- SetWindowLongPtr(hwnd, 0, 0);
- SetWindowLongPtr(hwnd, sizeof(COLORREF), 0);
- break;
- case CPM_SETDEFAULTCOLOUR:
- SetWindowLongPtr(hwnd, sizeof(COLORREF), lParam);
- break;
- case CPM_GETDEFAULTCOLOUR:
- return GetWindowLongPtr(hwnd, sizeof(COLORREF));
- case CPM_SETCOLOUR:
- SetWindowLongPtr(hwnd, 0, lParam);
- InvalidateRect(hwnd, NULL, FALSE);
- break;
- case CPM_GETCOLOUR:
- return GetWindowLongPtr(hwnd, 0);
- case WM_LBUTTONUP:
+ case WM_CREATE:
+ SetWindowLongPtr(hwnd, 0, 0);
+ SetWindowLongPtr(hwnd, sizeof(COLORREF), 0);
+ break;
+ case CPM_SETDEFAULTCOLOUR:
+ SetWindowLongPtr(hwnd, sizeof(COLORREF), lParam);
+ break;
+ case CPM_GETDEFAULTCOLOUR:
+ return GetWindowLongPtr(hwnd, sizeof(COLORREF));
+ case CPM_SETCOLOUR:
+ SetWindowLongPtr(hwnd, 0, lParam);
+ InvalidateRect(hwnd, NULL, FALSE);
+ break;
+ case CPM_GETCOLOUR:
+ return GetWindowLongPtr(hwnd, 0);
+ case WM_LBUTTONUP:
{
- CHOOSECOLOR cc = {0};
- COLORREF custColours[16] = {0};
+ CHOOSECOLOR cc = {0};
+ COLORREF custColours[16] = {0};
custColours[0] = GetWindowLongPtr(hwnd, sizeof(COLORREF));
- cc.lStructSize = sizeof(CHOOSECOLOR);
- cc.hwndOwner = hwnd;
- cc.hInstance = (HWND)hInst;
- cc.rgbResult = GetWindowLongPtr(hwnd, 0);
- cc.lpCustColors = custColours;
- cc.Flags = CC_ANYCOLOR|CC_FULLOPEN|CC_RGBINIT;
- if (ChooseColor(&cc)) {
+ cc.lStructSize = sizeof(CHOOSECOLOR);
+ cc.hwndOwner = hwnd;
+ cc.hInstance = (HWND)hInst;
+ cc.rgbResult = GetWindowLongPtr(hwnd, 0);
+ cc.lpCustColors = custColours;
+ cc.Flags = CC_ANYCOLOR|CC_FULLOPEN|CC_RGBINIT;
+ if (ChooseColor(&cc)) {
SetWindowLongPtr(hwnd, 0, cc.rgbResult);
SendMessage(GetParent(hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), CPN_COLOURCHANGED), (LPARAM)hwnd);
InvalidateRect(hwnd, NULL, FALSE);
}
break;
}
- case WM_ENABLE:
- InvalidateRect(hwnd, NULL, FALSE);
- break;
- case WM_NCPAINT:
- case WM_PAINT:
- { PAINTSTRUCT ps;
+ case WM_ENABLE:
+ InvalidateRect(hwnd, NULL, FALSE);
+ break;
+ case WM_NCPAINT:
+ case WM_PAINT:
+ {
+ PAINTSTRUCT ps;
HDC hdc1;
RECT rc;
HBRUSH hBrush;
@@ -82,8 +83,6 @@ static LRESULT CALLBACK ColourPickerWndProc(HWND hwnd, UINT message, WPARAM wPar
EndPaint(hwnd, &ps);
break;
}
- case WM_DESTROY:
- break;
}
return DefWindowProc(hwnd, message, wParam, lParam);
}
diff --git a/src/modules/utils/imgconv.cpp b/src/modules/utils/imgconv.cpp
index 216167316b..03c39eef1d 100644
--- a/src/modules/utils/imgconv.cpp
+++ b/src/modules/utils/imgconv.cpp
@@ -26,13 +26,13 @@ typedef DWORD ARGB;
void InitBitmapInfo(BITMAPINFO &bmi, const SIZE &size)
{
ZeroMemory(&bmi, sizeof(BITMAPINFO));
- bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
- bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biCompression = BI_RGB;
- bmi.bmiHeader.biBitCount = 32;
+ bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
+ bmi.bmiHeader.biPlanes = 1;
+ bmi.bmiHeader.biCompression = BI_RGB;
+ bmi.bmiHeader.biBitCount = 32;
- bmi.bmiHeader.biWidth = size.cx;
- bmi.bmiHeader.biHeight = size.cy;
+ bmi.bmiHeader.biWidth = size.cx;
+ bmi.bmiHeader.biHeight = size.cy;
}
void ConvertToPARGB32(HDC hdc, ARGB *pargb, HBITMAP hbmp, SIZE& sizImage, int cxRow)
@@ -41,77 +41,67 @@ void ConvertToPARGB32(HDC hdc, ARGB *pargb, HBITMAP hbmp, SIZE& sizImage, int cx
InitBitmapInfo(bmi, sizImage);
void *pvBits = malloc(sizImage.cx * 4 * sizImage.cy);
- if (GetDIBits(hdc, hbmp, 0, bmi.bmiHeader.biHeight, pvBits, &bmi, DIB_RGB_COLORS) == bmi.bmiHeader.biHeight)
- {
- ULONG cxDelta = cxRow - bmi.bmiHeader.biWidth;
- ARGB *pargbMask = (ARGB *)pvBits;
-
- for (ULONG y = bmi.bmiHeader.biHeight + 1; --y;)
- {
- for (ULONG x = bmi.bmiHeader.biWidth + 1; --x;)
- {
- if (*pargbMask++)
- {
- // transparent pixel
- *pargb++=0;
- }
- else
- {
- // opaque pixel
- *pargb++ |= 0xFF000000;
- }
- }
-
- pargb += cxDelta;
- }
- }
- free(pvBits);
+ if (GetDIBits(hdc, hbmp, 0, bmi.bmiHeader.biHeight, pvBits, &bmi, DIB_RGB_COLORS) == bmi.bmiHeader.biHeight) {
+ ULONG cxDelta = cxRow - bmi.bmiHeader.biWidth;
+ ARGB *pargbMask = (ARGB *)pvBits;
+
+ for (ULONG y = bmi.bmiHeader.biHeight + 1; --y;) {
+ for (ULONG x = bmi.bmiHeader.biWidth + 1; --x;) {
+ if (*pargbMask++) {
+ // transparent pixel
+ *pargb++=0;
+ }
+ else {
+ // opaque pixel
+ *pargb++ |= 0xFF000000;
+ }
+ }
+
+ pargb += cxDelta;
+ }
+ }
+ free(pvBits);
}
bool HasAlpha(ARGB *pargb, SIZE& sizImage, int cxRow)
{
- ULONG cxDelta = cxRow - sizImage.cx;
- for (ULONG y = sizImage.cy; y--;)
- {
- for (ULONG x = sizImage.cx; x--;)
- {
- if (*pargb++ & 0xFF000000)
- return true;
- }
- pargb += cxDelta;
- }
-
- return false;
+ ULONG cxDelta = cxRow - sizImage.cx;
+ for (ULONG y = sizImage.cy; y--;) {
+ for (ULONG x = sizImage.cx; x--;) {
+ if (*pargb++ & 0xFF000000)
+ return true;
+ }
+ pargb += cxDelta;
+ }
+
+ return false;
}
void ConvertBufferToPARGB32(HANDLE hPaintBuffer, HDC hdc, HICON hIcon, SIZE& sizIcon)
{
- RGBQUAD *prgbQuad;
- int cxRow;
- HRESULT hr = getBufferedPaintBits(hPaintBuffer, &prgbQuad, &cxRow);
- if (SUCCEEDED(hr))
- {
- ARGB *pargb = (ARGB *)prgbQuad;
- if ( !HasAlpha(pargb, sizIcon, cxRow))
- {
- ICONINFO info;
- if (GetIconInfo(hIcon, &info))
- {
- if (info.hbmMask)
- ConvertToPARGB32(hdc, pargb, info.hbmMask, sizIcon, cxRow);
-
- DeleteObject(info.hbmColor);
- DeleteObject(info.hbmMask);
- }
- }
- }
+ RGBQUAD *prgbQuad;
+ int cxRow;
+ HRESULT hr = getBufferedPaintBits(hPaintBuffer, &prgbQuad, &cxRow);
+ if (SUCCEEDED(hr)) {
+ ARGB *pargb = (ARGB *)prgbQuad;
+ if ( !HasAlpha(pargb, sizIcon, cxRow)) {
+ ICONINFO info;
+ if (GetIconInfo(hIcon, &info)) {
+ if (info.hbmMask)
+ ConvertToPARGB32(hdc, pargb, info.hbmMask, sizIcon, cxRow);
+
+ DeleteObject(info.hbmColor);
+ DeleteObject(info.hbmMask);
+ }
+ }
+ }
}
HBITMAP ConvertIconToBitmap(HICON hicon, HIMAGELIST hIml, int iconId)
{
- SIZE sizIcon;
- sizIcon.cx = GetSystemMetrics(SM_CXSMICON);
- sizIcon.cy = GetSystemMetrics(SM_CYSMICON);
+ SIZE sizIcon;
+ sizIcon.cx = GetSystemMetrics(SM_CXSMICON);
+ sizIcon.cy = GetSystemMetrics(SM_CYSMICON);
RECT rcIcon = { 0, 0, sizIcon.cx, sizIcon.cy };
@@ -121,32 +111,31 @@ HBITMAP ConvertIconToBitmap(HICON hicon, HIMAGELIST hIml, int iconId)
InitBitmapInfo(bmi, sizIcon);
HBITMAP hbmp = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, NULL, NULL, 0);
- HBITMAP hbmpOld = (HBITMAP)SelectObject(hdc, hbmp);
+ HBITMAP hbmpOld = (HBITMAP)SelectObject(hdc, hbmp);
BLENDFUNCTION bfAlpha = { AC_SRC_OVER, 0, 255, AC_SRC_ALPHA };
- BP_PAINTPARAMS paintParams = {0};
- paintParams.cbSize = sizeof(paintParams);
- paintParams.dwFlags = BPPF_ERASE;
- paintParams.pBlendFunction = &bfAlpha;
-
- HDC hdcBuffer;
- HANDLE hPaintBuffer = beginBufferedPaint(hdc, &rcIcon, BPBF_DIB, &paintParams, &hdcBuffer);
- if (hPaintBuffer)
- {
+ BP_PAINTPARAMS paintParams = {0};
+ paintParams.cbSize = sizeof(paintParams);
+ paintParams.dwFlags = BPPF_ERASE;
+ paintParams.pBlendFunction = &bfAlpha;
+
+ HDC hdcBuffer;
+ HANDLE hPaintBuffer = beginBufferedPaint(hdc, &rcIcon, BPBF_DIB, &paintParams, &hdcBuffer);
+ if (hPaintBuffer) {
if (hIml)
ImageList_Draw(hIml, iconId, hdc, 0, 0, ILD_TRANSPARENT);
else
DrawIconEx(hdcBuffer, 0, 0, hicon, sizIcon.cx, sizIcon.cy, 0, NULL, DI_NORMAL);
-
+
// If icon did not have an alpha channel we need to convert buffer to PARGB
- ConvertBufferToPARGB32(hPaintBuffer, hdc, hicon, sizIcon);
+ ConvertBufferToPARGB32(hPaintBuffer, hdc, hicon, sizIcon);
- // This will write the buffer contents to the destination bitmap
- endBufferedPaint(hPaintBuffer, TRUE);
- }
+ // This will write the buffer contents to the destination bitmap
+ endBufferedPaint(hPaintBuffer, TRUE);
+ }
- SelectObject(hdc, hbmpOld);
- DeleteDC(hdc);
+ SelectObject(hdc, hbmpOld);
+ DeleteDC(hdc);
- return hbmp;
+ return hbmp;
}
diff --git a/src/modules/utils/openurl.cpp b/src/modules/utils/openurl.cpp
index 4caa9fb022..a50ee22e7e 100644
--- a/src/modules/utils/openurl.cpp
+++ b/src/modules/utils/openurl.cpp
@@ -31,8 +31,8 @@ typedef struct {
static void OpenURLThread(void *arg)
{
- TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)arg;
- if ( !hUrlInfo->szUrl)
+ TOpenUrlInfo *hUrlInfo = (TOpenUrlInfo*)arg;
+ if ( !hUrlInfo->szUrl)
return;
//wack a protocol on it
@@ -52,15 +52,14 @@ static void OpenURLThread(void *arg)
wsprintf(szResult, _T("http://%s"), hUrlInfo->szUrl);
}
}
-
+
// check user defined browser for opening urls
DBVARIANT dbv;
if (!DBGetContactSettingTString(NULL, "Miranda", "OpenUrlBrowser", &dbv)) {
ShellExecute(NULL, _T("open"), dbv.ptszVal, szResult, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
DBFreeVariant(&dbv);
- } else {
- ShellExecute(NULL, _T("open"), szResult, NULL, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
}
+ else ShellExecute(NULL, _T("open"), szResult, NULL, NULL, (hUrlInfo->newWindow) ? SW_NORMAL : SW_SHOWDEFAULT);
mir_free(szResult);
mir_free(hUrlInfo->szUrl);
diff --git a/src/modules/utils/timezones.cpp b/src/modules/utils/timezones.cpp
index 96935bb8af..5342b82d5c 100644
--- a/src/modules/utils/timezones.cpp
+++ b/src/modules/utils/timezones.cpp
@@ -58,11 +58,11 @@ static pfnSendMessageW_t pfnSendMessageW;
typedef struct _REG_TZI_FORMAT
{
- LONG Bias;
- LONG StandardBias;
- LONG DaylightBias;
- SYSTEMTIME StandardDate;
- SYSTEMTIME DaylightDate;
+ LONG Bias;
+ LONG StandardBias;
+ LONG DaylightBias;
+ SYSTEMTIME StandardDate;
+ SYSTEMTIME DaylightDate;
} REG_TZI_FORMAT;
#define MIM_TZ_DISPLAYLEN 128
diff --git a/src/modules/visibility/visibility.cpp b/src/modules/visibility/visibility.cpp
index dbf547ae69..8f7172dbaa 100644
--- a/src/modules/visibility/visibility.cpp
+++ b/src/modules/visibility/visibility.cpp
@@ -118,7 +118,7 @@ static void SetAllContactIcons(HWND hwndList)
}
else {
flags = CallProtoServiceInt(NULL,szProto, PS_GETCAPS, PFLAGNUM_1, 0);
- status = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
+ status = db_get_w(hContact, szProto, "ApparentMode", 0);
}
if (flags & PF1_INVISLIST)
diff --git a/src/modules/xml/xmlParser.h b/src/modules/xml/xmlParser.h
index 3b91c62e5c..3820c93c12 100644
--- a/src/modules/xml/xmlParser.h
+++ b/src/modules/xml/xmlParser.h
@@ -133,24 +133,23 @@
// Some common types for char set portable code
#ifdef _XMLWIDECHAR
- #define _CXML(c) L ## c
- #define XMLCSTR const wchar_t *
- #define XMLSTR wchar_t *
- #define XMLCHAR wchar_t
+ #define _CXML(c) L ## c
+ #define XMLCSTR const wchar_t *
+ #define XMLSTR wchar_t *
+ #define XMLCHAR wchar_t
#else
- #define _CXML(c) c
- #define XMLCSTR const char *
- #define XMLSTR char *
- #define XMLCHAR char
+ #define _CXML(c) c
+ #define XMLCSTR const char *
+ #define XMLSTR char *
+ #define XMLCHAR char
#endif
#ifndef FALSE
- #define FALSE 0
+ #define FALSE 0
#endif /* FALSE */
#ifndef TRUE
- #define TRUE 1
+ #define TRUE 1
#endif /* TRUE */
-
/// Enumeration for XML parse errors.
typedef enum XMLError
{