From 0976190894d653d5062f8ef6befabf46218f2d24 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 3 Oct 2016 16:48:12 +0000 Subject: - inlined helpers for fonts, colors & effects creation replaced with functions; - services for getting fonts, colors & effects removed; - some memory corruptions removed git-svn-id: http://svn.miranda-ng.org/main/trunk@17347 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/TrafficCounter/src/TrafficCounter.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'plugins/TrafficCounter/src/TrafficCounter.cpp') diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index 3739e261c1..0694b3da0b 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -256,7 +256,7 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) TrafficFontID.deffontsettings.style = 0; mir_wstrcpy(TrafficFontID.deffontsettings.szFace, L"Arial"); TrafficFontID.order = 0; - FontRegisterW(&TrafficFontID); + Font_RegisterW(&TrafficFontID); // Регистрируем цвет фона TrafficBackgroundColorID.cbSize = sizeof(ColourIDW); @@ -265,7 +265,7 @@ int TrafficCounterModulesLoaded(WPARAM, LPARAM) mir_strcpy(TrafficBackgroundColorID.dbSettingsGroup, TRAFFIC_SETTINGS_GROUP); mir_strcpy(TrafficBackgroundColorID.setting, "FontBkColor"); TrafficBackgroundColorID.defcolour = GetSysColor(COLOR_BTNFACE); - ColourRegisterW(&TrafficBackgroundColorID); + Colour_RegisterW(&TrafficBackgroundColorID); HookEvent(ME_FONT_RELOAD, UpdateFonts); @@ -1162,15 +1162,13 @@ int ProtocolAckHook(WPARAM, LPARAM lParam) int UpdateFonts(WPARAM, LPARAM) { LOGFONT logfont; - //if no font service - if (!ServiceExists(MS_FONT_GETW)) return 0; //update traffic font if (Traffic_h_font) DeleteObject(Traffic_h_font); - Traffic_FontColor = CallService(MS_FONT_GETW, (WPARAM)&TrafficFontID, (LPARAM)&logfont); + Traffic_FontColor = Font_GetW(TrafficFontID, &logfont); Traffic_h_font = CreateFontIndirect(&logfont); - // + TrafficFontHeight = abs(logfont.lfHeight) + 1; - Traffic_BkColor = CallService(MS_COLOUR_GETW, (WPARAM)&TrafficBackgroundColorID, 0); + Traffic_BkColor = Colour_GetW(TrafficBackgroundColorID); // Ключевой цвет UseKeyColor = db_get_b(NULL, "ModernSettings", "UseKeyColor", 1); -- cgit v1.2.3