From 57abc51aad272a656282a52a460a47abe24e07d6 Mon Sep 17 00:00:00 2001 From: George Hazan <george.hazan@gmail.com> 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/Svc_dbepp/headers.h | 1 - plugins/Svc_dbepp/icons.cpp | 32 ++++++++++++-------------------- plugins/Svc_dbepp/main.cpp | 8 +------- 3 files changed, 13 insertions(+), 28 deletions(-) (limited to 'plugins/Svc_dbepp') diff --git a/plugins/Svc_dbepp/headers.h b/plugins/Svc_dbepp/headers.h index 97a530291c..57663f56e1 100644 --- a/plugins/Svc_dbepp/headers.h +++ b/plugins/Svc_dbepp/headers.h @@ -53,7 +53,6 @@ /////// icons support -extern BYTE UsingIconManager; void addIcons(TCHAR* szModuleFileName); HICON LoadSkinnedDBEIcon(int icon); int AddIconToList(HIMAGELIST hil, HICON hIcon); diff --git a/plugins/Svc_dbepp/icons.cpp b/plugins/Svc_dbepp/icons.cpp index f6ac36e95e..ae77539ae0 100644 --- a/plugins/Svc_dbepp/icons.cpp +++ b/plugins/Svc_dbepp/icons.cpp @@ -16,72 +16,64 @@ void addIcons(TCHAR* szModuleFileName) mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_KNOWN); sid.pszName = name; sid.iDefaultIndex = -ICO_KNOWN; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + Skin_AddIcon(&sid); // open known module sid.ptszDescription = LPGENT("Open Known Module"); mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_KNOWNOPEN); sid.pszName = name; sid.iDefaultIndex = -ICO_KNOWNOPEN; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + Skin_AddIcon(&sid); // closed unknown module sid.ptszDescription = LPGENT("Closed Unknown Module"); mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_UNKNOWN); sid.pszName = name; sid.iDefaultIndex = -ICO_UNKNOWN; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + Skin_AddIcon(&sid); // open unknown module sid.ptszDescription = LPGENT("Open Unknown Module"); mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_UNKNOWNOPEN); sid.pszName = name; sid.iDefaultIndex = -ICO_UNKNOWNOPEN; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + Skin_AddIcon(&sid); // settings contact sid.ptszDescription = LPGENT("Settings"); mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_SETTINGS); sid.pszName = name; sid.iDefaultIndex = -ICO_SETTINGS; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + Skin_AddIcon(&sid); // contact group sid.ptszDescription = LPGENT("Contacts Group"); mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_CONTACTS); sid.pszName = name; sid.iDefaultIndex = -ICO_CONTACTS; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + Skin_AddIcon(&sid); // unknwon contact sid.ptszDescription = LPGENT("Unknown Contact"); mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_OFFLINE); sid.pszName = name; sid.iDefaultIndex = -ICO_OFFLINE; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + Skin_AddIcon(&sid); // known contact sid.ptszDescription = LPGENT("Known Contact"); mir_snprintf(name, SIZEOF(name), "DBE++_%d", ICO_ONLINE); sid.pszName = name; sid.iDefaultIndex = -ICO_ONLINE; - CallService(MS_SKIN2_ADDICON,0,(LPARAM)&sid); + Skin_AddIcon(&sid); } HICON LoadSkinnedDBEIcon(int icon) { - HICON hIcon = 0; - if (UsingIconManager) - { - char name[32]; - mir_snprintf(name, SIZEOF(name), "DBE++_%d", icon); - - hIcon = (HICON)CallService(MS_SKIN2_GETICON,0,(LPARAM)name); - } - if (!hIcon) - return LoadIcon(hInst, MAKEINTRESOURCE(icon)); - else - return hIcon; + char name[32]; + mir_snprintf(name, SIZEOF(name), "DBE++_%d", icon); + HICON hIcon = (HICON)CallService(MS_SKIN2_GETICON,0,(LPARAM)name); + return (hIcon) ? hIcon : LoadIcon(hInst, MAKEINTRESOURCE(icon)); } diff --git a/plugins/Svc_dbepp/main.cpp b/plugins/Svc_dbepp/main.cpp index 0c7eec1a0f..c1507b3797 100644 --- a/plugins/Svc_dbepp/main.cpp +++ b/plugins/Svc_dbepp/main.cpp @@ -18,7 +18,6 @@ BYTE nameOrder[NAMEORDERCOUNT]; HANDLE hUserMenu; HANDLE hRestore; WatchListArrayStruct WatchListArray; -BYTE UsingIconManager; HANDLE sMenuCommand, sRegisterModule, sRegisterSingleModule, sImport, sServicemodeLaunch; HANDLE hModulesLoadedHook = NULL, hSettingsChangedHook=NULL, hOptInitHook=NULL, hPreShutdownHook=NULL, hTTBHook = NULL; @@ -212,13 +211,8 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam) doOldKnownModulesList(); // add the old plugins which havnt been changed over yet.. // icons - if (GetModuleFileName(hInst, szModuleFileName, MAX_PATH) && ServiceExists(MS_SKIN2_ADDICON)) - { - UsingIconManager =1; + if (GetModuleFileName(hInst, szModuleFileName, MAX_PATH)) addIcons(szModuleFileName); - } - else - UsingIconManager = 0; DBFreeVariant(&dbv); UnhookEvent(hModulesLoadedHook); -- cgit v1.2.3