diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-06 16:51:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-06 16:51:39 +0000 |
commit | 5e49edfe66308d79bd8095acb1c89d0e987c7aa4 (patch) | |
tree | 950fc1055228f15e2627bc5bafd5bfdfd987db8f | |
parent | 3bb087726db613aad9c1e61332fda7300600f60c (diff) |
Clist_GetImageList()
git-svn-id: http://svn.miranda-ng.org/main/trunk@17266 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
30 files changed, 33 insertions, 38 deletions
diff --git a/bin10/lib/mir_app.lib b/bin10/lib/mir_app.lib Binary files differindex f387672bef..a6393c746c 100644 --- a/bin10/lib/mir_app.lib +++ b/bin10/lib/mir_app.lib diff --git a/bin10/lib/mir_app64.lib b/bin10/lib/mir_app64.lib Binary files differindex 1c2630deeb..e65d5a7cb5 100644 --- a/bin10/lib/mir_app64.lib +++ b/bin10/lib/mir_app64.lib diff --git a/bin12/lib/mir_app.lib b/bin12/lib/mir_app.lib Binary files differindex f387672bef..a6393c746c 100644 --- a/bin12/lib/mir_app.lib +++ b/bin12/lib/mir_app.lib diff --git a/bin12/lib/mir_app64.lib b/bin12/lib/mir_app64.lib Binary files differindex 1c2630deeb..e65d5a7cb5 100644 --- a/bin12/lib/mir_app64.lib +++ b/bin12/lib/mir_app64.lib diff --git a/bin14/lib/mir_app.lib b/bin14/lib/mir_app.lib Binary files differindex f387672bef..a6393c746c 100644 --- a/bin14/lib/mir_app.lib +++ b/bin14/lib/mir_app.lib diff --git a/bin14/lib/mir_app64.lib b/bin14/lib/mir_app64.lib Binary files differindex 1c2630deeb..e65d5a7cb5 100644 --- a/bin14/lib/mir_app64.lib +++ b/bin14/lib/mir_app64.lib diff --git a/include/delphi/m_api.pas b/include/delphi/m_api.pas index f51f6e2ddd..e7a5a82b91 100644 --- a/include/delphi/m_api.pas +++ b/include/delphi/m_api.pas @@ -42,7 +42,7 @@ interface {$ENDIF}
uses
- Windows,Messages;//, FreeImage;
+ Windows,CommCtrl,Messages;//, FreeImage;
// often used
const
diff --git a/include/delphi/m_clist.inc b/include/delphi/m_clist.inc index 13b5a08cda..ea4ce13e31 100644 --- a/include/delphi/m_clist.inc +++ b/include/delphi/m_clist.inc @@ -116,16 +116,11 @@ const CLEF_PROTOCOLGLOBAL = 8; // set event globally for protocol, hContact has to
// be NULL, lpszProtocol the protocol ID name to be set
- {
- wParam : 0
- lParam : 0
- Affect : Get the image list handle with all the useful icons in it
- Version: v0.1.1.0+
- }
- MS_CLIST_GETICONSIMAGELIST:PAnsiChar = 'CList/GetIconsImageList';
IMAGE_GROUPOPEN = 11;
IMAGE_GROUPSHUT = 12;
+ function Clist_GetImageList : HIMAGELIST; stdcall; external AppDll;
+
{
wParam : TMCONTACT
lParam : ICON_ID
@@ -133,6 +128,7 @@ const ICON_ID is an index to what image has changed
Version: v0.1.2.1+
}
+const
ME_CLIST_CONTACTICONCHANGED:PAnsiChar = 'CList/ContactIconChanged';
//******************************* CLUI only *********************************
diff --git a/include/m_clist.h b/include/m_clist.h index 89edcc38f9..68e269b71e 100644 --- a/include/m_clist.h +++ b/include/m_clist.h @@ -258,15 +258,15 @@ typedef struct { /////////////////////////////////////////////////////////////////////////////////////////
// gets the image list with all the useful icons in it
-// wParam = lParam = 0
-// returns a HIMAGELIST
// the members of this image list are opaque, and you should trust what you are given
-#define MS_CLIST_GETICONSIMAGELIST "CList/GetIconsImageList"
-
#define IMAGE_GROUPOPEN 11
#define IMAGE_GROUPSHUT 12
+#ifdef _INC_COMMCTRL
+EXTERN_C MIR_APP_DLL(HIMAGELIST) Clist_GetImageList(void);
+#endif
+
/////////////////////////////////////////////////////////////////////////////////////////
// The icon of a contact in the contact list has changed
// wParam = (MCONTACT)hContact
diff --git a/plugins/Clist_blind/src/init.cpp b/plugins/Clist_blind/src/init.cpp index d09979acad..18e9ad813c 100644 --- a/plugins/Clist_blind/src/init.cpp +++ b/plugins/Clist_blind/src/init.cpp @@ -92,7 +92,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_CLIST, static int OnAccountsChanged(WPARAM, LPARAM)
{
- himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ himlCListClc = Clist_GetImageList();
return 0;
}
@@ -101,7 +101,7 @@ static int OnAccountsChanged(WPARAM, LPARAM) static int OnModulesLoaded(WPARAM, LPARAM)
{
- himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ himlCListClc = Clist_GetImageList();
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 1cd8e95663..683f0bd7d4 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1623,7 +1623,7 @@ static int clcHookModulesLoaded(WPARAM, LPARAM) HRESULT ClcLoadModule()
{
- g_himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ g_himlCListClc = Clist_GetImageList();
HookEvent(ME_MC_SUBCONTACTSCHANGED, clcMetacontactChanged);
HookEvent(ME_MC_ENABLED, clcMetaModeChanged);
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 7d25e6faf0..189717d6c6 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -204,7 +204,7 @@ int LoadCLCModule(void) g_cxsmIcon = GetSystemMetrics(SM_CXSMICON);
g_cysmIcon = GetSystemMetrics(SM_CYSMICON);
- hCListImages = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ hCListImages = Clist_GetImageList();
HookEvent(ME_MC_ENABLED, ClcMetamodeChanged);
HookEvent(ME_DB_CONTACT_SETTINGCHANGED, ClcSettingChanged);
diff --git a/plugins/FavContacts/src/menu.cpp b/plugins/FavContacts/src/menu.cpp index 0a24b6ecd3..92775dee70 100644 --- a/plugins/FavContacts/src/menu.cpp +++ b/plugins/FavContacts/src/menu.cpp @@ -241,7 +241,7 @@ static BOOL sttDrawItem_Contact(LPDRAWITEMSTRUCT lpdis, Options *options = NULL) char *proto = GetContactProto(hContact);
- HIMAGELIST hIml = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ HIMAGELIST hIml = Clist_GetImageList();
int iIcon = pcli->pfnGetContactIcon(hContact);
if (db_get_dw(hContact, proto, "IdleTS", 0)) {
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 0988542780..0f7b433256 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -211,7 +211,7 @@ static int OnContactDragStop(WPARAM hContact, LPARAM) static int OnSkinIconsChanged(WPARAM, LPARAM)
{
// Get handle to the image list
- himlMiranda = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ himlMiranda = Clist_GetImageList();
// Update thumbs
for (int i = 0; i < thumbList.getCount(); ++i)
diff --git a/plugins/FloatingContacts/src/stdafx.h b/plugins/FloatingContacts/src/stdafx.h index b983665732..fb438647d6 100644 --- a/plugins/FloatingContacts/src/stdafx.h +++ b/plugins/FloatingContacts/src/stdafx.h @@ -6,6 +6,7 @@ #include <assert.h>
#include <math.h>
#include <Shlwapi.h>
+#include <CommCtrl.h>
#include <newpluginapi.h>
#include <m_system_cpp.h>
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 8fb1a3c5f4..f1d3447e74 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -237,7 +237,7 @@ void ThumbInfo::ResizeThumb() {
int index = FLT_FONTID_NOTONLIST;
- himlMiranda = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ himlMiranda = Clist_GetImageList();
if (himlMiranda == NULL)
return;
diff --git a/plugins/HistoryPlusPlus/GlobalSearch.pas b/plugins/HistoryPlusPlus/GlobalSearch.pas index 44eb3283ea..5beb129b1d 100644 --- a/plugins/HistoryPlusPlus/GlobalSearch.pas +++ b/plugins/HistoryPlusPlus/GlobalSearch.pas @@ -443,7 +443,7 @@ begin ContactList := TObjectList.Create;
- ilContacts.Handle := CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ ilContacts.Handle := Clist_GetImageList();
// delphi 2006 doesn't save toolbar's flat property in dfm if it is True
// delphi 2006 doesn't save toolbar's edgeborder property in dfm
ToolBar.Flat := True;
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp index 8a472008de..561292c9b1 100644 --- a/plugins/NewAwaySysMod/src/ContactList.cpp +++ b/plugins/NewAwaySysMod/src/ContactList.cpp @@ -343,7 +343,7 @@ CCList::CCList(HWND hTreeView) : CWndUserData(GetParent(hTreeView)).SetCList(this);
OrigTreeViewProc = (WNDPROC)SetWindowLongPtr(hTreeView, GWLP_WNDPROC, (LONG_PTR)ContactListSubclassProc);
OrigParentProc = (WNDPROC)SetWindowLongPtr(GetParent(hTreeView), GWLP_WNDPROC, (LONG_PTR)ParentSubclassProc);
- TreeView_SetImageList(hTreeView, CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0), TVSIL_NORMAL);
+ TreeView_SetImageList(hTreeView, Clist_GetImageList(), TVSIL_NORMAL);
WindowList_Add(hCLWindowList, hTreeView, NULL);
TreeView_SetIndent(hTreeView, 5); // doesn't set it less than the initial value on my system, and i guess it's because of icons... but who knows - maybe it will work somewhere
}
diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index bc09d7f4aa..6f38d59d36 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -183,7 +183,7 @@ int ModulesLoaded(WPARAM, LPARAM) }
// Get the icons for the listbox
- hIml = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
+ hIml = Clist_GetImageList();
// Add menu item
CMenuItem mi;
diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index a2f96e4098..3ed4343e6d 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -1970,8 +1970,7 @@ begin grid:=GetDlgItem(Dialog,IDC_LIST);
// ListView
- ListView_SetImageList(grid,
- CallService(MS_CLIST_GETICONSIMAGELIST,0,0),LVSIL_SMALL);
+ ListView_SetImageList(grid,Clist_GetImageList,LVSIL_SMALL);
tmp:=LVS_EX_FULLROWSELECT or LVS_EX_SUBITEMIMAGES or LVS_EX_HEADERDRAGDROP or
LVS_EX_LABELTIP or LVS_EX_DOUBLEBUFFER;
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 72441c76e9..499ce50241 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -213,7 +213,7 @@ INT_PTR CALLBACK ShowListMainDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM ListView_InsertColumn(hList, 0, &lvc);
// add conacts to listview
- HIMAGELIST hImgList = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ HIMAGELIST hImgList = Clist_GetImageList();
if (hImgList != NULL)
ListView_SetImageList(hList, hImgList, LVSIL_SMALL);
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index f10def056c..b7fa55bcb7 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -318,7 +318,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa // status icon if (pwd->bIsIconVisible[0]) { for (i = 0; opt.exIconsOrder[i] != 0; i++); - pwd->extraIcons[i].hIcon = ImageList_GetIcon((HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0), pwd->iIconIndex, 0); + pwd->extraIcons[i].hIcon = ImageList_GetIcon(Clist_GetImageList(), pwd->iIconIndex, 0); pwd->extraIcons[i].bDestroy = true; } diff --git a/plugins/Utils.pas/protocols.pas b/plugins/Utils.pas/protocols.pas index bb57e337ad..f4526a6c09 100644 --- a/plugins/Utils.pas/protocols.pas +++ b/plugins/Utils.pas/protocols.pas @@ -226,8 +226,7 @@ begin begin
SetWindowLongPtrW(list,GWL_STYLE,
GetWindowLongPtrW(list,GWL_STYLE) or LVS_SHAREIMAGELISTS);
- ListView_SetImageList(list,
- CallService(MS_CLIST_GETICONSIMAGELIST,0,0),LVSIL_SMALL);
+ ListView_SetImageList(list,Clist_GetImageList,LVSIL_SMALL);
lvc.mask:=LVCF_FMT+LVCF_IMAGE
end
else
@@ -309,8 +308,7 @@ begin begin
SetWindowLongPtrW(list,GWL_STYLE,
GetWindowLongPtrW(list,GWL_STYLE) or LVS_SHAREIMAGELISTS);
- ListView_SetImageList(list,
- CallService(MS_CLIST_GETICONSIMAGELIST,0,0),LVSIL_SMALL);
+ ListView_SetImageList(list,Clist_GetImageList,LVSIL_SMALL);
lvc.mask:=LVCF_FMT+LVCF_IMAGE
end
else
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 417541d349..ee65c1f2f9 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -1110,7 +1110,7 @@ INT_PTR CIcqProto::RequestAdvStatusIconIdx(WPARAM wParam, LPARAM) if (bXStatus) {
if (!bXStatusCListIconsValid[bXStatus - 1]) { // adding icon
int idx = hXStatusCListIcons[bXStatus - 1];
- HIMAGELIST hCListImageList = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ HIMAGELIST hCListImageList = Clist_GetImageList();
if (hCListImageList) {
HICON hXStatusIcon = getXStatusIcon(bXStatus, LR_SHARED);
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 1a83ffad04..ccfb693037 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -310,7 +310,7 @@ int CJabberProto::LoadAdvancedIcons(int iID) mir_snwprintf(Group, LPGENW("Status icons")L"/%s/%S %s", m_tszUserName, proto, TranslateT("transport"));
mir_snprintf(defFile, "proto_%s.dll", proto);
if (!hAdvancedStatusIcon)
- hAdvancedStatusIcon = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ hAdvancedStatusIcon = Clist_GetImageList();
mir_cslock lck(m_csModeMsgMutex);
for (int i = 0; i < ID_STATUS_ONTHEPHONE - ID_STATUS_OFFLINE; i++) {
diff --git a/protocols/Steam/src/steam_xstatus.cpp b/protocols/Steam/src/steam_xstatus.cpp index ea8796448a..bf6812cad4 100644 --- a/protocols/Steam/src/steam_xstatus.cpp +++ b/protocols/Steam/src/steam_xstatus.cpp @@ -121,7 +121,7 @@ INT_PTR CSteamProto::OnRequestAdvStatusIconIdx(WPARAM wParam, LPARAM) if (std::find(xstatusIconsValid.begin(), xstatusIconsValid.end(), status) == xstatusIconsValid.end()) { // adding/updating icon - HIMAGELIST clistImageList = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0); + HIMAGELIST clistImageList = Clist_GetImageList(); if (clistImageList) { HICON hXStatusIcon = GetXStatusIcon(status, LR_SHARED); diff --git a/src/core/stdclist/src/init.cpp b/src/core/stdclist/src/init.cpp index 8c3a6d471d..2373ac2c35 100644 --- a/src/core/stdclist/src/init.cpp +++ b/src/core/stdclist/src/init.cpp @@ -84,7 +84,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_CLIST, static int OnAccountsChanged(WPARAM, LPARAM)
{
- himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ himlCListClc = Clist_GetImageList();
return 0;
}
@@ -96,7 +96,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) {
HookEvent(ME_MODERNOPT_INITIALIZE, OnModernOptsInit);
RegisterCListFonts();
- himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ himlCListClc = Clist_GetImageList();
return 0;
}
diff --git a/src/mir_app/src/clistmod.cpp b/src/mir_app/src/clistmod.cpp index 13f82b29ae..b74a591854 100644 --- a/src/mir_app/src/clistmod.cpp +++ b/src/mir_app/src/clistmod.cpp @@ -243,9 +243,9 @@ MIR_APP_DLL(void) Clist_ContactDoubleClicked(MCONTACT hContact) }
}
-static INT_PTR GetIconsImageList(WPARAM, LPARAM)
+MIR_APP_DLL(HIMAGELIST) Clist_GetImageList(void)
{
- return (INT_PTR)hCListImages;
+ return hCListImages;
}
static int CListIconsChanged(WPARAM, LPARAM)
@@ -431,7 +431,6 @@ int LoadContactListModule2(void) hCListImages = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 13, 0);
HookEvent(ME_SKIN_ICONSCHANGED, CListIconsChanged);
- CreateServiceFunction(MS_CLIST_GETICONSIMAGELIST, GetIconsImageList);
ImageList_AddIcon_NotShared(hCListImages, MAKEINTRESOURCE(IDI_BLANK));
diff --git a/src/mir_app/src/mir_app.def b/src/mir_app/src/mir_app.def index 4f2eee5936..c54c104990 100644 --- a/src/mir_app/src/mir_app.def +++ b/src/mir_app/src/mir_app.def @@ -271,3 +271,4 @@ Clist_MenuProcessHotkey @270 Clist_ContactChangeGroup @271
Clist_ContactCompare @272
Clist_ContactDoubleClicked @273
+Clist_GetImageList @274
diff --git a/src/mir_app/src/mir_app64.def b/src/mir_app/src/mir_app64.def index a046bfaf97..90a51705a2 100644 --- a/src/mir_app/src/mir_app64.def +++ b/src/mir_app/src/mir_app64.def @@ -271,3 +271,4 @@ Clist_MenuProcessHotkey @270 Clist_ContactChangeGroup @271
Clist_ContactCompare @272
Clist_ContactDoubleClicked @273
+Clist_GetImageList @274
|