From f580be3d9dcccb14831d6bed9e7dfca600f5b6f8 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 6 Mar 2019 16:15:45 +0300 Subject: popups: - internal implementation details & all service declarations moved to m_popup_int.h; - all service calls removed and replaced with function calls; - direct access to popup serttings replaced with Popup_Enable / Popup_Enabled; --- plugins/ChangeKeyboardLayout/src/hook_events.cpp | 4 ++-- plugins/ChangeKeyboardLayout/src/options.cpp | 6 ++---- plugins/ChangeKeyboardLayout/src/text_operations.cpp | 5 ++--- 3 files changed, 6 insertions(+), 9 deletions(-) (limited to 'plugins/ChangeKeyboardLayout/src') diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index 9cdf91d010..884182159e 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -80,7 +80,7 @@ void RegPopupActions() poOptions.paActions[0].flags = PAF_ENABLED; poOptions.paActions[0].wParam = poOptions.paActions[0].lParam = 0; poOptions.paActions[0].lchIcon = hCopyIcon; - CallService(MS_POPUP_REGISTERACTIONS, (WPARAM)&poOptions.paActions, 1); + PURegisterActions(poOptions.paActions, 1); } int OnIconsChanged(WPARAM, LPARAM) @@ -187,7 +187,7 @@ LRESULT CALLBACK Keyboard_Hook(int code, WPARAM wParam, LPARAM lParam) int CALLBACK CKLPopupDlgProc(HWND hWnd, UINT uiMessage, WPARAM wParam, LPARAM lParam) { - LPTSTR ptszPopupText = (LPTSTR)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd, (LPARAM)&ptszPopupText); + LPTSTR ptszPopupText = (LPTSTR)PUGetPluginData(hWnd); switch (uiMessage) { case WM_COMMAND: diff --git a/plugins/ChangeKeyboardLayout/src/options.cpp b/plugins/ChangeKeyboardLayout/src/options.cpp index a8a4e11be5..257acb225f 100644 --- a/plugins/ChangeKeyboardLayout/src/options.cpp +++ b/plugins/ChangeKeyboardLayout/src/options.cpp @@ -352,8 +352,7 @@ INT_PTR CALLBACK DlgPopupsProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, if ((HIWORD(wParam) == BN_CLICKED )) { ptszPopupPreviewText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)); - POPUPDATAW_V2 pdtData = { 0 }; - pdtData.cbSize = sizeof(pdtData); + POPUPDATAW pdtData = { 0 }; wcsncpy(pdtData.lpwzContactName, TranslateT(MODULENAME), MAX_CONTACTNAME); wcsncpy(pdtData.lpwzText, L"Ghbdtn? rfr ltkf&", MAX_SECONDLINE); @@ -389,8 +388,7 @@ INT_PTR CALLBACK DlgPopupsProcOptions(HWND hWnd, UINT uiMessage, WPARAM wParam, pdtData.lpActions = poOptions.paActions; pdtData.actionCount = 1; pdtData.PluginWindowProc = (WNDPROC)CKLPopupDlgProc; - - if (PUAddPopupW( &pdtData, APF_NEWDATA) < 0) + if (PUAddPopupW(&pdtData) < 0) mir_free(ptszPopupPreviewText); } break; diff --git a/plugins/ChangeKeyboardLayout/src/text_operations.cpp b/plugins/ChangeKeyboardLayout/src/text_operations.cpp index d1d2d05a65..094edd431f 100644 --- a/plugins/ChangeKeyboardLayout/src/text_operations.cpp +++ b/plugins/ChangeKeyboardLayout/src/text_operations.cpp @@ -448,8 +448,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) LPTSTR ptszPopupText = (LPTSTR)mir_alloc(MaxTextSize*sizeof(wchar_t)); mir_wstrcpy(ptszPopupText, ptszMBox); - POPUPDATAW_V2 pdtData = { 0 }; - pdtData.cbSize = sizeof(pdtData); + POPUPDATAW pdtData = { 0 }; wcsncpy(pdtData.lpwzContactName, TranslateT(MODULENAME), MAX_CONTACTNAME); wcsncpy(pdtData.lpwzText, ptszPopupText, MAX_SECONDLINE); @@ -486,7 +485,7 @@ int ChangeLayout(HWND hTextWnd, BYTE TextOperation, BOOL CurrentWord) pdtData.lpActions = poOptions.paActions; pdtData.actionCount = 1; - if (PUAddPopupW(&pdtData, APF_NEWDATA) < 0) { + if (PUAddPopupW(&pdtData) < 0) { mir_free(ptszPopupText); MessageBox(nullptr, ptszMBox, TranslateT(MODULENAME), MB_ICONINFORMATION); } -- cgit v1.2.3