summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/AuthState/src/main.cpp12
-rw-r--r--plugins/BASS_interface/src/Main.cpp12
-rw-r--r--plugins/BossKeyPlus/src/BossKey.cpp4
-rw-r--r--plugins/BuddyExpectator/src/BuddyExpectator.cpp36
-rw-r--r--plugins/Chat/src/options.cpp24
-rw-r--r--plugins/Clist_modern/src/modern_clcitems.cpp21
-rw-r--r--plugins/Clist_nicer/SRC/clui.cpp7
-rw-r--r--plugins/Console/src/Console.cpp6
-rw-r--r--plugins/CountryFlags/src/icons.cpp60
-rw-r--r--plugins/Db_autobackups/main.cpp5
-rw-r--r--plugins/Dbx_mmap_SA/dialogs.cpp16
-rw-r--r--plugins/ExtraIcons/src/options.cpp2
-rw-r--r--plugins/ExtraIcons/src/usedIcons.cpp2
-rw-r--r--plugins/Gender/main.cpp5
-rw-r--r--plugins/HistorySweeperLight/options.cpp10
-rw-r--r--plugins/IgnoreState/main.cpp1
-rw-r--r--plugins/ListeningTo/listeningto.cpp4
-rw-r--r--plugins/MenuItemEx/main.cpp3
-rw-r--r--plugins/MetaContacts/icons.cpp48
-rw-r--r--plugins/MetaContacts/meta_services.cpp2
-rw-r--r--plugins/MetaContacts/metacontacts.h2
-rw-r--r--plugins/SRMM/globals.cpp14
-rw-r--r--plugins/Scriver/globals.cpp127
-rw-r--r--plugins/SpellChecker/ardialog.cpp2
-rw-r--r--plugins/SpellChecker/options.cpp2
-rw-r--r--plugins/SpellChecker/spellchecker.cpp4
-rw-r--r--plugins/TabSRMM/src/msgs.cpp20
-rw-r--r--plugins/Utils/mir_icons.cpp46
-rw-r--r--plugins/Utils/mir_icons.h4
-rw-r--r--plugins/Utils/mir_options.cpp2
30 files changed, 226 insertions, 277 deletions
diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp
index 8494d0b9a3..29224bd3d3 100644
--- a/plugins/AuthState/src/main.cpp
+++ b/plugins/AuthState/src/main.cpp
@@ -219,14 +219,14 @@ int onPrebuildContactMenu(WPARAM wParam, LPARAM lParam)
int onModulesLoaded(WPARAM wParam,LPARAM lParam)
{
// IcoLib support
- SKINICONDESC sid = {0};
- ZeroMemory(&sid, sizeof(sid));
TCHAR szFile[MAX_PATH];
+ GetModuleFileName(g_hInst, szFile, MAX_PATH);
+
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(sid);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = _T("Auth State");
- GetModuleFileName(g_hInst, szFile, MAX_PATH);
sid.ptszDefaultFile = szFile;
sid.ptszDescription = _T("Auth");
@@ -246,12 +246,10 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
// extra icons
hExtraIcon = ExtraIcon_Register("authstate", "Auth State", "authgrant_icon");
- if (hExtraIcon != NULL)
- {
+ if (hExtraIcon != NULL) {
// Set initial value for all contacts
HANDLE hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
- while (hContact != NULL)
- {
+ while (hContact != NULL) {
onExtraImageApplying((WPARAM)hContact, 1);
hContact = (HANDLE) CallService(MS_DB_CONTACT_FINDNEXT, (WPARAM) hContact, 0);
}
diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp
index 2be38e4028..828babac15 100644
--- a/plugins/BASS_interface/src/Main.cpp
+++ b/plugins/BASS_interface/src/Main.cpp
@@ -311,21 +311,21 @@ static HANDLE hIconLibItem[SIZEOF(iconList)];
void InitIcons(void)
{
- int i; char szSettingName[100]; SKINICONDESC sid = {0}; TCHAR szFile[MAX_PATH];
-
+ TCHAR szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, SIZEOF(szFile));
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.ptszDefaultFile = szFile;
sid.cx = sid.cy = 16;
- sid.pszName = szSettingName;
sid.pszSection = ModuleName;
sid.flags = SIDF_PATH_TCHAR;
- for (i = 0; i < SIZEOF(iconList); i++)
- {
+ for (int i=0; i < SIZEOF(iconList); i++) {
+ char szSettingName[100];
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", ModuleName, iconList[i].szName);
-
+
+ sid.pszName = szSettingName;
sid.pszDescription = (char*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
hIconLibItem[i] = Skin_AddIcon(&sid);
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp
index cba063070e..5d4d6d4c21 100644
--- a/plugins/BossKeyPlus/src/BossKey.cpp
+++ b/plugins/BossKeyPlus/src/BossKey.cpp
@@ -602,21 +602,19 @@ static TCHAR *GetBossKeyText(void)
static int IcoLibInit (void) // Icolib support
{
- SKINICONDESC sid = {0};
TCHAR tszFile[MAX_PATH];
GetModuleFileName(g_hInstance, tszFile, MAX_PATH);
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszDefaultFile = tszFile;
sid.cx = sid.cy = 16;
sid.ptszSection = _T("BossKey");
-
sid.pszName = "hidemim";
sid.ptszDescription = _T("Hide Miranda IM");
sid.iDefaultIndex = -IDI_DLGPASSWD;
g_hIcon = Skin_AddIcon(&sid);
-
return 0;
}
diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
index ff0382bd61..9ef2779a02 100644
--- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp
@@ -742,10 +742,11 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
g_IECClear.hImage = (HANDLE) -1;
}
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileNameA(hInst, szFile, MAX_PATH);
+
// IcoLib support
SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
sid.pszDefaultFile = szFile;
sid.cbSize = sizeof(sid);
sid.pszSection = "BuddyExpectator";
@@ -776,12 +777,12 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
Skin_AddIcon(&sid);
hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onIconsChanged);
-
+
onIconsChanged(0,0);
-
+
if (options.enableMissYou) {
hPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
-
+
CLISTMENUITEM mi = {0};
mi.cbSize = sizeof(CLISTMENUITEM);
mi.flags = CMIF_ICONFROMICOLIB;
@@ -791,23 +792,22 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
mi.pszService = "BuddyExpectator/actionMissYouClick";
hContactMenu = Menu_AddContactMenuItem(&mi);
}
-
-
+
missyouactions[0].cbSize = sizeof(POPUPACTION);
missyouactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"disabled_icon");
lstrcpy(missyouactions[0].lpzTitle, Translate("Disable Miss You"));
missyouactions[0].wParam = missyouactions[0].lParam = 1;
-
+
hideactions[0].cbSize = sizeof(POPUPACTION);
hideactions[0].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"hide_icon");
lstrcpy(hideactions[0].lpzTitle, Translate("Hide contact"));
hideactions[0].wParam = hideactions[0].lParam = 2;
-
+
hideactions[1].cbSize = sizeof(POPUPACTION);
hideactions[1].lchIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)"neverhide_icon");
lstrcpy(hideactions[1].lpzTitle, Translate("Never hide this contact"));
hideactions[1].wParam = hideactions[1].lParam = 3;
-
+
return 0;
}
@@ -825,8 +825,8 @@ int ContactAdded(WPARAM wParam, LPARAM lParam)
int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
{
UnhookEvent(hEventContactSetting);
- UnhookEvent(hEventContactAdded);
- UnhookEvent(hEventUserInfoInit);
+ UnhookEvent(hEventContactAdded);
+ UnhookEvent(hEventUserInfoInit);
if (hPrebuildContactMenu) UnhookEvent(hPrebuildContactMenu);
UnhookEvent(hIcoLibIconsChanged);
UnhookEvent(hModulesLoaded);
@@ -834,19 +834,19 @@ int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
UnhookEvent(hSystemOKToExit);
UnhookEvent(hHookExtraIconsRebuild);
UnhookEvent(hHookExtraIconsApply);
-
+
DestroyServiceFunction(hContactReturnedAction);
DestroyServiceFunction(hContactStillAbsentAction);
DestroyServiceFunction(hMissYouAction);
DestroyServiceFunction(hMenuMissYouClick);
DeinitOptions();
-
+
if (hIcoLibIconsChanged)
CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
else
DestroyIcon(hIcon);
-
+
return 0;
}
@@ -873,9 +873,8 @@ extern "C" int __declspec(dllexport) Load(void)
DBVARIANT dbv;
HANDLE hContact = (HANDLE)CallService(MS_DB_CONTACT_FINDFIRST, 0, 0);
DWORD current_time = (DWORD)time(0);
- while (hContact != 0)
- {
- if (!DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv))
+ while (hContact != 0) {
+ if ( !DBGetContactSetting(hContact, MODULE_NAME, "CreationTime", &dbv))
DBFreeVariant(&dbv);
else
DBWriteContactSettingDword(hContact, MODULE_NAME, "CreationTime", current_time);
@@ -892,4 +891,3 @@ extern "C" int __declspec(dllexport) Unload(void)
return 0;
}
-
diff --git a/plugins/Chat/src/options.cpp b/plugins/Chat/src/options.cpp
index 381054d5ca..89d39d7f47 100644
--- a/plugins/Chat/src/options.cpp
+++ b/plugins/Chat/src/options.cpp
@@ -429,9 +429,9 @@ void RegisterFonts( void )
struct
{
int size;
- const char* szSection;
- const char* szDescr;
- const char* szName;
+ char* szSection;
+ char* szDescr;
+ char* szName;
int defIconID;
}
static const iconList[] =
@@ -477,19 +477,19 @@ static const iconList[] =
void AddIcons(void)
{
- int i;
- SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- GetModuleFileNameA(g_hInst, szFile, MAX_PATH);
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(g_hInst, szFile, MAX_PATH);
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
- sid.pszDefaultFile = szFile;
+ sid.ptszDefaultFile = szFile;
+ sid.flags = SIDF_PATH_TCHAR;
- for ( i = 0; i < SIZEOF(iconList); i++ ) {
+ for (int i = 0; i < SIZEOF(iconList); i++ ) {
sid.cx = sid.cy = iconList[i].size;
- sid.pszSection = (char*)iconList[i].szSection;
- sid.pszDescription = (char*)iconList[i].szDescr;
- sid.pszName = (char*)iconList[i].szName;
+ sid.pszSection = iconList[i].szSection;
+ sid.pszDescription = iconList[i].szDescr;
+ sid.pszName = iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
Skin_AddIcon(&sid);
} }
diff --git a/plugins/Clist_modern/src/modern_clcitems.cpp b/plugins/Clist_modern/src/modern_clcitems.cpp
index 2325cef988..b8b99a48e5 100644
--- a/plugins/Clist_modern/src/modern_clcitems.cpp
+++ b/plugins/Clist_modern/src/modern_clcitems.cpp
@@ -754,7 +754,7 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
char szTemp[64];
TCHAR szGroupMask[256];
DWORD dwLocalMask;
- PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry(hContact);
+ PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry(hContact);
BOOL fEmbedded = dat->force_in_dialog;
// always hide subcontacts (but show them on embedded contact lists)
@@ -766,18 +766,15 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
}
if (g_CluiData.bMetaAvail && dat != NULL && dat->IsMetaContactsEnabled && g_szMetaModuleName && db_get_b(hContact, g_szMetaModuleName, "IsSubcontact", 0))
return -1; //subcontact
- if (pdnce && pdnce->isUnknown && !fEmbedded)
- return 1; //'Unknown Contact'
- if (pdnce && g_CluiData.bFilterEffective && !fEmbedded)
- {
+ if (pdnce && pdnce->isUnknown && !fEmbedded)
+ return 1; //'Unknown Contact'
+ if (pdnce && g_CluiData.bFilterEffective && !fEmbedded) {
if (szProto == NULL)
szProto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
- if (g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS)
- {
+ if (g_CluiData.bFilterEffective & CLVM_STICKY_CONTACTS) {
if ((dwLocalMask = db_get_dw(hContact, CLVM_MODULE, g_CluiData.current_viewmode, 0)) != 0) {
- if (g_CluiData.bFilterEffective & CLVM_FILTER_STICKYSTATUS)
- {
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_STICKYSTATUS) {
WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
return !((1 << (wStatus - ID_STATUS_OFFLINE)) & HIWORD(dwLocalMask));
}
@@ -804,12 +801,10 @@ int __fastcall CLVM_GetContactHiddenStatus(HANDLE hContact, char *szProto, struc
WORD wStatus = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
filterResult = (g_CluiData.filterFlags & CLVM_GROUPSTATUS_OP) ? ((filterResult | ((1 << (wStatus - ID_STATUS_OFFLINE)) & g_CluiData.statusMaskFilter ? 1 : 0))) : (filterResult & ((1 << (wStatus - ID_STATUS_OFFLINE)) & g_CluiData.statusMaskFilter ? 1 : 0));
}
- if (g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG)
- {
+ if (g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG) {
DWORD now;
PDNCE pdnce = (PDNCE)pcli->pfnGetCacheEntry(hContact);
- if (pdnce)
- {
+ if (pdnce) {
now = g_CluiData.t_now;
now -= g_CluiData.lastMsgFilter;
if (g_CluiData.bFilterEffective & CLVM_FILTER_LASTMSG_OLDERTHAN)
diff --git a/plugins/Clist_nicer/SRC/clui.cpp b/plugins/Clist_nicer/SRC/clui.cpp
index b25888de02..d8ddd2076b 100644
--- a/plugins/Clist_nicer/SRC/clui.cpp
+++ b/plugins/Clist_nicer/SRC/clui.cpp
@@ -310,12 +310,10 @@ static void InitIcoLib()
TCHAR szFilename[MAX_PATH];
GetModuleFileName(g_hInst, szFilename, MAX_PATH);
- SKINICONDESC sid = {0};
int i, version = 0;
char szBuffer[128];
- int p_count = 0;
- PROTOACCOUNT **accs = NULL;
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.flags = SIDF_PATH_TCHAR;
sid.pszSection = LPGEN("CList - Nicer/Default");
@@ -350,6 +348,9 @@ static void InitIcoLib()
Skin_AddIcon(&sid);
}
sid.ptszSection = LPGENT("CList - Nicer/Connecting Icons");
+
+ PROTOACCOUNT **accs = NULL;
+ int p_count = 0;
ProtoEnumAccounts( &p_count, &accs );
for (i = 0; i < p_count; i++) {
TCHAR szDescr[128];
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp
index 05c0c35801..d22446be2c 100644
--- a/plugins/Console/src/Console.cpp
+++ b/plugins/Console/src/Console.cpp
@@ -121,13 +121,13 @@ static int OnTTBLoaded(WPARAM wParam,LPARAM lParam)
int state = IsWindowVisible(hwndConsole);
- TTBButton ttbb = {0};
+ TTBButton ttbb = { 0 };
ttbb.cbSize = sizeof(ttbb);
- TCHAR szModuleFileName[MAX_PATH]={0};
+ TCHAR szModuleFileName[MAX_PATH];
GetModuleFileName(hInst, szModuleFileName, SIZEOF(szModuleFileName));
- SKINICONDESC sid={0};
+ SKINICONDESC sid = { 0 };
sid.cbSize = sizeof(sid);
sid.pszSection = "Console";
sid.ptszDefaultFile = szModuleFileName;
diff --git a/plugins/CountryFlags/src/icons.cpp b/plugins/CountryFlags/src/icons.cpp
index 3b456a4d11..cde97ff74e 100644
--- a/plugins/CountryFlags/src/icons.cpp
+++ b/plugins/CountryFlags/src/icons.cpp
@@ -226,53 +226,51 @@ static INT_PTR ServiceCreateMergedFlagIcon(WPARAM wParam,LPARAM lParam)
void InitIcons(void)
{
- HIMAGELIST himl;
- SKINICONDESC sid;
char szId[20];
- int i,index;
- HICON hIcon;
WCHAR szName[64];
- LCID locale;
- locale=(LCID)CallService(MS_LANGPACK_GETLOCALE,0,0);
-
+ LCID locale = (LCID)CallService(MS_LANGPACK_GETLOCALE,0,0);
/* register icons */
- ZeroMemory(&sid,sizeof(sid));
- sid.cbSize=sizeof(sid);
- sid.pszName=szId;
- sid.cx=GetSystemMetrics(SM_CXSMICON);
- sid.cy=GetSystemMetrics(SM_CYSMICON);
- sid.flags=SIDF_SORTED|SIDF_TCHAR;
- sid.ptszSection=TranslateT("Country Flags");
+ SKINICONDESC sid = { 0 };
+ sid.cbSize = sizeof(sid);
+ sid.pszName = szId;
+ sid.cx = GetSystemMetrics(SM_CXSMICON);
+ sid.cy = GetSystemMetrics(SM_CYSMICON);
+ sid.flags = SIDF_SORTED | SIDF_TCHAR;
+ sid.ptszSection = TranslateT("Country Flags");
+
/* all those flag icons do not need any transparency mask (flags are always opaque),
* storing them in a large bitmap to reduce file size */
- himl=ImageList_LoadImage(hInst,MAKEINTRESOURCE(IDB_FLAGS),sid.cx,0,CLR_NONE,IMAGE_BITMAP,LR_CREATEDIBSECTION);
- if(himl!=NULL) {
- phIconHandles=(HANDLE*)mir_alloc(nCountriesCount*sizeof(HANDLE));
- if(phIconHandles!=NULL)
- for(i=0;i<nCountriesCount;++i) {
-
+ HIMAGELIST himl = ImageList_LoadImage(hInst,MAKEINTRESOURCE(IDB_FLAGS),sid.cx,0,CLR_NONE,IMAGE_BITMAP,LR_CREATEDIBSECTION);
+ if (himl != NULL) {
+ phIconHandles = (HANDLE*)mir_alloc(nCountriesCount*sizeof(HANDLE));
+ if (phIconHandles != NULL) {
+ for (int i=0; i < nCountriesCount; ++i) {
MultiByteToWideChar(locale,0,countries[i].szName,-1,szName,SIZEOF(szName));
- szName[SIZEOF(szName)-1]=L'\0';
- sid.pwszDescription=TranslateW(szName);
+ szName[SIZEOF(szName)-1] = L'\0';
+ sid.pwszDescription = TranslateW(szName);
/* create identifier */
- wsprintfA(szId,(countries[i].id==0xFFFF)?"%s0x%X":"%s%i","flags_",countries[i].id); /* buffer safe */
- index=CountryNumberToBitmapIndex(countries[i].id);
+ wsprintfA(szId,(countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i","flags_", countries[i].id); /* buffer safe */
+ int index = CountryNumberToBitmapIndex(countries[i].id);
/* create icon */
- hIcon=ImageList_GetIcon(himl,index,ILD_NORMAL);
- sid.hDefaultIcon=(hIcon!=NULL)?ResizeIconCentered(hIcon,sid.cx,sid.cy):NULL;
- if(hIcon!=NULL) DestroyIcon(hIcon);
- index=CountryNumberToIndex(countries[i].id);
+ HICON hIcon = ImageList_GetIcon(himl,index,ILD_NORMAL);
+ sid.hDefaultIcon = (hIcon != NULL) ? ResizeIconCentered(hIcon,sid.cx,sid.cy) : NULL;
+ if (hIcon != NULL)
+ DestroyIcon(hIcon);
+ index = CountryNumberToIndex(countries[i].id);
phIconHandles[index] = Skin_AddIcon(&sid);
- if(sid.hDefaultIcon!=NULL) DestroyIcon(sid.hDefaultIcon);
+ if (sid.hDefaultIcon != NULL)
+ DestroyIcon(sid.hDefaultIcon);
}
+ }
ImageList_Destroy(himl);
}
+
/* create services */
- hServiceLoadIcon=CreateServiceFunction(MS_FLAGS_LOADFLAGICON,ServiceLoadFlagIcon);
- hServiceCreateMergedIcon=CreateServiceFunction(MS_FLAGS_CREATEMERGEDFLAGICON,ServiceCreateMergedFlagIcon);
+ hServiceLoadIcon = CreateServiceFunction(MS_FLAGS_LOADFLAGICON, ServiceLoadFlagIcon);
+ hServiceCreateMergedIcon = CreateServiceFunction(MS_FLAGS_CREATEMERGEDFLAGICON, ServiceCreateMergedFlagIcon);
}
void UninitIcons(void)
diff --git a/plugins/Db_autobackups/main.cpp b/plugins/Db_autobackups/main.cpp
index c52b3ad199..f771261202 100644
--- a/plugins/Db_autobackups/main.cpp
+++ b/plugins/Db_autobackups/main.cpp
@@ -63,17 +63,16 @@ static int FoldersInit(void)
static void IcoLibInit(void)
{
- int i;
- SKINICONDESC sid = {0};
TCHAR tszFile[MAX_PATH];
GetModuleFileName(hInst, tszFile, MAX_PATH);
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.ptszDefaultFile = tszFile;
sid.ptszSection = _T("Database/Database Backups");
sid.flags = SIDF_ALL_TCHAR;
- for ( i = 0; i < SIZEOF(iconList); i++ ) {
+ for (int i = 0; i < SIZEOF(iconList); i++) {
sid.pszName = iconList[i].szName;
sid.ptszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
diff --git a/plugins/Dbx_mmap_SA/dialogs.cpp b/plugins/Dbx_mmap_SA/dialogs.cpp
index 4e51381d24..d690f477e0 100644
--- a/plugins/Dbx_mmap_SA/dialogs.cpp
+++ b/plugins/Dbx_mmap_SA/dialogs.cpp
@@ -98,18 +98,18 @@ static int ModulesLoad(WPARAM wParam, LPARAM lParam)
// icolib init
GetModuleFileName(g_hInst, szFile, MAX_PATH);
- sid.cbSize = sizeof(sid);
- sid.ptszDefaultFile = szFile;
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszSection = LPGENT("Database");
+ sid.cbSize = sizeof(sid);
+ sid.ptszDefaultFile = szFile;
+ sid.flags = SIDF_ALL_TCHAR;
+ sid.ptszSection = LPGENT("Database");
sid.ptszDescription = LPGENT("Database");
- sid.pszName = "database";
- sid.iDefaultIndex = -IDI_ICON2;
+ sid.pszName = "database";
+ sid.iDefaultIndex = -IDI_ICON2;
Skin_AddIcon(&sid);
sid.ptszDescription = LPGENT("Change Password");
- sid.pszName = "password";
- sid.iDefaultIndex = -IDI_ICON3;
+ sid.pszName = "password";
+ sid.iDefaultIndex = -IDI_ICON3;
Skin_AddIcon(&sid);
menu.cbSize = sizeof(menu);
diff --git a/plugins/ExtraIcons/src/options.cpp b/plugins/ExtraIcons/src/options.cpp
index 8308ac444c..83228a2a72 100644
--- a/plugins/ExtraIcons/src/options.cpp
+++ b/plugins/ExtraIcons/src/options.cpp
@@ -516,7 +516,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else
{
ImageList_AddIcon(hImageList, hIcon);
- IcoLib_ReleaseIcon(hIcon);
+ Skin_ReleaseIcon(hIcon);
}
}
TreeView_SetImageList(tree, hImageList, TVSIL_NORMAL);
diff --git a/plugins/ExtraIcons/src/usedIcons.cpp b/plugins/ExtraIcons/src/usedIcons.cpp
index de58069293..173117b865 100644
--- a/plugins/ExtraIcons/src/usedIcons.cpp
+++ b/plugins/ExtraIcons/src/usedIcons.cpp
@@ -62,7 +62,7 @@ static Icon * FindIcon(const char *icolibName)
if (icon->hImage == (HANDLE) -1)
icon->hImage = NULL;
- IcoLib_ReleaseIcon(hIcon);
+ Skin_ReleaseIcon(hIcon);
}
}
diff --git a/plugins/Gender/main.cpp b/plugins/Gender/main.cpp
index 62825459f6..5e5f1f4992 100644
--- a/plugins/Gender/main.cpp
+++ b/plugins/Gender/main.cpp
@@ -258,13 +258,14 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam)
if (bContactMenuItems) hHookPrebuildContactMenu = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu);
bMetaAvail = (ServiceExists(MS_MC_GETMETACONTACT) != 0);
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(g_hInst, szFile, MAX_PATH);
+
//IcoLib support
SKINICONDESC sid = {0};
sid.cbSize = sizeof(sid);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszSection = LPGENT("Gender");
- TCHAR szFile[MAX_PATH];
- GetModuleFileName(g_hInst, szFile, MAX_PATH);
sid.ptszDefaultFile = szFile;
sid.ptszDescription = LPGENT("Male");
diff --git a/plugins/HistorySweeperLight/options.cpp b/plugins/HistorySweeperLight/options.cpp
index f98f5dc67c..2963f8bb2b 100644
--- a/plugins/HistorySweeperLight/options.cpp
+++ b/plugins/HistorySweeperLight/options.cpp
@@ -62,20 +62,20 @@ static HANDLE hIconLibItem[SIZEOF(iconList)];
void InitIcons(void)
{
- int i; char szSettingName[100]; SKINICONDESC sid = {0}; TCHAR szFile[MAX_PATH];
-
+ TCHAR szFile[MAX_PATH];
GetModuleFileName(hInst, szFile, SIZEOF(szFile));
+ SKINICONDESC sid = { 0 };
sid.cbSize = sizeof(SKINICONDESC);
sid.ptszDefaultFile = szFile;
sid.cx = sid.cy = 16;
- sid.pszName = szSettingName;
sid.pszSection = ModuleName;
sid.flags = SIDF_PATH_TCHAR;
- for (i = 0; i < SIZEOF(iconList); i++)
- {
+ for (int i=0; i < SIZEOF(iconList); i++) {
+ char szSettingName[100];
mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", ModuleName, iconList[i].szName);
+ sid.pszName = szSettingName;
sid.pszDescription = (char*)iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
diff --git a/plugins/IgnoreState/main.cpp b/plugins/IgnoreState/main.cpp
index abc95bda11..c68e6f6d2d 100644
--- a/plugins/IgnoreState/main.cpp
+++ b/plugins/IgnoreState/main.cpp
@@ -197,7 +197,6 @@ static VOID init_icolib (void)
sid.iDefaultIndex = -iconList[i].defIconID;
iconList[i].hIconLibItem = Skin_AddIcon(&sid);
}
-// hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, onExtraImageListRebuild);
}
VOID fill_filter(void)
diff --git a/plugins/ListeningTo/listeningto.cpp b/plugins/ListeningTo/listeningto.cpp
index 0a6fecb66c..36df33520f 100644
--- a/plugins/ListeningTo/listeningto.cpp
+++ b/plugins/ListeningTo/listeningto.cpp
@@ -313,8 +313,8 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
// add our modules to the KnownModules list
CallService("DBEditorpp/RegisterSingleModule", (WPARAM) MODULE_NAME, 0);
- hIcon1 = IcoLib_Register("listening_to_icon", _T("ListeningTo"), _T("Listening to (enabled)"), IDI_LISTENINGTO);
- hIcon2 = IcoLib_Register("listening_off_icon", _T("ListeningTo"), _T("Listening to (disabled)"), IDI_LISTENINGOFF);
+ hIcon1 = IcoLib_Register("listening_to_icon", "ListeningTo", "Listening to (enabled)", IDI_LISTENINGTO);
+ hIcon2 = IcoLib_Register("listening_off_icon", "ListeningTo", "Listening to (disabled)", IDI_LISTENINGOFF);
// Extra icon support
hExtraIcon = ExtraIcon_Register(MODULE_NAME, "Listening to music", "listening_to_icon");
diff --git a/plugins/MenuItemEx/main.cpp b/plugins/MenuItemEx/main.cpp
index 3b24d1e0f9..ed053b2223 100644
--- a/plugins/MenuItemEx/main.cpp
+++ b/plugins/MenuItemEx/main.cpp
@@ -233,17 +233,16 @@ void RenameDbProto(HANDLE hContact, HANDLE hContactNew, char* oldName, char* new
static void IconsInit()
{
int i;
- SKINICONDESC sid = {0};
TCHAR tszFile[MAX_PATH];
GetModuleFileName(hinstance, tszFile, MAX_PATH);
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.flags = SIDF_ALL_TCHAR;
sid.ptszDefaultFile = tszFile;
sid.cx = sid.cy = 16;
sid.ptszSection = LPGENT(MODULENAME);
-
for ( i = 0; i < SIZEOF(iconList); i++ ) {
sid.pszName = iconList[i].szName;
sid.ptszDescription = iconList[i].szDescr;
diff --git a/plugins/MetaContacts/icons.cpp b/plugins/MetaContacts/icons.cpp
index 829636be1f..e6cbc9a3a3 100644
--- a/plugins/MetaContacts/icons.cpp
+++ b/plugins/MetaContacts/icons.cpp
@@ -1,8 +1,5 @@
#include "metacontacts.h"
-HANDLE hIcoLibIconsChanged = NULL;
-
-
typedef struct {
char* szDescr;
char* szName;
@@ -20,26 +17,18 @@ static IconStruct iconList[] = {
};
-HICON LoadIconEx(IconIndex i) {
- HICON hIcon;
-
- if (hIcoLibIconsChanged)
- hIcon = (HICON)CallService(MS_SKIN2_GETICON, 0, (LPARAM)iconList[(int)i].szName);
- else
- hIcon = (HICON)LoadImage(hInstance, MAKEINTRESOURCE(iconList[(int)i].defIconID), IMAGE_ICON, 0, 0, 0);
-
- return hIcon;
+HICON LoadIconEx(IconIndex i)
+{
+ return Skin_GetIcon(iconList[i].szName);
}
-
-void ReleaseIconEx(HICON hIcon) {
- if (hIcoLibIconsChanged)
- CallService(MS_SKIN2_RELEASEICON, (WPARAM)hIcon, 0);
- else
- DestroyIcon(hIcon);
+void ReleaseIconEx(HICON hIcon)
+{
+ Skin_ReleaseIcon(hIcon);
}
-int ReloadIcons(WPARAM wParam, LPARAM lParam) {
+int ReloadIcons(WPARAM wParam, LPARAM lParam)
+{
// fix menu icons
CLISTMENUITEM menu = {0};
@@ -73,29 +62,24 @@ int ReloadIcons(WPARAM wParam, LPARAM lParam) {
return 0;
}
-void InitIcons(void) {
+void InitIcons(void)
+{
+ TCHAR path[MAX_PATH];
+ GetModuleFileName(hInstance, path, SIZEOF(path));
+
SKINICONDESC sid = {0};
- char path[MAX_PATH];
- int i;
-
sid.cbSize = sizeof(SKINICONDESC);
sid.pszSection = META_PROTO;
sid.pszDefaultFile = path;
- GetModuleFileName(hInstance, path, sizeof(path));
- for (i = 0; i < sizeof(iconList) / sizeof(IconStruct); ++i)
- {
- sid.pszDescription = Translate(iconList[i].szDescr);
+ for (int i=0; i < SIZEOF(iconList); ++i) {
+ sid.pszDescription = iconList[i].szDescr;
sid.pszName = iconList[i].szName;
sid.iDefaultIndex = -iconList[i].defIconID;
Skin_AddIcon(&sid);
}
- hIcoLibIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
+ HookEvent(ME_SKIN2_ICONSCHANGED, ReloadIcons);
ReloadIcons(0, 0);
}
-
-void DeinitIcons(void) {
- if (hIcoLibIconsChanged) UnhookEvent(hIcoLibIconsChanged);
-}
diff --git a/plugins/MetaContacts/meta_services.cpp b/plugins/MetaContacts/meta_services.cpp
index 1fe1d9af4d..94aea51fc9 100644
--- a/plugins/MetaContacts/meta_services.cpp
+++ b/plugins/MetaContacts/meta_services.cpp
@@ -2072,6 +2072,4 @@ void Meta_CloseHandles()
// lets leave them, hey? (why?)
for (i=0;i<NB_SERVICES;i++) // Scan each 'HANDLE' and Destroy the service attached to it.
if (hServices[i]) DestroyServiceFunction(hServices[i]);
-
- DeinitIcons();
}
diff --git a/plugins/MetaContacts/metacontacts.h b/plugins/MetaContacts/metacontacts.h
index 762bd17b8d..b0c896c5f8 100644
--- a/plugins/MetaContacts/metacontacts.h
+++ b/plugins/MetaContacts/metacontacts.h
@@ -62,6 +62,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <m_langpack.h>
#include <m_popup.h>
#include <m_cluiframes.h>
+#include <win2k.h>
#define META_PROTO "MetaContacts"
#define META_FILTER "MetaContactsFilter"
@@ -224,7 +225,6 @@ INT_PTR MyDBGetContactSetting(HANDLE hContact, const char *szModule, const char
// IcoLib support
void InitIcons(void);
-void DeinitIcons(void);
typedef enum {I_MENUOFF, I_MENU, I_CONVERT, I_ADD, I_EDIT, I_SETDEFAULT, I_REMOVE} IconIndex;
HICON LoadIconEx(IconIndex i);
diff --git a/plugins/SRMM/globals.cpp b/plugins/SRMM/globals.cpp
index 802bc9fccc..e6d0175f1c 100644
--- a/plugins/SRMM/globals.cpp
+++ b/plugins/SRMM/globals.cpp
@@ -28,8 +28,8 @@ static int AvatarChanged(WPARAM wParam, LPARAM lParam);
typedef struct IconDefStruct
{
- const char *szName;
- const char *szDescr;
+ char *szName;
+ char *szDescr;
int defIconID;
} IconList;
@@ -45,13 +45,12 @@ HANDLE hIconLibItem[SIZEOF(iconList)];
static void InitIcons(void)
{
- TCHAR szFile[MAX_PATH];
char szSettingName[100];
- SKINICONDESC sid = {0};
- unsigned i;
+ TCHAR szFile[MAX_PATH];
GetModuleFileName(g_hInst, szFile, SIZEOF(szFile));
+ SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
sid.ptszDefaultFile = szFile;
sid.pszName = szSettingName;
@@ -59,10 +58,9 @@ static void InitIcons(void)
sid.flags = SIDF_PATH_TCHAR;
sid.cx = 10; sid.cy = 10;
- for (i = 0; i < SIZEOF(iconList); i++)
- {
+ for (int i=0; i < SIZEOF(iconList); i++) {
mir_snprintf(szSettingName, sizeof(szSettingName), "SRMM_%s", iconList[i].szName);
- sid.pszDescription = (char*)iconList[i].szDescr;
+ sid.pszDescription = iconList[i].szDescr;
sid.iDefaultIndex = -iconList[i].defIconID;
hIconLibItem[i] = Skin_AddIcon(&sid);
}
diff --git a/plugins/Scriver/globals.cpp b/plugins/Scriver/globals.cpp
index a9cfb0bf47..9a81ebcdbb 100644
--- a/plugins/Scriver/globals.cpp
+++ b/plugins/Scriver/globals.cpp
@@ -45,64 +45,64 @@ static const char *chatButtonIcons[] = {"scriver_CLOSEX",
typedef struct IconDefStruct
{
- const TCHAR* section;
- const char *name;
- int defaultIndex;
- const TCHAR *description;
+ char* section;
+ char *name;
+ int defaultIndex;
+ char *description;
int size;
} IconDef;
static const IconDef iconList[] = {
- {LPGENT("Single Messaging"), "scriver_ADD", IDI_ADDCONTACT, LPGENT("Add contact")},
- {LPGENT("Single Messaging"), "scriver_USERDETAILS", IDI_USERDETAILS, LPGENT("User's details")},
- {LPGENT("Single Messaging"), "scriver_HISTORY", IDI_HISTORY, LPGENT("User's history")},
- {LPGENT("Single Messaging"), "scriver_SEND", IDI_SEND, LPGENT("Send message")},
- {LPGENT("Single Messaging"), "scriver_SMILEY", IDI_SMILEY, LPGENT("Smiley button")},
- {LPGENT("Single Messaging"), "scriver_TYPING", IDI_TYPING, LPGENT("User is typing")},
- {LPGENT("Single Messaging"), "scriver_TYPINGOFF", IDI_TYPINGOFF, LPGENT("Typing notification off")},
- {LPGENT("Single Messaging"), "scriver_UNICODEON", IDI_UNICODEON, LPGENT("Unicode is on")},
- {LPGENT("Single Messaging"), "scriver_UNICODEOFF", IDI_UNICODEOFF, LPGENT("Unicode is off")},
- {LPGENT("Single Messaging"), "scriver_DELIVERING", IDI_TIMESTAMP, LPGENT("Sending")},
- {LPGENT("Single Messaging"), "scriver_QUOTE", IDI_QUOTE, LPGENT("Quote button")},
- {LPGENT("Single Messaging"), "scriver_CLOSEX", IDI_CLOSEX, LPGENT("Close button")},
- {LPGENT("Single Messaging"), "scriver_OVERLAY", IDI_OVERLAY, LPGENT("Icon overlay")},
- {LPGENT("Single Messaging"), "scriver_INCOMING", IDI_INCOMING, LPGENT("Incoming message (10x10)"),10},
- {LPGENT("Single Messaging"), "scriver_OUTGOING", IDI_OUTGOING, LPGENT("Outgoing message (10x10)"),10},
- {LPGENT("Single Messaging"), "scriver_NOTICE", IDI_NOTICE, LPGENT("Notice (10x10)"),10},
- {LPGENT("Group Chats"), "chat_window", IDI_CHANMGR, LPGENT("Window Icon")},
- {LPGENT("Group Chats"), "chat_fgcol", IDI_COLOR, LPGENT("Text colour")},
- {LPGENT("Group Chats"), "chat_bkgcol", IDI_BKGCOLOR, LPGENT("Background colour")},
- {LPGENT("Group Chats"), "chat_bold", IDI_BBOLD, LPGENT("Bold")},
- {LPGENT("Group Chats"), "chat_italics", IDI_BITALICS, LPGENT("Italics")},
- {LPGENT("Group Chats"), "chat_underline", IDI_BUNDERLINE, LPGENT("Underlined")},
- {LPGENT("Group Chats"), "chat_smiley", IDI_SMILEY, LPGENT("Smiley button")},
- {LPGENT("Group Chats"), "chat_history", IDI_HISTORY, LPGENT("Room history")},
- {LPGENT("Group Chats"), "chat_settings", IDI_TOPICBUT, LPGENT("Room settings")},
- {LPGENT("Group Chats"), "chat_filter", IDI_FILTER, LPGENT("Event filter disabled")},
- {LPGENT("Group Chats"), "chat_filter2", IDI_FILTER2, LPGENT("Event filter enabled")},
- {LPGENT("Group Chats"), "chat_nicklist", IDI_NICKLIST, LPGENT("Hide userlist")},
- {LPGENT("Group Chats"), "chat_nicklist2", IDI_NICKLIST2, LPGENT("Show userlist")},
- {LPGENT("Group Chats"), "chat_overlay", IDI_OVERLAY, LPGENT("Icon overlay")},
- {LPGENT("Group Chats"), "chat_status0", IDI_STATUS0, LPGENT("Status 1 (10x10)"),10},
- {LPGENT("Group Chats"), "chat_status1", IDI_STATUS1, LPGENT("Status 2 (10x10"),10},
- {LPGENT("Group Chats"), "chat_status2", IDI_STATUS2, LPGENT("Status 3 (10x10)"),10},
- {LPGENT("Group Chats"), "chat_status3", IDI_STATUS3, LPGENT("Status 4 (10x10)"),10},
- {LPGENT("Group Chats"), "chat_status4", IDI_STATUS4, LPGENT("Status 5 (10x10)"),10},
- {LPGENT("Group Chats"), "chat_status5", IDI_STATUS5, LPGENT("Status 6 (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_message_in", IDI_INCOMING, LPGENT("Message in (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_message_out", IDI_OUTGOING, LPGENT("Message out (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_action", IDI_ACTION, LPGENT("Action (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_addstatus", IDI_ADDSTATUS, LPGENT("Add Status (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_removestatus", IDI_REMSTATUS, LPGENT("Remove status (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_join", IDI_JOIN, LPGENT("Join (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_part", IDI_PART, LPGENT("Leave (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_quit", IDI_QUIT, LPGENT("Quit (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_kick", IDI_KICK, LPGENT("Kick (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_nick", IDI_NICK, LPGENT("Nickchange (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_notice", IDI_CHAT_NOTICE, LPGENT("Notice (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_topic", IDI_TOPIC, LPGENT("Topic (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_highlight", IDI_NOTICE, LPGENT("Highlight (10x10)"),10},
- {LPGENT("Group Chats Log"), "chat_log_info", IDI_INFO, LPGENT("Information (10x10)"),10}
+ {LPGEN("Single Messaging"), "scriver_ADD", IDI_ADDCONTACT, LPGEN("Add contact")},
+ {LPGEN("Single Messaging"), "scriver_USERDETAILS", IDI_USERDETAILS, LPGEN("User's details")},
+ {LPGEN("Single Messaging"), "scriver_HISTORY", IDI_HISTORY, LPGEN("User's history")},
+ {LPGEN("Single Messaging"), "scriver_SEND", IDI_SEND, LPGEN("Send message")},
+ {LPGEN("Single Messaging"), "scriver_SMILEY", IDI_SMILEY, LPGEN("Smiley button")},
+ {LPGEN("Single Messaging"), "scriver_TYPING", IDI_TYPING, LPGEN("User is typing")},
+ {LPGEN("Single Messaging"), "scriver_TYPINGOFF", IDI_TYPINGOFF, LPGEN("Typing notification off")},
+ {LPGEN("Single Messaging"), "scriver_UNICODEON", IDI_UNICODEON, LPGEN("Unicode is on")},
+ {LPGEN("Single Messaging"), "scriver_UNICODEOFF", IDI_UNICODEOFF, LPGEN("Unicode is off")},
+ {LPGEN("Single Messaging"), "scriver_DELIVERING", IDI_TIMESTAMP, LPGEN("Sending")},
+ {LPGEN("Single Messaging"), "scriver_QUOTE", IDI_QUOTE, LPGEN("Quote button")},
+ {LPGEN("Single Messaging"), "scriver_CLOSEX", IDI_CLOSEX, LPGEN("Close button")},
+ {LPGEN("Single Messaging"), "scriver_OVERLAY", IDI_OVERLAY, LPGEN("Icon overlay")},
+ {LPGEN("Single Messaging"), "scriver_INCOMING", IDI_INCOMING, LPGEN("Incoming message (10x10)"),10},
+ {LPGEN("Single Messaging"), "scriver_OUTGOING", IDI_OUTGOING, LPGEN("Outgoing message (10x10)"),10},
+ {LPGEN("Single Messaging"), "scriver_NOTICE", IDI_NOTICE, LPGEN("Notice (10x10)"),10},
+ {LPGEN("Group Chats"), "chat_window", IDI_CHANMGR, LPGEN("Window Icon")},
+ {LPGEN("Group Chats"), "chat_fgcol", IDI_COLOR, LPGEN("Text colour")},
+ {LPGEN("Group Chats"), "chat_bkgcol", IDI_BKGCOLOR, LPGEN("Background colour")},
+ {LPGEN("Group Chats"), "chat_bold", IDI_BBOLD, LPGEN("Bold")},
+ {LPGEN("Group Chats"), "chat_italics", IDI_BITALICS, LPGEN("Italics")},
+ {LPGEN("Group Chats"), "chat_underline", IDI_BUNDERLINE, LPGEN("Underlined")},
+ {LPGEN("Group Chats"), "chat_smiley", IDI_SMILEY, LPGEN("Smiley button")},
+ {LPGEN("Group Chats"), "chat_history", IDI_HISTORY, LPGEN("Room history")},
+ {LPGEN("Group Chats"), "chat_settings", IDI_TOPICBUT, LPGEN("Room settings")},
+ {LPGEN("Group Chats"), "chat_filter", IDI_FILTER, LPGEN("Event filter disabled")},
+ {LPGEN("Group Chats"), "chat_filter2", IDI_FILTER2, LPGEN("Event filter enabled")},
+ {LPGEN("Group Chats"), "chat_nicklist", IDI_NICKLIST, LPGEN("Hide userlist")},
+ {LPGEN("Group Chats"), "chat_nicklist2", IDI_NICKLIST2, LPGEN("Show userlist")},
+ {LPGEN("Group Chats"), "chat_overlay", IDI_OVERLAY, LPGEN("Icon overlay")},
+ {LPGEN("Group Chats"), "chat_status0", IDI_STATUS0, LPGEN("Status 1 (10x10)"),10},
+ {LPGEN("Group Chats"), "chat_status1", IDI_STATUS1, LPGEN("Status 2 (10x10"),10},
+ {LPGEN("Group Chats"), "chat_status2", IDI_STATUS2, LPGEN("Status 3 (10x10)"),10},
+ {LPGEN("Group Chats"), "chat_status3", IDI_STATUS3, LPGEN("Status 4 (10x10)"),10},
+ {LPGEN("Group Chats"), "chat_status4", IDI_STATUS4, LPGEN("Status 5 (10x10)"),10},
+ {LPGEN("Group Chats"), "chat_status5", IDI_STATUS5, LPGEN("Status 6 (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_message_in", IDI_INCOMING, LPGEN("Message in (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_message_out", IDI_OUTGOING, LPGEN("Message out (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_action", IDI_ACTION, LPGEN("Action (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_addstatus", IDI_ADDSTATUS, LPGEN("Add Status (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_removestatus", IDI_REMSTATUS, LPGEN("Remove status (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_join", IDI_JOIN, LPGEN("Join (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_part", IDI_PART, LPGEN("Leave (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_quit", IDI_QUIT, LPGEN("Quit (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_kick", IDI_KICK, LPGEN("Kick (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_nick", IDI_NICK, LPGEN("Nickchange (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_notice", IDI_CHAT_NOTICE, LPGEN("Notice (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_topic", IDI_TOPIC, LPGEN("Topic (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_highlight", IDI_NOTICE, LPGEN("Highlight (10x10)"),10},
+ {LPGEN("Group Chats Log"), "chat_log_info", IDI_INFO, LPGEN("Information (10x10)"),10}
};
HICON hIconList[SIZEOF(iconList)];
@@ -154,22 +154,23 @@ int ImageList_AddIcon_ProtoEx(HIMAGELIST hIml, const char* szProto, int status)
void RegisterIcons(void)
{
- SKINICONDESC sid = { 0 };
- TCHAR path[MAX_PATH];
- TCHAR tTemp[500];
- int i;
hEventSkin2IconsChanged = HookEvent_Ex(ME_SKIN2_ICONSCHANGED, IconsChanged);
+
+ TCHAR path[MAX_PATH];
+ char szSection[200];
GetModuleFileName(g_hInst, path, MAX_PATH);
+
+ SKINICONDESC sid = { 0 };
sid.cbSize = sizeof(SKINICONDESC);
- sid.flags = SIDF_ALL_TCHAR;
+ sid.flags = SIDF_PATH_TCHAR;
sid.ptszDefaultFile = path;
- sid.ptszSection = tTemp;
- for (i = 0; i < SIZEOF(iconList); i++) {
- mir_sntprintf(tTemp, SIZEOF(tTemp), _T("%s/%s"), LPGENT("Messaging"), iconList[i].section);
+ sid.pszSection = szSection;
+ for (int i = 0; i < SIZEOF(iconList); i++) {
+ mir_snprintf(szSection, SIZEOF(szSection), "%s/%s", LPGEN("Messaging"), iconList[i].section);
sid.pszName = (char*)iconList[i].name;
sid.cx = sid.cy = iconList[i].size;
sid.iDefaultIndex = -iconList[i].defaultIndex;
- sid.ptszDescription = (TCHAR*)iconList[i].description;
+ sid.pszDescription = iconList[i].description;
Skin_AddIcon(&sid);
}
}
diff --git a/plugins/SpellChecker/ardialog.cpp b/plugins/SpellChecker/ardialog.cpp
index dc8a24cd43..6a08585ea1 100644
--- a/plugins/SpellChecker/ardialog.cpp
+++ b/plugins/SpellChecker/ardialog.cpp
@@ -193,7 +193,7 @@ static INT_PTR CALLBACK AddReplacementDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
HICON hIcon = IcoLib_LoadIcon("spellchecker_enabled");
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM) hIcon);
- IcoLib_ReleaseIcon(hIcon);
+ Skin_ReleaseIcon(hIcon);
SendDlgItemMessage(hwndDlg, IDC_OLD, EM_LIMITTEXT, 256, 0);
SendDlgItemMessage(hwndDlg, IDC_NEW, EM_LIMITTEXT, 256, 0);
diff --git a/plugins/SpellChecker/options.cpp b/plugins/SpellChecker/options.cpp
index 4c8b299266..28886b1126 100644
--- a/plugins/SpellChecker/options.cpp
+++ b/plugins/SpellChecker/options.cpp
@@ -175,7 +175,7 @@ static void DrawItem(HWND hwndDlg, LPDRAWITEMSTRUCT lpdis, Dictionary *dict)
rc.left += ICON_SIZE + 4;
- IcoLib_ReleaseIcon(hFlag);
+ Skin_ReleaseIcon(hFlag);
}
// Draw text
diff --git a/plugins/SpellChecker/spellchecker.cpp b/plugins/SpellChecker/spellchecker.cpp
index f11ad5b2fb..a126070604 100644
--- a/plugins/SpellChecker/spellchecker.cpp
+++ b/plugins/SpellChecker/spellchecker.cpp
@@ -250,7 +250,7 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
if (hFlag != NULL)
{
// Already registered
- IcoLib_ReleaseIcon(hFlag);
+ Skin_ReleaseIcon(hFlag);
continue;
}
@@ -2135,7 +2135,7 @@ LRESULT CALLBACK MenuWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
rc.top = (lpdis->rcItem.bottom + lpdis->rcItem.top - ICON_SIZE) / 2;
DrawIconEx(lpdis->hDC, rc.left, rc.top, hFlag, 16, 16, 0, NULL, DI_NORMAL);
- IcoLib_ReleaseIcon(hFlag);
+ Skin_ReleaseIcon(hFlag);
rc.left += ICON_SIZE + 4;
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index 4593a3ea43..1a5a9780d0 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -1046,26 +1046,27 @@ static int GetIconPackVersion(HMODULE hDLL)
static int TSAPI SetupIconLibConfig()
{
- SKINICONDESC sid = { 0 };
- char szFilename[MAX_PATH];
int i = 0, j = 2, version = 0, n = 0;
- strncpy(szFilename, "icons\\tabsrmm_icons.dll", MAX_PATH);
- g_hIconDLL = LoadLibraryA(szFilename);
+ TCHAR szFilename[MAX_PATH];
+ _tcsncpy(szFilename, _T("icons\\tabsrmm_icons.dll"), MAX_PATH);
+ g_hIconDLL = LoadLibrary(szFilename);
if (g_hIconDLL == 0) {
CWarning::show(CWarning::WARN_ICONPACKMISSING, CWarning::CWF_NOALLOWHIDE|MB_ICONERROR|MB_OK);
return 0;
}
- GetModuleFileNameA(g_hIconDLL, szFilename, MAX_PATH);
+ GetModuleFileName(g_hIconDLL, szFilename, MAX_PATH);
if (PluginConfig.m_chat_enabled)
Chat_AddIcons();
version = GetIconPackVersion(g_hIconDLL);
FreeLibrary(g_hIconDLL);
g_hIconDLL = 0;
+ SKINICONDESC sid = { 0 };
sid.cbSize = sizeof(SKINICONDESC);
- sid.pszDefaultFile = szFilename;
+ sid.ptszDefaultFile = szFilename;
+ sid.flags = SIDF_PATH_TCHAR;
while (ICONBLOCKS[n].szSection) {
i = 0;
@@ -1075,7 +1076,7 @@ static int TSAPI SetupIconLibConfig()
sid.pszDescription = ICONBLOCKS[n].idesc[i].szDesc;
sid.iDefaultIndex = ICONBLOCKS[n].idesc[i].uId == -IDI_HISTORY ? 0 : ICONBLOCKS[n].idesc[i].uId; // workaround problem /w icoLib and a resource id of 1 (actually, a Windows problem)
i++;
- if (n>0&&n<4)
+ if (n > 0 && n < 4)
PluginConfig.g_buttonBarIconHandles[j++] = Skin_AddIcon(&sid);
else
Skin_AddIcon(&sid);
@@ -1084,13 +1085,12 @@ static int TSAPI SetupIconLibConfig()
}
sid.pszSection = "TabSRMM/Default";
-
sid.pszName = "tabSRMM_clock_symbol";
sid.pszDescription = "Clock symbol (for the info panel clock)";
sid.iDefaultIndex = -IDI_CLOCK;
Skin_AddIcon(&sid);
- strncpy(szFilename, "plugins\\tabsrmm.dll", MAX_PATH);
+ _tcsncpy(szFilename, _T("plugins\\tabsrmm.dll"), MAX_PATH);
sid.pszName = "tabSRMM_overlay_disabled";
sid.pszDescription = "Feature disabled (used as overlay)";
@@ -1101,8 +1101,6 @@ static int TSAPI SetupIconLibConfig()
sid.pszDescription = "Feature enabled (used as overlay)";
sid.iDefaultIndex = -IDI_FEATURE_ENABLED;
Skin_AddIcon(&sid);
-
-
return 1;
}
diff --git a/plugins/Utils/mir_icons.cpp b/plugins/Utils/mir_icons.cpp
index bab0674d35..00adda0614 100644
--- a/plugins/Utils/mir_icons.cpp
+++ b/plugins/Utils/mir_icons.cpp
@@ -29,15 +29,11 @@ extern HINSTANCE hInst;
HICON IcoLib_LoadIcon(const char *iconName, BOOL copy)
{
- if (!ServiceExists(MS_SKIN2_GETICON))
- return NULL;
-
if (iconName == NULL || iconName[0] == 0)
return NULL;
HICON hIcon = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) iconName);
- if (copy && hIcon != NULL)
- {
+ if (copy && hIcon != NULL) {
hIcon = CopyIcon(hIcon);
CallService(MS_SKIN2_RELEASEICON, (WPARAM) hIcon, 0);
}
@@ -46,40 +42,30 @@ HICON IcoLib_LoadIcon(const char *iconName, BOOL copy)
void IcoLib_ReleaseIcon(const char *iconName)
{
- if (ServiceExists(MS_SKIN2_RELEASEICON))
- CallService(MS_SKIN2_RELEASEICON, 0, (LPARAM) iconName);
+ CallService(MS_SKIN2_RELEASEICON, 0, (LPARAM) iconName);
}
-
void IcoLib_ReleaseIcon(HICON hIcon)
{
- if (ServiceExists(MS_SKIN2_RELEASEICON))
- CallService(MS_SKIN2_RELEASEICON, (WPARAM) hIcon, 0);
+ CallService(MS_SKIN2_RELEASEICON, (WPARAM) hIcon, 0);
}
-
-HANDLE IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id)
+HANDLE IcoLib_Register(char *name, char *section, char *description, int id)
{
- HICON hIcon = (HICON) CallService(MS_SKIN2_GETICON, 0, (LPARAM) name);
- if (hIcon != NULL) {
- CallService(MS_SKIN2_RELEASEICON, (WPARAM) hIcon, 0);
- return NULL;
- }
+ HANDLE hIcon = Skin_GetIconHandle(name);
+ if (hIcon != NULL)
+ return hIcon;
+
+ TCHAR tszFile[MAX_PATH];
+ GetModuleFileName(hInst, tszFile, MAX_PATH);
SKINICONDESC sid = {0};
sid.cbSize = sizeof(SKINICONDESC);
- sid.flags = SIDF_TCHAR;
+ sid.flags = SIDF_PATH_TCHAR;
sid.pszName = name;
- sid.ptszSection = section;
- sid.ptszDescription = description;
-
- int cx = GetSystemMetrics(SM_CXSMICON);
- sid.hDefaultIcon = (HICON) LoadImage(hInst, MAKEINTRESOURCE(id), IMAGE_ICON, cx, cx, LR_DEFAULTCOLOR | LR_SHARED);
- HANDLE hRes = Skin_AddIcon(&sid);
-
- if (sid.hDefaultIcon)
- DestroyIcon(sid.hDefaultIcon);
-
- return hRes;
+ sid.pszSection = section;
+ sid.pszDescription = description;
+ sid.ptszDefaultFile = tszFile;
+ sid.iDefaultIndex = -id;
+ return Skin_AddIcon(&sid);
}
-
diff --git a/plugins/Utils/mir_icons.h b/plugins/Utils/mir_icons.h
index e1e1a918a3..7e88d5f61c 100644
--- a/plugins/Utils/mir_icons.h
+++ b/plugins/Utils/mir_icons.h
@@ -23,10 +23,8 @@ Boston, MA 02111-1307, USA.
#define _CRT_SECURE_NO_WARNINGS
-HANDLE IcoLib_Register(char *name, TCHAR *section, TCHAR *description, int id);
+HANDLE IcoLib_Register(char *name, char *section, char *description, int id);
HICON IcoLib_LoadIcon(const char *iconName, BOOL copy = FALSE);
-void IcoLib_ReleaseIcon(const char *iconName);
-void IcoLib_ReleaseIcon(HICON hIcon);
#endif // __MIR_ICONS_H__
diff --git a/plugins/Utils/mir_options.cpp b/plugins/Utils/mir_options.cpp
index 493f01f527..ad3322e38a 100644
--- a/plugins/Utils/mir_options.cpp
+++ b/plugins/Utils/mir_options.cpp
@@ -581,7 +581,7 @@ INT_PTR CALLBACK SaveOptsDlgProc(OptPageControl *controls, int controlsSize, cha
{
NMLISTVIEW *nmlv = (NMLISTVIEW *)lParam;
- if(IsWindowVisible(GetDlgItem(hwndDlg, ctrl->nID)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK))
+ if (IsWindowVisible(GetDlgItem(hwndDlg, ctrl->nID)) && ((nmlv->uNewState ^ nmlv->uOldState) & LVIS_STATEIMAGEMASK))
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;