summaryrefslogtreecommitdiff
path: root/plugins/FloatingContacts
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-07-26 09:20:25 +0000
commit6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac (patch)
tree2e8bb660c908b54914abd562af8aafa4a486c846 /plugins/FloatingContacts
parenta61c8728b379057fe7f0a0d86fe0b037598229dd (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/FloatingContacts')
-rw-r--r--plugins/FloatingContacts/src/bitmap_funcs.cpp2
-rw-r--r--plugins/FloatingContacts/src/bitmap_funcs.h2
-rw-r--r--plugins/FloatingContacts/src/filedrop.cpp2
-rw-r--r--plugins/FloatingContacts/src/fltcont.h3
-rw-r--r--plugins/FloatingContacts/src/main.cpp34
-rw-r--r--plugins/FloatingContacts/src/options.cpp4
-rw-r--r--plugins/FloatingContacts/src/thumbs.cpp4
-rw-r--r--plugins/FloatingContacts/src/thumbs.h4
8 files changed, 28 insertions, 27 deletions
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.cpp b/plugins/FloatingContacts/src/bitmap_funcs.cpp
index ab3eca3c02..4db3c8f07c 100644
--- a/plugins/FloatingContacts/src/bitmap_funcs.cpp
+++ b/plugins/FloatingContacts/src/bitmap_funcs.cpp
@@ -697,7 +697,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h)
// Base on code by Artem Shpynov
// from clist_modern plugin
// slightly modified and integrated to MyBitmap class
-void MyBitmap::DrawText(TCHAR *str, int x, int y, int blur, int strength)
+void MyBitmap::DrawText(wchar_t *str, int x, int y, int blur, int strength)
{
SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz);
sz.cx += (blur + 2) * 2; sz.cy += (blur + 2) * 2;
diff --git a/plugins/FloatingContacts/src/bitmap_funcs.h b/plugins/FloatingContacts/src/bitmap_funcs.h
index d28923ff8d..55726b14c7 100644
--- a/plugins/FloatingContacts/src/bitmap_funcs.h
+++ b/plugins/FloatingContacts/src/bitmap_funcs.h
@@ -94,7 +94,7 @@ public:
void IncreaseAlpha(float q);
void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0);
- void DrawText(TCHAR *str, int x, int y, int blur = 0, int strength = 0);
+ void DrawText(wchar_t *str, int x, int y, int blur = 0, int strength = 0);
__forceinline COLOR32 *getBits() { return bits; }
__forceinline COLOR32 *getRow(int row) { return bits + row * width; }
diff --git a/plugins/FloatingContacts/src/filedrop.cpp b/plugins/FloatingContacts/src/filedrop.cpp
index 5858e85789..76da433254 100644
--- a/plugins/FloatingContacts/src/filedrop.cpp
+++ b/plugins/FloatingContacts/src/filedrop.cpp
@@ -113,7 +113,7 @@ HRESULT STDMETHODCALLTYPE CDropTarget::Drop(IDataObject *pData, DWORD, POINTL, D
}
}
else {
- TCHAR *pText = (TCHAR*)GlobalLock(stg.hGlobal);
+ wchar_t *pText = (wchar_t*)GlobalLock(stg.hGlobal);
if (pText != NULL) {
SendMsgDialog(hwndCurDrag, pText);
GlobalUnlock(stg.hGlobal);
diff --git a/plugins/FloatingContacts/src/fltcont.h b/plugins/FloatingContacts/src/fltcont.h
index 616baa50dc..691fc6101c 100644
--- a/plugins/FloatingContacts/src/fltcont.h
+++ b/plugins/FloatingContacts/src/fltcont.h
@@ -58,6 +58,7 @@ enum
//
#define MODULE "FloatingContacts"
+#define MODULEW L"FloatingContacts"
#define TOTOPTIME_P 1000
#define TOTOPTIME_MAX (15*(60000/TOTOPTIME_P))
@@ -135,7 +136,7 @@ static __forceinline BOOL ImageList_GetIconSize_my(HIMAGELIST himl, SIZE &sz)
void RegHotkey ( MCONTACT hContact, HWND hwnd );
BOOL IsStatusVisible ( int status );
BOOL HideOnFullScreen ();
-void SendMsgDialog ( HWND hwnd, TCHAR *pText );
+void SendMsgDialog ( HWND hwnd, wchar_t *pText );
void SaveContactsPos ( void );
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp
index d9e4d92fbf..ac8d80cadc 100644
--- a/plugins/FloatingContacts/src/main.cpp
+++ b/plugins/FloatingContacts/src/main.cpp
@@ -26,7 +26,7 @@ static void LoadContact(MCONTACT hContact);
// Internal funcs
static void RepaintWindow(HWND hwnd, HDC hdc);
-static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY);
+static void CreateThumbWnd(wchar_t *ptszName, MCONTACT hContact, int nX, int nY);
static void RegisterWindowClass(void);
static void UnregisterWindowClass(void);
static void LoadDBSettings(void);
@@ -123,11 +123,11 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD, LPVOID)
static LPCTSTR s_fonts[FLT_FONTIDS] =
{
- { LPGENT("Standard contacts") },
- { LPGENT("Online contacts to whom you have a different visibility") },
- { LPGENT("Offline contacts") },
- { LPGENT("Offline contacts to whom you have a different visibility") },
- { LPGENT("Contacts which are 'not on list'") }
+ { LPGENW("Standard contacts") },
+ { LPGENW("Online contacts to whom you have a different visibility") },
+ { LPGENW("Offline contacts") },
+ { LPGENW("Offline contacts to whom you have a different visibility") },
+ { LPGENW("Contacts which are 'not on list'") }
};
///////////////////////////////////////////////////////
@@ -310,7 +310,7 @@ static void LoadDBSettings()
bIsCListShow = (db_get_b(NULL, "CList", "State", 0) == 2);
}
-void SendMsgDialog(HWND hwnd, TCHAR *pText)
+void SendMsgDialog(HWND hwnd, wchar_t *pText)
{
ThumbInfo *pThumb = thumbList.FindThumb(hwnd);
if (pThumb != NULL)
@@ -413,7 +413,7 @@ static LRESULT __stdcall CommWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
case WM_REFRESH_CONTACT:
if (pThumb) {
- _tcsncpy(pThumb->ptszName, pcli->pfnGetContactDisplayName(pThumb->hContact, 0), USERNAME_LEN - 1);
+ wcsncpy(pThumb->ptszName, pcli->pfnGetContactDisplayName(pThumb->hContact, 0), USERNAME_LEN - 1);
pThumb->RefreshContactStatus((int)lParam);
pThumb->ResizeThumb();
}
@@ -500,7 +500,7 @@ static void UnregisterWindowClass()
UnregisterClass(WND_CLASS, hInst);
}
-static void CreateThumbWnd(TCHAR *ptszName, MCONTACT hContact, int nX, int nY)
+static void CreateThumbWnd(wchar_t *ptszName, MCONTACT hContact, int nX, int nY)
{
ThumbInfo *pThumb = thumbList.FindThumbByContact(hContact);
if (pThumb != NULL)
@@ -532,7 +532,7 @@ static void CreateThumbsFont()
}
LOGFONT lf;
- FontService_GetFont(LPGENT("Floating contacts"), s_fonts[nFontId], &tColor[nFontId], &lf);
+ FontService_GetFont(LPGENW("Floating contacts"), s_fonts[nFontId], &tColor[nFontId], &lf);
hFont[nFontId] = CreateFontIndirect(&lf);
}
}
@@ -679,8 +679,8 @@ static void LoadContacts()
static IconItemT g_iconList[] =
{
- { LPGENT("Show all thumbs"), "flt_show", IDI_HIDE },
- { LPGENT("Hide all thumbs"), "flt_hide", IDI_SHOW }
+ { LPGENW("Show all thumbs"), "flt_show", IDI_HIDE },
+ { LPGENW("Hide all thumbs"), "flt_hide", IDI_SHOW }
};
static INT_PTR OnMainMenu_HideAll(WPARAM, LPARAM)
@@ -725,7 +725,7 @@ static void LoadMenus()
mi.position = 0xFFFFF;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = LoadIcon(hInst, MAKEINTRESOURCE(IDI_HIDE));
- mi.name.t = LPGENT("Remove thumb");
+ mi.name.w = LPGENW("Remove thumb");
mi.pszService = MODULE "/RemoveThumb";
hMenuItemRemove = Menu_AddContactMenuItem(&mi);
@@ -735,7 +735,7 @@ static void LoadMenus()
mi.pszService = MODULE "/MainHideAllThumbs";
int i = (fcOpt.bHideAll) ? 0 : 1;
mi.hIcolibItem = g_iconList[i].hIcolib;
- mi.name.t = g_iconList[i].tszDescr;
+ mi.name.w = g_iconList[i].tszDescr;
hMainMenuItemHideAll = Menu_AddMainMenuItem(&mi);
// Register hotkeys
@@ -764,7 +764,7 @@ static void LoadContact(MCONTACT hContact)
DWORD dwPos = db_get_dw(hContact, MODULE, "ThumbsPos", (DWORD)-1);
if (dwPos != -1) {
- TCHAR *ptName = pcli->pfnGetContactDisplayName(hContact, 0);
+ wchar_t *ptName = pcli->pfnGetContactDisplayName(hContact, 0);
if (ptName != NULL) {
int nX = DB_POS_GETX(dwPos);
int nY = DB_POS_GETY(dwPos);
@@ -910,7 +910,7 @@ extern "C" int __declspec(dllexport) Load()
mir_getLP(&pluginInfoEx);
mir_getCLI();
- Icon_RegisterT(hInst, _T(MODULE), g_iconList, _countof(g_iconList));
+ Icon_RegisterT(hInst, MODULEW, g_iconList, _countof(g_iconList));
LoadMenus();
InitOptions();
@@ -924,7 +924,7 @@ extern "C" int __declspec(dllexport) Load()
char szId[20];
mir_snprintf(szId, "Font%d", i);
- FontService_RegisterFont(MODULE, szId, LPGENT("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
+ FontService_RegisterFont(MODULE, szId, LPGENW("Floating contacts"), s_fonts[i], NULL, NULL, i + 1, false, &lf, defColor);
}
HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoded);
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp
index bad721a483..ecf1100007 100644
--- a/plugins/FloatingContacts/src/options.cpp
+++ b/plugins/FloatingContacts/src/options.cpp
@@ -244,7 +244,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
case IDC_BROWSE:
{
- TCHAR str[MAX_PATH], filter[512];
+ wchar_t str[MAX_PATH], filter[512];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
Bitmap_GetFilter(filter, _countof(filter));
@@ -301,7 +301,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
db_set_b(NULL, MODULE, "BkUseBitmap", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
- TCHAR str[MAX_PATH];
+ wchar_t str[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_FILENAME, str, _countof(str));
db_set_ts(NULL, MODULE, "BkBitmap", str);
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp
index 51dc4132d1..a5d901bdd6 100644
--- a/plugins/FloatingContacts/src/thumbs.cpp
+++ b/plugins/FloatingContacts/src/thumbs.cpp
@@ -738,13 +738,13 @@ ThumbList::ThumbList() : OBJLIST<ThumbInfo>(1, NumericKeySortT)
ThumbList::~ThumbList()
{}
-ThumbInfo *ThumbList::AddThumb(HWND hwnd, TCHAR *ptszName, MCONTACT hContact)
+ThumbInfo *ThumbList::AddThumb(HWND hwnd, wchar_t *ptszName, MCONTACT hContact)
{
if (ptszName == NULL || hContact == NULL || hwnd == NULL)
return NULL;
ThumbInfo *pThumb = new ThumbInfo;
- _tcsncpy_s(pThumb->ptszName, ptszName, _TRUNCATE);
+ wcsncpy_s(pThumb->ptszName, ptszName, _TRUNCATE);
pThumb->hContact = hContact;
pThumb->hwnd = hwnd;
diff --git a/plugins/FloatingContacts/src/thumbs.h b/plugins/FloatingContacts/src/thumbs.h
index 0fe58fceb0..d3e8d396d1 100644
--- a/plugins/FloatingContacts/src/thumbs.h
+++ b/plugins/FloatingContacts/src/thumbs.h
@@ -14,7 +14,7 @@ struct ThumbInfo
{
MCONTACT hContact;
HWND hwnd;
- TCHAR ptszName[USERNAME_LEN];
+ wchar_t ptszName[USERNAME_LEN];
int iIcon;
CDropTarget *dropTarget;
DockOpt dockOpt;
@@ -60,7 +60,7 @@ public:
ThumbList();
~ThumbList();
- ThumbInfo* AddThumb(HWND hwnd, TCHAR *ptszName, MCONTACT hContact);
+ ThumbInfo* AddThumb(HWND hwnd, wchar_t *ptszName, MCONTACT hContact);
void RemoveThumb(ThumbInfo *pThumb);
ThumbInfo* FindThumb(HWND hwnd);