From 6e53dfca72b932c4bdcd7aa02ca62bf8b2630eac Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 26 Jul 2016 09:20:25 +0000 Subject: 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 --- plugins/Popup/src/bitmap_funcs.cpp | 18 ++++++++--------- plugins/Popup/src/bitmap_funcs.h | 10 +++++----- plugins/Popup/src/config.cpp | 10 +++++----- plugins/Popup/src/config.h | 4 ++-- plugins/Popup/src/font.cpp | 32 ++++++++++++++--------------- plugins/Popup/src/font.h | 37 +++++++++++++++++----------------- plugins/Popup/src/formula.cpp | 10 +++++----- plugins/Popup/src/formula.h | 14 ++++++------- plugins/Popup/src/main.cpp | 18 ++++++++--------- plugins/Popup/src/notifications.cpp | 9 ++++----- plugins/Popup/src/opt_adv.cpp | 6 +++--- plugins/Popup/src/opt_class.cpp | 26 +++++++++++------------- plugins/Popup/src/opt_gen.cpp | 40 ++++++++++++++++++------------------- plugins/Popup/src/opt_skins.cpp | 34 +++++++++++++++---------------- plugins/Popup/src/opt_skins.h | 2 +- plugins/Popup/src/opttree.cpp | 22 ++++++++++---------- plugins/Popup/src/popup_gdiplus.cpp | 6 +++--- plugins/Popup/src/popup_gdiplus.h | 6 +++--- plugins/Popup/src/popup_thread.cpp | 2 +- plugins/Popup/src/popup_wnd2.cpp | 30 ++++++++++++++-------------- plugins/Popup/src/popup_wnd2.h | 18 ++++++++--------- plugins/Popup/src/services.cpp | 12 +++++------ plugins/Popup/src/skin.cpp | 38 +++++++++++++++++------------------ plugins/Popup/src/stdafx.h | 3 ++- 24 files changed, 203 insertions(+), 204 deletions(-) (limited to 'plugins/Popup/src') diff --git a/plugins/Popup/src/bitmap_funcs.cpp b/plugins/Popup/src/bitmap_funcs.cpp index 547ab99a0f..9e2c094464 100644 --- a/plugins/Popup/src/bitmap_funcs.cpp +++ b/plugins/Popup/src/bitmap_funcs.cpp @@ -55,7 +55,7 @@ MyBitmap::MyBitmap(int w, int h) allocate(w, h); } -MyBitmap::MyBitmap(const TCHAR *fn) +MyBitmap::MyBitmap(const wchar_t *fn) { dcBmp = 0; hBmp = 0; @@ -594,7 +594,7 @@ void MyBitmap::DrawIcon(HICON hic, int x, int y, int w, int h) DeleteObject(info.hbmMask); } -void MyBitmap::Draw_Text(TCHAR *str, int x, int y) +void MyBitmap::Draw_Text(wchar_t *str, int x, int y) { SIZE sz; GetTextExtentPoint32(this->getDC(), str, (int)mir_tstrlen(str), &sz); RECT rc; SetRect(&rc, x, y, x + 10000, y + 10000); @@ -676,11 +676,11 @@ static int hex2dec(char hex) return 0; } -bool MyBitmap::loadFromFile_pixel(const TCHAR *fn) +bool MyBitmap::loadFromFile_pixel(const wchar_t *fn) { allocate(1, 1); int r, g, b, a = 255; - const TCHAR *p = fn + mir_tstrlen(L"pixel:"); + const wchar_t *p = fn + mir_tstrlen(L"pixel:"); r = (hex2dec(p[0]) << 4) + hex2dec(p[1]); g = (hex2dec(p[2]) << 4) + hex2dec(p[3]); b = (hex2dec(p[4]) << 4) + hex2dec(p[5]); @@ -688,9 +688,9 @@ bool MyBitmap::loadFromFile_pixel(const TCHAR *fn) return true; } -bool MyBitmap::loadFromFile_gradient(const TCHAR *fn) +bool MyBitmap::loadFromFile_gradient(const wchar_t *fn) { - const TCHAR *p = fn + mir_tstrlen(L"gradient:"); + const wchar_t *p = fn + mir_tstrlen(L"gradient:"); if (*p == 'h') allocate(256, 1); else allocate(1, 256); @@ -720,14 +720,14 @@ bool MyBitmap::loadFromFile_gradient(const TCHAR *fn) return true; } -bool MyBitmap::loadFromFile(const TCHAR *fn) +bool MyBitmap::loadFromFile(const wchar_t *fn) { if (bits) freemem(); - if (!_tcsncmp(fn, L"pixel:", mir_tstrlen(L"pixel:"))) + if (!wcsncmp(fn, L"pixel:", mir_tstrlen(L"pixel:"))) return loadFromFile_pixel(fn); - if (!_tcsncmp(fn, L"gradient:", mir_tstrlen(L"gradient:"))) + if (!wcsncmp(fn, L"gradient:", mir_tstrlen(L"gradient:"))) return loadFromFile_gradient(fn); SIZE sz; diff --git a/plugins/Popup/src/bitmap_funcs.h b/plugins/Popup/src/bitmap_funcs.h index 64150200ee..bc1ab377eb 100644 --- a/plugins/Popup/src/bitmap_funcs.h +++ b/plugins/Popup/src/bitmap_funcs.h @@ -43,18 +43,18 @@ private: void freemem(); - bool loadFromFile_pixel(const TCHAR *fn); - bool loadFromFile_gradient(const TCHAR *fn); + bool loadFromFile_pixel(const wchar_t *fn); + bool loadFromFile_gradient(const wchar_t *fn); void premultipleChannels(); public: MyBitmap(); MyBitmap(int w, int h); - MyBitmap(const TCHAR *fn); + MyBitmap(const wchar_t *fn); ~MyBitmap(); void allocate(int w, int h); - bool loadFromFile(const TCHAR *fn); + bool loadFromFile(const wchar_t *fn); int getWidth() { return width; } int getHeight() { return height; } @@ -87,7 +87,7 @@ public: // void DrawPartColorized(MyBitmap *bmp, int x, int y, int w, int h, COLOR32 color); void DrawIcon(HICON hic, int x, int y, int w = 0, int h = 0); - void Draw_Text(TCHAR *str, int x, int y); + void Draw_Text(wchar_t *str, int x, int y); __forceinline COLOR32 *getBits() { return bits; } __forceinline COLOR32 *getRow(int row) { return bits + row * width; } diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index 29178f9182..233fcdf811 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -89,12 +89,12 @@ void LoadOptions() void PopupPreview() { - TCHAR *lptzTitle1Eng = TranslateT("The Jabberwocky"); - TCHAR *lptzText1Eng = TranslateT("`Twas brillig, and the slithy toves\r\nDid gyre and gimble in the wabe:\r\nAll mimsy were the borogoves,\r\nAnd the mome raths outgrabe.\r\n\t[b][i]Lewis Carroll, 1855[/i][/b]"); + wchar_t *lptzTitle1Eng = TranslateT("The Jabberwocky"); + wchar_t *lptzText1Eng = TranslateT("`Twas brillig, and the slithy toves\r\nDid gyre and gimble in the wabe:\r\nAll mimsy were the borogoves,\r\nAnd the mome raths outgrabe.\r\n\t[b][i]Lewis Carroll, 1855[/i][/b]"); - TCHAR *lptzTitle2 = TranslateT("Test preview for the popup plugin settings. This is supposed to be long enough not to fit in one line..."); - TCHAR *lptzText2 = TranslateTS( - LPGENT("This is a special test preview for the popup plugin settings. The text and title are quite long so you can tweak your skin and plugin settings to best fit your needs :)") + wchar_t *lptzTitle2 = TranslateT("Test preview for the popup plugin settings. This is supposed to be long enough not to fit in one line..."); + wchar_t *lptzText2 = TranslateTS( + LPGENW("This is a special test preview for the popup plugin settings. The text and title are quite long so you can tweak your skin and plugin settings to best fit your needs :)") ); POPUPDATA2 ppd = { 0 }; diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h index 60af91a679..34bc824053 100644 --- a/plugins/Popup/src/config.h +++ b/plugins/Popup/src/config.h @@ -193,7 +193,7 @@ typedef struct TestStruct{ } TESTSIZE; // Generic Message Box for Errors -#define MSGERROR(text) MessageBox(NULL, text, _T(MODULNAME_LONG), MB_OK | MB_ICONERROR) -#define MSGINFO (text) MessageBox(NULL, text, _T(MODULNAME_LONG), MB_OK | MB_ICONINFORMATION) +#define MSGERROR(text) MessageBox(NULL, text, MODULNAME_LONG, MB_OK | MB_ICONERROR) +#define MSGINFO (text) MessageBox(NULL, text, MODULNAME_LONG, MB_OK | MB_ICONINFORMATION) #endif // __config_h__ diff --git a/plugins/Popup/src/font.cpp b/plugins/Popup/src/font.cpp index 5c76722063..56b9c26eca 100644 --- a/plugins/Popup/src/font.cpp +++ b/plugins/Popup/src/font.cpp @@ -30,44 +30,44 @@ void InitFonts() // Fonts FontIDT fid = { 0 }; fid.cbSize = sizeof(FontIDT); - mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), _countof(fid.group)); + mir_tstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.group)); mir_strncpy(fid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(fid.dbSettingsGroup)); fid.flags = FIDF_DEFAULTVALID; fid.deffontsettings.charset = DEFAULT_CHARSET; fid.deffontsettings.size = -11; - mir_tstrncpy(fid.backgroundGroup, _T(PU_FNT_AND_COLOR), _countof(fid.backgroundGroup)); + mir_tstrncpy(fid.backgroundGroup, PU_FNT_AND_COLORW, _countof(fid.backgroundGroup)); mir_tstrncpy(fid.backgroundName, PU_COL_BACK_NAME, _countof(fid.backgroundName)); mir_tstrncpy(fid.deffontsettings.szFace, L"Tahoma", _countof(fid.deffontsettings.szFace)); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name)); mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TITLE); fid.deffontsettings.style = DBFONTF_BOLD; fid.deffontsettings.colour = RGB(0, 0, 0); FontRegisterT(&fid); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name)); mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_CLOCK); FontRegisterT(&fid); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name)); mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_TEXT); fid.deffontsettings.style = 0; FontRegisterT(&fid); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name)); mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_ACTION); fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS; fid.deffontsettings.colour = RGB(0, 0, 255); FontRegisterT(&fid); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name)); mir_snprintf(fid.prefix, PU_FNT_PREFIX, PU_FNT_NAME_HOVERED_ACTION); fid.deffontsettings.style = DBFONTF_UNDERLINE; FontRegisterT(&fid); ColourIDT cid = { 0 }; cid.cbSize = sizeof(ColourIDT); - mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group)); + mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group)); mir_strncpy(cid.dbSettingsGroup, PU_FNT_AND_COLOR_DB, _countof(cid.dbSettingsGroup)); mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name)); @@ -95,35 +95,35 @@ void ReloadFonts() LOGFONT lf = { 0 }; FontIDT fid = { 0 }; fid.cbSize = sizeof(FontIDT); - mir_tstrncpy(fid.group, _T(PU_FNT_AND_COLOR), _countof(fid.name)); + mir_tstrncpy(fid.group, PU_FNT_AND_COLORW, _countof(fid.name)); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TITLE), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_TITLE, _countof(fid.name)); fonts.clTitle = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.title = CreateFontIndirect(&lf); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_CLOCK), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_CLOCK, _countof(fid.name)); fonts.clClock = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.clock = CreateFontIndirect(&lf); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name)); fonts.clText = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.text = CreateFontIndirect(&lf); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_ACTION), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_ACTION, _countof(fid.name)); fonts.clAction = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.action = CreateFontIndirect(&lf); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_HOVERED_ACTION), _countof(fid.name)); + mir_tstrncpy(fid.name, PU_FNT_NAME_HOVERED_ACTION, _countof(fid.name)); fonts.clActionHover = (COLORREF)CallService(MS_FONT_GETT, (WPARAM)&fid, (LPARAM)&lf); fonts.actionHover = CreateFontIndirect(&lf); ColourIDT cid = { 0 }; cid.cbSize = sizeof(ColourIDT); - mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group)); + mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group)); mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name)); fonts.clBack = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf); - mir_tstrncpy(cid.group, _T(PU_FNT_AND_COLOR), _countof(cid.group)); + mir_tstrncpy(cid.group, PU_FNT_AND_COLORW, _countof(cid.group)); mir_tstrncpy(cid.name, PU_COL_AVAT_NAME, _countof(cid.name)); fonts.clAvatarBorder = (COLORREF)CallService(MS_COLOUR_GETT, (WPARAM)&cid, (LPARAM)&lf); diff --git a/plugins/Popup/src/font.h b/plugins/Popup/src/font.h index 0b6c53a307..0967bb4c12 100644 --- a/plugins/Popup/src/font.h +++ b/plugins/Popup/src/font.h @@ -25,26 +25,27 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define __font_h__ //basic constants for all popup plugins -#define PU_FNT_AND_COLOR LPGEN("Popups") //common main group for customice\font&color -#define PU_FNT_AND_COLOR_DB MODULNAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB); +#define PU_FNT_AND_COLOR LPGEN("Popups") //common main group for customice\font&color +#define PU_FNT_AND_COLORW LPGENW("Popups") //common main group for customice\font&color +#define PU_FNT_AND_COLOR_DB MODULNAME //use eg mir_strcpy(fid.dbSettingsGroup, PU_FNT_GROUP_DB); #define PU_FNT_PREFIX "fnt%s" //use eg mir_snprintf(fid.prefix, _countof(fid.prefix), PU_FNT_PREFIX, PU_FNT_NAME_....); -#define PU_FNT_NAME_TITLE LPGEN("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT -#define PU_FNT_NAME_CLOCK LPGEN("Clock") -#define PU_FNT_NAME_TEXT LPGEN("Text") -#define PU_FNT_NAME_ACTION LPGEN("Action") -#define PU_FNT_NAME_HOVERED_ACTION LPGEN("Hovered action") - -#define PU_COL_BACK_NAME LPGENT("Background") -#define PU_COL_BACK_SETTING "ColourBg" -#define PU_COL_BORD_NAME LPGENT("Border") -#define PU_COL_BORD_SETTING "ColourBorder" -#define PU_COL_SIDE_NAME LPGENT("Sidebar") -#define PU_COL_SIDE_SETTING "ColourSidebar" -#define PU_COL_LINE_NAME LPGENT("Title underline") -#define PU_COL_LINE_SETTING "ColourUnderline" -#define PU_COL_AVAT_NAME LPGENT("Avatar border") -#define PU_COL_AVAT_SETTING "ColourAvatarBorder" +#define PU_FNT_NAME_TITLE LPGENW("Title") //use eg mir_tstrcpy(fid.name, _T(FNT_NAME_....)) for FontIDT +#define PU_FNT_NAME_CLOCK LPGENW("Clock") +#define PU_FNT_NAME_TEXT LPGENW("Text") +#define PU_FNT_NAME_ACTION LPGENW("Action") +#define PU_FNT_NAME_HOVERED_ACTION LPGENW("Hovered action") + +#define PU_COL_BACK_NAME LPGENW("Background") +#define PU_COL_BACK_SETTING "ColourBg" +#define PU_COL_BORD_NAME LPGENW("Border") +#define PU_COL_BORD_SETTING "ColourBorder" +#define PU_COL_SIDE_NAME LPGENW("Sidebar") +#define PU_COL_SIDE_SETTING "ColourSidebar" +#define PU_COL_LINE_NAME LPGENW("Title underline") +#define PU_COL_LINE_SETTING "ColourUnderline" +#define PU_COL_AVAT_NAME LPGENW("Avatar border") +#define PU_COL_AVAT_SETTING "ColourAvatarBorder" struct PopupFonts { diff --git a/plugins/Popup/src/formula.cpp b/plugins/Popup/src/formula.cpp index c328f32503..601d0e6cca 100644 --- a/plugins/Popup/src/formula.cpp +++ b/plugins/Popup/src/formula.cpp @@ -28,7 +28,7 @@ static inline bool myisspace(char ch) return (ch >= 0) && (ch <= 32); } -int Formula::eval_neq(TCHAR *&s, Args *args, bool *vars) const +int Formula::eval_neq(wchar_t *&s, Args *args, bool *vars) const { int left = eval_sum(s, args, vars); while (*s) { @@ -50,7 +50,7 @@ int Formula::eval_neq(TCHAR *&s, Args *args, bool *vars) const return left; } -int Formula::eval_sum(TCHAR *&s, Args *args, bool *vars) const +int Formula::eval_sum(wchar_t *&s, Args *args, bool *vars) const { int left = eval_mul(s, args, vars); while (*s) { @@ -68,7 +68,7 @@ int Formula::eval_sum(TCHAR *&s, Args *args, bool *vars) const return left; } -int Formula::eval_mul(TCHAR *&s, Args *args, bool *vars) const +int Formula::eval_mul(wchar_t *&s, Args *args, bool *vars) const { int left = eval_atom(s, args, vars); while (*s) { @@ -91,7 +91,7 @@ int Formula::eval_mul(TCHAR *&s, Args *args, bool *vars) const return left; } -int Formula::eval_atom(TCHAR *&s, Args *args, bool *vars) const +int Formula::eval_atom(wchar_t *&s, Args *args, bool *vars) const { while (*s) { if (myisspace(*s)) { @@ -137,7 +137,7 @@ int Formula::eval_atom(TCHAR *&s, Args *args, bool *vars) const int Formula::eval(Args *args, bool *vars) const { if (vars) *vars = false; - TCHAR *s = m_str; + wchar_t *s = m_str; int res = eval_neq(s, args, vars); return res; } diff --git a/plugins/Popup/src/formula.h b/plugins/Popup/src/formula.h index a73908dd77..0abbc50565 100644 --- a/plugins/Popup/src/formula.h +++ b/plugins/Popup/src/formula.h @@ -72,17 +72,17 @@ public: }; private: - TCHAR *m_str; - int eval_neq(TCHAR *&s, Args *args, bool *vars) const; - int eval_sum(TCHAR *&s, Args *args, bool *vars) const; - int eval_mul(TCHAR *&s, Args *args, bool *vars) const; - int eval_atom(TCHAR *&s, Args *args, bool *vars) const; + wchar_t *m_str; + int eval_neq(wchar_t *&s, Args *args, bool *vars) const; + int eval_sum(wchar_t *&s, Args *args, bool *vars) const; + int eval_mul(wchar_t *&s, Args *args, bool *vars) const; + int eval_atom(wchar_t *&s, Args *args, bool *vars) const; public: Formula() :m_str(mir_tstrdup(L"")) {} - Formula(TCHAR *s) :m_str(mir_tstrdup(s)) {} + Formula(wchar_t *s) :m_str(mir_tstrdup(s)) {} ~Formula() { mir_free(m_str); } - void set(TCHAR *s){ mir_free(m_str); m_str = mir_tstrdup(s); } + void set(wchar_t *s){ mir_free(m_str); m_str = mir_tstrdup(s); } int eval(Args *args, bool *vars = 0) const; }; diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 39e20dae06..ff38a8977a 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -148,14 +148,14 @@ INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM) // The action to do is "disable popups" (show disabled) and we must write "enable popup" in the new item. PopupOptions.ModuleIsEnabled = FALSE; db_set_b(NULL, "Popup", "ModuleIsEnabled", FALSE); - Menu_ModifyItem(hMenuItem, LPGENT("Enable Popups"), hIcon = GetIconHandle(IDI_NOPOPUP)); + Menu_ModifyItem(hMenuItem, LPGENW("Enable Popups"), hIcon = GetIconHandle(IDI_NOPOPUP)); } else { // The module is disabled. // The action to do is enable popups (show enabled), then write "disable popup" in the new item. PopupOptions.ModuleIsEnabled = TRUE; db_set_b(NULL, "Popup", "ModuleIsEnabled", TRUE); - Menu_ModifyItem(hMenuItem, LPGENT("Disable Popups"), hIcon = GetIconHandle(IDI_POPUP)); + Menu_ModifyItem(hMenuItem, LPGENW("Disable Popups"), hIcon = GetIconHandle(IDI_POPUP)); } Menu_ModifyItem(hMenuRoot, NULL, hIcon); @@ -180,14 +180,14 @@ void InitMenuItems(void) HANDLE hIcon = GetIconHandle(PopupOptions.ModuleIsEnabled ? IDI_POPUP : IDI_NOPOPUP); // Build main menu - hMenuRoot = mi.root = Menu_CreateRoot(MO_MAIN, LPGENT(MODULNAME_PLU), -1000000000, hIcon); + hMenuRoot = mi.root = Menu_CreateRoot(MO_MAIN, MODULNAME_PLUW, -1000000000, hIcon); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "3F5B5AB5-46D8-469E-8951-50B287C59037"); // Add item to main menu SET_UID(mi, 0x4353d44e, 0x177, 0x4843, 0x88, 0x30, 0x25, 0x5d, 0x91, 0xad, 0xdf, 0x3f); mi.pszService = MENUCOMMAND_SVC; CreateServiceFunction(mi.pszService, svcEnableDisableMenuCommand); - mi.name.t = PopupOptions.ModuleIsEnabled ? LPGENT("Disable Popups") : LPGENT("Enable Popups"); + mi.name.w = PopupOptions.ModuleIsEnabled ? LPGENW("Disable Popups") : LPGENW("Enable Popups"); mi.hIcolibItem = hIcon; hMenuItem = Menu_AddMainMenuItem(&mi); @@ -196,7 +196,7 @@ void InitMenuItems(void) mi.pszService = MENUCOMMAND_HISTORY; CreateServiceFunction(mi.pszService, svcShowHistory); mi.position = 1000000000; - mi.name.t = LPGENT("Popup History"); + mi.name.w = LPGENW("Popup History"); mi.hIcolibItem = GetIconHandle(IDI_HISTORY); hMenuItemHistory = Menu_AddMainMenuItem(&mi); } @@ -213,14 +213,14 @@ void LoadHotkey() HOTKEYDESC hk = { sizeof(hk) }; hk.dwFlags = HKD_TCHAR; hk.pszName = "Toggle Popups"; - hk.ptszDescription = LPGENT("Toggle Popups"); - hk.ptszSection = LPGENT(MODULNAME_PLU); + hk.ptszDescription = LPGENW("Toggle Popups"); + hk.ptszSection = MODULNAME_PLUW; hk.pszService = MENUCOMMAND_SVC; Hotkey_Register(&hk); // 'Popup History' Hotkey hk.pszName = "Popup History"; - hk.ptszDescription = LPGENT("Popup History"); + hk.ptszDescription = LPGENW("Popup History"); hk.pszService = MENUCOMMAND_HISTORY; Hotkey_Register(&hk); } @@ -339,7 +339,7 @@ MIRAPI int Load(void) PopupHistoryLoad(); LoadPopupThread(); if (!LoadPopupWnd2()) { - MessageBox(0, TranslateT("Error: I could not register the Popup Window class.\r\nThe plugin will not operate."), _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK); + MessageBox(0, TranslateT("Error: I could not register the Popup Window class.\r\nThe plugin will not operate."), MODULNAME_LONG, MB_ICONSTOP | MB_OK); return 0; // We couldn't register our Window Class, don't hook any event: the plugin will act as if it was disabled. } RegisterOptPrevBox(); diff --git a/plugins/Popup/src/notifications.cpp b/plugins/Popup/src/notifications.cpp index be9c78a595..9958db8c7d 100644 --- a/plugins/Popup/src/notifications.cpp +++ b/plugins/Popup/src/notifications.cpp @@ -87,7 +87,7 @@ void UnloadTreeData() gTreeData.destroy(); } -void SaveNotificationSettings(POPUPTREEDATA *ptd, char* szModul) +void SaveNotificationSettings(POPUPTREEDATA *ptd, char *szModul) { if (ptd->typ == 1) { char setting[2 * MAXMODULELABELLENGTH]; @@ -137,7 +137,6 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul) { if (ptd->typ == 1) { char setting[2 * MAXMODULELABELLENGTH]; - char *szTmp = NULL; mir_snprintf(setting, "{%s/%s}enabled", ptd->notification.lpzGroup, ptd->notification.lpzName); ptd->enabled = @@ -157,7 +156,7 @@ void LoadNotificationSettings(POPUPTREEDATA *ptd, char* szModul) db_get_b(NULL, szModul, setting, 0); mir_snprintf(setting, "{%s/%s}leftAction", ptd->notification.lpzGroup, ptd->notification.lpzName); - szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction); + char *szTmp = db_get_s(NULL, szModul, setting, ptd->notification.lpzLAction); mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction)); mir_free(szTmp); szTmp = NULL; @@ -186,7 +185,7 @@ HANDLE RegisterNotification(POPUPNOTIFICATION *notification) FontID fontid = { 0 }; fontid.cbSize = sizeof(fontid); - mir_snprintf(fontid.group, PU_FNT_AND_COLOR"/%s", notification->lpzGroup); + mir_snprintf(fontid.group, PU_FNT_AND_COLOR "/%s", notification->lpzGroup); mir_strcpy(fontid.dbSettingsGroup, "PopupNotifications"); fontid.flags = FIDF_DEFAULTVALID; fontid.deffontsettings.charset = DEFAULT_CHARSET; @@ -297,7 +296,7 @@ bool PerformAction(HANDLE hNotification, HWND hwnd, UINT message, WPARAM wparam, } for (int i = 0; i < ptd->notification.actionCount; ++i) { - if (!(ptd->notification.lpActions[i].dwFlags&PNAF_CALLBACK)) + if (!(ptd->notification.lpActions[i].dwFlags & PNAF_CALLBACK)) continue; if (mir_strcmp(ptd->notification.lpActions[i].lpzTitle, lpzAction)) continue; diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index 48c3c75b59..323bd1ce7b 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -29,7 +29,7 @@ LRESULT CALLBACK AvatarTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP LRESULT CALLBACK AlphaTrackBarWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam); // effekt name for drop down box -LIST g_lstPopupVfx(5, _tcsicmp); +LIST g_lstPopupVfx(5, wcsicmp); void OptAdv_RegisterVfx(char *name) { g_lstPopupVfx.insert(mir_a2t(name)); @@ -78,7 +78,7 @@ void LoadOption_AdvOpts() INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) { - TCHAR tstr[64]; + wchar_t tstr[64]; static bool bDlgInit = false; // some controls send WM_COMMAND before or during WM_INITDIALOG UINT idCtrl; @@ -88,7 +88,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM { hwndBox = CreateWindowEx( WS_EX_TOOLWINDOW | WS_EX_TOPMOST, // dwStyleEx - _T(BOXPREVIEW_WNDCLASS), // Class name + BOXPREVIEW_WNDCLASS, // Class name NULL, // Title DS_SETFONT | DS_FIXEDSYS | WS_POPUP, // dwStyle CW_USEDEFAULT, // x diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp index abfb394d88..170603d799 100644 --- a/plugins/Popup/src/opt_class.cpp +++ b/plugins/Popup/src/opt_class.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //--------------------------------------------------------------------------- // Workaround for MS bug ComboBox_SelectItemData -int ComboBox_SelectItem(HWND hwndCtl, char* data) { +int ComboBox_SelectItem(HWND hwndCtl, char *data) { int i = 0; for (i; i < ComboBox_GetCount(hwndCtl); i++) { if (mir_strcmp(data, (char*)ComboBox_GetItemData(hwndCtl, i)) == 0) { @@ -186,7 +186,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l for (i = 0; i < gTreeData.getCount(); ++i) { POPUPTREEDATA *p = gTreeData[i]; - TCHAR itemName[MAXMODULELABELLENGTH]; + wchar_t itemName[MAXMODULELABELLENGTH]; int iconIndex; if (p->typ == 1) { // Treeview part for typ 1 (notification) @@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l } else { // Treeview part typ 2 (popup class api) iconIndex = ImageList_ReplaceIcon(hImgLst, -1, p->pupClass.hIcon); - mir_sntprintf(itemName, L"%s/%s", LPGENT("CLASS Plugins"), p->pszDescription); + mir_sntprintf(itemName, L"%s/%s", LPGENW("CLASS Plugins"), p->pszDescription); } OptTree_AddItem(hwndTree, itemName, (LPARAM)p, iconIndex); } @@ -396,14 +396,14 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l switch (idCtrl) { case IDC_LACTION: mir_strncpy(ptd->leftAction, - (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)), - sizeof(ptd->leftAction)); + (char*)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)), + _countof(ptd->leftAction)); SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case IDC_RACTION: mir_strncpy(ptd->rightAction, - (char *)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)), - sizeof(ptd->rightAction)); + (char*)ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)), + _countof(ptd->rightAction)); SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; } @@ -490,8 +490,6 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul) { char setting[2 * MAXMODULELABELLENGTH]; - char *szTmp = NULL; - mir_snprintf(setting, "%s/enabled", ptd->pupClass.pszName); ptd->enabled = (signed char)db_get_b(NULL, szModul, setting, TRUE); @@ -506,14 +504,14 @@ void LoadClassSettings(POPUPTREEDATA *ptd, char* szModul) ptd->pupClass.iSeconds ? ptd->pupClass.iSeconds : PopupOptions.Seconds); mir_snprintf(setting, "%s/leftAction", ptd->pupClass.pszName); - szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ?? - mir_strncpy(ptd->leftAction, szTmp, sizeof(ptd->leftAction)); - mir_free(szTmp); szTmp = NULL; + char *szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_NOTHING); // standart ?? + mir_strncpy(ptd->leftAction, szTmp, _countof(ptd->leftAction)); + mir_free(szTmp); mir_snprintf(setting, "%s/rightAction", ptd->pupClass.pszName); szTmp = db_get_s(NULL, szModul, setting, POPUP_ACTION_DISMISS); // standart ?? - mir_strncpy(ptd->rightAction, szTmp, sizeof(ptd->rightAction)); - mir_free(szTmp); szTmp = NULL; + mir_strncpy(ptd->rightAction, szTmp, _countof(ptd->rightAction)); + mir_free(szTmp); } void SaveClassSettings(POPUPTREEDATA *ptd, char* szModul) diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index d10a95f507..70272f8176 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -47,7 +47,7 @@ int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag) if (!flag) return pos; options[pos].dwFlag = flag; options[pos].groupId = OPTTREE_CHECK; - options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR) * mir_tstrlen(prefix) + 32); + options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t) * mir_tstrlen(prefix) + 32); options[pos].pszSettingName = mir_tstrdup(prefix); options[pos].iconIndex = 0; @@ -55,16 +55,16 @@ int AddStatusMode(OPTTREE_OPTION *options, int pos, LPTSTR prefix, DWORD flag) mir_tstrcat(options[pos].pszOptionName, L"/"); switch (flag) { - case PF2_IDLE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Offline")); break; - case PF2_ONLINE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Online")); break; - case PF2_INVISIBLE: mir_tstrcat(options[pos].pszOptionName, LPGENT("Invisible")); break; - case PF2_SHORTAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENT("Away")); break; - case PF2_LONGAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENT("Not available")); break; - case PF2_LIGHTDND: mir_tstrcat(options[pos].pszOptionName, LPGENT("Occupied")); break; - case PF2_HEAVYDND: mir_tstrcat(options[pos].pszOptionName, LPGENT("Do not disturb")); break; - case PF2_FREECHAT: mir_tstrcat(options[pos].pszOptionName, LPGENT("Free for chat")); break; - case PF2_OUTTOLUNCH: mir_tstrcat(options[pos].pszOptionName, LPGENT("Out to lunch")); break; - case PF2_ONTHEPHONE: mir_tstrcat(options[pos].pszOptionName, LPGENT("On the phone")); break; + case PF2_IDLE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Offline")); break; + case PF2_ONLINE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Online")); break; + case PF2_INVISIBLE: mir_tstrcat(options[pos].pszOptionName, LPGENW("Invisible")); break; + case PF2_SHORTAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENW("Away")); break; + case PF2_LONGAWAY: mir_tstrcat(options[pos].pszOptionName, LPGENW("Not available")); break; + case PF2_LIGHTDND: mir_tstrcat(options[pos].pszOptionName, LPGENW("Occupied")); break; + case PF2_HEAVYDND: mir_tstrcat(options[pos].pszOptionName, LPGENW("Do not disturb")); break; + case PF2_FREECHAT: mir_tstrcat(options[pos].pszOptionName, LPGENW("Free for chat")); break; + case PF2_OUTTOLUNCH: mir_tstrcat(options[pos].pszOptionName, LPGENW("Out to lunch")); break; + case PF2_ONTHEPHONE: mir_tstrcat(options[pos].pszOptionName, LPGENW("On the phone")); break; } return pos + 1; } @@ -151,7 +151,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // Dynamic Resize CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopupOptions.DynamicResize ? BST_CHECKED : BST_UNCHECKED); - SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENT("Maximum width") : LPGENT("Width")); + SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENW("Maximum width") : LPGENW("Width")); // Minimum Width CheckDlgButton(hwnd, IDC_USEMINIMUMWIDTH, PopupOptions.UseMinimumWidth ? BST_CHECKED : BST_UNCHECKED); SendDlgItemMessage(hwnd, IDC_MINIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN)); @@ -217,15 +217,15 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM statusOptions = new OPTTREE_OPTION[statusOptionsCount]; - int pos = AddStatusModes(statusOptions, 0, LPGENT("Global Status"), globalFlags); + int pos = AddStatusModes(statusOptions, 0, LPGENW("Global Status"), globalFlags); for (int i = 0; i < protocolCount; ++i) { if (!protocols[i]->bIsVirtual) { DWORD protoFlags = CallProtoService(protocols[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0); if (!CountStatusModes(protoFlags)) continue; - TCHAR prefix[128]; - mir_sntprintf(prefix, LPGENT("Protocol Status")L"/%s", protocols[i]->tszAccountName); + wchar_t prefix[128]; + mir_sntprintf(prefix, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName); pos = AddStatusModes(statusOptions, pos, prefix, protoFlags); } } @@ -242,12 +242,12 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM char prefix[128]; mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName); - TCHAR pszSettingName[256]; - mir_sntprintf(pszSettingName, LPGENT("Protocol Status")L"/%s", protocols[i]->tszAccountName); + wchar_t pszSettingName[256]; + mir_sntprintf(pszSettingName, LPGENW("Protocol Status")L"/%s", protocols[i]->tszAccountName); OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, prefix, 0), pszSettingName); } } - OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENT("Global Status")); + OptTree_SetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, db_get_dw(NULL, MODULNAME, "Global Status", 0), LPGENW("Global Status")); } TranslateDialogDefault(hwnd); // do it on end of WM_INITDIALOG @@ -528,7 +528,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM char prefix[128]; mir_snprintf(prefix, "Protocol Status/%s", protocols[i]->szModuleName); - TCHAR pszSettingName[256]; + wchar_t pszSettingName[256]; mir_sntprintf(pszSettingName, L"Protocol Status/%s", protocols[i]->tszAccountName); db_set_dw(NULL, MODULNAME, prefix, OptTree_GetOptions(hwnd, IDC_STATUSES, statusOptions, statusOptionsCount, pszSettingName)); } @@ -580,7 +580,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM void ErrorMSG(int minValue, int maxValue) { - TCHAR str[128]; + wchar_t str[128]; mir_sntprintf(str, TranslateT("You cannot specify a value lower than %d and higher than %d."), minValue, maxValue); MSGERROR(str); } diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 867d70319b..a86b82c380 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -42,12 +42,12 @@ void RegisterOptPrevBox() wcl.hCursor = LoadCursor(NULL, IDC_ARROW); wcl.hbrBackground = NULL; // (HBRUSH)GetStockObject(LTGRAY_BRUSH); wcl.lpszMenuName = NULL; - wcl.lpszClassName = _T(BOXPREVIEW_WNDCLASS); + wcl.lpszClassName = BOXPREVIEW_WNDCLASS; wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); g_wndClass.cPopupPreviewBoxWndclass = RegisterClassEx(&wcl); err = GetLastError(); if (!g_wndClass.cPopupPreviewBoxWndclass) { - TCHAR msg[1024]; + wchar_t msg[1024]; mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName); MSGERROR(msg); } @@ -61,7 +61,7 @@ void RegisterOptPrevBox() g_wndClass.cPopupPlusDlgBox = RegisterClassEx(&wcl); err = GetLastError(); if (!g_wndClass.cPopupPlusDlgBox) { - TCHAR msg[1024]; + wchar_t msg[1024]; mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName); MSGERROR(msg); } @@ -185,7 +185,7 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos options[pos].groupId = OPTTREE_CHECK; options[pos].iconIndex = 0; options[pos].pszSettingName = mir_tstrdup(L"Skin options"); - options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*( + options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t)*( mir_tstrlen(options[pos].pszSettingName) + mir_strlen(skin->getFlagName(i)) + 10)); wsprintf(options[pos].pszOptionName, L"%s/%hs", options[pos].pszSettingName, skin->getFlagName(i)); // !!!!!!!!!!!!! @@ -201,12 +201,12 @@ int SkinOptionList_AddSkin(OPTTREE_OPTION* &options, int *OptionsCount, int pos ///////////////////////////////////////////////////////////////////////////////////////// static LPTSTR mainOption[] = { - LPGENT("Show clock"), - LPGENT("Drop shadow effect"), - LPGENT("Drop shadow effect") L"/" LPGENT("non rectangular"), - LPGENT("Enable Aero Glass (Vista+)"), - LPGENT("Use Windows colors"), - LPGENT("Use advanced text render") }; + LPGENW("Show clock"), + LPGENW("Drop shadow effect"), + LPGENW("Drop shadow effect") L"/" LPGENW("non rectangular"), + LPGENW("Enable Aero Glass (Vista+)"), + LPGENW("Use Windows colors"), + LPGENW("Use advanced text render") }; int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, DWORD *dwGlobalOptions) { @@ -245,8 +245,8 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, options[pos].dwFlag = (1 << i); options[pos].groupId = OPTTREE_CHECK; options[pos].iconIndex = 0; - options[pos].pszSettingName = mir_tstrdup(LPGENT("Global settings")); - options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(TCHAR)*( + options[pos].pszSettingName = mir_tstrdup(LPGENW("Global settings")); + options[pos].pszOptionName = (LPTSTR)mir_alloc(sizeof(wchar_t)*( mir_tstrlen(options[pos].pszSettingName) + mir_tstrlen(mainOption[i]) + 10)); wsprintf(options[pos].pszOptionName, L"%s/%s", options[pos].pszSettingName, mainOption[i]); // !!!!!!!!!!!!! @@ -403,7 +403,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR break; case IDC_BTN_RELOAD: - LPTSTR pszOldSkin = NEWTSTR_ALLOCA(PopupOptions.SkinPack); + LPTSTR pszOldSkin = NEWWSTR_ALLOCA(PopupOptions.SkinPack); skins.load(); hCtrl = GetDlgItem(hwndDlg, IDC_SKINLIST); ListBox_ResetContent(hCtrl); @@ -414,7 +414,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR ListBox_SetCurSel(hCtrl, ListBox_FindString(hCtrl, 0, PopupOptions.SkinPack)); // make shure we have select skin (ListBox_SetCurSel may be fail) - TCHAR szNewSkin[128]; + wchar_t szNewSkin[128]; ListBox_GetText(hCtrl, ListBox_GetCurSel(hCtrl), &szNewSkin); if (mir_tstrcmp(pszOldSkin, szNewSkin) != 0) { mir_free(PopupOptions.SkinPack); @@ -440,7 +440,7 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR { // Skin list change mir_free(PopupOptions.SkinPack); - PopupOptions.SkinPack = mir_tstrdup((TCHAR *)SendDlgItemMessage( + PopupOptions.SkinPack = mir_tstrdup((wchar_t *)SendDlgItemMessage( hwndDlg, IDC_SKINLIST, LB_GETITEMDATA, @@ -550,12 +550,12 @@ static void BoxPreview_OnPaint(HWND hwnd, HDC mydc, int mode) rc.left += 30; // 10+16+4 -- icon rc.right -= (rc.right - rc.left) / 3; rc.bottom -= (rc.bottom - rc.top) / 3; - DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER); + DrawText(mydc, MODULNAME_LONG, -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER); GetClientRect(hwnd, &rc); rc.left += 30; // 10+16+4 -- icon rc.left += (rc.right - rc.left) / 3; rc.top += (rc.bottom - rc.top) / 3; - DrawText(mydc, _T(MODULNAME_LONG), -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER); + DrawText(mydc, MODULNAME_LONG, -1, &rc, DT_CENTER | DT_NOPREFIX | DT_SINGLELINE | DT_VCENTER); GetClientRect(hwnd, &rc); FrameRect(mydc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH)); SelectObject(mydc, hfnt); diff --git a/plugins/Popup/src/opt_skins.h b/plugins/Popup/src/opt_skins.h index 6179ad35fb..e6200d6e25 100644 --- a/plugins/Popup/src/opt_skins.h +++ b/plugins/Popup/src/opt_skins.h @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef CS_DROPSHADOW #define CS_DROPSHADOW 0x00020000 #endif -#define BOXPREVIEW_WNDCLASS "PopupPreviewBoxWndclass" +#define BOXPREVIEW_WNDCLASS L"PopupPreviewBoxWndclass" void RegisterOptPrevBox(); diff --git a/plugins/Popup/src/opttree.cpp b/plugins/Popup/src/opttree.cpp index 1bacdf0212..c86ec17fb2 100644 --- a/plugins/Popup/src/opttree.cpp +++ b/plugins/Popup/src/opttree.cpp @@ -27,7 +27,7 @@ enum { IMG_GROUP, IMG_CHECK, IMG_NOCHECK, IMG_RCHECK, IMG_NORCHECK, IMG_GRPOPEN, static void OptTree_TranslateItem(HWND hwndTree, HTREEITEM hItem) { - TCHAR buf[64]; + wchar_t buf[64]; TVITEM tvi = { 0 }; tvi.mask = TVIF_HANDLE | TVIF_TEXT; @@ -65,10 +65,10 @@ void OptTree_Translate(HWND hwndTree) } } -HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHAR *name) +HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const wchar_t *name) { TVITEM tvi = { 0 }; - TCHAR str[MAX_PATH]; + wchar_t str[MAX_PATH]; if (hItem) tvi.hItem = TreeView_GetChild(hwndTree, hItem); @@ -95,9 +95,9 @@ HTREEITEM OptTree_FindNamedTreeItemAt(HWND hwndTree, HTREEITEM hItem, const TCHA HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconIndex) { - TCHAR itemName[1024]; + wchar_t itemName[1024]; - TCHAR *sectionName; + wchar_t *sectionName; int sectionLevel = 0; HTREEITEM hSection = NULL, result = NULL; @@ -106,10 +106,10 @@ HTREEITEM OptTree_AddItem(HWND hwndTree, LPTSTR name, LPARAM lParam, int iconInd while (sectionName) { // allow multi-level tree - TCHAR *pItemName = sectionName; + wchar_t *pItemName = sectionName; HTREEITEM hItem; - if (sectionName = _tcschr(sectionName, '/')) { + if (sectionName = wcschr(sectionName, '/')) { // one level deeper *sectionName = 0; sectionName++; @@ -154,7 +154,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res case WM_INITDIALOG: { int indx; - TCHAR itemName[1024]; + wchar_t itemName[1024]; HIMAGELIST hImgLst; TreeView_SelectItem(hwndTree, NULL); @@ -172,7 +172,7 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res /* build options tree. based on code from IcoLib */ for (indx = 0; indx < optionCount; indx++) { - TCHAR *sectionName; + wchar_t *sectionName; int sectionLevel = 0; HTREEITEM hSection = NULL; @@ -181,10 +181,10 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM, LPARAM lparam, int *res while (sectionName) { // allow multi-level tree - TCHAR *pItemName = sectionName; + wchar_t *pItemName = sectionName; HTREEITEM hItem; - if (sectionName = _tcschr(sectionName, '/')) { + if (sectionName = wcschr(sectionName, '/')) { // one level deeper *sectionName = 0; sectionName++; diff --git a/plugins/Popup/src/popup_gdiplus.cpp b/plugins/Popup/src/popup_gdiplus.cpp index 0f6212d7e9..4c788a0679 100644 --- a/plugins/Popup/src/popup_gdiplus.cpp +++ b/plugins/Popup/src/popup_gdiplus.cpp @@ -99,7 +99,7 @@ HBITMAP SkinEngine_CreateDIB32(int cx, int cy) } -BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName) +BOOL GDIPlus_IsAnimatedGIF(wchar_t * szName) { int nFrameCount = 0; Image image(szName); @@ -118,7 +118,7 @@ BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName) return (BOOL)(nFrameCount > 1) && image.GetWidth() && image.GetHeight(); } -void GDIPlus_GetGIFSize(TCHAR *szName, int *width, int *height) +void GDIPlus_GetGIFSize(wchar_t *szName, int *width, int *height) { Image image(szName); @@ -126,7 +126,7 @@ void GDIPlus_GetGIFSize(TCHAR *szName, int *width, int *height) *height = image.GetHeight(); } -void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar) +void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar) { int nFrameCount = 0; Bitmap image(szName); diff --git a/plugins/Popup/src/popup_gdiplus.h b/plugins/Popup/src/popup_gdiplus.h index bd67c5efd2..a398e686f9 100644 --- a/plugins/Popup/src/popup_gdiplus.h +++ b/plugins/Popup/src/popup_gdiplus.h @@ -26,8 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. void LoadGDIPlus(); void UnloadGDIPlus(); -BOOL GDIPlus_IsAnimatedGIF(TCHAR * szName); -void GDIPlus_GetGIFSize(TCHAR * szName, int * width, int * height); -void GDIPlus_ExtractAnimatedGIF(TCHAR *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar); +BOOL GDIPlus_IsAnimatedGIF(wchar_t * szName); +void GDIPlus_GetGIFSize(wchar_t * szName, int * width, int * height); +void GDIPlus_ExtractAnimatedGIF(wchar_t *szName, int width, int height, HBITMAP &pBitmap, int* &pframesDelay, int &pframesCount, SIZE &pSizeAvatar); #endif // __popup_gdiplus_h__ diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 6b2a5e70bd..a2a42b263d 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -231,7 +231,7 @@ static unsigned __stdcall PopupThread(void *) g_wndClass.cPopupThreadManagerWnd = RegisterClassEx(&wcl); err = GetLastError(); if (!g_wndClass.cPopupThreadManagerWnd) { - TCHAR msg[1024]; + wchar_t msg[1024]; mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName); MSGERROR(msg); } diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 1527c641de..b64c225c26 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "bitmap_funcs.h" #include -#define POPUP_WNDCLASS "PopupWnd2" +#define POPUP_WNDCLASS L"PopupWnd2" #ifndef CS_DROPSHADOW #define CS_DROPSHADOW 0x00020000 @@ -54,15 +54,15 @@ bool LoadPopupWnd2() wcl.hInstance = hInst; wcl.hCursor = LoadCursor(NULL, IDC_ARROW); wcl.hbrBackground = (HBRUSH)GetStockObject(LTGRAY_BRUSH); - wcl.lpszClassName = _T(POPUP_WNDCLASS); + wcl.lpszClassName = POPUP_WNDCLASS; wcl.hIconSm = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_POPUP), IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_DEFAULTCOLOR); g_wndClass.cPopupWnd2 = RegisterClassEx(&wcl); DWORD err = GetLastError(); if (!g_wndClass.cPopupWnd2) { res = false; - TCHAR msg[1024]; + wchar_t msg[1024]; mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName); - MessageBox(NULL, msg, _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK); + MessageBox(NULL, msg, MODULNAME_LONG, MB_ICONSTOP | MB_OK); } WNDCLASSEX wclw = { 0 }; @@ -75,7 +75,7 @@ bool LoadPopupWnd2() g_wndClass.cPopupEditBox = RegisterClassEx(&wclw); err = GetLastError(); if (!g_wndClass.cPopupEditBox) { - TCHAR msg[2048]; + wchar_t msg[2048]; mir_sntprintf(msg, TranslateT("Failed to register custom edit box window class.\r\n\r\ncbSize: %i\r\nstyle: %p\r\nlpfnWndProc: %i\r\ncbClsExtra: %i\r\ncbWndExtra: %i\r\nhInstance: %i\r\nhIcon: %i\r\nhCursor: %i\r\nhbrBackground: %i\r\nlpszMenuName: %s\r\nlpszClassName: %s\r\nhIconSm: %i\r\n"), wclw.cbSize, wclw.style, wclw.lpfnWndProc, wclw.cbClsExtra, wclw.cbWndExtra, wclw.hInstance, wclw.hIcon, wclw.hCursor, wclw.hbrBackground, wclw.lpszMenuName, wclw.lpszClassName, wclw.hIconSm); @@ -100,7 +100,7 @@ bool LoadPopupWnd2() err = GetLastError(); if (!g_wndClass.cPopupMenuHostWnd) { res = false; - TCHAR msg[1024]; + wchar_t msg[1024]; mir_sntprintf(msg, TranslateT("Failed to register %s class."), wcl.lpszClassName); MSGERROR(msg); } @@ -166,7 +166,7 @@ void PopupWnd2::create() m_hwnd = CreateWindowEx( WS_EX_TRANSPARENT | // prevents unwanted clicks WS_EX_TOOLWINDOW | WS_EX_TOPMOST, // dwStyleEx - _T(POPUP_WNDCLASS), // Class name + POPUP_WNDCLASS, // Class name NULL, // Title DS_SETFONT | DS_FIXEDSYS | WS_POPUP, // dwStyle CW_USEDEFAULT, // x @@ -485,7 +485,7 @@ void PopupWnd2::hide() // hwnd = 0; } -bool __forceinline isTextEmpty(TCHAR *text) +bool __forceinline isTextEmpty(wchar_t *text) { if (!text) return true; @@ -765,7 +765,7 @@ void PopupWnd2::buildMText() } } -void PopupWnd2::updateText(TCHAR *text) +void PopupWnd2::updateText(wchar_t *text) { if (m_lptzText) { replaceStrT(m_lptzText, text); @@ -775,7 +775,7 @@ void PopupWnd2::updateText(TCHAR *text) m_bTextEmpty = ::isTextEmpty(m_lptzText); } -void PopupWnd2::updateTitle(TCHAR *title) +void PopupWnd2::updateTitle(wchar_t *title) { if (m_lptzTitle) { replaceStrT(m_lptzTitle, title); @@ -831,7 +831,7 @@ LRESULT CALLBACK ReplyEditWndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM case WM_KEYDOWN: switch (wParam) { case VK_RETURN: - TCHAR msg[2048]; + wchar_t msg[2048]; GetWindowText(hwnd, msg, _countof(msg)); if (mir_wstrlen(msg) == 0) { DestroyWindow(hwnd); @@ -983,8 +983,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara if (OpenClipboard(m_hwnd)) { EmptyClipboard(); - HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (tszText.GetLength() + 1) * sizeof(TCHAR)); - TCHAR *buffer = (TCHAR *)GlobalLock(clipbuffer); + HGLOBAL clipbuffer = GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, (tszText.GetLength() + 1) * sizeof(wchar_t)); + wchar_t *buffer = (wchar_t *)GlobalLock(clipbuffer); mir_tstrcpy(buffer, tszText); GlobalUnlock(clipbuffer); SetClipboardData(CF_UNICODETEXT, clipbuffer); @@ -1132,8 +1132,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara case UM_CHANGEPOPUP: switch (wParam) { - case CPT_TEXTW: updateText((TCHAR *)lParam); mir_free((void *)lParam); break; - case CPT_TITLEW: updateTitle((TCHAR *)lParam); mir_free((void *)lParam); break; + case CPT_TEXTW: updateText((wchar_t *)lParam); mir_free((void *)lParam); break; + case CPT_TITLEW: updateTitle((wchar_t *)lParam); mir_free((void *)lParam); break; case CPT_DATAW: updateData((POPUPDATAW_V2 *)lParam); mir_free((void *)lParam); break; } update(); diff --git a/plugins/Popup/src/popup_wnd2.h b/plugins/Popup/src/popup_wnd2.h index 7e0af55bd4..96bf23ff97 100644 --- a/plugins/Popup/src/popup_wnd2.h +++ b/plugins/Popup/src/popup_wnd2.h @@ -54,13 +54,13 @@ private: // content TextType m_textType; - TCHAR *m_lptzTitle, *m_lptzText; + wchar_t *m_lptzTitle, *m_lptzText; HANDLE m_mtTitle, m_mtText; bool m_bTextEmpty, m_bIcoLib; HFONT m_hfnTitle, m_hfnText; HICON m_hIcon; HBITMAP m_hbmAvatar; - TCHAR m_time[2 + 1 + 2 + 1]; + wchar_t m_time[2 + 1 + 2 + 1]; ActionInfo* m_actions; int m_actionCount; HANDLE m_hNotification; @@ -131,8 +131,8 @@ public: void updateData(POPUPDATAW_V2 *ppd); void updateData(POPUPDATA2 *ppd); void buildMText(); - void updateText(TCHAR *text); - void updateTitle(TCHAR *title); + void updateText(wchar_t *text); + void updateTitle(wchar_t *title); void updateTimer(); @@ -146,15 +146,15 @@ public: bool isTextEmpty() { return m_bTextEmpty; } bool isIcolib() { return m_bIcoLib; } TextType getTextType() { return m_textType; } - TCHAR *getText() { return m_lptzText; } + wchar_t *getText() { return m_lptzText; } HANDLE getTextM() { return m_mtText; } - TCHAR *getTitle() { return m_lptzTitle; } + wchar_t *getTitle() { return m_lptzTitle; } HANDLE getTitleM() { return m_mtTitle; } int getActionCount() { return m_actionCount; } ActionInfo *getActions() { return m_actions; } - TCHAR *getTime() { return m_time; } + wchar_t *getTime() { return m_time; } HICON getIcon() { return m_hIcon; } MCONTACT getContact() { return m_hContact; } MCONTACT getContactPassed() { return m_hContactPassed; } @@ -210,8 +210,8 @@ public: LRESULT m_updateData_POPUPDATAW_V2(LPARAM arg) { updateData((POPUPDATAW_V2 *)arg); update(); return 0; } LRESULT m_updateData_POPUPDATA2(LPARAM arg) { updateData((POPUPDATA2 *)arg); update(); return 0; } - LRESULT m_updateText(LPARAM arg) { updateText((TCHAR *)arg); update(); return 0; } - LRESULT m_updateTitle(LPARAM arg) { updateTitle((TCHAR *)arg); update(); return 0; } + LRESULT m_updateText(LPARAM arg) { updateText((wchar_t *)arg); update(); return 0; } + LRESULT m_updateTitle(LPARAM arg) { updateTitle((wchar_t *)arg); update(); return 0; } LRESULT m_show(LPARAM) { show(); return 0; } LRESULT m_hide(LPARAM) { hide(); return 0; } diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index ce5b1da030..676ac0beab 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -237,7 +237,7 @@ INT_PTR Popup_ShowMessageW(WPARAM wParam, LPARAM lParam) POPUPDATA2 ppd2 = { 0 }; ppd2.cbSize = sizeof(ppd2); ppd2.flags = PU2_UNICODE; - ppd2.lptzText = (TCHAR*)wParam; + ppd2.lptzText = (wchar_t*)wParam; switch (lParam & 0x7fffffff) { case SM_ERROR: ppd2.lchIcon = LoadIconEx(IDI_MB_STOP, 0); @@ -381,13 +381,13 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorText = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, fonts.clText/*pc->colorText*/); FontIDT fid = { 0 }; fid.cbSize = sizeof(FontIDT); - mir_sntprintf(fid.group, _T(PU_FNT_AND_COLOR)L"/%S", ptd->pupClass.pszName); + mir_sntprintf(fid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName); mir_strncpy(fid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup) - 1); fid.flags = FIDF_DEFAULTVALID; fid.deffontsettings.charset = DEFAULT_CHARSET; fid.deffontsettings.size = -11; mir_tstrncpy(fid.deffontsettings.szFace, L"Verdana", _countof(fid.deffontsettings.szFace) - 1); - mir_tstrncpy(fid.name, _T(PU_FNT_NAME_TEXT), _countof(fid.name) - 1); + mir_tstrncpy(fid.name, PU_FNT_NAME_TEXT, _countof(fid.name) - 1); mir_strncpy(fid.prefix, setting, _countof(fid.prefix)); mir_snprintf(fid.prefix, "%s/Text", ptd->pupClass.pszName); // result is "%s/TextCol" fid.deffontsettings.style = 0; @@ -399,7 +399,7 @@ INT_PTR Popup_RegisterPopupClass(WPARAM, LPARAM lParam) ptd->pupClass.colorBack = (COLORREF)db_get_dw(NULL, PU_MODULCLASS, setting, (DWORD)fonts.clBack/*pc->colorBack*/); ColourIDT cid = { 0 }; cid.cbSize = sizeof(ColourIDT); - mir_sntprintf(cid.group, _T(PU_FNT_AND_COLOR)L"/%S", ptd->pupClass.pszName); + mir_sntprintf(cid.group, _A2W(PU_FNT_AND_COLOR) L"/%S", ptd->pupClass.pszName); mir_strncpy(cid.dbSettingsGroup, PU_MODULCLASS, _countof(fid.dbSettingsGroup)); mir_tstrncpy(cid.name, PU_COL_BACK_NAME, _countof(cid.name)); mir_snprintf(cid.setting, "%s/BgCol", ptd->pupClass.pszName); @@ -457,8 +457,8 @@ INT_PTR Popup_CreateClassPopup(WPARAM wParam, LPARAM lParam) ppd2.PluginWindowProc = pc->PluginWindowProc; if (pc->flags & PCF_UNICODE) { ppd2.flags = PU2_UNICODE; - ppd2.lptzTitle = (TCHAR*)pdc->ptszTitle; - ppd2.lptzText = (TCHAR*)pdc->ptszText; + ppd2.lptzTitle = (wchar_t*)pdc->pwszTitle; + ppd2.lptzText = (wchar_t*)pdc->pwszText; } else { ppd2.flags = PU2_ANSI; diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 96913d57cf..242bf7b4c2 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -62,7 +62,7 @@ SIZE PopupSkin::measureAction(HDC hdc, POPUPACTION *act) const SIZE szText, szSpace; LPTSTR wname = mir_a2t(name); - TCHAR *str = TranslateTS(wname); + wchar_t *str = TranslateTS(wname); GetTextExtentPoint32(hdc, str, (int)mir_tstrlen(str), &szText); mir_free(wname); GetTextExtentPoint32(hdc, L" ", 1, &szSpace); @@ -125,7 +125,7 @@ void PopupSkin::drawAction(MyBitmap *bmp, POPUPACTION *act, int x, int y, bool h GetTextExtentPoint32(bmp->getDC(), L" ", 1, &szSpace); LPTSTR wname = mir_a2t(name); - TCHAR *str = TranslateTS(wname); + wchar_t *str = TranslateTS(wname); GetTextExtentPoint32(bmp->getDC(), str, (int)mir_tstrlen(str), &szText); bmp->Draw_Text(str, (PopupOptions.actions&ACT_LARGE) ? (x + szSpace.cx + 32) : (x + szSpace.cx + 16), @@ -185,7 +185,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options SIZE szNew; szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT]; szNew.cy = head->myBmp->getHeight(); - for (TCHAR *p = wnd->getTime(); *p; p++) { + for (wchar_t *p = wnd->getTime(); *p; p++) { if (*p == ':') szNew.cx += head->clocksize[CLOCK_SEPARATOR]; else if ((*p >= '0') && (*p <= '9')) @@ -333,7 +333,7 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options if (head && head->myBmp) { szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT]; szNew.cy = head->myBmp->getHeight(); - for (TCHAR *p = wnd->getTime(); *p; p++) { + for (wchar_t *p = wnd->getTime(); *p; p++) { if (*p == ':') szNew.cx += head->clocksize[CLOCK_SEPARATOR]; else if ((*p >= '0') && (*p <= '9')) @@ -429,7 +429,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW SIZE szNew; szNew.cx = head->clocksize[CLOCK_LEFT] + head->clocksize[CLOCK_RIGHT]; szNew.cy = head->myBmp->getHeight(); - for (TCHAR *p = wnd->getTime(); *p; p++) { + for (wchar_t *p = wnd->getTime(); *p; p++) { if (*p == ':') szNew.cx += head->clocksize[CLOCK_SEPARATOR]; else if ((*p >= '0') && (*p <= '9')) @@ -661,7 +661,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, DW bmp->BlendPart(head->myBmp, head->clockstart[CLOCK_LEFT], 0, head->clocksize[CLOCK_LEFT], sy, x, y, head->clocksize[CLOCK_LEFT], sy); x += head->clocksize[CLOCK_LEFT]; - for (TCHAR *p = wnd->getTime(); *p; p++) { + for (wchar_t *p = wnd->getTime(); *p; p++) { int clock_idx = -1; if (*p == ':') clock_idx = CLOCK_SEPARATOR; @@ -741,7 +741,7 @@ bool PopupSkin::onMouseLeave(PopupWnd2 *wnd) const void PopupSkin::loadOptions(std::wistream &f) { - TCHAR *buf = new TCHAR[1024]; + wchar_t *buf = new wchar_t[1024]; while (!f.eof()) { f >> buf; if (*buf == '#') { @@ -755,10 +755,10 @@ void PopupSkin::loadOptions(std::wistream &f) id--; if (m_flag_names[id]) mir_free(m_flag_names[id]); - TCHAR *p = buf; + wchar_t *p = buf; while (isspace(*p)) p++; - TCHAR *q = p + mir_tstrlen(p) - 1; + wchar_t *q = p + mir_tstrlen(p) - 1; while ((q >= p) && isspace(*q)) *q-- = 0; m_flag_names[id] = mir_t2a(p); @@ -783,11 +783,11 @@ bool PopupSkin::load(LPCTSTR dir) } m_flags = 0; - if (!_tcsncmp(L"res:", dir, 4)) // resource + if (!wcsncmp(L"res:", dir, 4)) // resource loadSkin(dir + 4, L"Skin"); else { // filesystem // skin info - TCHAR dir_save[1024]; + wchar_t dir_save[1024]; GetCurrentDirectory(1024, dir_save); SetCurrentDirectory(dir); @@ -829,7 +829,7 @@ void PopupSkin::loadSkin(std::wistream &f) head->next = NULL; while (!f.eof()) { - TCHAR buf[1024]; + wchar_t buf[1024]; f >> buf; if (!*buf) @@ -900,7 +900,7 @@ void PopupSkin::loadSkin(LPCTSTR lpName, LPCTSTR lpType) HRSRC hRes = FindResource(hInst, lpName, lpType); HRSRC hResLoad = (HRSRC)LoadResource(hInst, hRes); char *lpResLock = (char *)LockResource(hResLoad); - std::wistringstream stream((TCHAR*)_A2T(lpResLock)); + std::wistringstream stream((wchar_t*)_A2T(lpResLock)); loadSkin(stream); UnlockResource(lpResLock); FreeResource(hRes); @@ -917,7 +917,7 @@ PopupSkin::SKINELEMENT *PopupSkin::loadObject(std::wistream &f) element->myBmp = NULL; while (!f.eof()) { - TCHAR buf[1024]; + wchar_t buf[1024]; f >> buf; if (!*buf) @@ -1087,11 +1087,11 @@ bool Skins::load() skin->next = m_skins; m_skins = skin; m_skins->name = mir_tstrdup(L"* Popup Classic"); - m_skins->dir = new TCHAR[1024]; + m_skins->dir = new wchar_t[1024]; mir_tstrcpy(m_skins->dir, L"res:classic.popupskin"); m_skins->skin = 0; - TCHAR dir[1024] = { '\0' }; + wchar_t dir[1024] = { '\0' }; if (ServiceExists(MS_FOLDERS_GET_PATH)) { if (FoldersGetCustomPathT(folderId, dir, _countof(dir), NULL) != 0) @@ -1104,7 +1104,7 @@ bool Skins::load() return false; } - TCHAR dir_save[1024]; + wchar_t dir_save[1024]; GetCurrentDirectory(1024, dir_save); SetCurrentDirectory(dir); @@ -1118,7 +1118,7 @@ bool Skins::load() skin->next = m_skins; m_skins = skin; m_skins->name = mir_tstrdup(ffd.cFileName); - m_skins->dir = new TCHAR[1024]; + m_skins->dir = new wchar_t[1024]; GetCurrentDirectory(1024, m_skins->dir); m_skins->skin = 0; @@ -1158,7 +1158,7 @@ const PopupSkin *Skins::getSkin(LPCTSTR name) if (!any->skin->isCompatible()) MessageBox(NULL, TranslateT("The skin you are trying to load is designed\r\nfor newer version of Popup plus. And will not\r\ndisplay properly.\r\n\r\nPlease choose another skin."), - _T(MODULNAME_LONG), MB_ICONSTOP | MB_OK); + MODULNAME_LONG, MB_ICONSTOP | MB_OK); return any->skin; } diff --git a/plugins/Popup/src/stdafx.h b/plugins/Popup/src/stdafx.h index bc6507a35f..044916d971 100644 --- a/plugins/Popup/src/stdafx.h +++ b/plugins/Popup/src/stdafx.h @@ -129,8 +129,9 @@ http://miranda-ng.org/distr/ #define PU_MODULCLASS "PopupCLASS" // temp DB modul for this plugin #define MODULNAME "Popup" -#define MODULNAME_LONG "Popup Plus" +#define MODULNAME_LONG L"Popup Plus" #define MODULNAME_PLU "Popups" +#define MODULNAME_PLUW L"Popups" INT_PTR svcEnableDisableMenuCommand(WPARAM, LPARAM); -- cgit v1.2.3