summaryrefslogtreecommitdiff
path: root/plugins/MirLua
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2019-03-06 16:15:45 +0300
committerGeorge Hazan <ghazan@miranda.im>2019-03-06 16:15:55 +0300
commitf580be3d9dcccb14831d6bed9e7dfca600f5b6f8 (patch)
tree468913d477b9d2a9fb430df9a886d24a8cf41887 /plugins/MirLua
parent827dbce0a554ccc313fd0b14b45bd57dffeead95 (diff)
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;
Diffstat (limited to 'plugins/MirLua')
-rw-r--r--plugins/MirLua/Modules/m_popup/src/main.cpp12
-rw-r--r--plugins/MirLua/Modules/m_popup/src/stdafx.h1
-rw-r--r--plugins/MirLua/src/utils.cpp2
3 files changed, 8 insertions, 7 deletions
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<POPUPDATAW> 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<POPUPDATA2> 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 <m_core.h>
#include <m_utils.h>
+#include <m_database.h>
#include <m_popup.h>
#endif //_COMMON_H_ \ No newline at end of file
diff --git a/plugins/MirLua/src/utils.cpp b/plugins/MirLua/src/utils.cpp
index d17301214e..d5d7658f3c 100644
--- a/plugins/MirLua/src/utils.cpp
+++ b/plugins/MirLua/src/utils.cpp
@@ -21,7 +21,7 @@ void ShowNotification(const char *caption, const char *message, int flags, MCONT
if (Miranda_IsTerminated())
return;
- if (db_get_b(0, "Popup", "ModuleIsEnabled", 1)) {
+ if (Popup_Enabled()) {
POPUPDATA ppd = { 0 };
ppd.lchContact = hContact;
mir_strncpy(ppd.lpzContactName, caption, MAX_CONTACTNAME);