summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikalaiR <nikolay.romanovich@narod.ru>2016-01-07 19:22:07 +0000
committerMikalaiR <nikolay.romanovich@narod.ru>2016-01-07 19:22:07 +0000
commit86f9e6be8bbdb7eabf2b92b72597c9802a71854a (patch)
tree33c2f8affe3f8701c85293e80e58d26514a673e3
parent2ca13af6059822110075a1666ce334d1595732da (diff)
Popup: LoadSkin service
git-svn-id: http://svn.miranda-ng.org/main/trunk@16052 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Popup/src/main.cpp2
-rw-r--r--plugins/Popup/src/services.cpp17
-rw-r--r--plugins/Popup/src/services.h2
3 files changed, 21 insertions, 0 deletions
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index 8a8fd046e3..793b33f097 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -389,6 +389,8 @@ MIRAPI int Load(void)
CreateServiceFunction(MS_POPUP_DESTROYPOPUP, Popup_DeletePopup);
+ CreateServiceFunction("Popup/LoadSkin", Popup_LoadSkin);
+
// load icons / create hook
InitIcons();
HookEvent(ME_SKIN2_ICONSCHANGED, IconsChanged);
diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp
index b2c3887c4c..4be78c8a12 100644
--- a/plugins/Popup/src/services.cpp
+++ b/plugins/Popup/src/services.cpp
@@ -474,4 +474,21 @@ INT_PTR Popup_CreateClassPopup(WPARAM wParam, LPARAM lParam)
INT_PTR Popup_DeletePopup(WPARAM, LPARAM lParam)
{
return (INT_PTR)SendMessage((HWND)lParam, UM_DESTROYPOPUP, 0, 0);
+}
+
+INT_PTR Popup_LoadSkin(WPARAM, LPARAM lParam)
+{
+ if (lParam)
+ {
+ mir_free(PopupOptions.SkinPack);
+ PopupOptions.SkinPack = mir_a2t((char*)lParam);
+ }
+
+ const PopupSkin *skin = 0;
+ if (skin = skins.getSkin(PopupOptions.SkinPack)) {
+ mir_free(PopupOptions.SkinPack);
+ PopupOptions.SkinPack = mir_tstrdup(skin->getName());
+ }
+
+ return 1;
} \ No newline at end of file
diff --git a/plugins/Popup/src/services.h b/plugins/Popup/src/services.h
index b47f04f397..6851c26350 100644
--- a/plugins/Popup/src/services.h
+++ b/plugins/Popup/src/services.h
@@ -53,4 +53,6 @@ INT_PTR Popup_UnregisterPopupClass(WPARAM wParam, LPARAM lParam);
INT_PTR Popup_CreateClassPopup(WPARAM wParam, LPARAM lParam);
INT_PTR Popup_DeletePopup(WPARAM, LPARAM lParam);
+INT_PTR Popup_LoadSkin(WPARAM, LPARAM lParam);
+
#endif // __services_h__