diff options
37 files changed, 247 insertions, 262 deletions
diff --git a/include/m_icolib.h b/include/m_icolib.h index b63fc4abf0..e8a0ec3704 100644 --- a/include/m_icolib.h +++ b/include/m_icolib.h @@ -111,6 +111,12 @@ MIR_APP_DLL(void) Window_SetProtoIcon_IcoLib(HWND hWnd, const char *szProto, i MIR_APP_DLL(void) Window_FreeIcon_IcoLib(HWND hWnd);
///////////////////////////////////////////////////////////////////////////////
+// Helper to add an icolib's icon to a HIMAGELIST
+
+MIR_APP_DLL(int) ImageList_AddSkinIcon(HIMAGELIST hIml, int iconId);
+MIR_APP_DLL(int) ImageList_AddProtoIcon(HIMAGELIST hIml, const char *szProto, int iconId);
+
+///////////////////////////////////////////////////////////////////////////////
// Icons' change notification event
#define ME_SKIN_ICONSCHANGED "Skin/IconsChanged"
diff --git a/include/newpluginapi.h b/include/newpluginapi.h index 6be344e66c..153da7936e 100644 --- a/include/newpluginapi.h +++ b/include/newpluginapi.h @@ -25,6 +25,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef M_NEWPLUGINAPI_H__
#define M_NEWPLUGINAPI_H__
+#if !defined(HIMAGELIST)
+typedef struct _IMAGELIST* HIMAGELIST;
+#endif
+
#include <m_core.h>
#include <m_database.h>
@@ -176,6 +180,7 @@ public: void debugLogW(LPCWSTR wszFormat, ...);
__forceinline void addIcolib(HANDLE hIcolib) { m_arIcons.insert((IcolibItem*)hIcolib); }
+ int addImgListIcon(HIMAGELIST himl, int iconId);
HICON getIcon(int iconId, bool big = false);
HANDLE getIconHandle(int iconId);
void releaseIcon(int iconId, bool big = false);
diff --git a/libs/win32/mir_app.lib b/libs/win32/mir_app.lib Binary files differindex 8d6dba2944..78fc2dc1c6 100644 --- a/libs/win32/mir_app.lib +++ b/libs/win32/mir_app.lib diff --git a/libs/win64/mir_app.lib b/libs/win64/mir_app.lib Binary files differindex e3edd45568..dcf8312d8f 100644 --- a/libs/win64/mir_app.lib +++ b/libs/win64/mir_app.lib diff --git a/plugins/FTPFileYM/src/manager.cpp b/plugins/FTPFileYM/src/manager.cpp index c4ea35a8f3..98f6818a23 100644 --- a/plugins/FTPFileYM/src/manager.cpp +++ b/plugins/FTPFileYM/src/manager.cpp @@ -66,10 +66,10 @@ void Manager::initImageList() char buff[256];
m_himlStates = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, ServerList::FTP_COUNT + 4, 0);
- ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_DELETE)); // image index 0 is useless for INDEXTOSTATEIMAGEMASK
- ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_DELETE));
- ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_NOTICK));
- ImageList_AddIcon(m_himlStates, Skin_LoadIcon(SKINICON_OTHER_TICK));
+ ImageList_AddSkinIcon(m_himlStates, SKINICON_OTHER_DELETE); // image index 0 is useless for INDEXTOSTATEIMAGEMASK
+ ImageList_AddSkinIcon(m_himlStates, SKINICON_OTHER_DELETE);
+ ImageList_AddSkinIcon(m_himlStates, SKINICON_OTHER_NOTICK);
+ ImageList_AddSkinIcon(m_himlStates, SKINICON_OTHER_TICK);
for (int i = 0; i < ServerList::FTP_COUNT; i++) {
mir_snprintf(buff, "ftp%d", i);
diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index dc032a06b4..50db5990f5 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -163,12 +163,9 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) TranslateDialogDefault(hwndDlg);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 2, 2);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
- HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon(hIml, hIcon);
- IcoLib_ReleaseIcon(hIcon);
-
- hIcon = g_plugin.getIcon(IDI_ACT1);
+ HICON hIcon = g_plugin.getIcon(IDI_ACT1);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ACT1, STM_SETICON, (WPARAM)hIcon, 0);
diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index b4dc6a1f85..e5bcbb89f8 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -287,11 +287,7 @@ static void RefreshProtoIcons() ImageList_AddIcon(hProtocolImageList, hIcon);
DestroyIcon(hIcon);
}
- else {
- hIcon = (HICON)Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
- ImageList_AddIcon(hProtocolImageList, hIcon);
- IcoLib_ReleaseIcon(hIcon);
- }
+ else ImageList_AddSkinIcon(hProtocolImageList, SKINICON_OTHER_MIRANDA);
}
}
diff --git a/plugins/KeyboardNotify/src/ignore.cpp b/plugins/KeyboardNotify/src/ignore.cpp index bf8f81bdcf..fd9808108c 100644 --- a/plugins/KeyboardNotify/src/ignore.cpp +++ b/plugins/KeyboardNotify/src/ignore.cpp @@ -195,13 +195,13 @@ INT_PTR CALLBACK DlgProcIgnoreOptions(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPa TranslateDialogDefault(hwndDlg);
{
HIMAGELIST hIml=ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 3+IGNOREEVENT_MAX, 3+IGNOREEVENT_MAX);
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_FILLEDBLOB));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_EMPTYBLOB));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_EVENT_MESSAGE));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_EVENT_URL));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_EVENT_FILE));
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_MIRANDA));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_FILLEDBLOB);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_EMPTYBLOB);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_MESSAGE);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_URL);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_FILE);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_MIRANDA);
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
for (int i=0; i < _countof(hIcons); i++)
hIcons[i] = ImageList_GetIcon(hIml, 1+i, ILD_NORMAL);
diff --git a/plugins/KeyboardNotify/src/stdafx.h b/plugins/KeyboardNotify/src/stdafx.h index 3b01954284..cce961e02f 100644 --- a/plugins/KeyboardNotify/src/stdafx.h +++ b/plugins/KeyboardNotify/src/stdafx.h @@ -31,6 +31,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include <newpluginapi.h>
#include <m_database.h>
#include <m_options.h>
+#include <m_icolib.h>
#include <m_clistint.h>
#include <m_langpack.h>
#include <m_protosvc.h>
diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index fc5b01d5e7..1dbbf99795 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -95,7 +95,7 @@ HIMAGELIST GetStatusIconsImgList(char *szProto) if (hList != nullptr) {
for (int i = ID_STATUS_MIN; i <= ID_STATUS_MAX; i++)
ImageList_AddIcon(hList, Skin_LoadProtoIcon(szProto, i));
- ImageList_AddIcon(hList, Skin_LoadIcon(SKINICON_OTHER_USERONLINE));
+ ImageList_AddSkinIcon(hList, SKINICON_OTHER_USERONLINE);
}
}
@@ -439,7 +439,7 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) ImageList_AddIcon(hImageList, IcoLib_GetIconByHandle(iconList[ICO_ENABLEALL].hIcolib));
SendDlgItemMessage(hwndDlg, IDC_ENABLEALLICON, STM_SETICON, (WPARAM)ImageList_GetIcon(hImageList, EXTRA_IMAGE_ENABLEALL, ILD_NORMAL), 0);
- ImageList_AddIcon(hImageList, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
+ ImageList_AddSkinIcon(hImageList, SKINICON_OTHER_SMALLDOT);
SendDlgItemMessage(hwndDlg, IDC_INDSNDLIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hImageList);
SendDlgItemMessage(hwndDlg, IDC_INDSNDLIST, CLM_SETEXTRACOLUMNS, 8, 0);
diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index 3e754678fa..3107787b21 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -102,9 +102,10 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA hwndList = GetDlgItem(hwndDlg, IDC_LIST);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_HKEEP));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_HREMOVE));
+ g_plugin.addImgListIcon(hIml, IDI_HKEEP);
+ g_plugin.addImgListIcon(hIml, IDI_HREMOVE);
SendMessage(hwndList, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
+
SendDlgItemMessage(hwndDlg, IDC_PIC_KEEP, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_HKEEP), 0);
SendDlgItemMessage(hwndDlg, IDC_PIC_REMOVE, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_HREMOVE), 0);
}
diff --git a/plugins/Popup/src/opt_contacts.cpp b/plugins/Popup/src/opt_contacts.cpp index 1ce1529047..55b17d1655 100644 --- a/plugins/Popup/src/opt_contacts.cpp +++ b/plugins/Popup/src/opt_contacts.cpp @@ -52,11 +52,11 @@ INT_PTR CALLBACK DlgProcContactOpts(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) SendDlgItemMessage(hwnd, IDC_ICO_BLOCK, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_OPT_BLOCK), 0);
{
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 5, 5);
- ImageList_AddIcon(hIml, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_ACT_OK));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_OPT_FAVORITE));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_OPT_FULLSCREEN));
- ImageList_AddIcon(hIml, g_plugin.getIcon(IDI_OPT_BLOCK));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ g_plugin.addImgListIcon(hIml, IDI_ACT_OK);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_FAVORITE);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_FULLSCREEN);
+ g_plugin.addImgListIcon(hIml, IDI_OPT_BLOCK);
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
SendDlgItemMessage(hwnd, IDC_LIST, CLM_SETEXTRACOLUMNS, 4 /*_countof(sttIcons)*/, 0);
sttResetListOptions(GetDlgItem(hwnd, IDC_LIST));
diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp index 397ac4ae75..6fdf6ac8bc 100644 --- a/plugins/Scriver/src/chat_main.cpp +++ b/plugins/Scriver/src/chat_main.cpp @@ -88,8 +88,7 @@ static MODULEINFO* MM_CreateModule() static void OnCreateModule(MODULEINFO *mi)
{
HIMAGELIST hList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 0, 0);
-
- int overlayIcon = ImageList_AddIcon(hList, g_plugin.getIcon(IDI_OVERLAY));
+ int overlayIcon = g_plugin.addImgListIcon(hList, IDI_OVERLAY);
ImageList_SetOverlayImage(hList, overlayIcon, 1);
int index = ImageList_AddIcon(hList, Skin_LoadProtoIcon(mi->pszModule, ID_STATUS_ONLINE));
diff --git a/plugins/Scriver/src/globals.cpp b/plugins/Scriver/src/globals.cpp index bed9a909e6..0e4ba89823 100644 --- a/plugins/Scriver/src/globals.cpp +++ b/plugins/Scriver/src/globals.cpp @@ -230,15 +230,17 @@ void LoadGlobalIcons() if (it == 0)
ImageList_AddIcon_ProtoEx(g_dat.hButtonIconList, nullptr, ID_STATUS_OFFLINE);
else
- ImageList_AddIcon(g_dat.hButtonIconList, g_plugin.getIcon(it));
+ g_plugin.addImgListIcon(g_dat.hButtonIconList, it);
}
for (auto &it : chatButtonIcons)
- ImageList_AddIcon(g_dat.hChatButtonIconList, g_plugin.getIcon(it));
+ g_plugin.addImgListIcon(g_dat.hChatButtonIconList, it);
- ImageList_AddIcon(g_dat.hHelperIconList, g_plugin.getIcon(IDI_OVERLAY));
- int overlayIcon = ImageList_AddIcon(g_dat.hHelperIconList, g_plugin.getIcon(IDI_OVERLAY));
+ g_plugin.addImgListIcon(g_dat.hHelperIconList, IDI_OVERLAY);
+
+ int overlayIcon = g_plugin.addImgListIcon(g_dat.hHelperIconList, IDI_OVERLAY);
ImageList_SetOverlayImage(g_dat.hHelperIconList, overlayIcon, 1);
+
for (int i = IDI_GOOGLE; i < IDI_LASTICON; i++) {
HICON hIcon = (HICON)LoadImage(g_plugin.getInst(), MAKEINTRESOURCE(i), IMAGE_ICON, 0, 0, 0);
ImageList_AddIcon(g_dat.hSearchEngineIconList, hIcon);
diff --git a/plugins/Scriver/src/msglog.cpp b/plugins/Scriver/src/msglog.cpp index 2d1e397d61..67de067e91 100644 --- a/plugins/Scriver/src/msglog.cpp +++ b/plugins/Scriver/src/msglog.cpp @@ -793,17 +793,17 @@ void LoadMsgLogIcons(void) for (int i = 0; i < _countof(pLogIconBmpBits); i++) {
switch (i) {
case LOGICON_MSG_IN:
- ImageList_AddIcon(g_hImageList, g_plugin.getIcon(IDI_INCOMING));
+ g_plugin.addImgListIcon(g_hImageList, IDI_INCOMING);
hIcon = ImageList_GetIcon(g_hImageList, LOGICON_MSG_IN, ILD_NORMAL);
hBrush = hInBkgBrush;
break;
case LOGICON_MSG_OUT:
- ImageList_AddIcon(g_hImageList, g_plugin.getIcon(IDI_OUTGOING));
+ g_plugin.addImgListIcon(g_hImageList, IDI_OUTGOING);
hIcon = ImageList_GetIcon(g_hImageList, LOGICON_MSG_OUT, ILD_NORMAL);
hBrush = hOutBkgBrush;
break;
case LOGICON_MSG_NOTICE:
- ImageList_AddIcon(g_hImageList, g_plugin.getIcon(IDI_NOTICE));
+ g_plugin.addImgListIcon(g_hImageList, IDI_NOTICE);
hIcon = ImageList_GetIcon(g_hImageList, LOGICON_MSG_NOTICE, ILD_NORMAL);
hBrush = hBkgBrush;
break;
diff --git a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp index 9ef607b19c..9a8e0f11d9 100644 --- a/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp +++ b/plugins/UserInfoEx/src/ex_import/dlg_ExImModules.cpp @@ -25,7 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * typedefs
***********************************************************************************************************/
-typedef struct {
+typedef struct
+{
lpExImParam ExImContact;
DB::CEnumList* pModules;
} EXPORTDATA, *LPEXPORTDATA;
@@ -34,14 +35,14 @@ typedef struct { * modules stuff
***********************************************************************************************************/
-/**
- * name: ExportTree_AppendModuleList
- * desc: according to the checked list items create the module list for exporting
- * param: hTree - handle to the window of the treeview
- * hParent - parent tree item for the item to add
- * pModules - module list to fill
- * return: nothing
- **/
+ /**
+ * name: ExportTree_AppendModuleList
+ * desc: according to the checked list items create the module list for exporting
+ * param: hTree - handle to the window of the treeview
+ * hParent - parent tree item for the item to add
+ * pModules - module list to fill
+ * return: nothing
+ **/
void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* pModules)
{
TVITEMA tvi;
@@ -51,7 +52,7 @@ void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* p CHAR szModule[MAXSETTING];
// add optional items
- tvi.mask = TVIF_STATE|TVIF_TEXT;
+ tvi.mask = TVIF_STATE | TVIF_TEXT;
tvi.stateMask = TVIS_STATEIMAGEMASK;
tvi.pszText = szModule;
tvi.cchTextMax = _countof(szModule);
@@ -62,9 +63,8 @@ void ExportTree_AppendModuleList(HWND hTree, HTREEITEM hParent, DB::CEnumList* p (
tvi.state == INDEXTOSTATEIMAGEMASK(0) ||
tvi.state == INDEXTOSTATEIMAGEMASK(2)
- )
- )
- {
+ )
+ ) {
pModules->Insert(tvi.pszText);
}
}
@@ -93,8 +93,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText) for (tvi.hItem = TreeView_GetChild(hTree, hParent);
tvi.hItem != nullptr;
- tvi.hItem = TreeView_GetNextSibling(hTree, tvi.hItem))
- {
+ tvi.hItem = TreeView_GetNextSibling(hTree, tvi.hItem)) {
if (SendMessageA(hTree, TVM_GETITEMA, NULL, (LPARAM)&tvi) && !mir_strcmpi(tvi.pszText, pszText))
return tvi.hItem;
}
@@ -109,7 +108,7 @@ HTREEITEM ExportTree_FindItem(HWND hTree, HTREEITEM hParent, LPSTR pszText) * pszDesc - item label
* bUseImages - icons are loaded
* bState - 0-hide checkbox/1-unchecked/2-checked
- * return: return handle to added treeitem
+ * return: return handle to added treeitem
**/
HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, BYTE bUseImages, BYTE bState)
{
@@ -120,7 +119,7 @@ HTREEITEM ExportTree_AddItem(HWND hTree, HTREEITEM hParent, LPSTR pszDesc, BYTE tvii.hInsertAfter = TVI_SORT;
tvii.itemex.mask = TVIF_TEXT;
if (bUseImages) {
- tvii.itemex.mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvii.itemex.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvii.itemex.iImage = tvii.itemex.iSelectedImage = 1;
}
tvii.itemex.pszText = pszDesc;
@@ -143,7 +142,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar LPEXPORTDATA pDat = (LPEXPORTDATA)GetUserData(hDlg);
switch (uMsg) {
- case WM_INITDIALOG:
+ case WM_INITDIALOG:
{
BYTE bImagesLoaded = 0;
@@ -155,8 +154,8 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // init the datastructure
if (!(pDat = (LPEXPORTDATA)mir_alloc(sizeof(EXPORTDATA))))
return FALSE;
- pDat->ExImContact = ((LPEXPORTDATA)lParam)->ExImContact;
- pDat->pModules = ((LPEXPORTDATA)lParam)->pModules;
+ pDat->ExImContact = ((LPEXPORTDATA)lParam)->ExImContact;
+ pDat->pModules = ((LPEXPORTDATA)lParam)->pModules;
SetUserData(hDlg, pDat);
// set icons
@@ -174,15 +173,13 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar OSVERSIONINFO osvi;
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (GetVersionEx(&osvi)) {
- HIMAGELIST hImages = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),
- ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5 && osvi.dwMinorVersion >= 1) ? ILC_COLOR32 : ILC_COLOR16)|ILC_MASK,0, 1);
- if (hImages != nullptr)
- {
+ HIMAGELIST hImages = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON),
+ ((osvi.dwPlatformId == VER_PLATFORM_WIN32_NT && osvi.dwMajorVersion >= 5 && osvi.dwMinorVersion >= 1) ? ILC_COLOR32 : ILC_COLOR16) | ILC_MASK, 0, 1);
+ if (hImages != nullptr) {
SendMessage(hTree, TVM_SETIMAGELIST, TVSIL_NORMAL, (LPARAM)hImages);
-
- HICON hIcon;
- bImagesLoaded = ((((hIcon = g_plugin.getIcon(IDI_LST_MODULES)) != nullptr) && 0 == ImageList_AddIcon(hImages, hIcon))
- && (((hIcon = g_plugin.getIcon(IDI_LST_FOLDER)) != nullptr) && 1 == ImageList_AddIcon(hImages, hIcon)));
+ g_plugin.addImgListIcon(hImages, IDI_LST_MODULES);
+ g_plugin.addImgListIcon(hImages, IDI_LST_FOLDER);
+ bImagesLoaded = true;
}
}
}
@@ -195,29 +192,29 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
// Set the Window Title and description
{
- LPCTSTR name = nullptr;
- wchar_t oldTitle[MAXDATASIZE],
- newTitle[MAXDATASIZE];
+ LPCTSTR name = nullptr;
+ wchar_t oldTitle[MAXDATASIZE],
+ newTitle[MAXDATASIZE];
switch (pDat->ExImContact->Typ) {
- case EXIM_ALL:
- case EXIM_GROUP:
- name = TranslateT("All Contacts");
- break;
- case EXIM_CONTACT:
- if (pDat->ExImContact->hContact == NULL) {
- name = TranslateT("Owner");
- }
- else {
- name = Clist_GetContactDisplayName(pDat->ExImContact->hContact);
- }
- break;
- case EXIM_SUBGROUP:
- name = (LPCTSTR) pDat->ExImContact->ptszName;
- break;
- case EXIM_ACCOUNT:
- PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
- name = (LPCTSTR) acc->tszAccountName;
- break;
+ case EXIM_ALL:
+ case EXIM_GROUP:
+ name = TranslateT("All Contacts");
+ break;
+ case EXIM_CONTACT:
+ if (pDat->ExImContact->hContact == NULL) {
+ name = TranslateT("Owner");
+ }
+ else {
+ name = Clist_GetContactDisplayName(pDat->ExImContact->hContact);
+ }
+ break;
+ case EXIM_SUBGROUP:
+ name = (LPCTSTR)pDat->ExImContact->ptszName;
+ break;
+ case EXIM_ACCOUNT:
+ PROTOACCOUNT* acc = Proto_GetAccount(pDat->ExImContact->pszName);
+ name = (LPCTSTR)acc->tszAccountName;
+ break;
}
TranslateDialogDefault(hDlg); //to translate oldTitle
GetWindowText(hDlg, oldTitle, _countof(oldTitle));
@@ -241,11 +238,11 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar // add items that are always exported
tviiT.hParent = TVI_ROOT;
tviiT.hInsertAfter = TVI_FIRST;
- tviiT.itemex.mask = TVIF_TEXT|TVIF_STATE;
+ tviiT.itemex.mask = TVIF_TEXT | TVIF_STATE;
tviiT.itemex.pszText = TranslateT("Required modules");
tviiT.itemex.state = tviiT.itemex.stateMask = TVIS_EXPANDED;
if (bImagesLoaded) {
- tviiT.itemex.mask |= TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tviiT.itemex.mask |= TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tviiT.itemex.iImage = tviiT.itemex.iSelectedImage = 0;
}
if (hItemEssential = TreeView_InsertItem(hTree, &tviiT)) {
@@ -275,8 +272,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar if (!Modules.EnumModules()) // init Modul list
{
- for (auto &p : Modules)
- {
+ for (auto &p : Modules) {
/*Filter/
if (!DB::Module::IsMeta(p))/end Filter*/
{
@@ -284,44 +280,38 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar if (pDat->ExImContact->Typ != EXIM_CONTACT) // TRUE = All Contacts
{
MCONTACT hContact;
-
- for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact))
- {
+
+ for (hContact = db_find_first(); hContact != NULL; hContact = db_find_next(hContact)) {
// ignore empty modules
if (!DB::Module::IsEmpty(hContact, p)) {
pszProto = Proto_GetBaseAccountName(hContact);
// Filter by mode
- switch (pDat->ExImContact->Typ)
- {
- case EXIM_ALL:
- case EXIM_GROUP:
- break;
- case EXIM_SUBGROUP:
- if (mir_wstrncmp(pDat->ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_wstrlen(pDat->ExImContact->ptszName))) {
- continue;
- }
- break;
- case EXIM_ACCOUNT:
- if (mir_strcmp(pDat->ExImContact->pszName, pszProto)) {
- continue;
- }
- break;
+ switch (pDat->ExImContact->Typ) {
+ case EXIM_ALL:
+ case EXIM_GROUP:
+ break;
+ case EXIM_SUBGROUP:
+ if (mir_wstrncmp(pDat->ExImContact->ptszName, DB::Setting::GetTString(hContact, "CList", "Group"), mir_wstrlen(pDat->ExImContact->ptszName))) {
+ continue;
+ }
+ break;
+ case EXIM_ACCOUNT:
+ if (mir_strcmp(pDat->ExImContact->pszName, pszProto)) {
+ continue;
+ }
+ break;
}
// contact's base protocol is to be added to the treeview uniquely
- if (!mir_strcmpi(p, pszProto))
- {
+ if (!mir_strcmpi(p, pszProto)) {
if (!ExportTree_FindItem(hTree, hItemEssential, p))
- {
ExportTree_AddItem(hTree, hItemEssential, p, bImagesLoaded, 0);
- }
break;
}
// add optional module, which is valid for at least one contact
/*/Filter/*/
- if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, MOD_MBIRTHDAY) && mir_strcmpi(p, META_PROTO))
- {
+ if (mir_strcmpi(p, USERINFO) && mir_strcmpi(p, MOD_MBIRTHDAY) && mir_strcmpi(p, META_PROTO)) {
ExportTree_AddItem(hTree, hItemOptional, p, bImagesLoaded, 1);
break;
}
@@ -336,8 +326,7 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar (!pDat->ExImContact->hContact || mir_strcmpi(p, pszProto)) &&
//mir_strcmpi(p, "Protocol") &&
mir_strcmpi(p, USERINFO) &&
- mir_strcmpi(p, MOD_MBIRTHDAY))
- {
+ mir_strcmpi(p, MOD_MBIRTHDAY)) {
ExportTree_AddItem(hTree, hItemOptional, (LPSTR)p, bImagesLoaded, 1);
}
} // end
@@ -346,74 +335,72 @@ INT_PTR CALLBACK SelectModulesToExport_DlgProc(HWND hDlg, UINT uMsg, WPARAM wPar }
}
TranslateDialogDefault(hDlg);
- return TRUE;
}
- case WM_CTLCOLORSTATIC:
- if (GetDlgItem(hDlg, STATIC_WHITERECT) == (HWND)lParam || GetDlgItem(hDlg, ICO_DLGLOGO) == (HWND)lParam) {
- SetBkColor((HDC)wParam, RGB(255, 255, 255));
- return (INT_PTR)GetStockObject(WHITE_BRUSH);
- }
- SetBkMode((HDC)wParam, TRANSPARENT);
- return (INT_PTR)GetStockObject(NULL_BRUSH);
-
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- {
- HWND hTree = GetDlgItem(hDlg, IDC_TREE);
- HTREEITEM hParent;
-
- // search the tree item of optional items
- for (hParent = TreeView_GetRoot(hTree);
- hParent != nullptr;
- hParent = TreeView_GetNextSibling(hTree, hParent))
- {
- ExportTree_AppendModuleList(hTree, hParent, pDat->pModules);
- }
- return EndDialog(hDlg, IDOK);
+ return TRUE;
+
+ case WM_CTLCOLORSTATIC:
+ if (GetDlgItem(hDlg, STATIC_WHITERECT) == (HWND)lParam || GetDlgItem(hDlg, ICO_DLGLOGO) == (HWND)lParam) {
+ SetBkColor((HDC)wParam, RGB(255, 255, 255));
+ return (INT_PTR)GetStockObject(WHITE_BRUSH);
+ }
+ SetBkMode((HDC)wParam, TRANSPARENT);
+ return (INT_PTR)GetStockObject(NULL_BRUSH);
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDOK:
+ {
+ HWND hTree = GetDlgItem(hDlg, IDC_TREE);
+ HTREEITEM hParent;
+
+ // search the tree item of optional items
+ for (hParent = TreeView_GetRoot(hTree);
+ hParent != nullptr;
+ hParent = TreeView_GetNextSibling(hTree, hParent)) {
+ ExportTree_AppendModuleList(hTree, hParent, pDat->pModules);
}
- case IDCANCEL:
- return EndDialog(hDlg, IDCANCEL);
-
- case BTN_CHECK:
- case BTN_UNCHECK:
- {
- HWND hTree = GetDlgItem(hDlg, IDC_TREE);
- LPCSTR pszRoot = Translate("Optional modules");
- TVITEMA tvi;
- CHAR szText[128];
-
- tvi.mask = TVIF_TEXT;
- tvi.pszText = szText;
- tvi.cchTextMax = _countof(szText);
-
- // search the tree item of optional items
- for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_ROOT, NULL);
- tvi.hItem != nullptr && SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tvi);
- tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem))
- {
- if (!mir_strcmpi(tvi.pszText, pszRoot)) {
- tvi.mask = TVIF_STATE;
- tvi.state = INDEXTOSTATEIMAGEMASK(LOWORD(wParam) == BTN_UNCHECK ? 1 : 2);
- tvi.stateMask = TVIS_STATEIMAGEMASK;
-
- for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)tvi.hItem);
- tvi.hItem != nullptr;
- tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem))
- {
- SendMessageA(hTree, TVM_SETITEMA, NULL, (LPARAM)&tvi);
- }
- break;
+ return EndDialog(hDlg, IDOK);
+ }
+ case IDCANCEL:
+ return EndDialog(hDlg, IDCANCEL);
+
+ case BTN_CHECK:
+ case BTN_UNCHECK:
+ {
+ HWND hTree = GetDlgItem(hDlg, IDC_TREE);
+ LPCSTR pszRoot = Translate("Optional modules");
+ TVITEMA tvi;
+ CHAR szText[128];
+
+ tvi.mask = TVIF_TEXT;
+ tvi.pszText = szText;
+ tvi.cchTextMax = _countof(szText);
+
+ // search the tree item of optional items
+ for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_ROOT, NULL);
+ tvi.hItem != nullptr && SendMessageA(hTree, TVM_GETITEMA, 0, (LPARAM)&tvi);
+ tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem)) {
+ if (!mir_strcmpi(tvi.pszText, pszRoot)) {
+ tvi.mask = TVIF_STATE;
+ tvi.state = INDEXTOSTATEIMAGEMASK(LOWORD(wParam) == BTN_UNCHECK ? 1 : 2);
+ tvi.stateMask = TVIS_STATEIMAGEMASK;
+
+ for (tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_CHILD, (LPARAM)tvi.hItem);
+ tvi.hItem != nullptr;
+ tvi.hItem = (HTREEITEM)SendMessageA(hTree, TVM_GETNEXTITEM, TVGN_NEXT, (LPARAM)tvi.hItem)) {
+ SendMessageA(hTree, TVM_SETITEMA, NULL, (LPARAM)&tvi);
}
+ break;
}
- break;
}
+ break;
}
- break;
+ }
+ break;
- case WM_DESTROY:
- mir_free(pDat);
- break;
+ case WM_DESTROY:
+ mir_free(pDat);
+ break;
}
return 0;
}
@@ -434,4 +421,3 @@ int DlgExImModules_SelectModulesToExport(lpExImParam ExImContact, DB::CEnumList* dat.pModules = pModules;
return (IDOK != DialogBoxParam(g_plugin.getInst(), MAKEINTRESOURCE(IDD_EXPORT), hParent, SelectModulesToExport_DlgProc, (LPARAM)&dat));
}
-
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index a2c69a335a..b3d8e0e791 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -195,8 +195,8 @@ public: m_lvBookmarks.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | LVS_EX_HEADERDRAGDROP | LVS_EX_DOUBLEBUFFER);
HIMAGELIST hIml = m_lvBookmarks.CreateImageList(LVSIL_SMALL);
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_GROUP));
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_EVENT_URL));
+ g_plugin.addImgListIcon(hIml, IDI_GROUP);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_URL);
m_lvBookmarks.AddColumn(0, TranslateT("Bookmark Name"), m_proto->getWord("bookmarksWnd_cx0", 120));
m_lvBookmarks.AddColumn(1, TranslateT("Address (JID or URL)"), m_proto->getWord("bookmarksWnd_cx1", 210));
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index ed7ce4a046..603a891d23 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -508,9 +508,3 @@ void g_IconsInit() g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs") "/" LPGEN("Discovery"), sharedIconList3, GLOBAL_SETTING_PREFIX);
g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs") "/" LPGEN("Privacy"), sharedIconList4, GLOBAL_SETTING_PREFIX);
}
-
-void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon)
-{
- ImageList_AddIcon(hIml, hIcon);
- IcoLib_ReleaseIcon(hIcon);
-}
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index a7e93e78a9..3079cfa96a 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -180,8 +180,8 @@ public: bool OnInitDialog() override
{
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 2, 0);
- ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_DELETE));
- ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_ADDCONTACT));
+ g_plugin.addImgListIcon(hImageList, IDI_DELETE);
+ g_plugin.addImgListIcon(hImageList, IDI_ADDCONTACT);
m_list.SetImageList(hImageList, LVSIL_SMALL);
m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES | LVS_EX_GRIDLINES);
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp index c8bda4c769..f8c5ed2379 100644 --- a/protocols/JabberG/src/jabber_opttree.cpp +++ b/protocols/JabberG/src/jabber_opttree.cpp @@ -97,13 +97,13 @@ void CCtrlTreeOpts::OnInit() DeleteAllItems();
hImgLst = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, 1);
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_MIRANDA));
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_TICK)); // check on
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_NOTICK)); // check off
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_TICK)); // radio on
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_NOTICK)); // radio on
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN));
- ImageList_AddIcon_Icolib(hImgLst, Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT));
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_MIRANDA);
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_TICK); // check on
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_NOTICK); // check off
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_TICK); // radio on
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_NOTICK); // radio on
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_GROUPOPEN);
+ ImageList_AddSkinIcon(hImgLst, SKINICON_OTHER_GROUPSHUT);
SetImageList(hImgLst, TVSIL_NORMAL);
/* build options tree. based on code from IcoLib */
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 4c7f27714c..5aeb3690dd 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -1340,15 +1340,15 @@ public: m_clcClist.SetExStyle(CLS_EX_DISABLEDRAGDROP | CLS_EX_TRACKSELECT);
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 9, 9);
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT));
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_PL_MSG_ALLOW));
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_PL_MSG_DENY));
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_PL_PRIN_ALLOW));
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_PL_PRIN_DENY));
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_PL_PROUT_ALLOW));
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_PL_PROUT_DENY));
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_PL_QUERY_ALLOW));
- ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_PL_QUERY_DENY));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ g_plugin.addImgListIcon(hIml, IDI_PL_MSG_ALLOW);
+ g_plugin.addImgListIcon(hIml, IDI_PL_MSG_DENY);
+ g_plugin.addImgListIcon(hIml, IDI_PL_PRIN_ALLOW);
+ g_plugin.addImgListIcon(hIml, IDI_PL_PRIN_DENY);
+ g_plugin.addImgListIcon(hIml, IDI_PL_PROUT_ALLOW);
+ g_plugin.addImgListIcon(hIml, IDI_PL_PROUT_DENY);
+ g_plugin.addImgListIcon(hIml, IDI_PL_QUERY_ALLOW);
+ g_plugin.addImgListIcon(hIml, IDI_PL_QUERY_DENY);
m_clcClist.SetExtraImageList(hIml);
m_clcClist.SetExtraColumns(4);
diff --git a/protocols/JabberG/src/jabber_treelist.cpp b/protocols/JabberG/src/jabber_treelist.cpp index c228169c17..b8588ef601 100644 --- a/protocols/JabberG/src/jabber_treelist.cpp +++ b/protocols/JabberG/src/jabber_treelist.cpp @@ -138,9 +138,9 @@ void TreeList_Create(HWND hwnd) ListView_SetImageList(hwnd, hIml, LVSIL_SMALL);
hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 2, 1);
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN));
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT));
- ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_OTHER_DOWNARROW));
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_GROUPOPEN);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_GROUPSHUT);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_DOWNARROW);
ListView_SetImageList(hwnd, hIml, LVSIL_STATE);
}
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index b8366ca25f..0488052609 100755 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -403,12 +403,12 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa memset(dat, 0, sizeof(JabberUserInfoDlgData)); dat->resourcesCount = -1; dat->hContact = lParam; - { - GetClientRect(hwndDlg, &rc); - MoveWindow(GetDlgItem(hwndDlg, IDC_TV_INFO), 5, 5, rc.right - 10, rc.bottom - 10, TRUE); + GetClientRect(hwndDlg, &rc); + MoveWindow(GetDlgItem(hwndDlg, IDC_TV_INFO), 5, 5, rc.right - 10, rc.bottom - 10, TRUE); + { HIMAGELIST himl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR | ILC_COLOR32 | ILC_MASK, 5, 1); - ImageList_AddIcon_Icolib(himl, Skin_LoadIcon(SKINICON_OTHER_SMALLDOT)); + ImageList_AddSkinIcon(himl, SKINICON_OTHER_SMALLDOT); TreeView_SetImageList(GetDlgItem(hwndDlg, IDC_TV_INFO), himl, TVSIL_NORMAL); SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat); diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index 99dbaae464..ecb24700bc 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -673,8 +673,6 @@ void g_IconsInit(); void g_XstatusIconsInit();
void g_XstatusIconsUninit();
-void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon);
-
//---- jabber_libstr.c ----------------------------------------------
int lstrcmp_null(const wchar_t *s1, const wchar_t *s2);
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp index 2979cba59a..841ad32122 100644 --- a/protocols/MSN/src/msn_lists.cpp +++ b/protocols/MSN/src/msn_lists.cpp @@ -471,12 +471,9 @@ INT_PTR CALLBACK DlgProcMsnServLists(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
HIMAGELIST hIml = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_MASK | ILC_COLOR32, 5, 5);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
- HICON hIcon = Skin_LoadIcon(SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon(hIml, hIcon);
- IcoLib_ReleaseIcon(hIcon);
-
- hIcon = g_plugin.getIcon(IDI_LIST_LC);
+ HICON hIcon = g_plugin.getIcon(IDI_LIST_LC);
ImageList_AddIcon(hIml, hIcon);
SendDlgItemMessage(hwndDlg, IDC_ICON_LC, STM_SETICON, (WPARAM)hIcon, 0);
diff --git a/src/mir_app/src/CMPluginBase.cpp b/src/mir_app/src/CMPluginBase.cpp index a18a3e15ff..3ced1cf459 100644 --- a/src/mir_app/src/CMPluginBase.cpp +++ b/src/mir_app/src/CMPluginBase.cpp @@ -279,6 +279,14 @@ void CMPluginBase::debugLogW(LPCWSTR wszFormat, ...) ///////////////////////////////////////////////////////////////////////////////////////// +int CMPluginBase::addImgListIcon(HIMAGELIST himl, int iconId) +{ + HICON hIcon = getIcon(iconId); + int ret = ::ImageList_AddIcon(himl, hIcon); + IcoLib_ReleaseIcon(hIcon); + return ret; +} + HICON CMPluginBase::getIcon(int iconId, bool big) { return IcoLib_GetIconByHandle(getIconHandle(iconId), big); diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index e56308f232..ed4c445e2a 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -135,7 +135,7 @@ MIR_APP_DLL(int) Clist_GetContactIcon(MCONTACT hContact) static void AddProtoIconIndex(PROTOACCOUNT *pa)
{
for (auto &it : g_statuses) {
- int iImg = ImageList_AddIcon_ProtoIconLibLoaded(hCListImages, pa->szModuleName, it.iStatus);
+ int iImg = ImageList_AddProtoIcon(hCListImages, pa->szModuleName, it.iStatus);
if (it.iStatus == ID_STATUS_OFFLINE)
pa->iIconBase = iImg;
}
diff --git a/src/mir_app/src/findadd.cpp b/src/mir_app/src/findadd.cpp index fdd69d0ef4..aca9b86624 100644 --- a/src/mir_app/src/findadd.cpp +++ b/src/mir_app/src/findadd.cpp @@ -390,7 +390,7 @@ static INT_PTR CALLBACK DlgProcFindAdd(HWND hwndDlg, UINT msg, WPARAM wParam, LP GetTextExtentPoint32(hdc, cbei.pszText, (int)mir_wstrlen(cbei.pszText), &textSize); if (textSize.cx > cbwidth) cbwidth = textSize.cx; - cbei.iImage = cbei.iSelectedImage = ImageList_AddIcon_IconLibLoaded(dat->himlComboIcons, SKINICON_OTHER_SEARCHALL); + cbei.iImage = cbei.iSelectedImage = ImageList_AddSkinIcon(dat->himlComboIcons, SKINICON_OTHER_SEARCHALL); cbei.lParam = 0; SendDlgItemMessage(hwndDlg, IDC_PROTOLIST, CBEM_INSERTITEM, 0, (LPARAM)&cbei); cbei.iItem++; diff --git a/src/mir_app/src/hotkey_opts.cpp b/src/mir_app/src/hotkey_opts.cpp index ac1e2b23c4..58d07e1e5c 100644 --- a/src/mir_app/src/hotkey_opts.cpp +++ b/src/mir_app/src/hotkey_opts.cpp @@ -472,14 +472,14 @@ static INT_PTR CALLBACK sttOptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, Hotkey_Subclass(GetDlgItem(hwndDlg, IDC_HOTKEY)); { HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 3, 1); - ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_WINDOWS); - ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_MIRANDA); - ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_WINDOW); - ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_ADDCONTACT); - ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_DELETE); - ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_UNDO); - ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_GROUPOPEN); - ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_GROUPSHUT); + ImageList_AddSkinIcon(hIml, SKINICON_OTHER_WINDOWS); + ImageList_AddSkinIcon(hIml, SKINICON_OTHER_MIRANDA); + ImageList_AddSkinIcon(hIml, SKINICON_OTHER_WINDOW); + ImageList_AddSkinIcon(hIml, SKINICON_OTHER_ADDCONTACT); + ImageList_AddSkinIcon(hIml, SKINICON_OTHER_DELETE); + ImageList_AddSkinIcon(hIml, SKINICON_OTHER_UNDO); + ImageList_AddSkinIcon(hIml, SKINICON_OTHER_GROUPOPEN); + ImageList_AddSkinIcon(hIml, SKINICON_OTHER_GROUPSHUT); ListView_SetImageList(hwndHotkey, hIml, LVSIL_SMALL); } ListView_SetExtendedListViewStyle(hwndHotkey, LVS_EX_CHECKBOXES | LVS_EX_SUBITEMIMAGES | LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_INFOTIP); diff --git a/src/mir_app/src/ignore.cpp b/src/mir_app/src/ignore.cpp index 10ee55d64e..82a3772d17 100644 --- a/src/mir_app/src/ignore.cpp +++ b/src/mir_app/src/ignore.cpp @@ -208,14 +208,14 @@ static INT_PTR CALLBACK DlgProcIgnoreOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM TranslateDialogDefault(hwndDlg);
{
HIMAGELIST hIml = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 3 + IGNOREEVENT_MAX, 3 + IGNOREEVENT_MAX);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_FILLEDBLOB);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_EMPTYBLOB);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_EVENT_MESSAGE);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_EVENT_FILE);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_USERONLINE);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_AUTH_REQUEST);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_TYPING);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_FILLEDBLOB);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_EMPTYBLOB);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_MESSAGE);
+ ImageList_AddSkinIcon(hIml, SKINICON_EVENT_FILE);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_USERONLINE);
+ ImageList_AddSkinIcon(hIml, SKINICON_AUTH_REQUEST);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_TYPING);
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
for (int i = 0; i < _countof(hIcons); i++)
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 8ff63cddf4..c04d269389 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -14,7 +14,7 @@ IcoLib_GetIconHandle @12 IcoLib_IsManaged @13
IcoLib_ReleaseIcon @14
Window_FreeIcon_IcoLib @15
-Window_SetSkinIcon_IcoLib @16
+Window_SetSkinIcon_IcoLib @16
Window_SetProtoIcon_IcoLib @17
ProtoServiceExists @18
mir_main @19
@@ -678,3 +678,6 @@ Srmm_SetIconFlags @767 ?getIcon@CMPluginBase@@QAEPAUHICON__@@H_N@Z @769 NONAME
?getIconHandle@CMPluginBase@@QAEPAXH@Z @770 NONAME
?releaseIcon@CMPluginBase@@QAEXH_N@Z @771 NONAME
+?addImgListIcon@CMPluginBase@@QAEHPAU_IMAGELIST@@H@Z @772 NONAME
+ImageList_AddProtoIcon @773
+ImageList_AddSkinIcon @774
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index 8c725df9d3..06c417483d 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -14,7 +14,7 @@ IcoLib_GetIconHandle @12 IcoLib_IsManaged @13
IcoLib_ReleaseIcon @14
Window_FreeIcon_IcoLib @15
-Window_SetSkinIcon_IcoLib @16
+Window_SetSkinIcon_IcoLib @16
Window_SetProtoIcon_IcoLib @17
ProtoServiceExists @18
mir_main @19
@@ -678,3 +678,6 @@ Srmm_SetIconFlags @767 ?getIcon@CMPluginBase@@QEAAPEAUHICON__@@H_N@Z @769 NONAME
?getIconHandle@CMPluginBase@@QEAAPEAXH@Z @770 NONAME
?releaseIcon@CMPluginBase@@QEAAXH_N@Z @771 NONAME
+?addImgListIcon@CMPluginBase@@QEAAHPEAU_IMAGELIST@@H@Z @772 NONAME
+ImageList_AddProtoIcon @773
+ImageList_AddSkinIcon @774
diff --git a/src/mir_app/src/miranda.h b/src/mir_app/src/miranda.h index 0a737d81c7..cd25f39443 100644 --- a/src/mir_app/src/miranda.h +++ b/src/mir_app/src/miranda.h @@ -103,10 +103,7 @@ extern int g_iIconX, g_iIconY, g_iIconSX, g_iIconSY; HICON LoadIconEx(HINSTANCE hInstance, LPCTSTR lpIconName, BOOL bShared);
int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource);
-int ImageList_ReplaceIcon_NotShared(HIMAGELIST hIml, int iIndex, HINSTANCE hInstance, LPCTSTR szResource);
-int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId);
-int ImageList_AddIcon_ProtoIconLibLoaded(HIMAGELIST hIml, const char *szProto, int iconId);
int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon);
#define Safe_DestroyIcon(hIcon) if (hIcon) DestroyIcon(hIcon)
diff --git a/src/mir_app/src/newplugins.cpp b/src/mir_app/src/newplugins.cpp index 4164f19ecc..72014fb9b7 100644 --- a/src/mir_app/src/newplugins.cpp +++ b/src/mir_app/src/newplugins.cpp @@ -528,11 +528,11 @@ static bool loadClistModule(wchar_t *exe, pluginEntry *p) // now all core skin icons are loaded via icon lib. so lets release them
for (auto &it : g_statuses)
- ImageList_AddIcon_IconLibLoaded(hCListImages, it.iSkinIcon);
+ ImageList_AddSkinIcon(hCListImages, it.iSkinIcon);
// see IMAGE_GROUP... in clist.h if you add more images above here
- ImageList_AddIcon_IconLibLoaded(hCListImages, SKINICON_OTHER_GROUPOPEN);
- ImageList_AddIcon_IconLibLoaded(hCListImages, SKINICON_OTHER_GROUPSHUT);
+ ImageList_AddSkinIcon(hCListImages, SKINICON_OTHER_GROUPOPEN);
+ ImageList_AddSkinIcon(hCListImages, SKINICON_OTHER_GROUPSHUT);
if (p->load() == 0) {
p->bLoaded = true;
diff --git a/src/mir_app/src/pluginopts.cpp b/src/mir_app/src/pluginopts.cpp index d7248a08b4..226fe9a9b2 100644 --- a/src/mir_app/src/pluginopts.cpp +++ b/src/mir_app/src/pluginopts.cpp @@ -290,8 +290,8 @@ public: bool OnInitDialog() override
{
HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 4, 0);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_UNICODE);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_ANSI);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_UNICODE);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_ANSI);
m_plugList.SetImageList(hIml, LVSIL_SMALL);
LVCOLUMN col;
diff --git a/src/mir_app/src/skinicons.cpp b/src/mir_app/src/skinicons.cpp index 5c08661183..5c5c4b5a2b 100644 --- a/src/mir_app/src/skinicons.cpp +++ b/src/mir_app/src/skinicons.cpp @@ -159,7 +159,7 @@ int ImageList_AddIcon_NotShared(HIMAGELIST hIml, LPCTSTR szResource) return res;
}
-int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId)
+MIR_APP_DLL(int) ImageList_AddSkinIcon(HIMAGELIST hIml, int iconId)
{
HICON hIcon = Skin_LoadIcon(iconId);
int res = ImageList_AddIcon(hIml, hIcon);
@@ -167,7 +167,7 @@ int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, int iconId) return res;
}
-int ImageList_AddIcon_ProtoIconLibLoaded(HIMAGELIST hIml, const char *szProto, int iconId)
+MIR_APP_DLL(int) ImageList_AddProtoIcon(HIMAGELIST hIml, const char *szProto, int iconId)
{
HICON hIcon = Skin_LoadProtoIcon(szProto, iconId);
int res = ImageList_AddIcon(hIml, hIcon);
@@ -175,14 +175,6 @@ int ImageList_AddIcon_ProtoIconLibLoaded(HIMAGELIST hIml, const char *szProto, i return res;
}
-int ImageList_ReplaceIcon_NotShared(HIMAGELIST hIml, int iIndex, HINSTANCE hInstance, LPCTSTR szResource)
-{
- HICON hTempIcon = LoadIconEx(hInstance, szResource, 0);
- int res = ImageList_ReplaceIcon(hIml, iIndex, hTempIcon);
- Safe_DestroyIcon(hTempIcon);
- return res;
-}
-
int ImageList_ReplaceIcon_IconLibLoaded(HIMAGELIST hIml, int nIndex, HICON hIcon)
{
int res = ImageList_ReplaceIcon(hIml, nIndex, hIcon);
diff --git a/src/mir_app/src/visibility.cpp b/src/mir_app/src/visibility.cpp index e4bc479b61..f3a36df1de 100644 --- a/src/mir_app/src/visibility.cpp +++ b/src/mir_app/src/visibility.cpp @@ -139,9 +139,9 @@ static INT_PTR CALLBACK DlgProcVisibilityOpts(HWND hwndDlg, UINT msg, WPARAM, LP TranslateDialogDefault(hwndDlg);
hIml = ImageList_Create(g_iIconSX, g_iIconSY, ILC_COLOR32 | ILC_MASK, 3, 3);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_SMALLDOT);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_VISIBLE_ALL);
- ImageList_AddIcon_IconLibLoaded(hIml, SKINICON_OTHER_INVISIBLE_ALL);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_SMALLDOT);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_VISIBLE_ALL);
+ ImageList_AddSkinIcon(hIml, SKINICON_OTHER_INVISIBLE_ALL);
SendDlgItemMessage(hwndDlg, IDC_LIST, CLM_SETEXTRAIMAGELIST, 0, (LPARAM)hIml);
hVisibleIcon = ImageList_GetIcon(hIml, 1, ILD_NORMAL);
SendDlgItemMessage(hwndDlg, IDC_VISIBLEICON, STM_SETICON, (WPARAM)hVisibleIcon, 0);
|