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/MirLua/Modules/m_popup/src/main.cpp | 12 ++++++------ plugins/MirLua/Modules/m_popup/src/stdafx.h | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'plugins/MirLua/Modules') diff --git a/plugins/MirLua/Modules/m_popup/src/main.cpp b/plugins/MirLua/Modules/m_popup/src/main.cpp index 0699967031..6980e38587 100644 --- a/plugins/MirLua/Modules/m_popup/src/main.cpp +++ b/plugins/MirLua/Modules/m_popup/src/main.cpp @@ -41,7 +41,7 @@ static int lua_AddPopup(lua_State *L) mir_ptr ppd(MakePopupData(L)); - INT_PTR res = ::PUAddPopupW(ppd); + INT_PTR res = (INT_PTR)::PUAddPopupW(ppd); lua_pushinteger(L, res); return 1; @@ -60,11 +60,11 @@ static POPUPDATA2* MakePopupData2(lua_State *L) ppd->flags |= PU2_UNICODE; lua_getfield(L, -1, "Title"); - ppd->lptzTitle = mir_utf8decodeW(lua_tostring(L, -1)); + ppd->szTitle.w = mir_utf8decodeW(lua_tostring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "Text"); - ppd->lpwzText = mir_utf8decodeW(luaL_checkstring(L, -1)); + ppd->szText.w = mir_utf8decodeW(luaL_checkstring(L, -1)); lua_pop(L, 1); lua_getfield(L, -1, "hContact"); @@ -104,11 +104,11 @@ static int lua_AddPopup2(lua_State *L) mir_ptr ppd(MakePopupData2(L)); - INT_PTR res = ::CallService(MS_POPUP_ADDPOPUP2, (WPARAM)ppd, 0); + INT_PTR res = (INT_PTR)Popup_Add(ppd.get()); lua_pushinteger(L, res); - mir_free(ppd->lptzTitle); - mir_free(ppd->lpwzText); + mir_free(ppd->szTitle.w); + mir_free(ppd->szText.w); return 1; } diff --git a/plugins/MirLua/Modules/m_popup/src/stdafx.h b/plugins/MirLua/Modules/m_popup/src/stdafx.h index e6f48ac834..88ef46230a 100644 --- a/plugins/MirLua/Modules/m_popup/src/stdafx.h +++ b/plugins/MirLua/Modules/m_popup/src/stdafx.h @@ -7,6 +7,7 @@ #include #include +#include #include #endif //_COMMON_H_ \ No newline at end of file -- cgit v1.2.3