From 57abc51aad272a656282a52a460a47abe24e07d6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 20 Jun 2012 23:51:53 +0000 Subject: - 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 --- plugins/BuddyExpectator/BuddyExpectator.cpp | 82 +++++++++++------------------ 1 file changed, 30 insertions(+), 52 deletions(-) (limited to 'plugins/BuddyExpectator') diff --git a/plugins/BuddyExpectator/BuddyExpectator.cpp b/plugins/BuddyExpectator/BuddyExpectator.cpp index 19e02d446a..e31bdf06c2 100644 --- a/plugins/BuddyExpectator/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/BuddyExpectator.cpp @@ -484,15 +484,7 @@ INT_PTR ContactStillAbsentAction(WPARAM wParam, LPARAM lParam) */ int onIconsChanged(WPARAM wParam, LPARAM lParam) { - if (ServiceExists(MS_SKIN2_ADDICON)) - { - hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"main_icon"); - } - else - { - hIcon = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_MAINICON), IMAGE_ICON, 16, 16, 0); - } - + hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"main_icon"); return 0; } @@ -563,16 +555,7 @@ int onExtraImageListRebuild(WPARAM wParam, LPARAM lParam) g_IECMissYou.ColumnType = options.MissYouIcon; if (ServiceExists(MS_CLIST_EXTRA_ADD_ICON)) - { - if (ServiceExists(MS_SKIN2_ADDICON)) - { - g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"), (LPARAM)0); - } - else - { - g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)LoadImage(hInst, MAKEINTRESOURCE(IDI_ENABLED), IMAGE_ICON, 16, 16, LR_SHARED), (LPARAM)0); - } - } + g_IECMissYou.hImage = (HANDLE)CallService(MS_CLIST_EXTRA_ADD_ICON, (WPARAM)(HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM)"enabled_icon"), (LPARAM)0); return 0; } @@ -767,48 +750,43 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam) } // IcoLib support - if (ServiceExists(MS_SKIN2_ADDICON)) - { - SKINICONDESC sid = {0}; - char szFile[MAX_PATH]; - GetModuleFileNameA(hInst, szFile, MAX_PATH); - sid.pszDefaultFile = szFile; - sid.cbSize = SKINICONDESC_SIZE_V1; - - sid.pszSection = Translate("BuddyExpectator"); + SKINICONDESC sid = {0}; + char szFile[MAX_PATH]; + GetModuleFileNameA(hInst, szFile, MAX_PATH); + sid.pszDefaultFile = szFile; + sid.cbSize = sizeof(sid); + sid.pszSection = "BuddyExpectator"; - sid.pszDescription = Translate("Tray/popup icon"); - sid.pszName = "main_icon"; - sid.iDefaultIndex = -IDI_MAINICON; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + sid.pszDescription = "Tray/popup icon"; + sid.pszName = "main_icon"; + sid.iDefaultIndex = -IDI_MAINICON; + Skin_AddIcon(&sid); - sid.pszDescription = Translate("Enabled"); - sid.pszName = "enabled_icon"; - sid.iDefaultIndex = -IDI_ENABLED; - hEnabledIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + sid.pszDescription = "Enabled"; + sid.pszName = "enabled_icon"; + sid.iDefaultIndex = -IDI_ENABLED; + hEnabledIcon = Skin_AddIcon(&sid); - sid.pszDescription = Translate("Disabled"); - sid.pszName = "disabled_icon"; - sid.iDefaultIndex = -IDI_DISABLED; - hDisabledIcon = (HANDLE)CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + sid.pszDescription = "Disabled"; + sid.pszName = "disabled_icon"; + sid.iDefaultIndex = -IDI_DISABLED; + hDisabledIcon = Skin_AddIcon(&sid); - sid.pszDescription = Translate("Hide"); - sid.pszName = "hide_icon"; - sid.iDefaultIndex = -IDI_HIDE; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + sid.pszDescription = "Hide"; + sid.pszName = "hide_icon"; + sid.iDefaultIndex = -IDI_HIDE; + Skin_AddIcon(&sid); - sid.pszDescription = Translate("NeverHide"); - sid.pszName = "neverhide_icon"; - sid.iDefaultIndex = -IDI_NEVERHIDE; - CallService(MS_SKIN2_ADDICON, 0, (LPARAM)&sid); + sid.pszDescription = "NeverHide"; + sid.pszName = "neverhide_icon"; + sid.iDefaultIndex = -IDI_NEVERHIDE; + Skin_AddIcon(&sid); - hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged); - } + hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged); onIconsChanged(0,0); - if (options.enableMissYou) - { + if (options.enableMissYou) { hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); CLISTMENUITEM mi = {0}; -- cgit v1.2.3