diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-22 18:30:42 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-22 18:30:42 +0300 |
commit | 8557d288376ccc87bd54f2a76c99f77115949f02 (patch) | |
tree | fdb3f8cac9215adc4493d26abb935bd5c1f54b2e | |
parent | feac2b1a6a79c9d0bb58b0825ec2a776b888f9ce (diff) |
m_fontservice.h => CMPlugin
35 files changed, 155 insertions, 102 deletions
diff --git a/include/m_fontservice.h b/include/m_fontservice.h index 4f6f0f264d..7910be2ba7 100644 --- a/include/m_fontservice.h +++ b/include/m_fontservice.h @@ -97,8 +97,8 @@ struct FontIDW };
// register a font
-EXTERN_C MIR_APP_DLL(int) Font_Register(FontID *pFont, int = hLangpack);
-EXTERN_C MIR_APP_DLL(int) Font_RegisterW(FontIDW *pFont, int = hLangpack);
+EXTERN_C MIR_APP_DLL(int) Font_Register(FontID *pFont, int langId);
+EXTERN_C MIR_APP_DLL(int) Font_RegisterW(FontIDW *pFont, int langId);
// get a font
// will fill the logfont structure passed in with the user's choices, or the default if it was set and the user has not chosen a font yet,
@@ -161,8 +161,8 @@ struct ColourIDW // [note - a colour with name 'Background' [translated!] has special meaning and will be used as the background colour of
// the font list box in the options, for the given group]
-EXTERN_C MIR_APP_DLL(int) Colour_Register(ColourID *pFont, int = hLangpack);
-EXTERN_C MIR_APP_DLL(int) Colour_RegisterW(ColourIDW *pFont, int = hLangpack);
+EXTERN_C MIR_APP_DLL(int) Colour_Register(ColourID *pFont, int langId);
+EXTERN_C MIR_APP_DLL(int) Colour_RegisterW(ColourIDW *pFont, int langId);
// get a colour
EXTERN_C MIR_APP_DLL(COLORREF) Colour_Get(const char *szGroup, const char *szName);
@@ -221,8 +221,8 @@ struct EffectIDW // wparam = (EffectID *)&effect_id
// lparam = 0
-EXTERN_C MIR_APP_DLL(int) Effect_Register(EffectID *pEffect, int = hLangpack);
-EXTERN_C MIR_APP_DLL(int) Effect_RegisterW(EffectIDW *pEffect, int = hLangpack);
+EXTERN_C MIR_APP_DLL(int) Effect_Register(EffectID *pEffect, int langId);
+EXTERN_C MIR_APP_DLL(int) Effect_RegisterW(EffectIDW *pEffect, int langId);
// get a effect
// wparam = (EffectID *)&effect_id (only name and group matter)
diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 280f34eacf..50ce94b720 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -205,6 +205,15 @@ public: HGENMENU addRootMenu(int hMenuObject, LPCWSTR ptszName, int position, HANDLE hIcoLib = nullptr);
+ int addFont(struct FontID *pFont);
+ int addFont(struct FontIDW *pFont);
+
+ int addColor(struct ColourID *pColor);
+ int addColor(struct ColourIDW *pColor);
+
+ int addEffect(struct EffectID *pEffect);
+ int addEffect(struct EffectIDW *pEffect);
+
int addHotkey(const struct HOTKEYDESC*);
int addSound(const char *name, const wchar_t *section, const wchar_t *description, const wchar_t *defaultFile = nullptr);
int addUserInfo(WPARAM wParam, struct OPTIONSDIALOGPAGE *odp);
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 4363e27b1c..eb58b07d19 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex 30f7aad8af..d0f643e582 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/Alarms/src/alarm_win.cpp b/plugins/Alarms/src/alarm_win.cpp index 940f9857a7..83cd180c2b 100644 --- a/plugins/Alarms/src/alarm_win.cpp +++ b/plugins/Alarms/src/alarm_win.cpp @@ -356,7 +356,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) wcsncpy_s(title_font_id.backgroundName, LPGENW("Background"), _TRUNCATE);
title_font_id.flags = 0;
title_font_id.order = 0;
- Font_RegisterW(&title_font_id);
+ g_plugin.addFont(&title_font_id);
window_font_id.cbSize = sizeof(FontIDW);
wcsncpy_s(window_font_id.group, LPGENW("Alarms"), _TRUNCATE);
@@ -367,7 +367,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) wcsncpy_s(window_font_id.backgroundName, LPGENW("Background"), _TRUNCATE);
window_font_id.flags = 0;
window_font_id.order = 1;
- Font_RegisterW(&window_font_id);
+ g_plugin.addFont(&window_font_id);
bk_colour_id.cbSize = sizeof(ColourIDW);
strncpy_s(bk_colour_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
@@ -378,7 +378,7 @@ int AlarmWinModulesLoaded(WPARAM, LPARAM) bk_colour_id.flags = 0;
bk_colour_id.order = 0;
- Colour_RegisterW(&bk_colour_id);
+ g_plugin.addColor(&bk_colour_id);
ReloadFonts(0, 0);
HookEvent(ME_FONT_RELOAD, ReloadFonts);
diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index f9c435a518..e756521f6d 100755 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -561,7 +561,7 @@ int CreateFrame() strncpy_s(font_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
strncpy_s(font_id.prefix, "Font", _TRUNCATE);
font_id.order = 0;
- Font_Register(&font_id);
+ g_plugin.addFont(&font_id);
framebk_colour_id.cbSize = sizeof(ColourID);
strncpy_s(framebk_colour_id.dbSettingsGroup, MODULENAME, _TRUNCATE);
@@ -571,7 +571,7 @@ int CreateFrame() framebk_colour_id.defcolour = GetSysColor(COLOR_3DFACE);
framebk_colour_id.flags = 0;
framebk_colour_id.order = 0;
- Colour_Register(&framebk_colour_id);
+ g_plugin.addColor(&framebk_colour_id);
LOGFONTA log_font;
fontColour = Font_Get(font_id, &log_font);
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index ce179545b3..53df988ec1 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -471,7 +471,7 @@ void CreateFrame() wcscpy_s(colourid.group, _A2W(MODULENAME));
colourid.defcolour = GetSysColor(COLOR_3DFACE);
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
HookEvent(ME_COLOUR_RELOAD, ReloadColors);
ReloadColors(0, 0);
diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 839a42fcd4..907d13bd35 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -251,7 +251,7 @@ void Options::Load(void) wcsncpy_s(fid.name, g_FontOptionsList[i].szDescr, _TRUNCATE);
wcsncpy_s(fid.backgroundName, g_FontOptionsList[i].szBackgroundName, _TRUNCATE);
fid.flags = FIDF_DEFAULTVALID | FIDF_CLASSGENERAL | g_FontOptionsList[i].flags;
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
}
strncpy_s(cid.dbSettingsGroup, "BasicHistory_Fonts", _TRUNCATE);
@@ -261,7 +261,7 @@ void Options::Load(void) mir_snprintf(cid.setting, _countof(cid.setting), "Color%d", i);
cid.order = i;
cid.defcolour = g_ColorOptionsList[i].def;
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
}
hid.dwFlags = HKD_UNICODE;
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 857b661cb3..ea10ddea87 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -150,7 +150,7 @@ void RegisterCLUIFonts(void) fontid.deffontsettings.style = fontOptionsList[i].defStyle;
mir_wstrncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
mir_wstrncpy(effectid.group, fontOptionsList[i].szGroup, _countof(effectid.group));
mir_wstrncpy(effectid.name, fontOptionsList[i].szDescr, _countof(effectid.name));
@@ -162,7 +162,7 @@ void RegisterCLUIFonts(void) effectid.defeffect.baseColour = fontOptionsList[i].defeffect.baseColour;
effectid.defeffect.secondaryColour = fontOptionsList[i].defeffect.secondaryColour;
- Effect_RegisterW(&effectid);
+ g_plugin.addEffect(&effectid);
}
ColourIDW colourid = { 0 };
@@ -175,7 +175,7 @@ void RegisterCLUIFonts(void) mir_strncpy(colourid.dbSettingsGroup, colourOptionsList[i].chGroup, _countof(colourid.dbSettingsGroup));
colourid.defcolour = colourOptionsList[i].defColour;
colourid.order = i + 1;
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
}
registered = true;
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index fbcb46ddc0..93ef355b69 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -1899,7 +1899,7 @@ void FS_RegisterFonts() mir_snprintf(idstr, "Font%d", i); strncpy(fid.prefix, idstr, _countof(fid.prefix)); fid.order = i; - Font_RegisterW(&fid); + g_plugin.addFont(&fid); } ReleaseDC(nullptr, hdc); @@ -1913,30 +1913,30 @@ void FS_RegisterFonts() wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name)); wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group)); colourid.defcolour = CLCDEFAULT_BKCOLOUR; - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR; - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR; - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR; - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); strncpy(colourid.dbSettingsGroup, "CLUI", sizeof(colourid.dbSettingsGroup)); strncpy(colourid.setting, "clr_frameborder", sizeof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Embedded frames border"), _countof(colourid.name)); colourid.order = 1; colourid.defcolour = RGB(40, 40, 40); - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); } diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 566e307791..0d317a5615 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -1115,7 +1115,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) fid.deffontsettings.size = 10;
fid.deffontsettings.style = 0;
mir_wstrncpy(fid.deffontsettings.szFace, L"Courier", _countof(fid.deffontsettings.szFace));
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
HookEvent(ME_FONT_RELOAD, OnFontChange);
@@ -1126,7 +1126,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) mir_strncpy(cid.dbSettingsGroup, "Console", _countof(cid.dbSettingsGroup));
mir_strncpy(cid.setting, "BgColor", _countof(cid.setting));
cid.defcolour = RGB(255, 255, 255);
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
HookEvent(ME_COLOUR_RELOAD, OnColourChange);
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index 896a1c61ab..1d989d81f4 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -174,13 +174,13 @@ int ProcessModulesLoaded(WPARAM, LPARAM) strncpy_s(fontid.prefix, "fntName", _TRUNCATE);
fontid.deffontsettings.colour = GetSysColor(COLOR_MENUTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
wcsncpy_s(fontid.name, LPGENW("Second line"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntSecond", _TRUNCATE);
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_MENUTEXT), GetSysColor(COLOR_MENU));
fontid.deffontsettings.style = 0;
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
wcsncpy_s(fontid.backgroundName, LPGENW("Selected background"), _TRUNCATE);
@@ -188,13 +188,13 @@ int ProcessModulesLoaded(WPARAM, LPARAM) strncpy_s(fontid.prefix, "fntNameSel", _TRUNCATE);
fontid.deffontsettings.colour = GetSysColor(COLOR_HIGHLIGHTTEXT);
fontid.deffontsettings.style = DBFONTF_BOLD;
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
wcsncpy_s(fontid.name, LPGENW("Selected second line (color)"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntSecondSel", _TRUNCATE);
fontid.deffontsettings.colour = sttShadeColor(GetSysColor(COLOR_HIGHLIGHTTEXT), GetSysColor(COLOR_HIGHLIGHT));
fontid.deffontsettings.style = 0;
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
/////////////////////////////////////////////////////////////////////////////////////
@@ -205,12 +205,12 @@ int ProcessModulesLoaded(WPARAM, LPARAM) wcsncpy_s(colourid.name, LPGENW("Background"), _TRUNCATE);
strncpy_s(colourid.setting, "BackColour", _TRUNCATE);
colourid.defcolour = GetSysColor(COLOR_MENU);
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
wcsncpy_s(colourid.name, LPGENW("Selected background"), _TRUNCATE);
strncpy_s(colourid.setting, "SelectedColour", _TRUNCATE);
colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT);
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
HookEvent(ME_FONT_RELOAD, ProcessReloadFonts);
HookEvent(ME_COLOUR_RELOAD, ProcessReloadFonts);
diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index f6ba0111eb..42a2565445 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -225,8 +225,8 @@ int CreateFrame() {
HDC hdc = GetDC(nullptr);
- Colour_Register(&bg_colour);
- Colour_Register(&av_colour);
+ g_plugin.addColor(&bg_colour);
+ g_plugin.addColor(&av_colour);
ReloadColour(0, 0);
HookEvent(ME_COLOUR_RELOAD, ReloadColour);
@@ -249,7 +249,7 @@ int CreateFrame() mir_wstrncpy(font_id[i].deffontsettings.szFace, L"Tahoma", _countof(font_id[i].deffontsettings.szFace));
font_id[i].order = i;
font_id[i].flags = FIDF_DEFAULTVALID;
- Font_RegisterW(&font_id[i]);
+ g_plugin.addFont(&font_id[i]);
}
ReleaseDC(nullptr, hdc);
diff --git a/plugins/NotesAndReminders/src/options.cpp b/plugins/NotesAndReminders/src/options.cpp index 37773c7b03..3ab3c022a3 100644 --- a/plugins/NotesAndReminders/src/options.cpp +++ b/plugins/NotesAndReminders/src/options.cpp @@ -253,7 +253,7 @@ void RegisterFontServiceFonts() strncpy(fontid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fontid.deffontsettings.szFace));
strncpy(fontid.backgroundName, fontOptionsList[i].szBkgName, _countof(fontid.backgroundName));
- Font_Register(&fontid);
+ g_plugin.addFont(&fontid);
}
ColourID colorid = { 0 };
@@ -269,7 +269,7 @@ void RegisterFontServiceFonts() colorid.defcolour = colourOptionsList[i].defColour;
strncpy(colorid.setting, colourOptionsList[i].szSettingName, _countof(colorid.setting));
- Colour_Register(&colorid);
+ g_plugin.addColor(&colorid);
}
hkFontChange = HookEvent(ME_FONT_RELOAD, FS_FontsChanged);
diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index 79e9e7942d..b994f24d1a 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -911,7 +911,7 @@ void InitList() font_id.deffontsettings.colour = RGB(255, 255, 255);
mir_wstrncpy(font_id.deffontsettings.szFace, L"Tahoma", _countof(font_id.deffontsettings.szFace));
- Font_RegisterW(&font_id);
+ g_plugin.addFont(&font_id);
bk_col_id.cbSize = sizeof(ColourIDW);
mir_wstrncpy(bk_col_id.group, L"Ping", _countof(bk_col_id.group));
@@ -919,7 +919,7 @@ void InitList() mir_strncpy(bk_col_id.dbSettingsGroup, "PING", _countof(bk_col_id.dbSettingsGroup));
mir_strncpy(bk_col_id.setting, "BgColor", _countof(bk_col_id.setting));
bk_col_id.defcolour = RGB(0, 0, 0);
- Colour_RegisterW(&bk_col_id);
+ g_plugin.addColor(&bk_col_id);
HookEvent(ME_FONT_RELOAD, ReloadFont);
diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index e499c65e25..92c260f856 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -43,27 +43,27 @@ void InitFonts() mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TITLE);
fid.deffontsettings.style = DBFONTF_BOLD;
fid.deffontsettings.colour = RGB(0, 0, 0);
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_CLOCK), _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK);
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_TEXT), _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TEXT);
fid.deffontsettings.style = 0;
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_ACTION), _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_ACTION);
fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS;
fid.deffontsettings.colour = RGB(0, 0, 255);
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
mir_wstrncpy(fid.name, _A2W(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name));
mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION);
fid.deffontsettings.style = DBFONTF_UNDERLINE;
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
ColourIDW cid = { 0 };
cid.cbSize = sizeof(ColourIDW);
@@ -73,12 +73,12 @@ void InitFonts() mir_wstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
mir_strncpy(cid.setting, PU_COL_BACK_SETTING, _countof(cid.setting));
cid.defcolour = SETTING_BACKCOLOUR_DEFAULT;
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
mir_wstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name));
mir_strncpy(cid.setting, PU_COL_AVAT_SETTING, _countof(cid.setting));
cid.defcolour = SETTING_TEXTCOLOUR_DEFAULT;
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
ReloadFonts();
}
diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 7aaf6dc615..1e2d97e7bc 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -196,7 +196,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) mir_snprintf(fontid.name, "%s (colors only)", notification->lpzName);
mir_snprintf(fontid.prefix, "{%s/%s}text", notification->lpzGroup, notification->lpzName);
fontid.deffontsettings.style = 0;
- Font_Register(&fontid);
+ g_plugin.addFont(&fontid);
ColourID colourid = { 0 };
colourid.cbSize = sizeof(colourid);
@@ -205,7 +205,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) mir_snprintf(colourid.name, "%s (colors only)", notification->lpzName);
mir_snprintf(colourid.setting, "{%s/%s}backColor", notification->lpzGroup, notification->lpzName);
colourid.defcolour = ptd->notification.colorBack;
- Colour_Register(&colourid);
+ g_plugin.addColor(&colourid);
gTreeData.insert(ptd);
return (HANDLE)ptd;
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 1e25a01b6e..e67dfd1dfa 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -393,7 +393,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol"
fid.deffontsettings.style = 0;
fid.deffontsettings.colour = fonts.clText;
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
// we ignore pc->colorBack and use fonts.clBack as default (if no setting found in DB)
mir_snprintf(setting, "%s/BgCol", ptd->pupClass.pszName);
@@ -405,7 +405,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) mir_wstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name));
mir_snprintf(cid.setting, "%s/BgCol", ptd->pupClass.pszName);
cid.defcolour = fonts.clBack;
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
gTreeData.insert(ptd);
num_classes++;
diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index c3af02c3b5..dc83dd1b7e 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -104,7 +104,7 @@ void RegisterFontServiceFonts() fid.deffontsettings.charset = DEFAULT_CHARSET;
wcsncpy(fid.deffontsettings.szFace, fontOptionsList[i].szDefFace, _countof(fid.deffontsettings.szFace));
wcsncpy(fid.backgroundName, fontOptionsList[i].szBkgName, _countof(fid.backgroundName));
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
}
ColourIDW cid = { sizeof(cid) };
@@ -120,7 +120,7 @@ void RegisterFontServiceFonts() cid.defcolour = colourOptionsList[i].defColour;
strncpy(cid.setting, colourOptionsList[i].szSettingName, _countof(cid.setting));
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
}
}
diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 6d0894c6b0..b4c44e9cf1 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -81,7 +81,7 @@ static int ModulesLoaded(WPARAM, LPARAM) strcpy_s(cid.name, LPGEN("Background color"));
strcpy_s(cid.setting, "SelWndBkgClr");
cid.defcolour = GetSysColor(COLOR_WINDOW);
- Colour_Register(&cid);
+ g_plugin.addColor(&cid);
return 0;
}
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 1cd74056a4..428b1bdfe7 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -547,7 +547,7 @@ void RegisterFontServiceFonts() wcsncpy(fid.backgroundName, LPGENW("Incoming background"), _countof(fid.backgroundName));
break;
}
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
}
fontOptionsList = IP_fontOptionsList;
@@ -572,7 +572,7 @@ void RegisterFontServiceFonts() wcsncpy(fid.backgroundName, L"", _countof(fid.backgroundName));
wcsncpy(fid.group, LPGENW("Message sessions"), _countof(fid.group));
}
- Font_RegisterW(&fid);
+ g_plugin.addFont(&fid);
}
wcsncpy(cid.group, LPGENW("Message sessions") L"/" LPGENW("Group chats"), _countof(cid.group));
@@ -592,18 +592,18 @@ void RegisterFontServiceFonts() cid.defcolour = RGB(0, 0, 0);
break;
}
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
}
cid.order++;
wcsncpy_s(cid.name, LPGENW("Nick list background"), _TRUNCATE);
strncpy_s(cid.setting, "ColorNicklistBG", _TRUNCATE);
cid.defcolour = SRMSGDEFSET_BKGCOLOUR;
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
cid.order++;
wcsncpy_s(cid.name, LPGENW("Group chat log background"), _TRUNCATE);
strncpy_s(cid.setting, "ColorLogBG", _TRUNCATE);
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
// static colors (info panel, tool bar background etc...)
strncpy(fid.dbSettingsGroup, FONTMODULE, _countof(fid.dbSettingsGroup));
@@ -618,7 +618,7 @@ void RegisterFontServiceFonts() cid.defcolour = GetSysColor(it.def & 0x000000ff);
else
cid.defcolour = it.def;
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
}
strncpy(cid.dbSettingsGroup, SRMSGMOD_T, _countof(fid.dbSettingsGroup));
@@ -634,7 +634,7 @@ void RegisterFontServiceFonts() else
cid.defcolour = it.def;
- Colour_RegisterW(&cid);
+ g_plugin.addColor(&cid);
}
}
diff --git a/plugins/TipperYM/src/tipper.cpp b/plugins/TipperYM/src/tipper.cpp index bef7a9ae51..bbdf9fa6f5 100644 --- a/plugins/TipperYM/src/tipper.cpp +++ b/plugins/TipperYM/src/tipper.cpp @@ -130,7 +130,7 @@ static void InitFonts() mir_strcpy(colourBg.setting, "ColourBg");
colourBg.defcolour = RGB(219, 219, 219);
colourBg.order = 0;
- Colour_RegisterW(&colourBg);
+ g_plugin.addColor(&colourBg);
colourBorder.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourBorder.group, LPGENW("Tooltips"));
@@ -139,7 +139,7 @@ static void InitFonts() mir_strcpy(colourBorder.setting, "BorderCol");
colourBorder.defcolour = 0;
colourBorder.order = 0;
- Colour_RegisterW(&colourBorder);
+ g_plugin.addColor(&colourBorder);
colourAvatarBorder.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourAvatarBorder.group, LPGENW("Tooltips"));
@@ -148,7 +148,7 @@ static void InitFonts() mir_strcpy(colourAvatarBorder.setting, "AvBorderCol");
colourAvatarBorder.defcolour = 0;
colourAvatarBorder.order = 0;
- Colour_RegisterW(&colourAvatarBorder);
+ g_plugin.addColor(&colourAvatarBorder);
colourDivider.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourDivider.group, LPGENW("Tooltips"));
@@ -157,7 +157,7 @@ static void InitFonts() mir_strcpy(colourDivider.setting, "DividerCol");
colourDivider.defcolour = 0;
colourDivider.order = 0;
- Colour_RegisterW(&colourDivider);
+ g_plugin.addColor(&colourDivider);
colourSidebar.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colourSidebar.group, LPGENW("Tooltips"));
@@ -166,7 +166,7 @@ static void InitFonts() mir_strcpy(colourSidebar.setting, "SidebarCol");
colourSidebar.defcolour = RGB(192, 192, 192);
colourSidebar.order = 0;
- Colour_RegisterW(&colourSidebar);
+ g_plugin.addColor(&colourSidebar);
fontTitle.cbSize = sizeof(FontIDW);
fontTitle.flags = FIDF_ALLOWEFFECTS;
@@ -232,10 +232,10 @@ static void InitFonts() fontTrayTitle.deffontsettings.colour = RGB(0, 0, 0);
fontTrayTitle.flags |= FIDF_DEFAULTVALID;
- Font_RegisterW(&fontTitle);
- Font_RegisterW(&fontLabels);
- Font_RegisterW(&fontValues);
- Font_RegisterW(&fontTrayTitle);
+ g_plugin.addFont(&fontTitle);
+ g_plugin.addFont(&fontLabels);
+ g_plugin.addFont(&fontValues);
+ g_plugin.addFont(&fontTrayTitle);
hReloadFonts = HookEvent(ME_FONT_RELOAD, ReloadFont);
}
diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 98d90b25cb..a70a3d5c85 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -95,11 +95,11 @@ void CTooltipNotify::RegisterFonts() wcsncpy(fontId.name, s_fontTable[i].name, _countof(fontId.name) - 1);
strncpy(fontId.prefix, s_fontTable[i].fontPrefix, _countof(fontId.prefix) - 1);
wcsncpy(fontId.backgroundName, s_fontTable[i].name, _countof(fontId.backgroundName) - 1);
- ::Font_RegisterW(&fontId);
+ ::g_plugin.addFont(&fontId);
wcsncpy(colorId.name, s_fontTable[i].name, _countof(colorId.name) - 1);
strncpy(colorId.setting, s_fontTable[i].clrPrefix, _countof(colorId.setting) - 1);
- ::Colour_RegisterW(&colorId);
+ ::g_plugin.addColor(&colorId);
}
}
diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 0f687b11d0..2de4bda8dc 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -1145,7 +1145,7 @@ static int TrafficCounterModulesLoaded(WPARAM, LPARAM) TrafficFontID.deffontsettings.style = 0;
mir_wstrcpy(TrafficFontID.deffontsettings.szFace, L"Arial");
TrafficFontID.order = 0;
- Font_RegisterW(&TrafficFontID);
+ g_plugin.addFont(&TrafficFontID);
// Регистрируем цвет фона
TrafficBackgroundColorID.cbSize = sizeof(ColourIDW);
@@ -1154,7 +1154,7 @@ static int TrafficCounterModulesLoaded(WPARAM, LPARAM) mir_strcpy(TrafficBackgroundColorID.dbSettingsGroup, MODULENAME);
mir_strcpy(TrafficBackgroundColorID.setting, "FontBkColor");
TrafficBackgroundColorID.defcolour = GetSysColor(COLOR_BTNFACE);
- Colour_RegisterW(&TrafficBackgroundColorID);
+ g_plugin.addColor(&TrafficBackgroundColorID);
HookEvent(ME_FONT_RELOAD, UpdateFonts);
diff --git a/plugins/Weather/src/weather_mwin.cpp b/plugins/Weather/src/weather_mwin.cpp index 5b0eeee3d7..84d652670b 100644 --- a/plugins/Weather/src/weather_mwin.cpp +++ b/plugins/Weather/src/weather_mwin.cpp @@ -323,7 +323,7 @@ void InitMwin(void) mir_wstrcpy(colourid.name, LPGENW("Frame Background"));
mir_wstrcpy(colourid.group, _A2W(WEATHERPROTONAME));
colourid.defcolour = GetSysColor(COLOR_3DFACE);
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
FontIDW fontid = { 0 };
fontid.cbSize = sizeof(FontIDW);
@@ -341,12 +341,12 @@ void InitMwin(void) mir_wstrcpy(fontid.deffontsettings.szFace, L"Verdana");
mir_wstrcpy(fontid.backgroundGroup, _A2W(WEATHERPROTONAME));
mir_wstrcpy(fontid.backgroundName, LPGENW("Frame Background"));
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
fontid.deffontsettings.style = DBFONTF_BOLD;
mir_wstrcpy(fontid.name, LPGENW("Frame Title Font"));
mir_strcpy(fontid.prefix, "fnt1");
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
for (auto &hContact : Contacts(WEATHERPROTONAME))
if (db_get_dw(hContact, WEATHERPROTONAME, "mwin", 0))
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 93438dc65a..b999307da6 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -103,7 +103,7 @@ static void InitFonts() mir_wstrcpy(font_id_firstline.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_firstline.backgroundName, L"Background");
font_id_firstline.order = 0;
- Font_RegisterW(&font_id_firstline);
+ g_plugin.addFont(&font_id_firstline);
font_id_secondline.cbSize = sizeof(FontIDW);
font_id_secondline.flags = FIDF_ALLOWEFFECTS;
@@ -114,7 +114,7 @@ static void InitFonts() mir_wstrcpy(font_id_secondline.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_secondline.backgroundName, L"Background");
font_id_secondline.order = 1;
- Font_RegisterW(&font_id_secondline);
+ g_plugin.addFont(&font_id_secondline);
font_id_time.cbSize = sizeof(FontIDW);
font_id_time.flags = FIDF_ALLOWEFFECTS;
@@ -125,7 +125,7 @@ static void InitFonts() mir_wstrcpy(font_id_time.backgroundGroup, L"Popups");
mir_wstrcpy(font_id_time.backgroundName, L"Background");
font_id_time.order = 2;
- Font_RegisterW(&font_id_time);
+ g_plugin.addFont(&font_id_time);
colour_id_bg.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_bg.group, LPGENW("Popups"));
@@ -134,7 +134,7 @@ static void InitFonts() mir_strcpy(colour_id_bg.setting, "ColourBg");
colour_id_bg.defcolour = GetSysColor(COLOR_3DSHADOW);
colour_id_bg.order = 0;
- Colour_RegisterW(&colour_id_bg);
+ g_plugin.addColor(&colour_id_bg);
colour_id_border.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_border.group, LPGENW("Popups"));
@@ -143,7 +143,7 @@ static void InitFonts() mir_strcpy(colour_id_border.setting, "ColourBorder");
colour_id_border.defcolour = RGB(0, 0, 0);
colour_id_border.order = 1;
- Colour_RegisterW(&colour_id_border);
+ g_plugin.addColor(&colour_id_border);
colour_id_sidebar.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_sidebar.group, LPGENW("Popups"));
@@ -152,7 +152,7 @@ static void InitFonts() mir_strcpy(colour_id_sidebar.setting, "ColourSidebar");
colour_id_sidebar.defcolour = RGB(128, 128, 128);
colour_id_sidebar.order = 2;
- Colour_RegisterW(&colour_id_sidebar);
+ g_plugin.addColor(&colour_id_sidebar);
colour_id_titleunderline.cbSize = sizeof(ColourIDW);
mir_wstrcpy(colour_id_titleunderline.group, LPGENW("Popups"));
@@ -161,7 +161,7 @@ static void InitFonts() mir_strcpy(colour_id_titleunderline.setting, "ColourTitleUnderline");
colour_id_titleunderline.defcolour = GetSysColor(COLOR_3DSHADOW);
colour_id_titleunderline.order = 3;
- Colour_RegisterW(&colour_id_titleunderline);
+ g_plugin.addColor(&colour_id_titleunderline);
ReloadFont(0, 0);
}
diff --git a/protocols/JabberG/src/jabber.cpp b/protocols/JabberG/src/jabber.cpp index 3ccc32c652..ff1d99b2f0 100755 --- a/protocols/JabberG/src/jabber.cpp +++ b/protocols/JabberG/src/jabber.cpp @@ -134,12 +134,12 @@ static int OnModulesLoaded(WPARAM, LPARAM) wcsncpy_s(fontid.name, LPGENW("Frame title"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntFrameTitle", _TRUNCATE);
fontid.deffontsettings.style = DBFONTF_BOLD;
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
wcsncpy_s(fontid.name, LPGENW("Frame text"), _TRUNCATE);
strncpy_s(fontid.prefix, "fntFrameClock", _TRUNCATE);
fontid.deffontsettings.style = 0;
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
ColourIDW colourid = {0};
colourid.cbSize = sizeof(colourid);
@@ -149,7 +149,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) wcsncpy_s(colourid.name, L"Background", _TRUNCATE);
strncpy_s(colourid.setting, "clFrameBack", _TRUNCATE);
colourid.defcolour = GetSysColor(COLOR_WINDOW);
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
return 0;
}
diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp index a68e3979aa..e7729d616b 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -76,7 +76,7 @@ void RegisterCListFonts() mir_snprintf(idstr, "Font%d", i);
strncpy(fontid.prefix, idstr, _countof(fontid.prefix));
fontid.order = i;
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
}
ReleaseDC(nullptr, hdc);
@@ -90,25 +90,25 @@ void RegisterCListFonts() wcsncpy(colourid.name, LPGENW("Background"), _countof(colourid.name));
wcsncpy(colourid.group, LPGENW("Contact list"), _countof(colourid.group));
colourid.defcolour = CLCDEFAULT_BKCOLOUR;
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
strncpy(colourid.setting, "SelTextColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Selected text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_SELTEXTCOLOUR;
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
strncpy(colourid.setting, "HotTextColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Hottrack text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_HOTTEXTCOLOUR;
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
strncpy(colourid.setting, "QuickSearchColour", sizeof(colourid.setting));
wcsncpy(colourid.name, LPGENW("Quicksearch text"), _countof(colourid.name));
colourid.order = 1;
colourid.defcolour = CLCDEFAULT_QUICKSEARCHCOLOUR;
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
HookEvent(ME_FONT_RELOAD, FS_FontsChanged);
}
diff --git a/src/core/stdmsg/src/chat_manager.cpp b/src/core/stdmsg/src/chat_manager.cpp index 06ca982f74..9a3885baa6 100644 --- a/src/core/stdmsg/src/chat_manager.cpp +++ b/src/core/stdmsg/src/chat_manager.cpp @@ -158,27 +158,27 @@ static void RegisterFonts() strncpy(colourid.setting, "ColorLogBG", _countof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Group chat log background"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); strncpy(colourid.setting, "ColorMessageBG", _countof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Message background"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); strncpy(colourid.setting, "ColorNicklistBG", _countof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Nick list background"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_WINDOW); - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); strncpy(colourid.setting, "ColorNicklistLines", _countof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Nick list lines"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_INACTIVEBORDER); - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); strncpy(colourid.setting, "ColorNicklistSelectedBG", _countof(colourid.setting)); wcsncpy(colourid.name, LPGENW("Nick list background (selected)"), _countof(colourid.name)); colourid.defcolour = GetSysColor(COLOR_HIGHLIGHT); - Colour_RegisterW(&colourid); + g_plugin.addColor(&colourid); } static void ShowRoom(SESSION_INFO *si) diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index 640841691d..20622ddd70 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -117,7 +117,7 @@ void RegisterSRMMFonts(void) fontid.deffontsettings.charset = MsgDlgGetFontDefaultCharset(fontOptionsList[i].szDefFace);
wcsncpy_s(fontid.backgroundGroup, LPGENW("Message sessions") L"/" LPGENW("Message log"), _TRUNCATE);
wcsncpy_s(fontid.backgroundName, LPGENW("Background"), _TRUNCATE);
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
}
ColourIDW colourid = { sizeof(colourid) };
@@ -126,7 +126,7 @@ void RegisterSRMMFonts(void) colourid.defcolour = SRMSGDEFSET_BKGCOLOUR;
wcsncpy_s(colourid.name, LPGENW("Background"), _TRUNCATE);
wcsncpy_s(colourid.group, LPGENW("Message sessions") L"/" LPGENW("Message log"), _TRUNCATE);
- Colour_RegisterW(&colourid);
+ g_plugin.addColor(&colourid);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp index 1933851f75..8f3001e2b0 100644 --- a/src/mir_app/src/CMPluginBase.cpp +++ b/src/mir_app/src/CMPluginBase.cpp @@ -165,6 +165,38 @@ void CMPluginBase::openOptionsPage(const wchar_t *pszGroup, const wchar_t *pszPa ///////////////////////////////////////////////////////////////////////////////////////// +int CMPluginBase::addFont(FontID *pFont) +{ + return Font_Register(pFont, m_hLang); +} + +int CMPluginBase::addFont(FontIDW *pFont) +{ + return Font_RegisterW(pFont, m_hLang); +} + +int CMPluginBase::addColor(ColourID *pColor) +{ + return Colour_Register(pColor, m_hLang); +} + +int CMPluginBase::addColor(ColourIDW *pColor) +{ + return Colour_RegisterW(pColor, m_hLang); +} + +int CMPluginBase::addEffect(EffectID *pEffect) +{ + return Effect_Register(pEffect, m_hLang); +} + +int CMPluginBase::addEffect(EffectIDW *pEffect) +{ + return Effect_RegisterW(pEffect, m_hLang); +} + +///////////////////////////////////////////////////////////////////////////////////////// + int CMPluginBase::addHotkey(const HOTKEYDESC *hk) { return Hotkey_Register(hk, m_hLang); diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp index 7acc62ac0b..1dd6e6a3e3 100644 --- a/src/mir_app/src/FontService.cpp +++ b/src/mir_app/src/FontService.cpp @@ -549,17 +549,17 @@ int LoadFontserviceModule(void) wcsncpy_s(fontid.name, LPGENW("Headers"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSHEADER;
strncpy(fontid.prefix, "Header", _countof(fontid.prefix));
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
wcsncpy_s(fontid.name, LPGENW("Generic text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSGENERAL;
strncpy(fontid.prefix, "Generic", _countof(fontid.prefix));
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
wcsncpy_s(fontid.name, LPGENW("Small text"), _TRUNCATE);
fontid.flags = FIDF_APPENDNAME | FIDF_NOAS | FIDF_SAVEPOINTSIZE | FIDF_ALLOWEFFECTS | FIDF_CLASSSMALL;
strncpy(fontid.prefix, "Small", _countof(fontid.prefix));
- Font_RegisterW(&fontid);
+ g_plugin.addFont(&fontid);
// do last for silly dyna plugin
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 5f12de28d3..caf575ca95 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -605,3 +605,9 @@ UnregisterPlugin @633 ?addHotkey@CMPluginBase@@QAEHPBUHOTKEYDESC@@@Z @634 NONAME
?addIcon@CMPluginBase@@QAEPAXPBUSKINICONDESC@@@Z @635 NONAME
?addRootMenu@CMPluginBase@@QAEPAUTMO_IntMenuItem@@HPB_WHPAX@Z @636 NONAME
+?addColor@CMPluginBase@@QAEHPAUColourID@@@Z @637 NONAME
+?addColor@CMPluginBase@@QAEHPAUColourIDW@@@Z @638 NONAME
+?addEffect@CMPluginBase@@QAEHPAUEffectID@@@Z @639 NONAME
+?addEffect@CMPluginBase@@QAEHPAUEffectIDW@@@Z @640 NONAME
+?addFont@CMPluginBase@@QAEHPAUFontID@@@Z @641 NONAME
+?addFont@CMPluginBase@@QAEHPAUFontIDW@@@Z @642 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 0b04631195..328d898c37 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -605,3 +605,9 @@ UnregisterPlugin @633 ?addHotkey@CMPluginBase@@QEAAHPEBUHOTKEYDESC@@@Z @634 NONAME
?addIcon@CMPluginBase@@QEAAPEAXPEBUSKINICONDESC@@@Z @635 NONAME
?addRootMenu@CMPluginBase@@QEAAPEAUTMO_IntMenuItem@@HPEB_WHPEAX@Z @636 NONAME
+?addColor@CMPluginBase@@QEAAHPEAUColourID@@@Z @637 NONAME
+?addColor@CMPluginBase@@QEAAHPEAUColourIDW@@@Z @638 NONAME
+?addEffect@CMPluginBase@@QEAAHPEAUEffectID@@@Z @639 NONAME
+?addEffect@CMPluginBase@@QEAAHPEAUEffectIDW@@@Z @640 NONAME
+?addFont@CMPluginBase@@QEAAHPEAUFontID@@@Z @641 NONAME
+?addFont@CMPluginBase@@QEAAHPEAUFontIDW@@@Z @642 NONAME
diff --git a/utils/mir_fonts.cpp b/utils/mir_fonts.cpp index 7da2bd1eef..8716e3c491 100644 --- a/utils/mir_fonts.cpp +++ b/utils/mir_fonts.cpp @@ -30,7 +30,7 @@ int FontService_RegisterFont(const char *pszDbModule, const char *pszDbName, con fid.deffontsettings.charset = plfDefault->lfCharSet; mir_wstrncpy(fid.deffontsettings.szFace, plfDefault->lfFaceName, _countof(fid.deffontsettings.szFace)); /* buffer safe */ } - Font_RegisterW(&fid); + Font_RegisterW(&fid, 0); return 0; } @@ -43,6 +43,6 @@ int FontService_RegisterColor(const char *pszDbModule, const char *pszDbName, co mir_strncpy(cid.setting, pszDbName, sizeof(cid.setting)); /* buffer safe */ mir_wstrncpy(cid.group, pszSection, _countof(cid.group)); /* buffer safe */ mir_wstrncpy(cid.name, pszDescription, _countof(cid.name)); /* buffer safe */ - Colour_RegisterW(&cid); + Colour_RegisterW(&cid, 0); return 0; } |