summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/delphi/m_message.inc112
-rw-r--r--include/m_message.h10
-rw-r--r--include/m_skin.h2
-rw-r--r--libs/win32/mir_app.libbin188990 -> 189220 bytes
-rw-r--r--libs/win64/mir_app.libbin184906 -> 185116 bytes
-rw-r--r--plugins/CountryFlags/src/extraimg.cpp2
-rw-r--r--plugins/FavContacts/src/services.cpp2
-rw-r--r--plugins/FingerprintNG/src/fingerprint.cpp2
-rw-r--r--plugins/HistorySweeperLight/src/main.cpp14
-rw-r--r--plugins/HistorySweeperLight/src/options.cpp12
-rw-r--r--plugins/MessageState/src/messagestate.cpp6
-rw-r--r--plugins/MirOTR/src/svcs_srmm.cpp2
-rwxr-xr-xplugins/New_GPG/src/init.cpp4
-rw-r--r--plugins/NoHistory/src/dllmain.cpp4
-rw-r--r--plugins/Popup/src/srmm_menu.cpp8
-rw-r--r--plugins/SecureIM/src/svcs_srmm.cpp8
-rw-r--r--plugins/SpellChecker/src/spellchecker.cpp4
-rw-r--r--plugins/TabSRMM/src/controls.cpp4
-rw-r--r--plugins/UserInfoEx/src/Flags/svc_flags.cpp2
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp2
-rw-r--r--src/mir_app/src/meta_services.cpp2
-rw-r--r--src/mir_app/src/mir_app.def1
-rw-r--r--src/mir_app/src/mir_app64.def1
-rw-r--r--src/mir_app/src/skinicons.cpp39
-rw-r--r--src/mir_app/src/srmm_statusicon.cpp45
25 files changed, 95 insertions, 193 deletions
diff --git a/include/delphi/m_message.inc b/include/delphi/m_message.inc
index c564f602f6..4cba1c6171 100644
--- a/include/delphi/m_message.inc
+++ b/include/delphi/m_message.inc
@@ -36,32 +36,6 @@ const
MS_MSG_SENDMESSAGE :PAnsiChar = 'SRMsg/SendCommand';
MS_MSG_SENDMESSAGEW:PAnsiChar = 'SRMsg/SendCommandW';
- ME_MSG_WINDOWEVENT:PAnsiChar = 'MessageAPI/WindowEvent';
-
- MS_MSG_CONVERS:PAnsiChar = 'SRMsg/LaunchMessageWindow';
-
- {wparam=0 }
- {lparam=(WPARAM)(MessageWindowEventData*)hWindowEvent; }
- {Event types }
- MSG_WINDOW_EVT_OPENING = 1; // window is about to be opened
- MSG_WINDOW_EVT_OPEN = 2; // window has been opened
- MSG_WINDOW_EVT_CLOSING = 3; // window is about to be closed
- MSG_WINDOW_EVT_CLOSE = 4; // window has been closed
-
-const
- { wparam=0
- lparam=0
- Returns a dword with the current message api version
- Current version is 0,0,0,4
- }
- MS_MSG_GETWINDOWAPI:PAnsiChar = 'MessageAPI/WindowAPI';
-
- { wparam=(AnsiChar*)szBuf
- lparam=(int)cbSize size of buffer
- Sets the window class name in wParam (ex. "SRMM" for srmm.dll)
- }
- MS_MSG_GETWINDOWCLASS:PAnsiChar = 'MessageAPI/WindowClass';
-
const
MSG_WINDOW_STATE_EXISTS = $00000001; // Window exists should always be true if hwndWindow exists
MSG_WINDOW_STATE_VISIBLE = $00000002;
@@ -78,90 +52,4 @@ type
function Srmm_GetWindowData(hContact:TMCONTACT; pResult:PMessageWindowData) : int; stdcall; external AppDll;
-{ wparam=0(unused)
- lparam=(pMessageWindowEvent) event written
- fired before SRMM writes an entered message into the database
-}
-
-type
- pMessageWindowEvent = ^tMessageWindowEvent;
- tMessageWindowEvent = record
- seq :int; // number returned by PSS_MESSAGE
- hContact :TMCONTACT;
- dbei :PDBEVENTINFO; // database event written on the basis of message sent
- end;
-
-const
- ME_MSG_PRECREATEEVENT:PAnsiChar = 'MessageAPI/PreCreateEvent';
-
-{ wParam = 0
- lParam = (MessageWindowPopupData *)&MessageWindowPopupData;
- Fired to allow plugins to add itens to the msg window popup menu
- Always fired twice: once with MSG_WINDOWPOPUP_SHOWING and once with MSG_WINDOWPOPUP_SELECTED.
- This is done to allow cleaning of resources.
-}
- ME_MSG_WINDOWPOPUP:PAnsiChar = 'MessageAPI/WindowPopupRequested';
-
- MSG_WINDOWPOPUP_SHOWING = 1;
- MSG_WINDOWPOPUP_SELECTED = 2;
-
- MSG_WINDOWPOPUP_INPUT = 1;
- MSG_WINDOWPOPUP_LOG = 2;
-
-type
- tMessageWindowPopupData = record
- uType :uint; // see popup types above
- uFlags :uint; // used to indicate in which window the popup was requested
- hContact :TMCONTACT;
- hwnd :HWND; // window where the popup was requested
- hMenu :HMENU; // The handle to the menu
- pt :TPOINT; // The point, in screen coords
- selection:int; // The menu control id or 0 if no one was selected
- end;
-
-// status icons
-const
- MBF_DISABLED = 1;
- MBF_HIDDEN = 2;
- MBF_UNICODE = 4;
-
-type
- pStatusIconData = ^tStatusIconData;
- tStatusIconData = record
- szModule :PAnsiChar; // used in combo with the dwId below to create a unique identifier
- dwId :dword; // uniquely defines a button inside a module
- hIcon,
- hIconDisabled:HICON; // hIconDisabled is optional - if null, will use hIcon in the disabled state
- flags :int; // one of MBF_* above
- szTooltip :TChar; // controlled by MBF_UNICODE
- end;
-
-const
- MBCF_RIGHTBUTTON = 1; // if this flag is specified, the click was a right button -
- // otherwize it was a left click
-
-type
- pStatusIconClickData = ^tStatusIconClickData;
- tStatusIconClickData = record
- clickLocation:TPOINT; // click location, in screen coordinates
- szModule :PAnsiChar;
- dwId :dword;
- flags :int; // one of MBCF_* above
- end;
-
-const
-{
- wParam = (HANDLE)hContact;
- lParam = (StatusIconClickData *)&StatusIconClickData;
- catch to show a popup menu, etc.
-}
- ME_MSG_ICONPRESSED:PAnsiChar = 'MessageAPI/IconPressed';
-
-{
- wParam = (HANDLE)hContact;
- lParam = (StatusIconkData*)pIcon
- catch to be notified about the icon list's change.
-}
- ME_MSG_ICONSCHANGED:PAnsiChar = 'MessageAPI/IconsChanged';
-
{$ENDIF}
diff --git a/include/m_message.h b/include/m_message.h
index df1ef4ad2c..b4c2f3ca3d 100644
--- a/include/m_message.h
+++ b/include/m_message.h
@@ -149,15 +149,11 @@ struct MessageWindowPopupData
struct StatusIconData
{
- char *szModule; // used in combo with the dwId below to create a unique identifier
+ const char *szModule; // used in combo with the dwId below to create a unique identifier
DWORD dwId; // uniquely defines a button inside a module
HICON hIcon, hIconDisabled; // hIconDisabled is optional - if null, will use hIcon in the disabled state
int flags; // bitwize OR of MBF_* flags above
- union {
- char *szTooltip; // controlled by MBF_UNICODE
- wchar_t *tszTooltip;
- wchar_t *wszTooltip;
- };
+ MAllCStrings szTooltip; // controlled by MBF_UNICODE
};
#define MBCF_RIGHTBUTTON 0x01 // if this flag is specified, the click was a right button - otherwize it was a left click
@@ -185,7 +181,7 @@ EXTERN_C MIR_APP_DLL(StatusIconData*) Srmm_GetNthIcon(MCONTACT hContact, int ind
struct StatusIconClickData
{
POINT clickLocation; // click location, in screen coordinates
- char *szModule;
+ const char *szModule;
DWORD dwId;
int flags; // bitwize OR of MBCF_* flags above
};
diff --git a/include/m_skin.h b/include/m_skin.h
index 522ead00b9..33ab4e6e49 100644
--- a/include/m_skin.h
+++ b/include/m_skin.h
@@ -93,6 +93,7 @@
/////////////////////////////////////////////////////////////////////////////////////////
// Miranda skin
// in all these functions idx = SKINICON_* constant
+
EXTERN_C MIR_APP_DLL(HICON) Skin_LoadIcon(int idx, bool big = false);
EXTERN_C MIR_APP_DLL(HANDLE) Skin_GetIconHandle(int idx);
EXTERN_C MIR_APP_DLL(char*) Skin_GetIconName(int idx);
@@ -117,6 +118,7 @@ EXTERN_C MIR_APP_DLL(char*) Skin_GetIconName(int idx);
// status icon.
EXTERN_C MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big = false);
+EXTERN_C MIR_APP_DLL(HANDLE) Skin_GetProtoIcon(const char *szProto, int status);
/////////////////////////////////////////////////////////////////////////////////////////
// plays a registered sound
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib
index 8a35106058..44731ab588 100644
--- a/libs/win32/mir_app.lib
+++ b/libs/win32/mir_app.lib
Binary files differ
diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib
index ff1011c12c..e91ada7d49 100644
--- a/libs/win64/mir_app.lib
+++ b/libs/win64/mir_app.lib
Binary files differ
diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp
index 30edfe8e27..90f48993e6 100644
--- a/plugins/CountryFlags/src/extraimg.cpp
+++ b/plugins/CountryFlags/src/extraimg.cpp
@@ -95,7 +95,7 @@ static void __fastcall SetStatusIcon(MCONTACT hContact,int countryNumber)
if (countryNumber != 0xFFFF || bUseUnknown) {
/* copy icon as status icon API will call DestroyIcon() on it */
sid.hIcon = LoadFlagIcon(countryNumber);
- sid.szTooltip = (char*) CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber,0);
+ sid.szTooltip.a = (char*) CallService(MS_UTILS_GETCOUNTRYBYNUMBER,countryNumber,0);
}
else sid.flags = MBF_HIDDEN;
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp
index 70418fd155..b6f1f8d52b 100644
--- a/plugins/FavContacts/src/services.cpp
+++ b/plugins/FavContacts/src/services.cpp
@@ -150,7 +150,7 @@ int ProcessModulesLoaded(WPARAM, LPARAM)
StatusIconData sid = {};
sid.szModule = MODULENAME;
- sid.szTooltip = LPGEN("Favorite Contacts");
+ sid.szTooltip.a = LPGEN("Favorite Contacts");
sid.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib);
sid.hIconDisabled = IcoLib_GetIconByHandle(iconList[1].hIcolib);
Srmm_AddIcon(&sid, &g_plugin);
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp
index fa13019856..cc5d58d3f2 100644
--- a/plugins/FingerprintNG/src/fingerprint.cpp
+++ b/plugins/FingerprintNG/src/fingerprint.cpp
@@ -151,7 +151,7 @@ static void SetSrmmIcon(MCONTACT hContact, LPTSTR ptszMirver)
sid.szModule = MODULENAME;
sid.dwId = 1;
sid.flags = MBF_UNICODE;
- sid.tszTooltip = ptszMirver;
+ sid.szTooltip.w = ptszMirver;
if (mir_wstrlen(ptszMirver))
sid.hIcon = (HICON)ServiceGetClientIconW((WPARAM)ptszMirver, TRUE);
diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp
index 04c3164429..b33612d569 100644
--- a/plugins/HistorySweeperLight/src/main.cpp
+++ b/plugins/HistorySweeperLight/src/main.cpp
@@ -79,32 +79,32 @@ static int OnModulesLoaded(WPARAM, LPARAM)
sid.hIcon = LoadIconEx("actG");
if (sweep == 0)
- sid.szTooltip = LPGEN("Keep all events");
+ sid.szTooltip.a = LPGEN("Keep all events");
else if (sweep == 1)
- sid.szTooltip = time_stamp_strings[g_plugin.getByte("StartupShutdownOlder", 0)];
+ sid.szTooltip.a = time_stamp_strings[g_plugin.getByte("StartupShutdownOlder", 0)];
else if (sweep == 2)
- sid.szTooltip = keep_strings[g_plugin.getByte("StartupShutdownKeep", 0)];
+ sid.szTooltip.a = keep_strings[g_plugin.getByte("StartupShutdownKeep", 0)];
else if (sweep == 3)
- sid.szTooltip = LPGEN("Delete all events");
+ sid.szTooltip.a = LPGEN("Delete all events");
sid.flags = MBF_HIDDEN;
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 1;
sid.hIcon = LoadIconEx("act1");
- sid.szTooltip = time_stamp_strings[g_plugin.getByte("StartupShutdownOlder", 0)];
+ sid.szTooltip.a = time_stamp_strings[g_plugin.getByte("StartupShutdownOlder", 0)];
sid.flags = MBF_HIDDEN;
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 2;
sid.hIcon = LoadIconEx("act2");
- sid.szTooltip = keep_strings[g_plugin.getByte("StartupShutdownKeep", 0)];
+ sid.szTooltip.a = keep_strings[g_plugin.getByte("StartupShutdownKeep", 0)];
sid.flags = MBF_HIDDEN;
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 3;
sid.hIcon = LoadIconEx("actDel");
- sid.szTooltip = LPGEN("Delete all events");
+ sid.szTooltip.a = LPGEN("Delete all events");
sid.flags = MBF_HIDDEN;
Srmm_AddIcon(&sid, &g_plugin);
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp
index e8fd5fdffa..314cfb43d1 100644
--- a/plugins/HistorySweeperLight/src/options.cpp
+++ b/plugins/HistorySweeperLight/src/options.cpp
@@ -168,20 +168,20 @@ void SaveSettings(HWND hwndDlg)
sid.szModule = MODULENAME;
sid.dwId = 0;
sid.hIcon = LoadIconEx("actG");
- if (st == 0) sid.szTooltip = LPGEN("Keep all events");
- else if (st == 1) sid.szTooltip = LPGEN(time_stamp_strings[g_plugin.getByte("StartupShutdownOlder", 0)]);
- else if (st == 2) sid.szTooltip = LPGEN(keep_strings[g_plugin.getByte("StartupShutdownKeep", 0)]);
- else if (st == 3) sid.szTooltip = LPGEN("Delete all events");
+ if (st == 0) sid.szTooltip.a = LPGEN("Keep all events");
+ else if (st == 1) sid.szTooltip.a = LPGEN(time_stamp_strings[g_plugin.getByte("StartupShutdownOlder", 0)]);
+ else if (st == 2) sid.szTooltip.a = LPGEN(keep_strings[g_plugin.getByte("StartupShutdownKeep", 0)]);
+ else if (st == 3) sid.szTooltip.a = LPGEN("Delete all events");
Srmm_ModifyIcon(NULL, &sid);
sid.dwId = 1;
sid.hIcon = LoadIconEx("act1");
- sid.szTooltip = time_stamp_strings[g_plugin.getByte("StartupShutdownOlder", 0)];
+ sid.szTooltip.a = time_stamp_strings[g_plugin.getByte("StartupShutdownOlder", 0)];
Srmm_ModifyIcon(NULL, &sid);
sid.dwId = 2;
sid.hIcon = LoadIconEx("act2");
- sid.szTooltip = keep_strings[g_plugin.getByte("StartupShutdownKeep", 0)];
+ sid.szTooltip.a = keep_strings[g_plugin.getByte("StartupShutdownKeep", 0)];
Srmm_ModifyIcon(NULL, &sid);
}
diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp
index c0ce9dd49d..0e52b1d5ad 100644
--- a/plugins/MessageState/src/messagestate.cpp
+++ b/plugins/MessageState/src/messagestate.cpp
@@ -37,11 +37,11 @@ void SetSRMMIcon(MCONTACT hContact, SRMM_ICON_TYPE type, time_t time)
if (g_plugin.getDword(hActualContact, DBKEY_MESSAGE_READ_TIME_TYPE, -1) == MRD_TYPE_READTIME) {
wchar_t buf[100];
wcsftime(buf, _countof(buf), TranslateT("Last message read at %X %x"), localtime(&time));
- sid.tszTooltip = buf;
+ sid.szTooltip.w = buf;
}
- else sid.tszTooltip = TranslateT("Last message read (unknown time)");
+ else sid.szTooltip.w = TranslateT("Last message read (unknown time)");
}
- else sid.tszTooltip = TranslateW(Tooltips[type]);
+ else sid.szTooltip.w = TranslateW(Tooltips[type]);
}
else sid.flags |= MBF_HIDDEN;
diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp
index c4855a842a..5e006e7841 100644
--- a/plugins/MirOTR/src/svcs_srmm.cpp
+++ b/plugins/MirOTR/src/svcs_srmm.cpp
@@ -120,7 +120,7 @@ void InitSRMM()
sid.hIcon = hIconFinished;
sid.hIconDisabled = hIconNotSecure;
sid.flags = MBF_DISABLED | MBF_HIDDEN;
- sid.szTooltip = LANG_OTR_TOOLTIP;
+ sid.szTooltip.a = LANG_OTR_TOOLTIP;
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 1;
diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp
index 5bf6631a74..673702f33a 100755
--- a/plugins/New_GPG/src/init.cpp
+++ b/plugins/New_GPG/src/init.cpp
@@ -113,12 +113,12 @@ static int OnModulesLoaded(WPARAM, LPARAM)
sid.flags = MBF_HIDDEN;
sid.dwId = 0x00000001;
sid.hIcon = IcoLib_GetIcon("secured");
- sid.szTooltip = LPGEN("GPG Turn off encryption");
+ sid.szTooltip.a = LPGEN("GPG Turn off encryption");
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 0x00000002;
sid.hIcon = IcoLib_GetIcon("unsecured");
- sid.szTooltip = LPGEN("GPG Turn on encryption");
+ sid.szTooltip.a = LPGEN("GPG Turn on encryption");
Srmm_AddIcon(&sid, &g_plugin);
if (globals.bJabberAPI) {
diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp
index f26ddc02e6..4197106333 100644
--- a/plugins/NoHistory/src/dllmain.cpp
+++ b/plugins/NoHistory/src/dllmain.cpp
@@ -220,12 +220,12 @@ void SrmmMenu_Load()
sid.szModule = MODULENAME;
sid.dwId = 0;
- sid.szTooltip = LPGEN("History Enabled");
+ sid.szTooltip.a = LPGEN("History Enabled");
sid.hIcon = sid.hIconDisabled = hIconKeep;
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 1;
- sid.szTooltip = LPGEN("History Disabled");
+ sid.szTooltip.a = LPGEN("History Disabled");
sid.hIcon = sid.hIconDisabled = hIconRemove;
Srmm_AddIcon(&sid, &g_plugin);
diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp
index 633532f477..a506c82e1c 100644
--- a/plugins/Popup/src/srmm_menu.cpp
+++ b/plugins/Popup/src/srmm_menu.cpp
@@ -108,22 +108,22 @@ void SrmmMenu_Load()
sid.szModule = MODULENAME;
sid.dwId = 0;
- sid.szTooltip = LPGEN("Popup Mode: Auto");
+ sid.szTooltip.a = LPGEN("Popup Mode: Auto");
sid.hIcon = sid.hIconDisabled = Skin_LoadIcon(SKINICON_OTHER_POPUP);
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 1;
- sid.szTooltip = LPGEN("Popup Mode: Favorite");
+ sid.szTooltip.a = LPGEN("Popup Mode: Favorite");
sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_OPT_FAVORITE);
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 2;
- sid.szTooltip = LPGEN("Popup Mode: Ignore fullscreen");
+ sid.szTooltip.a = LPGEN("Popup Mode: Ignore fullscreen");
sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_OPT_FULLSCREEN);
Srmm_AddIcon(&sid, &g_plugin);
sid.dwId = 3;
- sid.szTooltip = LPGEN("Popup Mode: Block contact");
+ sid.szTooltip.a = LPGEN("Popup Mode: Block contact");
sid.hIcon = sid.hIconDisabled = Skin_LoadIcon(SKINICON_OTHER_NOPOPUP);
Srmm_AddIcon(&sid, &g_plugin);
diff --git a/plugins/SecureIM/src/svcs_srmm.cpp b/plugins/SecureIM/src/svcs_srmm.cpp
index 1d9f0f065f..09323c5cd4 100644
--- a/plugins/SecureIM/src/svcs_srmm.cpp
+++ b/plugins/SecureIM/src/svcs_srmm.cpp
@@ -39,28 +39,28 @@ void InitSRMMIcons()
sid.dwId = MODE_NATIVE;
sid.hIcon = mode2icon(MODE_NATIVE | SECURED, 3);
sid.hIconDisabled = mode2icon(MODE_NATIVE, 3);
- sid.szTooltip = LPGEN("SecureIM [Native]");
+ sid.szTooltip.a = LPGEN("SecureIM [Native]");
Srmm_AddIcon(&sid, &g_plugin);
// PGP
sid.dwId = MODE_PGP;
sid.hIcon = mode2icon(MODE_PGP | SECURED, 3);
sid.hIconDisabled = mode2icon(MODE_PGP, 3);
- sid.szTooltip = LPGEN("SecureIM [PGP]");
+ sid.szTooltip.a = LPGEN("SecureIM [PGP]");
Srmm_AddIcon(&sid, &g_plugin);
// GPG
sid.dwId = MODE_GPG;
sid.hIcon = mode2icon(MODE_GPG | SECURED, 3);
sid.hIconDisabled = mode2icon(MODE_GPG, 3);
- sid.szTooltip = LPGEN("SecureIM [GPG]");
+ sid.szTooltip.a = LPGEN("SecureIM [GPG]");
Srmm_AddIcon(&sid, &g_plugin);
// RSAAES
sid.dwId = MODE_RSAAES;
sid.hIcon = mode2icon(MODE_RSAAES | SECURED, 3);
sid.hIconDisabled = mode2icon(MODE_RSAAES, 3);
- sid.szTooltip = LPGEN("SecureIM [RSA/AES]");
+ sid.szTooltip.a = LPGEN("SecureIM [RSA/AES]");
Srmm_AddIcon(&sid, &g_plugin);
// hook the window events so that we can can change the status of the icon
diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp
index 348946325e..0d99fb96b6 100644
--- a/plugins/SpellChecker/src/spellchecker.cpp
+++ b/plugins/SpellChecker/src/spellchecker.cpp
@@ -74,7 +74,7 @@ static int IconsChanged(WPARAM, LPARAM)
wchar_t tmp[128];
mir_snwprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name);
- sid.tszTooltip = tmp;
+ sid.szTooltip.w = tmp;
HICON hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled");
sid.hIcon = CopyIcon(hIcon);
@@ -194,7 +194,7 @@ static int ModulesLoaded(WPARAM, LPARAM)
wchar_t tmp[128];
mir_snwprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name);
- sid.tszTooltip = tmp;
+ sid.szTooltip.w = tmp;
sid.hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled");
Srmm_AddIcon(&sid, &g_plugin);
}
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index 7a940de17b..5d0a735fd5 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -970,8 +970,8 @@ LONG_PTR CALLBACK CTabBaseDlg::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM
else if (sid->dwId == MSG_ICON_SESSION)
wcsncpy_s(wBuf, TranslateT("Session list.\nClick left for a list of open sessions.\nClick right to access favorites and quickly configure message window behavior"), _TRUNCATE);
}
- else if (sid->tszTooltip)
- wcsncpy(wBuf, sid->tszTooltip, _countof(wBuf));
+ else if (sid->szTooltip.w)
+ wcsncpy_s(wBuf, sid->szTooltip.w, _TRUNCATE);
if (wBuf[0]) {
CallService("mToolTip/ShowTipW", (WPARAM)wBuf, (LPARAM)&ti);
diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
index 2dbeb04ac8..b17f9faa0b 100644
--- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp
+++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp
@@ -103,7 +103,7 @@ void MsgWndData::FlagsIconSet()
sid.flags = MBF_HIDDEN;
if (m_countryID != 0xFFFF || g_bUseUnknownFlag) {
sid.hIcon = LoadFlagIcon(m_countryID);
- sid.szTooltip = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, m_countryID, 0));
+ sid.szTooltip.a = Translate((char*)CallService(MS_UTILS_GETCOUNTRYBYNUMBER, m_countryID, 0));
}
else sid.flags = MBF_HIDDEN;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 469a6b8626..7e0fad12dc 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -283,7 +283,7 @@ void CJabberProto::OnModulesLoaded()
sid.szModule = m_szModuleName;
sid.hIcon = LoadIconEx("main");
sid.flags = MBF_HIDDEN;
- sid.szTooltip = LPGEN("Jabber Resource");
+ sid.szTooltip.a = LPGEN("Jabber Resource");
Srmm_AddIcon(&sid, &g_plugin);
HookProtoEvent(ME_MSG_ICONPRESSED, &CJabberProto::OnProcessSrmmIconClick);
diff --git a/src/mir_app/src/meta_services.cpp b/src/mir_app/src/meta_services.cpp
index 39874a71c9..b54e652c56 100644
--- a/src/mir_app/src/meta_services.cpp
+++ b/src/mir_app/src/meta_services.cpp
@@ -631,7 +631,7 @@ int Meta_ModulesLoaded(WPARAM, LPARAM)
StatusIconData sid = {};
sid.szModule = META_PROTO;
sid.flags = MBF_UNICODE;
- sid.tszTooltip = LPGENW("Select metacontact");
+ sid.szTooltip.w = LPGENW("Select metacontact");
sid.hIcon = Skin_LoadProtoIcon(META_PROTO, ID_STATUS_ONLINE);
Srmm_AddIcon(&sid, &g_plugin);
return 0;
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def
index 26df34bbb4..a1730123f0 100644
--- a/src/mir_app/src/mir_app.def
+++ b/src/mir_app/src/mir_app.def
@@ -673,3 +673,4 @@ Popup_Enabled @762
Popup_AddClass @763
Popup_Add @764
Popup_Change @765
+Skin_GetProtoIcon @766
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def
index 44315b8df0..1cda05d3e1 100644
--- a/src/mir_app/src/mir_app64.def
+++ b/src/mir_app/src/mir_app64.def
@@ -673,3 +673,4 @@ Popup_Enabled @762
Popup_AddClass @763
Popup_Add @764
Popup_Change @765
+Skin_GetProtoIcon @766
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp
index 7ed66af300..8daff88fa2 100644
--- a/src/mir_app/src/skinicons.cpp
+++ b/src/mir_app/src/skinicons.cpp
@@ -230,6 +230,11 @@ MIR_APP_DLL(void) Button_FreeIcon_IcoLib(HWND hwndDlg, int itemId)
MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
{
+ return IcoLib_GetIconByHandle(Skin_GetProtoIcon(szProto, status), big);
+}
+
+MIR_APP_DLL(HANDLE) Skin_GetProtoIcon(const char *szProto, int status)
+{
char iconName[MAX_PATH];
INT_PTR caps2;
if (szProto == nullptr)
@@ -239,7 +244,7 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
if (IsStatusConnecting(status)) {
mir_snprintf(iconName, "%s%d", mainIconsFmt, 7);
- return IcoLib_GetIcon(iconName, big);
+ return IcoLib_GetIconHandle(iconName);
}
int statusIndx = -1;
@@ -259,26 +264,28 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
// format: core_status_%proto%statusindex
mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx);
- HICON hIcon = IcoLib_GetIcon(iconName, big);
- if (hIcon)
- return hIcon;
+ HANDLE hIcolib = IcoLib_GetIconHandle(iconName);
+ if (hIcolib)
+ return hIcolib;
}
// format: core_status_%s%d
mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx);
- return IcoLib_GetIcon(iconName, big);
+ return IcoLib_GetIconHandle(iconName);
}
// format: core_status_%s%d
mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx);
- HICON hIcon = IcoLib_GetIcon(iconName, big);
- if (hIcon == nullptr && (caps2 == 0 || (caps2 & statusIcons[statusIndx].pf2))) {
+ if (HANDLE hIcolib = IcoLib_GetIconHandle(iconName))
+ return hIcolib;
+
+ // Queried protocol isn't in list, adding them
+ if (caps2 == 0 || (caps2 & statusIcons[statusIndx].pf2)) {
PROTOACCOUNT *pa = Proto_GetAccount(szProto);
if (pa) {
wchar_t szPath[MAX_PATH], szFullPath[MAX_PATH], *str;
GetModuleFileName(nullptr, szPath, _countof(szPath));
- // Queried protocol isn't in list, adding
wchar_t tszSection[MAX_PATH];
mir_snwprintf(tszSection, _A2W(PROTOCOLS_PREFIX)L"/%s", pa->tszAccountName);
@@ -289,11 +296,13 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
str = wcsrchr(szPath, '\\');
if (str != nullptr)
*str = 0;
+
mir_snwprintf(szFullPath, L"%s\\Icons\\proto_%S.dll", szPath, pa->szProtoName);
if (GetFileAttributes(szFullPath) != INVALID_FILE_ATTRIBUTES)
sid.defaultFile.w = szFullPath;
else {
mir_snwprintf(szFullPath, L"%s\\Plugins\\%S.dll", szPath, szProto);
+ HICON hIcon = nullptr;
if (int(ExtractIconEx(szFullPath, statusIcons[statusIndx].resource_id, nullptr, &hIcon, 1)) > 0) {
DestroyIcon(hIcon);
sid.defaultFile.w = szFullPath;
@@ -328,17 +337,15 @@ MIR_APP_DLL(HICON) Skin_LoadProtoIcon(const char *szProto, int status, bool big)
// format: core_status_%s%d
mir_snprintf(iconName, "%s%s%d", statusIconsFmt, szProto, statusIndx);
- hIcon = IcoLib_GetIcon(iconName, big);
- if (hIcon)
- return hIcon;
+ if (HANDLE hIcolib = IcoLib_GetIconHandle(iconName))
+ return hIcolib;
}
- if (hIcon == nullptr) {
- mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx);
- hIcon = IcoLib_GetIcon(iconName, big);
- }
+ mir_snprintf(iconName, "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, statusIndx);
+ if (HANDLE hIcolib = IcoLib_GetIconHandle(iconName))
+ return hIcolib;
- return hIcon;
+ return nullptr;
}
MIR_APP_DLL(HANDLE) Skin_GetIconHandle(int idx)
diff --git a/src/mir_app/src/srmm_statusicon.cpp b/src/mir_app/src/srmm_statusicon.cpp
index 27c5f48def..2b737edb19 100644
--- a/src/mir_app/src/srmm_statusicon.cpp
+++ b/src/mir_app/src/srmm_statusicon.cpp
@@ -44,13 +44,14 @@ struct StatusIconChild : public MZeroedObject
{
SafeDestroyIcon(hIcon);
SafeDestroyIcon(hIconDisabled);
- mir_free(tszTooltip);
+ mir_free(pwszTooltip);
}
MCONTACT hContact;
- HICON hIcon, hIconDisabled;
+ HICON hIcon, hIconDisabled;
+ HANDLE hIcolibOn, hIcolibOff;
int flags;
- wchar_t *tszTooltip;
+ wchar_t *pwszTooltip;
};
struct StatusIconMain : public MZeroedObject
@@ -61,12 +62,13 @@ struct StatusIconMain : public MZeroedObject
~StatusIconMain()
{
- mir_free(sid.szModule);
- mir_free(sid.szTooltip);
+ mir_free((void*)sid.szModule);
+ mir_free((void*)sid.szTooltip.w);
}
StatusIconData sid;
+ HANDLE hIcolibOn, hIcolibOff;
HPLUGIN pPlugin;
OBJLIST<StatusIconChild> arChildren;
};
@@ -80,7 +82,7 @@ static int CompareIcons(const StatusIconMain *p1, const StatusIconMain *p2)
return p1->sid.dwId - p2->sid.dwId;
}
-static OBJLIST<StatusIconMain> arIcons(3, CompareIcons);
+static OBJLIST<StatusIconMain> arIcons(10, CompareIcons);
/////////////////////////////////////////////////////////////////////////////////////////
@@ -97,10 +99,12 @@ MIR_APP_DLL(int) Srmm_AddIcon(StatusIconData *sid, HPLUGIN pPlugin)
memcpy(&p->sid, sid, sizeof(p->sid));
p->pPlugin = pPlugin;
p->sid.szModule = mir_strdup(sid->szModule);
+ p->hIcolibOn = IcoLib_IsManaged(sid->hIcon);
+ p->hIcolibOff = IcoLib_IsManaged(sid->hIconDisabled);
if (sid->flags & MBF_UNICODE)
- p->sid.tszTooltip = mir_wstrdup(sid->wszTooltip);
+ p->sid.szTooltip.w = mir_wstrdup(sid->szTooltip.w);
else
- p->sid.tszTooltip = mir_a2u(sid->szTooltip);
+ p->sid.szTooltip.w = mir_a2u(sid->szTooltip.a);
arIcons.insert(p);
NotifyEventHooks(hHookIconsChanged, 0, (LPARAM)p);
@@ -119,11 +123,13 @@ MIR_APP_DLL(int) Srmm_ModifyIcon(MCONTACT hContact, StatusIconData *sid)
return 1;
if (hContact == 0) {
- mir_free(p->sid.szModule);
- mir_free(p->sid.szTooltip);
+ mir_free((void*)p->sid.szModule);
+ mir_free((void*)p->sid.szTooltip.w);
memcpy(&p->sid, sid, sizeof(p->sid));
+ p->hIcolibOn = IcoLib_IsManaged(sid->hIcon);
+ p->hIcolibOff = IcoLib_IsManaged(sid->hIconDisabled);
p->sid.szModule = mir_strdup(sid->szModule);
- p->sid.tszTooltip = (sid->flags & MBF_UNICODE) ? mir_wstrdup(sid->wszTooltip) : mir_a2u(sid->szTooltip);
+ p->sid.szTooltip.w = (sid->flags & MBF_UNICODE) ? mir_wstrdup(sid->szTooltip.w) : mir_a2u(sid->szTooltip.a);
NotifyEventHooks(hHookIconsChanged, 0, (LPARAM)p);
return 0;
@@ -135,14 +141,13 @@ MIR_APP_DLL(int) Srmm_ModifyIcon(MCONTACT hContact, StatusIconData *sid)
pc->hContact = hContact;
p->arChildren.insert(pc);
}
- else SafeDestroyIcon(pc->hIcon);
pc->flags = sid->flags;
pc->hIcon = sid->hIcon;
pc->hIconDisabled = sid->hIconDisabled;
-
- mir_free(pc->tszTooltip);
- pc->tszTooltip = (sid->flags & MBF_UNICODE) ? mir_wstrdup(sid->wszTooltip) : mir_a2u(sid->szTooltip);
+ pc->hIcolibOn = IcoLib_IsManaged(sid->hIcon);
+ pc->hIcolibOff = IcoLib_IsManaged(sid->hIconDisabled);
+ replaceStrW(pc->pwszTooltip, (sid->flags & MBF_UNICODE) ? mir_wstrdup(sid->szTooltip.w) : mir_a2u(sid->szTooltip.a));
NotifyEventHooks(hHookIconsChanged, hContact, (LPARAM)p);
return 0;
@@ -177,15 +182,17 @@ MIR_APP_DLL(StatusIconData*) Srmm_GetNthIcon(MCONTACT hContact, int index)
if (nVis == index) {
memcpy(&res, it, sizeof(res));
if (pc) {
- if (pc->hIcon) res.hIcon = pc->hIcon;
+ if (pc->hIcon)
+ res.hIcon = pc->hIcon;
if (pc->hIconDisabled)
res.hIconDisabled = pc->hIconDisabled;
else if (pc->hIcon)
res.hIconDisabled = pc->hIcon;
- if (pc->tszTooltip) res.tszTooltip = pc->tszTooltip;
+ if (pc->pwszTooltip)
+ res.szTooltip.w = pc->pwszTooltip;
res.flags = pc->flags;
}
- res.tszTooltip = TranslateW_LP(res.tszTooltip, it->pPlugin);
+ res.szTooltip.w = TranslateW_LP(res.szTooltip.w, it->pPlugin);
return &res;
}
nVis++;
@@ -216,7 +223,7 @@ int LoadSrmmModule()
g_hCurHyperlinkHand = LoadCursor(nullptr, IDC_HAND);
LoadSrmmToolbarModule();
-
+
hHookSrmmEvent = CreateHookableEvent(ME_MSG_WINDOWEVENT);
hHookIconsChanged = CreateHookableEvent(ME_MSG_ICONSCHANGED);
hHookIconPressedEvt = CreateHookableEvent(ME_MSG_ICONPRESSED);