diff options
author | George Hazan <ghazan@miranda.im> | 2019-04-12 19:18:52 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-04-12 19:18:52 +0300 |
commit | 210080b3011c08b58184d9ccb7ebd52b9d5433a0 (patch) | |
tree | 735ce33a317db3a2c0bc1dd86cea83292f84794e /protocols | |
parent | 00c78ff657f997727c6ed7a66edde98c6036ed30 (diff) |
wiping custom icolib functions: Jabber
Diffstat (limited to 'protocols')
25 files changed, 333 insertions, 396 deletions
diff --git a/protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc b/protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc index 40eb3e2084..5e3f300d2c 100644 --- a/protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc +++ b/protocols/JabberG/jabber_xstatus/res/JABBER_XSTATUS.rc @@ -26,170 +26,170 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
-201 ICON "moods/afraid.ico"
-202 ICON "moods/amazed.ico"
-203 ICON "moods/amorous.ico"
-204 ICON "moods/angry.ico"
-205 ICON "moods/annoyed.ico"
-206 ICON "moods/anxious.ico"
-207 ICON "moods/aroused.ico"
-208 ICON "moods/ashamed.ico"
-209 ICON "moods/bored.ico"
-210 ICON "moods/brave.ico"
-211 ICON "moods/calm.ico"
-212 ICON "moods/cautious.ico"
-213 ICON "moods/cold.ico"
-214 ICON "moods/confident.ico"
-215 ICON "moods/confused.ico"
-216 ICON "moods/contemplative.ico"
-217 ICON "moods/contented.ico"
-218 ICON "moods/cranky.ico"
-219 ICON "moods/crazy.ico"
-220 ICON "moods/creative.ico"
-221 ICON "moods/curious.ico"
-222 ICON "moods/dejected.ico"
-223 ICON "moods/depressed.ico"
-224 ICON "moods/disappointed.ico"
-225 ICON "moods/disgusted.ico"
-226 ICON "moods/dismayed.ico"
-227 ICON "moods/distracted.ico"
-228 ICON "moods/embarrassed.ico"
-229 ICON "moods/envious.ico"
-230 ICON "moods/excited.ico"
-231 ICON "moods/flirtatious.ico"
-232 ICON "moods/frustrated.ico"
-233 ICON "moods/grateful.ico"
-234 ICON "moods/grieving.ico"
-235 ICON "moods/grumpy.ico"
-236 ICON "moods/guilty.ico"
-237 ICON "moods/happy.ico"
-238 ICON "moods/hopeful.ico"
-239 ICON "moods/hot.ico"
-240 ICON "moods/humbled.ico"
-241 ICON "moods/humiliated.ico"
-242 ICON "moods/hungry.ico"
-243 ICON "moods/hurt.ico"
-244 ICON "moods/impressed.ico"
-245 ICON "moods/in_awe.ico"
-246 ICON "moods/in_love.ico"
-247 ICON "moods/indignant.ico"
-248 ICON "moods/interested.ico"
-249 ICON "moods/intoxicated.ico"
-250 ICON "moods/invincible.ico"
-251 ICON "moods/jealous.ico"
-252 ICON "moods/lonely.ico"
-253 ICON "moods/lost.ico"
-254 ICON "moods/lucky.ico"
-255 ICON "moods/mean.ico"
-256 ICON "moods/moody.ico"
-257 ICON "moods/nervous.ico"
-258 ICON "moods/neutral.ico"
-259 ICON "moods/offended.ico"
-260 ICON "moods/outraged.ico"
-261 ICON "moods/playful.ico"
-262 ICON "moods/proud.ico"
-263 ICON "moods/relaxed.ico"
-264 ICON "moods/relieved.ico"
-265 ICON "moods/remorseful.ico"
-266 ICON "moods/restless.ico"
-267 ICON "moods/sad.ico"
-268 ICON "moods/sarcastic.ico"
-269 ICON "moods/satisfied.ico"
-270 ICON "moods/serious.ico"
-271 ICON "moods/shocked.ico"
-272 ICON "moods/shy.ico"
-273 ICON "moods/sick.ico"
-274 ICON "moods/sleepy.ico"
-275 ICON "moods/spontaneous.ico"
-276 ICON "moods/stressed.ico"
-277 ICON "moods/strong.ico"
-278 ICON "moods/surprised.ico"
-279 ICON "moods/thankful.ico"
-280 ICON "moods/thirsty.ico"
-281 ICON "moods/tired.ico"
-282 ICON "moods/undefined.ico"
-283 ICON "moods/weak.ico"
-284 ICON "moods/worried.ico"
+1201 ICON "moods/afraid.ico"
+1202 ICON "moods/amazed.ico"
+1203 ICON "moods/amorous.ico"
+1204 ICON "moods/angry.ico"
+1205 ICON "moods/annoyed.ico"
+1206 ICON "moods/anxious.ico"
+1207 ICON "moods/aroused.ico"
+1208 ICON "moods/ashamed.ico"
+1209 ICON "moods/bored.ico"
+1210 ICON "moods/brave.ico"
+1211 ICON "moods/calm.ico"
+1212 ICON "moods/cautious.ico"
+1213 ICON "moods/cold.ico"
+1214 ICON "moods/confident.ico"
+1215 ICON "moods/confused.ico"
+1216 ICON "moods/contemplative.ico"
+1217 ICON "moods/contented.ico"
+1218 ICON "moods/cranky.ico"
+1219 ICON "moods/crazy.ico"
+1220 ICON "moods/creative.ico"
+1221 ICON "moods/curious.ico"
+1222 ICON "moods/dejected.ico"
+1223 ICON "moods/depressed.ico"
+1224 ICON "moods/disappointed.ico"
+1225 ICON "moods/disgusted.ico"
+1226 ICON "moods/dismayed.ico"
+1227 ICON "moods/distracted.ico"
+1228 ICON "moods/embarrassed.ico"
+1229 ICON "moods/envious.ico"
+1230 ICON "moods/excited.ico"
+1231 ICON "moods/flirtatious.ico"
+1232 ICON "moods/frustrated.ico"
+1233 ICON "moods/grateful.ico"
+1234 ICON "moods/grieving.ico"
+1235 ICON "moods/grumpy.ico"
+1236 ICON "moods/guilty.ico"
+1237 ICON "moods/happy.ico"
+1238 ICON "moods/hopeful.ico"
+1239 ICON "moods/hot.ico"
+1240 ICON "moods/humbled.ico"
+1241 ICON "moods/humiliated.ico"
+1242 ICON "moods/hungry.ico"
+1243 ICON "moods/hurt.ico"
+1244 ICON "moods/impressed.ico"
+1245 ICON "moods/in_awe.ico"
+1246 ICON "moods/in_love.ico"
+1247 ICON "moods/indignant.ico"
+1248 ICON "moods/interested.ico"
+1249 ICON "moods/intoxicated.ico"
+1250 ICON "moods/invincible.ico"
+1251 ICON "moods/jealous.ico"
+1252 ICON "moods/lonely.ico"
+1253 ICON "moods/lost.ico"
+1254 ICON "moods/lucky.ico"
+1255 ICON "moods/mean.ico"
+1256 ICON "moods/moody.ico"
+1257 ICON "moods/nervous.ico"
+1258 ICON "moods/neutral.ico"
+1259 ICON "moods/offended.ico"
+1260 ICON "moods/outraged.ico"
+1261 ICON "moods/playful.ico"
+1262 ICON "moods/proud.ico"
+1263 ICON "moods/relaxed.ico"
+1264 ICON "moods/relieved.ico"
+1265 ICON "moods/remorseful.ico"
+1266 ICON "moods/restless.ico"
+1267 ICON "moods/sad.ico"
+1268 ICON "moods/sarcastic.ico"
+1269 ICON "moods/satisfied.ico"
+1270 ICON "moods/serious.ico"
+1271 ICON "moods/shocked.ico"
+1272 ICON "moods/shy.ico"
+1273 ICON "moods/sick.ico"
+1274 ICON "moods/sleepy.ico"
+1275 ICON "moods/spontaneous.ico"
+1276 ICON "moods/stressed.ico"
+1277 ICON "moods/strong.ico"
+1278 ICON "moods/surprised.ico"
+1279 ICON "moods/thankful.ico"
+1280 ICON "moods/thirsty.ico"
+1281 ICON "moods/tired.ico"
+1282 ICON "moods/undefined.ico"
+1283 ICON "moods/weak.ico"
+1284 ICON "moods/worried.ico"
-300 ICON "activities/doing_chores.ico"
-301 ICON "activities/buying_groceries.ico"
-302 ICON "activities/cleaning.ico"
-303 ICON "activities/cooking.ico"
-304 ICON "activities/doing_maintenance.ico"
-305 ICON "activities/doing_the_dishes.ico"
-306 ICON "activities/doing_the_laundry.ico"
-307 ICON "activities/gardening.ico"
-308 ICON "activities/running_an_errand.ico"
-309 ICON "activities/walking_the_dog.ico"
-320 ICON "activities/drinking.ico"
-321 ICON "activities/having_a_beer.ico"
-322 ICON "activities/having_coffee.ico"
-323 ICON "activities/having_tea.ico"
-340 ICON "activities/eating.ico"
-341 ICON "activities/having_a_snack.ico"
-342 ICON "activities/having_breakfast.ico"
-343 ICON "activities/having_dinner.ico"
-344 ICON "activities/having_lunch.ico"
-360 ICON "activities/exercising.ico"
-361 ICON "activities/cycling.ico"
-362 ICON "activities/dancing.ico"
-363 ICON "activities/hiking.ico"
-364 ICON "activities/jogging.ico"
-365 ICON "activities/playing_sports.ico"
-366 ICON "activities/running.ico"
-367 ICON "activities/skiing.ico"
-368 ICON "activities/swimming.ico"
-369 ICON "activities/working_out.ico"
-380 ICON "activities/grooming.ico"
-381 ICON "activities/at_the_spa.ico"
-382 ICON "activities/brushing_teeth.ico"
-383 ICON "activities/getting_a_haircut.ico"
-384 ICON "activities/shaving.ico"
-385 ICON "activities/taking_a_bath.ico"
-386 ICON "activities/taking_a_shower.ico"
-400 ICON "activities/having_appointment.ico"
-420 ICON "activities/inactive.ico"
-421 ICON "activities/day_off.ico"
-422 ICON "activities/hanging_out.ico"
-423 ICON "activities/hiding.ico"
-424 ICON "activities/on_vacation.ico"
-425 ICON "activities/praying.ico"
-426 ICON "activities/scheduled_holiday.ico"
-427 ICON "activities/sleeping.ico"
-428 ICON "activities/thinking.ico"
-440 ICON "activities/relaxing.ico"
-441 ICON "activities/fishing.ico"
-442 ICON "activities/gaming.ico"
-443 ICON "activities/going_out.ico"
-444 ICON "activities/partying.ico"
-445 ICON "activities/reading.ico"
-446 ICON "activities/rehearsing.ico"
-447 ICON "activities/shopping.ico"
-448 ICON "activities/smoking.ico"
-449 ICON "activities/socializing.ico"
-450 ICON "activities/sunbathing.ico"
-451 ICON "activities/watching_tv.ico"
-452 ICON "activities/watching_a_movie.ico"
-460 ICON "activities/talking.ico"
-461 ICON "activities/in_real_life.ico"
-462 ICON "activities/on_the_phone.ico"
-463 ICON "activities/on_video_phone.ico"
-480 ICON "activities/traveling.ico"
-481 ICON "activities/commuting.ico"
-482 ICON "activities/cycling.ico"
-483 ICON "activities/driving.ico"
-484 ICON "activities/in_a_car.ico"
-485 ICON "activities/on_a_bus.ico"
-486 ICON "activities/on_a_plane.ico"
-487 ICON "activities/on_a_train.ico"
-488 ICON "activities/on_a_trip.ico"
-489 ICON "activities/walking.ico"
-500 ICON "activities/working.ico"
-501 ICON "activities/coding.ico"
-502 ICON "activities/in_a_meeting.ico"
-503 ICON "activities/studying.ico"
-504 ICON "activities/writing.ico"
+1300 ICON "activities/doing_chores.ico"
+1301 ICON "activities/buying_groceries.ico"
+1302 ICON "activities/cleaning.ico"
+1303 ICON "activities/cooking.ico"
+1304 ICON "activities/doing_maintenance.ico"
+1305 ICON "activities/doing_the_dishes.ico"
+1306 ICON "activities/doing_the_laundry.ico"
+1307 ICON "activities/gardening.ico"
+1308 ICON "activities/running_an_errand.ico"
+1309 ICON "activities/walking_the_dog.ico"
+1320 ICON "activities/drinking.ico"
+1321 ICON "activities/having_a_beer.ico"
+1322 ICON "activities/having_coffee.ico"
+1323 ICON "activities/having_tea.ico"
+1340 ICON "activities/eating.ico"
+1341 ICON "activities/having_a_snack.ico"
+1342 ICON "activities/having_breakfast.ico"
+1343 ICON "activities/having_dinner.ico"
+1344 ICON "activities/having_lunch.ico"
+1360 ICON "activities/exercising.ico"
+1361 ICON "activities/cycling.ico"
+1362 ICON "activities/dancing.ico"
+1363 ICON "activities/hiking.ico"
+1364 ICON "activities/jogging.ico"
+1365 ICON "activities/playing_sports.ico"
+1366 ICON "activities/running.ico"
+1367 ICON "activities/skiing.ico"
+1368 ICON "activities/swimming.ico"
+1369 ICON "activities/working_out.ico"
+1380 ICON "activities/grooming.ico"
+1381 ICON "activities/at_the_spa.ico"
+1382 ICON "activities/brushing_teeth.ico"
+1383 ICON "activities/getting_a_haircut.ico"
+1384 ICON "activities/shaving.ico"
+1385 ICON "activities/taking_a_bath.ico"
+1386 ICON "activities/taking_a_shower.ico"
+1400 ICON "activities/having_appointment.ico"
+1420 ICON "activities/inactive.ico"
+1421 ICON "activities/day_off.ico"
+1422 ICON "activities/hanging_out.ico"
+1423 ICON "activities/hiding.ico"
+1424 ICON "activities/on_vacation.ico"
+1425 ICON "activities/praying.ico"
+1426 ICON "activities/scheduled_holiday.ico"
+1427 ICON "activities/sleeping.ico"
+1428 ICON "activities/thinking.ico"
+1440 ICON "activities/relaxing.ico"
+1441 ICON "activities/fishing.ico"
+1442 ICON "activities/gaming.ico"
+1443 ICON "activities/going_out.ico"
+1444 ICON "activities/partying.ico"
+1445 ICON "activities/reading.ico"
+1446 ICON "activities/rehearsing.ico"
+1447 ICON "activities/shopping.ico"
+1448 ICON "activities/smoking.ico"
+1449 ICON "activities/socializing.ico"
+1450 ICON "activities/sunbathing.ico"
+1451 ICON "activities/watching_tv.ico"
+1452 ICON "activities/watching_a_movie.ico"
+1460 ICON "activities/talking.ico"
+1461 ICON "activities/in_real_life.ico"
+1462 ICON "activities/on_the_phone.ico"
+1463 ICON "activities/on_video_phone.ico"
+1480 ICON "activities/traveling.ico"
+1481 ICON "activities/commuting.ico"
+1482 ICON "activities/cycling.ico"
+1483 ICON "activities/driving.ico"
+1484 ICON "activities/in_a_car.ico"
+1485 ICON "activities/on_a_bus.ico"
+1486 ICON "activities/on_a_plane.ico"
+1487 ICON "activities/on_a_train.ico"
+1488 ICON "activities/on_a_trip.ico"
+1489 ICON "activities/walking.ico"
+1500 ICON "activities/working.ico"
+1501 ICON "activities/coding.ico"
+1502 ICON "activities/in_a_meeting.ico"
+1503 ICON "activities/studying.ico"
+1504 ICON "activities/writing.ico"
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp index 66a0ac71ef..9502aee3ed 100644 --- a/protocols/JabberG/src/jabber_adhoc.cpp +++ b/protocols/JabberG/src/jabber_adhoc.cpp @@ -341,7 +341,7 @@ static INT_PTR CALLBACK JabberAdHoc_CommandDlgProc(HWND hwndDlg, UINT msg, WPARA dat->proto = pStartupParams->m_pProto;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- Window_SetIcon_IcoLib(hwndDlg, g_GetIconHandle(IDI_COMMAND));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_GROUP));
dat->proto->m_hwndCommandWindow = hwndDlg;
TranslateDialogDefault(hwndDlg);
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp index 87ac8971f8..a2c69a335a 100644 --- a/protocols/JabberG/src/jabber_bookmarks.cpp +++ b/protocols/JabberG/src/jabber_bookmarks.cpp @@ -186,7 +186,7 @@ public: {
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_BOOKMARKS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_BOOKMARKS));
m_btnAdd.Disable();
m_btnEdit.Disable();
@@ -195,7 +195,7 @@ 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, m_proto->LoadIconEx("group"));
+ ImageList_AddIcon_Icolib(hIml, g_plugin.getIcon(IDI_GROUP));
ImageList_AddIcon_Icolib(hIml, Skin_LoadIcon(SKINICON_EVENT_URL));
m_lvBookmarks.AddColumn(0, TranslateT("Bookmark Name"), m_proto->getWord("bookmarksWnd_cx0", 120));
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index 1a70cecb22..9b4dc70a54 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -689,7 +689,7 @@ public: m_newJids(1),
m_btnInvite(this, IDC_INVITE),
m_txtNewJid(this, IDC_NEWJID),
- m_btnAddJid(this, IDC_ADDJID, ppro->LoadIconEx("addroster"), "Add"),
+ m_btnAddJid(this, IDC_ADDJID, g_plugin.getIcon(IDI_ADDCONTACT), "Add"),
m_txtReason(this, IDC_REASON),
m_clc(this, IDC_CLIST)
{
@@ -713,7 +713,7 @@ public: CSuper::OnInitDialog();
SetDlgItemText(m_hwnd, IDC_HEADERBAR, CMStringW(FORMAT, TranslateT("Invite Users to\n%s"), m_room));
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_GROUP));
SetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE,
GetWindowLongPtr(m_clc.GetHwnd(), GWL_STYLE) | CLS_SHOWHIDDEN | CLS_HIDEOFFLINE | CLS_CHECKBOXES | CLS_HIDEEMPTYGROUPS | CLS_USEGROUPS | CLS_GREYALTERNATE | CLS_GROUPCHECKBOXES);
@@ -819,7 +819,7 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
dat = (TUserInfoData *)lParam;
- Window_SetIcon_IcoLib(hwndDlg, g_GetIconHandle(IDI_GROUP));
+ Window_SetIcon_IcoLib(hwndDlg, g_plugin.getIconHandle(IDI_GROUP));
{
LOGFONT lf;
GetObject((HFONT)SendDlgItemMessage(hwndDlg, IDC_TXT_NICK, WM_GETFONT, 0, 0), sizeof(lf), &lf);
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index 80510be24f..6c1de0b61a 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -298,14 +298,14 @@ struct {
int type;
wchar_t *title;
- char *icon;
+ int icon;
}
static filter_modes[] =
{
- { TFilterInfo::T_JID, L"JID", "main" },
- { TFilterInfo::T_XMLNS, L"xmlns", "xmlconsole" },
- { TFilterInfo::T_ANY, L"all attributes", "sd_filter_apply" },
- { TFilterInfo::T_OFF, L"disabled", "sd_filter_reset" },
+ { TFilterInfo::T_JID, L"JID", IDI_JABBER },
+ { TFilterInfo::T_XMLNS, L"xmlns", IDI_CONSOLE },
+ { TFilterInfo::T_ANY, L"all attributes", IDI_FILTER_APPLY },
+ { TFilterInfo::T_OFF, L"disabled", IDI_FILTER_RESET },
};
class CJabberDlgConsole : public CJabberDlgBase
@@ -321,7 +321,7 @@ public: {
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_CONSOLE));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_CONSOLE));
SendDlgItemMessage(m_hwnd, IDC_CONSOLE, EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
SendDlgItemMessage(m_hwnd, IDC_CONSOLE, EM_EXLIMITTEXT, 0, 0x80000000);
@@ -342,21 +342,21 @@ public: {
int idc;
char *title;
- char *icon;
+ int icon;
bool push;
BOOL pushed;
}
static buttons[] =
{
- { IDC_BTN_MSG, "Messages", "pl_msg_allow", true, m_proto->m_filterInfo.msg},
- { IDC_BTN_PRESENCE, "Presences", "pl_prin_allow", true, m_proto->m_filterInfo.presence},
- { IDC_BTN_IQ, "Queries", "pl_iq_allow", true, m_proto->m_filterInfo.iq},
- { IDC_BTN_FILTER, "Filter mode", "sd_filter_apply", true, FALSE},
- { IDC_BTN_FILTER_REFRESH, "Refresh list", "sd_nav_refresh", false, FALSE},
+ { IDC_BTN_MSG, "Messages", IDI_PL_MSG_ALLOW, true, m_proto->m_filterInfo.msg },
+ { IDC_BTN_PRESENCE, "Presences", IDI_PL_PRIN_ALLOW, true, m_proto->m_filterInfo.presence },
+ { IDC_BTN_IQ, "Queries", IDI_PL_QUERY_ALLOW, true, m_proto->m_filterInfo.iq },
+ { IDC_BTN_FILTER, "Filter mode", IDI_FILTER_APPLY, true, false },
+ { IDC_BTN_FILTER_REFRESH, "Refresh list", IDI_NAV_REFRESH, false, false },
};
for (auto &it : buttons) {
- SendDlgItemMessage(m_hwnd, it.idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon));
+ SendDlgItemMessage(m_hwnd, it.idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon));
SendDlgItemMessage(m_hwnd, it.idc, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(m_hwnd, it.idc, BUTTONADDTOOLTIP, (WPARAM)it.title, 0);
if (it.push)
@@ -367,8 +367,8 @@ public: for (auto &it : filter_modes)
if (it.type == m_proto->m_filterInfo.type) {
- IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon)));
- SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon)));
+ SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon));
break;
}
@@ -527,7 +527,7 @@ public: m_proto->m_filterInfo.type = (TFilterInfo::Type)(res - 1);
for (auto &it : filter_modes) {
if (it.type == m_proto->m_filterInfo.type) {
- IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon)));
+ IcoLib_ReleaseIcon((HICON)SendDlgItemMessage(m_hwnd, IDC_BTN_FILTER, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon)));
break;
}
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index 30d9ea5519..8abcf1bfcc 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -51,57 +51,51 @@ static DWORD sttLastAutoDisco = 0; enum { SD_OVERLAY_NONE, SD_OVERLAY_FAIL, SD_OVERLAY_PROGRESS, SD_OVERLAY_REGISTERED };
-static struct
+struct
{
char *feature;
char *category;
char *type;
- char *iconName;
+ int iconRes;
int iconIndex;
int listIndex;
-} sttNodeIcons[] =
+}
+static sttNodeIcons[] =
{
// standard identities: http://www.xmpp.org/registrar/disco-categories.html#directory
- {nullptr, "account", nullptr, nullptr, SKINICON_STATUS_ONLINE},
- {nullptr, "auth", nullptr, "key", 0},
- {nullptr, "automation", nullptr, "adhoc", 0},
- {nullptr, "client", nullptr, nullptr, SKINICON_STATUS_ONLINE},
- {nullptr, "collaboration", nullptr, "group", 0},
- {nullptr, "conference", nullptr, "group", 0},
-
- {nullptr, "directory", "chatroom", "group", 0},
- {nullptr, "directory", "group", "group", 0},
- {nullptr, "directory", "user", nullptr, SKINICON_OTHER_FINDUSER},
- {nullptr, "directory", nullptr, nullptr, SKINICON_OTHER_SEARCHALL},
-
- {nullptr, "gateway", "aim", "AIM", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "gadu-gadu", "GG", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "icq", "ICQ", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "msn", "MSN", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "qq", "QQ", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "tlen", "TLEN", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", "yahoo", "YAHOO", SKINICON_STATUS_ONLINE},
- {nullptr, "gateway", nullptr, "Agents", 0},
-
- {nullptr, "headline", "rss", "node_rss", 0},
- {nullptr, "headline", "weather", "node_weather", 0},
-
- {nullptr, "proxy", nullptr, nullptr, SKINICON_EVENT_FILE},
-
- {nullptr, "server", nullptr, "node_server", 0},
-
- {nullptr, "store", nullptr, "node_store", 0},
-
- // icons for non-standard identities
- {nullptr, "x-service", "x-rss", "node_rss", 0},
- {nullptr, "application", "x-weather", "node_weather", 0},
- {nullptr, "user", nullptr, nullptr, SKINICON_STATUS_ONLINE},
-
- // icon suggestions based on supported features
- {"jabber:iq:gateway", nullptr, nullptr, "Agents", 0},
- {"jabber:iq:search", nullptr, nullptr, nullptr, SKINICON_OTHER_FINDUSER},
- {JABBER_FEAT_COMMANDS, nullptr, nullptr, "adhoc", 0},
- {JABBER_FEAT_REGISTER, nullptr, nullptr, "key", 0},
+ {nullptr, "account", nullptr, 0, SKINICON_STATUS_ONLINE},
+ {nullptr, "auth", nullptr, IDI_KEYS, 0},
+ {nullptr, "automation", nullptr, IDI_COMMAND, 0},
+ {nullptr, "client", nullptr, 0, SKINICON_STATUS_ONLINE},
+ {nullptr, "collaboration", nullptr, IDI_GROUP, 0},
+ {nullptr, "conference", nullptr, IDI_GROUP, 0},
+
+ {nullptr, "directory", "chatroom", IDI_GROUP, 0},
+ {nullptr, "directory", "group", IDI_GROUP, 0},
+ {nullptr, "directory", "user", 0, SKINICON_OTHER_FINDUSER},
+ {nullptr, "directory", nullptr, 0, SKINICON_OTHER_SEARCHALL},
+
+ {nullptr, "gateway", nullptr, IDI_AGENTS, 0},
+
+ {nullptr, "headline", "rss", IDI_NODE_RSS, 0},
+ {nullptr, "headline", "weather", IDI_NODE_WEATHER, 0},
+
+ {nullptr, "proxy", nullptr, 0, SKINICON_EVENT_FILE},
+
+ {nullptr, "server", nullptr, IDI_NODE_SERVER, 0},
+
+ {nullptr, "store", nullptr, IDI_NODE_STORE, 0},
+
+ // icons for non-standard identities
+ {nullptr, "x-service", "x-rss", IDI_NODE_RSS, 0},
+ {nullptr, "application", "x-weather", IDI_NODE_WEATHER, 0},
+ {nullptr, "user", nullptr, 0, SKINICON_STATUS_ONLINE},
+
+ // icon suggestions based on supported features
+ {"jabber:iq:gateway", nullptr, nullptr, IDI_AGENTS, 0},
+ {"jabber:iq:search", nullptr, nullptr, 0, SKINICON_OTHER_FINDUSER},
+ {JABBER_FEAT_COMMANDS, nullptr, nullptr, IDI_COMMAND, 0},
+ {JABBER_FEAT_REGISTER, nullptr, nullptr, IDI_KEYS, 0},
};
void CJabberProto::OnIqResultServiceDiscoveryInfo(const TiXmlElement *iqNode, CJabberIqInfo *pInfo)
@@ -423,7 +417,7 @@ void CJabberProto::ApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode) }
for (auto &it : sttNodeIcons) {
- if (!it.iconIndex && !it.iconName)
+ if (!it.iconIndex && !it.iconRes)
continue;
if (it.category) {
@@ -506,12 +500,12 @@ public: CJabberDlgDiscovery(CJabberProto *proto, char *jid) :
CJabberDlgBase(proto, IDD_SERVICE_DISCOVERY),
m_jid(jid),
- m_btnViewAsTree(this, IDC_BTN_VIEWTREE, proto->LoadIconEx("sd_view_tree"), "View as tree"),
- m_btnViewAsList(this, IDC_BTN_VIEWLIST, proto->LoadIconEx("sd_view_list"), "View as list"),
- m_btnGoHome(this, IDC_BTN_NAVHOME, proto->LoadIconEx("sd_nav_home"), "Navigate home"),
- m_btnBookmarks(this, IDC_BTN_FAVORITE, proto->LoadIconEx("bookmarks"), "Favorites"),
- m_btnRefresh(this, IDC_BTN_REFRESH, proto->LoadIconEx("sd_nav_refresh"), "Refresh node"),
- m_btnBrowse(this, IDC_BUTTON_BROWSE, proto->LoadIconEx("sd_browse"), "Browse"),
+ m_btnViewAsTree(this, IDC_BTN_VIEWTREE, g_plugin.getIcon(IDI_VIEW_TREE), "View as tree"),
+ m_btnViewAsList(this, IDC_BTN_VIEWLIST, g_plugin.getIcon(IDI_VIEW_LIST), "View as list"),
+ m_btnGoHome(this, IDC_BTN_NAVHOME, g_plugin.getIcon(IDI_NAV_HOME), "Navigate home"),
+ m_btnBookmarks(this, IDC_BTN_FAVORITE, g_plugin.getIcon(IDI_BOOKMARKS), "Favorites"),
+ m_btnRefresh(this, IDC_BTN_REFRESH, g_plugin.getIcon(IDI_NAV_REFRESH), "Refresh node"),
+ m_btnBrowse(this, IDC_BUTTON_BROWSE, g_plugin.getIcon(IDI_BROWSE), "Browse"),
m_lstDiscoTree(this, IDC_TREE_DISCO),
m_filter(this, IDC_FILTER)
{
@@ -529,7 +523,7 @@ public: {
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_SERVICE_DISCOVERY));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_SERVICE_DISCOVERY));
if (m_jid) {
SetDlgItemTextUtf(m_hwnd, IDC_COMBO_JID, m_jid);
@@ -572,25 +566,19 @@ public: ListView_InsertColumn(hwndList, 2, &lvc);
TreeList_Create(hwndList);
- TreeList_AddIcon(hwndList, m_proto->LoadIconEx("main"), 0);
+ TreeList_AddIcon(hwndList, g_plugin.getIcon(IDI_JABBER), 0);
for (auto &it : sttNodeIcons) {
- bool needDestroy = false;
HICON hIcon;
- if ((it.iconIndex == SKINICON_STATUS_ONLINE) && it.iconName) {
- hIcon = (HICON)CallProtoService(it.iconName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
- needDestroy = true;
- }
- else if (it.iconName)
- hIcon = m_proto->LoadIconEx(it.iconName);
+ if (it.iconRes)
+ hIcon = g_plugin.getIcon(it.iconRes);
else if (it.iconIndex)
hIcon = Skin_LoadIcon(it.iconIndex);
else continue;
it.listIndex = TreeList_AddIcon(hwndList, hIcon, 0);
- if (needDestroy) DestroyIcon(hIcon);
}
- TreeList_AddIcon(hwndList, m_proto->LoadIconEx("disco_fail"), SD_OVERLAY_FAIL);
- TreeList_AddIcon(hwndList, m_proto->LoadIconEx("disco_progress"), SD_OVERLAY_PROGRESS);
- TreeList_AddIcon(hwndList, m_proto->LoadIconEx("disco_ok"), SD_OVERLAY_REGISTERED);
+ TreeList_AddIcon(hwndList, g_plugin.getIcon(IDI_DISCO_FAIL), SD_OVERLAY_FAIL);
+ TreeList_AddIcon(hwndList, g_plugin.getIcon(IDI_DISCO_PROGRESS), SD_OVERLAY_PROGRESS);
+ TreeList_AddIcon(hwndList, g_plugin.getIcon(IDI_DISCO_OK), SD_OVERLAY_REGISTERED);
TreeList_SetMode(hwndList, m_proto->getByte("discoWnd_useTree", 1) ? TLM_TREE : TLM_REPORT);
diff --git a/protocols/JabberG/src/jabber_frame.cpp b/protocols/JabberG/src/jabber_frame.cpp index 4ce01e3396..fcc0d2eed1 100644 --- a/protocols/JabberG/src/jabber_frame.cpp +++ b/protocols/JabberG/src/jabber_frame.cpp @@ -102,7 +102,7 @@ CJabberInfoFrame::CJabberInfoFrame(CJabberProto *proto) : SetWindowPos(m_hwndToolTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
CreateInfoItem("$", true);
- UpdateInfoItem("$", proto->GetIconHandle(IDI_JABBER), proto->m_tszUserName);
+ UpdateInfoItem("$", proto->m_hProtoIcon, proto->m_tszUserName);
CreateInfoItem("$/JID", true);
UpdateInfoItem("$/JID", Skin_GetIconHandle(SKINICON_OTHER_USERDETAILS), L"Offline");
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 3fba354194..cf2205a912 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -403,7 +403,7 @@ public: {
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_GROUP));
JabberGcRecentInfo *pInfo = nullptr;
if (m_jid)
@@ -443,7 +443,7 @@ public: lf.lfWeight = FW_BOLD;
SendDlgItemMessage(m_hwnd, IDC_TXT_RECENT, WM_SETFONT, (WPARAM)CreateFontIndirect(&lf), TRUE);
- SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx("bookmarks"));
+ SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_BOOKMARKS));
SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONADDTOOLTIP, (WPARAM)"Bookmarks", 0);
SendDlgItemMessage(m_hwnd, IDC_BOOKMARKS, BUTTONSETASPUSHBTN, TRUE, 0);
@@ -561,16 +561,16 @@ public: SetTextColor(lpdis->hDC, clLine2);
DrawText(lpdis->hDC, info->line2, -1, &rc, DT_LEFT | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER | DT_WORD_ELLIPSIS);
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("group"), 16, 16, 0, nullptr, DI_NORMAL);
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, g_plugin.getIcon(IDI_GROUP), 16, 16, 0, nullptr, DI_NORMAL);
switch (info->overlay) {
case RoomInfo::ROOM_WAIT:
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("disco_progress"), 16, 16, 0, nullptr, DI_NORMAL);
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, g_plugin.getIcon(IDI_DISCO_PROGRESS), 16, 16, 0, nullptr, DI_NORMAL);
break;
case RoomInfo::ROOM_FAIL:
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("disco_fail"), 16, 16, 0, nullptr, DI_NORMAL);
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, g_plugin.getIcon(IDI_DISCO_FAIL), 16, 16, 0, nullptr, DI_NORMAL);
break;
case RoomInfo::ROOM_BOOKMARK:
- DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, m_proto->LoadIconEx("disco_ok"), 16, 16, 0, nullptr, DI_NORMAL);
+ DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 1, lpdis->rcItem.top + 1, g_plugin.getIcon(IDI_DISCO_OK), 16, 16, 0, nullptr, DI_NORMAL);
break;
}
}
@@ -1145,7 +1145,7 @@ public: SetDlgItemTextUtf(m_hwnd, IDC_REASON, m_reason);
SetDlgItemTextUtf(m_hwnd, IDC_NICK, JabberNickFromJID(m_proto->m_szJabberJID));
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_GROUP));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_GROUP));
SetFocus(GetDlgItem(m_hwnd, IDC_NICK));
return true;
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index ec8fdfedc8..ed7ce4a046 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -172,25 +172,6 @@ void CJabberProto::IconsInit(void) m_transportProtoTableStartIndex[i] = -1;
}
-HANDLE CJabberProto::GetIconHandle(int iconId)
-{
- if (iconId == IDI_JABBER)
- return m_hProtoIcon;
-
- return g_GetIconHandle(iconId);
-}
-
-HICON CJabberProto::LoadIconEx(const char* name, bool big)
-{
- if (HICON result = g_LoadIconEx(name, big))
- return result;
-
- if (!mir_strcmp(name, "main"))
- return IcoLib_GetIconByHandle(m_hProtoIcon, big);
-
- return nullptr;
-}
-
/////////////////////////////////////////////////////////////////////////////////////////
// internal functions
@@ -456,7 +437,7 @@ void CJabberProto::CheckAllContactsAreTransported() static IconItem sharedIconList1[] =
{
- { LPGEN("Jabber"), "jabber", IDI_JABBER },
+ { LPGEN("Jabber"), "jabber", IDI_JABBER },
{ LPGEN("Privacy Lists"), "privacylists", IDI_PRIVACY_LISTS },
{ LPGEN("Bookmarks"), "bookmarks", IDI_BOOKMARKS },
{ LPGEN("Notes"), "notes", IDI_NOTES },
@@ -528,34 +509,6 @@ void g_IconsInit() g_plugin.registerIcon(LPGEN("Protocols") "/" LPGEN("Jabber") "/" LPGEN("Dialogs") "/" LPGEN("Privacy"), sharedIconList4, GLOBAL_SETTING_PREFIX);
}
-HANDLE g_GetIconHandle(int iconId)
-{
- for (auto &it : sharedIconList1)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- for (auto &it : sharedIconList2)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- for (auto &it : sharedIconList3)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- for (auto &it : sharedIconList4)
- if (it.defIconID == iconId)
- return it.hIcolib;
-
- return nullptr;
-}
-
-HICON g_LoadIconEx(const char* name, bool big)
-{
- char szSettingName[100];
- mir_snprintf(szSettingName, "%s_%s", GLOBAL_SETTING_PREFIX, name);
- return IcoLib_GetIcon(szSettingName, big);
-}
-
void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon)
{
ImageList_AddIcon(hIml, hIcon);
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp index 8686e1f314..bed8949e14 100644 --- a/protocols/JabberG/src/jabber_iq_handlers.cpp +++ b/protocols/JabberG/src/jabber_iq_handlers.cpp @@ -431,7 +431,7 @@ BOOL CJabberProto::AddClistHttpAuthEvent(CJabberHttpAuthParams *pParams) mir_snprintf(szService, "%s%s", m_szModuleName, JS_HTTP_AUTH);
CLISTEVENT cle = {};
- cle.hIcon = (HICON)LoadIconEx("openid");
+ cle.hIcon = g_plugin.getIcon(IDI_HTTP_AUTH);
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_UNICODE;
cle.hDbEvent = -99;
cle.lParam = (LPARAM)pParams;
diff --git a/protocols/JabberG/src/jabber_iqid_muc.cpp b/protocols/JabberG/src/jabber_iqid_muc.cpp index 6cc9421c32..a7e93e78a9 100644 --- a/protocols/JabberG/src/jabber_iqid_muc.cpp +++ b/protocols/JabberG/src/jabber_iqid_muc.cpp @@ -59,13 +59,13 @@ struct {
int idc;
char *title;
- char *icon;
+ int icon;
bool push;
}
static buttons[] =
{
- { IDC_BTN_FILTERAPPLY, "Apply filter", "sd_filter_apply", false },
- { IDC_BTN_FILTERRESET, "Reset filter", "sd_filter_reset", false },
+ { IDC_BTN_FILTERAPPLY, "Apply filter", IDI_FILTER_APPLY, false },
+ { IDC_BTN_FILTERRESET, "Reset filter", IDI_FILTER_RESET, false },
};
class CJabberMucJidListDlg : public CJabberDlgBase
@@ -180,8 +180,8 @@ public: bool OnInitDialog() override
{
HIMAGELIST hImageList = ImageList_Create(16, 16, ILC_COLOR32 | ILC_MASK, 2, 0);
- ImageList_AddIcon(hImageList, g_LoadIconEx("delete"));
- ImageList_AddIcon(hImageList, g_LoadIconEx("addcontact"));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_DELETE));
+ ImageList_AddIcon(hImageList, g_plugin.getIcon(IDI_ADDCONTACT));
m_list.SetImageList(hImageList, LVSIL_SMALL);
m_list.SetExtendedListViewStyle(LVS_EX_FULLROWSELECT | LVS_EX_SUBITEMIMAGES | LVS_EX_GRIDLINES);
@@ -197,7 +197,7 @@ public: Refresh(m_info);
for (auto &it : buttons) {
- SendDlgItemMessage(m_hwnd, it.idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)m_proto->LoadIconEx(it.icon));
+ SendDlgItemMessage(m_hwnd, it.idc, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(it.icon));
SendDlgItemMessage(m_hwnd, it.idc, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(m_hwnd, it.idc, BUTTONADDTOOLTIP, (WPARAM)it.title, 0);
if (it.push)
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index f1cbdcbae9..d0ec3b9dae 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -170,7 +170,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/ConvertChatContact";
mi.name.a = LPGEN("Convert");
mi.position = -1999901004;
- mi.hIcolibItem = g_GetIconHandle(IDI_USER2ROOM);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_USER2ROOM);
g_hMenuConvert = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuConvertChatContact);
@@ -188,7 +188,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/AddToBookmarks";
mi.name.a = LPGEN("Add to Bookmarks");
mi.position = -1999901006;
- mi.hIcolibItem = g_GetIconHandle(IDI_BOOKMARKS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BOOKMARKS);
g_hMenuAddBookmark = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuBookmarkAdd);
@@ -197,7 +197,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/TransportLogin";
mi.name.a = LPGEN("Login/logout");
mi.position = -1999901007;
- mi.hIcolibItem = g_GetIconHandle(IDI_LOGIN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_LOGIN);
g_hMenuLogin = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuTransportLogin);
@@ -206,7 +206,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/TransportGetNicks";
mi.name.a = LPGEN("Resolve nicks");
mi.position = -1999901008;
- mi.hIcolibItem = g_GetIconHandle(IDI_REFRESH);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_REFRESH);
g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuTransportResolve);
@@ -215,7 +215,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/RunCommands";
mi.name.a = LPGEN("Commands");
mi.position = -1999901009;
- mi.hIcolibItem = g_GetIconHandle(IDI_COMMAND);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_COMMAND);
g_hMenuCommands = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberContactMenuRunCommands);
@@ -224,7 +224,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/SendNote";
mi.name.a = LPGEN("Send Note");
mi.position = -1999901010;
- mi.hIcolibItem = g_GetIconHandle(IDI_SEND_NOTE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SEND_NOTE);
g_hMenuSendNote = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, JabberMenuSendNote);
@@ -235,7 +235,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/DirectPresenceDummySvc";
mi.name.a = LPGEN("Send Presence");
mi.position = -1999901011;
- mi.hIcolibItem = g_GetIconHandle(IDI_NOTES);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTES);
g_hMenuDirectPresence[0] = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
@@ -261,7 +261,7 @@ void g_MenuInit(void) mi.pszService = "Jabber/ResourceSelectorDummySvc";
mi.name.a = LPGEN("Jabber Resource");
mi.position = -1999901011;
- mi.hIcolibItem = g_GetIconHandle(IDI_JABBER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_JABBER);
g_hMenuResourcesRoot = Menu_AddContactMenuItem(&mi);
UNSET_UID(mi);
@@ -270,14 +270,14 @@ void g_MenuInit(void) mi.pszService = "Jabber/UseResource_last";
mi.name.a = LPGEN("Last Active");
mi.position = -1999901000;
- mi.hIcolibItem = g_GetIconHandle(IDI_JABBER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_JABBER);
g_hMenuResourcesActive = Menu_AddContactMenuItem(&mi);
CreateServiceFunctionParam(mi.pszService, JabberMenuHandleResource, MENUITEM_LASTSEEN);
mi.pszService = "Jabber/UseResource_server";
mi.name.a = LPGEN("Server's Choice");
mi.position = -1999901000;
- mi.hIcolibItem = g_GetIconHandle(IDI_NODE_SERVER);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NODE_SERVER);
g_hMenuResourcesServer = Menu_AddContactMenuItem(&mi);
CreateServiceFunctionParam(mi.pszService, JabberMenuHandleResource, MENUITEM_SERVER);
}
@@ -541,14 +541,14 @@ void CJabberProto::OnBuildProtoMenu() CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleBookmarks);
mi.name.a = LPGEN("Bookmarks");
mi.position = 200001;
- mi.hIcolibItem = GetIconHandle(IDI_BOOKMARKS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_BOOKMARKS);
m_hMenuBookmarks = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "Services..."
mi.pszService = nullptr;
mi.name.a = LPGEN("Services...");
mi.position = 200003;
- mi.hIcolibItem = GetIconHandle(IDI_SERVICE_DISCOVERY);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SERVICE_DISCOVERY);
HGENMENU hMenuServicesRoot = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "Service Discovery..."
@@ -557,35 +557,35 @@ void CJabberProto::OnBuildProtoMenu() CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleServiceDiscovery);
mi.name.a = LPGEN("Service Discovery");
mi.position = 2000050001;
- mi.hIcolibItem = GetIconHandle(IDI_SERVICE_DISCOVERY);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_SERVICE_DISCOVERY);
m_hMenuServiceDiscovery = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/SD/MyTransports";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleServiceDiscoveryMyTransports);
mi.name.a = LPGEN("Registered Transports");
mi.position = 2000050003;
- mi.hIcolibItem = GetIconHandle(IDI_TRANSPORTL);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_TRANSPORTL);
m_hMenuSDMyTransports = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/SD/Transports";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleServiceDiscoveryTransports);
mi.name.a = LPGEN("Local Server Transports");
mi.position = 2000050004;
- mi.hIcolibItem = GetIconHandle(IDI_TRANSPORT);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_TRANSPORT);
m_hMenuSDTransports = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/SD/Conferences";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleServiceDiscoveryConferences);
mi.name.a = LPGEN("Browse chatrooms");
mi.position = 2000050005;
- mi.hIcolibItem = GetIconHandle(IDI_GROUP);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_GROUP);
m_hMenuSDConferences = Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/Groupchat";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleJoinGroupchat);
mi.name.a = LPGEN("Create/Join group chat");
mi.position = 2000050006;
- mi.hIcolibItem = GetIconHandle(IDI_GROUP);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_GROUP);
m_hMenuGroupchat = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "Change Password..."
@@ -593,7 +593,7 @@ void CJabberProto::OnBuildProtoMenu() CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleChangePassword);
mi.name.a = LPGEN("Change Password");
mi.position = 2000050007;
- mi.hIcolibItem = GetIconHandle(IDI_KEYS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_KEYS);
m_hMenuChangePassword = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "Roster editor"
@@ -601,7 +601,7 @@ void CJabberProto::OnBuildProtoMenu() CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleRosterControl);
mi.name.a = LPGEN("Roster editor");
mi.position = 2000050009;
- mi.hIcolibItem = GetIconHandle(IDI_AGENTS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_AGENTS);
m_hMenuRosterControl = Menu_AddProtoMenuItem(&mi, m_szModuleName);
// "XML Console"
@@ -609,14 +609,14 @@ void CJabberProto::OnBuildProtoMenu() CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleConsole);
mi.name.a = LPGEN("XML Console");
mi.position = 2000050010;
- mi.hIcolibItem = GetIconHandle(IDI_CONSOLE);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_CONSOLE);
Menu_AddProtoMenuItem(&mi, m_szModuleName);
mi.pszService = "/Notes";
CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandleNotes);
mi.name.a = LPGEN("Notes");
mi.position = 2000050011;
- mi.hIcolibItem = GetIconHandle(IDI_NOTES);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_NOTES);
m_hMenuNotes = Menu_AddProtoMenuItem(&mi, m_szModuleName);
BuildPrivacyMenu();
@@ -694,11 +694,11 @@ void CJabberProto::BuildPriorityMenu() mir_snprintf(srvFce, "/menuSetPriority/%d", steps[i]);
if (steps[i] > 0) {
mir_snwprintf(szName, TranslateT("Increase priority by %d"), steps[i]);
- mi.hIcolibItem = GetIconHandle(IDI_ARROW_UP);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ARROW_UP);
}
else {
mir_snwprintf(szName, TranslateT("Decrease priority by %d"), -steps[i]);
- mi.hIcolibItem = GetIconHandle(IDI_ARROW_DOWN);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_ARROW_DOWN);
}
if (needServices)
@@ -799,19 +799,19 @@ int g_OnToolbarInit(WPARAM, LPARAM) CreateServiceFunction("JABBER/*/Groupchat", g_ToolbarHandleJoinGroupchat);
ttb.pszService = "JABBER/*/Groupchat";
ttb.pszTooltipUp = ttb.name = LPGEN("Join conference");
- ttb.hIconHandleUp = g_GetIconHandle(IDI_GROUP);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_GROUP);
g_plugin.addTTB(&ttb);
CreateServiceFunction("JABBER/*/Bookmarks", g_ToolbarHandleBookmarks);
ttb.pszService = "JABBER/*/Bookmarks";
ttb.pszTooltipUp = ttb.name = LPGEN("Open bookmarks");
- ttb.hIconHandleUp = g_GetIconHandle(IDI_BOOKMARKS);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_BOOKMARKS);
g_plugin.addTTB(&ttb);
CreateServiceFunction("JABBER/*/ServiceDiscovery", g_ToolbarHandleServiceDiscovery);
ttb.pszService = "JABBER/*/ServiceDiscovery";
ttb.pszTooltipUp = ttb.name = LPGEN("Service discovery");
- ttb.hIconHandleUp = g_GetIconHandle(IDI_SERVICE_DISCOVERY);
+ ttb.hIconHandleUp = g_plugin.getIconHandle(IDI_SERVICE_DISCOVERY);
g_plugin.addTTB(&ttb);
return 0;
}
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index 7f6ccc3d53..434394c7da 100755 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -412,7 +412,7 @@ void CJabberProto::InitPopups(void) mir_snprintf(name, "%s_%s", m_szModuleName, "Error");
mir_snwprintf(desc, L"%s/%s", m_tszUserName, TranslateT("Errors"));
- ppc.hIcon = LoadIconEx("main");
+ ppc.hIcon = IcoLib_GetIconByHandle(m_hProtoIcon);
ppc.colorBack = RGB(191, 0, 0); //Red
ppc.colorText = RGB(255, 245, 225); //Yellow
ppc.iSeconds = 60;
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp index 0956b06bfc..11e1f98a54 100644 --- a/protocols/JabberG/src/jabber_notes.cpp +++ b/protocols/JabberG/src/jabber_notes.cpp @@ -178,7 +178,7 @@ public: bool OnInitDialog() override
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_NOTES));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_NOTES));
if (m_fnProcess) {
CMStringW buf;
@@ -507,7 +507,7 @@ public: bool OnInitDialog() override
{
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_NOTES));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_NOTES));
LOGFONT lf, lfTmp;
m_hfntNormal = (HFONT)GetStockObject(DEFAULT_GUI_FONT);
@@ -723,7 +723,7 @@ bool CJabberProto::OnIncomingNote(const char *szFrom, const TiXmlElement *hXml) mir_snprintf(szService, "%s%s", m_szModuleName, JS_INCOMING_NOTE_EVENT);
CLISTEVENT cle = {};
- cle.hIcon = (HICON)LoadIconEx("notes");
+ cle.hIcon = g_plugin.getIcon(IDI_NOTES);
cle.flags = CLEF_PROTOCOLGLOBAL | CLEF_UNICODE;
cle.hDbEvent = -99;
cle.lParam = (LPARAM)pItem;
diff --git a/protocols/JabberG/src/jabber_password.cpp b/protocols/JabberG/src/jabber_password.cpp index 4ad8974619..b80679f565 100644 --- a/protocols/JabberG/src/jabber_password.cpp +++ b/protocols/JabberG/src/jabber_password.cpp @@ -41,7 +41,7 @@ public: bool OnInitDialog() override
{
m_proto->m_hwndJabberChangePassword = m_hwnd;
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_KEYS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_KEYS));
if (m_proto->m_bJabberOnline && m_proto->m_ThreadInfo != nullptr) {
char text[1024];
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 5cc56e0e84..4c7f27714c 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -357,10 +357,10 @@ public: m_proto->m_hwndPrivacyRule = m_hwnd;
- SendDlgItemMessage(m_hwnd, IDC_ICO_MESSAGE, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_msg_allow"), 0);
- SendDlgItemMessage(m_hwnd, IDC_ICO_QUERY, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_iq_allow"), 0);
- SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEIN, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_prin_allow"), 0);
- SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEOUT, STM_SETICON, (WPARAM)m_proto->LoadIconEx("pl_prout_allow"), 0);
+ SendDlgItemMessage(m_hwnd, IDC_ICO_MESSAGE, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_PL_MSG_ALLOW), 0);
+ SendDlgItemMessage(m_hwnd, IDC_ICO_QUERY, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_PL_QUERY_ALLOW), 0);
+ SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEIN, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_PL_PRIN_ALLOW), 0);
+ SendDlgItemMessage(m_hwnd, IDC_ICO_PRESENCEOUT, STM_SETICON, (WPARAM)g_plugin.getIcon(IDI_PL_PROUT_ALLOW), 0);
wchar_t *szTypes[] = { L"JID", L"Group", L"Subscription", L"Any" };
int i, nTypes[] = { Jid, Group, Subscription, Else };
@@ -832,11 +832,11 @@ class CJabberDlgPrivacyLists : public CJabberDlgBase }
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 4, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- m_proto->LoadIconEx("main"), 16, 16, 0, nullptr, DI_NORMAL);
+ IcoLib_GetIconByHandle(m_proto->m_hProtoIcon), 16, 16, 0, nullptr, DI_NORMAL);
if (pRule)
DrawIconEx(lpdis->hDC, lpdis->rcItem.left + 4, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- m_proto->LoadIconEx(pRule->GetAction() ? "disco_ok" : "disco_fail"),
+ g_plugin.getIcon(pRule->GetAction() ? IDI_DISCO_OK : IDI_DISCO_FAIL),
16, 16, 0, nullptr, DI_NORMAL);
if (lpdis->itemState & ODS_FOCUS) {
@@ -915,12 +915,12 @@ class CJabberDlgPrivacyLists : public CJabberDlgBase DrawNextRulePart(lpdis->hDC, clLine2, TranslateT(" (default)"), &rc);
DrawIconEx(lpdis->hDC, lpdis->rcItem.right - 16 - 4, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- m_proto->LoadIconEx(bActive ? "pl_list_active" : "pl_list_any"),
+ g_plugin.getIcon(bActive ? IDI_PL_LIST_ACTIVE : IDI_PL_LIST_ANY),
16, 16, 0, nullptr, DI_NORMAL);
if (bDefault)
DrawIconEx(lpdis->hDC, lpdis->rcItem.right - 16 - 4, (lpdis->rcItem.top + lpdis->rcItem.bottom - 16) / 2,
- m_proto->LoadIconEx("disco_ok"),
+ g_plugin.getIcon(IDI_DISCO_OK),
16, 16, 0, nullptr, DI_NORMAL);
if (hfnt)
@@ -1271,16 +1271,16 @@ lbl_return: public:
CJabberDlgPrivacyLists(CJabberProto *proto) :
CSuper(proto, IDD_PRIVACY_LISTS),
- m_btnSimple(this, IDC_BTN_SIMPLE, proto->LoadIconEx("group"), LPGEN("Simple mode")),
- m_btnAdvanced(this, IDC_BTN_ADVANCED, proto->LoadIconEx("sd_view_list"), LPGEN("Advanced mode")),
- m_btnAddJid(this, IDC_ADDJID, proto->LoadIconEx("addroster"), LPGEN("Add JID")),
- m_btnActivate(this, IDC_ACTIVATE, proto->LoadIconEx("pl_list_active"), LPGEN("Activate")),
- m_btnSetDefault(this, IDC_SET_DEFAULT, proto->LoadIconEx("pl_list_default"), LPGEN("Set default")),
+ m_btnSimple(this, IDC_BTN_SIMPLE, g_plugin.getIcon(IDI_GROUP), LPGEN("Simple mode")),
+ m_btnAdvanced(this, IDC_BTN_ADVANCED, g_plugin.getIcon(IDI_VIEW_LIST), LPGEN("Advanced mode")),
+ m_btnAddJid(this, IDC_ADDJID, g_plugin.getIcon(IDI_ADDCONTACT), LPGEN("Add JID")),
+ m_btnActivate(this, IDC_ACTIVATE, g_plugin.getIcon(IDI_PL_LIST_ACTIVE), LPGEN("Activate")),
+ m_btnSetDefault(this, IDC_SET_DEFAULT, g_plugin.getIcon(IDI_PL_LIST_DEFAULT), LPGEN("Set default")),
m_btnEditRule(this, IDC_EDIT_RULE, SKINICON_OTHER_RENAME, LPGEN("Edit rule")),
m_btnAddRule(this, IDC_ADD_RULE, SKINICON_OTHER_ADDCONTACT, LPGEN("Add rule")),
m_btnRemoveRule(this, IDC_REMOVE_RULE, SKINICON_OTHER_DELETE, LPGEN("Delete rule")),
- m_btnUpRule(this, IDC_UP_RULE, proto->LoadIconEx("arrow_up"), LPGEN("Move rule up")),
- m_btnDownRule(this, IDC_DOWN_RULE, proto->LoadIconEx("arrow_down"), LPGEN("Move rule down")),
+ m_btnUpRule(this, IDC_UP_RULE, g_plugin.getIcon(IDI_ARROW_UP), LPGEN("Move rule up")),
+ m_btnDownRule(this, IDC_DOWN_RULE, g_plugin.getIcon(IDI_ARROW_DOWN), LPGEN("Move rule down")),
m_btnAddList(this, IDC_ADD_LIST, SKINICON_OTHER_ADDCONTACT, LPGEN("Add list...")),
m_btnRemoveList(this, IDC_REMOVE_LIST, SKINICON_OTHER_DELETE, LPGEN("Remove list")),
m_btnApply(this, IDC_APPLY),
@@ -1318,7 +1318,7 @@ public: {
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_PRIVACY_LISTS));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_PRIVACY_LISTS));
EnableWindow(GetDlgItem(m_hwnd, IDC_ADD_RULE), FALSE);
EnableWindow(GetDlgItem(m_hwnd, IDC_EDIT_RULE), FALSE);
@@ -1341,14 +1341,14 @@ public: 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, m_proto->LoadIconEx("pl_msg_allow"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_msg_deny"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_prin_allow"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_prin_deny"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_prout_allow"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_prout_deny"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_iq_allow"));
- ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("pl_iq_deny"));
+ 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));
m_clcClist.SetExtraImageList(hIml);
m_clcClist.SetExtraColumns(4);
@@ -1530,15 +1530,15 @@ public: struct
{
wchar_t *textEng;
- char *icon;
+ int icon;
wchar_t *text;
}
static drawItems[] =
{
- { LPGENW("Message"), "pl_msg_allow" },
- { LPGENW("Presence (in)"), "pl_prin_allow" },
- { LPGENW("Presence (out)"), "pl_prout_allow" },
- { LPGENW("Query"), "pl_iq_allow" }
+ { LPGENW("Message"), IDI_PL_MSG_ALLOW },
+ { LPGENW("Presence (in)"), IDI_PL_PRIN_ALLOW },
+ { LPGENW("Presence (out)"), IDI_PL_PROUT_ALLOW },
+ { LPGENW("Query"), IDI_PL_QUERY_ALLOW }
};
LPDRAWITEMSTRUCT lpdis = (LPDRAWITEMSTRUCT)lParam;
@@ -1561,7 +1561,7 @@ public: rc.left = (rc.left + rc.right - totalWidth) / 2;
for (auto &it : drawItems) {
- DrawIconEx(lpdis->hDC, rc.left, (rc.top + rc.bottom - 16) / 2, m_proto->LoadIconEx(it.icon),
+ DrawIconEx(lpdis->hDC, rc.left, (rc.top + rc.bottom - 16) / 2, g_plugin.getIcon(it.icon),
16, 16, 0, nullptr, DI_NORMAL);
rc.left += 18;
DrawNextRulePart(lpdis->hDC, clText, it.text, &rc);
@@ -2024,7 +2024,7 @@ void CJabberProto::BuildPrivacyMenu() {
CMenuItem mi(&g_plugin);
mi.position = 200005;
- mi.hIcolibItem = GetIconHandle(IDI_AGENTS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_AGENTS);
mi.flags = CMIF_UNMOVABLE | CMIF_HIDDEN;
mi.name.a = LPGEN("Privacy Lists");
mi.root = m_hMenuRoot;
@@ -2034,7 +2034,7 @@ void CJabberProto::BuildPrivacyMenu() CreateProtoService(mi.pszService, &CJabberProto::OnMenuHandlePrivacyLists);
mi.position = 3000040000;
mi.flags = CMIF_UNMOVABLE | CMIF_UNICODE;
- mi.hIcolibItem = GetIconHandle(IDI_PRIVACY_LISTS);
+ mi.hIcolibItem = g_plugin.getIconHandle(IDI_PRIVACY_LISTS);
mi.name.w = LPGENW("List Editor...");
mi.root = m_hPrivacyMenuRoot;
Menu_AddProtoMenuItem(&mi, m_szModuleName);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 005311104f..7b3a62b12a 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -281,7 +281,7 @@ void CJabberProto::OnModulesLoaded() StatusIconData sid = {};
sid.szModule = m_szModuleName;
- sid.hIcon = LoadIconEx("main");
+ sid.hIcon = IcoLib_GetIconByHandle(m_hProtoIcon);
sid.flags = MBF_HIDDEN;
sid.szTooltip.a = LPGEN("Jabber Resource");
Srmm_AddIcon(&sid, &g_plugin);
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index 40227f952c..97bcef405d 100755 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -482,8 +482,6 @@ struct CJabberProto : public PROTO<CJabberProto>, public IJabberInterface int* m_transportProtoTableStartIndex;
void IconsInit(void);
- HANDLE GetIconHandle(int iconId);
- HICON LoadIconEx(const char* name, bool big = false);
int LoadAdvancedIcons(int iID);
int GetTransportProtoID(char* TransportDomain);
int GetTransportStatusIconIndex(int iID, int Status);
diff --git a/protocols/JabberG/src/jabber_roster.cpp b/protocols/JabberG/src/jabber_roster.cpp index 727f77ea9a..c248722229 100644 --- a/protocols/JabberG/src/jabber_roster.cpp +++ b/protocols/JabberG/src/jabber_roster.cpp @@ -236,7 +236,7 @@ public: bool OnInitDialog() override { - Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_AGENTS)); + Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_AGENTS)); Utils_RestoreWindowPosition(m_hwnd, 0, m_proto->m_szModuleName, "rosterCtrlWnd_"); diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 8ac857be1b..15061de69d 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -583,7 +583,7 @@ public: {
CSuper::OnInitDialog();
- Window_SetIcon_IcoLib(m_hwnd, g_GetIconHandle(IDI_OPEN));
+ Window_SetIcon_IcoLib(m_hwnd, g_plugin.getIconHandle(IDI_OPEN));
SetDlgItemTextUtf(m_hwnd, IDC_TXT_URL, m_pParams->m_szUrl);
SetDlgItemTextUtf(m_hwnd, IDC_TXT_FROM, m_pParams->m_szFrom);
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp index 16a0097a95..b8366ca25f 100755 --- a/protocols/JabberG/src/jabber_userinfo.cpp +++ b/protocols/JabberG/src/jabber_userinfo.cpp @@ -233,7 +233,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti // caps JabberCapsBits jcb = ppro->GetResourceCapabilities(MakeJid(item->jid, r->m_szResourceName), r); if (!(jcb & JABBER_RESOURCE_CAPS_ERROR)) { - HTREEITEM htiCaps = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), nullptr, TranslateU("Client capabilities"), sttInfoLineId(resource, INFOLINE_CAPS)); + HTREEITEM htiCaps = sttFillInfoLine(hwndTree, htiResource, IcoLib_GetIconByHandle(ppro->m_hProtoIcon), nullptr, TranslateU("Client capabilities"), sttInfoLineId(resource, INFOLINE_CAPS)); int i; for (i = 0; i < g_cJabberFeatCapPairs; i++) if (jcb & g_JabberFeatCapPairs[i].jcbCap) { @@ -258,7 +258,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti } // Software info - HTREEITEM htiSoftwareInfo = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), nullptr, TranslateU("Software information"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION)); + HTREEITEM htiSoftwareInfo = sttFillInfoLine(hwndTree, htiResource, IcoLib_GetIconByHandle(ppro->m_hProtoIcon), nullptr, TranslateU("Software information"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION)); int nLineId = 0; if (CJabberClientPartialCaps *pCaps = r->m_pCaps) { if (pCaps->GetOs()) @@ -300,7 +300,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM sttCleanupInfo(hwndTree, 0); - HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, ppro->LoadIconEx("main"), L"JID", item->jid, sttInfoLineId(0, INFOLINE_NAME), true); + HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, IcoLib_GetIconByHandle(ppro->m_hProtoIcon), L"JID", item->jid, sttInfoLineId(0, INFOLINE_NAME), true); if (MCONTACT hContact = ppro->HContactFromJID(item->jid)) { sttFillAdvStatusInfo(ppro, hwndTree, htiRoot, sttInfoLineId(0, INFOLINE_MOOD), hContact, TranslateT("Mood"), ADVSTATUS_MOOD); @@ -439,8 +439,8 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa if (dat->item == nullptr) { HWND hwndTree = GetDlgItem(hwndDlg, IDC_TV_INFO); TreeView_DeleteAllItems(hwndTree); - HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, dat->ppro->LoadIconEx("main"), L"JID", jid, sttInfoLineId(0, INFOLINE_NAME), true); - sttFillInfoLine(hwndTree, htiRoot, dat->ppro->LoadIconEx("vcard"), nullptr, TranslateU("Please switch online to see more details.")); + HTREEITEM htiRoot = sttFillInfoLine(hwndTree, nullptr, IcoLib_GetIconByHandle(dat->ppro->m_hProtoIcon), L"JID", jid, sttInfoLineId(0, INFOLINE_NAME), true); + sttFillInfoLine(hwndTree, htiRoot, g_plugin.getIcon(IDI_VCARD), nullptr, TranslateU("Please switch online to see more details.")); break; } } @@ -570,7 +570,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP photoInfo->ppro = nullptr; photoInfo->hBitmap = nullptr; SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)photoInfo); - SendDlgItemMessage(hwndDlg, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_LoadIconEx("save")); + SendDlgItemMessage(hwndDlg, IDC_SAVE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_SAVE)); SendDlgItemMessage(hwndDlg, IDC_SAVE, BUTTONSETASFLATBTN, TRUE, 0); ShowWindow(GetDlgItem(hwndDlg, IDC_LOAD), SW_HIDE); ShowWindow(GetDlgItem(hwndDlg, IDC_DELETE), SW_HIDE); diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 981610f811..1d569e09a6 100755 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -693,7 +693,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param) else {
ppro->m_pInfoFrame->RemoveInfoItem("$/PEP/");
ppro->m_pInfoFrame->CreateInfoItem("$/PEP", false);
- ppro->m_pInfoFrame->UpdateInfoItem("$/PEP", ppro->GetIconHandle(IDI_PL_LIST_ANY), TranslateT("Advanced Status"));
+ ppro->m_pInfoFrame->UpdateInfoItem("$/PEP", g_plugin.getIconHandle(IDI_PL_LIST_ANY), TranslateT("Advanced Status"));
ppro->m_pInfoFrame->CreateInfoItem("$/PEP/mood", true);
ppro->m_pInfoFrame->SetInfoItemCallback("$/PEP/mood", &CJabberProto::InfoFrame_OnUserMood);
@@ -706,7 +706,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param) ppro->m_pInfoFrame->RemoveInfoItem("$/Transports/");
ppro->m_pInfoFrame->CreateInfoItem("$/Transports", false);
- ppro->m_pInfoFrame->UpdateInfoItem("$/Transports", ppro->GetIconHandle(IDI_TRANSPORT), TranslateT("Transports"));
+ ppro->m_pInfoFrame->UpdateInfoItem("$/Transports", g_plugin.getIconHandle(IDI_TRANSPORT), TranslateT("Transports"));
JABBER_LIST_ITEM *item = nullptr;
LISTFOREACH(i, ppro, LIST_ROSTER)
@@ -720,7 +720,7 @@ static VOID CALLBACK sttRebuildInfoFrameApcProc(void* param) char name[128];
mir_snprintf(name, "$/Transports/%s", item->jid);
ppro->m_pInfoFrame->CreateInfoItem(name, true, hContact);
- ppro->m_pInfoFrame->UpdateInfoItem(name, ppro->GetIconHandle(IDI_TRANSPORTL), (wchar_t *)item->jid);
+ ppro->m_pInfoFrame->UpdateInfoItem(name, g_plugin.getIconHandle(IDI_TRANSPORTL), (wchar_t *)item->jid);
ppro->m_pInfoFrame->SetInfoItemCallback(name, &CJabberProto::InfoFrame_OnTransport);
}
}
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index a8ba50067c..1dc02d045d 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -264,9 +264,9 @@ static INT_PTR CALLBACK PhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR case WM_INITDIALOG:
if (!lParam) break; // Launched from userinfo
TranslateDialogDefault(hwndDlg);
- SendDlgItemMessage(hwndDlg, IDC_LOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_LoadIconEx("open"));
+ SendDlgItemMessage(hwndDlg, IDC_LOAD, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_OPEN));
SendDlgItemMessage(hwndDlg, IDC_LOAD, BUTTONSETASFLATBTN, TRUE, 0);
- SendDlgItemMessage(hwndDlg, IDC_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_LoadIconEx("delete"));
+ SendDlgItemMessage(hwndDlg, IDC_DELETE, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_DELETE));
SendDlgItemMessage(hwndDlg, IDC_DELETE, BUTTONSETASFLATBTN, TRUE, 0);
ShowWindow(GetDlgItem(hwndDlg, IDC_SAVE), SW_HIDE);
{
@@ -804,11 +804,11 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP ListView_GetSubItemRect(nm->nmcd.hdr.hwndFrom, nm->nmcd.dwItemSpec, nm->iSubItem, LVIR_LABEL, &rc);
if (nm->nmcd.lItemlParam == -1 && nm->iSubItem == 3)
- hIcon = g_LoadIconEx("addcontact");
+ hIcon = g_plugin.getIcon(IDI_ADDCONTACT);
else if (nm->iSubItem == 2 && nm->nmcd.lItemlParam != -1)
- hIcon = g_LoadIconEx("edit");
+ hIcon = g_plugin.getIcon(IDI_EDIT);
else if (nm->iSubItem == 3 && nm->nmcd.lItemlParam != -1)
- hIcon = g_LoadIconEx("delete");
+ hIcon = g_plugin.getIcon(IDI_DELETE);
else break;
DrawIconEx(nm->nmcd.hdc, (rc.left + rc.right - GetSystemMetrics(SM_CXSMICON)) / 2, (rc.top + rc.bottom - GetSystemMetrics(SM_CYSMICON)) / 2, hIcon, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), 0, nullptr, DI_NORMAL);
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, CDRF_SKIPDEFAULT);
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 6f2b8a80fe..af69115cf2 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -760,7 +760,7 @@ void CPepMood::UpdateMenuView() ///////////////////////////////////////////////////////////////////////////////
// CPepActivity
-#define ACTIVITY_ICON(section, item) -(300 + (section) * 20 + (item))
+#define ACTIVITY_ICON(section, item) -(1300 + (section) * 20 + (item))
struct
{
@@ -1499,7 +1499,7 @@ void g_XstatusIconsInit() mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Moods"));
for (int i = 1; i < _countof(g_arrMoods); i++)
- g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(200 + i), szSection, TranslateW(g_arrMoods[i].szName));
+ g_MoodIcons.RegisterIcon(g_arrMoods[i].szTag, szFile, -(1200 + i), szSection, TranslateW(g_arrMoods[i].szName));
mir_wstrcpy(szSection, L"Protocols/Jabber/" LPGENW("Activities"));
for (int k = 0; k < _countof(g_arrActivities); k++) {
diff --git a/protocols/JabberG/src/stdafx.h b/protocols/JabberG/src/stdafx.h index f319bb16d2..99dbaae464 100755 --- a/protocols/JabberG/src/stdafx.h +++ b/protocols/JabberG/src/stdafx.h @@ -672,8 +672,6 @@ public: void g_IconsInit();
void g_XstatusIconsInit();
void g_XstatusIconsUninit();
-HANDLE g_GetIconHandle(int iconId);
-HICON g_LoadIconEx(const char* name, bool big = false);
void ImageList_AddIcon_Icolib(HIMAGELIST hIml, HICON hIcon);
|