diff options
Diffstat (limited to 'plugins/MobileState/src/main.cpp')
-rw-r--r-- | plugins/MobileState/src/main.cpp | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/plugins/MobileState/src/main.cpp b/plugins/MobileState/src/main.cpp index 46a3f348f1..2ced60c6cb 100644 --- a/plugins/MobileState/src/main.cpp +++ b/plugins/MobileState/src/main.cpp @@ -19,10 +19,15 @@ #include "stdafx.h"
-HINSTANCE g_hInst;
int hLangpack;
+CMPlugin g_plugin;
+
HANDLE hExtraIcon = nullptr;
+static IconItem icon = { LPGEN("Mobile State"), "mobile_icon", IDI_MOBILE };
+
+/////////////////////////////////////////////////////////////////////////////////////////
+
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -36,19 +41,13 @@ PLUGININFOEX pluginInfo = { { 0xf0ba32d0, 0xcd07, 0x4a9c, { 0x92, 0x6b, 0x5a, 0x1f, 0xf2, 0x1c, 0x3c, 0x10 } }
};
-static IconItem icon = { LPGEN("Mobile State"), "mobile_icon", IDI_MOBILE };
-
-BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
-{
- g_hInst = hinstDLL;
- return TRUE;
-}
-
extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD)
{
return &pluginInfo;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
bool hasMobileClient(MCONTACT hContact, LPARAM)
{
char *proto = GetContactProto(hContact);
@@ -67,7 +66,9 @@ bool hasMobileClient(MCONTACT hContact, LPARAM) return false;
}
-int ExtraIconsApply(WPARAM wParam, LPARAM lParam)
+/////////////////////////////////////////////////////////////////////////////////////////
+
+static int ExtraIconsApply(WPARAM wParam, LPARAM lParam)
{
if (wParam == NULL)
return 0;
@@ -80,7 +81,7 @@ int ExtraIconsApply(WPARAM wParam, LPARAM lParam) return 0;
}
-int onContactSettingChanged(WPARAM wParam, LPARAM lParam)
+static int onContactSettingChanged(WPARAM wParam, LPARAM lParam)
{
char *proto = GetContactProto(wParam);
if (!proto)
@@ -93,7 +94,7 @@ int onContactSettingChanged(WPARAM wParam, LPARAM lParam) return 0;
}
-int onModulesLoaded(WPARAM, LPARAM)
+static int onModulesLoaded(WPARAM, LPARAM)
{
// Set initial value for all contacts
for (auto &hContact : Contacts())
@@ -111,13 +112,15 @@ extern "C" int __declspec(dllexport) Load(void) HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, ExtraIconsApply);
// IcoLib support
- Icon_Register(g_hInst, "Mobile State", &icon, 1);
+ Icon_Register(g_plugin.getInst(), "Mobile State", &icon, 1);
// Extra icons
hExtraIcon = ExtraIcon_RegisterIcolib("mobilestate", LPGEN("Mobile State"), "mobile_icon");
return 0;
}
+/////////////////////////////////////////////////////////////////////////////////////////
+
extern "C" int __declspec(dllexport) Unload(void)
{
return 0;
|