From 6a52ba7c0566911d27468e748910bd87f0035c6a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 27 Jan 2013 11:59:50 +0000 Subject: all perversions will "core_main_*" icon names removed git-svn-id: http://svn.miranda-ng.org/main/trunk@3302 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- src/modules/extraicons/DefaultExtraIcons.cpp | 162 +++++++++++---------------- src/modules/extraicons/extraicons.cpp | 7 -- src/modules/extraicons/extraicons.h | 1 - src/modules/skin/skinicons.cpp | 115 ++++++++++--------- 4 files changed, 133 insertions(+), 152 deletions(-) (limited to 'src/modules') 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 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; -- cgit v1.2.3