From d5558b6f67918ea8f951fd0408eff18532a63d4e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 6 Apr 2018 21:37:45 +0300 Subject: CLIST_INTERFACE::pfnClcOptionsChanged => Clist_ClcOptionsChanged CLIST_INTERFACE::pfnRegisterFileDropping & CLIST_INTERFACE::pfnUnregisterFileDropping => suspended --- src/mir_app/src/clc.cpp | 8 +++----- src/mir_app/src/clc.h | 8 ++------ src/mir_app/src/clcfiledrop.cpp | 20 ++------------------ src/mir_app/src/clistcore.cpp | 4 ---- src/mir_app/src/mir_app.def | 1 + src/mir_app/src/mir_app64.def | 1 + 6 files changed, 9 insertions(+), 33 deletions(-) (limited to 'src/mir_app') diff --git a/src/mir_app/src/clc.cpp b/src/mir_app/src/clc.cpp index 9cd81ba7d2..0cb995c13e 100644 --- a/src/mir_app/src/clc.cpp +++ b/src/mir_app/src/clc.cpp @@ -58,7 +58,7 @@ MIR_APP_DLL(void) Clist_BroadcastAsync(int msg, WPARAM wParam, LPARAM lParam) WindowList_BroadcastAsync(hClcWindowList, msg, wParam, lParam); } -void fnClcOptionsChanged(void) +MIR_APP_DLL(void) Clist_ClcOptionsChanged(void) { Clist_Broadcast(INTM_RELOADOPTIONS, 0, 0); } @@ -211,8 +211,6 @@ int LoadCLCModule(void) CreateServiceFunction(MS_CLC_SETINFOTIPHOVERTIME, SetInfoTipHoverTime); CreateServiceFunction(MS_CLC_GETINFOTIPHOVERTIME, GetInfoTipHoverTime); - InitFileDropping(); - HookEvent(ME_SYSTEM_MODULESLOADED, ClcModulesLoaded); HookEvent(ME_PROTO_ACCLISTCHANGED, ClcAccountsChanged); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ClcSettingChanged); @@ -255,7 +253,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam switch (uMsg) { case WM_CREATE: WindowList_Add(hClcWindowList, hwnd); - cli.pfnRegisterFileDropping(hwnd); + RegisterFileDropping(hwnd); if (dat == nullptr) { dat = new ClcData(); SetWindowLongPtr(hwnd, 0, (LONG_PTR)dat); @@ -1280,7 +1278,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT uMsg, WPARAM wParam DeleteObject(dat->hBmpBackground); FreeGroup(&dat->list); delete dat; - cli.pfnUnregisterFileDropping(hwnd); + UnregisterFileDropping(hwnd); WindowList_Remove(hClcWindowList, hwnd); } return DefWindowProc(hwnd, uMsg, wParam, lParam); diff --git a/src/mir_app/src/clc.h b/src/mir_app/src/clc.h index 5a9099cd49..2abed41833 100644 --- a/src/mir_app/src/clc.h +++ b/src/mir_app/src/clc.h @@ -42,8 +42,6 @@ extern HIMAGELIST hCListImages; extern bool g_bReadyToInitClist; extern OBJLIST g_menuProtos; -void fnClcOptionsChanged(void); - LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); /* clcidents.c */ @@ -107,10 +105,8 @@ void fnCheckCacheItem(ClcCacheEntry *p); void fnFreeCacheItem(ClcCacheEntry *p); /* clcfiledrop.c */ -void InitFileDropping(void); - -void fnRegisterFileDropping(HWND hwnd); -void fnUnregisterFileDropping(HWND hwnd); +void RegisterFileDropping(HWND hwnd); +void UnregisterFileDropping(HWND hwnd); /* clistevents.c */ struct CListEvent* fnAddEvent(CLISTEVENT *cle); diff --git a/src/mir_app/src/clcfiledrop.cpp b/src/mir_app/src/clcfiledrop.cpp index 93960b09c4..1065de73de 100644 --- a/src/mir_app/src/clcfiledrop.cpp +++ b/src/mir_app/src/clcfiledrop.cpp @@ -246,28 +246,12 @@ HRESULT CDropTarget::Drop(IDataObject * pDataObj, DWORD /*fKeyState*/, POINTL pt return S_OK; } -static VOID CALLBACK CreateDropTargetHelperTimerProc(HWND hwnd, UINT, UINT_PTR idEvent, DWORD) -{ - KillTimer(hwnd, idEvent); - //This is a ludicrously slow function (~200ms) so we delay load it a bit. - if (S_OK != CoCreateInstance(CLSID_DragDropHelper, nullptr, CLSCTX_INPROC_SERVER, - IID_IDropTargetHelper, (LPVOID*)&dropTarget.pDropTargetHelper)) - dropTarget.pDropTargetHelper = nullptr; -} - -void InitFileDropping(void) -{ - // Disabled as this function loads tons of dlls for no apparenet reason - // we will se what the reaction will be -// SetTimer(nullptr, 1, 1000, CreateDropTargetHelperTimerProc); -} - -void fnRegisterFileDropping(HWND hwnd) +void RegisterFileDropping(HWND hwnd) { RegisterDragDrop(hwnd, (IDropTarget *) & dropTarget); } -void fnUnregisterFileDropping(HWND hwnd) +void UnregisterFileDropping(HWND hwnd) { RevokeDragDrop(hwnd); } diff --git a/src/mir_app/src/clistcore.cpp b/src/mir_app/src/clistcore.cpp index b885d86ba2..0e454969f0 100644 --- a/src/mir_app/src/clistcore.cpp +++ b/src/mir_app/src/clistcore.cpp @@ -62,12 +62,8 @@ void InitClistCore() cli.bDisplayLocked = true; cli.menuProtos = &g_menuProtos; - cli.pfnClcOptionsChanged = fnClcOptionsChanged; cli.pfnContactListControlWndProc = fnContactListControlWndProc; - cli.pfnRegisterFileDropping = fnRegisterFileDropping; - cli.pfnUnregisterFileDropping = fnUnregisterFileDropping; - cli.pfnGetRowsPriorTo = fnGetRowsPriorTo; cli.pfnFindItem = fnFindItem; cli.pfnGetRowByIndex = fnGetRowByIndex; diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index e8b2c97f9b..e274058e7e 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -575,3 +575,4 @@ Clist_GetGroupCountsText @594 Clist_SaveStateAndRebuildList @595 Clist_DeleteItemFromTree @596 Clist_RemoveItemFromGroup @597 +Clist_ClcOptionsChanged @598 diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index d9782165d9..37564261f0 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -575,3 +575,4 @@ Clist_GetGroupCountsText @594 Clist_SaveStateAndRebuildList @595 Clist_DeleteItemFromTree @596 Clist_RemoveItemFromGroup @597 +Clist_ClcOptionsChanged @598 -- cgit v1.2.3