diff options
author | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-14 16:22:13 +0000 |
---|---|---|
committer | Vadim Dashevskiy <watcherhd@gmail.com> | 2012-06-14 16:22:13 +0000 |
commit | d5d023f683b23fe26ddea93738cb721d532804f0 (patch) | |
tree | 21e7398686c7a5d1604d58bfb71ca4329c84be66 /plugins | |
parent | e58823d961a630eb62e60d2ccb443761ba5f1704 (diff) |
another portion of "#ifsef Unicode" removal
git-svn-id: http://svn.miranda-ng.org/main/trunk@411 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/Folders/version.h | 2 | ||||
-rw-r--r-- | plugins/SRMM/msgdialog.c | 26 | ||||
-rw-r--r-- | plugins/SRMM/msglog.c | 6 | ||||
-rw-r--r-- | plugins/SRMM/msgoptions.c | 66 | ||||
-rw-r--r-- | plugins/SRMM/msgs.c | 6 | ||||
-rw-r--r-- | plugins/TabSRMM/chat/log.cpp | 14 | ||||
-rw-r--r-- | plugins/TabSRMM/src/themes.cpp | 2 |
7 files changed, 7 insertions, 115 deletions
diff --git a/plugins/Folders/version.h b/plugins/Folders/version.h index 0e144ef86d..5aff03dd5a 100644 --- a/plugins/Folders/version.h +++ b/plugins/Folders/version.h @@ -24,7 +24,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define __MAJOR_VERSION 0
#define __MINOR_VERSION 1
#define __RELEASE_NUM 6
-#define __BUILD_NUM 0
+#define __BUILD_NUM 1
#define VERSION PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM)
diff --git a/plugins/SRMM/msgdialog.c b/plugins/SRMM/msgdialog.c index 1a90a861c6..c5fce0f782 100644 --- a/plugins/SRMM/msgdialog.c +++ b/plugins/SRMM/msgdialog.c @@ -57,7 +57,6 @@ static void NotifyLocalWinEvent(HANDLE hContact, HWND hwnd, unsigned int type) { static char *MsgServiceName(HANDLE hContact)
{
-#ifdef _UNICODE
char szServiceName[100];
char *szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
if (szProto == NULL)
@@ -66,7 +65,6 @@ static char *MsgServiceName(HANDLE hContact) mir_snprintf(szServiceName, SIZEOF(szServiceName), "%s%sW", szProto, PSS_MESSAGE);
if (ServiceExists(szServiceName))
return PSS_MESSAGE "W";
-#endif
return PSS_MESSAGE;
}
@@ -124,7 +122,7 @@ HANDLE SendMessageDirect(const TCHAR *szMsg, HANDLE hContact, char *szProto) return NULL;
}
bufSize = (int)strlen(sendBuffer) + 1;
-#ifdef _UNICODE
+
{
size_t bufSizeT = (_tcslen(szMsg) + 1) * sizeof(TCHAR) ;
@@ -132,7 +130,7 @@ HANDLE SendMessageDirect(const TCHAR *szMsg, HANDLE hContact, char *szProto) memcpy((TCHAR*)&sendBuffer[bufSize], szMsg, bufSizeT);
bufSize += (int)bufSizeT;
}
-#endif
+
}
if (hContact == NULL)
@@ -772,11 +770,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP if (newData->szInitialText)
{
int len;
-#ifdef _UNICODE
+
if(newData->isWchar)
SetDlgItemText(hwndDlg, IDC_MESSAGE, (TCHAR *)newData->szInitialText);
else
-#endif
+
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len);
@@ -1133,11 +1131,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hData = GlobalAlloc(GMEM_MOVEABLE, _tcslen(buf) * sizeof(TCHAR) + 1);
_tcscpy(GlobalLock(hData), buf);
GlobalUnlock(hData);
-#ifdef _UNICODE
SetClipboardData(CF_UNICODETEXT, hData);
-#else
- SetClipboardData(CF_TEXT, hData);
-#endif
CloseClipboard();
}
}
@@ -1298,17 +1292,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
char* blob = ( char* )alloca(1000);
-#if defined( _UNICODE )
int ansiLen = WideCharToMultiByte(CP_ACP, 0, buffer, -1, blob, 1000, 0, 0);
memcpy( blob+ansiLen, buffer, sizeof(TCHAR)*(iLen+1));
dbei.cbBlob = ansiLen + sizeof(TCHAR)*(iLen+1);
-#else
- int wLen = MultiByteToWideChar(CP_ACP, 0, buffer, -1, NULL, 0 );
- memcpy( blob, buffer, iLen+1 );
- MultiByteToWideChar(CP_ACP, 0, buffer, -1, (WCHAR*)&blob[iLen+1], wLen+1 );
- dbei.cbBlob = iLen+1 + sizeof(WCHAR)*wLen;
-#endif
-
dbei.cbSize = sizeof(dbei);
dbei.pBlob = (PBYTE) blob;
dbei.eventType = EVENTTYPE_STATUSCHANGE;
@@ -1936,11 +1922,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP hData = GlobalAlloc(GMEM_MOVEABLE, (_tcslen(tr.lpstrText) + 1) * sizeof(TCHAR));
_tcscpy(GlobalLock(hData), tr.lpstrText);
GlobalUnlock(hData);
-#ifdef _UNICODE
SetClipboardData(CF_UNICODETEXT, hData);
-#else
- SetClipboardData(CF_TEXT, hData);
-#endif
CloseClipboard();
}
break;
diff --git a/plugins/SRMM/msglog.c b/plugins/SRMM/msglog.c index 00a8b682e4..82bb0f8da5 100644 --- a/plugins/SRMM/msglog.c +++ b/plugins/SRMM/msglog.c @@ -180,11 +180,7 @@ static int AppendToBufferWithRTF(char **buffer, int *cbBufferEnd, int *cbBufferA return textCharsCount;
}
-#ifdef _UNICODE
- #define FONT_FORMAT "{\\f%u\\fnil\\fcharset%u %S;}"
-#else
- #define FONT_FORMAT "{\\f%u\\fnil\\fcharset%u %s;}"
-#endif
+#define FONT_FORMAT "{\\f%u\\fnil\\fcharset%u %S;}"
static char *CreateRTFHeader(struct MessageWindowData *dat)
{
diff --git a/plugins/SRMM/msgoptions.c b/plugins/SRMM/msgoptions.c index 0cdfca4562..3542902fb4 100644 --- a/plugins/SRMM/msgoptions.c +++ b/plugins/SRMM/msgoptions.c @@ -48,76 +48,10 @@ static const fontOptionsList[] = const int msgDlgFontCount = SIZEOF(fontOptionsList);
-#if defined( _UNICODE )
static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont)
{
return DEFAULT_CHARSET;
}
-#else
-// get font charset according to current CP
-static BYTE MsgDlgGetCPDefaultCharset()
-{
- switch (GetACP()) {
- case 1250:
- return EASTEUROPE_CHARSET;
- case 1251:
- return RUSSIAN_CHARSET;
- case 1252:
- return ANSI_CHARSET;
- case 1253:
- return GREEK_CHARSET;
- case 1254:
- return TURKISH_CHARSET;
- case 1255:
- return HEBREW_CHARSET;
- case 1256:
- return ARABIC_CHARSET;
- case 1257:
- return BALTIC_CHARSET;
- case 1361:
- return JOHAB_CHARSET;
- case 874:
- return THAI_CHARSET;
- case 932:
- return SHIFTJIS_CHARSET;
- case 936:
- return GB2312_CHARSET;
- case 949:
- return HANGEUL_CHARSET;
- case 950:
- return CHINESEBIG5_CHARSET;
- default:
- return DEFAULT_CHARSET;
- }
-}
-
-static int CALLBACK EnumFontFamExProc(const LOGFONT *lpelfe, const TEXTMETRIC *lpntme, DWORD FontType, LPARAM lParam)
-{
- *(int*)lParam = 1;
- return 0;
-}
-
-// get font charset according to current CP, if available for specified font
-static BYTE MsgDlgGetFontDefaultCharset(const TCHAR* szFont)
-{
- HDC hdc;
- LOGFONT lf = {0};
- int found = 0;
-
- _tcscpy(lf.lfFaceName, szFont);
- lf.lfCharSet = MsgDlgGetCPDefaultCharset();
-
- // check if the font supports specified charset
- hdc = GetDC(0);
- EnumFontFamiliesEx(hdc, &lf, &EnumFontFamExProc, (LPARAM)&found, 0);
- ReleaseDC(0, hdc);
-
- if (found)
- return lf.lfCharSet;
- else // no, give default
- return DEFAULT_CHARSET;
-}
-#endif
void LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour)
{
diff --git a/plugins/SRMM/msgs.c b/plugins/SRMM/msgs.c index 8b822c2b42..ac7a615703 100644 --- a/plugins/SRMM/msgs.c +++ b/plugins/SRMM/msgs.c @@ -149,12 +149,10 @@ INT_PTR SendMessageCmd(HANDLE hContact, char* msg, int isWchar) return 0;
}
-#if defined(_UNICODE)
static INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam)
{
return SendMessageCmd((HANDLE)wParam, (char*)lParam, TRUE);
}
-#endif
static INT_PTR SendMessageCommand(WPARAM wParam, LPARAM lParam)
{
@@ -192,9 +190,7 @@ static int TypingMessage(WPARAM wParam, LPARAM lParam) tn.tszInfoTitle = TranslateT("Typing Notification");
tn.tszInfo = szTip;
tn.dwInfoFlags = NIIF_INFO;
-#ifdef _UNICODE
tn.dwInfoFlags |= NIIF_INTERN_UNICODE;
-#endif
tn.uTimeout = 1000 * 4;
CallService(MS_CLIST_SYSTRAY_NOTIFY, 0, (LPARAM) & tn);
}
@@ -458,9 +454,7 @@ int LoadSendRecvMessageModule(void) hHooks[7] = HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PrebuildContactMenu);
hServices[0] = CreateServiceFunction(MS_MSG_SENDMESSAGE, SendMessageCommand);
-#ifdef _UNICODE
hServices[1] = CreateServiceFunction(MS_MSG_SENDMESSAGEW, SendMessageCommand_W);
-#endif
hServices[2] = CreateServiceFunction(MS_MSG_GETWINDOWAPI, GetWindowAPI);
hServices[3] = CreateServiceFunction(MS_MSG_GETWINDOWCLASS, GetWindowClass);
hServices[4] = CreateServiceFunction(MS_MSG_GETWINDOWDATA, GetWindowData);
diff --git a/plugins/TabSRMM/chat/log.cpp b/plugins/TabSRMM/chat/log.cpp index a297c9b006..d0fcf2e299 100644 --- a/plugins/TabSRMM/chat/log.cpp +++ b/plugins/TabSRMM/chat/log.cpp @@ -76,25 +76,17 @@ static char* u2a( const wchar_t* src, int codepage ) { }
static char* t2acp( const TCHAR* src, int codepage ) {
- #if defined( _UNICODE )
- return u2a( src, codepage );
- #else
- return mir_strdup( src );
- #endif
+ return u2a( src, codepage );
}
static TCHAR *a2tcp(const char *text, int cp) {
if ( text != NULL ) {
- #if defined ( _UNICODE )
int cbLen = MultiByteToWideChar( cp, 0, text, -1, NULL, 0 );
TCHAR* result = ( TCHAR* )mir_alloc( sizeof(TCHAR)*( cbLen+1 ));
if ( result == NULL )
return NULL;
MultiByteToWideChar(cp, 0, text, -1, result, cbLen);
return result;
- #else
- return mir_strdup(text);
- #endif
}
return NULL;
}
@@ -200,13 +192,11 @@ static void AddEventToBufferIEView(TCHAR **buffer, int *bufferEnd, int *bufferAl if ( streamData->lin->ptszText ) {
TCHAR *ptszTemp = NULL;
TCHAR *ptszText = streamData->lin->ptszText;
- #if defined( _UNICODE )
if (streamData->dat->codePage != CP_ACP) {
char *aText = t2acp(streamData->lin->ptszText, CP_ACP);
ptszText = ptszTemp = a2tcp(aText, streamData->dat->codePage);
mir_free(aText);
}
- #endif
Log_AppendIEView( streamData, FALSE, buffer, bufferEnd, bufferAlloced, _T("%s"), ptszText );
mir_free(ptszTemp);
}
@@ -344,9 +334,7 @@ static void LogEventIEView(LOGSTREAMDATA *streamData, TCHAR *ptszNick) }
ied.dwData |= g_Settings.ShowTime ? IEEDD_GC_SHOW_TIME : 0;
ied.dwData |= IEEDD_GC_SHOW_ICON;
-#if defined( _UNICODE )
ied.dwFlags = IEEDF_UNICODE_TEXT | IEEDF_UNICODE_NICK | IEEDF_UNICODE_TEXT2;
-#endif
ied.next = NULL;
CallService(streamData->dat->hwndIEView ? MS_IEVIEW_EVENT : MS_HPP_EG_EVENT, 0, (LPARAM)&event);
mir_free(buffer);
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp index 426a90d2d2..dd475d1a19 100644 --- a/plugins/TabSRMM/src/themes.cpp +++ b/plugins/TabSRMM/src/themes.cpp @@ -1620,9 +1620,7 @@ create_it: newItem->nextItem = 0;
curItem->nextItem = newItem;
}
-#ifdef _UNICODE
mir_free((void *)szItemNameA);
-#endif
return;
}
|