From 9af11cd3eecbfb6e524623b6304fcacfe77bbfff Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Jul 2016 07:42:30 +0000 Subject: non-redefined function pfnClcBroadcast made static -> Clist_Broadcast also its async variant created and published as Clist_BroadcastAsync git-svn-id: http://svn.miranda-ng.org/main/trunk@17108 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/mir_app/src/clc.cpp | 37 +++++++++++++++++++++---------------- src/mir_app/src/clc.h | 1 - src/mir_app/src/clistcore.cpp | 1 - src/mir_app/src/clistmod.cpp | 16 ++++++++-------- src/mir_app/src/mir_app.def | 2 ++ src/mir_app/src/mir_app64.def | 2 ++ src/mir_app/src/proto_order.cpp | 4 ++-- 7 files changed, 35 insertions(+), 28 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 7e02a50895..083352ddf7 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -34,7 +34,7 @@ void MTG_OnmodulesLoad(void); static bool bModuleInitialized = false; static HANDLE hShowInfoTipEvent; HANDLE hHideInfoTipEvent; -MWindowList hClcWindowList; +static MWindowList hClcWindowList; int g_IconWidth, g_IconHeight; @@ -48,14 +48,19 @@ void fnInitAutoRebuild(HWND hWnd) } } -void fnClcBroadcast(int msg, WPARAM wParam, LPARAM lParam) +MIR_APP_DLL(void) Clist_Broadcast(int msg, WPARAM wParam, LPARAM lParam) { WindowList_Broadcast(hClcWindowList, msg, wParam, lParam); } +MIR_APP_DLL(void) Clist_BroadcastAsync(int msg, WPARAM wParam, LPARAM lParam) +{ + WindowList_BroadcastAsync(hClcWindowList, msg, wParam, lParam); +} + void fnClcOptionsChanged(void) { - cli.pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0); + Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -66,49 +71,49 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam; if (hContact == NULL) { if (!strcmp(cws->szModule, "CListGroups")) - cli.pfnClcBroadcast(INTM_GROUPSCHANGED, hContact, lParam); + Clist_Broadcast(INTM_GROUPSCHANGED, hContact, lParam); return 0; } if (!strcmp(cws->szModule, "CList")) { if (!strcmp(cws->szSetting, "MyHandle")) { cli.pfnInvalidateDisplayNameCacheEntry(hContact); - cli.pfnClcBroadcast(INTM_NAMECHANGED, hContact, lParam); + Clist_Broadcast(INTM_NAMECHANGED, hContact, lParam); } else if (!strcmp(cws->szSetting, "Group")) - cli.pfnClcBroadcast(INTM_GROUPCHANGED, hContact, lParam); + Clist_Broadcast(INTM_GROUPCHANGED, hContact, lParam); else if (!strcmp(cws->szSetting, "Hidden")) - cli.pfnClcBroadcast(INTM_HIDDENCHANGED, hContact, lParam); + Clist_Broadcast(INTM_HIDDENCHANGED, hContact, lParam); else if (!strcmp(cws->szSetting, "NotOnList")) - cli.pfnClcBroadcast(INTM_NOTONLISTCHANGED, hContact, lParam); + Clist_Broadcast(INTM_NOTONLISTCHANGED, hContact, lParam); else if (!strcmp(cws->szSetting, "Status")) - cli.pfnClcBroadcast(INTM_INVALIDATE, 0, 0); + Clist_Broadcast(INTM_INVALIDATE, 0, 0); else if (!strcmp(cws->szSetting, "NameOrder")) - cli.pfnClcBroadcast(INTM_NAMEORDERCHANGED, 0, 0); + Clist_Broadcast(INTM_NAMEORDERCHANGED, 0, 0); } else { char *szProto = GetContactProto(hContact); if (szProto != NULL) { if (!strcmp(cws->szModule, "Protocol") && !strcmp(cws->szSetting, "p")) - cli.pfnClcBroadcast(INTM_PROTOCHANGED, hContact, lParam); + Clist_Broadcast(INTM_PROTOCHANGED, hContact, lParam); // something is being written to a protocol module if (!strcmp(szProto, cws->szModule)) { // was a unique setting key written? char *id = (char *)CallProtoServiceInt(NULL, szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); if ((INT_PTR)id != CALLSERVICE_NOTFOUND && id != NULL && !strcmp(id, cws->szSetting)) - cli.pfnClcBroadcast(INTM_PROTOCHANGED, hContact, lParam); + Clist_Broadcast(INTM_PROTOCHANGED, hContact, lParam); } } if (szProto == NULL || strcmp(szProto, cws->szModule)) return 0; if (!strcmp(cws->szSetting, "Nick") || !strcmp(cws->szSetting, "FirstName") || !strcmp(cws->szSetting, "e-mail") || !strcmp(cws->szSetting, "LastName") || !strcmp(cws->szSetting, "UIN")) - cli.pfnClcBroadcast(INTM_NAMECHANGED, hContact, lParam); + Clist_Broadcast(INTM_NAMECHANGED, hContact, lParam); else if (!strcmp(cws->szSetting, "ApparentMode")) - cli.pfnClcBroadcast(INTM_APPARENTMODECHANGED, hContact, lParam); + Clist_Broadcast(INTM_APPARENTMODECHANGED, hContact, lParam); else if (!strcmp(cws->szSetting, "IdleTS")) - cli.pfnClcBroadcast(INTM_IDLECHANGED, hContact, lParam); + Clist_Broadcast(INTM_IDLECHANGED, hContact, lParam); } return 0; } @@ -178,7 +183,7 @@ static int ClcIconsChanged(WPARAM, LPARAM) static INT_PTR SetInfoTipHoverTime(WPARAM wParam, LPARAM) { db_set_w(NULL, "CLC", "InfoTipHoverTime", (WORD)wParam); - cli.pfnClcBroadcast(INTM_SETINFOTIPHOVERTIME, wParam, 0); + Clist_Broadcast(INTM_SETINFOTIPHOVERTIME, wParam, 0); return 0; } diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 901468a042..4695cd9b58 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -36,7 +36,6 @@ struct ClcCacheEntry : public ClcCacheEntryBase /* clc.c */ extern int g_IconWidth, g_IconHeight; -extern MWindowList hClcWindowList; extern HIMAGELIST hCListImages; void fnClcOptionsChanged(void); diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index d34baadf52..9d9607e7c8 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -77,7 +77,6 @@ static INT_PTR srvRetrieveInterface(WPARAM, LPARAM) cli.bDisplayLocked = TRUE; cli.pfnClcOptionsChanged = fnClcOptionsChanged; - cli.pfnClcBroadcast = fnClcBroadcast; cli.pfnContactListControlWndProc = fnContactListControlWndProc; cli.pfnRegisterFileDropping = fnRegisterFileDropping; diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index 60b6023cb3..1e39d397c6 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -216,8 +216,8 @@ static int ContactListAccountsChanged(WPARAM eventCode, LPARAM lParam) } cli.pfnReloadProtoMenus(); cli.pfnTrayIconIconsChanged(); - cli.pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0); - cli.pfnClcBroadcast(INTM_INVALIDATE, 0, 0); + Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0); + Clist_Broadcast(INTM_INVALIDATE, 0, 0); return 0; } @@ -389,12 +389,12 @@ int fnShowHide(WPARAM, LPARAM) return 0; } -void fnChangeContactIcon(MCONTACT hContact, int iIcon) -{ - WindowList_BroadcastAsync(hClcWindowList, INTM_ICONCHANGED, hContact, iIcon); - - NotifyEventHooks(hContactIconChangedEvent, hContact, iIcon); -} +void fnChangeContactIcon(MCONTACT hContact, int iIcon) +{ + Clist_BroadcastAsync(INTM_ICONCHANGED, hContact, iIcon); + + NotifyEventHooks(hContactIconChangedEvent, hContact, iIcon); +} ///////////////////////////////////////////////////////////////////////////////////////// diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index f3d069a66c..6f5048578f 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -264,3 +264,5 @@ Clist_ContactToHItem @262 Clist_ContactToItemHandle @263 Window_SetSkinIcon_IcoLib @264 Window_SetIcon_IcoLib @265 +Clist_Broadcast @266 +Clist_BroadcastAsync @267 diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 6b2c27b7b6..6f48beb92d 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -264,3 +264,5 @@ Clist_ContactToHItem @262 Clist_ContactToItemHandle @263 Window_SetSkinIcon_IcoLib @264 Window_SetIcon_IcoLib @265 +Clist_Broadcast @266 +Clist_BroadcastAsync @267 diff --git a/src/mir_app/src/proto_order.cpp b/src/mir_app/src/proto_order.cpp index 6587352737..292ac235fb 100644 --- a/src/mir_app/src/proto_order.cpp +++ b/src/mir_app/src/proto_order.cpp @@ -191,8 +191,8 @@ public: WriteDbAccounts(); cli.pfnReloadProtoMenus(); cli.pfnTrayIconIconsChanged(); - cli.pfnClcBroadcast(INTM_RELOADOPTIONS, 0, 0); - cli.pfnClcBroadcast(INTM_INVALIDATE, 0, 0); + Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0); + Clist_Broadcast(INTM_INVALIDATE, 0, 0); } virtual void OnDestroy() -- cgit v1.2.3