diff options
author | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-07-26 09:20:25 +0000 |
commit | 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch) | |
tree | 2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/TipperYM/src/mir_smileys.cpp | |
parent | a61c8728b379057fe7f0a0d86fe0b037598229dd (diff) |
less TCHARs:
- TCHAR is replaced with wchar_t everywhere;
- LPGENT replaced with either LPGENW or LPGEN;
- fixes for ANSI plugins that improperly used _t functions;
- TCHAR *t removed from MAllStrings;
- ptszGroup, ptszTitle & ptszTab in OPTIONSDIALOGPAGE replaced with pwsz*
git-svn-id: http://svn.miranda-ng.org/main/trunk@17133 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/TipperYM/src/mir_smileys.cpp')
-rw-r--r-- | plugins/TipperYM/src/mir_smileys.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/plugins/TipperYM/src/mir_smileys.cpp b/plugins/TipperYM/src/mir_smileys.cpp index 3e2df38660..5e8c62b8c9 100644 --- a/plugins/TipperYM/src/mir_smileys.cpp +++ b/plugins/TipperYM/src/mir_smileys.cpp @@ -20,6 +20,8 @@ Boston, MA 02111-1307, USA. #include "stdafx.h"
+#include <tchar.h>
+
int InitTipperSmileys()
{
// Register smiley category
@@ -104,13 +106,13 @@ int Smileys_DrawText(HDC hDC, LPCTSTR lpString, int nCount, LPRECT lpRect, UINT return text_size.cy;
}
-SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
+SIZE GetTextSize(HDC hdcMem, const wchar_t *szText, SMILEYPARSEINFO info, UINT uTextFormat, int max_width)
{
SIZE text_size = { 0 };
int text_height;
int row_count = 0, pos_x = 0;
- if (szText == NULL || _tcsclen(szText) == 0) {
+ if (szText == NULL || wcslen(szText) == 0) {
text_size.cy = 0;
text_size.cx = 0;
}
@@ -177,7 +179,7 @@ SIZE GetTextSize(HDC hdcMem, const TCHAR *szText, SMILEYPARSEINFO info, UINT uTe return text_size;
}
-void DrawTextSmiley(HDC hdcMem, RECT free_rc, const TCHAR *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
+void DrawTextSmiley(HDC hdcMem, RECT free_rc, const wchar_t *szText, int len, SMILEYPARSEINFO info, UINT uTextFormat)
{
if (szText == NULL)
return;
@@ -304,7 +306,7 @@ void DestroySmileyList(SortedList* p_list) }
// Generate the list of smileys / text to be drawn
-SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protocol, int *max_smiley_height)
+SortedList *ReplaceSmileys(const wchar_t *text, int text_size, const char *protocol, int *max_smiley_height)
{
*max_smiley_height = 0;
@@ -322,7 +324,7 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco // Parse it!
SMADD_BATCHPARSE2 sp = { 0 };
sp.cbSize = sizeof(sp);
- sp.str = (TCHAR *)text;
+ sp.str = (wchar_t *)text;
sp.flag = SAFL_TCHAR;
sp.Protocolname = (opt.iSmileyAddFlags & SMILEYADD_USEPROTO) ? smileyProto : "tipper";
SMADD_BATCHPARSERES *spres = (SMADD_BATCHPARSERES *)CallService(MS_SMILEYADD_BATCHPARSE, 0, (LPARAM)&sp);
@@ -333,11 +335,11 @@ SortedList *ReplaceSmileys(const TCHAR *text, int text_size, const char *protoco // Lets add smileys
SortedList *plText = List_Create(0, 10);
- TCHAR *word_start, *word_end;
- TCHAR *smiley_start, *smiley_end;
- TCHAR *last_text_pos = _tcsninc(text, text_size);
+ wchar_t *word_start, *word_end;
+ wchar_t *smiley_start, *smiley_end;
+ wchar_t *last_text_pos = _tcsninc(text, text_size);
- word_start = word_end = (TCHAR *)text;
+ word_start = word_end = (wchar_t *)text;
for (unsigned i = 0; i < sp.numSmileys; i++) {
// Get smile position
|