From 96f34ff28a65710520816b32a87ab6752c32c02f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 19 Aug 2022 17:55:12 +0300 Subject: fixes #3167 (VoiceService: problems with frame) - no frame, no pain --- plugins/VoiceService/VoiceService.vcxproj | 2 - plugins/VoiceService/VoiceService.vcxproj.filters | 45 ------------ plugins/VoiceService/src/VoiceCall.cpp | 3 - plugins/VoiceService/src/hooks.cpp | 88 ----------------------- plugins/VoiceService/src/main.cpp | 10 --- plugins/VoiceService/src/services.cpp | 4 -- plugins/VoiceService/src/stdafx.h | 10 --- 7 files changed, 162 deletions(-) (limited to 'plugins') diff --git a/plugins/VoiceService/VoiceService.vcxproj b/plugins/VoiceService/VoiceService.vcxproj index 45ec92d4df..0816a9cc42 100644 --- a/plugins/VoiceService/VoiceService.vcxproj +++ b/plugins/VoiceService/VoiceService.vcxproj @@ -26,7 +26,6 @@ - @@ -44,7 +43,6 @@ - diff --git a/plugins/VoiceService/VoiceService.vcxproj.filters b/plugins/VoiceService/VoiceService.vcxproj.filters index 29396adb3f..2b465b04b6 100644 --- a/plugins/VoiceService/VoiceService.vcxproj.filters +++ b/plugins/VoiceService/VoiceService.vcxproj.filters @@ -44,48 +44,6 @@ Resource Files - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Resource Files - - - Header Files - Header Files @@ -109,9 +67,6 @@ Source Files - - Source Files - Source Files diff --git a/plugins/VoiceService/src/VoiceCall.cpp b/plugins/VoiceService/src/VoiceCall.cpp index f40d0a3f40..df2cb5ca11 100644 --- a/plugins/VoiceService/src/VoiceCall.cpp +++ b/plugins/VoiceService/src/VoiceCall.cpp @@ -100,7 +100,6 @@ bool VoiceCall::OnClose() Button_FreeIcon_IcoLib(m_hwnd, IDC_ANSWERBTN); calls.remove(this); - RefreshFrame(); return false; } @@ -296,8 +295,6 @@ void VoiceCall::Notify(bool popup, bool sound, bool /*clist*/) clistBlinking = true; }*/ - - RefreshFrame(); } bool VoiceCall::IsFinished() diff --git a/plugins/VoiceService/src/hooks.cpp b/plugins/VoiceService/src/hooks.cpp index cab92f8f83..4eaa3ffcb5 100644 --- a/plugins/VoiceService/src/hooks.cpp +++ b/plugins/VoiceService/src/hooks.cpp @@ -61,13 +61,6 @@ static HGENMENU hCMHold = NULL; OBJLIST modules(1, PtrKeySortT); OBJLIST calls(1, PtrKeySortT); -HFONT fonts[NUM_STATES] = { 0 }; -COLORREF font_colors[NUM_STATES] = { 0 }; -int font_max_height; - -COLORREF bkg_color = { 0 }; -HBRUSH bk_brush = NULL; - static INT_PTR CListDblClick(WPARAM wParam, LPARAM lParam); static INT_PTR Service_CanCall(WPARAM wParam, LPARAM lParam); @@ -356,22 +349,6 @@ static int PreBuildContactMenu(WPARAM wParam, LPARAM) ///////////////////////////////////////////////////////////////////////////////////////// -static int ReloadColor(WPARAM, LPARAM) -{ - ColourIDW ci = { 0 }; - lstrcpyn(ci.group, TranslateT("Voice Calls"), _countof(ci.group)); - lstrcpyn(ci.name, TranslateT("Background"), _countof(ci.name)); - - bkg_color = Colour_GetW(ci); - - if (bk_brush != NULL) - DeleteObject(bk_brush); - bk_brush = CreateSolidBrush(bkg_color); - - RefreshFrame(); - return 0; -} - VoiceProvider* FindModule(const char *szModule) { for (auto &it : modules) @@ -482,28 +459,6 @@ void Answer(VoiceCall *call) ///////////////////////////////////////////////////////////////////////////////////////// -static int ReloadFont(WPARAM, LPARAM) -{ - FontID fi = { 0 }; - strncpy_s(fi.group, "Voice Calls", _TRUNCATE); - - font_max_height = 0; - for (int i = 0; i < NUM_STATES; i++) { - if (fonts[i] != 0) DeleteObject(fonts[i]); - - strncpy_s(fi.name, stateIcons[i].szName, _TRUNCATE); - - LOGFONTA log_font = { 0 }; - font_colors[i] = Font_Get(fi, &log_font); - fonts[i] = CreateFontIndirectA(&log_font); - - font_max_height = max(font_max_height, log_font.lfHeight); - } - - RefreshFrame(); - return 0; -} - static INT_PTR Service_CanCall(WPARAM wParam, LPARAM) { MCONTACT hContact = (MCONTACT)wParam; @@ -586,8 +541,6 @@ static INT_PTR CMDrop(WPARAM wParam, LPARAM) int ModulesLoaded(WPARAM, LPARAM) { - g_plugin.bFramesExist = ServiceExists(MS_CLIST_FRAMES_ADDFRAME); - // add our modules to the KnownModules list CallService("DBEditorpp/RegisterSingleModule", (WPARAM)MODULE_NAME, 0); @@ -596,38 +549,7 @@ int ModulesLoaded(WPARAM, LPARAM) g_plugin.registerIcon(LPGEN("Voice Calls"), stateIcons, "vc"); g_plugin.registerIcon(LPGEN("Voice Calls"), actionIcons, "vca"); - // Init fonts - { - FontID fi = {}; - strncpy_s(fi.group, LPGEN("Voice Calls"), _TRUNCATE); - strncpy_s(fi.dbSettingsGroup, MODULE_NAME, _TRUNCATE); - - for (int i = 0; i < _countof(stateIcons); i++) { - fi.order = i; - strncpy_s(fi.name, stateIcons[i].szName, _TRUNCATE); - g_plugin.addFont(&fi); - } - - ReloadFont(0, 0); - HookEvent(ME_FONT_RELOAD, ReloadFont); - } - - // Init bkg color - { - ColourID ci = { 0 }; - strncpy_s(ci.group, LPGEN("Voice Calls"), _TRUNCATE); - strncpy_s(ci.name, LPGEN("Background"), _TRUNCATE); - strncpy_s(ci.dbSettingsGroup, MODULE_NAME, _TRUNCATE); - strncpy_s(ci.setting, "BkgColor", _TRUNCATE); - ci.defcolour = GetSysColor(COLOR_BTNFACE); - g_plugin.addColor(&ci); - - ReloadColor(0, 0); - HookEvent(ME_COLOUR_RELOAD, ReloadColor); - } - InitOptions(); - InitFrames(); // Add menu items CMenuItem mi(&g_plugin); @@ -685,16 +607,6 @@ int ModulesLoaded(WPARAM, LPARAM) int PreShutdown(WPARAM, LPARAM) { - DeInitFrames(); DeInitOptions(); return 0; } - -int ProtoAck(WPARAM, LPARAM lParam) -{ - ACKDATA *ack = (ACKDATA *)lParam; - if (ack->type == ACKTYPE_STATUS) - RefreshFrame(); - - return 0; -} diff --git a/plugins/VoiceService/src/main.cpp b/plugins/VoiceService/src/main.cpp index fd9062dfc2..8c307b9dfd 100644 --- a/plugins/VoiceService/src/main.cpp +++ b/plugins/VoiceService/src/main.cpp @@ -47,7 +47,6 @@ void CreateServices(void); int ModulesLoaded(WPARAM wParam, LPARAM lParam); int PreShutdown(WPARAM wParam, LPARAM lParam); -int ProtoAck(WPARAM wParam, LPARAM lParam); int CMPlugin::Load() { @@ -56,14 +55,5 @@ int CMPlugin::Load() // Hooks HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded); HookEvent(ME_SYSTEM_PRESHUTDOWN, PreShutdown); - HookEvent(ME_PROTO_ACK, ProtoAck); - return 0; -} - -int CMPlugin::Unload() -{ - if (bk_brush != NULL) - DeleteObject(bk_brush); - return 0; } diff --git a/plugins/VoiceService/src/services.cpp b/plugins/VoiceService/src/services.cpp index c8607ca99a..e068d3dd6f 100644 --- a/plugins/VoiceService/src/services.cpp +++ b/plugins/VoiceService/src/services.cpp @@ -126,8 +126,6 @@ INT_PTR VoiceRegister(WPARAM wParam, LPARAM) return -3; modules.insert(new VoiceProvider(in->name, in->description, in->flags, in->icon)); - - RefreshFrame(); return 0; } @@ -150,8 +148,6 @@ INT_PTR VoiceUnregister(WPARAM wParam, LPARAM) } modules.remove(module); - - RefreshFrame(); return 0; } diff --git a/plugins/VoiceService/src/stdafx.h b/plugins/VoiceService/src/stdafx.h index 4ef560e84f..6fcd01ff9c 100644 --- a/plugins/VoiceService/src/stdafx.h +++ b/plugins/VoiceService/src/stdafx.h @@ -63,19 +63,15 @@ using namespace std; #include "resource.h" #include "version.h" #include "options.h" -#include "frame.h" #include "popup.h" ///////////////////////////////////////////////////////////////////////////////////////// struct CMPlugin : public PLUGIN { - bool bFramesExist = false; - CMPlugin(); int Load() override; - int Unload() override; }; #define MODULE_NAME "VoiceService" @@ -91,12 +87,6 @@ struct CMPlugin : public PLUGIN #define AUTO_ACCEPT 1 #define AUTO_DROP 2 -extern HFONT fonts[NUM_STATES]; -extern COLORREF font_colors[NUM_STATES]; -extern int font_max_height; -extern COLORREF bkg_color; -extern HBRUSH bk_brush; - class VoiceProvider { public: -- cgit v1.2.3