From e31ac6c82a921e5d972fe3a3d437f18f147877a9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 7 Jun 2013 20:35:29 +0000 Subject: duplicated and unused services removed git-svn-id: http://svn.miranda-ng.org/main/trunk@4899 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- .../Clist_modern/src/hdr/modern_commonprototypes.h | 3 +- plugins/Clist_modern/src/hdr/modern_static_clui.h | 1 - plugins/Clist_modern/src/init.cpp | 3 +- plugins/Clist_modern/src/modern_clc.cpp | 2 +- plugins/Clist_modern/src/modern_clistmod.cpp | 34 +----- plugins/Clist_modern/src/modern_clisttray.cpp | 2 +- plugins/Clist_modern/src/modern_clui.cpp | 4 +- plugins/Clist_modern/src/modern_cluiservices.cpp | 119 +-------------------- plugins/Clist_modern/src/modern_contact.cpp | 11 -- plugins/Clist_modern/src/modern_statusbar.cpp | 2 +- .../Clist_modern/src/modern_statusbar_options.cpp | 2 +- 11 files changed, 13 insertions(+), 170 deletions(-) (limited to 'plugins/Clist_modern/src') diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index 19f2d1d3d2..844638c10b 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -118,8 +118,6 @@ void CLUI_UpdateLayeredMode(); UINT_PTR CLUI_SafeSetTimer(HWND hwnd, int ID, int Timeout, TIMERPROC proc); /* CLUIServices */ -INT_PTR CLUIServices_ProtocolStatusChanged(WPARAM wParam,LPARAM lParam); - int CLUIUnreadEmailCountChanged(WPARAM wParam,LPARAM lParam); /* GDIPlus */ @@ -303,6 +301,7 @@ BOOL CLUI__cliInvalidateRect(HWND hWnd, CONST RECT* lpRect,BOOL bErase ); int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2); int cliFindItem(HWND hwnd,ClcData *dat,HANDLE hItem,ClcContact **contact,ClcGroup **subgroup,int *isVisible); void cliTrayIconUpdateBase(const char *szChangedProto); +int cliTrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam); void cliCluiProtocolStatusChanged(int status,const char * proto); HMENU cliBuildGroupPopupMenu(ClcGroup *group); void cliInvalidateDisplayNameCacheEntry(HANDLE hContact); diff --git a/plugins/Clist_modern/src/hdr/modern_static_clui.h b/plugins/Clist_modern/src/hdr/modern_static_clui.h index ec4e3acc01..844d172c7c 100644 --- a/plugins/Clist_modern/src/hdr/modern_static_clui.h +++ b/plugins/Clist_modern/src/hdr/modern_static_clui.h @@ -67,7 +67,6 @@ int CListSettings_SetToCache(ClcCacheEntry *pSrc, DWORD flag); int CLUIServices_LoadModule(void); INT_PTR CLUIServices_SortList(WPARAM wParam,LPARAM lParam); -INT_PTR CLUIServices_ProtocolStatusChanged(WPARAM wParam,LPARAM lParam); void Docking_GetMonitorRectFromWindow(HWND hWnd,RECT *rc); diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index ed6ac90cd1..80e7c27b14 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -160,7 +160,8 @@ static HRESULT SubclassClistInterface() pcli->pfnFreeCacheItem = cliFreeCacheItem; pcli->pfnInvalidateDisplayNameCacheEntry = cliInvalidateDisplayNameCacheEntry; - pcli->pfnTrayIconUpdateBase = cliTrayIconUpdateBase; + pcli->pfnTrayIconPauseAutoHide = cliTrayIconPauseAutoHide; + pcli->pfnTrayIconUpdateBase = cliTrayIconUpdateBase; pcli->pfnCluiProtocolStatusChanged = cliCluiProtocolStatusChanged; pcli->pfnBeginRenameSelection = cliBeginRenameSelection; diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 15e8300427..1663134546 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -211,7 +211,7 @@ static int clcHookSettingChanged(WPARAM wParam,LPARAM lParam) } else if ( !strcmp(cws->szSetting,"XStatusId") || !strcmp(cws->szSetting,"XStatusName")) { - CLUIServices_ProtocolStatusChanged(0, (LPARAM)cws->szModule); + cliCluiProtocolStatusChanged(0, cws->szModule); } } else // (HANDLE)wParam != NULL diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index f3da87eae2..6fd2978021 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -47,7 +47,6 @@ int ModernSkinOptInit(WPARAM wParam,LPARAM lParam); int EventsProcessContactDoubleClick(HANDLE hContact); INT_PTR TrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam); -INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam); void InitTrayMenus(void); void UninitTrayMenu(); @@ -157,31 +156,6 @@ int CListMod_ContactListShutdownProc(WPARAM wParam,LPARAM lParam) return 0; } -INT_PTR GetCapsService(WPARAM wParam,LPARAM lParam) -{ - if (lParam) { - switch (lParam) { - case 0: - return 0; - case CLUIF2_PLUGININFO: - return (INT_PTR)&pluginInfo; - case CLUIF2_CLISTTYPE: - return 0x0107; - case CLUIF2_EXTRACOLUMNCOUNT: - return EXTRA_ICON_COUNT; - } - } - else { - switch (wParam) { - case CLUICAPS_FLAGS1: - return CLUIF_HIDEEMPTYGROUPS|CLUIF_DISABLEGROUPS|CLUIF_HASONTOPOPTION|CLUIF_HASAUTOHIDEOPTION; - case CLUICAPS_FLAGS2: - return MAKELONG(EXTRA_ICON_COUNT,1); - } - } - return 0; -} - HRESULT PreLoadContactListModule() { /* Global data initialization */ @@ -189,10 +163,6 @@ HRESULT PreLoadContactListModule() g_CluiData.dwKeyColor = RGB(255, 0, 255); g_CluiData.bCurrentAlpha = 255; - //initialize firstly hooks - //clist interface is empty yet so handles should check - CreateServiceFunction(MS_CLUI_GETCAPS, GetCapsService); - // catch langpack events HookEvent(ME_LANGPACK_CHANGED, OnLoadLangpack); OnLoadLangpack(0, 0); @@ -215,9 +185,7 @@ HRESULT CluiLoadModule() CreateServiceFunction("ModernSkinSel/Apply", SvcApplySkin); HookEvent(ME_DB_CONTACT_ADDED,ContactAdded); - CreateServiceFunction(MS_CLIST_TRAYICONPROCESSMESSAGE,cli_TrayIconProcessMessage); - CreateServiceFunction(MS_CLIST_PAUSEAUTOHIDE,TrayIconPauseAutoHide); - CreateServiceFunction(MS_CLIST_CONTACTCHANGEGROUP,ContactChangeGroup); + CreateServiceFunction(MS_CLIST_TOGGLEHIDEOFFLINE,ToggleHideOffline); CreateServiceFunction(MS_CLIST_TOGGLEGROUPS,ToggleGroups); diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index f99b24ca6d..19a6b8c605 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -360,7 +360,7 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd,UINT message,UINT_PTR idEve MySetProcessWorkingSetSize(GetCurrentProcess(),-1,-1); } -INT_PTR TrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam) +int cliTrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam) { if ( db_get_b(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT)) { diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 75be2ea628..cea7571750 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -71,7 +71,7 @@ int CLUI::OnEvent_ModulesLoaded(WPARAM wParam,LPARAM lParam) if ( ServiceExists(MS_MC_GETPROTOCOLNAME)) g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0); - CLUIServices_ProtocolStatusChanged(0, 0); + cliCluiProtocolStatusChanged(0, 0); SleepEx(0, TRUE); g_flag_bOnModulesLoadedCalled = TRUE; ///pcli->pfnInvalidateDisplayNameCacheEntry(INVALID_HANDLE_VALUE); @@ -1980,7 +1980,7 @@ LRESULT CLUI::OnCreate(UINT msg, WPARAM wParam, LPARAM lParam) { TranslateMenu(GetMenu(m_hWnd)); DrawMenuBar(m_hWnd); - CLUIServices_ProtocolStatusChanged(0, 0); + cliCluiProtocolStatusChanged(0, 0); MENUITEMINFO mii; ZeroMemory(&mii,sizeof(mii)); diff --git a/plugins/Clist_modern/src/modern_cluiservices.cpp b/plugins/Clist_modern/src/modern_cluiservices.cpp index 75140b5afc..c5813f1439 100644 --- a/plugins/Clist_modern/src/modern_cluiservices.cpp +++ b/plugins/Clist_modern/src/modern_cluiservices.cpp @@ -31,24 +31,11 @@ int CLUIUnreadEmailCountChanged(WPARAM wParam,LPARAM lParam) return 0; } -INT_PTR CLUIServices_ProtocolStatusChanged(WPARAM wParam,LPARAM lParam) -{ - CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)pcli->hwndStatus,0); - if (lParam) cliTrayIconUpdateBase((char*)lParam); - return 0; -} - void cliCluiProtocolStatusChanged(int status,const char * proto) { - CLUIServices_ProtocolStatusChanged((WPARAM)status,(LPARAM)proto); -} - -INT_PTR SortList(WPARAM wParam,LPARAM lParam) -{ - pcli->pfnClcBroadcast( WM_TIMER,TIMERID_DELAYEDRESORTCLC,0); - pcli->pfnClcBroadcast( INTM_SCROLLBARCHANGED, 0, 0); - - return 0; + CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE,(WPARAM)pcli->hwndStatus,0); + if (proto) + cliTrayIconUpdateBase(proto); } static INT_PTR MetaSupportCheck(WPARAM wParam,LPARAM lParam) @@ -56,110 +43,10 @@ static INT_PTR MetaSupportCheck(WPARAM wParam,LPARAM lParam) return 1; } -static INT_PTR GetHwnd(WPARAM wParam, LPARAM lParam) -{ - return (INT_PTR)pcli->hwndContactList; -} - -static INT_PTR GetHwndTree(WPARAM wParam,LPARAM lParam) -{ - return (INT_PTR)pcli->hwndContactTree; -} - -static INT_PTR GroupAdded(WPARAM wParam, LPARAM lParam) -{ - //CLC does this automatically unless it's a new group - if (lParam) { - HANDLE hItem; - TCHAR szFocusClass[64]; - HWND hwndFocus = GetFocus(); - - GetClassName(hwndFocus, szFocusClass, SIZEOF(szFocusClass)); - if ( !lstrcmp(szFocusClass, _T(CLISTCONTROL_CLASS))) { - hItem = (HANDLE) SendMessage(hwndFocus, CLM_FINDGROUP, wParam, 0); - if (hItem) - SendMessage(hwndFocus, CLM_EDITLABEL, (WPARAM) hItem, 0); - } - } - return 0; -} - -static INT_PTR ContactSetIcon(WPARAM wParam, LPARAM lParam) -{ - //unnecessary: CLC does this automatically - return 0; -} - -static INT_PTR ContactDeleted(WPARAM wParam, LPARAM lParam) -{ - //unnecessary: CLC does this automatically - return 0; -} - -static INT_PTR ContactAdded(WPARAM wParam, LPARAM lParam) -{ - //unnecessary: CLC does this automatically - return 0; -} - -static INT_PTR ListBeginRebuild(WPARAM wParam, LPARAM lParam) -{ - //unnecessary: CLC does this automatically - return 0; -} - -static INT_PTR ContactRenamed(WPARAM wParam, LPARAM lParam) -{ - //unnecessary: CLC does this automatically - return 0; -} - -static INT_PTR ListEndRebuild(WPARAM wParam, LPARAM lParam) -{ - int rebuild = 0; - //CLC does this automatically, but we need to force it if hideoffline or hideempty has changed - if (( db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) == 0) != ((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEOFFLINE) == 0)) { - if ( db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT)) - SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) | CLS_HIDEOFFLINE); - else - SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & ~CLS_HIDEOFFLINE); - rebuild = 1; - } - if (( db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS) == 0)) { - if ( db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT)) - SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) | CLS_HIDEEMPTYGROUPS); - else - SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & ~CLS_HIDEEMPTYGROUPS); - rebuild = 1; - } - if (( db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) == 0) != ((GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS) == 0)) { - if ( db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT)) - SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) | CLS_USEGROUPS); - else - SetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & ~CLS_USEGROUPS); - rebuild = 1; - } - if (rebuild) - SendMessage(pcli->hwndContactTree, CLM_AUTOREBUILD, 0, 0); - return 0; -} - int CLUIServices_LoadModule(void) { CreateServiceFunction(MS_CLUI_METASUPPORT,MetaSupportCheck); - CreateServiceFunction(MS_CLUI_PROTOCOLSTATUSCHANGED,CLUIServices_ProtocolStatusChanged); - CreateServiceFunction(MS_CLUI_SORTLIST,SortList); CreateServiceFunction(MS_CLIST_GETSTATUSMODE,CListTray_GetGlobalStatus); - - CreateServiceFunction(MS_CLUI_GETHWND, GetHwnd); - CreateServiceFunction(MS_CLUI_GETHWNDTREE,GetHwndTree); - CreateServiceFunction(MS_CLUI_GROUPADDED, GroupAdded); - CreateServiceFunction(MS_CLUI_CONTACTSETICON, ContactSetIcon); - CreateServiceFunction(MS_CLUI_CONTACTADDED, ContactAdded); - CreateServiceFunction(MS_CLUI_CONTACTDELETED, ContactDeleted); - CreateServiceFunction(MS_CLUI_CONTACTRENAMED, ContactRenamed); - CreateServiceFunction(MS_CLUI_LISTBEGINREBUILD, ListBeginRebuild); - CreateServiceFunction(MS_CLUI_LISTENDREBUILD, ListEndRebuild); return 0; } diff --git a/plugins/Clist_modern/src/modern_contact.cpp b/plugins/Clist_modern/src/modern_contact.cpp index 29db1d8e81..2fe6c81265 100644 --- a/plugins/Clist_modern/src/modern_contact.cpp +++ b/plugins/Clist_modern/src/modern_contact.cpp @@ -167,17 +167,6 @@ int cliCompareContacts(const ClcContact *contact1,const ClcContact *contact2) #undef SAFESTRING -INT_PTR ContactChangeGroup(WPARAM wParam,LPARAM lParam) -{ - CallService(MS_CLUI_CONTACTDELETED,wParam,0); - if ((HANDLE)lParam == NULL) - db_unset((HANDLE)wParam,"CList","Group"); - else - db_set_ws((HANDLE)wParam,"CList","Group",pcli->pfnGetGroupName(lParam, NULL)); - CallService(MS_CLUI_CONTACTADDED, wParam, pcli->pfnIconFromStatusMode(GetContactProto((HANDLE)wParam),GetContactStatus((HANDLE)wParam),(HANDLE)wParam)); - return 0; -} - INT_PTR ToggleHideOffline(WPARAM wParam,LPARAM lParam) { return pcli->pfnSetHideOffline((WPARAM)-1,0); diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index 496c18ffd4..0c8e13521e 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -983,7 +983,7 @@ HWND StatusBar_Create(HWND parent) CallService(MS_SKINENG_REGISTERPAINTSUB,(WPARAM)Frame.hWnd,(LPARAM)NewStatusPaintCallbackProc); //$$$$$ register sub for frame LoadStatusBarData(); - CLUIServices_ProtocolStatusChanged(0, 0); + cliCluiProtocolStatusChanged(0, 0); CallService(MS_CLIST_FRAMES_UPDATEFRAME,-1,0); return hModernStatusBar; } diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index 0173efb72f..3fce815114 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -524,7 +524,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_b(NULL,"CLUI","ShowSBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)); LoadStatusBarData(); - CLUIServices_ProtocolStatusChanged(0, 0); + cliCluiProtocolStatusChanged(0, 0); return TRUE; } } -- cgit v1.2.3