diff options
-rw-r--r-- | plugins/AVS/image_utils.cpp | 20 | ||||
-rw-r--r-- | plugins/AVS/image_utils.h | 16 | ||||
-rw-r--r-- | plugins/AVS/main.cpp | 15 | ||||
-rw-r--r-- | plugins/AVS/poll.cpp | 4 | ||||
-rw-r--r-- | plugins/AVS/version.rc | 19 |
5 files changed, 20 insertions, 54 deletions
diff --git a/plugins/AVS/image_utils.cpp b/plugins/AVS/image_utils.cpp index f6b6c7a98b..3a7c43a707 100644 --- a/plugins/AVS/image_utils.cpp +++ b/plugins/AVS/image_utils.cpp @@ -317,7 +317,6 @@ INT_PTR BmpFilterSaveBitmap(WPARAM wParam,LPARAM lParam) return -1;
}
-#if defined(_UNICODE)
INT_PTR BmpFilterSaveBitmapW(WPARAM wParam,LPARAM lParam)
{
if ( fei == NULL )
@@ -334,7 +333,6 @@ INT_PTR BmpFilterSaveBitmapW(WPARAM wParam,LPARAM lParam) return -1;
}
-#endif
// Returns != 0 if can save that type of image, = 0 if cant
// wParam = 0
@@ -742,16 +740,14 @@ BOOL MakeTransparentBkg(HANDLE hContact, HBITMAP *hBitmap) int SaveAvatar( const char* protocol, const TCHAR* tszFileName )
{
int result = CallProtoService(protocol, PS_SETMYAVATART, 0, ( LPARAM )tszFileName);
- #if defined( _UNICODE )
- if ( result == CALLSERVICE_NOTFOUND ) {
- if ( tszFileName != NULL ) {
- char szFileName[ MAX_PATH ];
- WideCharToMultiByte( CP_ACP, 0, tszFileName, -1, szFileName, SIZEOF(szFileName), 0, 0 );
- result = CallProtoService(protocol, PS_SETMYAVATAR, 0, ( LPARAM )szFileName);
- }
- else result = CallProtoService(protocol, PS_SETMYAVATAR, 0, 0);
+ if ( result == CALLSERVICE_NOTFOUND ) {
+ if ( tszFileName != NULL ) {
+ char szFileName[ MAX_PATH ];
+ WideCharToMultiByte( CP_ACP, 0, tszFileName, -1, szFileName, SIZEOF(szFileName), 0, 0 );
+ result = CallProtoService(protocol, PS_SETMYAVATAR, 0, ( LPARAM )szFileName);
}
- #endif
-
+ else result = CallProtoService(protocol, PS_SETMYAVATAR, 0, 0);
+ }
+
return result;
}
diff --git a/plugins/AVS/image_utils.h b/plugins/AVS/image_utils.h index 2dd75d8211..eadb2a3cfe 100644 --- a/plugins/AVS/image_utils.h +++ b/plugins/AVS/image_utils.h @@ -16,12 +16,8 @@ INT_PTR BmpFilterLoadBitmap32(WPARAM wParam,LPARAM lParam); // wParam = HBITMAP
// lParam = full path of filename
INT_PTR BmpFilterSaveBitmap(WPARAM wParam,LPARAM lParam);
-#if defined(_UNICODE)
- INT_PTR BmpFilterSaveBitmapW(WPARAM wParam,LPARAM lParam);
- #define BmpFilterSaveBitmapT BmpFilterSaveBitmapW
-#else
- #define BmpFilterSaveBitmapT BmpFilterSaveBitmap
-#endif
+INT_PTR BmpFilterSaveBitmapW(WPARAM wParam,LPARAM lParam);
+#define BmpFilterSaveBitmapT BmpFilterSaveBitmapW
// Returns != 0 if can save that type of image, = 0 if cant
// wParam = 0
@@ -35,12 +31,8 @@ INT_PTR BmpFilterResizeBitmap(WPARAM wParam,LPARAM lParam); int BmpFilterSaveBitmap(HBITMAP hBmp, char *szFile, int flags);
-#if defined(_UNICODE)
- int BmpFilterSaveBitmapW(HBITMAP hBmp, wchar_t *wszFile, int flags);
- #define BmpFilterSaveBitmapT BmpFilterSaveBitmapW
-#else
- #define BmpFilterSaveBitmapT BmpFilterSaveBitmap
-#endif
+int BmpFilterSaveBitmapW(HBITMAP hBmp, wchar_t *wszFile, int flags);
+#define BmpFilterSaveBitmapT BmpFilterSaveBitmapW
HBITMAP CopyBitmapTo32(HBITMAP hBitmap);
diff --git a/plugins/AVS/main.cpp b/plugins/AVS/main.cpp index 999d62222e..70372a2f0d 100644 --- a/plugins/AVS/main.cpp +++ b/plugins/AVS/main.cpp @@ -502,7 +502,6 @@ int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto) if (CallProtoService(szProto, PS_GETMYAVATART, (WPARAM)tszFilename, (LPARAM)MAX_PATH))
tszFilename[0] = '\0';
}
-#if defined( _UNICODE )
else if (ProtoServiceExists(szProto, PS_GETMYAVATAR)) {
char szFileName[ MAX_PATH ];
if (CallProtoService(szProto, PS_GETMYAVATAR, (WPARAM)szFileName, (LPARAM)MAX_PATH))
@@ -510,7 +509,6 @@ int CreateAvatarInCache(HANDLE hContact, avatarCacheEntry *ace, char *szProto) else
MultiByteToWideChar( CP_ACP, 0, szFileName, -1, tszFilename, SIZEOF( tszFilename ));
}
-#endif
else if (!DBGetContactSettingTString(NULL, szProto, "AvatarFile", &dbv)) {
AVS_pathToAbsolute(dbv.ptszVal, tszFilename);
DBFreeVariant(&dbv);
@@ -932,11 +930,9 @@ INT_PTR SetAvatar(WPARAM wParam, LPARAM lParam) { return avSetAvatar(( HANDLE )wParam, A2T(( const char* )lParam ));
}
-#if defined( _UNICODE )
INT_PTR SetAvatarW(WPARAM wParam, LPARAM lParam)
{ return avSetAvatar(( HANDLE )wParam, ( TCHAR* )lParam );
}
-#endif
/*
* see if is possible to set the avatar for the expecified protocol
@@ -1481,11 +1477,9 @@ static INT_PTR SetMyAvatar( WPARAM wParam, LPARAM lParam ) { return avSetMyAvatar(( char* )wParam, A2T(( const char* )lParam ));
}
-#if defined( _UNICODE )
static INT_PTR SetMyAvatarW( WPARAM wParam, LPARAM lParam )
{ return avSetMyAvatar(( char* )wParam, ( TCHAR* )lParam );
}
-#endif
///////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -2442,12 +2436,9 @@ static int LoadAvatarModule() arServices.insert( CreateServiceFunction( MS_AV_SAVEBITMAP, BmpFilterSaveBitmap ));
arServices.insert( CreateServiceFunction( MS_AV_CANSAVEBITMAP, BmpFilterCanSaveBitmap ));
arServices.insert( CreateServiceFunction( MS_AV_RESIZEBITMAP, BmpFilterResizeBitmap ));
-
- #if defined( _UNICODE )
- arServices.insert( CreateServiceFunction( MS_AV_SETAVATARW, SetAvatarW ));
- arServices.insert( CreateServiceFunction( MS_AV_SETMYAVATARW, SetMyAvatarW ));
- #endif
-
+ arServices.insert( CreateServiceFunction( MS_AV_SETAVATARW, SetAvatarW ));
+ arServices.insert( CreateServiceFunction( MS_AV_SETMYAVATARW, SetMyAvatarW ));
+
hEventChanged = CreateHookableEvent(ME_AV_AVATARCHANGED);
hEventContactAvatarChanged = CreateHookableEvent(ME_AV_CONTACTAVATARCHANGED);
hMyAvatarChanged = CreateHookableEvent(ME_AV_MYAVATARCHANGED);
diff --git a/plugins/AVS/poll.cpp b/plugins/AVS/poll.cpp index 32553a9c33..d93ef5309c 100644 --- a/plugins/AVS/poll.cpp +++ b/plugins/AVS/poll.cpp @@ -246,7 +246,7 @@ int FetchAvatarFor(HANDLE hContact, char *szProto = NULL) pai_s.hContact = hContact;
//_DebugTrace(hContact, "schedule request");
INT_PTR res = CallProtoService(szProto, PS_GETAVATARINFOT, GAIF_FORCE, (LPARAM)&pai_s);
-#ifdef _UNICODE
+
if (res == CALLSERVICE_NOTFOUND)
{
PROTO_AVATAR_INFORMATION pai = {0};
@@ -256,7 +256,7 @@ int FetchAvatarFor(HANDLE hContact, char *szProto = NULL) MultiByteToWideChar( CP_ACP, 0, pai.filename, -1, pai_s.filename, SIZEOF(pai_s.filename));
pai_s.format = pai.format;
}
-#endif
+
if (res != CALLSERVICE_NOTFOUND) result = res;
ProcessAvatarInfo(pai_s.hContact, result, &pai_s, szProto);
}
diff --git a/plugins/AVS/version.rc b/plugins/AVS/version.rc index 43d374df60..21312a927c 100644 --- a/plugins/AVS/version.rc +++ b/plugins/AVS/version.rc @@ -68,8 +68,7 @@ BEGIN BEGIN
BLOCK "040904b0"
BEGIN
-#if !defined(UNICODE)
- VALUE "Comments", "Service plugin to load and update avatars for Miranda IM"
+ VALUE "Comments", "Service plugin to load and update avatars for Miranda IM"
VALUE "CompanyName", "Written by Nightwish and Pescuma for Miranda IM project"
VALUE "FileDescription", "Service plugin to load and update avatars for Miranda IM"
VALUE "FileVersion", __FILEVERSION_STRING
@@ -77,21 +76,9 @@ BEGIN VALUE "LegalCopyright", "Copyright (C) 2010, Nightwish, Pescuma"
VALUE "LegalTrademarks", "Licensed under the Gnu General Public License V2 or any later version"
VALUE "OriginalFilename", "avs.dll"
- VALUE "ProductName", "Miranda IM Avatar Service plugin"
+ VALUE "ProductName", "Miranda IM Avatar Service"
VALUE "ProductVersion", __FILEVERSION_STRING
-#else
- VALUE "Comments", "Service plugin to load and update avatars for Miranda IM"
- VALUE "CompanyName", "Written by Nightwish and Pescuma for Miranda IM project"
- VALUE "FileDescription", "Service plugin to load and update avatars for Miranda IM"
- VALUE "FileVersion", __FILEVERSION_STRING
- VALUE "InternalName", "avsW"
- VALUE "LegalCopyright", "Copyright (C) 2010, Nightwish, Pescuma"
- VALUE "LegalTrademarks", "Licensed under the Gnu General Public License V2 or any later version"
- VALUE "OriginalFilename", "avs.dll"
- VALUE "ProductName", "Miranda IM Avatar Service (Unicode)"
- VALUE "ProductVersion", __FILEVERSION_STRING
-#endif
- END
+ END
END
BLOCK "VarFileInfo"
BEGIN
|