summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-01-27 11:59:50 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-01-27 11:59:50 +0000
commit6a52ba7c0566911d27468e748910bd87f0035c6a (patch)
treefcc714ea23136e219ad6a7975a450caaf511492c
parent18f6faf592c21341463e835599b61fa811d3e1a0 (diff)
all perversions will "core_main_*" icon names removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@3302 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/m_skin.h7
-rw-r--r--plugins/AvatarHistory/src/icolib.cpp4
-rw-r--r--plugins/Dbx_mmap_SA/src/commonheaders.h1
-rw-r--r--plugins/Dbx_mmap_SA/src/dialogs.cpp61
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp7
-rw-r--r--plugins/TabSRMM/src/msgs.cpp18
-rw-r--r--protocols/FacebookRM/src/theme.cpp2
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp2
-rw-r--r--protocols/Twitter/src/theme.cpp2
-rw-r--r--src/modules/extraicons/DefaultExtraIcons.cpp162
-rw-r--r--src/modules/extraicons/extraicons.cpp7
-rw-r--r--src/modules/extraicons/extraicons.h1
-rw-r--r--src/modules/skin/skinicons.cpp115
13 files changed, 182 insertions, 207 deletions
diff --git a/include/m_skin.h b/include/m_skin.h
index 4363478fab..0da463463d 100644
--- a/include/m_skin.h
+++ b/include/m_skin.h
@@ -33,9 +33,10 @@ extern int hLangpack;
//returns NULL if id is invalid, but will always succeed for a valid id
#define MS_SKIN_LOADICON "Skin/Icons/Load"
//nice function to wrap this:
-__forceinline HICON LoadSkinnedIcon(int id) {return (HICON)CallService(MS_SKIN_LOADICON, id, 0);}
-__forceinline HANDLE LoadSkinnedIconHandle(int id) {return (HANDLE)CallService(MS_SKIN_LOADICON, id, 1);}
-__forceinline HICON LoadSkinnedIconBig(int id) {return (HICON)CallService(MS_SKIN_LOADICON, id, 2);}
+__forceinline HICON LoadSkinnedIcon(int id) { return (HICON) CallService(MS_SKIN_LOADICON, id, 0); }
+__forceinline HANDLE LoadSkinnedIconHandle(int id) { return (HANDLE)CallService(MS_SKIN_LOADICON, id, 1); }
+__forceinline HICON LoadSkinnedIconBig(int id) { return (HICON) CallService(MS_SKIN_LOADICON, id, 2); }
+__forceinline LPCSTR LoadSkinnedIconName(int id) { return (LPCSTR)CallService(MS_SKIN_LOADICON, id, 3); }
//event icons
#define SKINICON_EVENT_MESSAGE 100
diff --git a/plugins/AvatarHistory/src/icolib.cpp b/plugins/AvatarHistory/src/icolib.cpp
index 12497d1009..cc971b8d6e 100644
--- a/plugins/AvatarHistory/src/icolib.cpp
+++ b/plugins/AvatarHistory/src/icolib.cpp
@@ -8,13 +8,13 @@ enum IconIndex
static IconItem iconList[] =
{
- { LPGEN("History"), "core_main_10", IDI_AVATARHIST },
+ { LPGEN("History"), "", IDI_AVATARHIST },
{ LPGEN("Avatar Overlay"), "avh_overlay", IDI_AVATAROVERLAY }
};
static HICON LoadIconEx(IconIndex i)
{
- return Skin_GetIcon(iconList[(int)i].szName);
+ return Skin_GetIconByHandle(iconList[(int)i].hIcolib);
}
static void ReleaseIconEx(HICON hIcon)
diff --git a/plugins/Dbx_mmap_SA/src/commonheaders.h b/plugins/Dbx_mmap_SA/src/commonheaders.h
index a322878055..b1e5602a90 100644
--- a/plugins/Dbx_mmap_SA/src/commonheaders.h
+++ b/plugins/Dbx_mmap_SA/src/commonheaders.h
@@ -55,6 +55,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_langpack.h>
#include <m_utils.h>
#include <m_options.h>
+#include <m_skin.h>
//non-official miranda-plugins sdk
#include "m_folders.h"
diff --git a/plugins/Dbx_mmap_SA/src/dialogs.cpp b/plugins/Dbx_mmap_SA/src/dialogs.cpp
index 1d5c4fe4df..90c0fdbbab 100644
--- a/plugins/Dbx_mmap_SA/src/dialogs.cpp
+++ b/plugins/Dbx_mmap_SA/src/dialogs.cpp
@@ -113,54 +113,47 @@ void CDbxMmapSA::InitDialogs()
CreateServiceFunctionObj(MS_DB_CHANGEPASSWORD, ChangePassword, this);
}
-int ImageList_AddIcon_IconLibLoaded(HIMAGELIST hIml, char* name)
-{
- HICON hIcon = Skin_GetIcon(name);
- int res = ImageList_AddIcon(hIml, hIcon);
- return res;
-}
-
INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndList = GetDlgItem(hwndDlg, IDC_MODULES);
CDbxMmapSA *p_Db = (CDbxMmapSA*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- LVCOLUMN col;
LVITEM item;
int i, iRow, iIndex;
NMLISTVIEW * hdr = (NMLISTVIEW *) lParam;
WORD uid;
- HIMAGELIST hIml;
switch ( msg ) {
case WM_INITDIALOG:
- hIml = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus()? ILC_COLOR32 : ILC_COLOR16), 2, 0);
TranslateDialogDefault( hwndDlg );
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
p_Db = (CDbxMmapSA*)lParam;
-
- ImageList_AddIcon_IconLibLoaded( hIml, "core_main_29" );
- ImageList_AddIcon_IconLibLoaded( hIml, "core_main_30" );
- ListView_SetImageList( hwndList, hIml, LVSIL_SMALL );
-
- col.pszText = NULL;
- col.mask = LVCF_TEXT | LVCF_WIDTH;
- col.fmt = LVCFMT_LEFT;
- col.cx = 50;
- ListView_InsertColumn(hwndList, 1, &col);
-
- col.pszText = TranslateT("Dll");
- col.mask = LVCF_TEXT | LVCF_WIDTH;
- col.fmt = LVCFMT_LEFT;
- col.cx = 1000;
- ListView_InsertColumn(hwndList, 2, &col);
-
- col.pszText = TranslateT("Name");
- col.cx = 1000;
- ListView_InsertColumn(hwndList, 3, &col);
-
- col.pszText = TranslateT("Version");
- col.cx = 1000;
- ListView_InsertColumn(hwndList, 4, &col);
+ {
+ HIMAGELIST hIml = ImageList_Create(16, 16, ILC_MASK | (IsWinVerXPPlus()? ILC_COLOR32 : ILC_COLOR16), 2, 0);
+ ImageList_AddIcon(hIml, LoadSkinnedIcon(SKINICON_OTHER_LOADED));
+ ImageList_AddIcon(hIml, LoadSkinnedIcon(SKINICON_OTHER_NOTLOADED));
+ ListView_SetImageList( hwndList, hIml, LVSIL_SMALL );
+
+ LVCOLUMN col;
+ col.pszText = NULL;
+ col.mask = LVCF_TEXT | LVCF_WIDTH;
+ col.fmt = LVCFMT_LEFT;
+ col.cx = 50;
+ ListView_InsertColumn(hwndList, 1, &col);
+
+ col.pszText = TranslateT("Dll");
+ col.mask = LVCF_TEXT | LVCF_WIDTH;
+ col.fmt = LVCFMT_LEFT;
+ col.cx = 1000;
+ ListView_InsertColumn(hwndList, 2, &col);
+
+ col.pszText = TranslateT("Name");
+ col.cx = 1000;
+ ListView_InsertColumn(hwndList, 3, &col);
+
+ col.pszText = TranslateT("Version");
+ col.cx = 1000;
+ ListView_InsertColumn(hwndList, 4, &col);
+ }
ListView_SetExtendedListViewStyleEx(hwndList, 0, LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES);
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 57e5a10991..8e61a94067 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -1219,14 +1219,13 @@ static int BuildMenuObjectsTree(HWND hToolBarTree)
TreeView_DeleteAllItems(hToolBarTree);
himgl = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 2, 2);
- ImageList_AddIcon(himgl, Skin_GetIcon("core_main_24"));
- HIMAGELIST himl = TreeView_GetImageList(hToolBarTree, TVSIL_NORMAL);
- ImageList_Destroy(himl);
+ ImageList_AddIcon(himgl, LoadSkinnedIcon(SKINICON_OTHER_SMALLDOT));
+ ImageList_Destroy( TreeView_GetImageList(hToolBarTree, TVSIL_NORMAL));
TreeView_SetImageList(hToolBarTree, himgl, TVSIL_NORMAL);
-
if ((RButtonsList->realCount + LButtonsList->realCount) == 0)
return FALSE;
+
EnterCriticalSection(&ToolBarCS);
qsort(LButtonsList->items, LButtonsList->realCount, sizeof(CustomButtonData *), sstSortButtons);
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index ff26111ceb..a043188047 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -1106,17 +1106,17 @@ static int TSAPI LoadFromIconLib()
}
n++;
}
- PluginConfig.g_buttonBarIcons[0] = Skin_GetIcon("core_main_8");
- PluginConfig.g_buttonBarIcons[1] = Skin_GetIcon("core_main_10");
- PluginConfig.g_buttonBarIconHandles[0] = Skin_GetIconHandle("core_main_10");
- PluginConfig.g_buttonBarIconHandles[1] = Skin_GetIconHandle("core_main_8");
- PluginConfig.g_buttonBarIconHandles[20] = Skin_GetIconHandle("core_main_9");
+ PluginConfig.g_buttonBarIcons[0] = LoadSkinnedIcon(SKINICON_OTHER_ADDCONTACT);
+ PluginConfig.g_buttonBarIcons[1] = LoadSkinnedIcon(SKINICON_OTHER_HISTORY);
+ PluginConfig.g_buttonBarIconHandles[0] = LoadSkinnedIconHandle(SKINICON_OTHER_HISTORY);
+ PluginConfig.g_buttonBarIconHandles[1] = LoadSkinnedIconHandle(SKINICON_OTHER_ADDCONTACT);
+ PluginConfig.g_buttonBarIconHandles[20] = LoadSkinnedIconHandle(SKINICON_OTHER_USERDETAILS);
PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING] =
- PluginConfig.g_buttonBarIcons[12] = Skin_GetIcon("core_main_23");
- PluginConfig.g_IconChecked = Skin_GetIcon("core_main_19");
- PluginConfig.g_IconUnchecked = Skin_GetIcon("core_main_20");
- PluginConfig.g_IconFolder = Skin_GetIcon("core_main_5");
+ PluginConfig.g_buttonBarIcons[12] = LoadSkinnedIcon(SKINICON_OTHER_TYPING);
+ PluginConfig.g_IconChecked = LoadSkinnedIcon(SKINICON_OTHER_TICK);
+ PluginConfig.g_IconUnchecked = LoadSkinnedIcon(SKINICON_OTHER_NOTICK);
+ PluginConfig.g_IconFolder = LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN);
PluginConfig.g_iconOverlayEnabled = Skin_GetIcon("tabSRMM_overlay_enabled");
PluginConfig.g_iconOverlayDisabled = Skin_GetIcon("tabSRMM_overlay_disabled");
diff --git a/protocols/FacebookRM/src/theme.cpp b/protocols/FacebookRM/src/theme.cpp
index e29f5f727d..419dee4036 100644
--- a/protocols/FacebookRM/src/theme.cpp
+++ b/protocols/FacebookRM/src/theme.cpp
@@ -41,7 +41,7 @@ static IconItem icons[] =
void InitIcons(void)
{
Icon_Register(g_hInstance, "Protocols/Facebook", icons, SIZEOF(icons)-1, "Facebook");
- icons[ SIZEOF(icons)-1 ].hIcolib = Skin_GetIconHandle("core_main_2");
+ icons[ SIZEOF(icons)-1 ].hIcolib = LoadSkinnedIconHandle(SKINICON_EVENT_URL);
}
HANDLE GetIconHandle(const char* name)
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 1ecf1db98b..e30f358b21 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -1171,7 +1171,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
void CJabberProto::GroupchatProcessMessage(HXML node)
{
- HXML n, xNode, m;
+ HXML n, m;
const TCHAR *from, *type, *p, *nick, *resource;
JABBER_LIST_ITEM *item;
diff --git a/protocols/Twitter/src/theme.cpp b/protocols/Twitter/src/theme.cpp
index cb9dd71e9d..d1d212fbfe 100644
--- a/protocols/Twitter/src/theme.cpp
+++ b/protocols/Twitter/src/theme.cpp
@@ -35,7 +35,7 @@ static HANDLE hIconLibItem[SIZEOF(icons)];
void InitIcons(void)
{
Icon_Register(g_hInstance, "Protocols/Twitter", icons, SIZEOF(icons), "Twitter");
- icons[ SIZEOF(icons)-1 ].hIcolib = Skin_GetIconHandle("core_main_2");
+ icons[ SIZEOF(icons)-1 ].hIcolib = LoadSkinnedIconHandle(SKINICON_EVENT_URL);
}
HANDLE GetIconHandle(const char* name)
diff --git a/src/modules/extraicons/DefaultExtraIcons.cpp b/src/modules/extraicons/DefaultExtraIcons.cpp
index 5e865c7609..fdc6a79219 100644
--- a/src/modules/extraicons/DefaultExtraIcons.cpp
+++ b/src/modules/extraicons/DefaultExtraIcons.cpp
@@ -24,33 +24,8 @@
#include "ExtraIcon.h"
#include "extraicons.h"
-/*
- 0, // EXTRA_ICON_VISMODE
- 1, // EXTRA_ICON_EMAIL
- 2, // EXTRA_ICON_PROTO
- 3, // EXTRA_ICON_SMS
- 4, // EXTRA_ICON_ADV1
- 5, // EXTRA_ICON_ADV2
- 6, // EXTRA_ICON_WEB
- 7, // EXTRA_ICON_CLIENT
- 8, // EXTRA_ICON_ADV3
- 9, // EXTRA_ICON_ADV4
- */
-
-static void ProtocolInit();
-static void DBExtraIconsInit();
ExtraIcon* GetExtraIcon(HANDLE id);
-void DefaultExtraIcons_Load()
-{
- DBExtraIconsInit();
- ProtocolInit();
-}
-
-void DefaultExtraIcons_Unload()
-{
-}
-
// DB extra icons ///////////////////////////////////////////////////////////////////////
struct Info;
@@ -71,28 +46,27 @@ static void SetVisibility(HANDLE hContact, int apparentMode, bool clear)
if (apparentMode <= 0)
apparentMode = db_get_w(hContact, proto, "ApparentMode", 0);
- const char *ico = NULL;
- HANDLE hExtraIcon;
+ HANDLE hExtraIcon, hIcolib = NULL;
if ( db_get_b(hContact, proto, "ChatRoom", 0)) {
// Is chat
hExtraIcon = hExtraChat;
if (apparentMode == ID_STATUS_OFFLINE)
- ico = "ChatActivity";
+ hIcolib = Skin_GetIconHandle("ChatActivity");
}
else {
// Not chat
hExtraIcon = hExtraVisibility;
if (apparentMode == ID_STATUS_OFFLINE)
- ico = "core_main_47";
+ hIcolib = LoadSkinnedIconHandle(SKINICON_OTHER_INVISIBLE_ALL);
else if (apparentMode == ID_STATUS_ONLINE)
- ico = "core_main_46";
+ hIcolib = LoadSkinnedIconHandle(SKINICON_OTHER_VISIBLE_ALL);
}
- if (ico != NULL || clear) {
+ if (hIcolib != NULL || clear) {
ExtraIcon *extra = GetExtraIcon(hExtraIcon);
if (extra)
- extra->setIconByName((int)hExtraIcon, hContact, ico);
+ extra->setIcon((int)hExtraIcon, hContact, hIcolib);
}
}
@@ -133,21 +107,24 @@ struct Info
{
const char *name;
const char *desc;
- const char *icon;
+ int iSkinIcon;
const char *db[8];
void (*SetIcon)(HANDLE hContact, Info *info, const char *text);
void (*OnClick)(Info *info, const char *text);
- HANDLE hExtraIcon;
-} infos[] = {
- { "homepage", "Homepage", "core_main_2", { NULL, "Homepage",
- "UserInfo", "Homepage" }, DefaultSetIcon, &HomepageOnClick, NULL },
- { "sms", "Phone/SMS", "core_main_17", { NULL, "Cellular",
- "UserInfo", "Cellular",
- "UserInfo", "Phone",
- "UserInfo", "MyPhone0" }, DefaultSetIcon, NULL, NULL },
- { "email", "E-mail", "core_main_14", { NULL, "e-mail",
- "UserInfo", "e-mail",
- "UserInfo", "Mye-mail0" }, DefaultSetIcon, &EmailOnClick, NULL },
+
+ HANDLE hIcolib, hExtraIcon;
+}
+static infos[] =
+{
+ { "homepage", "Homepage", SKINICON_EVENT_URL,
+ { NULL, "Homepage", "UserInfo", "Homepage" },
+ DefaultSetIcon, &HomepageOnClick },
+ { "sms", "Phone/SMS", SKINICON_OTHER_SMS,
+ { NULL, "Cellular", "UserInfo", "Cellular", "UserInfo", "Phone", "UserInfo", "MyPhone0" },
+ DefaultSetIcon, NULL },
+ { "email", "E-mail", SKINICON_OTHER_SENDEMAIL,
+ { NULL, "e-mail", "UserInfo", "e-mail", "UserInfo", "Mye-mail0" },
+ DefaultSetIcon, &EmailOnClick },
};
static void EmailOnClick(Info *info, const char *text)
@@ -164,7 +141,7 @@ static void HomepageOnClick(Info *info, const char *text)
static void DefaultSetIcon(HANDLE hContact, Info *info, const char *text)
{
- ExtraIcon_SetIcon(info->hExtraIcon, hContact, text ? info->icon : NULL);
+ ExtraIcon_SetIcon(info->hExtraIcon, hContact, text ? info->hIcolib : NULL);
}
static void SetExtraIcons(HANDLE hContact)
@@ -177,17 +154,17 @@ static void SetExtraIcons(HANDLE hContact)
return;
for (unsigned int i = 0; i < SIZEOF(infos); i++) {
- Info &info = infos[i];
+ Info &p = infos[i];
bool show = false;
- for (unsigned int j = 0; !show && j < SIZEOF(info.db); j += 2) {
- if (info.db[j + 1] == NULL)
+ for (unsigned int j = 0; !show && j < SIZEOF(p.db); j += 2) {
+ if (p.db[j + 1] == NULL)
break;
DBVARIANT dbv;
- if (!DBGetContactSettingString(hContact, info.db[j] == NULL ? proto : info.db[j], info.db[j+1], &dbv)) {
+ if (!DBGetContactSettingString(hContact, p.db[j] == NULL ? proto : p.db[j], p.db[j+1], &dbv)) {
if (!IsEmpty(dbv.pszVal)) {
- info.SetIcon(hContact, &info, dbv.pszVal);
+ p.SetIcon(hContact, &p, dbv.pszVal);
show = true;
}
db_free(&dbv);
@@ -219,21 +196,21 @@ static int SettingChanged(WPARAM wParam, LPARAM lParam)
return 0;
}
- for (unsigned int i = 0; i < SIZEOF(infos); i++) {
- Info &info = infos[i];
+ for (int i = 0; i < SIZEOF(infos); i++) {
+ Info &p = infos[i];
- for (unsigned int j = 0; j < SIZEOF(info.db); j += 2) {
- if (info.db[j + 1] == NULL)
+ for (int j = 0; j < SIZEOF(p.db); j += 2) {
+ if (p.db[j + 1] == NULL)
break;
- if (info.db[j] == NULL && !isProto)
+ if (p.db[j] == NULL && !isProto)
continue;
- if (info.db[j] != NULL && strcmp(cws->szModule, info.db[j]))
+ if (p.db[j] != NULL && strcmp(cws->szModule, p.db[j]))
continue;
- if (strcmp(cws->szSetting, info.db[j + 1]))
+ if (strcmp(cws->szSetting, p.db[j + 1]))
continue;
bool show = (cws->value.type != DBVT_DELETED && !IsEmpty(cws->value.pszVal));
- info.SetIcon(hContact, &info, show ? cws->value.pszVal : NULL);
+ p.SetIcon(hContact, &p, show ? cws->value.pszVal : NULL);
break;
}
@@ -244,8 +221,8 @@ static int SettingChanged(WPARAM wParam, LPARAM lParam)
static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param)
{
- Info *info = (Info*)param;
- if (info == NULL)
+ Info *p = (Info*)param;
+ if (p == NULL)
return 0;
HANDLE hContact = (HANDLE)wParam;
@@ -257,14 +234,14 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param)
return 0;
bool found = false;
- for (unsigned int j = 0; !found && j < SIZEOF(info->db); j += 2) {
- if (info->db[j + 1] == NULL)
+ for (int j = 0; !found && j < SIZEOF(p->db); j += 2) {
+ if (p->db[j + 1] == NULL)
break;
DBVARIANT dbv;
- if ( !DBGetContactSettingString(hContact, info->db[j] == NULL ? proto : info->db[j], info->db[j+1], &dbv)) {
+ if ( !DBGetContactSettingString(hContact, p->db[j] == NULL ? proto : p->db[j], p->db[j+1], &dbv)) {
if (!IsEmpty(dbv.pszVal)) {
- info->OnClick(info, dbv.pszVal);
+ p->OnClick(p, dbv.pszVal);
found = true;
}
@@ -275,32 +252,6 @@ static int DefaultOnClick(WPARAM wParam, LPARAM lParam, LPARAM param)
return 0;
}
-static void DBExtraIconsInit()
-{
- hExtraChat = ExtraIcon_Register("chat_activity", "Chat activity", "ChatActivity");
- hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", "core_main_46");
- hExtraGender = ExtraIcon_Register("gender", "Gender", "gender_male");
-
- for (unsigned int i = 0; i < SIZEOF(infos); i++) {
- Info &info = infos[i];
- if (info.OnClick)
- info.hExtraIcon = ExtraIcon_Register(info.name, info.desc, info.icon, DefaultOnClick, (LPARAM) &info);
- else
- info.hExtraIcon = ExtraIcon_Register(info.name, info.desc, info.icon);
- }
-
- HANDLE hContact = db_find_first();
- while (hContact != NULL) {
- SetExtraIcons(hContact);
- SetVisibility(hContact, -1, false);
- SetGender(hContact, -1, false);
-
- hContact = db_find_next(hContact);
- }
-
- HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged);
-}
-
// Protocol /////////////////////////////////////////////////////////////////////////////
struct ProtoInfo
@@ -311,7 +262,7 @@ struct ProtoInfo
vector<ProtoInfo> protos;
-HANDLE hExtraProto = NULL;
+static HANDLE hExtraProto;
static int ProtocolRebuildIcons(WPARAM wParam, LPARAM lParam)
{
@@ -372,8 +323,31 @@ static int ProtocolOnClick(WPARAM wParam, LPARAM lParam, LPARAM param)
return 0;
}
-static void ProtocolInit()
+void DefaultExtraIcons_Load()
{
- hExtraProto = ExtraIcon_Register("protocol", "Account", "core_main_34", &ProtocolRebuildIcons, &ProtocolApplyIcon,
- &ProtocolOnClick);
+ hExtraChat = ExtraIcon_Register("chat_activity", "Chat activity", "ChatActivity");
+ hExtraVisibility = ExtraIcon_Register("visibility", "Visibility", LoadSkinnedIconName(SKINICON_OTHER_VISIBLE_ALL));
+ hExtraGender = ExtraIcon_Register("gender", "Gender", "gender_male");
+ hExtraProto = ExtraIcon_Register("protocol", "Account", LoadSkinnedIconName(SKINICON_OTHER_ACCMGR),
+ &ProtocolRebuildIcons, &ProtocolApplyIcon, &ProtocolOnClick);
+
+ for (unsigned int i = 0; i < SIZEOF(infos); i++) {
+ Info &p = infos[i];
+ p.hIcolib = LoadSkinnedIconHandle(p.iSkinIcon);
+ if (p.OnClick)
+ p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon), DefaultOnClick, (LPARAM) &p);
+ else
+ p.hExtraIcon = ExtraIcon_Register(p.name, p.desc, LoadSkinnedIconName(p.iSkinIcon));
+ }
+
+ HANDLE hContact = db_find_first();
+ while (hContact != NULL) {
+ SetExtraIcons(hContact);
+ SetVisibility(hContact, -1, false);
+ SetGender(hContact, -1, false);
+
+ hContact = db_find_next(hContact);
+ }
+
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED, SettingChanged);
}
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp
index b47a5d4dd9..f7b5493f6f 100644
--- a/src/modules/extraicons/extraicons.cpp
+++ b/src/modules/extraicons/extraicons.cpp
@@ -73,12 +73,6 @@ void KillModuleExtraIcons(int hLangpack)
}
}
-int PreShutdown(WPARAM wParam, LPARAM lParam)
-{
- DefaultExtraIcons_Unload();
- return 0;
-}
-
int GetNumberOfSlots()
{
return clistSlotCount;
@@ -536,7 +530,6 @@ void LoadExtraIconsModule()
// Hooks
HookEvent(ME_SYSTEM_MODULESLOADED, &ModulesLoaded);
- HookEvent(ME_SYSTEM_PRESHUTDOWN, &PreShutdown);
HookEvent(ME_CLIST_EXTRA_LIST_REBUILD, &ClistExtraListRebuild);
HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, &ClistExtraImageApply);
diff --git a/src/modules/extraicons/extraicons.h b/src/modules/extraicons/extraicons.h
index 7d8f14e2fc..f4aa7ae770 100644
--- a/src/modules/extraicons/extraicons.h
+++ b/src/modules/extraicons/extraicons.h
@@ -43,7 +43,6 @@ int ConvertToClistSlot(int slot);
int Clist_SetExtraIcon(HANDLE hContact, int slot, HANDLE hImage);
void DefaultExtraIcons_Load();
-void DefaultExtraIcons_Unload();
HANDLE ExtraIcon_Add(HICON hIcon);
diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp
index de309707aa..3940011d19 100644
--- a/src/modules/skin/skinicons.cpp
+++ b/src/modules/skin/skinicons.cpp
@@ -35,53 +35,53 @@ struct StandardIconDescription
static struct StandardIconDescription mainIcons[] =
{
- { SKINICON_OTHER_MIRANDA, LPGEN("Miranda NG"), -IDI_MIRANDA },
- { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG },
- { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL },
- { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE },
- { SKINICON_OTHER_USERONLINE, LPGEN("User Online"), -IDI_USERONLINE },
- { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (Open)"), -IDI_GROUPOPEN },
- { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (Closed)"), -IDI_GROUPSHUT },
- { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD },
- { SKINICON_OTHER_ADDCONTACT, LPGEN("Add Contact"), -IDI_ADDCONTACT },
- { SKINICON_OTHER_USERDETAILS, LPGEN("User Details"), -IDI_USERDETAILS },
- { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY },
- { SKINICON_OTHER_DOWNARROW, LPGEN("Down Arrow"), -IDI_DOWNARROW },
- { SKINICON_OTHER_FINDUSER, LPGEN("Find User"), -IDI_FINDUSER },
- { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS },
- { SKINICON_OTHER_SENDEMAIL, LPGEN("Send E-mail"), -IDI_SENDEMAIL },
- { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE },
- { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME },
- { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS },
- { SKINICON_OTHER_SEARCHALL, LPGEN("Search All"), -IDI_SEARCHALL },
- { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK },
- { SKINICON_OTHER_NOTICK, LPGEN("No Tick"), -IDI_NOTICK },
- { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP },
- { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda Website"), -IDI_MIRANDAWEBSITE },
- { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING },
- { SKINICON_OTHER_SMALLDOT, LPGEN("Small Dot"), -IDI_SMALLDOT },
- { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled Blob"), -IDI_FILLEDBLOB },
- { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty Blob"), -IDI_EMPTYBLOB },
- { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE },
- { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI },
- { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED },
- { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED },
- { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO },
- { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW },
- { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS },
- { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR },
- { SKINICON_OTHER_SHOWHIDE, LPGEN("ShowHide"), -IDI_SHOWHIDE },
- { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT },
- { SKINICON_OTHER_MAINMENU, LPGEN("Main Menu"), -IDI_MAINMENU },
- { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE },
- { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT },
- { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT },
- { SKINICON_OTHER_GROUP, LPGEN("Move to Group"), -IDI_MOVETOGROUP },
- { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON },
- { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF },
- { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY },
- { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY },
- { SKINICON_OTHER_FRAME, LPGEN("Frames"), -IDI_FRAME },
+ { SKINICON_OTHER_MIRANDA, LPGEN("Miranda NG"), -IDI_MIRANDA }, // 0
+ { SKINICON_EVENT_MESSAGE, LPGEN("Message"), -IDI_RECVMSG }, // 1
+ { SKINICON_EVENT_URL, LPGEN("URL"), -IDI_URL }, // 2
+ { SKINICON_EVENT_FILE, LPGEN("File"), -IDI_FILE }, // 3
+ { SKINICON_OTHER_USERONLINE, LPGEN("User Online"), -IDI_USERONLINE }, // 4
+ { SKINICON_OTHER_GROUPOPEN, LPGEN("Group (Open)"), -IDI_GROUPOPEN }, // 5
+ { SKINICON_OTHER_GROUPSHUT, LPGEN("Group (Closed)"), -IDI_GROUPSHUT }, // 6
+ { SKINICON_OTHER_CONNECTING, LPGEN("Connecting"), -IDI_LOAD }, // 7
+ { SKINICON_OTHER_ADDCONTACT, LPGEN("Add Contact"), -IDI_ADDCONTACT }, // 8
+ { SKINICON_OTHER_USERDETAILS, LPGEN("User Details"), -IDI_USERDETAILS }, // 9
+ { SKINICON_OTHER_HISTORY, LPGEN("History"), -IDI_HISTORY }, // 10
+ { SKINICON_OTHER_DOWNARROW, LPGEN("Down Arrow"), -IDI_DOWNARROW }, // 11
+ { SKINICON_OTHER_FINDUSER, LPGEN("Find User"), -IDI_FINDUSER }, // 12
+ { SKINICON_OTHER_OPTIONS, LPGEN("Options"), -IDI_OPTIONS }, // 13
+ { SKINICON_OTHER_SENDEMAIL, LPGEN("Send E-mail"), -IDI_SENDEMAIL }, // 14
+ { SKINICON_OTHER_DELETE, LPGEN("Delete"), -IDI_DELETE }, // 15
+ { SKINICON_OTHER_RENAME, LPGEN("Rename"), -IDI_RENAME }, // 16
+ { SKINICON_OTHER_SMS, LPGEN("SMS"), -IDI_SMS }, // 17
+ { SKINICON_OTHER_SEARCHALL, LPGEN("Search All"), -IDI_SEARCHALL }, // 18
+ { SKINICON_OTHER_TICK, LPGEN("Tick"), -IDI_TICK }, // 19
+ { SKINICON_OTHER_NOTICK, LPGEN("No Tick"), -IDI_NOTICK }, // 20
+ { SKINICON_OTHER_HELP, LPGEN("Help"), -IDI_HELP }, // 21
+ { SKINICON_OTHER_MIRANDAWEB, LPGEN("Miranda Website"), -IDI_MIRANDAWEBSITE }, // 22
+ { SKINICON_OTHER_TYPING, LPGEN("Typing"), -IDI_TYPING }, // 23
+ { SKINICON_OTHER_SMALLDOT, LPGEN("Small Dot"), -IDI_SMALLDOT }, // 24
+ { SKINICON_OTHER_FILLEDBLOB, LPGEN("Filled Blob"), -IDI_FILLEDBLOB }, // 25
+ { SKINICON_OTHER_EMPTYBLOB, LPGEN("Empty Blob"), -IDI_EMPTYBLOB }, // 26
+ { SKINICON_OTHER_UNICODE, LPGEN("Unicode plugin"), -IDI_UNICODE }, // 27
+ { SKINICON_OTHER_ANSI, LPGEN("ANSI plugin"), -IDI_ANSI }, // 28
+ { SKINICON_OTHER_LOADED, LPGEN("Running plugin"), -IDI_LOADED }, // 29
+ { SKINICON_OTHER_NOTLOADED, LPGEN("Unloaded plugin"), -IDI_NOTLOADED }, // 30
+ { SKINICON_OTHER_UNDO, LPGEN("Undo"), -IDI_UNDO }, // 31
+ { SKINICON_OTHER_WINDOW, LPGEN("Window"), -IDI_WINDOW }, // 32
+ { SKINICON_OTHER_WINDOWS, LPGEN("System"), -IDI_WINDOWS }, // 33
+ { SKINICON_OTHER_ACCMGR, LPGEN("Accounts"), -IDI_ACCMGR }, // 34
+ { SKINICON_OTHER_SHOWHIDE, LPGEN("ShowHide"), -IDI_SHOWHIDE }, // 35
+ { SKINICON_OTHER_EXIT, LPGEN("Exit"), -IDI_EXIT }, // 36
+ { SKINICON_OTHER_MAINMENU, LPGEN("Main Menu"), -IDI_MAINMENU }, // 37
+ { SKINICON_OTHER_STATUS, LPGEN("Status"), -IDI_ONLINE }, // 38
+ { SKINICON_CHAT_JOIN, LPGEN("Join chat"), -IDI_JOINCHAT }, // 39
+ { SKINICON_CHAT_LEAVE, LPGEN("Leave chat"), -IDI_LEAVECHAT }, // 40
+ { SKINICON_OTHER_GROUP, LPGEN("Move to Group"), -IDI_MOVETOGROUP }, // 41
+ { SKINICON_OTHER_ON, LPGEN("On"), -IDI_ON }, // 42
+ { SKINICON_OTHER_OFF, LPGEN("Off"), -IDI_OFF }, // 43
+ { SKINICON_OTHER_LOADEDGRAY, LPGEN("Running core plugin"), -IDI_LOADED_GRAY }, // 44
+ { SKINICON_OTHER_NOTLOADEDGRAY, LPGEN("Non-loadable plugin"), -IDI_NOTLOADED_GRAY }, // 45
+ { SKINICON_OTHER_FRAME, LPGEN("Frames"), -IDI_FRAME }, // 46
{ SKINICON_OTHER_VISIBLE_ALL, LPGEN("Always visible"), -IDI_ALWAYSVIS, 0, "Contact List" },
{ SKINICON_OTHER_INVISIBLE_ALL, LPGEN("Always invisible"), -IDI_NEVERVIS, 0, "Contact List" },
{ SKINICON_OTHER_STATUS_LOCKED, LPGEN("Locked status"), -IDI_STATUS_LOCKED, 0, "Status Icons" },
@@ -101,9 +101,9 @@ static struct StandardIconDescription statusIcons[] =
{ ID_STATUS_OUTTOLUNCH, LPGEN("Out to lunch"), -IDI_OUTTOLUNCH, PF2_OUTTOLUNCH }
};
-const char *mainIconsFmt = "core_main_";
-const char *statusIconsFmt = "core_status_";
-const char *protoIconsFmt = LPGEN("%s Icons");
+const char mainIconsFmt[] = "core_main_";
+const char statusIconsFmt[] = "core_status_";
+const char protoIconsFmt[] = LPGEN("%s Icons");
#define PROTOCOLS_PREFIX "Status Icons/"
#define GLOBAL_PROTO_NAME "*"
@@ -335,6 +335,20 @@ HANDLE GetSkinIconHandle(int idx)
return NULL;
}
+char* GetSkinIconName(int idx)
+{
+ static char szIconName[100];
+
+ for (int i=0; i < SIZEOF(mainIcons); i++) {
+ if (idx != mainIcons[i].id)
+ continue;
+
+ mir_snprintf(szIconName, SIZEOF(szIconName), "%s%d", mainIconsFmt, i);
+ return szIconName;
+ }
+ return NULL;
+}
+
HICON LoadSkinIcon(int idx, bool big)
{
//
@@ -377,6 +391,7 @@ static INT_PTR sttLoadSkinIcon(WPARAM wParam, LPARAM lParam)
case 0: return (INT_PTR)LoadSkinIcon(wParam);
case 1: return (INT_PTR)GetSkinIconHandle(wParam);
case 2: return (INT_PTR)LoadSkinIcon(wParam, true);
+ case 3: return (INT_PTR)GetSkinIconName(wParam);
}
return 0;