summaryrefslogtreecommitdiff
path: root/plugins/wbOSD/src/options.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/wbOSD/src/options.cpp')
-rw-r--r--plugins/wbOSD/src/options.cpp180
1 files changed, 90 insertions, 90 deletions
diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp
index cea0f87793..9136649854 100644
--- a/plugins/wbOSD/src/options.cpp
+++ b/plugins/wbOSD/src/options.cpp
@@ -103,53 +103,53 @@ void loadDBSettings(plgsettings *ps)
{
logmsg("loadDBSettings");
- ps->align = db_get_b(NULL, MODULENAME, "align", DEFAULT_ALIGN);
- ps->salign = db_get_b(NULL, MODULENAME, "salign", DEFAULT_SALIGN);
- ps->altShadow = db_get_b(NULL, MODULENAME, "altShadow", DEFAULT_ALTSHADOW);
- ps->transparent = db_get_b(NULL, MODULENAME, "transparent", DEFAULT_TRANPARENT);
- ps->showShadow = db_get_b(NULL, MODULENAME, "showShadow", DEFAULT_SHOWSHADOW);
- ps->messages = db_get_b(NULL, MODULENAME, "messages", DEFAULT_ANNOUNCEMESSAGES);
- ps->a_user = db_get_b(NULL, MODULENAME, "a_user", DEFAULT_ANNOUNCESTATUS);
- ps->distance = db_get_b(NULL, MODULENAME, "distance", DEFAULT_DISTANCE);
- ps->winx = db_get_dw(NULL, MODULENAME, "winx", DEFAULT_WINX);
- ps->winy = db_get_dw(NULL, MODULENAME, "winy", DEFAULT_WINY);
- ps->winxpos = db_get_dw(NULL, MODULENAME, "winxpos", DEFAULT_WINXPOS);
- ps->winypos = db_get_dw(NULL, MODULENAME, "winypos", DEFAULT_WINYPOS);
- ps->alpha = db_get_b(NULL, MODULENAME, "alpha", DEFAULT_ALPHA);
- ps->showmystatus = db_get_b(NULL, MODULENAME, "showMyStatus", DEFAULT_SHOWMYSTATUS);
- ps->timeout = db_get_dw(NULL, MODULENAME, "timeout", DEFAULT_TIMEOUT);
- ps->clr_msg = db_get_dw(NULL, MODULENAME, "clr_msg", DEFAULT_CLRMSG);
- ps->clr_status = db_get_dw(NULL, MODULENAME, "clr_status", DEFAULT_CLRSTATUS);
- ps->clr_shadow = db_get_dw(NULL, MODULENAME, "clr_shadow", DEFAULT_CLRSHADOW);
- ps->bkclr = db_get_dw(NULL, MODULENAME, "bkclr", DEFAULT_BKCLR);
-
- ps->showMsgWindow = db_get_b(NULL, MODULENAME, "showMessageWindow", DEFAULT_SHOWMSGWIN);
- ps->showWhen = db_get_dw(NULL, MODULENAME, "showWhen", DEFAULT_SHOWWHEN);
+ ps->align = g_plugin.getByte("align", DEFAULT_ALIGN);
+ ps->salign = g_plugin.getByte("salign", DEFAULT_SALIGN);
+ ps->altShadow = g_plugin.getByte("altShadow", DEFAULT_ALTSHADOW);
+ ps->transparent = g_plugin.getByte("transparent", DEFAULT_TRANPARENT);
+ ps->showShadow = g_plugin.getByte("showShadow", DEFAULT_SHOWSHADOW);
+ ps->messages = g_plugin.getByte("messages", DEFAULT_ANNOUNCEMESSAGES);
+ ps->a_user = g_plugin.getByte("a_user", DEFAULT_ANNOUNCESTATUS);
+ ps->distance = g_plugin.getByte("distance", DEFAULT_DISTANCE);
+ ps->winx = g_plugin.getDword("winx", DEFAULT_WINX);
+ ps->winy = g_plugin.getDword("winy", DEFAULT_WINY);
+ ps->winxpos = g_plugin.getDword("winxpos", DEFAULT_WINXPOS);
+ ps->winypos = g_plugin.getDword("winypos", DEFAULT_WINYPOS);
+ ps->alpha = g_plugin.getByte("alpha", DEFAULT_ALPHA);
+ ps->showmystatus = g_plugin.getByte("showMyStatus", DEFAULT_SHOWMYSTATUS);
+ ps->timeout = g_plugin.getDword("timeout", DEFAULT_TIMEOUT);
+ ps->clr_msg = g_plugin.getDword("clr_msg", DEFAULT_CLRMSG);
+ ps->clr_status = g_plugin.getDword("clr_status", DEFAULT_CLRSTATUS);
+ ps->clr_shadow = g_plugin.getDword("clr_shadow", DEFAULT_CLRSHADOW);
+ ps->bkclr = g_plugin.getDword("bkclr", DEFAULT_BKCLR);
+
+ ps->showMsgWindow = g_plugin.getByte("showMessageWindow", DEFAULT_SHOWMSGWIN);
+ ps->showWhen = g_plugin.getDword("showWhen", DEFAULT_SHOWWHEN);
DBVARIANT dbv;
- if (!db_get_ws(NULL, MODULENAME, "message_format", &dbv)) {
+ if (!g_plugin.getWString("message_format", &dbv)) {
mir_wstrcpy(ps->msgformat, dbv.pwszVal);
db_free(&dbv);
}
else mir_wstrcpy(ps->msgformat, DEFAULT_MESSAGEFORMAT);
- ps->announce = db_get_dw(NULL, MODULENAME, "announce", DEFAULT_ANNOUNCE);
-
- ps->lf.lfHeight = db_get_dw(NULL, MODULENAME, "fntHeight", DEFAULT_FNT_HEIGHT);
- ps->lf.lfWidth = db_get_dw(NULL, MODULENAME, "fntWidth", DEFAULT_FNT_WIDTH);
- ps->lf.lfEscapement = db_get_dw(NULL, MODULENAME, "fntEscapement", DEFAULT_FNT_ESCAPEMENT);
- ps->lf.lfOrientation = db_get_dw(NULL, MODULENAME, "fntOrientation", DEFAULT_FNT_ORIENTATION);
- ps->lf.lfWeight = db_get_dw(NULL, MODULENAME, "fntWeight", DEFAULT_FNT_WEIGHT);
- ps->lf.lfItalic = db_get_b(NULL, MODULENAME, "fntItalic", DEFAULT_FNT_ITALIC);
- ps->lf.lfUnderline = db_get_b(NULL, MODULENAME, "fntUnderline", DEFAULT_FNT_UNDERLINE);
- ps->lf.lfStrikeOut = db_get_b(NULL, MODULENAME, "fntStrikeout", DEFAULT_FNT_STRIKEOUT);
- ps->lf.lfCharSet = db_get_b(NULL, MODULENAME, "fntCharSet", DEFAULT_FNT_CHARSET);
- ps->lf.lfOutPrecision = db_get_b(NULL, MODULENAME, "fntOutPrecision", DEFAULT_FNT_OUTPRECISION);
- ps->lf.lfClipPrecision = db_get_b(NULL, MODULENAME, "fntClipPrecision", DEFAULT_FNT_CLIPRECISION);
- ps->lf.lfQuality = db_get_b(NULL, MODULENAME, "fntQuality", DEFAULT_FNT_QUALITY);
- ps->lf.lfPitchAndFamily = db_get_b(NULL, MODULENAME, "fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM);
-
- if (!db_get_ws(NULL, MODULENAME, "fntFaceName", &dbv)) {
+ ps->announce = g_plugin.getDword("announce", DEFAULT_ANNOUNCE);
+
+ ps->lf.lfHeight = g_plugin.getDword("fntHeight", DEFAULT_FNT_HEIGHT);
+ ps->lf.lfWidth = g_plugin.getDword("fntWidth", DEFAULT_FNT_WIDTH);
+ ps->lf.lfEscapement = g_plugin.getDword("fntEscapement", DEFAULT_FNT_ESCAPEMENT);
+ ps->lf.lfOrientation = g_plugin.getDword("fntOrientation", DEFAULT_FNT_ORIENTATION);
+ ps->lf.lfWeight = g_plugin.getDword("fntWeight", DEFAULT_FNT_WEIGHT);
+ ps->lf.lfItalic = g_plugin.getByte("fntItalic", DEFAULT_FNT_ITALIC);
+ ps->lf.lfUnderline = g_plugin.getByte("fntUnderline", DEFAULT_FNT_UNDERLINE);
+ ps->lf.lfStrikeOut = g_plugin.getByte("fntStrikeout", DEFAULT_FNT_STRIKEOUT);
+ ps->lf.lfCharSet = g_plugin.getByte("fntCharSet", DEFAULT_FNT_CHARSET);
+ ps->lf.lfOutPrecision = g_plugin.getByte("fntOutPrecision", DEFAULT_FNT_OUTPRECISION);
+ ps->lf.lfClipPrecision = g_plugin.getByte("fntClipPrecision", DEFAULT_FNT_CLIPRECISION);
+ ps->lf.lfQuality = g_plugin.getByte("fntQuality", DEFAULT_FNT_QUALITY);
+ ps->lf.lfPitchAndFamily = g_plugin.getByte("fntPitchAndFamily", DEFAULT_FNT_PITCHANDFAM);
+
+ if (!g_plugin.getWString("fntFaceName", &dbv)) {
mir_wstrcpy(ps->lf.lfFaceName, dbv.pwszVal);
db_free(&dbv);
}
@@ -161,52 +161,52 @@ void saveDBSettings(plgsettings *ps)
{
logmsg("saveDBSettings");
- db_set_b(NULL, MODULENAME, "showShadow", ps->showShadow);
- db_set_b(NULL, MODULENAME, "altShadow", ps->altShadow);
- db_set_b(NULL, MODULENAME, "distance", ps->distance);
-
- db_set_dw(NULL, MODULENAME, "winx", ps->winx);
- db_set_dw(NULL, MODULENAME, "winy", ps->winy);
- db_set_dw(NULL, MODULENAME, "winxpos", ps->winxpos);
- db_set_dw(NULL, MODULENAME, "winypos", ps->winypos);
-
- db_set_b(NULL, MODULENAME, "alpha", ps->alpha);
- db_set_dw(NULL, MODULENAME, "timeout", ps->timeout);
-
- db_set_b(NULL, MODULENAME, "transparent", ps->transparent);
- db_set_b(NULL, MODULENAME, "messages", ps->messages);
- db_set_b(NULL, MODULENAME, "a_user", ps->a_user);
- db_set_ws(NULL, MODULENAME, "message_format", ps->msgformat);
-
- db_set_b(NULL, MODULENAME, "align", ps->align);
- db_set_b(NULL, MODULENAME, "salign", ps->salign);
-
- db_set_b(NULL, MODULENAME, "showMyStatus", ps->showmystatus);
-
- db_set_dw(NULL, MODULENAME, "clr_msg", ps->clr_msg);
- db_set_dw(NULL, MODULENAME, "clr_shadow", ps->clr_shadow);
- db_set_dw(NULL, MODULENAME, "clr_status", ps->clr_status);
- db_set_dw(NULL, MODULENAME, "bkclr", ps->bkclr);
-
- db_set_dw(NULL, MODULENAME, "fntHeight", ps->lf.lfHeight);
- db_set_dw(NULL, MODULENAME, "fntWidth", ps->lf.lfWidth);
- db_set_dw(NULL, MODULENAME, "fntEscapement", ps->lf.lfEscapement);
- db_set_dw(NULL, MODULENAME, "fntOrientation", ps->lf.lfOrientation);
- db_set_dw(NULL, MODULENAME, "fntWeight", ps->lf.lfWeight);
- db_set_b(NULL, MODULENAME, "fntItalic", ps->lf.lfItalic);
- db_set_b(NULL, MODULENAME, "fntUnderline", ps->lf.lfUnderline);
- db_set_b(NULL, MODULENAME, "fntStrikeout", ps->lf.lfStrikeOut);
- db_set_b(NULL, MODULENAME, "fntCharSet", ps->lf.lfCharSet);
- db_set_b(NULL, MODULENAME, "fntOutPrecision", ps->lf.lfOutPrecision);
- db_set_b(NULL, MODULENAME, "fntClipPrecision", ps->lf.lfClipPrecision);
- db_set_b(NULL, MODULENAME, "fntQuality", ps->lf.lfQuality);
- db_set_b(NULL, MODULENAME, "fntPitchAndFamily", ps->lf.lfPitchAndFamily);
- db_set_ws(NULL, MODULENAME, "fntFaceName", ps->lf.lfFaceName);
-
- db_set_dw(NULL, MODULENAME, "announce", ps->announce);
-
- db_set_b(NULL, MODULENAME, "showMessageWindow", ps->showMsgWindow);
- db_set_dw(NULL, MODULENAME, "showWhen", ps->showWhen);
+ g_plugin.setByte("showShadow", ps->showShadow);
+ g_plugin.setByte("altShadow", ps->altShadow);
+ g_plugin.setByte("distance", ps->distance);
+
+ g_plugin.setDword("winx", ps->winx);
+ g_plugin.setDword("winy", ps->winy);
+ g_plugin.setDword("winxpos", ps->winxpos);
+ g_plugin.setDword("winypos", ps->winypos);
+
+ g_plugin.setByte("alpha", ps->alpha);
+ g_plugin.setDword("timeout", ps->timeout);
+
+ g_plugin.setByte("transparent", ps->transparent);
+ g_plugin.setByte("messages", ps->messages);
+ g_plugin.setByte("a_user", ps->a_user);
+ g_plugin.setWString("message_format", ps->msgformat);
+
+ g_plugin.setByte("align", ps->align);
+ g_plugin.setByte("salign", ps->salign);
+
+ g_plugin.setByte("showMyStatus", ps->showmystatus);
+
+ g_plugin.setDword("clr_msg", ps->clr_msg);
+ g_plugin.setDword("clr_shadow", ps->clr_shadow);
+ g_plugin.setDword("clr_status", ps->clr_status);
+ g_plugin.setDword("bkclr", ps->bkclr);
+
+ g_plugin.setDword("fntHeight", ps->lf.lfHeight);
+ g_plugin.setDword("fntWidth", ps->lf.lfWidth);
+ g_plugin.setDword("fntEscapement", ps->lf.lfEscapement);
+ g_plugin.setDword("fntOrientation", ps->lf.lfOrientation);
+ g_plugin.setDword("fntWeight", ps->lf.lfWeight);
+ g_plugin.setByte("fntItalic", ps->lf.lfItalic);
+ g_plugin.setByte("fntUnderline", ps->lf.lfUnderline);
+ g_plugin.setByte("fntStrikeout", ps->lf.lfStrikeOut);
+ g_plugin.setByte("fntCharSet", ps->lf.lfCharSet);
+ g_plugin.setByte("fntOutPrecision", ps->lf.lfOutPrecision);
+ g_plugin.setByte("fntClipPrecision", ps->lf.lfClipPrecision);
+ g_plugin.setByte("fntQuality", ps->lf.lfQuality);
+ g_plugin.setByte("fntPitchAndFamily", ps->lf.lfPitchAndFamily);
+ g_plugin.setWString("fntFaceName", ps->lf.lfFaceName);
+
+ g_plugin.setDword("announce", ps->announce);
+
+ g_plugin.setByte("showMessageWindow", ps->showMsgWindow);
+ g_plugin.setDword("showWhen", ps->showWhen);
}
INT_PTR CALLBACK OptDlgProc(HWND hDlg, UINT msg, WPARAM wparam, LPARAM lparam)
@@ -364,9 +364,9 @@ xxx:
saveDBSettings(ps);
SetWindowPos(g_hWnd, nullptr, 0, 0, ps->winx, ps->winy, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
SetLayeredWindowAttributes(g_hWnd,
- db_get_dw(NULL, MODULENAME, "bkclr", DEFAULT_BKCLR),
- db_get_b(NULL, MODULENAME, "alpha", DEFAULT_ALPHA),
- (db_get_b(NULL, MODULENAME, "transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
+ g_plugin.getDword("bkclr", DEFAULT_BKCLR),
+ g_plugin.getByte("alpha", DEFAULT_ALPHA),
+ (g_plugin.getByte("transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
InvalidateRect(g_hWnd, nullptr, TRUE);
SendMessage(GetParent(hDlg), PSM_CHANGED, 0, 0);
@@ -397,7 +397,7 @@ xxx:
ps[1] = ps[0]; //apply current settings at closing
saveDBSettings(ps);
- SetLayeredWindowAttributes(g_hWnd, db_get_dw(NULL, MODULENAME, "bkclr", DEFAULT_BKCLR), db_get_b(NULL, MODULENAME, "alpha", DEFAULT_ALPHA), (db_get_b(NULL, MODULENAME, "transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
+ SetLayeredWindowAttributes(g_hWnd, g_plugin.getDword("bkclr", DEFAULT_BKCLR), g_plugin.getByte("alpha", DEFAULT_ALPHA), (g_plugin.getByte("transparent", DEFAULT_TRANPARENT) ? LWA_COLORKEY : 0) | LWA_ALPHA);
InvalidateRect(g_hWnd, nullptr, TRUE);
break;
}