From e5cb033463036b182fb6e5e3eed50a14987f5300 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 7 Jun 2015 18:19:34 +0000 Subject: SKINICONDESC -> MAllStrings git-svn-id: http://svn.miranda-ng.org/main/trunk@14054 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- include/delphi/m_icolib.inc | 1 - include/m_icolib.h | 29 +++++++------------------ plugins/Actman/actman.dpr | 3 +-- plugins/Actman/iac_service.pas | 5 ++--- plugins/Actman/ua/i_uaplaces.inc | 3 --- plugins/AutoShutdown/src/utils.cpp | 14 ++++++------ plugins/CSList/src/cslist.cpp | 8 +++---- plugins/Clist_modern/src/modern_clc.cpp | 16 +++++++------- plugins/Clist_modern/src/modern_clui.cpp | 8 +++---- plugins/CountryFlags/src/icons.cpp | 6 ++--- plugins/FingerprintNG/src/fingerprint.cpp | 8 +++---- plugins/HistoryPlusPlus/hpp_options.pas | 1 - plugins/HistoryStats/src/mu_common.cpp | 21 +++++++----------- plugins/Popup/src/notifications.cpp | 6 ++--- plugins/QuickMessages/src/Utils.cpp | 8 +++---- plugins/QuickSearch/quicksearch.dpr | 1 - plugins/SecureIM/src/loadicons.cpp | 10 ++++----- plugins/SpellChecker/src/spellchecker.cpp | 10 ++++----- plugins/TabSRMM/src/msgs.cpp | 16 +++++++------- plugins/TopToolBar/src/toolbar.cpp | 9 ++++---- plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp | 8 +++---- plugins/UserInfoEx/src/classPsTreeItem.cpp | 10 ++++----- plugins/UserInfoEx/src/mir_icolib.cpp | 16 +++++++------- plugins/Utils.pas/mirutils.pas | 1 - plugins/Utils.pas/sedit.pas | 11 +++++----- plugins/Watrack/lastfm/lastfm.pas | 1 - plugins/Watrack/myshows/myshows.pas | 1 - plugins/Watrack/popup/popups.pas | 1 - plugins/Watrack/proto/proto.pas | 1 - plugins/Watrack/stat/statlog.pas | 1 - plugins/Watrack/waticons.pas | 8 ++----- plugins/WhenWasIt/src/icons.cpp | 8 +++---- plugins/mRadio/i_visual.inc | 1 - protocols/IcqOscarJ/src/icq_xstatus.cpp | 8 +++---- protocols/JabberG/src/jabber_icolib.cpp | 16 +++++++------- protocols/MRA/src/MraIcons.cpp | 8 +++---- protocols/MSN/src/msn_skypeab.cpp | 4 ++-- protocols/SkypeWeb/src/skype_icons.cpp | 8 +++---- protocols/Steam/src/steam_proto.cpp | 11 +++++----- protocols/Tox/src/tox_icons.cpp | 8 +++---- protocols/WhatsApp/src/proto.cpp | 6 ++--- protocols/Yahoo/src/version.h | 2 +- src/mir_core/src/icons.cpp | 16 +++++++------- src/modules/clist/genmenu.cpp | 6 ++--- src/modules/icolib/skin2icons.cpp | 21 ++++++++---------- src/modules/skin/skinicons.cpp | 28 ++++++++++++------------ 46 files changed, 176 insertions(+), 217 deletions(-) diff --git a/include/delphi/m_icolib.inc b/include/delphi/m_icolib.inc index cb033101d0..f20a919b17 100644 --- a/include/delphi/m_icolib.inc +++ b/include/delphi/m_icolib.inc @@ -7,7 +7,6 @@ type // Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl". PSKINICONDESC = ^TSKINICONDESC; TSKINICONDESC = record - cbSize :int; szSection :TChar; // [TRANSLATED-BY-CORE] section name used to group icons szDescription :TChar; // [TRANSLATED-BY-CORE] description for options dialog pszName :PAnsiChar; // name to refer to icon when playing and in db diff --git a/include/m_icolib.h b/include/m_icolib.h index a684e53336..de1c388b53 100644 --- a/include/m_icolib.h +++ b/include/m_icolib.h @@ -33,27 +33,14 @@ extern int hLangpack; // Use LPGEN instead which are just dummy wrappers/markers for "lpgen.pl". typedef struct { - size_t cbSize; - union { - char *pszSection; // section name used to group icons - TCHAR *ptszSection; // [TRANSLATED-BY-CORE] - WCHAR *pwszSection; - }; - union { - char *pszDescription; // description for options dialog - TCHAR *ptszDescription; // [TRANSLATED-BY-CORE] - WCHAR *pwszDescription; - }; - char *pszName; // name to refer to icon when playing and in db - union { - char *pszDefaultFile; // default icon file to use - TCHAR *ptszDefaultFile; - WCHAR *pwszDefaultFile; - }; - int iDefaultIndex; // index of icon in default file - HICON hDefaultIcon; // handle to default icon - int cx,cy; // dimensions of icon (if 0 then standard size icon (big and small options available) - int flags; // combination of SIDF_* + MAllStrings section; // section name used to group icons + MAllStrings description; // description for options dialog + char *pszName; // name to refer to icon when playing and in db + MAllStrings defaultFile; // default icon file to use + int iDefaultIndex; // index of icon in default file + HICON hDefaultIcon; // handle to default icon + int cx,cy; // dimensions of icon (if 0 then standard size icon (big and small options available) + int flags; // combination of SIDF_* } SKINICONDESC; #define SIDF_SORTED 0x01 // Icons in section are sorted by name diff --git a/plugins/Actman/actman.dpr b/plugins/Actman/actman.dpr index f66f265381..f9eee181cb 100644 --- a/plugins/Actman/actman.dpr +++ b/plugins/Actman/actman.dpr @@ -122,7 +122,6 @@ var // ii:tIconItem; begin FillChar(sid,SizeOf(sid),0); - sid.cbSize:=SizeOf(sid); sid.cx:=16; sid.cy:=16; sid.szSection.a:='Actions'; @@ -192,7 +191,7 @@ begin LoadMacros; RegisterIcons; - + HookEvent(ME_OPT_INITIALISE ,@OnOptInitialise); HookEvent(ME_SYSTEM_PRESHUTDOWN{ME_SYSTEM_OKTOEXIT},@PreShutdown); NotifyEventHooks(hHookChanged,twparam(ACTM_LOADED),0); diff --git a/plugins/Actman/iac_service.pas b/plugins/Actman/iac_service.pas index f9b2b6ba15..cfeb456191 100644 --- a/plugins/Actman/iac_service.pas +++ b/plugins/Actman/iac_service.pas @@ -421,14 +421,13 @@ function DlgProc(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; var ServiceBlock:HWND; rc:TRECT; - b:bool; begin result:=0; case hMessage of WM_DESTROY: begin end; - + WM_INITDIALOG: begin GetClientRect(Dialog,rc); ServiceBlock:=CreateServiceBlock(Dialog,0,0,rc.right,rc.bottom, @@ -481,7 +480,7 @@ begin WM_COMMAND: begin case wParam shr 16 of CBN_EDITCHANGE, - BN_CLICKED: + BN_CLICKED: SendMessage(GetParent(GetParent(Dialog)),PSM_CHANGED,0,0); end; end; diff --git a/plugins/Actman/ua/i_uaplaces.inc b/plugins/Actman/ua/i_uaplaces.inc index 222065b460..680566e2fc 100644 --- a/plugins/Actman/ua/i_uaplaces.inc +++ b/plugins/Actman/ua/i_uaplaces.inc @@ -153,7 +153,6 @@ begin begin // add icon for action to icolib fillChar(sid,SizeOf(sid),0); - sid.cbSize :=sizeof(sid); sid.szSection .w:=ICOLIB_ACTSECTION; sid.szDefaultFile.w:=szMyPath; sid.iDefaultIndex :=-IDI_ACTION; @@ -178,7 +177,6 @@ begin begin // add icon for action to icolib fillChar(sid,SizeOf(sid),0); - sid.cbSize :=sizeof(sid); sid.szSection .w:=ICOLIB_ACTSECTION; sid.szDefaultFile.w:=szMyPath; sid.iDefaultIndex :=-IDI_ACTION; @@ -259,7 +257,6 @@ var begin FillChar(sid,SizeOf(sid),0); //first - register icon for root popup - sid.cbSize := sizeof(sid); sid.szSection.w := ICOLIB_MNUSECTION; sid.flags := SIDF_ALL_UNICODE; sid.cx := 16; diff --git a/plugins/AutoShutdown/src/utils.cpp b/plugins/AutoShutdown/src/utils.cpp index 933ca57446..f679d8c3bf 100644 --- a/plugins/AutoShutdown/src/utils.cpp +++ b/plugins/AutoShutdown/src/utils.cpp @@ -175,10 +175,10 @@ BOOL GetFormatedCountdown(TCHAR *pszOut,int nSize,time_t countdown) if (pfnGetDurationFormat(locale,0,&st,0,NULL,pszOut,nSize)) return TRUE; return FALSE; - } else + } + /* Win9x/NT/XP */ - return StrFromTimeInterval(pszOut,nSize,(countdown>(MAXDWORD/1000))?MAXDWORD:(countdown*1000),10) != 0; - return FALSE; + return StrFromTimeInterval(pszOut,nSize,(countdown>(MAXDWORD/1000))?MAXDWORD:(countdown*1000),10) != 0; } BOOL GetFormatedDateTime(TCHAR *pszOut,int nSize,time_t timestamp,BOOL fShowDateEvenToday) @@ -209,11 +209,11 @@ HANDLE IcoLib_AddIconRes(const char *pszDbName,const TCHAR *pszSection,const TCH TCHAR szFileName[MAX_PATH]; GetModuleFileName(hInst,szFileName,SIZEOF(szFileName)); - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.pszName = (char*)pszDbName; - sid.ptszSection = (TCHAR*)pszSection; - sid.ptszDescription = (TCHAR*)pszDesc; - sid.ptszDefaultFile = szFileName; + sid.section.t = (TCHAR*)pszSection; + sid.description.t = (TCHAR*)pszDesc; + sid.defaultFile.t = szFileName; sid.iDefaultIndex = -idRes; sid.cx = GetSystemMetrics(fLarge?SM_CXICON:SM_CXSMICON); sid.cy = GetSystemMetrics(fLarge?SM_CYICON:SM_CYSMICON); diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index b9bf0c759e..9b9c5f7ecd 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -127,18 +127,18 @@ extern "C" __declspec(dllexport) int Load() TCHAR tszFile[MAX_PATH]; GetModuleFileName(g_hInst, tszFile, MAX_PATH); - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszDefaultFile = tszFile; + SKINICONDESC sid = { 0 }; + sid.defaultFile.t = tszFile; sid.flags = SIDF_ALL_TCHAR; sid.cx = sid.cy = 16; - sid.ptszSection = _T(MODULENAME); + sid.section.t = _T(MODULENAME); for (int i = 0; i < SIZEOF(forms); i++) { char szSettingName[64]; mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODNAME, forms[i].pszIconIcoLib); sid.pszName = szSettingName; - sid.ptszDescription = forms[i].ptszDescr; + sid.description.t = forms[i].ptszDescr; sid.iDefaultIndex = -forms[i].iconNoIcoLib; forms[i].hIcoLibItem = Skin_AddIcon(&sid); } diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index a031919d39..a6cb44c833 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1637,28 +1637,28 @@ static int clcHookModulesLoaded(WPARAM, LPARAM) TCHAR szMyPath[MAX_PATH]; GetModuleFileName(g_hInst, szMyPath, SIZEOF(szMyPath)); - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.cx = sid.cy = 16; - sid.ptszDefaultFile = szMyPath; + sid.defaultFile.t = szMyPath; sid.flags = SIDF_PATH_TCHAR; - sid.pszSection = LPGEN("Contact list"); - sid.pszDescription = LPGEN("Listening to"); + sid.section.a = LPGEN("Contact list"); + sid.description.a = LPGEN("Listening to"); sid.pszName = "LISTENING_TO_ICON"; sid.iDefaultIndex = -IDI_LISTENING_TO; Skin_AddIcon(&sid); - sid.pszSection = LPGEN("Contact list") "/" LPGEN("Avatar overlay"); + sid.section.a = LPGEN("Contact list") "/" LPGEN("Avatar overlay"); for (int i = 0; i < SIZEOF(g_pAvatarOverlayIcons); i++) { - sid.pszDescription = g_pAvatarOverlayIcons[i].description; + sid.description.a = g_pAvatarOverlayIcons[i].description; sid.pszName = g_pAvatarOverlayIcons[i].name; sid.iDefaultIndex = -g_pAvatarOverlayIcons[i].id; Skin_AddIcon(&sid); } - sid.pszSection = LPGEN("Contact list") "/" LPGEN("Status overlay"); + sid.section.a = LPGEN("Contact list") "/" LPGEN("Status overlay"); for (int i = 0; i < SIZEOF(g_pStatusOverlayIcons); i++) { - sid.pszDescription = g_pStatusOverlayIcons[i].description; + sid.description.a = g_pStatusOverlayIcons[i].description; sid.pszName = g_pStatusOverlayIcons[i].name; sid.iDefaultIndex = -g_pStatusOverlayIcons[i].id; Skin_AddIcon(&sid); diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 31f4e347f2..b1ea419cb8 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -1545,13 +1545,13 @@ HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDesc TCHAR fileFull[MAX_PATH] = { 0 }; - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.cx = sid.cy = 16; - sid.pszSection = szSectionName; + sid.section.a = szSectionName; sid.pszName = szIcoID; sid.flags |= SIDF_PATH_TCHAR; - sid.pszDescription = szDescription; - sid.ptszDefaultFile = fileFull; + sid.description.a = szDescription; + sid.defaultFile.t = fileFull; if (tszDefaultFile) { PathToAbsoluteT(tszDefaultFile, fileFull); diff --git a/plugins/CountryFlags/src/icons.cpp b/plugins/CountryFlags/src/icons.cpp index 5b4e8affac..401f79c15d 100644 --- a/plugins/CountryFlags/src/icons.cpp +++ b/plugins/CountryFlags/src/icons.cpp @@ -227,12 +227,12 @@ void InitIcons(void) char szId[20]; /* register icons */ - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.pszName = szId; sid.cx = GetSystemMetrics(SM_CXSMICON); sid.cy = GetSystemMetrics(SM_CYSMICON); sid.flags = SIDF_SORTED; - sid.pszSection = "Country Flags"; + sid.section.a = "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 */ @@ -241,7 +241,7 @@ void InitIcons(void) phIconHandles = (HANDLE*)mir_alloc(nCountriesCount*sizeof(HANDLE)); if (phIconHandles != NULL) { for (int i=0; i < nCountriesCount; ++i) { - sid.pszDescription = (char*)countries[i].szName; + sid.description.a = (char*)countries[i].szName; /* create identifier */ mir_snprintf(szId, SIZEOF(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i","flags_", countries[i].id); /* buffer safe */ diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index ae149b9115..edc787d283 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -78,12 +78,12 @@ void __fastcall Prepare(KN_FP_MASK* mask, bool bEnable) if (SectName == NULL) return; - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; - sid.ptszSection = SectName; + sid.section.t = SectName; sid.pszName = mask->szIconName; - sid.ptszDescription = mask->szClientDescription; - sid.ptszDefaultFile = destfile; + sid.description.t = mask->szClientDescription; + sid.defaultFile.t = destfile; sid.iDefaultIndex = -mask->iIconIndex; sid.cx = sid.cy = 16; mask->hIcolibItem = Skin_AddIcon(&sid); diff --git a/plugins/HistoryPlusPlus/hpp_options.pas b/plugins/HistoryPlusPlus/hpp_options.pas index 155dd17925..3b135b2678 100644 --- a/plugins/HistoryPlusPlus/hpp_options.pas +++ b/plugins/HistoryPlusPlus/hpp_options.pas @@ -549,7 +549,6 @@ begin // Register in IcoLib hppIconPack := FindIconsDll(false); ZeroMemory(@sid, sizeof(sid)); - sid.cbSize := sizeof(sid); sid.Flags:=SIDF_ALL_UNICODE; sid.szDefaultFile.w := PChar(hppIconPack); diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 74cd534b0f..5bd5a5a4ab 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -125,15 +125,12 @@ namespace mu void addIcon(const TCHAR* szSection, const TCHAR* szDescription, const char* szIconName, const char* szDefaultFile, int iDefaultIndex, int cx /* = 16 */, int cy /* = 16 */) { - SKINICONDESC sid; - - sid.cbSize = sizeof(sid); - sid.ptszSection = const_cast(szSection); - sid.ptszDescription = const_cast(szDescription); + SKINICONDESC sid = { 0 }; + sid.section.t = const_cast(szSection); + sid.description.t = const_cast(szDescription); sid.pszName = const_cast(szIconName); - sid.pszDefaultFile = const_cast(szDefaultFile); + sid.defaultFile.a = const_cast(szDefaultFile); sid.iDefaultIndex = iDefaultIndex; - sid.hDefaultIcon = NULL; sid.cx = cx; sid.cy = cy; sid.flags = SIDF_TCHAR; @@ -142,13 +139,11 @@ namespace mu void addIcon(const TCHAR* szSection, const TCHAR* szDescription, const char* szIconName, HICON hDefaultIcon, int cx /* = 16 */, int cy /* = 16 */) { - SKINICONDESC sid; - - sid.cbSize = sizeof(sid); - sid.ptszSection = const_cast(szSection); - sid.ptszDescription = const_cast(szDescription); + SKINICONDESC sid = { 0 }; + sid.section.t = const_cast(szSection); + sid.description.t = const_cast(szDescription); sid.pszName = const_cast(szIconName); - sid.pszDefaultFile = NULL; + sid.defaultFile.a = NULL; sid.iDefaultIndex = 0; sid.hDefaultIcon = hDefaultIcon; sid.cx = cx; diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index 3652582256..413959315a 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -211,11 +211,11 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) mir_snprintf(section, SIZEOF(section), "Popups/%s", notification->lpzGroup); mir_snprintf(setting, MODULNAME"_%s_%s", notification->lpzGroup, notification->lpzName); - SKINICONDESC sid = { sizeof(sid) }; - sid.pszSection = section; + SKINICONDESC sid = { 0 }; + sid.section.a = section; sid.cx = sid.cy = 16; sid.pszName = setting; - sid.pszDescription = notification->lpzName; + sid.description.a = notification->lpzName; sid.hDefaultIcon = notification->lchIcon; Skin_AddIcon(&sid); diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index ad5517938b..8ae1829407 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -232,13 +232,13 @@ static HANDLE AddIcon(char* szIcoName) TCHAR tszPath[MAX_PATH]; GetModuleFileName(hinstance, tszPath, SIZEOF(tszPath)); - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_PATH_TCHAR; - sid.pszSection = "Quick Messages"; + sid.section.a = "Quick Messages"; sid.cx = sid.cy = 16; - sid.pszDescription = szIcoName; + sid.description.a = szIcoName; sid.pszName = szIcoName; - sid.ptszDefaultFile = tszPath; + sid.defaultFile.t = tszPath; sid.iDefaultIndex = -IDI_QICON; return Skin_AddIcon(&sid); } diff --git a/plugins/QuickSearch/quicksearch.dpr b/plugins/QuickSearch/quicksearch.dpr index bb363cc6b7..b0041c2d66 100644 --- a/plugins/QuickSearch/quicksearch.dpr +++ b/plugins/QuickSearch/quicksearch.dpr @@ -74,7 +74,6 @@ var sid:TSKINICONDESC; begin FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize :=SizeOf(TSKINICONDESC); sid.cx :=16; sid.cy :=16; sid.szSection.a:=qs_module; diff --git a/plugins/SecureIM/src/loadicons.cpp b/plugins/SecureIM/src/loadicons.cpp index ff4d1d876a..bf6aca904d 100644 --- a/plugins/SecureIM/src/loadicons.cpp +++ b/plugins/SecureIM/src/loadicons.cpp @@ -96,14 +96,14 @@ void InitIcons(void) TCHAR tszPath[MAX_PATH]; GetModuleFileName(g_hIconInst, tszPath, SIZEOF(tszPath)); - SKINICONDESC sid = { sizeof(sid) }; - sid.pszSection = "SecureIM"; - sid.ptszDefaultFile = tszPath; + SKINICONDESC sid = { 0 }; + sid.section.a = "SecureIM"; + sid.defaultFile.t = tszPath; for (int i = 0; i < SIZEOF(icons); i++) { - sid.pszSection = icons[i].section; + sid.section.a = icons[i].section; sid.pszName = icons[i].name; - sid.pszDescription = icons[i].text; + sid.description.a = icons[i].text; sid.iDefaultIndex = -icons[i].key; HANDLE hIcolib = Skin_AddIcon(&sid); diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index f0191cbabc..6e539a8b19 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -141,14 +141,14 @@ static int ModulesLoaded(WPARAM, LPARAM) TCHAR path[MAX_PATH]; GetModuleFileName(hInst, path, MAX_PATH); - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR | SIDF_SORTED; - sid.ptszSection = LPGENT("Spell Checker")_T("/")LPGENT("Flags"); + sid.section.t = LPGENT("Spell Checker")_T("/")LPGENT("Flags"); // Get language flags for (int i = 0; i < languages.getCount(); i++) { Dictionary *p = languages[i]; - sid.ptszDescription = p->full_name; + sid.description.t = p->full_name; char lang[32]; mir_snprintf(lang, SIZEOF(lang), "spell_lang_%d", i); @@ -160,13 +160,13 @@ static int ModulesLoaded(WPARAM, LPARAM) if (hFlag != NULL) { sid.hDefaultIcon = hFlag; - sid.ptszDefaultFile = NULL; + sid.defaultFile.t = NULL; sid.iDefaultIndex = 0; } else { hFlagIcoLib = Skin_GetIcon("spellchecker_unknown"); sid.hDefaultIcon = hFlagIcoLib; - sid.ptszDefaultFile = NULL; + sid.defaultFile.t = NULL; sid.iDefaultIndex = 0; } diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp index 948e471350..4f2ee0568a 100644 --- a/plugins/TabSRMM/src/msgs.cpp +++ b/plugins/TabSRMM/src/msgs.cpp @@ -794,15 +794,15 @@ static int TSAPI SetupIconLibConfig() FreeLibrary(g_hIconDLL); g_hIconDLL = 0; - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszDefaultFile = szFilename; + SKINICONDESC sid = { 0 }; + sid.defaultFile.t = szFilename; sid.flags = SIDF_PATH_TCHAR; for (int n = 0; n < SIZEOF(ICONBLOCKS); n++) { - sid.pszSection = ICONBLOCKS[n].szSection; + sid.section.a = ICONBLOCKS[n].szSection; for (int i = 0; i < ICONBLOCKS[n].nItems; i++) { sid.pszName = ICONBLOCKS[n].idesc[i].szName; - sid.pszDescription = ICONBLOCKS[n].idesc[i].szDesc; + sid.description.a = 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) if (n > 0 && n < 4) @@ -812,21 +812,21 @@ static int TSAPI SetupIconLibConfig() } } - sid.pszSection = LPGEN("Message Sessions")"/"LPGEN("Default"); + sid.section.a = LPGEN("Message Sessions")"/"LPGEN("Default"); sid.pszName = "tabSRMM_clock_symbol"; - sid.pszDescription = LPGEN("Clock symbol (for the info panel clock)"); + sid.description.a = LPGEN("Clock symbol (for the info panel clock)"); sid.iDefaultIndex = -IDI_CLOCK; Skin_AddIcon(&sid); _tcsncpy(szFilename, _T("plugins\\tabsrmm.dll"), MAX_PATH); sid.pszName = "tabSRMM_overlay_disabled"; - sid.pszDescription = LPGEN("Feature disabled (used as overlay)"); + sid.description.a = LPGEN("Feature disabled (used as overlay)"); sid.iDefaultIndex = -IDI_FEATURE_DISABLED; Skin_AddIcon(&sid); sid.pszName = "tabSRMM_overlay_enabled"; - sid.pszDescription = LPGEN("Feature enabled (used as overlay)"); + sid.description.a = LPGEN("Feature enabled (used as overlay)"); sid.iDefaultIndex = -IDI_FEATURE_ENABLED; Skin_AddIcon(&sid); return 1; diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index 930925a7a7..0842ce95e3 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -152,12 +152,13 @@ static void Icon2button(TTBButton *but, HANDLE &hIcoLib, HICON &hIcon, bool bIsU if (!hIcoLib) { char buf[256]; mir_snprintf(buf, "toptoolbar_%s%s", but->name, bIsUp ? (but->hIconDn ? "%s_up" : "%s") : "%s_dn"); - SKINICONDESC sid = { sizeof(sid) }; - sid.pszSection = "Toolbar"; + + SKINICONDESC sid = { 0 }; + sid.section.a = "Toolbar"; sid.pszName = buf; - sid.pszDefaultFile = NULL; + sid.defaultFile.a = NULL; mir_snprintf(buf, "%s%s", but->name, bIsUp ? "" : " (pressed)"); - sid.pszDescription = buf; + sid.description.a = buf; sid.hDefaultIcon = bIsUp ? but->hIconUp : but->hIconDn; hIcoLib = Skin_AddIcon(&sid); } diff --git a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp index 61fab1365b..9774ac2f42 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flagsicons.cpp @@ -388,15 +388,15 @@ void InitIcons() phIconHandles = (HANDLE*)mir_alloc(nCountriesCount*sizeof(HANDLE)); if (phIconHandles != NULL) { char szId[20]; - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszSection = LPGENT("Country flags"); + SKINICONDESC sid = { 0 }; + sid.section.t = LPGENT("Country flags"); sid.pszName = szId; // name to refer to icon when playing and in db sid.cx = GetSystemMetrics(SM_CXSMICON); sid.cy = GetSystemMetrics(SM_CYSMICON); sid.flags = SIDF_SORTED | SIDF_TCHAR; for (int i=0; i < nCountriesCount; i++) { - sid.ptszDescription = mir_a2t(LPGEN(countries[i].szName)); + sid.description.t = mir_a2t(LPGEN(countries[i].szName)); /* create identifier */ mir_snprintf(szId, SIZEOF(szId), (countries[i].id == 0xFFFF) ? "%s0x%X" : "%s%i", "flags_", countries[i].id); /* buffer safe */ int index = CountryNumberToBitmapIndex(countries[i].id); @@ -406,7 +406,7 @@ void InitIcons() phIconHandles[index] = Skin_AddIcon(&sid); if (sid.hDefaultIcon!=NULL) DestroyIcon(sid.hDefaultIcon); - mir_free(sid.ptszDescription); sid.ptszDescription = NULL; + mir_free(sid.description.t); sid.description.t = NULL; } } ImageList_Destroy(himl); diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 32ffb499fd..4aab90ed26 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -318,13 +318,13 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn if (!(hIcon = Skin_GetIcon(pszIconName))) { bool bNeedFree = false; - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; sid.cx = GetSystemMetrics(SM_CXSMICON); sid.cy = GetSystemMetrics(SM_CYSMICON); sid.pszName = (LPSTR)pszIconName; - sid.ptszDescription = _ptszLabel; - sid.ptszSection = LPGENT(SECT_TREE); + sid.description.t = _ptszLabel; + sid.section.t = LPGENT(SECT_TREE); // the item to insert brings along an icon? if (odp->flags & ODPF_ICON) { @@ -332,10 +332,10 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn if (odp->hInstance == ghInst) { // the pszGroup holds the iconfile for items added by uinfoex - sid.ptszDefaultFile = odp->ptszGroup; + sid.defaultFile.t = odp->ptszGroup; // icon library exists? - if (sid.ptszDefaultFile) + if (sid.defaultFile.t) sid.iDefaultIndex = (INT_PTR)odp->hIcon; // no valid icon library else { diff --git a/plugins/UserInfoEx/src/mir_icolib.cpp b/plugins/UserInfoEx/src/mir_icolib.cpp index 4b8388382f..2154abdc46 100644 --- a/plugins/UserInfoEx/src/mir_icolib.cpp +++ b/plugins/UserInfoEx/src/mir_icolib.cpp @@ -226,13 +226,13 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L HANDLE hIconHandle = NULL; if (szIconID && szDescription && szSection) { - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; sid.pszName = szIconID; - sid.ptszDescription = mir_a2t(szDescription); - sid.ptszSection = mir_a2t(szSection); + sid.description.t = mir_a2t(szDescription); + sid.section.t = mir_a2t(szSection); - if (sid.ptszDescription && sid.ptszSection) { + if (sid.description.t && sid.section.t) { switch (Size) { // small icons (16x16) case 0: @@ -252,8 +252,8 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L break; } - sid.ptszDefaultFile = szDefaultFile; - if (sid.ptszDefaultFile && sid.ptszDefaultFile[0]) + sid.defaultFile.t = szDefaultFile; + if (sid.defaultFile.t && sid.defaultFile.t[0]) sid.iDefaultIndex = -idIcon; else { sid.hDefaultIcon = hDefIcon; @@ -261,8 +261,8 @@ static HANDLE IcoLib_RegisterIconHandleEx(LPSTR szIconID, LPSTR szDescription, L } hIconHandle = Skin_AddIcon(&sid); } - MIR_FREE(sid.ptszDescription); - MIR_FREE(sid.ptszSection); + MIR_FREE(sid.description.t); + MIR_FREE(sid.section.t); } return hIconHandle; } diff --git a/plugins/Utils.pas/mirutils.pas b/plugins/Utils.pas/mirutils.pas index dd46e411bb..5c25045c11 100644 --- a/plugins/Utils.pas/mirutils.pas +++ b/plugins/Utils.pas/mirutils.pas @@ -701,7 +701,6 @@ var sid:TSKINICONDESC; begin FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize :=SizeOf(TSKINICONDESC); sid.cx :=16; sid.cy :=16; sid.flags :=0; diff --git a/plugins/Utils.pas/sedit.pas b/plugins/Utils.pas/sedit.pas index 35f90b9dde..7c7010e43b 100644 --- a/plugins/Utils.pas/sedit.pas +++ b/plugins/Utils.pas/sedit.pas @@ -92,7 +92,6 @@ begin exit; FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize :=SizeOf(TSKINICONDESC); sid.cx :=16; sid.cy :=16; sid.flags :=SIDF_UNICODE; @@ -442,7 +441,7 @@ var {$IFDEF Miranda}isScript:boolean;{$ENDIF} begin li.iItem:=item; - + // result value check and element type li.mask :=LVIF_PARAM or LVIF_STATE; li.iSubItem :=0; @@ -490,7 +489,7 @@ begin // type text (can skip and use type code) li.mask :=LVIF_TEXT; li.cchTextMax:=HIGH(buf); - li.pszText :=@buf; + li.pszText :=@buf; li.iSubItem :=col_type; SendMessageW(list,LVM_GETITEMTEXTW,item,lparam(@li)); dst:=StrEnd(FastWideToAnsiBuf(@buf,dst)); @@ -499,7 +498,7 @@ begin // alias li.mask :=LVIF_TEXT; li.cchTextMax:=HIGH(buf); - li.pszText :=@buf; + li.pszText :=@buf; li.iSubItem :=col_alias; if SendMessageW(list,LVM_GETITEMTEXTW,item,lparam(@li))>0 then @@ -839,7 +838,7 @@ begin {$ENDIF} buf[idx]:=#0; LV_SetItemW(list,@buf,item,col_flag); - + // values tmp:=nil; case ltype of @@ -1072,7 +1071,7 @@ begin GetWindowRect(wnd,rc1); SetWindowPos(wnd,0,0,0,rc.right-rc1.left-8,rc1.bottom-rc1.top, SWP_NOMOVE or SWP_NOZORDER or SWP_SHOWWINDOW); - + wnd:=GetDlgItem(Dialog,IDC_DATA_FULL); GetWindowRect(wnd,rc1); SetWindowPos(wnd,0,0,0,rc1.right-rc1.left, rc.bottom-rc1.top-8, diff --git a/plugins/Watrack/lastfm/lastfm.pas b/plugins/Watrack/lastfm/lastfm.pas index c5ccd796cc..677d7aa4c5 100644 --- a/plugins/Watrack/lastfm/lastfm.pas +++ b/plugins/Watrack/lastfm/lastfm.pas @@ -193,7 +193,6 @@ var sid:TSKINICONDESC; begin FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize:=SizeOf(TSKINICONDESC); sid.cx:=16; sid.cy:=16; sid.szSection.a:='WATrack'; diff --git a/plugins/Watrack/myshows/myshows.pas b/plugins/Watrack/myshows/myshows.pas index f4fce5bc5a..ff9e2975a5 100644 --- a/plugins/Watrack/myshows/myshows.pas +++ b/plugins/Watrack/myshows/myshows.pas @@ -226,7 +226,6 @@ var sid:TSKINICONDESC; begin FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize:=SizeOf(TSKINICONDESC); sid.cx:=16; sid.cy:=16; sid.szSection.a:='WATrack'; diff --git a/plugins/Watrack/popup/popups.pas b/plugins/Watrack/popup/popups.pas index ec21e11f5d..eea51ae883 100644 --- a/plugins/Watrack/popup/popups.pas +++ b/plugins/Watrack/popup/popups.pas @@ -473,7 +473,6 @@ begin ssmi:=CreateServiceFunction(MS_WAT_SHOWMUSICINFO,@OpenPopup); FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize:=SizeOf(TSKINICONDESC); sid.cx:=16; sid.cy:=16; sid.szSection.a:='WATrack'; diff --git a/plugins/Watrack/proto/proto.pas b/plugins/Watrack/proto/proto.pas index 4ee38f79b3..8da9d20b12 100644 --- a/plugins/Watrack/proto/proto.pas +++ b/plugins/Watrack/proto/proto.pas @@ -468,7 +468,6 @@ var sid:TSKINICONDESC; begin FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize:=SizeOf(TSKINICONDESC); sid.cx:=16; sid.cy:=16; sid.szSection.a:=PluginShort; diff --git a/plugins/Watrack/stat/statlog.pas b/plugins/Watrack/stat/statlog.pas index 50da1cc2ff..3d82b93223 100644 --- a/plugins/Watrack/stat/statlog.pas +++ b/plugins/Watrack/stat/statlog.pas @@ -588,7 +588,6 @@ begin loadstat; FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize:=SizeOf(TSKINICONDESC); sid.cx:=16; sid.cy:=16; sid.szSection.a:='WATrack'; diff --git a/plugins/Watrack/waticons.pas b/plugins/Watrack/waticons.pas index 396fdd887e..3de092b5c7 100644 --- a/plugins/Watrack/waticons.pas +++ b/plugins/Watrack/waticons.pas @@ -69,20 +69,17 @@ begin hIconDLL:=hInstance; FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize:=SizeOf(TSKINICONDESC); sid.cx:=16; sid.cy:=16; sid.szSection.a:='WATrack'; - sid.hDefaultIcon :=LoadImage(hIconDLL, - MAKEINTRESOURCE(IDI_PLUGIN_ENABLE),IMAGE_ICON,16,16,0); + sid.hDefaultIcon :=LoadImage(hIconDLL,MAKEINTRESOURCE(IDI_PLUGIN_ENABLE),IMAGE_ICON,16,16,0); sid.pszName :=IcoBtnEnable; sid.szDescription.a:='Plugin Enabled'; Skin_AddIcon(@sid); DestroyIcon(sid.hDefaultIcon); - sid.hDefaultIcon :=LoadImage(hIconDLL, - MAKEINTRESOURCE(IDI_PLUGIN_DISABLE),IMAGE_ICON,16,16,0); + sid.hDefaultIcon :=LoadImage(hIconDLL,MAKEINTRESOURCE(IDI_PLUGIN_DISABLE),IMAGE_ICON,16,16,0); sid.pszName :=IcoBtnDisable; sid.szDescription.a:='Plugin Disabled'; Skin_AddIcon(@sid); @@ -165,7 +162,6 @@ begin FreeLibrary(hIconDLL); FillChar(sid,SizeOf(sid),0); sid.flags:=0; - sid.cbSize:=SizeOf(TSKINICONDESC); sid.cx:=16; sid.cy:=16; diff --git a/plugins/WhenWasIt/src/icons.cpp b/plugins/WhenWasIt/src/icons.cpp index 864b9a81bd..fbaed89acf 100644 --- a/plugins/WhenWasIt/src/icons.cpp +++ b/plugins/WhenWasIt/src/icons.cpp @@ -31,13 +31,13 @@ HANDLE hWWIExtraIcons = (HANDLE)-1; static HANDLE AddIcon(char *name, char *description, TCHAR *tszPath, int iDefaultIdx) { - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_PATH_TCHAR; - sid.pszSection = LPGEN("WhenWasIt"); + sid.section.a = LPGEN("WhenWasIt"); sid.cx = sid.cy = 16; - sid.pszDescription = description; + sid.description.a = description; sid.pszName = name; - sid.ptszDefaultFile = tszPath; + sid.defaultFile.t = tszPath; sid.iDefaultIndex = -iDefaultIdx; return Skin_AddIcon(&sid); } diff --git a/plugins/mRadio/i_visual.inc b/plugins/mRadio/i_visual.inc index 86ba8fb2c6..a2b6574df3 100644 --- a/plugins/mRadio/i_visual.inc +++ b/plugins/mRadio/i_visual.inc @@ -71,7 +71,6 @@ var sid:TSKINICONDESC; begin FillChar(sid,SizeOf(TSKINICONDESC),0); - sid.cbSize:=SizeOf(TSKINICONDESC); sid.cx:=16; sid.cy:=16; sid.szSection.a:='Protocols/mRadio'; diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index e2a0ca4787..0315bd3c01 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -890,16 +890,16 @@ void InitXStatusIcons() { TCHAR lib[2*MAX_PATH] = {0}; - SKINICONDESC sid = { sizeof(sid) }; - sid.pszSection = "Protocols/" ICQ_PROTOCOL_NAME "/"LPGEN("Custom Status"); + SKINICONDESC sid = { 0 }; + sid.section.a = "Protocols/" ICQ_PROTOCOL_NAME "/"LPGEN("Custom Status"); sid.flags = SIDF_PATH_TCHAR; - sid.ptszDefaultFile = InitXStatusIconLibrary(lib, SIZEOF(lib)); + sid.defaultFile.t = InitXStatusIconLibrary(lib, SIZEOF(lib)); for (int i = 0; i < XSTATUS_COUNT; i++) { char szTemp[100]; mir_snprintf(szTemp, "icq_xstatus%d", i); sid.pszName = szTemp; - sid.pszDescription = (LPSTR)nameXStatus[i]; + sid.description.a = (LPSTR)nameXStatus[i]; sid.iDefaultIndex = -(IDI_XSTATUS1+i); hXStatusIcons[i] = Skin_AddIcon(&sid); } diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp index 0b582f3548..6ce5f2385c 100644 --- a/protocols/JabberG/src/jabber_icolib.cpp +++ b/protocols/JabberG/src/jabber_icolib.cpp @@ -119,11 +119,11 @@ void CIconPool::RegisterIcon(const char *name, TCHAR *filename, int iconid, TCHA item->m_name = mir_strdup(name); item->m_szIcolibName = mir_strdup(szSettingName); - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszDefaultFile = filename; + SKINICONDESC sid = { 0 }; + sid.defaultFile.t = filename; sid.pszName = szSettingName; - sid.ptszSection = szSection; - sid.ptszDescription = szDescription; + sid.section.t = szSection; + sid.description.t = szDescription; sid.flags = SIDF_ALL_TCHAR; sid.iDefaultIndex = iconid; item->m_hIcolibItem = Skin_AddIcon(&sid); @@ -284,12 +284,12 @@ static HICON LoadTransportIcon(char *filename,int i,char *IconName,TCHAR *SectNa if (hi) has_proto_icon=TRUE; if (hi && nf) DestroyIcon(hi); if (IconName != NULL && SectName != NULL) { - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.hDefaultIcon = (has_proto_icon) ? NULL : LoadSkinnedProtoIcon(0, -internalidx); - sid.ptszSection = SectName; + sid.section.t = SectName; sid.pszName = IconName; - sid.ptszDescription = Description; - sid.pszDefaultFile = szMyPath; + sid.description.t = Description; + sid.defaultFile.a = szMyPath; sid.iDefaultIndex = i; sid.flags = SIDF_TCHAR; Skin_AddIcon(&sid); diff --git a/protocols/MRA/src/MraIcons.cpp b/protocols/MRA/src/MraIcons.cpp index a0d0261ec1..0bfe17d19b 100644 --- a/protocols/MRA/src/MraIcons.cpp +++ b/protocols/MRA/src/MraIcons.cpp @@ -100,9 +100,9 @@ void InitXStatusIcons() GetModuleFileName((g_hDLLXStatusIcons != NULL) ? g_hDLLXStatusIcons : g_hInstance, szBuff, SIZEOF(szBuff)); - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszSection = LPGENT("Protocols")_T("/")LPGENT("MRA")_T("/")LPGENT("Custom Status"); - sid.ptszDefaultFile = szBuff; + SKINICONDESC sid = { 0 }; + sid.section.t = LPGENT("Protocols")_T("/")LPGENT("MRA")_T("/")LPGENT("Custom Status"); + sid.defaultFile.t = szBuff; sid.cx = sid.cy = 16; sid.flags = SIDF_ALL_TCHAR; @@ -113,7 +113,7 @@ void InitXStatusIcons() sid.pszName = szBuff; int iCurIndex = i+IDI_XSTATUS1-1; - sid.ptszDescription = (TCHAR*)lpcszXStatusNameDef[i]; + sid.description.t = (TCHAR*)lpcszXStatusNameDef[i]; sid.iDefaultIndex = -iCurIndex; hXStatusAdvancedStatusIcons[i] = Skin_AddIcon(&sid); diff --git a/protocols/MSN/src/msn_skypeab.cpp b/protocols/MSN/src/msn_skypeab.cpp index 2b2d5dccc9..6137f6bda3 100644 --- a/protocols/MSN/src/msn_skypeab.cpp +++ b/protocols/MSN/src/msn_skypeab.cpp @@ -124,7 +124,7 @@ bool CMsnProto::MSN_SKYABGetProfiles(const char *pszPOST) if (!APISkypeComRequest(&nlhr, headers)) return false; nlhr.requestType = REQUEST_POST; nlhr.szUrl = "https://api.skype.com/users/self/contacts/profiles"; - nlhr.dataLength = mir_strlen(pszPOST); + nlhr.dataLength = (int)mir_strlen(pszPOST); nlhr.pData = (char*)pszPOST; mHttpsTS = clock(); @@ -343,7 +343,7 @@ bool CMsnProto::MSN_SKYABAuthRq(const char *wlid, const char *pszGreeting) nlhr.headers[3].szValue = "application/x-www-form-urlencoded"; nlhr.headersCount++; post.Format("greeting=%s", pszGreeting); - nlhr.dataLength = mir_strlen(post); + nlhr.dataLength = (int)mir_strlen(post); nlhr.pData = (char*)(const char*)post; mHttpsTS = clock(); diff --git a/protocols/SkypeWeb/src/skype_icons.cpp b/protocols/SkypeWeb/src/skype_icons.cpp index a846ef0390..7c49c9adad 100644 --- a/protocols/SkypeWeb/src/skype_icons.cpp +++ b/protocols/SkypeWeb/src/skype_icons.cpp @@ -37,18 +37,18 @@ void CSkypeProto::InitIcons() char szSettingName[100]; TCHAR szSectionName[100]; - SKINICONDESC sid = { sizeof(SKINICONDESC) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; - sid.ptszDefaultFile = szFile; + sid.defaultFile.t = szFile; sid.pszName = szSettingName; - sid.ptszSection = szSectionName; + sid.section.t = szSectionName; mir_sntprintf(szSectionName, SIZEOF(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); for (int i = 0; i < SIZEOF(Icons); i++) { mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, Icons[i].Name); - sid.ptszDescription = Icons[i].Description; + sid.description.t = Icons[i].Description; sid.iDefaultIndex = -Icons[i].IconId; Icons[i].Handle = Skin_AddIcon(&sid); } diff --git a/protocols/Steam/src/steam_proto.cpp b/protocols/Steam/src/steam_proto.cpp index 1ce64f65de..8841ce81ef 100644 --- a/protocols/Steam/src/steam_proto.cpp +++ b/protocols/Steam/src/steam_proto.cpp @@ -24,18 +24,17 @@ CSteamProto::CSteamProto(const char* protoName, const TCHAR* userName) : char settingName[100]; mir_snprintf(settingName, SIZEOF(settingName), "%s_%s", MODULE, "main"); - SKINICONDESC sid = {0}; - sid.cbSize = sizeof(SKINICONDESC); + SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; - sid.ptszDefaultFile = filePath; + sid.defaultFile.t = filePath; sid.pszName = settingName; - sid.ptszSection = sectionName; - sid.ptszDescription = LPGENT("Protocol icon"); + sid.section.t = sectionName; + sid.description.t = LPGENT("Protocol icon"); sid.iDefaultIndex = -IDI_STEAM; Skin_AddIcon(&sid); mir_snprintf(settingName, SIZEOF(settingName), "%s_%s", MODULE, "gaming"); - sid.ptszDescription = LPGENT("Gaming icon"); + sid.description.t = LPGENT("Gaming icon"); sid.iDefaultIndex = -IDI_GAMING; Skin_AddIcon(&sid); diff --git a/protocols/Tox/src/tox_icons.cpp b/protocols/Tox/src/tox_icons.cpp index eecb2e2bd6..10a228c626 100644 --- a/protocols/Tox/src/tox_icons.cpp +++ b/protocols/Tox/src/tox_icons.cpp @@ -17,18 +17,18 @@ void CToxProto::InitIcons() char szSettingName[100]; TCHAR szSectionName[100]; - SKINICONDESC sid = { sizeof(SKINICONDESC) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_ALL_TCHAR; - sid.ptszDefaultFile = szFile; + sid.defaultFile.t = szFile; sid.pszName = szSettingName; - sid.ptszSection = szSectionName; + sid.section.t = szSectionName; mir_sntprintf(szSectionName, SIZEOF(szSectionName), _T("%s/%s"), LPGENT("Protocols"), LPGENT(MODULE)); for (int i = 0; i < SIZEOF(Icons); i++) { mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, Icons[i].Name); - sid.ptszDescription = Icons[i].Description; + sid.description.t = Icons[i].Description; sid.iDefaultIndex = -Icons[i].IconId; Icons[i].Handle = Skin_AddIcon(&sid); } diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp index 780bd12159..4823119505 100644 --- a/protocols/WhatsApp/src/proto.cpp +++ b/protocols/WhatsApp/src/proto.cpp @@ -12,8 +12,8 @@ struct SearchParam LONG id; }; -WhatsAppProto::WhatsAppProto(const char* proto_name, const TCHAR* username) : - PROTO(proto_name, username), +WhatsAppProto::WhatsAppProto(const char *proto_name, const TCHAR *username) + : PROTO(proto_name, username), m_tszDefaultGroup(getTStringA(WHATSAPP_KEY_DEF_GROUP)) { update_loop_lock_ = CreateEvent(NULL, false, false, NULL); @@ -322,7 +322,7 @@ int WhatsAppProto::OnUserInfo(WPARAM, LPARAM hContact) ptrA jid(getStringA(hContact, WHATSAPP_KEY_ID)); if (jid && isOnline()) m_pConnection->sendQueryLastOnline((char*)jid); - + return 0; } diff --git a/protocols/Yahoo/src/version.h b/protocols/Yahoo/src/version.h index 8767e4ee00..e6c4a66171 100644 --- a/protocols/Yahoo/src/version.h +++ b/protocols/Yahoo/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 11 #define __RELEASE_NUM 0 -#define __BUILD_NUM 1 +#define __BUILD_NUM 2 #include diff --git a/src/mir_core/src/icons.cpp b/src/mir_core/src/icons.cpp index 806f17d775..47d6e1c904 100644 --- a/src/mir_core/src/icons.cpp +++ b/src/mir_core/src/icons.cpp @@ -31,9 +31,9 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte TCHAR szFile[MAX_PATH]; GetModuleFileName(hInst, szFile, MAX_PATH); - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszDefaultFile = szFile; - sid.pszSection = (char*)szSection; + SKINICONDESC sid = { 0 }; + sid.defaultFile.t = szFile; + sid.section.a = (char*)szSection; sid.flags = SIDF_PATH_TCHAR; for (unsigned i = 0; i < iCount; i++) { @@ -45,7 +45,7 @@ MIR_CORE_DLL(void) Icon_Register(HINSTANCE hInst, const char *szSection, IconIte else sid.pszName = pIcons[i].szName; sid.cx = sid.cy = pIcons[i].size; - sid.pszDescription = pIcons[i].szDescr; + sid.description.a = pIcons[i].szDescr; sid.iDefaultIndex = -pIcons[i].defIconID; pIcons[i].hIcolib = (HANDLE)CallService("Skin2/Icons/AddIcon", hLangpack, (LPARAM)&sid); } @@ -56,9 +56,9 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const TCHAR *szSection, IconI TCHAR szFile[MAX_PATH]; GetModuleFileName(hInst, szFile, MAX_PATH); - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszDefaultFile = szFile; - sid.ptszSection = (TCHAR*)szSection; + SKINICONDESC sid = { 0 }; + sid.defaultFile.t = szFile; + sid.section.t = (TCHAR*)szSection; sid.flags = SIDF_ALL_TCHAR; for (unsigned i = 0; i < iCount; i++) { @@ -70,7 +70,7 @@ MIR_CORE_DLL(void) Icon_RegisterT(HINSTANCE hInst, const TCHAR *szSection, IconI else sid.pszName = pIcons[i].szName; sid.cx = sid.cy = pIcons[i].size; - sid.ptszDescription = pIcons[i].tszDescr; + sid.description.t = pIcons[i].tszDescr; sid.iDefaultIndex = -pIcons[i].defIconID; pIcons[i].hIcolib = (HANDLE)CallService("Skin2/Icons/AddIcon", hLangpack, (LPARAM)&sid); } diff --git a/src/modules/clist/genmenu.cpp b/src/modules/clist/genmenu.cpp index c085c0d201..c8ea4e0c33 100644 --- a/src/modules/clist/genmenu.cpp +++ b/src/modules/clist/genmenu.cpp @@ -1079,11 +1079,11 @@ static int MO_RegisterIcon(PMO_IntMenuItem pmi, void*) } } - SKINICONDESC sid = { sizeof(sid) }; + SKINICONDESC sid = { 0 }; sid.flags = SIDF_TCHAR; - sid.ptszSection = sectionName; + sid.section.t = sectionName; sid.pszName = iconame; - sid.ptszDescription = descr; + sid.description.t = descr; sid.hDefaultIcon = hIcon; pmi->hIcolibItem = IcoLib_AddNewIcon(0, &sid); diff --git a/src/modules/icolib/skin2icons.cpp b/src/modules/icolib/skin2icons.cpp index 2f5bfed191..5b41b14e36 100644 --- a/src/modules/icolib/skin2icons.cpp +++ b/src/modules/icolib/skin2icons.cpp @@ -499,17 +499,14 @@ static void IcoLib_FreeIcon(IcolibItem* icon) ///////////////////////////////////////////////////////////////////////////////////////// // IcoLib_AddNewIcon -HANDLE IcoLib_AddNewIcon(int hLangpack, SKINICONDESC* sid) +HANDLE IcoLib_AddNewIcon(int hLangpack, SKINICONDESC *sid) { - if (sid->cbSize != sizeof(SKINICONDESC)) - return NULL; - bool utf = (sid->flags & SIDF_UNICODE) != 0; bool utf_path = (sid->flags & SIDF_PATH_UNICODE) != 0; mir_cslock lck(csIconList); - IcolibItem* item = IcoLib_FindIcon(sid->pszName); + IcolibItem *item = IcoLib_FindIcon(sid->pszName); if (!item) { item = (IcolibItem*)mir_calloc(sizeof(IcolibItem)); item->name = sid->pszName; @@ -519,12 +516,12 @@ HANDLE IcoLib_AddNewIcon(int hLangpack, SKINICONDESC* sid) item->name = mir_strdup(sid->pszName); if (utf) { - item->description = mir_u2t(sid->pwszDescription); - item->section = IcoLib_AddSection(sid->pwszSection, TRUE); + item->description = mir_u2t(sid->description.w); + item->section = IcoLib_AddSection(sid->section.w, TRUE); } else { - item->description = mir_a2t(sid->pszDescription); - WCHAR* pwszSection = sid->pszSection ? mir_a2u(sid->pszSection) : NULL; + item->description = mir_a2t(sid->description.a); + WCHAR *pwszSection = sid->section.a ? mir_a2u(sid->section.a) : NULL; item->section = IcoLib_AddSection(pwszSection, TRUE); SAFE_FREE((void**)&pwszSection); } @@ -535,12 +532,12 @@ HANDLE IcoLib_AddNewIcon(int hLangpack, SKINICONDESC* sid) } else item->orderID = 0; - if (sid->pszDefaultFile) { + if (sid->defaultFile.a) { WCHAR fileFull[ MAX_PATH ]; if (utf_path) - PathToAbsoluteT(sid->pwszDefaultFile, fileFull); + PathToAbsoluteT(sid->defaultFile.w, fileFull); else - PathToAbsoluteT(_A2T(sid->pszDefaultFile), fileFull); + PathToAbsoluteT(_A2T(sid->defaultFile.a), fileFull); item->default_file = mir_wstrdup(fileFull); } item->default_indx = sid->iDefaultIndex; diff --git a/src/modules/skin/skinicons.cpp b/src/modules/skin/skinicons.cpp index 2382da9976..1b8b9de3be 100644 --- a/src/modules/skin/skinicons.cpp +++ b/src/modules/skin/skinicons.cpp @@ -280,8 +280,8 @@ HICON LoadSkinProtoIcon(const char *szProto, int status, bool big) TCHAR tszSection[MAX_PATH]; mir_sntprintf(tszSection, SIZEOF(tszSection), _T(PROTOCOLS_PREFIX)_T("/%s"), pa->tszAccountName); - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszSection = tszSection; + SKINICONDESC sid = { 0 }; + sid.section.t = tszSection; sid.flags = SIDF_ALL_TCHAR; str = _tcsrchr(szPath, '\\'); @@ -289,19 +289,19 @@ HICON LoadSkinProtoIcon(const char *szProto, int status, bool big) *str = 0; mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\Icons\\proto_%S.dll"), szPath, pa->szProtoName); if (GetFileAttributes(szFullPath) != INVALID_FILE_ATTRIBUTES) - sid.ptszDefaultFile = szFullPath; + sid.defaultFile.t = szFullPath; else { mir_sntprintf(szFullPath, SIZEOF(szFullPath), _T("%s\\Plugins\\%S.dll"), szPath, szProto); - if ((int)ExtractIconEx(szFullPath, statusIcons[statusIndx].resource_id, NULL, &hIcon, 1) > 0) { + if (int(ExtractIconEx(szFullPath, statusIcons[statusIndx].resource_id, NULL, &hIcon, 1)) > 0) { DestroyIcon(hIcon); - sid.ptszDefaultFile = szFullPath; + sid.defaultFile.t = szFullPath; hIcon = NULL; } - if (sid.pszDefaultFile == NULL) { + if (sid.defaultFile.a == NULL) { if (str != NULL) *str = '\\'; - sid.ptszDefaultFile = szPath; + sid.defaultFile.t = szPath; } } // @@ -319,7 +319,7 @@ HICON LoadSkinProtoIcon(const char *szProto, int status, bool big) // format: core_%s%d mir_snprintf(iconName, SIZEOF(iconName), "%s%s%d", statusIconsFmt, szProto, i); sid.pszName = iconName; - sid.ptszDescription = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0); + sid.description.t = cli.pfnGetStatusModeDescription(statusIcons[i].id, 0); sid.iDefaultIndex = statusIcons[i].resource_id; IcoLib_AddNewIcon(0, &sid); } @@ -472,8 +472,8 @@ int LoadSkinIcons(void) TCHAR modulePath[MAX_PATH]; GetModuleFileName(NULL, modulePath, SIZEOF(modulePath)); - SKINICONDESC sid = { sizeof(sid) }; - sid.ptszDefaultFile = modulePath; + SKINICONDESC sid = { 0 }; + sid.defaultFile.t = modulePath; sid.flags = SIDF_PATH_TCHAR; sid.pszName = iconName; @@ -482,22 +482,22 @@ int LoadSkinIcons(void) // for (i=0; i < SIZEOF(mainIcons); i++) { mir_snprintf(iconName, SIZEOF(iconName), "%s%d", mainIconsFmt, i); - sid.pszSection = mainIcons[i].section == NULL ? LPGEN("Main icons") : (char*)mainIcons[i].section; - sid.pszDescription = (char*)mainIcons[i].description; + sid.section.a = mainIcons[i].section == NULL ? LPGEN("Main icons") : (char*)mainIcons[i].section; + sid.description.a = (char*)mainIcons[i].description; sid.iDefaultIndex = mainIcons[i].resource_id; mainIcons[i].hIcolib = IcoLib_AddNewIcon(0, &sid); } // // Add global icons to list // - sid.pszSection = PROTOCOLS_PREFIX "/" LPGEN("Global"); + sid.section.a = PROTOCOLS_PREFIX "/" LPGEN("Global"); // // Asterisk is used, to avoid conflict with proto-plugins // 'coz users can't rename it to name with '*' for (i=0; i < SIZEOF(statusIcons); i++) { mir_snprintf(iconName, SIZEOF(iconName), "%s%s%d", statusIconsFmt, GLOBAL_PROTO_NAME, i); sid.pszName = iconName; - sid.pszDescription = (char*)statusIcons[i].description; + sid.description.a = (char*)statusIcons[i].description; sid.iDefaultIndex = statusIcons[i].resource_id; statusIcons[i].hIcolib = IcoLib_AddNewIcon(0, &sid); } -- cgit v1.2.3