diff options
author | George Hazan <george.hazan@gmail.com> | 2023-11-05 22:06:24 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-11-05 22:06:24 +0300 |
commit | ca97e51bc8522538feb522940682a55f0620b90c (patch) | |
tree | a4e53d7fc7ae0252afcfdc94313a44f874150d7d /src/mir_app | |
parent | cda14f4f5ec6f88e98285dc9af5c89231561e73f (diff) |
mir_fonts.cpp erased because the problems with translation
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/CMPluginBase.cpp | 38 | ||||
-rw-r--r-- | src/mir_app/src/mir_app.def | 2 | ||||
-rw-r--r-- | src/mir_app/src/mir_app64.def | 2 |
3 files changed, 42 insertions, 0 deletions
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp index 910b1bbd44..8c50bfdd2e 100644 --- a/src/mir_app/src/CMPluginBase.cpp +++ b/src/mir_app/src/CMPluginBase.cpp @@ -208,6 +208,32 @@ int CMPluginBase::addFont(FontIDW *pFont) return Font_RegisterW(pFont, this);
}
+int CMPluginBase::addFont(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, const wchar_t *pszBackgroundGroup, const wchar_t *pszBackgroundName, int position, BOOL bAllowEffects, LOGFONT *plfDefault, COLORREF clrDefault)
+{
+ FontIDW fid = {};
+ mir_strncpy(fid.dbSettingsGroup, pszDbModule, sizeof(fid.dbSettingsGroup)); /* buffer safe */
+ mir_strncpy(fid.setting, pszDbName, sizeof(fid.setting)); /* buffer safe */
+ mir_wstrncpy(fid.group, pszSection, _countof(fid.group)); /* buffer safe */
+ mir_wstrncpy(fid.name, pszDescription, _countof(fid.name)); /* buffer safe */
+ mir_wstrncpy(fid.backgroundGroup, pszBackgroundGroup, _countof(fid.backgroundGroup)); /* buffer safe */
+ mir_wstrncpy(fid.backgroundName, pszBackgroundName, _countof(fid.backgroundName)); /* buffer safe */
+ fid.flags = FIDF_ALLOWREREGISTER;
+ if (bAllowEffects) fid.flags |= FIDF_ALLOWEFFECTS;
+ fid.order = position;
+ if (plfDefault != nullptr) {
+ fid.flags |= FIDF_DEFAULTVALID;
+ fid.deffontsettings.colour = clrDefault;
+ fid.deffontsettings.size = (char)plfDefault->lfHeight;
+ if (plfDefault->lfItalic) fid.deffontsettings.style |= DBFONTF_ITALIC;
+ if (plfDefault->lfWeight != FW_NORMAL) fid.deffontsettings.style |= DBFONTF_BOLD;
+ if (plfDefault->lfUnderline) fid.deffontsettings.style |= DBFONTF_UNDERLINE;
+ if (plfDefault->lfStrikeOut) fid.deffontsettings.style |= DBFONTF_STRIKEOUT;
+ fid.deffontsettings.charset = plfDefault->lfCharSet;
+ mir_wstrncpy(fid.deffontsettings.szFace, plfDefault->lfFaceName, _countof(fid.deffontsettings.szFace)); /* buffer safe */
+ }
+ return Font_RegisterW(&fid, this);
+}
+
int CMPluginBase::addColor(ColourID *pColor)
{
return Colour_Register(pColor, this);
@@ -218,6 +244,18 @@ int CMPluginBase::addColor(ColourIDW *pColor) return Colour_RegisterW(pColor, this);
}
+int CMPluginBase::addColor(const char *pszDbModule, const char *pszDbName, const wchar_t *pszSection, const wchar_t *pszDescription, COLORREF clrDefault)
+{
+ ColourIDW cid = {};
+ cid.defcolour = clrDefault;
+ mir_strncpy(cid.dbSettingsGroup, pszDbModule, sizeof(cid.dbSettingsGroup)); /* buffer safe */
+ 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, 0);
+ return 0;
+}
+
int CMPluginBase::addEffect(EffectID *pEffect)
{
return Effect_Register(pEffect, this);
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 53c82fe05e..c670d01805 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -907,3 +907,5 @@ Clist_GroupSaveExpanded @1003 NONAME ?Srmm_ApplyOptions@@YGXXZ @1025 NONAME
?OnOptionsApplied@CSrmmBaseDialog@@UAEXXZ @1026 NONAME
?Srmm_GetWindowClass@@YGPAUSrmmLogWindowClass@@PAVCMsgDialog@@@Z @1027 NONAME
+?addColor@CMPluginBase@@QAEHPBD0PB_W1K@Z @1028 NONAME
+?addFont@CMPluginBase@@QAEHPBD0PB_W111HHPAUtagLOGFONTW@@K@Z @1029 NONAME
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 518db90afc..fd393985c3 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -907,3 +907,5 @@ Clist_GroupSaveExpanded @1003 NONAME ?Srmm_ApplyOptions@@YAXXZ @1025 NONAME
?OnOptionsApplied@CSrmmBaseDialog@@UEAAXXZ @1026 NONAME
?Srmm_GetWindowClass@@YAPEAUSrmmLogWindowClass@@PEAVCMsgDialog@@@Z @1027 NONAME
+?addColor@CMPluginBase@@QEAAHPEBD0PEB_W1K@Z @1028 NONAME
+?addFont@CMPluginBase@@QEAAHPEBD0PEB_W111HHPEAUtagLOGFONTW@@K@Z @1029 NONAME
|