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 /src | |
parent | feac2b1a6a79c9d0bb58b0825ec2a776b888f9ce (diff) |
m_fontservice.h => CMPlugin
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdclist/src/clcfonts.cpp | 10 | ||||
-rw-r--r-- | src/core/stdmsg/src/chat_manager.cpp | 10 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgoptions.cpp | 4 | ||||
-rw-r--r-- | src/mir_app/src/CMPluginBase.cpp | 32 | ||||
-rw-r--r-- | src/mir_app/src/FontService.cpp | 6 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 6 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 6 |
7 files changed, 59 insertions, 15 deletions
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
|