diff options
-rw-r--r-- | src/mir_app/src/FontOptions.cpp | 76 | ||||
-rw-r--r-- | src/mir_app/src/FontService.cpp | 43 |
2 files changed, 62 insertions, 57 deletions
diff --git a/src/mir_app/src/FontOptions.cpp b/src/mir_app/src/FontOptions.cpp index 26e6708bff..261656d706 100644 --- a/src/mir_app/src/FontOptions.cpp +++ b/src/mir_app/src/FontOptions.cpp @@ -75,6 +75,67 @@ static int sttCompareEffect(const EffectInternal* p1, const EffectInternal* p2) OBJLIST<EffectInternal> effect_id_list(10, sttCompareEffect), effect_id_list_w2(10, sttCompareEffect), effect_id_list_w3(10, sttCompareEffect);
+/////////////////////////////////////////////////////////////////////////////////////////
+
+void notifyOptions()
+{
+ if (hwndFontOptions)
+ SetTimer(hwndFontOptions, 1, 100, nullptr);
+}
+
+MIR_APP_DLL(void) KillModuleFonts(HPLUGIN pPlugin)
+{
+ for (auto &it : font_id_list.rev_iter())
+ if (it->pPlugin == pPlugin) {
+ font_id_list.remove(font_id_list.indexOf(&it));
+ notifyOptions();
+ }
+
+ for (auto &it : font_id_list_w2.rev_iter())
+ if (it->pPlugin == pPlugin)
+ font_id_list_w2.remove(font_id_list_w2.indexOf(&it));
+
+ for (auto &it : font_id_list_w3.rev_iter())
+ if (it->pPlugin == pPlugin)
+ font_id_list_w3.remove(font_id_list_w3.indexOf(&it));
+}
+
+MIR_APP_DLL(void) KillModuleColours(HPLUGIN pPlugin)
+{
+ for (auto &it : colour_id_list.rev_iter())
+ if (it->pPlugin == pPlugin) {
+ colour_id_list.remove(colour_id_list.indexOf(&it));
+ notifyOptions();
+ }
+
+ for (auto &it : colour_id_list_w2.rev_iter())
+ if (it->pPlugin == pPlugin)
+ colour_id_list_w2.remove(colour_id_list_w2.indexOf(&it));
+
+ for (auto &it : colour_id_list_w3.rev_iter())
+ if (it->pPlugin == pPlugin)
+ colour_id_list_w3.remove(colour_id_list_w3.indexOf(&it));
+}
+
+MIR_APP_DLL(void) KillModuleEffects(HPLUGIN pPlugin)
+{
+ for (auto &it : effect_id_list.rev_iter())
+ if (it->pPlugin == pPlugin) {
+ effect_id_list.remove(effect_id_list.indexOf(&it));
+ notifyOptions();
+ }
+
+ for (auto &it : effect_id_list_w2.rev_iter())
+ if (it->pPlugin == pPlugin)
+ effect_id_list_w2.remove(effect_id_list_w2.indexOf(&it));
+
+ for (auto &it : effect_id_list_w3.rev_iter())
+ if (it->pPlugin == pPlugin)
+ effect_id_list_w3.remove(effect_id_list_w3.indexOf(&it));
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
struct DrawTextWithEffectParam
{
int cbSize;
@@ -1195,18 +1256,3 @@ int OptInit(WPARAM wParam, LPARAM) g_plugin.addOptions(wParam, &odp);
return 0;
}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
-static FontInternal* sttFindFont(OBJLIST<FontInternal> &fonts, char *module, char *setting)
-{
- for (auto &F : fonts)
- if (!mir_strcmp(F->dbSettingsGroup, module) && !mir_strcmp(F->setting, setting))
- return F;
-
- return nullptr;
-}
-
-static FontInternal fntHeader, fntGeneral, fntSmall;
-
-INT_PTR CALLBACK DlgPluginOpt(HWND, UINT, WPARAM, LPARAM);
diff --git a/src/mir_app/src/FontService.cpp b/src/mir_app/src/FontService.cpp index dce937b2be..0b4fbd1495 100644 --- a/src/mir_app/src/FontService.cpp +++ b/src/mir_app/src/FontService.cpp @@ -27,13 +27,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. int code_page = CP_ACP;
HANDLE hFontReloadEvent, hColourReloadEvent;
-extern HWND hwndFontOptions;
-static void notifyOptions()
-{
- if (hwndFontOptions)
- SetTimer(hwndFontOptions, 1, 100, nullptr);
-}
+void notifyOptions();
/////////////////////////////////////////////////////////////////////////////////////////
@@ -315,19 +310,6 @@ static INT_PTR ReloadFonts(WPARAM, LPARAM) }
/////////////////////////////////////////////////////////////////////////////////////////
-
-MIR_APP_DLL(void) KillModuleFonts(HPLUGIN pPlugin)
-{
- auto T = font_id_list.rev_iter();
- for (auto &it : T) {
- if (it->pPlugin == pPlugin) {
- font_id_list.remove(T.indexOf(&it));
- notifyOptions();
- }
- }
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
// RegisterColour service
void UpdateColourSettings(ColourIDW *colour_id, COLORREF *colour)
@@ -392,19 +374,6 @@ static INT_PTR ReloadColours(WPARAM, LPARAM) return 0;
}
-/////////////////////////////////////////////////////////////////////////////////////////
-
-MIR_APP_DLL(void) KillModuleColours(HPLUGIN pPlugin)
-{
- auto T = colour_id_list.rev_iter();
- for (auto &it : T) {
- if (it->pPlugin == pPlugin) {
- colour_id_list.remove(T.indexOf(&it));
- notifyOptions();
- }
- }
-}
-
//////////////////////////////////////////////////////////////////////////
// Effects
@@ -480,16 +449,6 @@ MIR_APP_DLL(int) Effect_Get(const char *szGroup, const char *szName, FONTEFFECT /////////////////////////////////////////////////////////////////////////////////////////
-MIR_APP_DLL(void) KillModuleEffects(HPLUGIN pPlugin)
-{
- auto T = colour_id_list.rev_iter();
- for (auto &it : T)
- if (it->pPlugin == pPlugin)
- effect_id_list.remove(T.indexOf(&it));
-}
-
-/////////////////////////////////////////////////////////////////////////////////////////
-
int OptInit(WPARAM, LPARAM);
static int OnModulesLoaded(WPARAM, LPARAM)
|