summaryrefslogtreecommitdiff
path: root/plugins/CSList/src
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/CSList/src
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/CSList/src')
-rw-r--r--plugins/CSList/src/cslist.cpp46
-rw-r--r--plugins/CSList/src/stdafx.h38
-rw-r--r--plugins/CSList/src/strpos.h8
3 files changed, 46 insertions, 46 deletions
diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp
index 19ea7e1558..77a43eff9f 100644
--- a/plugins/CSList/src/cslist.cpp
+++ b/plugins/CSList/src/cslist.cpp
@@ -84,9 +84,9 @@ static int OnInitOptions(WPARAM wparam, LPARAM)
odp.position = 955000000;
odp.hInstance = g_hInst;
odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.pszTitle = MODULENAME;
+ odp.pwszTitle = MODULENAME;
odp.pfnDlgProc = CSOptionsProc;
- odp.pszGroup = LPGEN("Status");
+ odp.pwszGroup = L"Status";
odp.flags = ODPF_BOLDGROUPS;
Options_AddPage(wparam, &odp);
return 0;
@@ -124,20 +124,20 @@ extern "C" __declspec(dllexport) int Load()
InitCommonControlsEx(&icc);
// init icons
- TCHAR tszFile[MAX_PATH];
+ wchar_t tszFile[MAX_PATH];
GetModuleFileName(g_hInst, tszFile, MAX_PATH);
SKINICONDESC sid = { 0 };
- sid.defaultFile.t = tszFile;
+ sid.defaultFile.w = tszFile;
sid.flags = SIDF_ALL_TCHAR;
- sid.section.t = _T(MODULENAME);
+ sid.section.w = MODULENAME;
for (int i = 0; i < _countof(forms); i++) {
char szSettingName[64];
mir_snprintf(szSettingName, "%s_%s", MODNAME, forms[i].pszIconIcoLib);
sid.pszName = szSettingName;
- sid.description.t = forms[i].ptszDescr;
+ sid.description.w = forms[i].ptszDescr;
sid.iDefaultIndex = -forms[i].iconNoIcoLib;
forms[i].hIcoLibItem = IcoLib_AddIcon(&sid);
}
@@ -161,13 +161,13 @@ extern "C" __declspec(dllexport) int Unload()
// ====[ FUN ]================================================================
-void RegisterHotkeys(char buf[200], TCHAR* accName, int Number)
+void RegisterHotkeys(char buf[200], wchar_t* accName, int Number)
{
HOTKEYDESC hotkey = { sizeof(hotkey) };
hotkey.dwFlags = HKD_TCHAR;
hotkey.pszName = buf;
hotkey.ptszDescription = accName;
- hotkey.ptszSection = LPGENT("Custom Status List");
+ hotkey.ptszSection = LPGENW("Custom Status List");
hotkey.pszService = buf;
hotkey.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, '0' + Number);
Hotkey_Register(&hotkey);
@@ -240,7 +240,7 @@ void addProtoStatusMenuItem(char *protoName)
CMenuItem mi;
mi.flags = CMIF_TCHAR;
mi.hIcolibItem = forms[0].hIcoLibItem;
- mi.name.t = _T(MODULENAME);
+ mi.name.w = MODULENAME;
mi.position = 2000040000;
mi.pszService = buf;
mi.root = hRoot;
@@ -388,15 +388,15 @@ void CSWindow::toggleEmptyListMessage()
BOOL CSWindow::itemPassedFilter(ListItem< StatusItem >* li)
{
- TCHAR filter[MAX_PATH];
+ wchar_t filter[MAX_PATH];
GetDlgItemText(m_handle, IDC_FILTER_FIELD, filter, _countof(filter));
if (mir_tstrlen(filter))
{
- TCHAR title[EXTRASTATUS_TITLE_LIMIT], message[EXTRASTATUS_MESSAGE_LIMIT];
+ wchar_t title[EXTRASTATUS_TITLE_LIMIT], message[EXTRASTATUS_MESSAGE_LIMIT];
mir_tstrcpy(title, li->m_item->m_tszTitle); mir_tstrcpy(message, li->m_item->m_tszMessage);
- if (strpos(_tcslwr(title), _tcslwr(filter)) == -1)
- if (strpos(_tcslwr(message), _tcslwr(filter)) == -1)
+ if (strpos(wcslwr(title), wcslwr(filter)) == -1)
+ if (strpos(wcslwr(message), wcslwr(filter)) == -1)
return FALSE;
}
@@ -415,7 +415,7 @@ void CSWindow::toggleFilter()
SetFocus(hFilter);
else
{
- TCHAR filterText[255];
+ wchar_t filterText[255];
GetDlgItemText(m_handle, IDC_FILTER_FIELD, filterText, _countof(filterText));
if (filterText[0] != 0)
SetDlgItemText(m_handle, IDC_FILTER_FIELD, TEXT(""));
@@ -484,7 +484,7 @@ void CSAMWindow::setCombo()
db_free(&dbv);
WPARAM iStatus;
- TCHAR tszName[100];
+ wchar_t tszName[100];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
cs.ptszName = tszName;
@@ -528,13 +528,13 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item)
if (action == EN_CHANGE)
{
- TCHAR* ptszInputText = (TCHAR*)mir_alloc((limit + 8) * sizeof(TCHAR));
+ wchar_t* ptszInputText = (wchar_t*)mir_alloc((limit + 8) * sizeof(wchar_t));
GetDlgItemText(m_handle, item, ptszInputText, limit + 8);
if (mir_tstrlen(ptszInputText) > limit)
{
- TCHAR tszPopupTip[MAX_PATH];
+ wchar_t tszPopupTip[MAX_PATH];
EDITBALLOONTIP ebt = { 0 };
ebt.cbStruct = sizeof(ebt);
ebt.pszTitle = TranslateT("Warning");
@@ -543,7 +543,7 @@ void CSAMWindow::checkFieldLimit(WORD action, WORD item)
ebt.ttiIcon = TTI_WARNING;
SendDlgItemMessage(m_handle, item, EM_SHOWBALLOONTIP, 0, (LPARAM)&ebt);
- TCHAR* ptszOutputText = (TCHAR*)mir_alloc((limit + 1) * sizeof(TCHAR));
+ wchar_t* ptszOutputText = (wchar_t*)mir_alloc((limit + 1) * sizeof(wchar_t));
GetDlgItemText(m_handle, item, ptszOutputText, limit + 1);
SetDlgItemText(m_handle, item, ptszOutputText);
mir_free(ptszOutputText);
@@ -562,7 +562,7 @@ void CSAMWindow::checkItemValidity()
if (m_item->m_iIcon != cbi.iImage)
m_item->m_iIcon = cbi.iImage, m_bChanged = TRUE;
- TCHAR tszInputMessage[EXTRASTATUS_MESSAGE_LIMIT];
+ wchar_t tszInputMessage[EXTRASTATUS_MESSAGE_LIMIT];
GetDlgItemText(m_handle, IDC_MESSAGE, tszInputMessage, _countof(tszInputMessage));
@@ -571,7 +571,7 @@ void CSAMWindow::checkItemValidity()
return;
WPARAM i = SendMessage(m_hCombo, CB_GETCURSEL, 0, 0) + 1;
- TCHAR tszTitle[100];
+ wchar_t tszTitle[100];
CUSTOM_STATUS cs = { sizeof(cs) };
cs.flags = CSSF_MASK_NAME | CSSF_DEFAULT_NAME | CSSF_TCHAR;
@@ -827,7 +827,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa
csw->toggleButtons();
csw->toggleEmptyListMessage();
csw->loadWindowPosition();
- SetWindowText(hwnd, TranslateT(MODULENAME));
+ SetWindowText(hwnd, MODULENAME);
return TRUE;
case WM_COMMAND:
@@ -852,7 +852,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa
case IDC_REMOVE:
if (getByte("ConfirmDeletion", DEFAULT_PLUGIN_CONFIRM_ITEMS_DELETION))
- if (MessageBox(hwnd, TranslateT("Do you really want to delete selected item?"), TranslateT(MODULENAME), MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION) == IDNO)
+ if (MessageBox(hwnd, TranslateT("Do you really want to delete selected item?"), TranslateTS(MODULENAME), MB_YESNO | MB_DEFBUTTON2 | MB_ICONQUESTION) == IDNO)
break;
csw->m_itemslist->m_list->remove(csw->m_listview->getPositionInList());
@@ -893,7 +893,7 @@ INT_PTR CALLBACK CSWindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lpa
else {
result = MessageBox(hwnd,
TranslateT("Do you want old database entries to be deleted after Import?"),
- TranslateT(MODULENAME), MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONQUESTION);
+ TranslateTS(MODULENAME), MB_YESNOCANCEL | MB_DEFBUTTON2 | MB_ICONQUESTION);
if (result == IDCANCEL)
break;
}
diff --git a/plugins/CSList/src/stdafx.h b/plugins/CSList/src/stdafx.h
index ddea917d2f..a99e42fe2d 100644
--- a/plugins/CSList/src/stdafx.h
+++ b/plugins/CSList/src/stdafx.h
@@ -54,8 +54,8 @@
// ====[ BASIC DEFINITIONS ]==================================================
-#define MODULENAME LPGEN("Custom Status List")
-#define MODNAME "CSList"
+#define MODULENAME LPGENW("Custom Status List")
+#define MODNAME "CSList"
// ====[ LIMITS ]=============================================================
@@ -103,8 +103,8 @@ typedef void(__cdecl *pForAllProtosFunc)(char*, void *);
struct StatusItem // list item structure
{
int m_iIcon;
- TCHAR m_tszTitle[EXTRASTATUS_TITLE_LIMIT];
- TCHAR m_tszMessage[EXTRASTATUS_MESSAGE_LIMIT];
+ wchar_t m_tszTitle[EXTRASTATUS_TITLE_LIMIT];
+ wchar_t m_tszMessage[EXTRASTATUS_MESSAGE_LIMIT];
BOOL m_bFavourite;
StatusItem()
@@ -130,25 +130,25 @@ struct StatusItem // list item structure
static struct CSForm { // icons + buttons
int idc;
- TCHAR* ptszTitle;
- TCHAR* ptszDescr;
+ wchar_t* ptszTitle;
+ wchar_t* ptszDescr;
char * pszIconIcoLib;
int iconNoIcoLib;
HANDLE hIcoLibItem;
} forms[] = {
- { -1, LPGENT("Main Menu"), LPGENT("Main Icon"), "icon", IDI_CSLIST },
- { IDC_ADD, LPGENT("Add new item"), LPGENT("Add"), "add", IDI_ADD },
- { IDC_MODIFY, LPGENT("Modify selected item"), LPGENT("Modify"), "modify", IDI_MODIFY },
- { IDC_REMOVE, LPGENT("Delete selected item"), LPGENT("Remove"), "remove", IDI_REMOVE },
- { IDC_FAVOURITE, LPGENT("Set/unset current item as favorite"), LPGENT("Favorite"), "favourite", IDI_FAVOURITE },
- { IDC_UNDO, LPGENT("Undo changes"), LPGENT("Undo changes"), "undo", IDI_UNDO },
- { IDC_IMPORT, LPGENT("Import statuses from database"), LPGENT("Import"), "import", IDI_IMPORT },
- { IDC_FILTER, LPGENT("Filter list"), LPGENT("Filter"), "filter", IDI_FILTER },
- { IDCLOSE, LPGENT("Close without changing custom status"), LPGENT("No change"), "nochng", IDI_CLOSE },
- { IDC_CANCEL, LPGENT("Clear custom status (reset to None) and close"), LPGENT("Clear"), "clear", IDI_UNSET },
- { IDOK, LPGENT("Set custom status to selected one and close"), LPGENT("Set"), "apply", IDI_APPLY }
+ { -1, LPGENW("Main Menu"), LPGENW("Main Icon"), "icon", IDI_CSLIST },
+ { IDC_ADD, LPGENW("Add new item"), LPGENW("Add"), "add", IDI_ADD },
+ { IDC_MODIFY, LPGENW("Modify selected item"), LPGENW("Modify"), "modify", IDI_MODIFY },
+ { IDC_REMOVE, LPGENW("Delete selected item"), LPGENW("Remove"), "remove", IDI_REMOVE },
+ { IDC_FAVOURITE, LPGENW("Set/unset current item as favorite"), LPGENW("Favorite"), "favourite", IDI_FAVOURITE },
+ { IDC_UNDO, LPGENW("Undo changes"), LPGENW("Undo changes"), "undo", IDI_UNDO },
+ { IDC_IMPORT, LPGENW("Import statuses from database"), LPGENW("Import"), "import", IDI_IMPORT },
+ { IDC_FILTER, LPGENW("Filter list"), LPGENW("Filter"), "filter", IDI_FILTER },
+ { IDCLOSE, LPGENW("Close without changing custom status"), LPGENW("No change"), "nochng", IDI_CLOSE },
+ { IDC_CANCEL, LPGENW("Clear custom status (reset to None) and close"), LPGENW("Clear"), "clear", IDI_UNSET },
+ { IDOK, LPGENW("Set custom status to selected one and close"), LPGENW("Set"), "apply", IDI_APPLY }
};
// ====[ MY BITCHY LIST IMPLEMENTATION x)) ]==================================
@@ -343,7 +343,7 @@ struct CSWindow
HIMAGELIST m_icons;
int m_statusCount;
BOOL m_bSomethingChanged;
- TCHAR* m_filterString;
+ wchar_t* m_filterString;
char * m_protoName;
CSWindow(char *protoName);
@@ -395,7 +395,7 @@ void addProtoStatusMenuItem(char *protoName);
// other functions
void IitIcoLib();
-void RegisterHotkeys(char buf[200], TCHAR* accName, int Number);
+void RegisterHotkeys(char buf[200], wchar_t* accName, int Number);
void SetStatus(WORD code, StatusItem* item, char *protoName);
// ====[ PROCEDURES ]=========================================================
diff --git a/plugins/CSList/src/strpos.h b/plugins/CSList/src/strpos.h
index 210bfddf0a..9ba847a395 100644
--- a/plugins/CSList/src/strpos.h
+++ b/plugins/CSList/src/strpos.h
@@ -32,9 +32,9 @@
*/
-# ifndef TCHAR
-# define TCHAR wchar_t
-# endif /* TCHAR */
+# ifndef wchar_t
+# define wchar_t wchar_t
+# endif /* wchar_t */
# define STRING wchar_t *
@@ -46,7 +46,7 @@ int strpos( STRING haystack, STRING needle )
int position;
#ifdef DEBUG_VERBOSE
- TCHAR lpBuf[1024];
+ wchar_t lpBuf[1024];
#endif /* def DEBUG_VERBOSE */
pDest = (STRING) wcsstr( haystack, needle );