diff options
author | George Hazan <george.hazan@gmail.com> | 2013-08-10 13:28:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-08-10 13:28:49 +0000 |
commit | 794fa3fb5cc63ac9b69908bd04f4be985a4a8cd1 (patch) | |
tree | fdbdd95eff3b6508bd38aefb0695ccd96afdbbca /plugins | |
parent | f2935b7bf093965926cee07254f7a015ecd492cd (diff) |
- unused services MS_FP_SAMECLIENTS & MS_FP_GETCLIENTICON removed;
- Finger_IsSameClents & Finger_GetClientIcon helpers added;
- unused code removed from FingerPrint or replaced with the calls from mir_core.dll
git-svn-id: http://svn.miranda-ng.org/main/trunk@5632 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/ClientChangeNotify/src/ClientChangeNotify.cpp | 8 | ||||
-rw-r--r-- | plugins/ClientChangeNotify/src/CommonLibs/CString.h | 69 | ||||
-rw-r--r-- | plugins/ClientChangeNotify/src/Misc.h | 22 | ||||
-rw-r--r-- | plugins/ExternalAPI/delphi/m_fingerprint.inc | 6 | ||||
-rw-r--r-- | plugins/ExternalAPI/m_fingerprint.h | 44 | ||||
-rw-r--r-- | plugins/FingerprintNG/src/fingerprint.cpp | 205 | ||||
-rw-r--r-- | plugins/FingerprintNG/src/global.h | 4 | ||||
-rw-r--r-- | plugins/FingerprintNG/src/main.cpp | 5 | ||||
-rw-r--r-- | plugins/MenuItemEx/src/main.cpp | 18 | ||||
-rw-r--r-- | plugins/QuickSearch/sr_global.pas | 8 | ||||
-rw-r--r-- | plugins/QuickSearch/sr_optdialog.pas | 2 | ||||
-rw-r--r-- | plugins/QuickSearch/sr_window.pas | 16 | ||||
-rw-r--r-- | plugins/TabSRMM/src/msgdlgutils.cpp | 11 | ||||
-rw-r--r-- | plugins/TipperYM/src/popwin.cpp | 9 |
14 files changed, 49 insertions, 378 deletions
diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 00113d2b31..8a91324ae4 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -176,7 +176,7 @@ void ShowPopup(SHOWPOPUP_DATA *sd) POPUPDATAT ppd = {0};
ppd.lchContact = sd->hContact;
char *szProto = GetContactProto(sd->hContact);
- pdata->hIcon = ppd.lchIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)(const char*)TCHAR2ANSI(sd->MirVer), false);
+ pdata->hIcon = ppd.lchIcon = Finger_GetClientIcon(sd->MirVer, false);
_ASSERT(ppd.lchIcon);
if (!ppd.lchIcon || (DWORD)ppd.lchIcon == CALLSERVICE_NOTFOUND) {
// if we didn't succeed retrieving client icon, show the usual status icon instead
@@ -247,8 +247,8 @@ int ContactSettingChanged(WPARAM wParam, LPARAM lParam) sd.PopupOptPage = &PopupOptPage;
if (!PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) || !PopupOptPage.GetValue(IDC_POPUPOPTDLG_SHOWVER)) {
if (bFingerprintExists) {
- LPCTSTR ptszOldClient = (LPCTSTR)CallService(MS_FP_SAMECLIENTST, (WPARAM)(TCHAR*)sd.OldMirVer, (LPARAM)(TCHAR*)sd.OldMirVer); // remove version from MirVer strings. I know, the way in which MS_FP_SAMECLIENTS is used here is pretty ugly, but at least it gives necessary results
- LPCTSTR ptszClient = (LPCTSTR)CallService(MS_FP_SAMECLIENTST, (WPARAM)(TCHAR*)sd.MirVer, (LPARAM)(TCHAR*)sd.MirVer);
+ LPCTSTR ptszOldClient = Finger_IsSameClents(sd.OldMirVer, sd.OldMirVer);
+ LPCTSTR ptszClient = Finger_IsSameClents(sd.MirVer, sd.MirVer);
if (ptszOldClient && ptszClient) {
if (PerContactSetting != NOTIFY_ALMOST_ALWAYS && PerContactSetting != NOTIFY_ALWAYS && !PopupOptPage.GetValue(IDC_POPUPOPTDLG_VERCHGNOTIFY) && !_tcscmp(ptszClient, ptszOldClient))
return 0;
@@ -371,7 +371,7 @@ static int ModuleLoad(WPARAM wParam, LPARAM lParam) {
bPopupExists = ServiceExists(MS_POPUP_ADDPOPUP);
bMetaContactsExists = ServiceExists(MS_MC_GETPROTOCOLNAME) && ServiceExists(MS_MC_GETMETACONTACT);
- bFingerprintExists = ServiceExists(MS_FP_SAMECLIENTS) && ServiceExists(MS_FP_GETCLIENTICON);
+ bFingerprintExists = ServiceExists(MS_FP_SAMECLIENTST) && ServiceExists(MS_FP_GETCLIENTICONT);
bVariablesExists = ServiceExists(MS_VARS_FORMATSTRING);
return 0;
}
diff --git a/plugins/ClientChangeNotify/src/CommonLibs/CString.h b/plugins/ClientChangeNotify/src/CommonLibs/CString.h index c9a4a9538e..fc81efed22 100644 --- a/plugins/ClientChangeNotify/src/CommonLibs/CString.h +++ b/plugins/ClientChangeNotify/src/CommonLibs/CString.h @@ -101,75 +101,6 @@ typedef TString<TCHAR> TCString; typedef TString<char> CString;
typedef TString<WCHAR> WCString;
-
-/*#define TCString TString<TCHAR>
-#define CString TString<char>
-#define WCString TString<WCHAR>*/
-
-
-__inline CString TCHAR2ANSI(TCString Str)
-{
-
- if (Str == NULL)
- {
- return CString();
- }
- CString AStr;
- if (!WideCharToMultiByte(CP_ACP, 0, Str, -1, AStr.GetBuffer(Str.GetLen() + 1), Str.GetLen() + 1, NULL, NULL))
- {
- AStr.ReleaseBuffer(0);
- } else
- {
- AStr.ReleaseBuffer(Str.GetLen());
- }
- return AStr;
-
-}
-
-
-__inline TCString ANSI2TCHAR(CString Str)
-{
-
- if (Str == NULL)
- {
- return TCString();
- }
- TCString TStr;
- int Len = MultiByteToWideChar(CP_ACP, 0, Str, -1, NULL, 0);
- if (!MultiByteToWideChar(CP_ACP, 0, Str, -1, TStr.GetBuffer(Len), Len))
- {
- TStr.ReleaseBuffer(0);
- } else
- {
- TStr.ReleaseBuffer(Len - 1);
- }
- return TStr;
-
-}
-
-
-__inline WCString TCHAR2WCHAR(TCString Str)
-{
-
- return Str;
-
-}
-
-
-__inline TCString WCHAR2TCHAR(WCString Str)
-{
-
- return Str;
-
-}
-
-
-
-#define WCHAR2ANSI TCHAR2ANSI
-#define ANSI2WCHAR ANSI2TCHAR
-
-
-
#ifdef CHARARRAY_CONVERT
__inline CHARARRAY WCHAR2ANSI_ARRAY(CHARARRAY &c)
diff --git a/plugins/ClientChangeNotify/src/Misc.h b/plugins/ClientChangeNotify/src/Misc.h index e64855bb5b..8f3d299073 100644 --- a/plugins/ClientChangeNotify/src/Misc.h +++ b/plugins/ClientChangeNotify/src/Misc.h @@ -38,27 +38,6 @@ __inline void ShowMsg(TCHAR *FirstLine, TCHAR *SecondLine = _T(""), bool IsError }
}
-
-__inline TCString Path_ToRelative(TCString &Path)
-{
- CString Str;
- Str.GetBuffer(MAX_PATH);
- PathToRelative(TCHAR2ANSI(Path), Str);
- Str.ReleaseBuffer();
- return ANSI2TCHAR(Str);
-}
-
-
-__inline TCString Path_ToAbsolute(TCString &Path)
-{
- CString Str;
- Str.GetBuffer(MAX_PATH);
- PathToAbsolute( TCHAR2ANSI(Path), Str);
- Str.ReleaseBuffer();
- return ANSI2TCHAR(Str);
-}
-
-
__inline void ShowLog(TCString &LogFilePath)
{
int Result = (int)ShellExecute(NULL, _T("open"), LogFilePath, NULL, NULL, SW_SHOW);
@@ -70,7 +49,6 @@ __inline void ShowLog(TCString &LogFilePath) }
}
-
__inline void RecompileRegexps(TCString IgnoreSubstrings)
{
FreePcreCompileData();
diff --git a/plugins/ExternalAPI/delphi/m_fingerprint.inc b/plugins/ExternalAPI/delphi/m_fingerprint.inc index 293cf78f08..0dc585334c 100644 --- a/plugins/ExternalAPI/delphi/m_fingerprint.inc +++ b/plugins/ExternalAPI/delphi/m_fingerprint.inc @@ -36,11 +36,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. const
{
Service SameClients MS_FP_SAMECLIENTS
- wParam - TChar first MirVer value
- lParam - TChar second MirVer value
+ wParam - TChar first MirVer value
+ lParam - TChar second MirVer value
return pointer to AnsiChar string - client desription (DO NOT DESTROY) if clients are same otherwise NULL
}
- MS_FP_SAMECLIENTS :PAnsiChar = 'Fingerprint/SameClients';
MS_FP_SAMECLIENTSW:PAnsiChar = 'Fingerprint/SameClientsW';
{
@@ -48,7 +47,6 @@ const wParam - TChar MirVer value to get client for.
lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
}
- MS_FP_GETCLIENTICON :PAnsiChar = 'Fingerprint/GetClientIcon';
MS_FP_GETCLIENTICONW:PAnsiChar = 'Fingerprint/GetClientIconW';
// Plugin UUIDs for New plugin loader
diff --git a/plugins/ExternalAPI/m_fingerprint.h b/plugins/ExternalAPI/m_fingerprint.h index b44e937dbb..3dd6cbd694 100644 --- a/plugins/ExternalAPI/m_fingerprint.h +++ b/plugins/ExternalAPI/m_fingerprint.h @@ -24,47 +24,33 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /* January 12, 2006 */
/************************************************************************/
-
/*
* FINGERPRINT PLUGIN SERVICES HEADER
*/
/*
- * Service SameClients MS_FP_SAMECLIENTS
- * wParam - char * first MirVer value
- * lParam - char * second MirVer value
- * return pointer to char string - client desription (DO NOT DESTROY) if clients are same otherwise NULL
- */
-#define MS_FP_SAMECLIENTS "Fingerprint/SameClients"
-
-/*
- * Service SameClientsW MS_FP_SAMECLIENTSW
+ * Service SameClientsW MS_FP_SAMECLIENTSW
* wParam - LPWSTR first MirVer value
- * lParam - LPWSTR second MirVer value
- * return pointer to char string - client desription (DO NOT DESTROY) if clients are same otherwise NULL
+ * lParam - LPWSTR second MirVer value
+ * return LPWSTR: client desription (DO NOT DESTROY) if clients are same otherwise NULL
*/
#define MS_FP_SAMECLIENTSW "Fingerprint/SameClientsW"
-/*
- * Service GetClientIcon MS_FP_GETCLIENTICON
- * wParam - char * MirVer value to get client for.
- * lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
- * the returned in this case handler is static valid only till next service call.
- */
-#define MS_FP_GETCLIENTICON "Fingerprint/GetClientIcon"
+__forceinline LPCWSTR Finger_IsSameClents(LPCWSTR pwszName1, LPCWSTR pwszName2)
+{ return (LPCWSTR)CallService(MS_FP_SAMECLIENTSW, (WPARAM)pwszName1, (WPARAM)pwszName2);
+}
/*
- * Service GetClientIconW MS_FP_GETCLIENTICONW
+ * Service GetClientIconW MS_FP_GETCLIENTICONW
* wParam - LPWSTR MirVer value to get client for.
- * lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
- * the returned in this case handler is static valid only till next service call.
+ * lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
+ * the returned in this case handler is static valid only till next service call.
*/
#define MS_FP_GETCLIENTICONW "Fingerprint/GetClientIconW"
-#if defined( _UNICODE )
- #define MS_FP_SAMECLIENTST MS_FP_SAMECLIENTSW
- #define MS_FP_GETCLIENTICONT MS_FP_GETCLIENTICONW
-#else
- #define MS_FP_SAMECLIENTST MS_FP_SAMECLIENTS
- #define MS_FP_GETCLIENTICONT MS_FP_GETCLIENTICON
-#endif
+__forceinline HICON Finger_GetClientIcon(LPCWSTR pwszName, BOOL bNoCopy)
+{ return (HICON)CallService(MS_FP_SAMECLIENTSW, (WPARAM)pwszName, bNoCopy);
+}
+
+#define MS_FP_SAMECLIENTST MS_FP_SAMECLIENTSW
+#define MS_FP_GETCLIENTICONT MS_FP_GETCLIENTICONW
diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 8f2cb0c060..40327b3c7e 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -178,59 +178,6 @@ int OnExtraIconClick(WPARAM wParam, LPARAM lParam, LPARAM) return 0;
}
-/*
-* WildCompareA
-* Compare 'name' string with 'mask' strings.
-* Masks can contain '*' or '?' wild symbols
-* Asterics '*' symbol covers 'empty' symbol too e.g WildCompare("Tst","T*st*"), returns TRUE
-* In order to handle situation 'at least one any sybol' use "?*" combination:
-* e.g WildCompare("Tst","T?*st*"), returns FALSE, but both WildCompare("Test","T?*st*") and
-* WildCompare("Teeest","T?*st*") return TRUE.
-*
-* Function is case sensitive! so convert input or modify func to use _qtoupper()
-*
-* Mask can contain several submasks. In this case each submask (including first)
-* should start from '|' e.g: "|first*submask|second*mask".
-*
-* Dec 25, 2006 by FYR:
-* Added Exception to masks: the mask "|^mask3|mask2|mask1" means:
-* if NOT according to mask 3 AND (mask1 OR mask2)
-* EXCEPTION should be BEFORE main mask:
-* IF Exception match - the comparing stops as FALSE
-* IF Exception does not match - comparing continue
-* IF Mask match - comparing stops as TRUE
-* IF Mask does not not match comparing continue
-*/
-BOOL __fastcall WildCompareA(LPSTR szName, LPSTR szMask)
-{
- if (*szMask != '|')
- return WildCompareProcA(szName, szMask);
-
- size_t s = 1, e = 1;
- LPSTR szTemp = (LPSTR)_alloca(strlen(szMask) * sizeof(CHAR) + sizeof(CHAR));
- BOOL bExcept;
-
- while(szMask[e] != '\0') {
- s = e;
- while(szMask[e] != '\0' && szMask[e] != '|') e++;
-
- // exception mask
- bExcept = (*(szMask + s) == '^');
- if (bExcept) s++;
-
- memcpy(szTemp, szMask + s, (e - s) * sizeof(CHAR));
- szTemp[e - s] = '\0';
-
- if (WildCompareProcA(szName, szTemp))
- return !bExcept;
-
- if (szMask[e] != '\0')
- e++;
- else
- return FALSE;
- }
- return FALSE;
-}
/*
* WildCompareW
@@ -261,7 +208,7 @@ BOOL __fastcall WildCompareW(LPWSTR wszName, LPWSTR wszMask) return NULL;
if (*wszMask != L'|')
- return WildCompareProcW(wszName, wszMask);
+ return wildcmpw(wszName, wszMask);
size_t s = 1, e = 1;
LPWSTR wszTemp = (LPWSTR)_alloca(wcslen(wszMask) * sizeof(WCHAR) + sizeof(WCHAR));
@@ -279,7 +226,7 @@ BOOL __fastcall WildCompareW(LPWSTR wszName, LPWSTR wszMask) memcpy(wszTemp, wszMask + s, (e - s) * sizeof(WCHAR));
wszTemp[e - s] = L'\0';
- if (WildCompareProcW(wszName, wszTemp))
+ if ( wildcmpw(wszName, wszTemp))
return !bExcept;
if (wszMask[e] != L'\0')
@@ -290,56 +237,6 @@ BOOL __fastcall WildCompareW(LPWSTR wszName, LPWSTR wszMask) return FALSE;
}
-BOOL __inline WildCompareProcA(LPSTR szName, LPSTR szMask)
-{
- LPSTR szLast = NULL;
- for (;; szMask++, szName++)
- {
- if (*szMask != '?' && *szMask != *szName) break;
- if (*szName == '\0') return ((BOOL)!*szMask);
- }
- if (*szMask != '*') return FALSE;
- for (;; szMask++, szName++)
- {
- while(*szMask == '*')
- {
- szLast = szMask++;
- if (*szMask == '\0') return ((BOOL)!*szMask); /* true */
- }
- if (*szName == '\0') return ((BOOL)!*szMask); /* *mask == EOS */
- if (*szMask != '?' && *szMask != *szName && szLast != NULL)
- {
- szName -= (size_t)(szMask - szLast) - 1;
- szMask = szLast;
- }
- }
-}
-
-BOOL __inline WildCompareProcW(LPWSTR wszName, LPWSTR wszMask)
-{
- LPWSTR wszLast = NULL;
- for (;; wszMask++, wszName++)
- {
- if (*wszMask != L'?' && *wszMask != *wszName) break;
- if (*wszName == L'\0') return ((BOOL)!*wszMask);
- }
- if (*wszMask != L'*') return FALSE;
- for (;; wszMask++, wszName++)
- {
- while(*wszMask == L'*')
- {
- wszLast = wszMask++;
- if (*wszMask == L'\0') return ((BOOL)!*wszMask); /* true */
- }
- if (*wszName == L'\0') return ((BOOL)!*wszMask); /* *mask == EOS */
- if (*wszMask != L'?' && *wszMask != *wszName && wszLast != NULL)
- {
- wszName -= (size_t)(wszMask - wszLast) - 1;
- wszMask = wszLast;
- }
- }
-}
-
static void MatchMasks(TCHAR* szMirVer, short *base, short *overlay, short *overlay2, short *overlay3, short *overlay4)
{
int i = 0, j = -1, k = -1, n = -1, m = -1;
@@ -852,102 +749,6 @@ VOID ClearFI() }
/****************************************************************************************
-* ServiceGetClientIconA
-* MS_FP_GETCLIENTICON service implementation.
-* wParam - char * MirVer value to get client for.
-* lParam - int noCopy - if wParam is equal to "1" will return icon handler without copiing icon.
-* ICON IS ALWAYS COPIED!!!
-*/
-
-static INT_PTR ServiceGetClientIconA(WPARAM wParam, LPARAM lParam)
-{
- LPSTR szMirVer = (LPSTR)wParam; // MirVer value to get client for.
- if (szMirVer == NULL)
- return 0;
-
- HICON hIcon = NULL; // returned HICON
- int NoCopy = (int)lParam; // noCopy
- short base, overlay, overlay2, overlay3, overlay4;
-
- GetIconsIndexesA(szMirVer, &base, &overlay, &overlay2, &overlay3, &overlay4);
- if (base != -1)
- hIcon = CreateIconFromIndexes(base, overlay, overlay2, overlay3, overlay4);
- return (INT_PTR)hIcon;
-}
-
-/****************************************************************************************
- * ServiceSameClientA
- * MS_FP_SAMECLIENTS service implementation.
- * wParam - char * first MirVer value
- * lParam - char * second MirVer value
- * return pointer to char string - client desription (do not destroy) if clients are same
- */
-
-static INT_PTR ServiceSameClientsA(WPARAM wParam, LPARAM lParam)
-{
- LPSTR szMirVerFirst = (LPSTR)wParam; // MirVer value to get client for.
- LPSTR szMirVerSecond = (LPSTR)lParam; // MirVer value to get client for.
- int firstIndex, secondIndex;
- BOOL Result = FALSE;
-
- firstIndex = secondIndex = 0;
- if (!szMirVerFirst || !szMirVerSecond)
- return (INT_PTR)NULL; //one of its is not null
-
- {
- LPTSTR tszMirVerFirstUp, tszMirVerSecondUp;
- int iMirVerFirstUpLen, iMirVerSecondUpLen;
-
- iMirVerFirstUpLen = MultiByteToWideChar(g_LPCodePage, 0, szMirVerFirst, -1, NULL, 0);
- iMirVerSecondUpLen = MultiByteToWideChar(g_LPCodePage, 0, szMirVerSecond, -1, NULL, 0);
-
- tszMirVerFirstUp = (LPTSTR)mir_alloc(iMirVerFirstUpLen * sizeof(TCHAR));
- tszMirVerSecondUp = (LPTSTR)mir_alloc(iMirVerSecondUpLen * sizeof(TCHAR));
-
- MultiByteToWideChar(g_LPCodePage, 0, szMirVerFirst, -1, tszMirVerFirstUp, iMirVerFirstUpLen);
- MultiByteToWideChar(g_LPCodePage, 0, szMirVerSecond, -1, tszMirVerSecondUp, iMirVerSecondUpLen);
-
- _tcsupr_s(tszMirVerFirstUp, iMirVerFirstUpLen);
- _tcsupr_s(tszMirVerSecondUp, iMirVerSecondUpLen);
-
- if (_tcscmp(tszMirVerFirstUp, _T("?")) == 0)
- firstIndex = UNKNOWN_MASK_NUMBER;
- else
- while(firstIndex < DEFAULT_KN_FP_MASK_COUNT) {
- if (WildCompare(tszMirVerFirstUp, def_kn_fp_mask[firstIndex].szMaskUpper))
- break;
- firstIndex++;
- }
-
- if (_tcscmp(tszMirVerSecondUp, _T("?")) == 0)
- secondIndex = UNKNOWN_MASK_NUMBER;
- else
- while(secondIndex < DEFAULT_KN_FP_MASK_COUNT) {
- if (WildCompare(tszMirVerSecondUp, def_kn_fp_mask[secondIndex].szMaskUpper))
- break;
- secondIndex++;
- }
-
- mir_free(tszMirVerFirstUp);
- mir_free(tszMirVerSecondUp);
-
- if (firstIndex == secondIndex && firstIndex < DEFAULT_KN_FP_MASK_COUNT)
- {
- int iClientDescriptionLen = WideCharToMultiByte(g_LPCodePage, 0, def_kn_fp_mask[firstIndex].szClientDescription, -1, NULL, 0, NULL, NULL);
- if (iClientDescriptionLen > 0)
- g_szClientDescription = (LPSTR)mir_realloc(g_szClientDescription, iClientDescriptionLen * sizeof(CHAR));
- else
- return (INT_PTR)NULL;
-
- WideCharToMultiByte(g_LPCodePage, 0, def_kn_fp_mask[firstIndex].szClientDescription, -1, g_szClientDescription, iClientDescriptionLen, NULL, NULL);
- return (INT_PTR)g_szClientDescription;
-
- }
- }
- return (INT_PTR)NULL;
-}
-
-/****************************************************************************************
* ServiceGetClientIconW
* MS_FP_GETCLIENTICONW service implementation.
* wParam - LPWSTR MirVer value to get client for.
@@ -1174,8 +975,6 @@ void InitFingerModule() {
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
- CreateServiceFunction(MS_FP_SAMECLIENTS, ServiceSameClientsA);
- CreateServiceFunction(MS_FP_GETCLIENTICON, ServiceGetClientIconA);
CreateServiceFunction(MS_FP_SAMECLIENTSW, ServiceSameClientsW);
CreateServiceFunction(MS_FP_GETCLIENTICONW, ServiceGetClientIconW);
}
diff --git a/plugins/FingerprintNG/src/global.h b/plugins/FingerprintNG/src/global.h index 5bca488be6..8476fde883 100644 --- a/plugins/FingerprintNG/src/global.h +++ b/plugins/FingerprintNG/src/global.h @@ -141,10 +141,7 @@ HBITMAP __inline CreateBitmap32(int cx, int cy); HBITMAP __fastcall CreateBitmap32Point(int cx, int cy, LPVOID* bits);
HANDLE __fastcall GetIconIndexFromFI(LPTSTR szMirVer);
-BOOL __fastcall WildCompareA(LPSTR name, LPSTR mask);
BOOL __fastcall WildCompareW(LPWSTR name, LPWSTR mask);
-BOOL __inline WildCompareProcA(LPSTR name, LPSTR mask);
-BOOL __inline WildCompareProcW(LPWSTR name, LPWSTR mask);
void __fastcall Prepare(KN_FP_MASK* mask);
void RegisterIcons();
@@ -154,7 +151,6 @@ void RegisterIcons(); extern HINSTANCE g_hInst;
extern HANDLE hHeap;
-extern LPSTR g_szClientDescription;
extern KN_FP_MASK
def_kn_fp_mask[],
diff --git a/plugins/FingerprintNG/src/main.cpp b/plugins/FingerprintNG/src/main.cpp index b35de299ba..8415390044 100644 --- a/plugins/FingerprintNG/src/main.cpp +++ b/plugins/FingerprintNG/src/main.cpp @@ -28,8 +28,6 @@ int hLangpack; HANDLE hHeap = NULL;
-LPSTR g_szClientDescription = NULL;
-
//End of header
// PluginInfo & PluginInfoEx
@@ -70,9 +68,6 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload()
{
- if (g_szClientDescription != NULL)
- mir_free(g_szClientDescription);
-
HeapDestroy(hHeap);
ClearFI();
UninitFingerModule();
diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 37e33d37d2..c89089478d 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -378,14 +378,14 @@ void getIP(HANDLE hContact,LPSTR szProto,LPSTR szIP) strcat(szIP, szmIP);
}
-LPSTR getMirVer(HANDLE hContact)
+LPTSTR getMirVer(HANDLE hContact)
{
LPSTR szProto = GetContactProto(hContact);
if (!szProto) return NULL;
- LPSTR msg = db_get_sa(hContact,szProto,"MirVer");
+ LPTSTR msg = db_get_tsa(hContact,szProto,"MirVer");
if (msg) {
- if (strlen(msg))
+ if (msg[0] != 0)
return msg;
mir_free(msg);
}
@@ -601,10 +601,10 @@ void ModifyCopyMirVer(HANDLE hContact) CLISTMENUITEM mi = { sizeof(mi) };
mi.flags = CMIM_ICON;
- if (ServiceExists(MS_FP_GETCLIENTICON)) {
- LPSTR msg = getMirVer(hContact);
+ if ( ServiceExists(MS_FP_GETCLIENTICONT)) {
+ LPTSTR msg = getMirVer(hContact);
if (msg) {
- mi.hIcon = (HICON)CallService(MS_FP_GETCLIENTICON,(WPARAM)msg,(LPARAM)1);
+ mi.hIcon = Finger_GetClientIcon(msg, 1);
mir_free(msg);
}
}
@@ -703,11 +703,11 @@ INT_PTR onCopyIP(WPARAM wparam,LPARAM lparam) INT_PTR onCopyMirVer(WPARAM wparam,LPARAM lparam)
{
- LPSTR msg = getMirVer((HANDLE)wparam);
+ LPTSTR msg = getMirVer((HANDLE)wparam);
if (msg) {
- CopyToClipboard((HWND)lparam, msg, 0);
+ CopyToClipboard((HWND)lparam, _T2A(msg), 0);
if (CTRL_IS_PRESSED && bPopupService)
- ShowPopup(msg, 0, (HANDLE)wparam);
+ ShowPopup( _T2A(msg), 0, (HANDLE)wparam);
mir_free(msg);
}
diff --git a/plugins/QuickSearch/sr_global.pas b/plugins/QuickSearch/sr_global.pas index cd9e1d826e..46d53df0f9 100644 --- a/plugins/QuickSearch/sr_global.pas +++ b/plugins/QuickSearch/sr_global.pas @@ -48,7 +48,7 @@ const ptString = 2;
ptUnicode = 3;
ptCurrent = 4;
-
+
const //types
ST_BYTE = 0;
ST_WORD = 1;
@@ -169,7 +169,7 @@ const so_skipminimized :PAnsiChar = 'skipminimized';
so_showoffline :PAnsiChar = 'showoffline';
so_colorize :PAnsiChar = 'colorize';
-
+
so__title :PAnsiChar = '_title';
so__setting_type :PAnsiChar = '_setting_type';
so__setting_cnftype:PAnsiChar = '_setting_cnftype';
@@ -220,7 +220,7 @@ var ttbopt:TTBButton;
begin
removetoolbar;
-
+
if qsopt.showintoptoolbar then
begin
if ServiceExists(MS_TTB_ADDBUTTON)>0 then
@@ -681,7 +681,7 @@ begin qsopt.savepattern :=GetBool(so_savepattern ,true);
qsopt.colorize :=GetBool(so_colorize ,true);
- if ServiceExists(MS_FP_GETCLIENTICON)<>0 then
+ if ServiceExists(MS_FP_GETCLIENTICONW)<>0 then
qsopt.showclienticons:=GetBool(so_showclienticons,true)
else
qsopt.showclienticons:=false;
diff --git a/plugins/QuickSearch/sr_optdialog.pas b/plugins/QuickSearch/sr_optdialog.pas index 7e7e711532..0bdb9e444c 100644 --- a/plugins/QuickSearch/sr_optdialog.pas +++ b/plugins/QuickSearch/sr_optdialog.pas @@ -713,7 +713,7 @@ begin CheckDlgButton(Dialog,IDC_CH_EXPORTHEADERS ,ORD(qsopt.exportheaders));
CheckDlgButton(Dialog,IDC_CH_SKIPMINIMIZED ,ORD(qsopt.skipminimized));
CheckDlgButton(Dialog,IDC_CH_SAVEPATTERN ,ORD(qsopt.savepattern));
- if ServiceExists(MS_FP_GETCLIENTICON)<>0 then
+ if ServiceExists(MS_FP_GETCLIENTICONW)<>0 then
CheckDlgButton(Dialog,IDC_CH_SHOWCLIENTICONS,ORD(qsopt.showclienticons))
else
EnableWindow(GetDlgItem(Dialog,IDC_CH_SHOWCLIENTICONS),false);
diff --git a/plugins/QuickSearch/sr_window.pas b/plugins/QuickSearch/sr_window.pas index de9ba1b634..0b13cbeede 100644 --- a/plugins/QuickSearch/sr_window.pas +++ b/plugins/QuickSearch/sr_window.pas @@ -500,7 +500,7 @@ var cni:TCONTACTINFO;
dbei:TDBEVENTINFO;
hDbEvent:cardinal;
- tmp:uint_ptr;
+ tmp:int_ptr;
protov:PAnsiChar;
begin
FillChar(res,SizeOf(tQSRec),0);
@@ -526,7 +526,7 @@ begin ST_SERVICE: begin
if wparam._type=ptCurrent then wparam.n:=hContact;
if lparam._type=ptCurrent then lparam.n:=hContact;
- tmp:=uint_ptr(CallService(protov,wparam.n,lparam.n));
+ tmp:=int_ptr(CallService(protov,wparam.n,lparam.n));
if tmp=CALLSERVICE_NOTFOUND then exit;
case setting_cnftype of
ptString: begin
@@ -1884,6 +1884,7 @@ var rc:TRECT;
h:HICON;
buf:array [0..255] of AnsiChar;
+ MirVerW:PWideChar;
i,j,sub:integer;
begin
lplvcd:=pointer(lParam);
@@ -1946,13 +1947,10 @@ begin if (qsopt.columns[sub].flags and COL_CLIENT)<>0 then
begin
i:=LV_GetLParam(grid,lplvcd^.nmcd.dwItemSpec);
- FastWideToAnsiBuf(MainBuf[i,sub].text,buf);
-
-// ListView_GetItemTextA(grid,lplvcd^.nmcd.dwItemSpec,lplvcd^.iSubItem,buf,SizeOf(buf));
-//!!
- if (buf[0]<>#0) and (ServiceExists(MS_FP_GETCLIENTICON)<>0) then
+ MirVerW:=MainBuf[i,sub].text;
+ if (MirVerW[0]<>#0) and (ServiceExists(MS_FP_GETCLIENTICONW)<>0) then
begin
- h:=CallService(MS_FP_GETCLIENTICON,tlparam(@buf),0);
+ h:=CallService(MS_FP_GETCLIENTICONW,tlparam(MirVerW),0);
ListView_GetSubItemRect(grid,lplvcd^.nmcd.dwItemSpec,lplvcd^.iSubItem,LVIR_ICON,@rc);
DrawIconEx(lplvcd^.nmcd.hdc,rc.left+1,rc.top,h,16,16,0,0,DI_NORMAL);
DestroyIcon(h);
@@ -2184,7 +2182,7 @@ begin else if (wparam.a<>NIL) and // FingerPrint preprocess
(setting_type=ST_STRING) and
(lstrcmpia(wparam.a,'MirVer')=0) and
- (ServiceExists(MS_FP_GETCLIENTICON)<>0) then
+ (ServiceExists(MS_FP_GETCLIENTICONW)<>0) then
flags:=flags or COL_CLIENT;
end;
end;
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp index 93ac9d56ff..71cd93d012 100644 --- a/plugins/TabSRMM/src/msgdlgutils.cpp +++ b/plugins/TabSRMM/src/msgdlgutils.cpp @@ -2177,17 +2177,14 @@ void TSAPI SendNudge(const TWindowData *dat) void TSAPI GetClientIcon(TWindowData *dat)
{
- DBVARIANT dbv = {0};
-
if (dat->hClientIcon)
DestroyIcon(dat->hClientIcon);
dat->hClientIcon = 0;
- if (ServiceExists(MS_FP_GETCLIENTICON)) {
- if (!db_get_s(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer", &dbv)) {
- dat->hClientIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)dbv.pszVal, 1);
- db_free(&dbv);
- }
+ if ( ServiceExists(MS_FP_GETCLIENTICONT)) {
+ ptrT tszMirver( db_get_tsa(dat->cache->getActiveContact(), dat->cache->getActiveProto(), "MirVer"));
+ if (tszMirver)
+ dat->hClientIcon = Finger_GetClientIcon(tszMirver, 1);
}
}
diff --git a/plugins/TipperYM/src/popwin.cpp b/plugins/TipperYM/src/popwin.cpp index 3b872e1a8b..00dee77ce6 100644 --- a/plugins/TipperYM/src/popwin.cpp +++ b/plugins/TipperYM/src/popwin.cpp @@ -402,18 +402,11 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa for (i = 0; opt.exIconsOrder[i] != 5; i++);
if ( ServiceExists(MS_FP_GETCLIENTICONT)) {
if (!db_get_ts(pwd->hContact, szProto, "MirVer", &dbv)) {
- pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICONT, (WPARAM)dbv.ptszVal, 0);
+ pwd->extraIcons[i].hIcon = Finger_GetClientIcon(dbv.ptszVal, 0);
pwd->extraIcons[i].bDestroy = true;
db_free(&dbv);
}
}
- else if (ServiceExists(MS_FP_GETCLIENTICON)) {
- if (!db_get_s(pwd->hContact, szProto, "MirVer", &dbv)) {
- pwd->extraIcons[i].hIcon = (HICON)CallService(MS_FP_GETCLIENTICON, (WPARAM)dbv.pszVal, 0);
- pwd->extraIcons[i].bDestroy = true;
- db_free(&dbv);
- }
- }
}
//request xstatus details
|