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 --- include/delphi/m_clistint.inc | 8 ++++---- include/m_clistint.h | 9 +++++---- libs/win32/mir_app.lib | Bin 155212 -> 155472 bytes libs/win64/mir_app.lib | Bin 150322 -> 150562 bytes plugins/Clist_blind/src/clcopts.cpp | 2 +- plugins/Clist_modern/src/modern_clc.cpp | 2 +- plugins/Clist_nicer/src/clcopts.cpp | 4 ++-- plugins/Clist_nicer/src/clui.cpp | 2 +- plugins/Clist_nicer/src/cluiopts.cpp | 2 +- plugins/Clist_nicer/src/extBackg.cpp | 6 +++--- src/core/stdclist/src/clcfonts.cpp | 2 +- src/core/stdclist/src/clcopts.cpp | 4 ++-- 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 + 18 files changed, 30 insertions(+), 53 deletions(-) diff --git a/include/delphi/m_clistint.inc b/include/delphi/m_clistint.inc index d89db6b8dd..119c2b40bb 100644 --- a/include/delphi/m_clistint.inc +++ b/include/delphi/m_clistint.inc @@ -297,14 +297,14 @@ type clcProto : PClcProtoStatus; (* clc.h *) - pfnClcOptionsChanged : procedure; cdecl; - pfnBuildGroupPopupMenu : function (_para1:PClcGroup):HMENU; cdecl; + blablablabla27 : procedure; cdecl; + blablablabla26 : procedure; cdecl; pfnContactListControlWndProc : function(hwnd:HWND; msg:uint; wParam:WPARAM; lParam:LPARAM):LRESULT; stdcall; (* clcfiledrop.c *) - pfnRegisterFileDropping : procedure (hwnd:HWND); cdecl; - pfnUnregisterFileDropping : procedure (hwnd:HWND); cdecl; + blablablabla25 : procedure; cdecl; + blablablabla24 : procedure; cdecl; (* clcidents.c *) blablabla6 : procedure; cdecl; diff --git a/include/m_clistint.h b/include/m_clistint.h index 86b504f70b..94b4da6bf7 100644 --- a/include/m_clistint.h +++ b/include/m_clistint.h @@ -254,6 +254,7 @@ EXTERN_C MIR_APP_DLL(void) Clist_BroadcastAsync(int msg, WPARAM wParam, LPA EXTERN_C MIR_APP_DLL(void) Clist_CalcEipPosition(ClcData *dat, ClcContact *contact, ClcGroup *group, POINT *result); EXTERN_C MIR_APP_DLL(void) Clist_ChangeContactIcon(MCONTACT hContact, int iIcon); +EXTERN_C MIR_APP_DLL(void) Clist_ClcOptionsChanged(void); EXTERN_C MIR_APP_DLL(int) Clist_ClcStatusToPf2(int status); EXTERN_C MIR_APP_DLL(void) Clist_DeleteFromContactList(HWND hwnd, ClcData *dat); EXTERN_C MIR_APP_DLL(void) Clist_DeleteItemFromTree(HWND hwnd, MCONTACT hItem); @@ -321,14 +322,14 @@ struct CLIST_INTERFACE ClcProtoStatus *clcProto; /* clc.h */ - void (*pfnClcOptionsChanged)(void); - HMENU (*pfnBuildGroupPopupMenu)(struct ClcGroup*); // unused + void (*blablablabla27)(); + void (*blablablabla26)(); LRESULT (CALLBACK *pfnContactListControlWndProc)(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); /* clcfiledrop.c */ - void (*pfnRegisterFileDropping)(HWND hwnd); - void (*pfnUnregisterFileDropping)(HWND hwnd); + void (*blablablabla25)(); + void (*blablablabla24)(); /* clcidents.c */ ClcContact* (*pfnFindItem)(DWORD dwItem, ClcContact *contact); diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib index 3e38fb65a0..59f17642c7 100644 Binary files a/libs/win32/mir_app.lib and b/libs/win32/mir_app.lib differ diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib index bfbf250f40..a459d7338d 100644 Binary files a/libs/win64/mir_app.lib and b/libs/win64/mir_app.lib differ diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index 8abc59289a..bab6a296b1 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -234,7 +234,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam GetDlgItemText(hwndDlg, IDC_T_INFO, tmp, _countof(tmp)); db_set_ws(NULL, "CLC", "TemplateInfo", tmp); - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); return TRUE; } break; diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index dd2c1c367c..1230408ffb 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -171,7 +171,7 @@ static int clcHookDbEventAdded(WPARAM hContact, LPARAM lParam) static int clcHookBkgndConfigChanged(WPARAM, LPARAM) { - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); return 0; } diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 0895b0d146..d2114efd77 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -683,7 +683,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam cfg::dat.bDblClkAvatars = IsDlgButtonChecked(hwndDlg, IDC_DBLCLKAVATARS) ? TRUE : FALSE; db_set_b(NULL, "CLC", "dblclkav", (BYTE)cfg::dat.bDblClkAvatars); - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); CoolSB_SetupScrollBar(); PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); opt_clc_main_changed = 0; @@ -809,7 +809,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, cfg::dat.bWallpaperMode = IsDlgButtonChecked(hwndDlg, IDC_SKINMODE) ? 1 : 0; db_set_b(NULL, "CLUI", "UseBkSkin", (BYTE)cfg::dat.bWallpaperMode); - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); opt_clc_bkg_changed = 0; return TRUE; diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index a0663c1270..9df0da77e5 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -151,7 +151,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) DeleteObject(g_hPenCLUIFrames); g_hPenCLUIFrames = CreatePen(PS_SOLID, 1, clr_cluiframes); - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index 432d497781..ad87500749 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -297,7 +297,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l cfg::dat.fadeinout = oldFading; opt_clui_changed = 0; - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); Clist_Broadcast(CLM_AUTOREBUILD, 0, 0); return TRUE; } diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index fb674e4b5e..f9b5b457d1 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -1449,7 +1449,7 @@ void extbk_import(char *file, HWND hwndDlg) // refresh if (hwndDlg && ServiceExists(MS_CLNSE_FILLBYCURRENTSEL)) CallService(MS_CLNSE_FILLBYCURRENTSEL, (WPARAM)hwndDlg, 0); - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); ConfigureCLUIGeometry(1); SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); @@ -1608,7 +1608,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: SaveNonStatusItemsSettings(hwndDlg); - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); return TRUE; } @@ -1653,7 +1653,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara sd.pfnSaveCompleteStruct = SaveCompleteStructToDB; sd.lastItem = ID_STATUS_OFFLINE + arStatusItems.getCount(); sd.firstItem = ID_STATUS_OFFLINE; - sd.pfnClcOptionsChanged = pcli->pfnClcOptionsChanged; + sd.pfnClcOptionsChanged = Clist_ClcOptionsChanged; sd.hwndCLUI = pcli->hwndContactList; hwndSkinEdit = (HWND)CallService(MS_CLNSE_INVOKE, 0, (LPARAM)&sd); } diff --git a/src/core/stdclist/src/clcfonts.cpp b/src/core/stdclist/src/clcfonts.cpp index c8f06365f1..a68e3979aa 100644 --- a/src/core/stdclist/src/clcfonts.cpp +++ b/src/core/stdclist/src/clcfonts.cpp @@ -45,7 +45,7 @@ static clistFontDescr[] = static int FS_FontsChanged(WPARAM, LPARAM) { - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); return 0; } diff --git a/src/core/stdclist/src/clcopts.cpp b/src/core/stdclist/src/clcopts.cpp index 7f3d5a69ed..0450672c0d 100644 --- a/src/core/stdclist/src/clcopts.cpp +++ b/src/core/stdclist/src/clcopts.cpp @@ -261,7 +261,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam db_set_b(NULL, "CLC", "NoVScrollBar", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0)); db_set_b(NULL, "CLC", "RowHeight", (BYTE)SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0)); db_set_b(NULL, "CLC", "GammaCorrect", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT)); - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); return TRUE; } break; @@ -409,7 +409,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, flags |= CLBF_PROPORTIONAL; db_set_w(NULL, "CLC", "BkBmpUse", flags); } - pcli->pfnClcOptionsChanged(); + Clist_ClcOptionsChanged(); return TRUE; } break; 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