diff options
author | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-04-05 22:27:16 +0000 |
commit | 007b4c7301f0d26a72f89f74e9929f42e24eb3e6 (patch) | |
tree | b1ee30b70c6e36d1a06aed6885cb80dc560a68ca /plugins/TipperYM | |
parent | f4a1bbc6ba4b8137cb868639ac146aa97e97e9df (diff) |
- rest of menus cleared;
- old database macroses wiped out from all plugins (left in m_database.h for compatibility)
git-svn-id: http://svn.miranda-ng.org/main/trunk@4324 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM')
-rw-r--r-- | plugins/TipperYM/src/message_pump.cpp | 8 | ||||
-rw-r--r-- | plugins/TipperYM/src/options.cpp | 336 | ||||
-rw-r--r-- | plugins/TipperYM/src/popwin.cpp | 36 | ||||
-rw-r--r-- | plugins/TipperYM/src/skin_parser.cpp | 8 | ||||
-rw-r--r-- | plugins/TipperYM/src/subst.cpp | 54 | ||||
-rw-r--r-- | plugins/TipperYM/src/tipper.cpp | 4 | ||||
-rw-r--r-- | plugins/TipperYM/src/translations.cpp | 156 |
7 files changed, 301 insertions, 301 deletions
diff --git a/plugins/TipperYM/src/message_pump.cpp b/plugins/TipperYM/src/message_pump.cpp index f0a52cdc9a..8029b04782 100644 --- a/plugins/TipperYM/src/message_pump.cpp +++ b/plugins/TipperYM/src/message_pump.cpp @@ -58,7 +58,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) if (opt.bWaitForStatusMsg && !bStatusMsgReady)
{
- DBDeleteContactSetting(clcitex->hItem, MODULE, "TempStatusMsg");
+ db_unset(clcitex->hItem, MODULE, "TempStatusMsg");
if (CanRetrieveStatusMsg(clcitex->hItem, szProto) &&
CallContactService(clcitex->hItem, PSS_GETAWAYMSG, 0, 0))
{
@@ -74,7 +74,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) CallProtoService(szProto, PS_GETAVATARCAPS, AF_ENABLED, 0))
{
DBVARIANT dbv;
- if (!DBGetContactSettingString(clcitex->hItem, "ContactPhoto", "File", &dbv))
+ if (!db_get_s(clcitex->hItem, "ContactPhoto", "File", &dbv))
{
if (!strstr(dbv.pszVal, ".xml"))
{
@@ -93,7 +93,7 @@ bool NeedWaitForContent(CLCINFOTIPEX *clcitex) else
bAvatarReady = true;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
else
bAvatarReady = true;
@@ -176,7 +176,7 @@ unsigned int CALLBACK MessagePumpThread(void *param) if (swzMsg)
{
- DBWriteContactSettingTString(clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
+ db_set_ts(clcitex->hItem, MODULE, "TempStatusMsg", swzMsg);
mir_free(swzMsg);
}
diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index ed38a434ca..383770067c 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -36,10 +36,10 @@ extern int IsTrayProto(const TCHAR *swzProto, BOOL bExtendedTip) DBVARIANT dbv;
int result = 1;
- if (!DBGetContactSettingTString(NULL, MODULE, szSetting, &dbv))
+ if (!db_get_ts(NULL, MODULE, szSetting, &dbv))
{
result = _tcsstr(dbv.ptszVal, swzProto) ? 1 : 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return result;
@@ -106,43 +106,43 @@ bool LoadDS(DISPLAYSUBST *ds, int index) mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
ds->swzName[0] = 0;
- if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy(ds->swzName, dbv.ptszVal, SIZEOF(ds->swzName));
ds->swzName[SIZEOF(ds->swzName) - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
return false;
mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
- ds->type = (DisplaySubstType)DBGetContactSettingByte(0, MODULE_ITEMS, setting, DVT_PROTODB);
+ ds->type = (DisplaySubstType)db_get_b(0, MODULE_ITEMS, setting, DVT_PROTODB);
mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
ds->szModuleName[0] = 0;
- if (!DBGetContactSetting(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get(0, MODULE_ITEMS, setting, &dbv))
{
strncpy(ds->szModuleName, dbv.pszVal, MODULE_NAME_LEN);
ds->szModuleName[MODULE_NAME_LEN - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
ds->szSettingName[0] = 0;
- if (!DBGetContactSetting(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get(0, MODULE_ITEMS, setting, &dbv))
{
strncpy(ds->szSettingName, dbv.pszVal, SETTING_NAME_LEN);
ds->szSettingName[SETTING_NAME_LEN - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index);
- ds->iTranslateFuncId = DBGetContactSettingDword(0, MODULE_ITEMS, setting, (DWORD)-1);
+ ds->iTranslateFuncId = db_get_dw(0, MODULE_ITEMS, setting, (DWORD)-1);
// a little backward compatibility
if ((DWORD)ds->iTranslateFuncId == (DWORD)-1)
{
mir_snprintf(setting, SIZEOF(setting), "TransFunc%d", index);
- ds->iTranslateFuncId = (DWORD)DBGetContactSettingWord(0, MODULE_ITEMS, setting, 0);
+ ds->iTranslateFuncId = (DWORD)db_get_w(0, MODULE_ITEMS, setting, 0);
}
return true;
@@ -154,15 +154,15 @@ void SaveDS(DISPLAYSUBST *ds, int index) char setting[512];
mir_snprintf(setting, SIZEOF(setting), "Name%d", index);
- DBWriteContactSettingTString(0, MODULE_ITEMS, setting, ds->swzName);
+ db_set_ts(0, MODULE_ITEMS, setting, ds->swzName);
mir_snprintf(setting, SIZEOF(setting), "Type%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, (BYTE)ds->type);
+ db_set_b(0, MODULE_ITEMS, setting, (BYTE)ds->type);
mir_snprintf(setting, SIZEOF(setting), "Module%d", index);
- DBWriteContactSettingString(0, MODULE_ITEMS, setting, ds->szModuleName);
+ db_set_s(0, MODULE_ITEMS, setting, ds->szModuleName);
mir_snprintf(setting, SIZEOF(setting), "Setting%d", index);
- DBWriteContactSettingString(0, MODULE_ITEMS, setting, ds->szSettingName);
+ db_set_s(0, MODULE_ITEMS, setting, ds->szSettingName);
mir_snprintf(setting, SIZEOF(setting), "TransFuncId%d", index);
- DBWriteContactSettingDword(0, MODULE_ITEMS, setting, (WORD)ds->iTranslateFuncId);
+ db_set_dw(0, MODULE_ITEMS, setting, (WORD)ds->iTranslateFuncId);
}
@@ -173,31 +173,31 @@ bool LoadDI(DISPLAYITEM *di, int index) mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
di->swzLabel[0] = 0;
- if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy( di->swzLabel, dbv.ptszVal, SIZEOF(di->swzLabel));
di->swzLabel[SIZEOF(di->swzLabel) - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
} else
return false;
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
di->swzValue[0] = 0;
- if (!DBGetContactSettingTString(0, MODULE_ITEMS, setting, &dbv))
+ if (!db_get_ts(0, MODULE_ITEMS, setting, &dbv))
{
_tcsncpy(di->swzValue, dbv.ptszVal, SIZEOF(di->swzValue));
di->swzValue[SIZEOF(di->swzValue) - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index);
- di->bLineAbove = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+ di->bLineAbove = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index);
- di->bValueNewline = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+ di->bValueNewline = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index);
- di->bIsVisible = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 1) == 1);
+ di->bIsVisible = (db_get_b(0, MODULE_ITEMS, setting, 1) == 1);
mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index);
- di->bParseTipperVarsFirst = (DBGetContactSettingByte(0, MODULE_ITEMS, setting, 0) == 1);
+ di->bParseTipperVarsFirst = (db_get_b(0, MODULE_ITEMS, setting, 0) == 1);
return true;
}
@@ -208,70 +208,70 @@ void SaveDI(DISPLAYITEM *di, int index) char setting[512];
mir_snprintf(setting, SIZEOF(setting), "DILabel%d", index);
- if (DBWriteContactSettingTString(0, MODULE_ITEMS, setting, di->swzLabel))
+ if (db_set_ts(0, MODULE_ITEMS, setting, di->swzLabel))
{
char buff[LABEL_LEN];
t2a(di->swzLabel, buff, LABEL_LEN);
- DBWriteContactSettingString(0, MODULE_ITEMS, setting, buff);
+ db_set_s(0, MODULE_ITEMS, setting, buff);
}
mir_snprintf(setting, SIZEOF(setting), "DIValue%d", index);
- if (DBWriteContactSettingTString(0, MODULE_ITEMS, setting, di->swzValue))
+ if (db_set_ts(0, MODULE_ITEMS, setting, di->swzValue))
{
char buff[VALUE_LEN];
t2a(di->swzValue, buff, VALUE_LEN);
- DBWriteContactSettingString(0, MODULE_ITEMS, setting, buff);
+ db_set_s(0, MODULE_ITEMS, setting, buff);
}
mir_snprintf(setting, SIZEOF(setting), "DILineAbove%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bLineAbove ? 1 : 0);
+ db_set_b(0, MODULE_ITEMS, setting, di->bLineAbove ? 1 : 0);
mir_snprintf(setting, SIZEOF(setting), "DIValNewline%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bValueNewline ? 1 : 0);
+ db_set_b(0, MODULE_ITEMS, setting, di->bValueNewline ? 1 : 0);
mir_snprintf(setting, SIZEOF(setting), "DIVisible%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bIsVisible ? 1 : 0);
+ db_set_b(0, MODULE_ITEMS, setting, di->bIsVisible ? 1 : 0);
mir_snprintf(setting, SIZEOF(setting), "DITipperVarsFirst%d", index);
- DBWriteContactSettingByte(0, MODULE_ITEMS, setting, di->bParseTipperVarsFirst ? 1 : 0);
+ db_set_b(0, MODULE_ITEMS, setting, di->bParseTipperVarsFirst ? 1 : 0);
}
void SaveOptions()
{
- DBWriteContactSettingDword(0, MODULE, "MaxWidth", opt.iWinWidth);
- DBWriteContactSettingDword(0, MODULE, "MaxHeight", opt.iWinMaxHeight);
- DBWriteContactSettingByte(0, MODULE, "AvatarOpacity", (BYTE)opt.iAvatarOpacity);
- DBWriteContactSettingByte(0, MODULE, "AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "TitleLayout", (BYTE)opt.titleLayout);
+ db_set_dw(0, MODULE, "MaxWidth", opt.iWinWidth);
+ db_set_dw(0, MODULE, "MaxHeight", opt.iWinMaxHeight);
+ db_set_b(0, MODULE, "AvatarOpacity", (BYTE)opt.iAvatarOpacity);
+ db_set_b(0, MODULE, "AvatarRoundCorners", (opt.bAvatarRound ? 1 : 0));
+ db_set_b(0, MODULE, "TitleLayout", (BYTE)opt.titleLayout);
if (ServiceExists(MS_AV_DRAWAVATAR))
- DBWriteContactSettingByte(0, MODULE, "AVLayout", (BYTE)opt.avatarLayout);
+ db_set_b(0, MODULE, "AVLayout", (BYTE)opt.avatarLayout);
opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
- DBWriteContactSettingDword(0, MODULE, "AVSize", opt.iAvatarSize);
- DBWriteContactSettingDword(0, MODULE, "TextIndent", opt.iTextIndent);
- DBWriteContactSettingDword(0, MODULE, "TitleIndent", opt.iTitleIndent);
- DBWriteContactSettingDword(0, MODULE, "ValueIndent", opt.iValueIndent);
- DBWriteContactSettingByte(0, MODULE, "ShowNoFocus", (opt.bShowNoFocus ? 1 : 0));
+ db_set_dw(0, MODULE, "AVSize", opt.iAvatarSize);
+ db_set_dw(0, MODULE, "TextIndent", opt.iTextIndent);
+ db_set_dw(0, MODULE, "TitleIndent", opt.iTitleIndent);
+ db_set_dw(0, MODULE, "ValueIndent", opt.iValueIndent);
+ db_set_b(0, MODULE, "ShowNoFocus", (opt.bShowNoFocus ? 1 : 0));
- DBWriteContactSettingWord(0, MODULE, "TimeIn", opt.iTimeIn);
+ db_set_w(0, MODULE, "TimeIn", opt.iTimeIn);
CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
- DBWriteContactSettingWord(0, MODULE, "Padding", opt.iPadding);
- DBWriteContactSettingWord(0, MODULE, "OuterAvatarPadding", opt.iOuterAvatarPadding);
- DBWriteContactSettingWord(0, MODULE, "InnerAvatarPadding", opt.iInnerAvatarPadding);
- DBWriteContactSettingWord(0, MODULE, "TextPadding", opt.iTextPadding);
- DBWriteContactSettingByte(0, MODULE, "Position", (BYTE)opt.pos);
- DBWriteContactSettingDword(0, MODULE, "MinWidth", (DWORD)opt.iMinWidth);
- DBWriteContactSettingDword(0, MODULE, "MinHeight", (DWORD)opt.iMinHeight);
- DBWriteContactSettingDword(0, MODULE, "SidebarWidth", (DWORD)opt.iSidebarWidth);
- DBWriteContactSettingByte(0, MODULE, "MouseTollerance", (BYTE)opt.iMouseTollerance);
- DBWriteContactSettingByte(0, MODULE, "SBarTips", (opt.bStatusBarTips ? 1 : 0));
-
- DBWriteContactSettingWord(0, MODULE, "LabelVAlign", opt.iLabelValign);
- DBWriteContactSettingWord(0, MODULE, "LabelHAlign", opt.iLabelHalign);
- DBWriteContactSettingWord(0, MODULE, "ValueVAlign", opt.iValueValign);
- DBWriteContactSettingWord(0, MODULE, "ValueHAlign", opt.iValueHalign);
-
- DBWriteContactSettingByte(0, MODULE, "OriginalAvSize", (opt.bOriginalAvatarSize ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "AvatarBorder", (opt.bAvatarBorder ? 1 : 0));
+ db_set_w(0, MODULE, "Padding", opt.iPadding);
+ db_set_w(0, MODULE, "OuterAvatarPadding", opt.iOuterAvatarPadding);
+ db_set_w(0, MODULE, "InnerAvatarPadding", opt.iInnerAvatarPadding);
+ db_set_w(0, MODULE, "TextPadding", opt.iTextPadding);
+ db_set_b(0, MODULE, "Position", (BYTE)opt.pos);
+ db_set_dw(0, MODULE, "MinWidth", (DWORD)opt.iMinWidth);
+ db_set_dw(0, MODULE, "MinHeight", (DWORD)opt.iMinHeight);
+ db_set_dw(0, MODULE, "SidebarWidth", (DWORD)opt.iSidebarWidth);
+ db_set_b(0, MODULE, "MouseTollerance", (BYTE)opt.iMouseTollerance);
+ db_set_b(0, MODULE, "SBarTips", (opt.bStatusBarTips ? 1 : 0));
+
+ db_set_w(0, MODULE, "LabelVAlign", opt.iLabelValign);
+ db_set_w(0, MODULE, "LabelHAlign", opt.iLabelHalign);
+ db_set_w(0, MODULE, "ValueVAlign", opt.iValueValign);
+ db_set_w(0, MODULE, "ValueHAlign", opt.iValueHalign);
+
+ db_set_b(0, MODULE, "OriginalAvSize", (opt.bOriginalAvatarSize ? 1 : 0));
+ db_set_b(0, MODULE, "AvatarBorder", (opt.bAvatarBorder ? 1 : 0));
}
void SaveItems()
@@ -285,7 +285,7 @@ void SaveItems() index++;
}
- DBWriteContactSettingWord(0, MODULE_ITEMS, "DSNumValues", index);
+ db_set_w(0, MODULE_ITEMS, "DSNumValues", index);
index = 0;
DIListNode *di_node = opt.diList;
@@ -299,21 +299,21 @@ void SaveItems() index++;
}
- DBWriteContactSettingWord(0, MODULE_ITEMS, "DINumValues", index);
+ db_set_w(0, MODULE_ITEMS, "DINumValues", index);
}
void SaveSkinOptions()
{
- DBWriteContactSettingByte(0, MODULE, "Border", (opt.bBorder ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "DropShadow", (opt.bDropShadow ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "RoundCorners", (opt.bRound ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "AeroGlass", (opt.bAeroGlass ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "Opacity", (BYTE)opt.iOpacity);
- DBWriteContactSettingByte(0, MODULE, "ShowEffect", (BYTE)opt.showEffect);
- DBWriteContactSettingByte(0, MODULE, "ShowEffectSpeed", (BYTE)opt.iAnimateSpeed);
- DBWriteContactSettingByte(0, MODULE, "LoadFonts", (opt.bLoadFonts ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "LoadProportions", (opt.bLoadProportions ? 1 : 0));
- DBWriteContactSettingDword(0, MODULE, "EnableColoring", opt.iEnableColoring);
+ db_set_b(0, MODULE, "Border", (opt.bBorder ? 1 : 0));
+ db_set_b(0, MODULE, "DropShadow", (opt.bDropShadow ? 1 : 0));
+ db_set_b(0, MODULE, "RoundCorners", (opt.bRound ? 1 : 0));
+ db_set_b(0, MODULE, "AeroGlass", (opt.bAeroGlass ? 1 : 0));
+ db_set_b(0, MODULE, "Opacity", (BYTE)opt.iOpacity);
+ db_set_b(0, MODULE, "ShowEffect", (BYTE)opt.showEffect);
+ db_set_b(0, MODULE, "ShowEffectSpeed", (BYTE)opt.iAnimateSpeed);
+ db_set_b(0, MODULE, "LoadFonts", (opt.bLoadFonts ? 1 : 0));
+ db_set_b(0, MODULE, "LoadProportions", (opt.bLoadProportions ? 1 : 0));
+ db_set_dw(0, MODULE, "EnableColoring", opt.iEnableColoring);
}
void LoadObsoleteSkinSetting()
@@ -324,16 +324,16 @@ void LoadObsoleteSkinSetting() for (int i = 0; i < SKIN_ITEMS_COUNT; i++)
{
mir_snprintf(setting, 128, "SPaintMode%d", i);
- opt.transfMode[i] = (TransformationMode)DBGetContactSettingByte(0, MODULE, setting, 0);
+ opt.transfMode[i] = (TransformationMode)db_get_b(0, MODULE, setting, 0);
mir_snprintf(setting, 128, "SImgFile%d", i);
- if (!DBGetContactSettingTString(NULL, MODULE, setting, &dbv))
+ if (!db_get_ts(NULL, MODULE, setting, &dbv))
{
opt.szImgFile[i] = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
mir_snprintf(setting, 128, "SGlyphMargins%d", i);
- DWORD margins = DBGetContactSettingDword(NULL, MODULE, setting, 0);
+ DWORD margins = db_get_dw(NULL, MODULE, setting, 0);
opt.margins[i].top = LOBYTE(LOWORD(margins));
opt.margins[i].right = HIBYTE(LOWORD(margins));
opt.margins[i].bottom = LOBYTE(HIWORD(margins));
@@ -343,30 +343,30 @@ void LoadObsoleteSkinSetting() void LoadOptions()
{
- opt.iWinWidth = DBGetContactSettingDword(0, MODULE, "MaxWidth", 420);
- opt.iWinMaxHeight = DBGetContactSettingDword(0, MODULE, "MaxHeight", 400);
- opt.iAvatarOpacity = DBGetContactSettingByte(0, MODULE, "AvatarOpacity", 100);
+ opt.iWinWidth = db_get_dw(0, MODULE, "MaxWidth", 420);
+ opt.iWinMaxHeight = db_get_dw(0, MODULE, "MaxHeight", 400);
+ opt.iAvatarOpacity = db_get_b(0, MODULE, "AvatarOpacity", 100);
if (opt.iAvatarOpacity > 100) opt.iAvatarOpacity = 100;
- opt.bAvatarRound = (DBGetContactSettingByte(0, MODULE, "AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
- opt.titleLayout = (PopupTitleLayout)DBGetContactSettingByte(0, MODULE, "TitleLayout", (BYTE)PTL_LEFTICON);
+ opt.bAvatarRound = (db_get_b(0, MODULE, "AvatarRoundCorners", opt.bRound ? 1 : 0) == 1);
+ opt.titleLayout = (PopupTitleLayout)db_get_b(0, MODULE, "TitleLayout", (BYTE)PTL_LEFTICON);
if (ServiceExists(MS_AV_DRAWAVATAR))
- opt.avatarLayout = (PopupAvLayout)DBGetContactSettingByte(0, MODULE, "AVLayout", PAV_RIGHT);
+ opt.avatarLayout = (PopupAvLayout)db_get_b(0, MODULE, "AVLayout", PAV_RIGHT);
else
opt.avatarLayout = PAV_NONE;
opt.bWaitForAvatar = (opt.avatarLayout == PAV_NONE) ? false : true;
- opt.iAvatarSize = DBGetContactSettingDword(0, MODULE, "AVSize", 60); //tweety
- opt.iTextIndent = DBGetContactSettingDword(0, MODULE, "TextIndent", 22);
- opt.iTitleIndent = DBGetContactSettingDword(0, MODULE, "TitleIndent", 22);
- opt.iValueIndent = DBGetContactSettingDword(0, MODULE, "ValueIndent", 10);
- opt.iSidebarWidth = DBGetContactSettingDword(0, MODULE, "SidebarWidth", 22);
- opt.bShowNoFocus = (DBGetContactSettingByte(0, MODULE, "ShowNoFocus", 1) == 1);
+ opt.iAvatarSize = db_get_dw(0, MODULE, "AVSize", 60); //tweety
+ opt.iTextIndent = db_get_dw(0, MODULE, "TextIndent", 22);
+ opt.iTitleIndent = db_get_dw(0, MODULE, "TitleIndent", 22);
+ opt.iValueIndent = db_get_dw(0, MODULE, "ValueIndent", 10);
+ opt.iSidebarWidth = db_get_dw(0, MODULE, "SidebarWidth", 22);
+ opt.bShowNoFocus = (db_get_b(0, MODULE, "ShowNoFocus", 1) == 1);
int i, real_count = 0;
opt.dsList = 0;
DSListNode *ds_node;
- opt.iDsCount = DBGetContactSettingWord(0, MODULE_ITEMS, "DSNumValues", 0);
+ opt.iDsCount = db_get_w(0, MODULE_ITEMS, "DSNumValues", 0);
for (i = opt.iDsCount - 1; i >= 0; i--)
{
ds_node = (DSListNode *)mir_alloc(sizeof(DSListNode));
@@ -388,7 +388,7 @@ void LoadOptions() DIListNode *di_node;
opt.bWaitForStatusMsg = false;
- opt.iDiCount = DBGetContactSettingWord(0, MODULE_ITEMS, "DINumValues", 0);
+ opt.iDiCount = db_get_w(0, MODULE_ITEMS, "DINumValues", 0);
for (i = opt.iDiCount - 1; i >= 0; i--)
{
di_node = (DIListNode *)mir_alloc(sizeof(DIListNode));
@@ -407,22 +407,22 @@ void LoadOptions() }
opt.iDiCount = real_count;
- opt.iTimeIn = DBGetContactSettingWord(0, MODULE, "TimeIn", 750);
- opt.iPadding = DBGetContactSettingWord(0, MODULE, "Padding", 4);
- opt.iOuterAvatarPadding = DBGetContactSettingWord(0, MODULE, "OuterAvatarPadding", 6);
- opt.iInnerAvatarPadding = DBGetContactSettingWord(0, MODULE, "InnerAvatarPadding", 10);
- opt.iTextPadding = DBGetContactSettingWord(0, MODULE, "TextPadding", 4);
- opt.pos = (PopupPosition)DBGetContactSettingByte(0, MODULE, "Position", (BYTE)PP_BOTTOMRIGHT);
- opt.iMinWidth = DBGetContactSettingDword(0, MODULE, "MinWidth", 0);
- opt.iMinHeight = DBGetContactSettingDword(0, MODULE, "MinHeight", 0);
+ opt.iTimeIn = db_get_w(0, MODULE, "TimeIn", 750);
+ opt.iPadding = db_get_w(0, MODULE, "Padding", 4);
+ opt.iOuterAvatarPadding = db_get_w(0, MODULE, "OuterAvatarPadding", 6);
+ opt.iInnerAvatarPadding = db_get_w(0, MODULE, "InnerAvatarPadding", 10);
+ opt.iTextPadding = db_get_w(0, MODULE, "TextPadding", 4);
+ opt.pos = (PopupPosition)db_get_b(0, MODULE, "Position", (BYTE)PP_BOTTOMRIGHT);
+ opt.iMinWidth = db_get_dw(0, MODULE, "MinWidth", 0);
+ opt.iMinHeight = db_get_dw(0, MODULE, "MinHeight", 0);
- opt.iMouseTollerance = DBGetContactSettingByte(0, MODULE, "MouseTollerance", (BYTE)GetSystemMetrics(SM_CXSMICON));
- opt.bStatusBarTips = (DBGetContactSettingByte(0, MODULE, "SBarTips", 1) == 1);
+ opt.iMouseTollerance = db_get_b(0, MODULE, "MouseTollerance", (BYTE)GetSystemMetrics(SM_CXSMICON));
+ opt.bStatusBarTips = (db_get_b(0, MODULE, "SBarTips", 1) == 1);
// convert defunct last message and status message options to new 'sys' items, and remove the old settings
- if (DBGetContactSettingByte(0, MODULE, "ShowLastMessage", 0))
+ if (db_get_b(0, MODULE, "ShowLastMessage", 0))
{
- DBDeleteContactSetting(0, MODULE, "ShowLastMessage");
+ db_unset(0, MODULE, "ShowLastMessage");
// find end of list
di_node = opt.diList;
@@ -448,9 +448,9 @@ void LoadOptions() opt.iDiCount++;
}
- if (DBGetContactSettingByte(0, MODULE, "ShowStatusMessage", 0))
+ if (db_get_b(0, MODULE, "ShowStatusMessage", 0))
{
- DBDeleteContactSetting(0, MODULE, "ShowStatusMessage");
+ db_unset(0, MODULE, "ShowStatusMessage");
// find end of list
di_node = opt.diList;
@@ -476,31 +476,31 @@ void LoadOptions() opt.iDiCount++;
}
- opt.iLabelValign = DBGetContactSettingWord(0, MODULE, "LabelVAlign", DT_TOP /*DT_VCENTER*/);
- opt.iLabelHalign = DBGetContactSettingWord(0, MODULE, "LabelHAlign", DT_LEFT);
- opt.iValueValign = DBGetContactSettingWord(0, MODULE, "ValueVAlign", DT_TOP /*DT_VCENTER*/);
- opt.iValueHalign = DBGetContactSettingWord(0, MODULE, "ValueHAlign", DT_LEFT);
+ opt.iLabelValign = db_get_w(0, MODULE, "LabelVAlign", DT_TOP /*DT_VCENTER*/);
+ opt.iLabelHalign = db_get_w(0, MODULE, "LabelHAlign", DT_LEFT);
+ opt.iValueValign = db_get_w(0, MODULE, "ValueVAlign", DT_TOP /*DT_VCENTER*/);
+ opt.iValueHalign = db_get_w(0, MODULE, "ValueHAlign", DT_LEFT);
// tray tooltip
- opt.bTraytip = DBGetContactSettingByte(0, MODULE, "TrayTip", 1) ? true : false;
- opt.bHandleByTipper = DBGetContactSettingByte(0, MODULE, "ExtendedTrayTip", 1) ? true : false;
- opt.bExpandTraytip = DBGetContactSettingByte(0, MODULE, "ExpandTrayTip", 1) ? true : false;
- opt.bHideOffline = DBGetContactSettingByte(0, MODULE, "HideOffline", 0) ? true : false;
- opt.iExpandTime = DBGetContactSettingDword(0, MODULE, "ExpandTime", 1000);
- opt.iFirstItems = DBGetContactSettingDword(0, MODULE, "TrayTipItems", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_CLIST_EVENT);
- opt.iSecondItems = DBGetContactSettingDword(0, MODULE, "TrayTipItemsEx", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_STATUS_MSG | TRAYTIP_EXTRA_STATUS | TRAYTIP_MIRANDA_UPTIME | TRAYTIP_CLIST_EVENT);
- opt.iFavoriteContFlags = DBGetContactSettingDword(0, MODULE, "FavContFlags", FAVCONT_APPEND_PROTO);
+ opt.bTraytip = db_get_b(0, MODULE, "TrayTip", 1) ? true : false;
+ opt.bHandleByTipper = db_get_b(0, MODULE, "ExtendedTrayTip", 1) ? true : false;
+ opt.bExpandTraytip = db_get_b(0, MODULE, "ExpandTrayTip", 1) ? true : false;
+ opt.bHideOffline = db_get_b(0, MODULE, "HideOffline", 0) ? true : false;
+ opt.iExpandTime = db_get_dw(0, MODULE, "ExpandTime", 1000);
+ opt.iFirstItems = db_get_dw(0, MODULE, "TrayTipItems", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_CLIST_EVENT);
+ opt.iSecondItems = db_get_dw(0, MODULE, "TrayTipItemsEx", TRAYTIP_NUMCONTACTS | TRAYTIP_LOGON | TRAYTIP_STATUS | TRAYTIP_STATUS_MSG | TRAYTIP_EXTRA_STATUS | TRAYTIP_MIRANDA_UPTIME | TRAYTIP_CLIST_EVENT);
+ opt.iFavoriteContFlags = db_get_dw(0, MODULE, "FavContFlags", FAVCONT_APPEND_PROTO);
// extra setting
- opt.bWaitForContent= DBGetContactSettingByte(0, MODULE, "WaitForContent", 0) ? true : false;
- opt.bGetNewStatusMsg = DBGetContactSettingByte(0, MODULE, "GetNewStatusMsg", 0) ? true : false;
- opt.bDisableIfInvisible = DBGetContactSettingByte(0, MODULE, "DisableInvisible", 1) ? true : false;
- opt.bRetrieveXstatus = DBGetContactSettingByte(0, MODULE, "RetrieveXStatus", 0) ? true : false;
- opt.bOriginalAvatarSize = DBGetContactSettingByte(0, MODULE, "OriginalAvSize", 0) ? true : false;
- opt.bAvatarBorder = DBGetContactSettingByte(0, MODULE, "AvatarBorder", 0) ? true : false;
- opt.bLimitMsg = DBGetContactSettingByte(0, MODULE, "LimitMsg", 0) ? true : false;
- opt.iLimitCharCount = DBGetContactSettingByte(0, MODULE, "LimitCharCount", 64);
- opt.iSmileyAddFlags = DBGetContactSettingDword(0, MODULE, "SmileyAddFlags", SMILEYADD_ENABLE);
+ opt.bWaitForContent= db_get_b(0, MODULE, "WaitForContent", 0) ? true : false;
+ opt.bGetNewStatusMsg = db_get_b(0, MODULE, "GetNewStatusMsg", 0) ? true : false;
+ opt.bDisableIfInvisible = db_get_b(0, MODULE, "DisableInvisible", 1) ? true : false;
+ opt.bRetrieveXstatus = db_get_b(0, MODULE, "RetrieveXStatus", 0) ? true : false;
+ opt.bOriginalAvatarSize = db_get_b(0, MODULE, "OriginalAvSize", 0) ? true : false;
+ opt.bAvatarBorder = db_get_b(0, MODULE, "AvatarBorder", 0) ? true : false;
+ opt.bLimitMsg = db_get_b(0, MODULE, "LimitMsg", 0) ? true : false;
+ opt.iLimitCharCount = db_get_b(0, MODULE, "LimitCharCount", 64);
+ opt.iSmileyAddFlags = db_get_dw(0, MODULE, "SmileyAddFlags", SMILEYADD_ENABLE);
DBVARIANT dbv;
// Load the icons order
@@ -510,16 +510,16 @@ void LoadOptions() opt.exIconsVis[i]=1;
}
- if (!DBGetContactSetting(NULL, MODULE, "IconOrder", &dbv))
+ if (!db_get(NULL, MODULE, "IconOrder", &dbv))
{
CopyMemory(opt.exIconsOrder,dbv.pbVal,dbv.cpbVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
- if (!DBGetContactSetting(NULL, MODULE, "icons_vis", &dbv))
+ if (!db_get(NULL, MODULE, "icons_vis", &dbv))
{
CopyMemory(opt.exIconsVis,dbv.pbVal,dbv.cpbVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
for(i = 0; i < EXICONS_COUNT; i++)
@@ -528,24 +528,24 @@ void LoadOptions() exIcons[i].vis = opt.exIconsVis[i];
}
- opt.iOpacity = DBGetContactSettingByte(0, MODULE, "Opacity", 75);
- opt.bBorder = DBGetContactSettingByte(0, MODULE, "Border", 1) ? true : false;
- opt.bDropShadow = DBGetContactSettingByte(0, MODULE, "DropShadow", 1) ? true : false;
- opt.bRound = DBGetContactSettingByte(0, MODULE, "RoundCorners", 1) ? true : false;
- opt.bAeroGlass = DBGetContactSettingByte(0, MODULE, "AeroGlass", 0) ? true : false;
- opt.showEffect = (PopupShowEffect)DBGetContactSettingByte(0, MODULE, "ShowEffect", (BYTE)PSE_FADE);
- opt.iAnimateSpeed = DBGetContactSettingByte(0, MODULE, "ShowEffectSpeed", 12);
+ opt.iOpacity = db_get_b(0, MODULE, "Opacity", 75);
+ opt.bBorder = db_get_b(0, MODULE, "Border", 1) ? true : false;
+ opt.bDropShadow = db_get_b(0, MODULE, "DropShadow", 1) ? true : false;
+ opt.bRound = db_get_b(0, MODULE, "RoundCorners", 1) ? true : false;
+ opt.bAeroGlass = db_get_b(0, MODULE, "AeroGlass", 0) ? true : false;
+ opt.showEffect = (PopupShowEffect)db_get_b(0, MODULE, "ShowEffect", (BYTE)PSE_FADE);
+ opt.iAnimateSpeed = db_get_b(0, MODULE, "ShowEffectSpeed", 12);
if (opt.iAnimateSpeed < 1)
opt.iAnimateSpeed = 1;
else if (opt.iAnimateSpeed > 20)
opt.iAnimateSpeed = 20;
- int iBgImg = DBGetContactSettingByte(0, MODULE, "SBgImage", 0);
- opt.skinMode = (SkinMode)DBGetContactSettingByte(0, MODULE, "SkinEngine", iBgImg ? SM_OBSOLOTE : SM_COLORFILL);
- opt.bLoadFonts = DBGetContactSettingByte(0, MODULE, "LoadFonts", 1) ? true : false;
- opt.bLoadProportions= DBGetContactSettingByte(0, MODULE, "LoadProportions", 1) ? true : false;
- opt.iEnableColoring = DBGetContactSettingDword(0, MODULE, "EnableColoring", 0);
+ int iBgImg = db_get_b(0, MODULE, "SBgImage", 0);
+ opt.skinMode = (SkinMode)db_get_b(0, MODULE, "SkinEngine", iBgImg ? SM_OBSOLOTE : SM_COLORFILL);
+ opt.bLoadFonts = db_get_b(0, MODULE, "LoadFonts", 1) ? true : false;
+ opt.bLoadProportions= db_get_b(0, MODULE, "LoadProportions", 1) ? true : false;
+ opt.iEnableColoring = db_get_dw(0, MODULE, "EnableColoring", 0);
opt.szSkinName[0] = 0;
if (opt.skinMode == SM_OBSOLOTE)
@@ -554,10 +554,10 @@ void LoadOptions() }
else if (opt.skinMode == SM_IMAGE)
{
- if (!DBGetContactSettingTString(NULL, MODULE, "SkinName", &dbv))
+ if (!db_get_ts(NULL, MODULE, "SkinName", &dbv))
{
_tcscpy(opt.szSkinName, dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -1710,13 +1710,13 @@ INT_PTR CALLBACK DlgProcOptsExtra(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM opt.bLimitMsg = IsDlgButtonChecked(hwndDlg, IDC_CHK_LIMITMSG) ? true : false;
opt.iLimitCharCount = GetDlgItemInt(hwndDlg, IDC_ED_CHARCOUNT, 0, FALSE);
- DBWriteContactSettingDword(0, MODULE, "SmileyAddFlags", opt.iSmileyAddFlags);
- DBWriteContactSettingByte(0, MODULE, "WaitForContent", opt.bWaitForContent ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "GetNewStatusMsg", opt.bGetNewStatusMsg ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "DisableInvisible", opt.bDisableIfInvisible ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "RetrieveXStatus", opt.bRetrieveXstatus ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "LimitMsg", opt.bLimitMsg ? 1 : 0);
- DBWriteContactSettingByte(0, MODULE, "LimitCharCount", opt.iLimitCharCount);
+ db_set_dw(0, MODULE, "SmileyAddFlags", opt.iSmileyAddFlags);
+ db_set_b(0, MODULE, "WaitForContent", opt.bWaitForContent ? 1 : 0);
+ db_set_b(0, MODULE, "GetNewStatusMsg", opt.bGetNewStatusMsg ? 1 : 0);
+ db_set_b(0, MODULE, "DisableInvisible", opt.bDisableIfInvisible ? 1 : 0);
+ db_set_b(0, MODULE, "RetrieveXStatus", opt.bRetrieveXstatus ? 1 : 0);
+ db_set_b(0, MODULE, "LimitMsg", opt.bLimitMsg ? 1 : 0);
+ db_set_b(0, MODULE, "LimitCharCount", opt.iLimitCharCount);
return TRUE;
}
@@ -2026,8 +2026,8 @@ INT_PTR CALLBACK DlgProcOptsSkin(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l }
}
- DBWriteContactSettingByte(0, MODULE, "SkinEngine", opt.skinMode);
- DBWriteContactSettingTString(0, MODULE, "SkinName", opt.szSkinName);
+ db_set_b(0, MODULE, "SkinEngine", opt.skinMode);
+ db_set_ts(0, MODULE, "SkinName", opt.szSkinName);
DestroySkinBitmap();
SetDlgItemInt(hwndDlg, IDC_ED_TRANS, opt.iOpacity, FALSE);
@@ -2084,7 +2084,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, {
TranslateDialogDefault(hwndDlg);
- if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
+ if (CallService(MS_CLUI_GETCAPS, 0, 0) & CLUIF_DISABLEGROUPS && !db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) FALSE, 0);
else
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETUSEGROUPS, (WPARAM) TRUE, 0);
@@ -2098,7 +2098,7 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, while (hContact)
{
hItem = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, (WPARAM)hContact, 0);
- if (hItem && DBGetContactSettingByte(hContact, MODULE, "FavouriteContact", 0))
+ if (hItem && db_get_b(hContact, MODULE, "FavouriteContact", 0))
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
hContact = db_find_next(hContact);
@@ -2126,19 +2126,19 @@ INT_PTR CALLBACK DlgProcFavouriteContacts(HWND hwndDlg, UINT msg, WPARAM wParam, if (hItem)
{
isChecked = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0);
- DBWriteContactSettingByte(hContact, MODULE, "FavouriteContact", isChecked);
+ db_set_b(hContact, MODULE, "FavouriteContact", isChecked);
if (isChecked) count++;
}
hContact = db_find_next(hContact);
}
- DBWriteContactSettingDword(0, MODULE, "FavouriteContactsCount", count);
+ db_set_dw(0, MODULE, "FavouriteContactsCount", count);
opt.iFavoriteContFlags = 0;
opt.iFavoriteContFlags |= IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? FAVCONT_HIDE_OFFLINE : 0 |
IsDlgButtonChecked(hwndDlg, IDC_CHK_APPENDPROTO) ? FAVCONT_APPEND_PROTO : 0;
- DBWriteContactSettingDword(0, MODULE, "FavContFlags", opt.iFavoriteContFlags);
+ db_set_dw(0, MODULE, "FavContFlags", opt.iFavoriteContFlags);
} // fall through
case IDC_BTN_CANCEL:
{
@@ -2295,7 +2295,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_FIRST_PROTOS), item.hItem);
}
- DBWriteContactSettingTString(0, MODULE, "TrayProtocols", swzProtos);
+ db_set_ts(0, MODULE, "TrayProtocols", swzProtos);
swzProtos[0] = 0;
item.hItem = TreeView_GetRoot(GetDlgItem(hwndDlg,IDC_TREE_SECOND_PROTOS));
@@ -2312,7 +2312,7 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA item.hItem = TreeView_GetNextSibling(GetDlgItem(hwndDlg, IDC_TREE_SECOND_PROTOS), item.hItem);
}
- DBWriteContactSettingTString(0, MODULE, "TrayProtocolsEx", swzProtos);
+ db_set_ts(0, MODULE, "TrayProtocolsEx", swzProtos);
int count = 0;
opt.iFirstItems = 0;
@@ -2348,13 +2348,13 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA opt.bHideOffline = IsDlgButtonChecked(hwndDlg, IDC_CHK_HIDEOFFLINE) ? true : false;
opt.iExpandTime = max(min(GetDlgItemInt(hwndDlg, IDC_ED_EXPANDTIME, 0, FALSE), 5000), 10);
- DBWriteContactSettingByte(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
- DBWriteContactSettingByte(0, MODULE, "HideOffline", (opt.bHideOffline ? 1 : 0));
- DBWriteContactSettingDword(0, MODULE, "ExpandTime", opt.iExpandTime);
- DBWriteContactSettingDword(0, MODULE, "TrayTipItems", opt.iFirstItems);
- DBWriteContactSettingDword(0, MODULE, "TrayTipItemsEx", opt.iSecondItems);
+ db_set_b(0, MODULE, "TrayTip", (opt.bTraytip ? 1 : 0));
+ db_set_b(0, MODULE, "ExtendedTrayTip", (opt.bHandleByTipper ? 1 : 0));
+ db_set_b(0, MODULE, "ExpandTrayTip", (opt.bExpandTraytip ? 1 : 0));
+ db_set_b(0, MODULE, "HideOffline", (opt.bHideOffline ? 1 : 0));
+ db_set_dw(0, MODULE, "ExpandTime", opt.iExpandTime);
+ db_set_dw(0, MODULE, "TrayTipItems", opt.iFirstItems);
+ db_set_dw(0, MODULE, "TrayTipItemsEx", opt.iSecondItems);
return TRUE;
}
break;
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index c3ed182e2b..155990697d 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -153,7 +153,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
}
else {
- if (DBGetContactSettingByte(0, pwd->clcit.szProto, "XStatusId", 0)) {
+ if (db_get_b(0, pwd->clcit.szProto, "XStatusId", 0)) {
// xstatus title
swzAdvTitle = GetProtoExtraStatusTitle(pwd->clcit.szProto);
if (swzAdvTitle) {
@@ -316,7 +316,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // don't use stored status message
if (!opt.bWaitForContent)
- DBDeleteContactSetting(pwd->hContact, MODULE, "TempStatusMsg");
+ db_unset(pwd->hContact, MODULE, "TempStatusMsg");
TCHAR *swzNick = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)pwd->hContact, GCDNF_TCHAR);
_tcsncpy(pwd->swzTitle, swzNick, TITLE_TEXT_LEN);
@@ -339,14 +339,14 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // xstatus icon
if (pwd->bIsIconVisible[1]) {
for (i = 0; opt.exIconsOrder[i] != 1; i++);
- int iXstatus = DBGetContactSettingByte(pwd->hContact, szProto, "XStatusId", 0);
+ int iXstatus = db_get_b(pwd->hContact, szProto, "XStatusId", 0);
if (iXstatus) {
char szIconProto[64];
if (strcmp(szProto, szMetaModuleName) != 0)
strcpy(szIconProto, szProto);
- else if (!DBGetContactSettingString(pwd->hContact, szProto, "XStatusProto", &dbv)) {
+ else if (!db_get_s(pwd->hContact, szProto, "XStatusProto", &dbv)) {
strcpy(szIconProto, dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
pwd->extraIcons[i].hIcon = (HICON)CallProtoService(szIconProto, PS_GETCUSTOMSTATUSICON, (WPARAM)iXstatus, LR_SHARED);
@@ -367,9 +367,9 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (ServiceExists(MS_GENDER_GETICON))
pwd->extraIcons[i].hIcon = (HICON)CallService(MS_GENDER_GETICON, (WPARAM)pwd->hContact, 0);
else {
- int iGender = DBGetContactSettingByte(pwd->hContact, "UserInfo", "Gender", 0);
+ int iGender = db_get_b(pwd->hContact, "UserInfo", "Gender", 0);
if (iGender == 0)
- iGender = DBGetContactSettingByte(pwd->hContact, szProto, "Gender", 0);
+ iGender = db_get_b(pwd->hContact, szProto, "Gender", 0);
if (iGender == GEN_FEMALE)
pwd->extraIcons[i].hIcon = Skin_GetIcon("UserInfoEx_common_female");
@@ -399,24 +399,24 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if (pwd->bIsIconVisible[5]) {
for (i = 0; opt.exIconsOrder[i] != 5; i++);
if ( ServiceExists(MS_FP_GETCLIENTICONT)) {
- if (!DBGetContactSettingTString(pwd->hContact, szProto, "MirVer", &dbv)) {
+ if (!db_get_ts(pwd->hContact, szProto, "MirVer", &dbv)) {
pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICONT, (WPARAM)dbv.ptszVal, 0);
pwd->extraIcons[i].bDestroy = true;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else if (ServiceExists(MS_FP_GETCLIENTICON)) {
- if (!DBGetContactSettingString(pwd->hContact, szProto, "MirVer", &dbv)) {
+ if (!db_get_s(pwd->hContact, szProto, "MirVer", &dbv)) {
pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)dbv.pszVal, 0);
pwd->extraIcons[i].bDestroy = true;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
//request xstatus details
if (opt.bRetrieveXstatus)
- if (!DBGetContactSettingByte(0, szProto, "XStatusAuto", 1) && ProtoServiceExists(szProto, PS_ICQ_REQUESTCUSTOMSTATUS))
+ if (!db_get_b(0, szProto, "XStatusAuto", 1) && ProtoServiceExists(szProto, PS_ICQ_REQUESTCUSTOMSTATUS))
CallProtoService(szProto, PS_ICQ_REQUESTCUSTOMSTATUS, (WPARAM)pwd->hContact, 0);
}
@@ -996,7 +996,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa case PUM_SETSTATUSTEXT:
if (pwd && (HANDLE)wParam == pwd->hContact) {
- DBWriteContactSettingTString(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR *)lParam);
+ db_set_ts(pwd->hContact, MODULE, "TempStatusMsg", (TCHAR *)lParam);
pwd->bIsPainted = false;
pwd->bNeedRefresh = true;
SendMessage(hwnd, PUM_REFRESH_VALUES, TRUE, 0);
@@ -1555,7 +1555,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa while (hContact) {
char *proto = GetContactProto(hContact);
if (proto && !strcmp(proto, pa->szModuleName)) {
- if (DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ if (db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
iCountOnline++;
iCount++;
}
@@ -1626,7 +1626,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
}
else {
- if (DBGetContactSettingByte(0, pa->szModuleName, "XStatusId", 0)) {
+ if (db_get_b(0, pa->szModuleName, "XStatusId", 0)) {
// xstatus title
swzAdvTitle = GetProtoExtraStatusTitle(pa->szModuleName);
if (swzAdvTitle) {
@@ -1672,7 +1672,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa }
if (dwItems & TRAYTIP_FAVCONTACTS) {
- if (DBGetContactSettingDword(0, MODULE, "FavouriteContactsCount", 0)) {
+ if (db_get_dw(0, MODULE, "FavouriteContactsCount", 0)) {
TCHAR swzName[256];
TCHAR swzStatus[256];
bool bTitlePainted = false;
@@ -1680,10 +1680,10 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa HANDLE hContact = db_find_first();
while (hContact) {
- if (DBGetContactSettingByte(hContact, MODULE, "FavouriteContact", 0)) {
+ if (db_get_b(hContact, MODULE, "FavouriteContact", 0)) {
char *proto = GetContactProto(hContact);
if (proto) {
- WORD wStatus = DBGetContactSettingWord(hContact, proto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, proto, "Status", ID_STATUS_OFFLINE);
WordToStatusDesc(hContact, proto, "Status", swzStatus, 256);
if (wStatus != ID_STATUS_OFFLINE)
diff --git a/plugins/TipperYM/src/skin_parser.cpp b/plugins/TipperYM/src/skin_parser.cpp index 439b1a2b44..3a00979545 100644 --- a/plugins/TipperYM/src/skin_parser.cpp +++ b/plugins/TipperYM/src/skin_parser.cpp @@ -210,7 +210,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) if (_tcslen(pch) > 32)
pch[32] = 0;
- DBWriteContactSettingTString(0, MODULE, szSetting, pch);
+ db_set_ts(0, MODULE, szSetting, pch);
}
}
else if (_tcsstr(buff, _T("color")))
@@ -227,7 +227,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) {
BYTE b = _ttoi(pch);
COLORREF color = RGB(r, g ,b);
- DBWriteContactSettingDword(0, MODULE, szSetting, color);
+ db_set_dw(0, MODULE, szSetting, color);
}
}
}
@@ -238,7 +238,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) {
HDC hdc = GetDC(0);
int size = -MulDiv(_ttoi(pch), GetDeviceCaps(hdc, LOGPIXELSY), 72);
- DBWriteContactSettingByte(0, MODULE, szSetting, (BYTE)size);
+ db_set_b(0, MODULE, szSetting, (BYTE)size);
ReleaseDC(0, hdc);
}
}
@@ -254,7 +254,7 @@ void ParseFontPart(FILE *fp, TCHAR *buff) if (_tcsstr(pch, _T("font_underline")))
effect |= DBFONTF_UNDERLINE;
- DBWriteContactSettingByte(0, MODULE, szSetting, effect);
+ db_set_b(0, MODULE, szSetting, effect);
}
}
}
diff --git a/plugins/TipperYM/src/subst.cpp b/plugins/TipperYM/src/subst.cpp index 41fb8eda43..779fe76bf8 100644 --- a/plugins/TipperYM/src/subst.cpp +++ b/plugins/TipperYM/src/subst.cpp @@ -36,7 +36,7 @@ bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, cons if (!szModuleName || !szSettingName)
return false;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
switch(dbv.type)
{
@@ -65,7 +65,7 @@ bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, cons }
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return buff[0] ? true : false;
@@ -73,7 +73,7 @@ bool DBGetContactSettingAsString(HANDLE hContact, const char *szModuleName, cons void StripBBCodesInPlace(TCHAR *swzText)
{
- if (!DBGetContactSettingByte(0, MODULE, "StripBBCodes", 1))
+ if (!db_get_b(0, MODULE, "StripBBCodes", 1))
return;
if (swzText == 0)
@@ -207,13 +207,13 @@ bool CanRetrieveStatusMsg(HANDLE hContact, char *szProto) if (opt.bGetNewStatusMsg)
{
int iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0);
- WORD wStatus = DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
if ((CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_MODEMSGSEND) && (iFlags & Proto_Status2Flag(wStatus)))
{
iFlags = CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & (PF1_VISLIST | PF1_INVISLIST);
if (opt.bDisableIfInvisible && iFlags)
{
- int iVisMode = DBGetContactSettingWord(hContact, szProto, "ApparentMode", 0);
+ int iVisMode = db_get_w(hContact, szProto, "ApparentMode", 0);
int wProtoStatus = CallProtoService(szProto, PS_GETSTATUS, 0, 0);
if ((iVisMode == ID_STATUS_OFFLINE) || (wProtoStatus == ID_STATUS_INVISIBLE && iVisMode != ID_STATUS_ONLINE))
return false;
@@ -252,11 +252,11 @@ TCHAR *GetStatusMessageText(HANDLE hContact) if (wStatus == ID_STATUS_OFFLINE)
return NULL;
- if (!DBGetContactSettingTString(hContact, MODULE, "TempStatusMsg", &dbv))
+ if (!db_get_ts(hContact, MODULE, "TempStatusMsg", &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzMsg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
@@ -268,11 +268,11 @@ TCHAR *GetStatusMessageText(HANDLE hContact) return NULL;
}
- if (!DBGetContactSettingTString(hContact, "CList", "StatusMsg", &dbv))
+ if (!db_get_ts(hContact, "CList", "StatusMsg", &dbv))
{
if (dbv.ptszVal && _tcslen(dbv.ptszVal) != 0)
swzMsg = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
@@ -417,17 +417,17 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int buffle for (int i = 0; i < iNumber; i++) {
if (i > 0)
hTmpContact = (HANDLE)CallService(MS_MC_GETSUBCONTACT, (WPARAM)hContact, i);
- dwRecountTs = DBGetContactSettingDword(hTmpContact, MODULE, "LastCountTS", 0);
+ dwRecountTs = db_get_dw(hTmpContact, MODULE, "LastCountTS", 0);
dwTime = (DWORD)time(0);
dwDiff = (dwTime - dwRecountTs);
if (dwDiff > (60 * 60 * 24 * 3)) {
- DBWriteContactSettingDword(hTmpContact, MODULE, "LastCountTS", dwTime);
+ db_set_dw(hTmpContact, MODULE, "LastCountTS", dwTime);
dwCountOut = dwCountIn = dwLastTs = 0;
}
else {
- dwCountOut = DBGetContactSettingDword(hTmpContact, MODULE, "MsgCountOut", 0);
- dwCountIn = DBGetContactSettingDword(hTmpContact, MODULE, "MsgCountIn", 0);
- dwLastTs = DBGetContactSettingDword(hTmpContact, MODULE, "LastMsgTS", 0);
+ dwCountOut = db_get_dw(hTmpContact, MODULE, "MsgCountOut", 0);
+ dwCountIn = db_get_dw(hTmpContact, MODULE, "MsgCountIn", 0);
+ dwLastTs = db_get_dw(hTmpContact, MODULE, "LastMsgTS", 0);
}
dwNewTs = dwLastTs;
@@ -449,9 +449,9 @@ bool GetSysSubstText(HANDLE hContact, TCHAR *swzRawSpec, TCHAR *buff, int buffle }
if (dwNewTs > dwLastTs) {
- DBWriteContactSettingDword(hTmpContact, MODULE, "MsgCountOut", dwCountOut);
- DBWriteContactSettingDword(hTmpContact, MODULE, "MsgCountIn", dwCountIn);
- DBWriteContactSettingDword(hTmpContact, MODULE, "LastMsgTS", dwNewTs);
+ db_set_dw(hTmpContact, MODULE, "MsgCountOut", dwCountOut);
+ db_set_dw(hTmpContact, MODULE, "MsgCountIn", dwCountIn);
+ db_set_dw(hTmpContact, MODULE, "LastMsgTS", dwNewTs);
}
dwMetaCountOut += dwCountOut;
@@ -851,11 +851,11 @@ TCHAR *GetProtoExtraStatusTitle(char *szProto) if (!szProto)
return NULL;
- if (!DBGetContactSettingTString(0, szProto, "XStatusName", &dbv))
+ if (!db_get_ts(0, szProto, "XStatusName", &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (!swzText)
@@ -879,11 +879,11 @@ TCHAR *GetProtoExtraStatusMessage(char *szProto) if (!szProto)
return NULL;
- if (!DBGetContactSettingTString(0, szProto, "XStatusMsg", &dbv))
+ if (!db_get_ts(0, szProto, "XStatusMsg", &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
if (ServiceExists(MS_VARS_FORMATSTRING))
{
@@ -923,11 +923,11 @@ TCHAR *GetListeningTo(char *szProto) if (!szProto)
return NULL;
- if (!DBGetContactSettingTString(0, szProto, "ListeningTo", &dbv))
+ if (!db_get_ts(0, szProto, "ListeningTo", &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (opt.bLimitMsg)
@@ -946,11 +946,11 @@ TCHAR *GetJabberAdvStatusText(char *szProto, const char *szSlot, const char *szV return NULL;
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, szSlot, szValue);
- if (!DBGetContactSettingTString(0, "AdvStatus", szSetting, &dbv))
+ if (!db_get_ts(0, "AdvStatus", szSetting, &dbv))
{
if (_tcslen(dbv.ptszVal) != 0)
swzText = mir_tstrdup(dbv.ptszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
if (opt.bLimitMsg)
@@ -969,10 +969,10 @@ HICON GetJabberActivityIcon(HANDLE hContact, char *szProto) return NULL;
mir_snprintf(szSetting, SIZEOF(szSetting), "%s/%s/%s", szProto, "activity", "icon");
- if (!DBGetContactSettingString(hContact, "AdvStatus", szSetting, &dbv))
+ if (!db_get_s(hContact, "AdvStatus", szSetting, &dbv))
{
hIcon = Skin_GetIcon(dbv.pszVal);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return hIcon;
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index 17e9100251..4129c9a58a 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -113,7 +113,7 @@ int EventDeleted(WPARAM wParam, LPARAM lParam) DBEVENTINFO dbei = { sizeof(dbei) };
if ( !db_event_get((HANDLE)lParam, &dbei))
if (dbei.eventType == EVENTTYPE_MESSAGE)
- DBDeleteContactSetting((HANDLE)wParam, MODULE, "LastCountTS");
+ db_unset((HANDLE)wParam, MODULE, "LastCountTS");
return 0;
}
@@ -269,7 +269,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) CallService(MS_CLC_SETINFOTIPHOVERTIME, opt.iTimeIn, 0);
// set Miranda start timestamp
- DBWriteContactSettingDword(0, MODULE, "MirandaStartTS", (DWORD)time(0));
+ db_set_dw(0, MODULE, "MirandaStartTS", (DWORD)time(0));
// get MetaContacts module name
if (ServiceExists(MS_MC_GETPROTOCOLNAME))
diff --git a/plugins/TipperYM/src/translations.cpp b/plugins/TipperYM/src/translations.cpp index fcbe097981..39b32434a5 100644 --- a/plugins/TipperYM/src/translations.cpp +++ b/plugins/TipperYM/src/translations.cpp @@ -43,7 +43,7 @@ void AddTranslation(DBVTranslation *newTrans) }
else
{
- DWORD id = DBGetContactSettingDword(0, MODULE_ITEMS, szSetting, 0);
+ DWORD id = db_get_dw(0, MODULE_ITEMS, szSetting, 0);
if (id != 0)
{
translations[iTransFuncsCount - 1].id = id;
@@ -52,10 +52,10 @@ void AddTranslation(DBVTranslation *newTrans) else
{
translations[iTransFuncsCount - 1].id = dwNextFuncId++;
- DBWriteContactSettingDword(0, MODULE_ITEMS, szSetting, translations[iTransFuncsCount - 1].id);
+ db_set_dw(0, MODULE_ITEMS, szSetting, translations[iTransFuncsCount - 1].id);
}
- DBWriteContactSettingDword(0, MODULE_ITEMS, "NextFuncId", dwNextFuncId);
+ db_set_dw(0, MODULE_ITEMS, "NextFuncId", dwNextFuncId);
}
mir_free(szName);
@@ -70,7 +70,7 @@ TCHAR *NullTranslation(HANDLE hContact, const char *szModuleName, const char *sz TCHAR *TimestampToShortDate(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
DBTIMETOSTRINGT dbt = {0};
@@ -83,7 +83,7 @@ TCHAR *TimestampToShortDate(HANDLE hContact, const char *szModuleName, const cha TCHAR *TimestampToLongDate(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
DBTIMETOSTRINGT dbt = {0};
@@ -96,7 +96,7 @@ TCHAR *TimestampToLongDate(HANDLE hContact, const char *szModuleName, const char TCHAR *TimestampToTime(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
DBTIMETOSTRINGT dbt = {0};
@@ -109,7 +109,7 @@ TCHAR *TimestampToTime(HANDLE hContact, const char *szModuleName, const char *sz TCHAR *TimestampToTimeNoSecs(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ts == 0) return 0;
DBTIMETOSTRINGT dbt = {0};
@@ -122,7 +122,7 @@ TCHAR *TimestampToTimeNoSecs(HANDLE hContact, const char *szModuleName, const ch TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ts = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ts = db_get_dw(hContact, szModuleName, szSettingName, 0);
DWORD t = (DWORD)time(0);
if (ts == 0) return 0;
@@ -142,7 +142,7 @@ TCHAR *TimestampToTimeDifference(HANDLE hContact, const char *szModuleName, cons TCHAR *SecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD diff = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD diff = db_get_dw(hContact, szModuleName, szSettingName, 0);
int d = (diff / 60 / 60 / 24);
int h = (diff - d * 60 * 60 * 24) / 60 / 60;
int m = (diff - d * 60 * 60 * 24 - h * 60 * 60) / 60;
@@ -158,7 +158,7 @@ TCHAR *SecondsToTimeDifference(HANDLE hContact, const char *szModuleName, const TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- WORD wStatus = DBGetContactSettingWord(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
+ WORD wStatus = db_get_w(hContact, szModuleName, szSettingName, ID_STATUS_OFFLINE);
TCHAR *szStatus = (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)wStatus, GSMDF_TCHAR);
_tcsncpy(buff,szStatus, bufflen);
buff[bufflen - 1] = 0;
@@ -168,7 +168,7 @@ TCHAR *WordToStatusDesc(HANDLE hContact, const char *szModuleName, const char *s TCHAR *ByteToYesNo(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
DBVARIANT dbv;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (dbv.type == DBVT_BYTE)
{
@@ -177,17 +177,17 @@ TCHAR *ByteToYesNo(HANDLE hContact, const char *szModuleName, const char *szSett else
_tcsncpy(buff, _T("No"), bufflen);
buff[bufflen - 1] = 0;
- DBFreeVariant(&dbv);
+ db_free(&dbv);
return buff;
}
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
TCHAR *ByteToGender(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- BYTE val = (BYTE)DBGetContactSettingByte(hContact, szModuleName, szSettingName, 0);
+ BYTE val = (BYTE)db_get_b(hContact, szModuleName, szSettingName, 0);
if (val == 'F')
_tcsncpy(buff, TranslateT("Female"), bufflen);
else if (val == 'M')
@@ -202,7 +202,7 @@ TCHAR *ByteToGender(HANDLE hContact, const char *szModuleName, const char *szSet TCHAR *WordToCountry(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
char *szCountryName = 0;
- WORD cid = (WORD)DBGetContactSettingWord(hContact, szModuleName, szSettingName, (WORD)-1);
+ WORD cid = (WORD)db_get_w(hContact, szModuleName, szSettingName, (WORD)-1);
if (cid != (WORD)-1 && ServiceExists(MS_UTILS_GETCOUNTRYBYNUMBER) && (szCountryName = (char *)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, cid, 0)) != 0)
{
if (strcmp(szCountryName, "Unknown") == 0)
@@ -216,7 +216,7 @@ TCHAR *WordToCountry(HANDLE hContact, const char *szModuleName, const char *szSe TCHAR *DwordToIp(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- DWORD ip = DBGetContactSettingDword(hContact, szModuleName, szSettingName, 0);
+ DWORD ip = db_get_dw(hContact, szModuleName, szSettingName, 0);
if (ip) {
unsigned char *ipc = (unsigned char*)&ip;
mir_sntprintf(buff, bufflen, _T("%u.%u.%u.%u"), ipc[3], ipc[2], ipc[1], ipc[0]);
@@ -249,26 +249,26 @@ TCHAR *DayMonthYearToDate(HANDLE hContact, const char *szModuleName, const char DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sDay", prefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMonth", prefix);
int month = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sYear", prefix);
int year = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SYSTEMTIME st = {0};
st.wDay = day;
@@ -279,15 +279,15 @@ TCHAR *DayMonthYearToDate(HANDLE hContact, const char *szModuleName, const char return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -297,26 +297,26 @@ TCHAR *DayMonthYearToAge(HANDLE hContact, const char *szModuleName, const char * DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
int month = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sYear", szPrefix);
int year = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SYSTEMTIME now;
GetLocalTime(&now);
@@ -328,15 +328,15 @@ TCHAR *DayMonthYearToAge(HANDLE hContact, const char *szModuleName, const char * return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -346,25 +346,25 @@ TCHAR *HoursMinutesSecondsToTime(HANDLE hContact, const char *szModuleName, cons DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
int minutes = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sSeconds", szPrefix);
int seconds = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
GetInt(dbv, &seconds);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
SYSTEMTIME st = {0};
@@ -376,11 +376,11 @@ TCHAR *HoursMinutesSecondsToTime(HANDLE hContact, const char *szModuleName, cons return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -390,19 +390,19 @@ TCHAR *HoursMinutesToTime(HANDLE hContact, const char *szModuleName, const char DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
int minutes = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
SYSTEMTIME st = {0};
st.wHour = hours;
@@ -412,11 +412,11 @@ TCHAR *HoursMinutesToTime(HANDLE hContact, const char *szModuleName, const char return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -426,46 +426,46 @@ TCHAR *DmyToTimeDifference(HANDLE hContact, const char *szModuleName, const char DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
int month = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sYear", szPrefix);
int year = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &year))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sHours", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int hours = 0;
if (GetInt(dbv, &hours))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMinutes", szPrefix);
int minutes = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &minutes))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sSeconds", szPrefix);
int seconds = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
GetInt(dbv, &seconds);
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
SYSTEMTIME st = {0}, st_now;
@@ -502,23 +502,23 @@ TCHAR *DmyToTimeDifference(HANDLE hContact, const char *szModuleName, const char return buff;
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
else
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
return 0;
}
@@ -528,19 +528,19 @@ TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, c DBVARIANT dbv;
char szSettingName[256];
mir_snprintf(szSettingName, 256, "%sDay", szPrefix);
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
int day = 0;
if (GetInt(dbv, &day))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
mir_snprintf(szSettingName, 256, "%sMonth", szPrefix);
int month = 0;
- if (!DBGetContactSetting(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get(hContact, szModuleName, szSettingName, &dbv))
{
if (GetInt(dbv, &month))
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
time_t now = time(NULL);
struct tm *ti = localtime(&now);
int yday_now = ti->tm_yday;
@@ -563,13 +563,13 @@ TCHAR *DayMonthToDaysToNextBirthday(HANDLE hContact, const char *szModuleName, c }
else
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
}
else
{
- DBFreeVariant(&dbv);
+ db_free(&dbv);
}
}
return 0;
@@ -585,7 +585,7 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons // translate jabber mood
if (ProtoServiceExists(szModuleName, "/SendXML")) // jabber protocol?
{
- if (!DBGetContactSettingTString(hContact, szModuleName, szSettingName, &dbv))
+ if (!db_get_ts(hContact, szModuleName, szSettingName, &dbv))
{
_tcsncpy(buff, TranslateTS(dbv.ptszVal), bufflen);
buff[bufflen - 1] = 0;
@@ -596,7 +596,7 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons if (NullTranslation(hContact, szModuleName, szSettingName, buff, bufflen))
return buff;
- int status = DBGetContactSettingByte(hContact, szModuleName, "XStatusId", 0);
+ int status = db_get_b(hContact, szModuleName, "XStatusId", 0);
if (!status) return 0;
if (ProtoServiceExists(szModuleName, PS_GETCUSTOMSTATUSEX))
@@ -618,7 +618,7 @@ TCHAR *EmptyXStatusToDefaultName(HANDLE hContact, const char *szModuleName, cons TCHAR *TimezoneToTime(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- int timezone = DBGetContactSettingByte(hContact,szModuleName,szSettingName,256);
+ int timezone = db_get_b(hContact,szModuleName,szSettingName,256);
if (timezone==256 || (char)timezone==-100)
return 0;
@@ -643,7 +643,7 @@ TCHAR *TimezoneToTime(HANDLE hContact, const char *szModuleName, const char *szS TCHAR *ByteToDay(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- int iDay = DBGetContactSettingWord(hContact, szModuleName, szSettingName, -1);
+ int iDay = db_get_w(hContact, szModuleName, szSettingName, -1);
if (iDay > -1 && iDay < 7)
{
a2t(Translate(days[iDay]), buff, bufflen);
@@ -656,7 +656,7 @@ TCHAR *ByteToDay(HANDLE hContact, const char *szModuleName, const char *szSettin TCHAR *ByteToMonth(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- int iMonth = DBGetContactSettingWord(hContact, szModuleName, szSettingName, 0);
+ int iMonth = db_get_w(hContact, szModuleName, szSettingName, 0);
if (iMonth > 0 && iMonth < 13)
{
a2t(Translate(months[iMonth - 1]), buff, bufflen);
@@ -669,7 +669,7 @@ TCHAR *ByteToMonth(HANDLE hContact, const char *szModuleName, const char *szSett TCHAR *ByteToLanguage(HANDLE hContact, const char *szModuleName, const char *szSettingName, TCHAR *buff, int bufflen)
{
- int iLang = DBGetContactSettingByte(hContact, szModuleName, szSettingName, 0);
+ int iLang = db_get_b(hContact, szModuleName, szSettingName, 0);
if (iLang)
{
for (int i = 0; i < SIZEOF(languages); i++)
@@ -725,7 +725,7 @@ static DBVTranslation internalTranslations[] = void InitTranslations()
{
- dwNextFuncId = DBGetContactSettingDword(0, MODULE_ITEMS, "NextFuncId", 1);
+ dwNextFuncId = db_get_dw(0, MODULE_ITEMS, "NextFuncId", 1);
for (int i = 0; i < SIZEOF(internalTranslations); i++)
AddTranslation( &internalTranslations[i] );
|