summaryrefslogtreecommitdiff
path: root/plugins/Clist_modern/modern_clc.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-20 23:51:53 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-20 23:51:53 +0000
commit57abc51aad272a656282a52a460a47abe24e07d6 (patch)
treec6f3538e63c9c736cfa7129423d1b498273278b6 /plugins/Clist_modern/modern_clc.cpp
parentb9f120f97699286410fe902f93135235eed0b127 (diff)
- MS_SKIN2_ADDICON replaced with Skin_AddIcon;
- SKINICONDESC_SIZE* constants removed and replaced with sizeof(sid); - added SIDF_PATH_UNICODE for all plugins; - dynamic translation fixed in the icolib options dialog git-svn-id: http://svn.miranda-ng.org/main/trunk@507 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_modern/modern_clc.cpp')
-rw-r--r--plugins/Clist_modern/modern_clc.cpp93
1 files changed, 36 insertions, 57 deletions
diff --git a/plugins/Clist_modern/modern_clc.cpp b/plugins/Clist_modern/modern_clc.cpp
index 1e05581498..e4626ceb63 100644
--- a/plugins/Clist_modern/modern_clc.cpp
+++ b/plugins/Clist_modern/modern_clc.cpp
@@ -67,8 +67,8 @@ static int clcExitDragToScroll();
static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
{
- int i;
- if (MirandaExiting()) return 0;
+ if (MirandaExiting())
+ return 0;
ModernHookEvent(ME_MODERNOPT_INITIALIZE,ModernOptInit);
ModernHookEvent(ME_MODERNOPT_INITIALIZE,ModernSkinOptInit);
@@ -79,67 +79,46 @@ static int clcHookModulesLoaded(WPARAM wParam,LPARAM lParam)
g_szMetaModuleName = (char *)CallService(MS_MC_GETPROTOCOLNAME, 0, 0);
// Get icons
- if(ServiceExists(MS_SKIN2_ADDICON))
- {
- SKINICONDESC sid={0};
- char szMyPath[MAX_PATH];
- int i;
-
- GetModuleFileNameA(g_hInst, szMyPath, MAX_PATH);
-
- sid.cbSize = sizeof(sid);
- sid.cx=16;
- sid.cy=16;
- sid.pszDefaultFile = szMyPath;
-
- sid.pszSection = LPGEN("Contact List");
- sid.pszDescription = LPGEN("Listening to");
- sid.pszName = "LISTENING_TO_ICON";
- sid.iDefaultIndex = - IDI_LISTENING_TO;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
-
- sid.pszSection = LPGEN("Contact List/Avatar Overlay");
+ int i;
- for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
- {
- sid.pszDescription = g_pAvatarOverlayIcons[i].description;
- sid.pszName = g_pAvatarOverlayIcons[i].name;
- sid.iDefaultIndex = - g_pAvatarOverlayIcons[i].id;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- }
- sid.pszSection = LPGEN("Contact List/Status Overlay");
+ TCHAR szMyPath[MAX_PATH];
+ GetModuleFileName(g_hInst, szMyPath, SIZEOF(szMyPath));
+
+ SKINICONDESC sid={0};
+ sid.cbSize = sizeof(sid);
+ sid.cx = 16;
+ sid.cy = 16;
+ sid.ptszDefaultFile = szMyPath;
+ sid.flags = SIDF_PATH_TCHAR;
+
+ sid.pszSection = LPGEN("Contact List");
+ sid.pszDescription = LPGEN("Listening to");
+ sid.pszName = "LISTENING_TO_ICON";
+ sid.iDefaultIndex = - IDI_LISTENING_TO;
+ Skin_AddIcon(&sid);
+
+ sid.pszSection = LPGEN("Contact List/Avatar Overlay");
+ for (i=0; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++) {
+ sid.pszDescription = g_pAvatarOverlayIcons[i].description;
+ sid.pszName = g_pAvatarOverlayIcons[i].name;
+ sid.iDefaultIndex = - g_pAvatarOverlayIcons[i].id;
+ Skin_AddIcon(&sid);
+ }
- for (i = 0 ; i < MAX_REGS(g_pStatusOverlayIcons) ; i++)
- {
- sid.pszDescription = g_pStatusOverlayIcons[i].description;
- sid.pszName = g_pStatusOverlayIcons[i].name;
- sid.iDefaultIndex = - g_pStatusOverlayIcons[i].id;
- CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid);
- }
+ sid.pszSection = LPGEN("Contact List/Status Overlay");
+ for (i=0; i < MAX_REGS(g_pStatusOverlayIcons); i++) {
+ sid.pszDescription = g_pStatusOverlayIcons[i].description;
+ sid.pszName = g_pStatusOverlayIcons[i].name;
+ sid.iDefaultIndex = - g_pStatusOverlayIcons[i].id;
+ Skin_AddIcon(&sid);
+ }
- clcHookIconsChanged(0,0);
+ clcHookIconsChanged(0,0);
- hIconChangedHook=ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
- }
- else
- {
- if (hAvatarOverlays) ImageList_Destroy(hAvatarOverlays);
- hAvatarOverlays=ImageList_Create(16,16,ILC_MASK|ILC_COLOR32,MAX_REGS(g_pAvatarOverlayIcons)*2,1);
- for (i = 0 ; i < MAX_REGS(g_pAvatarOverlayIcons) ; i++)
- {
- HICON hIcon=LoadSmallIcon(g_hInst, MAKEINTRESOURCE(g_pAvatarOverlayIcons[i].id));
- g_pAvatarOverlayIcons[i].listID = ImageList_AddIcon(hAvatarOverlays,hIcon);
- DestroyIcon_protect(hIcon);
- hIcon=LoadSmallIcon(g_hInst, MAKEINTRESOURCE(g_pStatusOverlayIcons[i].id));
- g_pStatusOverlayIcons[i].listID = ImageList_AddIcon(hAvatarOverlays,hIcon);
- DestroyIcon_protect(hIcon);
- }
- g_hListeningToIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_LISTENING_TO), IMAGE_ICON, 16, 16, 0);
- }
+ hIconChangedHook=ModernHookEvent(ME_SKIN2_ICONSCHANGED, clcHookIconsChanged);
// Register smiley category
- if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY))
- {
+ if (ServiceExists(MS_SMILEYADD_REGISTERCATEGORY)) {
SMADD_REGCAT rc;
rc.cbSize = sizeof(rc);