From c4582dd65b444e5dae29ada7cc3f6c9a9c20edf3 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 2 Dec 2012 18:19:49 +0000 Subject: new easy standard way of registering icons: Icon_Register git-svn-id: http://svn.miranda-ng.org/main/trunk@2601 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/IgnoreState/src/main.cpp | 36 ++++++------------------------------ 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'plugins/IgnoreState') diff --git a/plugins/IgnoreState/src/main.cpp b/plugins/IgnoreState/src/main.cpp index 5826b55bcc..e81da8b9dc 100644 --- a/plugins/IgnoreState/src/main.cpp +++ b/plugins/IgnoreState/src/main.cpp @@ -110,38 +110,13 @@ void applyExtraImage(HANDLE hContact) ///////////////////////////////////////////////////////////////////////////////////////// -static struct +static IconItem iconList[] = { - TCHAR* szDescr; - char* szName; - int defIconID; - HANDLE hIconLibItem; -} -iconList[] = -{ - { LPGENT( "Full Ignore" ), "ignore_full", IDI_IFULL }, - { LPGENT( "Partial Ignore" ), "ignore_part", IDI_IPART }, - { LPGENT( "Message Ignore" ), "ignore_mess", IDI_IMESS }, + { LPGEN("Full Ignore"), "ignore_full", IDI_IFULL }, + { LPGEN("Partial Ignore"), "ignore_part", IDI_IPART }, + { LPGEN("Message Ignore"), "ignore_mess", IDI_IMESS }, }; -static VOID init_icolib (void) -{ - TCHAR tszFile[MAX_PATH]; - GetModuleFileName(g_hInst, tszFile, MAX_PATH); - - SKINICONDESC sid = { sizeof(sid) }; - sid.flags = SIDF_ALL_TCHAR; - sid.ptszSection = _T(MODULENAME); - sid.ptszDefaultFile = tszFile; - - for (int i = 0; i < SIZEOF(iconList); i++) { - sid.pszName = iconList[i].szName; - sid.ptszDescription = iconList[i].szDescr; - sid.iDefaultIndex = -iconList[i].defIconID; - iconList[i].hIconLibItem = Skin_AddIcon(&sid); - } -} - VOID fill_filter(void) { bUseMirandaSettings = DBGetContactSettingByte(NULL, MODULENAME, "UseMirandaSettings", 0); @@ -161,7 +136,8 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) HookEvent(ME_OPT_INITIALISE, onOptInitialise); //IcoLib support - init_icolib(); + Icon_Register(g_hInst, MODULENAME, iconList, SIZEOF(iconList)); + fill_filter(); hExtraIcon = ExtraIcon_Register("ignore", "IgnoreState", "ignore_full"); -- cgit v1.2.3